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: iasecc_sdo_get_data(struct sc_card *card, struct iasecc_sdo *sdo) { struct sc_context *ctx = card->ctx; int rv, sdo_tag; LOG_FUNC_CALLED(ctx); sdo_tag = iasecc_sdo_tag_from_class(sdo->sdo_class); rv = iasecc_sdo_get_tagged_data(card, sdo_tag, sdo); /* When there is no public data 'GET DATA' returns error...
0
78,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: bool ParamTraits<float>::Read(const Message* m, PickleIterator* iter, param_type* r) { const char *data; int data_size; if (!m->ReadData(iter, &data, &data_size) || data_size != sizeof(param_type)) { NOTREACHED(); return false; } memcpy(r, data, sizeof(param_t...
0
117,387
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 V8TestObject::RaisesExceptionGetterLongAttributeAttributeSetterCallback( const v8::FunctionCallbackInfo<v8::Value>& info) { RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_raisesExceptionGetterLongAttribute_Setter"); v8::Local<v8::Value> v8_value = info[0]; test_...
0
135,040
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: EventSuppressForWindow(WindowPtr pWin, ClientPtr client, Mask mask, Bool *checkOptional) { int i, freed; if (mask & ~PropagateMask) { client->errorValue = mask; return BadValue; } if (pWin->dontPropagate) DontPropagateRefCnts[pWin->dontPropagate]--; ...
0
4,829
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 intAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) { INC_STATS("DOM.TestObj.intAttr._set"); TestObj* imp = V8TestObj::toNative(info.Holder()); int v = toInt32(value); imp->setIntAttr(v); return; } Commit Message: [V8] Pass Isola...
0
109,565
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 authorized_client(CLIENT *opts) { const char *ERRMSG="Invalid entry '%s' in authfile '%s', so, refusing all connections."; FILE *f ; char line[LINELEN]; char *tmp; struct in_addr addr; struct in_addr client; struct in_addr cltemp; int len; if ((f=fopen(opts->server->authname,"r"))==NULL) { msg4(L...
0
18,422
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 Document::updateDistributionForNodeIfNeeded(Node* node) { if (node->inDocument()) { updateDistributionIfNeeded(); return; } Node* root = node; while (Node* host = root->shadowHost()) root = host; while (Node* ancestor = root->parentOrShadowHostNode()) root ...
0
102,908
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: tlink_rb_search(struct rb_root *root, uid_t uid) { struct rb_node *node = root->rb_node; struct tcon_link *tlink; while (node) { tlink = rb_entry(node, struct tcon_link, tl_rbnode); if (tlink->tl_uid > uid) node = node->rb_left; else if (tlink->tl_uid < uid) node = node->rb_right; else retur...
0
24,522
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: sp<MediaPlayerBase> MediaPlayerService::Client::createPlayer(player_type playerType) { sp<MediaPlayerBase> p = mPlayer; if ((p != NULL) && (p->playerType() != playerType)) { ALOGV("delete player"); p.clear(); } if (p == NULL) { p = MediaPlayerFactory::createPlayer(playerType, this, ...
0
157,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 LayerTreeHostImpl::SetExternalTilePriorityConstraints( const gfx::Rect& viewport_rect, const gfx::Transform& transform) { gfx::Rect viewport_rect_for_tile_priority_in_view_space; gfx::Transform screen_to_view(gfx::Transform::kSkipInitialization); if (transform.GetInverse(&screen_to_view)) { ...
0
137,360
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 find_unmapped_nsuid(struct lxc_conf *conf, enum idtype idtype) { struct lxc_list *it; struct id_map *map; unsigned int freeid = 0; again: lxc_list_for_each(it, &conf->id_map) { map = it->elem; if (map->idtype != idtype) continue; if (freeid >= map->nsid && freeid < map->nsid + map->range) { fr...
0
44,564
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 LoginDisplayHostWebUI::IsVoiceInteractionOobe() { return is_voice_interaction_oobe_; } Commit Message: cros: Check initial auth type when showing views login. Bug: 859611 Change-Id: I0298db9bbf4aed6bd40600aef2e1c5794e8cd058 Reviewed-on: https://chromium-review.googlesource.com/1123056 Reviewed-by: Xiaoyi...
0
131,627
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: gfx::PluginWindowHandle RenderView::AllocateFakePluginWindowHandle( bool opaque, bool root) { gfx::PluginWindowHandle window = NULL; Send(new ViewHostMsg_AllocateFakePluginWindowHandle( routing_id(), opaque, root, &window)); if (window) { fake_plugin_window_handles_.insert(window); } retur...
0
98,895
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 EAS_I8 ConvertPan (EAS_I32 pan) { /* multiply by conversion factor */ pan = FMUL_15x15 (PAN_CONVERSION_FACTOR, pan); if (pan < MIN_PAN_VALUE) return MIN_PAN_VALUE; if (pan > MAX_PAN_VALUE) return MAX_PAN_VALUE; return (EAS_I8) pan; } Commit Message: DLS parser: fix wave pool size check. Bug: 2...
0
157,506
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 SelectionEditor::UpdateCachedVisibleSelectionIfNeeded() const { DCHECK_GE(GetDocument().Lifecycle().GetState(), DocumentLifecycle::kAfterPerformLayout); AssertSelectionValid(); if (!NeedsUpdateVisibleSelection()) return; style_version_for_dom_tree_ = GetDocument().StyleVersion(); ca...
0
124,972
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 SavePackage::Init( const SavePackageDownloadCreatedCallback& download_created_callback) { if (wait_state_ != INITIALIZE) return false; wait_state_ = START_PROCESS; BrowserContext* browser_context = web_contents()->GetBrowserContext(); if (!browser_context) { NOTREACHED(); return fal...
0
115,197
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 CLASS canon_600_load_raw() { uchar data[1120], *dp; ushort pixel[896], *pix; int irow, row, col, val; static const short mul[4][2] = { { 1141,1145 }, { 1128,1109 }, { 1178,1149 }, { 1128,1109 } }; for (irow=row=0; irow < height; irow++) { if ((int)fread (data, 1, raw_width*5/4, ifp) < raw_w...
0
43,245
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: long kvm_arch_vm_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg) { struct kvm *kvm = filp->private_data; void __user *argp = (void __user *)arg; int r = -ENOTTY; /* * This union makes it completely explicit to gcc-3.x * that these two variables' stack usage should be * combined,...
0
28,861
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: ofpact_bitmap_format(uint64_t ofpacts_bitmap, struct ds *s) { if (!ofpacts_bitmap) { ds_put_cstr(s, "<none>"); } else { while (ofpacts_bitmap) { ds_put_format(s, "%s ", ofpact_name(rightmost_1bit_idx(ofpacts_bitmap))); ofpacts_bitmap = zero...
0
76,978
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: error::Error GLES2DecoderPassthroughImpl::DoVertexAttrib1fv( GLuint indx, const volatile GLfloat* values) { api()->glVertexAttrib1fvFn(indx, const_cast<const GLfloat*>(values)); return error::kNoError; } Commit Message: Add GL_PROGRAM_COMPLETION_QUERY_CHROMIUM This makes the query of GL_COMPLETION_S...
0
142,179
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 char *ffs_prepare_buffer(const char __user *buf, size_t len) { char *data; if (unlikely(!len)) return NULL; data = kmalloc(len, GFP_KERNEL); if (unlikely(!data)) return ERR_PTR(-ENOMEM); if (unlikely(copy_from_user(data, buf, len))) { kfree(data); return ERR_PTR(-EFAULT); } pr_vdebug("Bu...
0
49,630
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: error::Error GLES2DecoderImpl::HandleBindAttribLocation( uint32 immediate_data_size, const gles2::BindAttribLocation& c) { GLuint program = static_cast<GLuint>(c.program); GLuint index = static_cast<GLuint>(c.index); uint32 name_size = c.data_size; const char* name = GetSharedMemoryAs<const char*>( ...
0
103,618
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 __always_inline void *slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, void *addr) { void **object; struct kmem_cache_cpu *c; unsigned long flags; local_irq_save(flags); c = get_cpu_slab(s, smp_processor_id()); if (unlikely(!c->freelist || !node_match(c, node))) object = __slab_alloc(...
0
24,898
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 sm_adaptive_routing(p_fm_config_conx_hdlt hdl, fm_mgr_type_t mgr, int argc, char *argv[]) { fm_mgr_config_errno_t res; fm_msg_ret_code_t ret_code; uint32_t enable=0; if (argc == 1) { enable = atol(argv[0]); if((res = fm_mgr_simple_query(hdl, FM_ACT_GET, FM_DT_SM_SET_ADAPTIVE_ROUTING, mgr, sizeof(...
0
96,197
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: DOMHandler::DOMHandler() : DevToolsDomainHandler(DOM::Metainfo::domainName), host_(nullptr) { } Commit Message: DevTools: speculative fix for crash in NetworkHandler::Disable This keeps BrowserContext* and StoragePartition* instead of RenderProcessHost* in an attemp to resolve UAF of RenderProcessHost...
0
148,431
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 __clear_buddies_next(struct sched_entity *se) { for_each_sched_entity(se) { struct cfs_rq *cfs_rq = cfs_rq_of(se); if (cfs_rq->next != se) break; cfs_rq->next = NULL; } } Commit Message: sched/fair: Fix infinite loop in update_blocked_averages() by reverting a9e7f6544b9c Zhipeng Xie, Xie...
0
92,437
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 long __tun_chr_ioctl(struct file *file, unsigned int cmd, unsigned long arg, int ifreq_len) { struct tun_file *tfile = file->private_data; struct tun_struct *tun; void __user* argp = (void __user*)arg; struct ifreq ifr; kuid_t owner; kgid_t group; int sndbuf; int vnet_hdr_sz; unsigned int i...
0
93,254
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: megasas_read_fw_status_reg_xscale(struct megasas_instance *instance) { return readl(&instance->reg_set->outbound_msg_0); } Commit Message: scsi: megaraid_sas: return error when create DMA pool failed when create DMA pool for cmd frames failed, we should return -ENOMEM, instead of 0. In some case in: megas...
0
90,394
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 block_sigs(sigset_t *oldset) { sigset_t mask; siginitsetinv(&mask, sigmask(SIGKILL)); sigprocmask(SIG_BLOCK, &mask, oldset); } Commit Message: fuse: check size of FUSE_NOTIFY_INVAL_ENTRY message FUSE_NOTIFY_INVAL_ENTRY didn't check the length of the write so the message processing could overrun ...
0
24,584
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 btif_in_storage_request_copy_cb(UINT16 event, char *p_new_buf, char *p_old_buf) { btif_storage_req_t *new_req = (btif_storage_req_t*)p_new_buf; btif_storage_req_t *old_req = (btif_storage_req_t*)p_old_buf; BTIF_TRACE_EVENT("%s", __FUNCTION__); switch (event) { case BTIF_CORE_STORAGE_REMOTE...
0
158,546
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 IRCView::replaceDecoration(QString& line, char decoration, char replacement) { int pos; bool decorated = false; while((pos=line.indexOf(decoration))!=-1) { line.replace(pos,1,(decorated) ? QString("</%1>").arg(replacement) : QString("<%1>").arg(replacement)); decorated = !dec...
0
1,771
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: free_cache(struct name_cache *cache) { size_t i; if (cache != NULL) { for (i = 0; i < cache->size; i++) free(cache->cache[i].name); free(cache); } } Commit Message: Add ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS option This fixes a directory traversal in the cpio tool. CWE ID: CWE-22
0
43,869
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 wchar_t* default_channel() const { return mode_->default_channel_name; } Commit Message: Ignore switches following "--" when parsing a command line. BUG=933004 R=wfh@chromium.org Change-Id: I911be4cbfc38a4d41dec85d85f7fe0f50ddca392 Reviewed-on: https://chromium-review.googlesource.com/c/1481210 Auto-Su...
0
152,674
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 GLES2DecoderImpl::ResizeOffscreenFrameBuffer(const gfx::Size& size) { bool is_offscreen = !!offscreen_target_frame_buffer_.get(); if (!is_offscreen) { LOG(ERROR) << "GLES2DecoderImpl::ResizeOffscreenFrameBuffer called " << " with an onscreen framebuffer."; return false; } if (...
0
99,302
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 user_single_step_siginfo(struct task_struct *tsk, struct pt_regs *regs, struct siginfo *info) { fill_sigtrap_info(tsk, regs, 0, TRAP_BRKPT, info); } Commit Message: perf: Remove the nmi parameter from the swevent and overflow interface The nmi parameter indicated if we could do wakeups from the cu...
0
25,921
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 handle_id3(AVIOContext *pb, struct playlist *pls) { AVDictionary *metadata = NULL; ID3v2ExtraMetaAPIC *apic = NULL; ID3v2ExtraMeta *extra_meta = NULL; int64_t timestamp = AV_NOPTS_VALUE; parse_id3(pls->ctx, pb, &metadata, &timestamp, &apic, &extra_meta); if (timestamp != AV_N...
0
61,792
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 RenderBlock::paintContinuationOutlines(PaintInfo& info, const LayoutPoint& paintOffset) { ContinuationOutlineTableMap* table = continuationOutlineTable(); if (table->isEmpty()) return; OwnPtr<ListHashSet<RenderInline*> > continuations = table->take(this); if (!continuations) ...
0
116,266
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 nlmsvc_release_block(struct nlm_block *block) { if (block != NULL) kref_put_mutex(&block->b_count, nlmsvc_free_block, &block->b_file->f_mutex); } Commit Message: Merge tag 'nfsd-4.12' of git://linux-nfs.org/~bfields/linux Pull nfsd updates from Bruce Fields: "Another RDMA update from Chuck Lever...
0
65,229
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 btif_dm_ssp_key_notif_evt(tBTA_DM_SP_KEY_NOTIF *p_ssp_key_notif) { bt_bdaddr_t bd_addr; bt_bdname_t bd_name; UINT32 cod; int dev_type; BTIF_TRACE_DEBUG("%s", __FUNCTION__); /* Remote properties update */ if (!btif_get_device_type(p_ssp_key_notif->bd_addr, &dev_type)) { dev_type...
0
158,612
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: content::RenderView* view() { return view_; } Commit Message: Make chrome.appWindow.create() provide access to the child window at a predictable time. When you first create a window with chrome.appWindow.create(), it won't have loaded any resources. So, at create time, you are guaranteed that: child_window....
0
105,357
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 append_bin_stats(const char *key, const uint16_t klen, const char *val, const uint32_t vlen, conn *c) { char *buf = c->stats.buffer + c->stats.offset; uint32_t bodylen = klen + vlen; protocol_binary_response_header header = { ...
0
18,222
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 ChromeContentBrowserClient::DidCreatePpapiPlugin( content::BrowserPpapiHost* browser_host) { #if BUILDFLAG(ENABLE_PLUGINS) ChromeContentBrowserClientPluginsPart::DidCreatePpapiPlugin(browser_host); #endif } Commit Message: Move IsDataSaverEnabledByUser to be a static method and use it This method now...
0
142,623
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 void LocaleUpper(char *string) { register char *q; assert(string != (char *) NULL); for (q=string; *q != '\0'; q++) *q=(char) LocaleUppercase((int) *q); } Commit Message: ... CWE ID: CWE-125
0
90,903
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 unsigned int clientstr_hashval(const char *name) { return opaque_hashval(name, 8) & CLIENT_HASH_MASK; } Commit Message: Merge tag 'nfsd-4.12' of git://linux-nfs.org/~bfields/linux Pull nfsd updates from Bruce Fields: "Another RDMA update from Chuck Lever, and a bunch of miscellaneous bugfixes" * tag...
0
65,428
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: int32_t PPB_URLLoader_Impl::FollowRedirect(PP_CompletionCallback callback) { int32_t rv = ValidateCallback(callback); if (rv != PP_OK) return rv; WebURL redirect_url = GURL(response_info_->redirect_url()); loader_->setDefersLoading(false); // Allow the redirect to continue. RegisterCallback(callb...
0
100,010
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: virDomainInterfaceAddresses(virDomainPtr dom, virDomainInterfacePtr **ifaces, unsigned int source, unsigned int flags) { VIR_DOMAIN_DEBUG(dom, "ifaces=%p, source=%d, flags=%x", ifaces, source, flags); virResetLastError();...
0
93,833
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: virtual float SpoolPage(GraphicsContext& context, int page_number) { IntRect page_rect = page_rects_[page_number]; float scale = printed_page_width_ / page_rect.Width(); AffineTransform transform; #if defined(OS_POSIX) && !defined(OS_MACOSX) transform.Scale(scale); #endif transform.Translat...
0
145,771
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 struct l2tp_eth_net *l2tp_eth_pernet(struct net *net) { return net_generic(net, l2tp_eth_net_id); } Commit Message: net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared After the last patch, We are left in a state in which only drivers calling ether_setup have IFF_TX_SKB_SHARIN...
0
24,310
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: ps_parser_done( PS_Parser parser ) { FT_UNUSED( parser ); } Commit Message: CWE ID: CWE-119
0
7,341
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 nfs3svc_encode_setaclres(struct svc_rqst *rqstp, __be32 *p, struct nfsd3_attrstat *resp) { p = nfs3svc_encode_post_op_attr(rqstp, p, &resp->fh); return xdr_ressize_check(rqstp, p); } Commit Message: nfsd: check permissions when setting ACLs Use set_posix_acl, which includes proper permission che...
0
55,757
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: unsigned int tcp_poll(struct file *file, struct socket *sock, poll_table *wait) { unsigned int mask; struct sock *sk = sock->sk; const struct tcp_sock *tp = tcp_sk(sk); int state; sock_rps_record_flow(sk); sock_poll_wait(file, sk_sleep(sk), wait); state = sk_state_load(sk); if (state == TCP_LISTEN) r...
0
61,754
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 array_num_elements(HashTable* ht) { if (ht->pListTail && ht->pListTail->nKeyLength == 0) { return ht->pListTail->h-1; } return 0; } Commit Message: CWE ID:
0
14,843
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 mschmd_header *chmd_open(struct mschm_decompressor *base, const char *filename) { return chmd_real_open(base, filename, 1); } Commit Message: length checks when looking for control files CWE ID: CWE-119
0
86,820
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 StreamTcpDetectLogFlush(ThreadVars *tv, StreamTcpThread *stt, Flow *f, Packet *p, PacketQueue *pq) { TcpSession *ssn = f->protoctx; ssn->client.flags |= STREAMTCP_STREAM_FLAG_TRIGGER_RAW; ssn->server.flags |= STREAMTCP_STREAM_FLAG_TRIGGER_RAW; bool ts = PKT_IS_TOSERVER(p) ? true : false; ...
0
79,185
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: ppp_do_recv(struct ppp *ppp, struct sk_buff *skb, struct channel *pch) { ppp_recv_lock(ppp); if (!ppp->closing) ppp_receive_frame(ppp, skb, pch); else kfree_skb(skb); ppp_recv_unlock(ppp); } Commit Message: ppp: take reference on channels netns Let channels hold a reference on their network namespace. S...
0
52,625
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 WebContentsImpl::DidGetResourceResponseStart( const ResourceRequestDetails& details) { controller_.ssl_manager()->DidStartResourceResponse( details.url, details.has_certificate, details.ssl_cert_status); for (auto& observer : observers_) observer.DidGetResourceResponseStart(details); } Comm...
0
135,670
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_empty_slot(struct module *module, int slot) { return !slots[slot] || !*slots[slot]; } Commit Message: ALSA: control: Protect user controls against concurrent access The user-control put and get handlers as well as the tlv do not protect against concurrent access from multiple threads. Since th...
0
36,506
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 ssl_cipher_list_to_bytes(SSL *s, STACK_OF(SSL_CIPHER) *sk, unsigned char *p) { int i, j = 0; const SSL_CIPHER *c; unsigned char *q; int empty_reneg_info_scsv = !s->renegotiate; /* Set disabled masks for this session */ ssl_set_client_disabled(s); if (sk == NULL) return (0)...
0
69,369
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 ExecuteJavaScriptForTests(const std::string& js) { base::RunLoop run_loop; browser() ->tab_strip_model() ->GetActiveWebContents() ->GetMainFrame() ->ExecuteJavaScriptForTests( base::ASCIIToUTF16(js), base::Bind([](const base::Closure& quit_cal...
0
147,419
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 ssize_t SetPSDOffset(const PSDInfo *psd_info,Image *image, const size_t offset) { if (psd_info->version == 1) return(WriteBlobMSBShort(image,(unsigned short) offset)); return(WriteBlobMSBLong(image,(unsigned int) offset)); } Commit Message: https://github.com/ImageMagick/ImageMagick/issue...
0
91,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: void cJSON_Delete( cJSON *c ) { cJSON *next; while ( c ) { next = c->next; if ( ! ( c->type & cJSON_IsReference ) && c->child ) cJSON_Delete( c->child ); if ( ! ( c->type & cJSON_IsReference ) && c->valuestring ) cJSON_free( c->valuestring ); if ( c->string ) cJSON_free( c->string ); cJSON_...
1
167,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: static void l2cap_sock_cleanup_listen(struct sock *parent) { struct sock *sk; BT_DBG("parent %p", parent); /* Close not yet accepted channels */ while ((sk = bt_accept_dequeue(parent, NULL))) { struct l2cap_chan *chan = l2cap_pi(sk)->chan; l2cap_chan_lock(chan); __clear_chan_timer(chan); l2cap_chan...
0
94,518
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 TaskService::RunTask(InstanceId instance_id, RunnerId runner_id, base::OnceClosure task) { base::subtle::AutoReadLock task_lock(task_lock_); { base::AutoLock lock(lock_); if (instance_id != bound_instance_id_) return; } std::move(...
1
172,212
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_track_tsc_matching(struct kvm_vcpu *vcpu) { #ifdef CONFIG_X86_64 bool vcpus_matched; bool do_request = false; struct kvm_arch *ka = &vcpu->kvm->arch; struct pvclock_gtod_data *gtod = &pvclock_gtod_data; vcpus_matched = (ka->nr_vcpus_matched_tsc + 1 == atomic_read(&vcpu->kvm->online_vcpus)); i...
0
28,886
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 BrowserLauncherItemController::Close() { views::Widget* widget = views::Widget::GetWidgetForNativeView(window_); if (widget) widget->Close(); } Commit Message: Remove TabContents from TabStripModelObserver::TabDetachedAt. BUG=107201 TEST=no visible change Review URL: https://chromiumcodereview.ap...
0
117,723
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 ActivationCallback() { ++callback_count_; } Commit Message: (Reland) Discard compositor frames from unloaded web content This is a reland of https://codereview.chromium.org/2707243005/ with a small change to fix an uninitialized memory error that fails on MSAN bots. BUG=672847 TBR=danakj@chromium.org, c...
0
137,405
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: hardcopy(WebKitWebView *page, GArray *argv, GString *result) { (void) argv; (void) result; webkit_web_frame_print(webkit_web_view_get_main_frame(page)); } Commit Message: disable Uzbl javascript object because of security problem. CWE ID: CWE-264
0
18,355
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 NewObjectTestInterfacePromiseMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { ExceptionState exception_state(info.GetIsolate(), ExceptionState::kExecutionContext, "TestObject", "newObjectTestInterfacePromiseMethod"); ExceptionToRejectPromiseScope reject_promise_scope(info, exception...
0
134,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: static void setLineColor(Color8888* dst, Color8888 color, int width) { for (; width > 0; width--, dst++) { *dst = color; } } Commit Message: Skip composition of frames lacking a color map Bug:68399117 Change-Id: I32f1d6856221b8a60130633edb69da2d2986c27c (cherry picked from commit 0dc887f70eeea8d707cb426b96c...
0
163,291
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 __dm_suspend(struct mapped_device *md, struct dm_table *map, unsigned suspend_flags, long task_state, int dmf_suspended_flag) { bool do_lockfs = suspend_flags & DM_SUSPEND_LOCKFS_FLAG; bool noflush = suspend_flags & DM_SUSPEND_NOFLUSH_FLAG; int r; lockdep_assert_held(&md->suspend_lock); /*...
0
85,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: GF_Box *trpy_New() { ISOM_DECL_BOX_ALLOC(GF_TRPYBox, GF_ISOM_BOX_TYPE_TRPY); return (GF_Box *)tmp; } Commit Message: fixed 2 possible heap overflows (inc. #1088) CWE ID: CWE-125
0
80,609
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::LoadingStateChanged(WebContents* source, bool to_different_document) { ScheduleUIUpdate(source, content::INVALIDATE_TYPE_LOAD); UpdateWindowForLoadingStateChanged(source, to_different_document); } Commit Message: If a dialog is shown, drop fullscreen. BUG=8750...
0
146,017
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 kvm_fetch_guest_virt(struct x86_emulate_ctxt *ctxt, gva_t addr, void *val, unsigned int bytes, struct x86_exception *exception) { struct kvm_vcpu *vcpu = emul_to_vcpu(ctxt); u32 access = (kvm_x86_ops->get_cpl(vcpu) == 3) ? PFERR_USER_MASK : 0; unsigned offset; int ret; /* Inline kvm_read_...
0
35,787
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 QQuickWebViewExperimental::setContentX(qreal x) { Q_D(QQuickWebView); ASSERT(d->flickProvider); d->flickProvider->setContentX(x); } Commit Message: [Qt][WK2] Allow transparent WebViews https://bugs.webkit.org/show_bug.cgi?id=80608 Reviewed by Tor Arne Vestbø. Added support for transparentBackg...
0
101,776
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: chunkVectIter ContainerChunk::getChild( Chunk* needle ) { chunkVectIter iter; for( iter = this->children.begin(); iter != this->children.end(); iter++ ) { Chunk* temp1 = *iter; Chunk* temp2 = needle; if ( (*iter) == needle ) return iter; } return this->children.end(); } Commit Message: CWE ID: CWE-19...
0
16,076
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 openssl_init_fork_handlers(void) { return 0; } Commit Message: CWE ID: CWE-330
0
12,063
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 sas_get_phy_change_count(struct domain_device *dev, int phy_id, int *pcc) { int res; struct smp_resp *disc_resp; disc_resp = alloc_smp_resp(DISCOVER_RESP_SIZE); if (!disc_resp) return -ENOMEM; res = sas_get_phy_discover(dev, phy_id, disc_resp); if (!res) *pcc = disc_resp->disc.chang...
0
83,964
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: message_send_invite(const char *const roomjid, const char *const contact, const char *const reason) { xmpp_ctx_t * const ctx = connection_get_ctx(); xmpp_stanza_t *stanza; muc_member_type_t member_type = muc_member_type(roomjid); if (member_type == MUC_MEMBER_TYPE_PUBLIC) { log_debug(...
0
68,675
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 php_snmp_write_valueretrieval(php_snmp_object *snmp_object, zval *newval) { zval ztmp; int ret = SUCCESS; if (Z_TYPE_P(newval) != IS_LONG) { ztmp = *newval; zval_copy_ctor(&ztmp); convert_to_long(&ztmp); newval = &ztmp; } if (Z_LVAL_P(newval) >= 0 && Z_LVAL_P(newval) <= (SNMP_VALUE_LIBRA...
0
11,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: void FormAssociatedElement::insertedInto(ContainerNode* insertionPoint) { if (m_form && insertionPoint->highestAncestor() != m_form->highestAncestor()) setForm(0); resetFormOwner(); if (!insertionPoint->inDocument()) return; HTMLElement* element = toHTMLElement(this); if (ele...
0
123,827
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 ImportBlackQuantum(const Image *image,QuantumInfo *quantum_info, const MagickSizeType number_pixels,const unsigned char *magick_restrict p, Quantum *magick_restrict q,ExceptionInfo *exception) { QuantumAny range; register ssize_t x; unsigned int pixel; if (image->colorspace ...
0
71,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: GF_Err asrt_dump(GF_Box *a, FILE * trace) { u32 i; GF_AdobeSegmentRunTableBox *p = (GF_AdobeSegmentRunTableBox*)a; gf_isom_box_dump_start(a, "AdobeSegmentRunTableBox", trace); fprintf(trace, ">\n"); for (i=0; i<p->quality_entry_count; i++) { char *str = (char*)gf_list_get(p->quality_segment_url_modifiers...
0
80,686
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 __init sched_init_smp(void) { cpumask_var_t non_isolated_cpus; alloc_cpumask_var(&non_isolated_cpus, GFP_KERNEL); alloc_cpumask_var(&fallback_doms, GFP_KERNEL); #if defined(CONFIG_NUMA) sched_group_nodes_bycpu = kzalloc(nr_cpu_ids * sizeof(void **), GFP_KERNEL); BUG_ON(sched_group_nodes_bycpu ...
0
22,556
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 arm_coherent_iommu_map_sg(struct device *dev, struct scatterlist *sg, int nents, enum dma_data_direction dir, struct dma_attrs *attrs) { return __iommu_map_sg(dev, sg, nents, dir, attrs, true); } Commit Message: ARM: dma-mapping: don't allow DMA mappings to be marked executable DMA mapping permissions we...
0
58,286
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: ShellWindowFrameView::~ShellWindowFrameView() { } Commit Message: [views] Remove header bar on shell windows created with {frame: none}. BUG=130182 R=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/10597003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143439 0039d316-1c4b-4281-b9...
0
103,199
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 char* event_type() const { return event_type_; } Commit Message: Revert 143656 - Add an IPC channel between the NaCl loader process and the renderer. BUG=116317 TEST=ppapi, nacl tests, manual testing for experimental IPC proxy. Review URL: https://chromiumcodereview.appspot.com/10641016 TBR=bbudge@chrom...
0
103,408
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 __net_exit igmp_net_exit(struct net *net) { proc_net_remove(net, "mcfilter"); proc_net_remove(net, "igmp"); } Commit Message: igmp: Avoid zero delay when receiving odd mixture of IGMP queries Commit 5b7c84066733c5dfb0e4016d939757b38de189e4 ('ipv4: correct IGMP behavior on v3 query during v2-compat...
0
21,609
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 promiseMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); TestObjectPythonV8Internal::promiseMethodMethod(info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); } Commit Message: document.location bindings fix...
0
122,532
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: FakeCentral::FakeCentral(mojom::CentralState state, mojom::FakeCentralRequest request) : state_(state), binding_(this, std::move(request)) {} Commit Message: bluetooth: Implement getAvailability() This change implements the getAvailability() method for navigator.bluetooth as defined...
0
138,218
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 ssl23_client_hello(SSL *s) { unsigned char *buf; unsigned char *p,*d; int i,ch_len; unsigned long l; int ssl2_compat; int version = 0, version_major, version_minor; #ifndef OPENSSL_NO_COMP int j; SSL_COMP *comp; #endif int ret; unsigned long mask, options = s->options; ssl2_compat = (optio...
0
12,232
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: struct dns_resolvers *find_resolvers_by_id(const char *id) { struct dns_resolvers *res; list_for_each_entry(res, &dns_resolvers, list) { if (!strcmp(res->id, id)) return res; } return NULL; } Commit Message: CWE ID: CWE-125
0
730
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 get_key_callback(void *c, struct key_params *params) { struct nlattr *key; struct get_key_cookie *cookie = c; if (params->key) NLA_PUT(cookie->msg, NL80211_ATTR_KEY_DATA, params->key_len, params->key); if (params->seq) NLA_PUT(cookie->msg, NL80211_ATTR_KEY_SEQ, params->seq_len, params-...
0
26,658
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::FrameFocused() { Send(new FrameHostMsg_FrameFocused(routing_id_)); } Commit Message: Convert FrameHostMsg_DidAddMessageToConsole to Mojo. Note: Since this required changing the test RenderViewImplTest.DispatchBeforeUnloadCanDetachFrame, I manually re-introduced https://crbug.com/666714 l...
0
139,641
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: unsigned CSSComputedStyleDeclaration::length() const { Node* node = m_node.get(); if (!node) return 0; RenderStyle* style = node->computedStyle(m_pseudoElementSpecifier); if (!style) return 0; return numComputedProperties; } Commit Message: Rename isPositioned to isOutOfFlow...
0
99,492
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 GLES2DecoderPassthroughImpl::UpdateTextureSizeFromTexturePassthrough( TexturePassthrough* texture, GLuint client_id) { if (texture == nullptr) { return; } CheckErrorCallbackState(); GLenum target = texture->target(); TextureTarget internal_texture_type = GLenumToTextureTarget(target);...
0
141,845
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 MagickPNGWarningHandler(png_struct *ping,png_const_charp message) { ExceptionInfo *exception; Image *image; PNGErrorInfo *error_info; if (LocaleCompare(message, "Missing PLTE before tRNS") == 0) png_error(ping, message); error_info=(PNGErrorInfo *) png_get_error_ptr(ping)...
0
63,298
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 RenderMessageFilter::OnOpenChannelToPlugin(int routing_id, const GURL& url, const GURL& policy_url, const std::string& mime_type, ...
0
116,871
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: ChromeContentBrowserClient::GetExternalBrowserPpapiHost( int plugin_process_id) { BrowserChildProcessHostIterator iter(content::PROCESS_TYPE_NACL_LOADER); while (!iter.Done()) { NaClProcessHost* host = static_cast<NaClProcessHost*>(iter.GetDelegate()); if (host->process() && host->...
0
115,753
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 tm_tar_active(struct task_struct *target, const struct user_regset *regset) { if (!cpu_has_feature(CPU_FTR_TM)) return -ENODEV; if (MSR_TM_ACTIVE(target->thread.regs->msr)) return regset->n; return 0; } Commit Message: powerpc/tm: Flush TM only if CPU has TM feature Commit cd63f3c ("powe...
0
84,833
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 ahci_dma_reset(IDEDMA *dma) { return 0; } Commit Message: CWE ID: CWE-119
0
15,765