instruction
stringclasses
1 value
input
stringlengths
56
241k
output
int64
0
1
__index_level_0__
int64
0
175k
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int assign_eip_far(struct x86_emulate_ctxt *ctxt, ulong dst, const struct desc_struct *cs_desc) { enum x86emul_mode mode = ctxt->mode; #ifdef CONFIG_X86_64 if (ctxt->mode >= X86EMUL_MODE_PROT32 && cs_desc->l) { u64 efer = 0; ctxt->ops->get_msr(ctxt, MSR_EFER, &efer); if (efer & EFER_LMA) ...
0
45,016
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gsicc_profile_serialize(gsicc_serialized_profile_t *profile_data, cmm_profile_t *icc_profile) { if (icc_profile == NULL) return; memcpy(profile_data, icc_profile, GSICC_SERIALIZED_SIZE); } Commit Message: CWE ID: CWE-20
0
13,989
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xsltFreeKeyDefList(xsltKeyDefPtr keyd) { xsltKeyDefPtr cur; while (keyd != NULL) { cur = keyd; keyd = keyd->next; xsltFreeKeyDef(cur); } } Commit Message: Roll libxslt to 891681e3e948f31732229f53cb6db7215f740fc7 BUG=583156,583171 Review URL: https://codereview.chromium.org/1853083002 Cr-Commit...
0
156,739
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: LayoutUnit RenderFlexibleBox::computeChildMarginValue(Length margin) { LayoutUnit availableSize = contentLogicalWidth(); return minimumValueForLength(margin, availableSize); } Commit Message: Separate repaint and layout requirements of StyleDifference (Step 1) Previously StyleDifference was an enum that...
0
116,646
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static PHP_FUNCTION(session_save_path) { char *name = NULL; int name_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &name, &name_len) == FAILURE) { return; } RETVAL_STRING(PS(save_path), 1); if (name) { if (memchr(name, '\0', name_len) != NULL) { php_error_docref(NULL TSRMLS_CC, E...
0
9,583
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void PrepareDelegateForCreation( std::unique_ptr<AudioOutputDelegate> delegate) { ASSERT_EQ(nullptr, delegate_); delegate_.swap(delegate); } Commit Message: Correct mojo::WrapSharedMemoryHandle usage Fixes some incorrect uses of mojo::WrapSharedMemoryHandle which were assuming that the call ac...
0
149,554
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: reverseSamples8bits (uint16 spp, uint16 bps, uint32 width, uint8 *ibuff, uint8 *obuff) { int ready_bits = 0; uint32 col; uint32 src_byte, src_bit; uint32 bit_offset = 0; uint8 match_bits = 0, mask_bits = 0; uint8 buff1 = 0, buff2 = 0; unsigned char *src; un...
0
48,277
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void Update(BytesConsumer* consumer) { DCHECK(!underlying_); if (is_cancelled_) { return; } underlying_ = consumer; if (client_) { Client* client = client_; client_ = nullptr; underlying_->SetClient(client); if (GetPublicState() != PublicState::kReadableOrWaiti...
0
154,247
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int __net_init pfkey_init_proc(struct net *net) { struct proc_dir_entry *e; e = proc_create("pfkey", 0, net->proc_net, &pfkey_proc_ops); if (e == NULL) return -ENOMEM; return 0; } Commit Message: af_key: initialize satype in key_notify_policy_flush() This field was left uninitialized. Some user d...
0
31,426
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static inline int kvm_apic_id(struct kvm_lapic *apic) { return (kvm_apic_get_reg(apic, APIC_ID) >> 24) & 0xff; } Commit Message: KVM: x86: fix guest-initiated crash with x2apic (CVE-2013-6376) A guest can cause a BUG_ON() leading to a host kernel crash. When the guest writes to the ICR to request an IPI, whi...
0
28,750
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: StateBase* writeFile(v8::Handle<v8::Value> value, StateBase* next) { File* file = V8File::toNative(value.As<v8::Object>()); if (!file) return 0; if (file->hasBeenClosed()) return handleError(DataCloneError, "A File object has been closed, and could therefo...
1
171,651
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: _callerid_find_job(callerid_conn_t conn, uint32_t *job_id) { ino_t inode; pid_t pid; int rc; rc = callerid_find_inode_by_conn(conn, &inode); if (rc != SLURM_SUCCESS) { debug3("network_callerid inode not found"); return ESLURM_INVALID_JOB_ID; } debug3("network_callerid found inode %lu", (long unsigned ...
0
72,053
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: autofill::RegionDataLoader* PaymentRequestState::GetRegionDataLoader() { return payment_request_delegate_->GetRegionDataLoader(); } Commit Message: [Payment Handler] Don't wait for response from closed payment app. Before this patch, tapping the back button on top of the payment handler window on desktop woul...
0
151,145
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void RemoveICCProfileFromResourceBlock(StringInfo *bim_profile) { register const unsigned char *p; size_t length; unsigned char *datum; unsigned int count, long_sans; unsigned short id, short_sans; length=GetStringInfoLength(bim_profile); if (length < 16) ...
1
168,789
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void AutofillPopupItemView::CreateContent() { AutofillPopupController* controller = popup_view_->controller(); auto* layout_manager = SetLayoutManager(std::make_unique<views::BoxLayout>( views::BoxLayout::kHorizontal, gfx::Insets(0, GetHorizontalMargin()))); layout_manager->set_cross_axis_alignment(...
0
130,540
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static uint32_t GetURLLoaderOptions(bool is_main_frame) { uint32_t options = network::mojom::kURLLoadOptionNone; options |= network::mojom::kURLLoadOptionSniffMimeType; if (is_main_frame) { options |= network::mojom::kURLLoadOptionSendSSLInfoWithResponse; options |= network::mojom::kUR...
0
145,371
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SYSCALL_DEFINE5(renameat2, int, olddfd, const char __user *, oldname, int, newdfd, const char __user *, newname, unsigned int, flags) { struct dentry *old_dir, *new_dir; struct dentry *old_dentry, *new_dentry; struct dentry *trap; struct nameidata oldnd, newnd; struct inode *delegated_inode = NULL; struct...
0
36,288
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int read_gab2_sub(AVFormatContext *s, AVStream *st, AVPacket *pkt) { if (pkt->size >= 7 && pkt->size < INT_MAX - AVPROBE_PADDING_SIZE && !strcmp(pkt->data, "GAB2") && AV_RL16(pkt->data + 5) == 2) { uint8_t desc[256]; int score = AVPROBE_SCORE_EXTENSION, ret; ...
1
168,073
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: qtdemux_tag_add_blob (GNode * node, GstQTDemux * demux) { gint len; guint8 *data; GstBuffer *buf; gchar *media_type, *style; GstCaps *caps; data = node->data; len = QT_UINT32 (data); buf = gst_buffer_new_and_alloc (len); memcpy (GST_BUFFER_DATA (buf), data, len); /* heuristic to determine st...
0
4,975
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: const AtomicString& Element::webkitRegionOverset() const { document()->updateLayoutIgnorePendingStylesheets(); DEFINE_STATIC_LOCAL(AtomicString, undefinedState, ("undefined", AtomicString::ConstructFromLiteral)); if (!RuntimeEnabledFeatures::cssRegionsEnabled() || !renderRegion()) return unde...
0
112,432
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool WebContentsImpl::IsHidden() { return capturer_count_ == 0 && !should_normally_be_visible_; } Commit Message: Cancel JavaScript dialogs when an interstitial appears. BUG=295695 TEST=See bug for repro steps. Review URL: https://chromiumcodereview.appspot.com/24360011 git-svn-id: svn://svn.chromium.org/ch...
0
110,694
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int check_ld_imm(struct bpf_verifier_env *env, struct bpf_insn *insn) { struct bpf_reg_state *regs = cur_regs(env); int err; if (BPF_SIZE(insn->code) != BPF_DW) { verbose(env, "invalid BPF_LD_IMM insn\n"); return -EINVAL; } if (insn->off != 0) { verbose(env, "BPF_LD_IMM64 uses reserved fields\n...
0
59,114
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int sctp_setsockopt_connectx(struct sock *sk, struct sockaddr __user *addrs, int addrs_size) { sctp_assoc_t assoc_id = 0; int err = 0; err = __sctp_setsockopt_connectx(sk, addrs, addrs_size, &assoc_id); if (err) return err; else return assoc_id; } Commit Message: sctp: fix ASCON...
0
43,568
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: decompileDEFINEFUNCTION(int n, SWF_ACTION *actions, int maxn, int is_type2) { int i,j,k,m,r; struct SWF_ACTIONPUSHPARAM *myregs[ 256 ]; struct _stack *StackSave; struct SWF_ACTIONDEFINEFUNCTION2 *sactv2; struct strbufinfo origbuf; OUT_BEGIN2(SWF_ACTIONDEFINEFUNCTION); sactv2 = (struct SWF_ACTIONDEFINEF...
0
89,490
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: lookup(XML_Parser parser, HASH_TABLE *table, KEY name, size_t createSize) { size_t i; if (table->size == 0) { size_t tsize; if (!createSize) return NULL; table->power = INIT_POWER; /* table->size is a power of 2 */ table->size = (size_t)1 << INIT_POWER; tsize = table->size * size...
0
92,345
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func) { xmlDeregisterNodeFunc old = xmlDeregisterNodeDefaultValue; __xmlRegisterCallbacks = 1; xmlDeregisterNodeDefaultValue = func; return(old); } Commit Message: Attempt to address libxml crash. BUG=129930 Review URL: https://chromiumcoderevi...
0
107,319
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MagickExport unsigned char *ImageToBlob(const ImageInfo *image_info, Image *image,size_t *length,ExceptionInfo *exception) { const MagickInfo *magick_info; ImageInfo *blob_info; MagickBooleanType status; unsigned char *blob; assert(image_info != (const ImageInfo *) NULL); assert(...
0
88,524
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int refresh_total_sectors(BlockDriverState *bs, int64_t hint) { BlockDriver *drv = bs->drv; /* Do not attempt drv->bdrv_getlength() on scsi-generic devices */ if (bs->sg) return 0; /* query actual device if possible, otherwise just trust the hint */ if (drv->bdrv_getlength) { ...
0
16,913
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void airspy_cleanup_queued_bufs(struct airspy *s) { unsigned long flags; dev_dbg(s->dev, "\n"); spin_lock_irqsave(&s->queued_bufs_lock, flags); while (!list_empty(&s->queued_bufs)) { struct airspy_frame_buf *buf; buf = list_entry(s->queued_bufs.next, struct airspy_frame_buf, list); list_de...
0
51,653
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void vmx_deliver_posted_interrupt(struct kvm_vcpu *vcpu, int vector) { struct vcpu_vmx *vmx = to_vmx(vcpu); int r; r = vmx_deliver_nested_posted_interrupt(vcpu, vector); if (!r) return; if (pi_test_and_set_pir(vector, &vmx->pi_desc)) return; /* If a previous notification has sent the IPI, noth...
0
63,033
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static gboolean OnFocusIn(GtkWidget* widget, GdkEventFocus* focus, RenderWidgetHostViewGtk* host_view) { host_view->ShowCurrentCursor(); RenderWidgetHostImpl* host = RenderWidgetHostImpl::From(host_view->GetRenderWidgetHost()); host->Go...
0
114,977
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void kvm_arch_commit_memory_region(struct kvm *kvm, struct kvm_userspace_memory_region *mem, struct kvm_memory_slot old, int user_alloc) { return; } Commit Message: KVM: Ensure all vcpus are consistent with in-kernel irqchip settings (cherry picked from commit 3e515705a1f46beb1c942bb8043c16f8ac7b1e9e) I...
0
20,579
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void GraphicsContext3DPrivate::blitMultisampleFramebufferAndRestoreContext() const { if (!m_context->m_attrs.antialias) return; const QOpenGLContext* currentContext = QOpenGLContext::currentContext(); QSurface* currentSurface = 0; if (currentContext && currentContext != m_platformContext)...
0
107,377
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void *binary_hickup_recv_verification_thread(void *arg) { protocol_binary_response_no_extras *response = malloc(65*1024); if (response != NULL) { while (safe_recv_packet(response, 65*1024)) { /* Just validate the packet format */ validate_response_header(response, ...
0
94,221
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static v8::Handle<v8::Value> GetExtensionViews(const v8::Arguments& args) { if (args.Length() != 2) return v8::Undefined(); if (!args[0]->IsInt32() || !args[1]->IsString()) return v8::Undefined(); int browser_window_id = args[0]->Int32Value(); std::string view_type_string = *v8::S...
0
99,810
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Extension::PermissionMessage Extension::PermissionMessage::CreateFromMessageId( Extension::PermissionMessage::MessageId message_id) { DCHECK_GT(PermissionMessage::ID_NONE, PermissionMessage::ID_UNKNOWN); if (message_id <= ID_NONE) return PermissionMessage(message_id, string16()); string16 message =...
0
99,975
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void RenderFrameImpl::WasShown() { for (auto& observer : observers_) observer.WasShown(); #if BUILDFLAG(ENABLE_PLUGINS) for (auto* plugin : active_pepper_instances_) plugin->PageVisibilityChanged(true); #endif // ENABLE_PLUGINS if (GetWebFrame()->FrameWidget()) { GetWebFrame()->FrameWidget()-...
0
147,936
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static XMP_Uns16 GetMacLang ( std::string * xmpLang ) { if ( *xmpLang == "" ) return kNoMacLang; size_t hyphenPos = xmpLang->find ( '-' ); // Make sure the XMP language is "generic". if ( hyphenPos != std::string::npos ) xmpLang->erase ( hyphenPos ); for ( XMP_Uns16 i = 0; i <= 94; ++i ) { // Using std::m...
0
15,896
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: nfs3svc_decode_readdirplusargs(struct svc_rqst *rqstp, __be32 *p, struct nfsd3_readdirargs *args) { int len; u32 max_blocksize = svc_max_payload(rqstp); p = decode_fh(p, &args->fh); if (!p) return 0; p = xdr_decode_hyper(p, &args->cookie); args->verf = p; p += 2; args->dircount = ntohl(*p++); ...
1
168,142
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool RenderView::RendererAccessibilityNotification::ShouldIncludeChildren() { typedef ViewHostMsg_AccessibilityNotification_Params params; if (type == WebKit::WebAccessibilityNotificationChildrenChanged || type == WebKit::WebAccessibilityNotificationLoadComplete) { return true; } return false; }...
0
98,981
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS_EX pEntryPoints, PVOID pInitHandle) { UINT rc; drdynvcPlugin* drdynvc; DrdynvcClientContext* context = NULL; CHANNEL_ENTRY_POINTS_FREERDP_EX* pEntryPointsEx; drdynvc = (drdynvcPlugin*) calloc(1, sizeof(drdynvcPlugin)); if (!drdynvc) { WLog_ERR(T...
0
74,954
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: FakeBluetoothAgentManagerClient::GetAgentServiceProvider() { return service_provider_; } Commit Message: Refactor to support default Bluetooth pairing delegate In order to support a default pairing delegate we need to move the agent service provider delegate implementation from BluetoothDevice to BluetoothAda...
0
112,497
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: cc::EffectTree& PropertyTreeManager::GetEffectTree() { return property_trees_.effect_tree; } Commit Message: Reland "[CI] Make paint property nodes non-ref-counted" This reverts commit 887383b30842d9d9006e11bb6932660a3cb5b1b7. Reason for revert: Retry in M69. Original change's description: > Revert "[CI] Ma...
0
125,610
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int codeTriggerProgram( Parse *pParse, /* The parser context */ TriggerStep *pStepList, /* List of statements inside the trigger body */ int orconf /* Conflict algorithm. (OE_Abort, etc) */ ){ TriggerStep *pStep; Vdbe *v = pParse->pVdbe; sqlite3 *db = pParse->db; ...
0
136,418
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: archive_read_format_zip_seekable_read_header(struct archive_read *a, struct archive_entry *entry) { struct zip *zip = (struct zip *)a->format->data; struct zip_entry *rsrc; int64_t offset; int r, ret = ARCHIVE_OK; /* * It should be sufficient to call archive_read_next_header() for * a reader to determi...
0
55,704
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static inline void net_tx_pkt_sendv(struct NetTxPkt *pkt, NetClientState *nc, const struct iovec *iov, int iov_cnt) { if (pkt->is_loopback) { nc->info->receive_iov(nc, iov, iov_cnt); } else { qemu_sendv_packet(nc, iov, iov_cnt); } } Commit Message: CWE ID: CWE-190
0
8,968
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int mov_read_stsz(MOVContext *c, AVIOContext *pb, MOVAtom atom) { AVStream *st; MOVStreamContext *sc; unsigned int i, entries, sample_size, field_size, num_bytes; GetBitContext gb; unsigned char* buf; int ret; if (c->fc->nb_streams < 1) return 0; st = c->fc->streams...
0
61,466
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: zisofs_free(struct archive_write *a) { (void)a; /* UNUSED */ return (ARCHIVE_OK); } Commit Message: Issue 711: Be more careful about verifying filename lengths when writing ISO9660 archives * Don't cast size_t to int, since this can lead to overflow on machines where sizeof(int) < sizeof(size_t) * Check a ...
0
50,910
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) { int al, i, j, ret; unsigned int n; SSL3_RECORD *rr; void (*cb) (const SSL *ssl, int type2, int val) = NULL; if (s->s3->rbuf.buf == NULL) /* Not initialized yet */ if (!ssl3_setup_read_buffer(s)) ...
1
165,140
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: IMPEG2D_ERROR_CODES_T impeg2d_dec_pic_coding_ext(dec_state_t *ps_dec) { stream_t *ps_stream; IMPEG2D_ERROR_CODES_T e_error = (IMPEG2D_ERROR_CODES_T) IV_SUCCESS; ps_stream = &ps_dec->s_bit_stream; impeg2d_bit_stream_flush(ps_stream,START_CODE_LEN); /* extension code identifier */ impeg2d_bit_str...
0
162,940
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void ExpectFilledTestForm() { ExpectFieldValue("firstname", "Milton"); ExpectFieldValue("lastname", "Waddams"); ExpectFieldValue("address1", "4120 Freidrich Lane"); ExpectFieldValue("address2", "Basement"); ExpectFieldValue("city", "Austin"); ExpectFieldValue("state", "TX"); ExpectFi...
0
112,158
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void PluginService::PurgePluginListCache(BrowserContext* browser_context, bool reload_pages) { for (RenderProcessHost::iterator it = RenderProcessHost::AllHostsIterator(); !it.IsAtEnd(); it.Advance()) { RenderProcessHost* host = it.GetCurrentValue(); if (!...
0
116,796
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xfs_attr_rmtval_get( struct xfs_da_args *args) { struct xfs_bmbt_irec map[ATTR_RMTVALUE_MAPSIZE]; struct xfs_mount *mp = args->dp->i_mount; struct xfs_buf *bp; xfs_dablk_t lblkno = args->rmtblkno; __uint8_t *dst = args->value; int valuelen = args->valuelen; int nmap; int error; int blkc...
1
166,739
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void iucv_process_message(struct sock *sk, struct sk_buff *skb, struct iucv_path *path, struct iucv_message *msg) { int rc; unsigned int len; len = iucv_msg_length(msg); /* store msg target class in the second 4 bytes of skb ctrl buffer */ /* Note: the first 4 bytes are reserved for msg ta...
0
30,604
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int vol_effect_process(effect_handle_t self, audio_buffer_t *in_buffer, audio_buffer_t *out_buffer) { int status = 0; ALOGV("%s Called ", __func__); vol_listener_context_t *context = (vol_listener_context_t *)self; pthread_mutex_lock(&vol_listner_init_lock); if (context->state != VOL_LISTENE...
0
161,563
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool AppCacheDatabase::FindResponseIdsForCacheHelper( int64_t cache_id, std::vector<int64_t>* ids_vector, std::set<int64_t>* ids_set) { DCHECK(ids_vector || ids_set); DCHECK(!(ids_vector && ids_set)); if (!LazyOpen(kDontCreate)) return false; static const char kSql[] = "SELECT respo...
0
151,285
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void Np_toFixed(js_State *J) { js_Object *self = js_toobject(J, 0); int width = js_tointeger(J, 1); char buf[32]; double x; if (self->type != JS_CNUMBER) js_typeerror(J, "not a number"); if (width < 0) js_rangeerror(J, "precision %d out of range", width); if (width > 20) js_rangeerror(J, "precision ...
0
90,739
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void ib_uverbs_detach_umcast(struct ib_qp *qp, struct ib_uqp_object *uobj) { struct ib_uverbs_mcast_entry *mcast, *tmp; list_for_each_entry_safe(mcast, tmp, &uobj->mcast_list, list) { ib_detach_mcast(qp, &mcast->gid, mcast->lid); list_del(&mcast->list); kfree(mcast); } } Commit Message: ...
0
52,888
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: views::View* AutofillPopupSuggestionView::CreateSubtextLabel() { if (GetLayoutType() != PopupItemLayoutType::kTwoLinesLeadingIcon) return AutofillPopupItemView::CreateSubtextLabel(); base::string16 label_text = popup_view_->controller()->GetSuggestionAt(line_number_).additional_label; if (label_t...
0
130,549
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void cassignforin(JF, js_Ast *stm) { js_Ast *lhs = stm->a; if (stm->type == STM_FOR_IN_VAR) { if (lhs->b) jsC_error(J, lhs->b, "more than one loop variable in for-in statement"); emitlocal(J, F, OP_SETLOCAL, OP_SETVAR, lhs->a->a); /* list(var-init(ident)) */ emit(J, F, OP_POP); return; } s...
0
7,899
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address, unsigned int fault) { struct task_struct *tsk = current; struct mm_struct *mm = tsk->mm; int code = BUS_ADRERR; up_read(&mm->mmap_sem); /* Kernel mode? Handle exceptions or die: */ if (!(error_code & PF_USER)) { no_conte...
0
25,932
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void EnterNamespaceSandbox(LinuxSandbox* linux_sandbox, base::Closure* post_fork_parent_callback) { linux_sandbox->EngageNamespaceSandbox(); if (getpid() == 1) { base::Closure drop_all_caps_callback = base::Bind(&DropAllCapabilities, linux_sandbox->proc_fd...
0
150,259
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void read_fsinfo(DOS_FS * fs, struct boot_sector *b, int lss) { struct info_sector i; if (!b->info_sector) { printf("No FSINFO sector\n"); if (interactive) printf("1) Create one\n2) Do without FSINFO\n"); else printf(" Not automatically creating it.\n"); if (interactive && get_key("...
0
52,673
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void CameraSourceListener::postDataTimestamp( nsecs_t timestamp, int32_t msgType, const sp<IMemory>& dataPtr) { sp<CameraSource> source = mSource.promote(); if (source.get() != NULL) { source->dataCallbackTimestamp(timestamp/1000, msgType, dataPtr); } } Commit Message: DO NOT MERGE: Camera: Adjus...
0
159,350
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static NodeInfo *GetNodeInfo(CubeInfo *cube_info,const size_t id, const size_t level,NodeInfo *parent) { NodeInfo *node_info; if (cube_info->free_nodes == 0) { Nodes *nodes; /* Allocate a new queue of nodes. */ nodes=(Nodes *) AcquireMagickMemory(sizeof(*nod...
0
62,710
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: InspectorStyleRecalcInvalidationTrackingEvent::Data( Node* node, const StyleChangeReasonForTracing& reason) { DCHECK(node); std::unique_ptr<TracedValue> value = TracedValue::Create(); value->SetString("frame", ToHexString(node->GetDocument().GetFrame())); SetNodeInfo(value.get(), node, "nodeId", ...
0
138,614
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Status IndexedDBDatabase::GetOperation( int64_t object_store_id, int64_t index_id, std::unique_ptr<IndexedDBKeyRange> key_range, indexed_db::CursorType cursor_type, scoped_refptr<IndexedDBCallbacks> callbacks, IndexedDBTransaction* transaction) { IDB_TRACE1("IndexedDBDatabase::GetOperati...
0
155,449
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: decode_OFPAT_RAW_SET_NW_SRC(ovs_be32 ipv4, enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *out) { ofpact_put_SET_IPV4_SRC(out)->ipv4 = ipv4; return 0; } Commit Message: ofp-actions: Avoid buffer overread in BUNDLE action decoding. Reported-...
0
76,842
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void reset_stats() { num_invocations_ = 0; } Commit Message: ash: Make UserActivityDetector ignore synthetic mouse events This may have been preventing us from suspending (e.g. mouse event is synthesized in response to lock window being shown so Chrome tells powerd that the user is active). BUG=133419 TEST=a...
0
103,211
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static struct mm_struct * mm_init(struct mm_struct * mm, struct task_struct *p) { atomic_set(&mm->mm_users, 1); atomic_set(&mm->mm_count, 1); init_rwsem(&mm->mmap_sem); INIT_LIST_HEAD(&mm->mmlist); mm->flags = (current->mm) ? (current->mm->flags & MMF_INIT_MASK) : default_dump_filter; mm->core_state = NUL...
0
22,273
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: helpFile(char *base) { return expandPath(Strnew_m_charp(w3m_help_dir(), "/", base, NULL)->ptr); } Commit Message: Make temporary directory safely when ~/.w3m is unwritable CWE ID: CWE-59
0
84,559
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ber_parse_header(STREAM s, int tagval, int *length) { int tag, len; if (tagval > 0xff) { in_uint16_be(s, tag); } else { in_uint8(s, tag); } if (tag != tagval) { logger(Core, Error, "ber_parse_header(), expected tag %d, got %d", tagval, tag); return False; } in_uint8(s, len); if (len & 0...
1
169,794
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void test_global_rules() { assert_true_rule( "global private rule global_rule { \ condition: \ true \ } \ rule test { \ condition: true \ }", NULL); assert_false_rule( "global private rule global_rule { \ condition: \ fals...
0
63,494
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: RenderFrameHostImpl::GetNavigationClientFromInterfaceProvider() { mojom::NavigationClientAssociatedPtr navigation_client_ptr; GetRemoteAssociatedInterfaces()->GetInterface(&navigation_client_ptr); return navigation_client_ptr; } Commit Message: Convert FrameHostMsg_DidAddMessageToConsole to Mojo. Note: Si...
0
139,292
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static inline void ftrace_exports_enable(void) { static_branch_enable(&ftrace_exports_enabled); } Commit Message: Merge tag 'trace-v4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing fixes from Steven Rostedt: "This contains a few fixes and a clean up. - a bad merg...
0
81,281
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void WebGL2RenderingContextBase::clearBufferfv( GLenum buffer, GLint drawbuffer, MaybeShared<DOMFloat32Array> value, GLuint src_offset) { if (isContextLost() || !ValidateClearBuffer("clearBufferfv", buffer, value.View()->length(), src_offset)) return; Scop...
0
146,629
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int get_nohz_timer_target(void) { int cpu = smp_processor_id(); int i; struct sched_domain *sd; rcu_read_lock(); for_each_domain(cpu, sd) { for_each_cpu(i, sched_domain_span(sd)) { if (!idle_cpu(i)) { cpu = i; goto unlock; } } } unlock: rcu_read_unlock(); return cpu; } Commit Message: ...
0
26,287
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: explicit NavigationHandleWatcher(WebContents* web_contents) : WebContentsObserver(web_contents) {} Commit Message: Add a check for disallowing remote frame navigations to local resources. Previously, RemoteFrame navigations did not perform any renderer-side checks and relied solely on the browser-side l...
0
143,864
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int update_open_stateid(struct nfs4_state *state, nfs4_stateid *open_stateid, nfs4_stateid *delegation, fmode_t fmode) { struct nfs_inode *nfsi = NFS_I(state->inode); struct nfs_delegation *deleg_cur; int ret = 0; fmode &= (FMODE_READ|FMODE_WRITE); rcu_read_lock(); deleg_cur = rcu_dereference(nfsi-...
0
57,278
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static inline void btif_hh_close_poll_thread(btif_hh_device_t *p_dev) { APPL_TRACE_DEBUG("%s", __FUNCTION__); p_dev->hh_keep_polling = 0; if(p_dev->hh_poll_thread_id > 0) pthread_join(p_dev->hh_poll_thread_id,NULL); return; } Commit Message: DO NOT MERGE Fix potential DoS caused by delivering ...
0
158,513
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void GLSurfaceEGLSurfaceControl::Destroy() { pending_transaction_.reset(); surface_list_.clear(); root_surface_.reset(); } Commit Message: gpu/android : Add support for partial swap with surface control. Add support for PostSubBuffer to GLSurfaceEGLSurfaceControl. This should allow the display compositor ...
0
130,866
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PHP_FUNCTION(locale_canonicalize) { get_icu_value_src_php( LOC_CANONICALIZE_TAG , INTERNAL_FUNCTION_PARAM_PASSTHRU ); } Commit Message: Fix bug #72241: get_icu_value_internal out-of-bounds read CWE ID: CWE-125
0
52,213
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int kvm_arch_init(void *opaque) { int r; struct kvm_x86_ops *ops = (struct kvm_x86_ops *)opaque; if (kvm_x86_ops) { printk(KERN_ERR "kvm: already loaded the other module\n"); r = -EEXIST; goto out; } if (!ops->cpu_has_kvm_support()) { printk(KERN_ERR "kvm: no hardware support\n"); r = -EOPNOTSUPP...
0
33,276
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xsltXPathVariableLookup(void *ctxt, const xmlChar *name, const xmlChar *ns_uri) { xsltTransformContextPtr tctxt; xmlXPathObjectPtr valueObj = NULL; if ((ctxt == NULL) || (name == NULL)) return(NULL); #ifdef WITH_XSLT_DEBUG_VARIABLE XSLT_TRACE(((xsltTransformContextPtr)ctxt),XSL...
0
156,876
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void TrimTrailingSpaces ( TIFF_Manager::TagInfo * info ) { info->dataLen = (XMP_Uns32) TrimTrailingSpaces ( (char*)info->dataPtr, (size_t)info->dataLen ); } Commit Message: CWE ID: CWE-416
0
15,994
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void DBusHelperProxy::setHelperResponder(QObject *o) { responder = o; } Commit Message: CWE ID: CWE-20
0
7,462
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int mov_write_prft_tag(AVIOContext *pb, MOVMuxContext *mov, int tracks) { int64_t pos = avio_tell(pb), pts_us, ntp_ts; MOVTrack *first_track; /* PRFT should be associated with at most one track. So, choosing only the * first track. */ if (tracks > 0) return 0; first_track ...
0
79,386
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: handle_child_line(const char *line, void *data) { UNUSED(data); const char *val; char buf[1024]; if (str_startswith(line, "Class:")) { val = line + sizeof("Class:"); /* Skip whitespace and second Class: occurrence */ val += strspn(val, " \t") + sizeof("Class"); current_device.klass = strtol(val, NUL...
0
92,938
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void AppLayerProtoDetectPrintProbingParsers(AppLayerProtoDetectProbingParser *pp) { SCEnter(); AppLayerProtoDetectProbingParserPort *pp_port = NULL; AppLayerProtoDetectProbingParserElement *pp_pe = NULL; printf("\nProtocol Detection Configuration\n"); for ( ; pp != NULL; pp = pp->nex...
0
96,494
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int sg_emulated_host(struct request_queue *q, int __user *p) { return put_user(1, p); } Commit Message: block: fail SCSI passthrough ioctls on partition devices Linux allows executing the SG_IO ioctl on a partition or LVM volume, and will pass the command to the underlying block device. This is well-kn...
0
94,365
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static bool vmacache_valid(struct mm_struct *mm) { struct task_struct *curr; if (!vmacache_valid_mm(mm)) return false; curr = current; if (mm->vmacache_seqnum != curr->vmacache.seqnum) { /* * First attempt will always be invalid, initialize * the new cache for this task here. */ curr->vmacach...
0
77,752
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: status_t OggSource::start(MetaData * /* params */) { if (mStarted) { return INVALID_OPERATION; } mStarted = true; return OK; } Commit Message: Fix memory leak in OggExtractor Test: added a temporal log and run poc Bug: 63581671 Change-Id: I436a08e54d5e831f9fbdb33c26d15397ce1fbeba (cherry picked from c...
0
162,198
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ~UserCloudPolicyManagerFactoryChromeOS() {} Commit Message: Make the policy fetch for first time login blocking The CL makes policy fetching for first time login blocking for all users, except the ones that are known to be non-enterprise users. BUG=334584 Review URL: https://codereview.chromium.org/330843...
0
110,413
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void OmniboxViewWin::ExecuteCommand(int command_id) { ScopedFreeze freeze(this, GetTextObjectModel()); if (command_id == IDS_PASTE_AND_GO) { model_->PasteAndGo(); return; } OnBeforePossibleChange(); switch (command_id) { case IDS_UNDO: Undo(); break; case IDC_CUT: Cut...
0
107,435
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void Browser::OnWindowActivated() { WebContents* contents = chrome::GetActiveWebContents(this); if (contents && ShouldReloadCrashedTab(contents)) chrome::Reload(this, CURRENT_TAB); } Commit Message: Remove TabContents from TabStripModelObserver::TabDetachedAt. BUG=107201 TEST=no visible change Review ...
0
117,795
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int skcipher_encrypt_ablkcipher(struct skcipher_request *req) { struct crypto_skcipher *skcipher = crypto_skcipher_reqtfm(req); struct crypto_tfm *tfm = crypto_skcipher_tfm(skcipher); struct ablkcipher_alg *alg = &tfm->__crt_alg->cra_ablkcipher; return skcipher_crypt_ablkcipher(req, alg->encrypt); } ...
0
64,790
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PlainTextRange InputMethodController::CreateSelectionRangeForSetComposition( int selection_start, int selection_end, size_t text_length) const { const int selection_offsets_start = static_cast<int>(GetSelectionOffsets().Start()); const int start = selection_offsets_start + selection_start; ...
0
124,865
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool venc_dev::venc_enable_initial_qp(QOMX_EXTNINDEX_VIDEO_INITIALQP* initqp) { int rc; struct v4l2_control control; struct v4l2_ext_control ctrl[4]; struct v4l2_ext_controls controls; ctrl[0].id = V4L2_CID_MPEG_VIDC_VIDEO_I_FRAME_QP; ctrl[0].value = initqp->nQpI; ctrl[1].id = V4L2_CID_MPEG_VIDC_...
0
159,258
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void FillDriveEntryPropertiesValue(const drive::ResourceEntry& entry_proto, bool shared_with_me, DriveEntryProperties* properties) { properties->shared_with_me.reset(new bool(shared_with_me)); properties->shared.reset(new bool(entry_proto.s...
0
111,762
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, unsigned long, arg4, unsigned long, arg5) { struct task_struct *me = current; unsigned char comm[sizeof(me->comm)]; long error; error = security_task_prctl(option, arg2, arg3, arg4, arg5); if (error != -ENOSYS) return error; ...
0
21,539