instruction
stringclasses
1 value
input
stringlengths
64
129k
output
int64
0
1
__index_level_0__
int64
0
30k
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 RenderWidgetHostImpl::StartNewContentRenderingTimeout() { if (received_paint_after_load_) { received_paint_after_load_ = false; return; } new_content_rendering_timeout_->Start(new_content_rendering_delay_); } Commit Message: Check that RWHI isn't deleted manually while owned by a scoped_ptr i...
0
21,219
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::RunCachedStatementWithIds( sql::StatementID statement_id, const char* sql, const std::vector<int64_t>& ids) { DCHECK(sql); if (!LazyOpen(kCreateIfNeeded)) return false; sql::Transaction transaction(db_.get()); if (!transaction.Begin()) return false; sql::Stat...
0
22,092
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 RecordUMAStatistics(flags_ui::FlagsStorage* flags_storage) { std::set<std::string> switches; std::set<std::string> features; FlagsStateSingleton::GetFlagsState()->GetSwitchesAndFeaturesFromFlags( flags_storage, &switches, &features); ReportAboutFlagsHistogram("Launch.FlagsAtStartup", switches, ...
0
10,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: static inline u64 global_rt_runtime(void) { if (sysctl_sched_rt_runtime < 0) return RUNTIME_INF; return (u64)sysctl_sched_rt_runtime * NSEC_PER_USEC; } Commit Message: Sched: fix skip_clock_update optimization idle_balance() drops/retakes rq->lock, leaving the previous task vulnerable to set_tsk_need_resch...
0
1,473
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 u64 vmx_read_l1_tsc_offset(struct kvm_vcpu *vcpu) { struct vmcs12 *vmcs12 = get_vmcs12(vcpu); if (is_guest_mode(vcpu) && (vmcs12->cpu_based_vm_exec_control & CPU_BASED_USE_TSC_OFFSETING)) return vcpu->arch.tsc_offset - vmcs12->tsc_offset; return vcpu->arch.tsc_offset; } Commit Message: kvm: nV...
0
21,293
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::registerNodeListWithIdNameCache(const LiveNodeListBase* list) { #if ENABLE(OILPAN) m_nodeLists[InvalidateOnIdNameAttrChange].add(list); #else m_nodeListCounts[InvalidateOnIdNameAttrChange]++; #endif } Commit Message: Change Document::detach() to RELEASE_ASSERT all subframes are gone. BUG=...
0
1,438
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 PageInfoUI::GetConnectionIconID(PageInfo::SiteConnectionStatus status) { int resource_id = IDR_PAGEINFO_INFO; switch (status) { case PageInfo::SITE_CONNECTION_STATUS_UNKNOWN: case PageInfo::SITE_CONNECTION_STATUS_INTERNAL_PAGE: break; case PageInfo::SITE_CONNECTION_STATUS_ENCRYPTED: ...
0
3,832
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: SWFInput_input_eof(SWFInput input) { return input->offset >= input->length; } Commit Message: Fix left shift of a negative value in SWFInput_readSBits. Check for number before before left-shifting by (number-1). CWE ID: CWE-190
0
28,570
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: sync_api::UserShare* ProfileSyncService::GetUserShare() const { if (backend_.get() && backend_initialized_) { return backend_->GetUserShare(); } NOTREACHED(); return NULL; } Commit Message: [Sync] Cleanup all tab sync enabling logic now that its on by default. BUG=none TEST= Review URL: https://ch...
0
1,763
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 __copy_gigantic_page(struct page *dst, struct page *src, int nr_pages) { int i; struct page *dst_base = dst; struct page *src_base = src; for (i = 0; i < nr_pages; ) { cond_resched(); copy_highpage(dst, src); i++; dst = mem_map_next(dst, dst_base, i); src = mem_map_next(src, src_ba...
0
21,115
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 task_group *cgroup_tg(struct cgroup *cgrp) { return container_of(cgroup_subsys_state(cgrp, cpu_cgroup_subsys_id), struct task_group, css); } Commit Message: Sched: fix skip_clock_update optimization idle_balance() drops/retakes rq->lock, leaving the previous task vulnerable to set_t...
0
6,892
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 ChromeContentUtilityClient::SetNetworkBinderCreationCallback( const NetworkBinderCreationCallback& callback) { g_network_binder_creation_callback.Get() = callback; } Commit Message: Use pdf compositor service for printing when OOPIF is enabled When OOPIF is enabled (by site-per-process flag or top-do...
0
3,318
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 uas_resume(struct usb_interface *intf) { return 0; } Commit Message: USB: uas: fix bug in handling of alternate settings The uas driver has a subtle bug in the way it handles alternate settings. The uas_find_uas_alt_setting() routine returns an altsetting value (the bAlternateSetting number in the ...
0
9,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: static void octetAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) { ExceptionState exceptionState(ExceptionState::SetterContext, "octetAttribute", "TestObjectPython", info.Holder(), info.GetIsolate()); TestObjectPython* imp = V8TestObjectPython::toNative(i...
0
7,722
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: rdp_parse_bounds(STREAM s, BOUNDS * bounds) { uint8 present; in_uint8(s, present); if (present & 1) rdp_in_coord(s, &bounds->left, False); else if (present & 16) rdp_in_coord(s, &bounds->left, True); if (present & 2) rdp_in_coord(s, &bounds->top, False); else if (present & 32) rdp_in_coord(s, &bo...
0
12,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: static unsigned addChunk_tIME(ucvector* out, const LodePNGTime* time) { unsigned error = 0; unsigned char* data = (unsigned char*)malloc(7); if(!data) return 83; /*alloc fail*/ data[0] = (unsigned char)(time->year / 256); data[1] = (unsigned char)(time->year % 256); data[2] = (unsigned char)time->mont...
0
4,183
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 mac80211_hwsim_roc(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_channel *chan, int duration, enum ieee80211_roc_type type) { struct mac80211_hwsim_data *hwsim = hw->priv; mutex_lock(&hwsim->mutex); if (WARN_ON(hwsim->tmp_chan || hwsim->hw_...
0
26,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 struct sctp_association *__sctp_rcv_lookup_harder(struct sk_buff *skb, const union sctp_addr *laddr, struct sctp_transport **transportp) { sctp_chunkhdr_t *ch; ch = (sctp_chunkhdr_t *) skb->data; /* The code below will attempt to walk the chunk and extract * parameter information...
0
25,499
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 BlockEntry* Cluster::GetEntry(const CuePoint& cp, const CuePoint::TrackPosition& tp) const { assert(m_pSegment); #if 0 LoadBlockEntries(); if (m_entries == NULL) return NULL; const long long count = m_entries_count; if (count <= 0) ret...
1
15,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 CL_InitDownloads( void ) { char missingfiles[1024]; if ( !(cl_allowDownload->integer & DLF_ENABLE) ) { if (FS_ComparePaks( missingfiles, sizeof( missingfiles ), qfalse ) ) { Com_Printf( "\nWARNING: You are missing some files referenced by the server:\n%s" "You might not be able to join the gam...
0
9,733
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: png_do_read_swap_alpha(png_row_infop row_info, png_bytep row) { png_debug(1, "in png_do_read_swap_alpha"); #ifdef PNG_USELESS_TESTS_SUPPORTED if (row != NULL && row_info != NULL) #endif { png_uint_32 row_width = row_info->width; if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) { ...
0
24,509
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 br_nf_pre_routing_finish_ipv6(struct sk_buff *skb) { struct nf_bridge_info *nf_bridge = skb->nf_bridge; struct rtable *rt; if (nf_bridge->mask & BRNF_PKT_TYPE) { skb->pkt_type = PACKET_OTHERHOST; nf_bridge->mask ^= BRNF_PKT_TYPE; } nf_bridge->mask ^= BRNF_NF_BRIDGE_PREROUTING; rt = bridge_p...
0
19,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: int bio_associate_current(struct bio *bio) { struct io_context *ioc; if (bio->bi_css) return -EBUSY; ioc = current->io_context; if (!ioc) return -ENOENT; get_io_context_active(ioc); bio->bi_ioc = ioc; bio->bi_css = task_get_css(current, io_cgrp_id); return 0; } Commit Message: fix unbalanced page ...
0
25,156
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 pppoe_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *m, size_t total_len, int flags) { struct sock *sk = sock->sk; struct sk_buff *skb; int error = 0; if (sk->sk_state & PPPOX_BOUND) { error = -EIO; goto end; } skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT, flag...
1
18,808
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: new_decoder_state (void) { DECODER_STATE ds; ds = xmalloc (sizeof (*ds) + 99*sizeof(DECODER_STATE_ITEM)); ds->stacksize = 100; ds->idx = 0; ds->cur.node = NULL; ds->cur.went_up = 0; ds->cur.in_seq_of = 0; ds->cur.in_any = 0; ds->cur.again = 0; ds->cur.next_tag = 0; ds->cur.length = 0; ds-...
0
21,504
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 fuse_file_mmap(struct file *file, struct vm_area_struct *vma) { if ((vma->vm_flags & VM_SHARED) && (vma->vm_flags & VM_MAYWRITE)) fuse_link_write_file(file); file_accessed(file); vma->vm_ops = &fuse_file_vm_ops; return 0; } Commit Message: fuse: break infinite loop in fuse_fill_write_pages() I...
0
3,742
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 lrw_init_table(struct lrw_table_ctx *ctx, const u8 *tweak) { be128 tmp = { 0 }; int i; if (ctx->table) gf128mul_free_64k(ctx->table); /* initialize multiplication table for Key2 */ ctx->table = gf128mul_init_64k_bbe((be128 *)tweak); if (!ctx->table) return -ENOMEM; /* initialize optimization tab...
0
16,071
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 __stratum_send(struct pool *pool, char *s, ssize_t len) { SOCKETTYPE sock = pool->sock; ssize_t ssent = 0; if (opt_protocol) applog(LOG_DEBUG, "SEND: %s", s); strcat(s, "\n"); len++; while (len > 0 ) { struct timeval timeout = {0, 0}; ssize_t sent; fd_set wd; FD_ZERO(&wd); FD_SET...
0
19,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: Locale& Element::locale() const { return document()->getCachedLocale(computeInheritedLanguage()); } Commit Message: Set Attr.ownerDocument in Element#setAttributeNode() Attr objects can move across documents by setAttributeNode(). So It needs to reset ownerDocument through TreeScopeAdoptr::adoptIfNeeded(). ...
0
24,486
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 virtnet_free_queues(struct virtnet_info *vi) { int i; for (i = 0; i < vi->max_queue_pairs; i++) { napi_hash_del(&vi->rq[i].napi); netif_napi_del(&vi->rq[i].napi); } kfree(vi->rq); kfree(vi->sq); } Commit Message: virtio-net: drop NETIF_F_FRAGLIST virtio declares support for NETIF_F_FRAGLI...
0
1,576
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: val_wrap_args(OM_uint32 *minor_status, gss_ctx_id_t context_handle, int conf_req_flag, gss_qop_t qop_req, gss_buffer_t input_message_buffer, int *conf_state, gss_buffer_t output_message_buffer) { /* Initialize outputs. */ ...
0
16,995
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::crossAxisScrollbarExtent() const { return isHorizontalFlow() ? horizontalScrollbarHeight() : verticalScrollbarWidth(); } Commit Message: Separate repaint and layout requirements of StyleDifference (Step 1) Previously StyleDifference was an enum that proximately bigger values im...
0
10,306
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 NeedsPaintOffsetTranslationForScrollbars( const LayoutBoxModelObject& object) { if (auto* area = object.GetScrollableArea()) { if (area->HorizontalScrollbar() || area->VerticalScrollbar()) return true; } return false; } Commit Message: Reland "[CI] Make paint property nodes non-re...
0
5,548
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 bpf_prog_release(struct inode *inode, struct file *filp) { struct bpf_prog *prog = filp->private_data; bpf_prog_put_rcu(prog); return 0; } Commit Message: bpf: fix refcnt overflow On a system with >32Gbyte of phyiscal memory and infinite RLIMIT_MEMLOCK, the malicious application may overflow 32-b...
0
1,939
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 AssertForegroundAndRepost(const base::Process& renderer_process, base::PortProvider* port_provider) { ASSERT_FALSE(renderer_process.IsProcessBackgrounded(port_provider)); base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, base::BindOnce...
0
18,979
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: UNCURL_EXPORT void uncurl_close(struct uncurl_conn *ucc) { if (!ucc) return; tls_close(ucc->tls); net_close(ucc->net); free(ucc->host); http_free_header(ucc->hin); free(ucc->hout); free(ucc->netbuf); free(ucc); } Commit Message: origin matching must come at str end CWE ID: CWE-352
0
13,608
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: find_unicode_charmap( FT_Face face ) { FT_CharMap* first; FT_CharMap* cur; /* caller should have already checked that `face' is valid */ FT_ASSERT( face ); first = face->charmaps; if ( !first ) return FT_Err_Invalid_CharMap_Handle; /* * The original TrueType spe...
0
23,384
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: Node* Range::checkNodeWOffset(Node* n, int offset, ExceptionCode& ec) const { switch (n->nodeType()) { case Node::DOCUMENT_TYPE_NODE: case Node::ENTITY_NODE: case Node::NOTATION_NODE: ec = RangeException::INVALID_NODE_TYPE_ERR; return 0; case Node::CDATA...
0
398
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: size_t TestDataReductionProxyConfig::GetWarmupURLFetchAttemptCounts() const { if (!previous_attempt_counts_) return DataReductionProxyConfig::GetWarmupURLFetchAttemptCounts(); return previous_attempt_counts_.value(); } Commit Message: Implicitly bypass localhost when proxying requests. This aligns Chrom...
0
17,519
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: size_t GLES2DecoderImpl::GetCreatedBackTextureCountForTest() { return create_back_texture_count_for_test_; } Commit Message: Add GL_PROGRAM_COMPLETION_QUERY_CHROMIUM This makes the query of GL_COMPLETION_STATUS_KHR to programs much cheaper by minimizing the round-trip to the GPU thread. Bug: 881152, 957001 C...
0
16,683
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: size_t Parcel::ipcObjectsCount() const { return mObjectsSize; } Commit Message: Disregard alleged binder entities beyond parcel bounds When appending one parcel's contents to another, ignore binder objects within the source Parcel that appear to lie beyond the formal bounds of that Parcel's data buffer. Bug 1...
0
7,321
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::AddToTopLayer(Element* element, const Element* before) { if (element->IsInTopLayer()) return; DCHECK(!top_layer_elements_.Contains(element)); DCHECK(!before || top_layer_elements_.Contains(before)); if (before) { size_t before_position = top_layer_elements_.Find(before); top_la...
0
7,171
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 net_ratelimit(void) { return __ratelimit(&net_ratelimit_state); } Commit Message: net: avoid dependency of net_get_random_once on nop patching net_get_random_once depends on the static keys infrastructure to patch up the branch to the slow path during boot. This was realized by abusing the static keys api ...
0
6,253
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 red_channel_client_pipe_add_tail_no_push(RedChannelClient *rcc, PipeItem *item) { spice_assert(rcc); rcc->pipe_size++; ring_add_before(&item->link, &rcc->pipe); } Commit Message: CWE ID: CWE-399
0
16,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: aspath_delimiter_char (u_char type, u_char which) { int i; struct { int type; char start; char end; } aspath_delim_char [] = { { AS_SET, '{', '}' }, { AS_CONFED_SET, '[', ']' }, { AS_CONFED_SEQUENCE, '(', ')' }, { 0 } }; for (i = 0; aspath_de...
0
27,784
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 mapping_level(struct kvm_vcpu *vcpu, gfn_t large_gfn) { int host_level, level, max_level; host_level = host_mapping_level(vcpu->kvm, large_gfn); if (host_level == PT_PAGE_TABLE_LEVEL) return host_level; max_level = min(kvm_x86_ops->get_lpage_level(), host_level); for (level = PT_DIRECTORY_LE...
0
5,503
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: nvmet_fc_unregister_targetport(struct nvmet_fc_target_port *target_port) { struct nvmet_fc_tgtport *tgtport = targetport_to_tgtport(target_port); /* terminate any outstanding associations */ __nvmet_fc_free_assocs(tgtport); nvmet_fc_tgtport_put(tgtport); return 0; } Commit Message: nvmet-fc: ensure targe...
0
24,640
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 testInterfaceEmptyArrayMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); TestObjectPythonV8Internal::testInterfaceEmptyArrayMethodMethod(info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); } Commit Message...
0
12,392
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 ath_send_bar(struct ath_atx_tid *tid, u16 seqno) { if (!tid->an->sta) return; ieee80211_send_bar(tid->an->vif, tid->an->sta->addr, tid->tidno, seqno << IEEE80211_SEQ_SEQ_SHIFT); } Commit Message: ath9k: protect tid->sched check We check tid->sched without a lock taken on ath_tx_aggr_sleep...
0
7,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 TT_F26Dot6 Round_Super( EXEC_OPS TT_F26Dot6 distance, TT_F26Dot6 compensation ) { TT_F26Dot6 val; if ( distance >= 0 ) { val = (distance - CUR.phase + CUR.threshold + compensation) & (-CUR.period); if ( val < 0 ) ...
0
28,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: nfs_clear_request_commit(struct nfs_page *req) { } Commit Message: nfs: always make sure page is up-to-date before extending a write to cover the entire page We should always make sure the cached page is up-to-date when we're determining whether we can extend a write to cover the full page -- even if we've rece...
0
11,141
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 peer_close(struct t3cdev *tdev, struct sk_buff *skb, void *ctx) { struct iwch_ep *ep = ctx; struct iwch_qp_attributes attrs; unsigned long flags; int disconnect = 1; int release = 0; PDBG("%s ep %p\n", __func__, ep); dst_confirm(ep->dst); spin_lock_irqsave(&ep->com.lock, flags); switch (ep->...
0
26,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: struct cred *prepare_creds(void) { struct task_struct *task = current; const struct cred *old; struct cred *new; validate_process_creds(); new = kmem_cache_alloc(cred_jar, GFP_KERNEL); if (!new) return NULL; kdebug("prepare_creds() alloc %p", new); old = task->cred; memcpy(new, old, sizeof(struct c...
0
22,086
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 HTMLInputElement::setSelectionEndForBinding( unsigned end, bool is_null, ExceptionState& exception_state) { if (!input_type_->SupportsSelectionAPI()) { exception_state.ThrowDOMException(kInvalidStateError, "The input element's type ('" + ...
0
14,996
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 iwl_send_remove_station(struct iwl_priv *priv, const u8 *addr, int sta_id, bool temporary) { struct iwl_rx_packet *pkt; int ret; unsigned long flags_spin; struct iwl_rem_sta_cmd rm_sta_cmd; struct iwl_host_cmd cmd = { .id = REPLY_REMOVE_STA, .len = { sizeof(struct iwl_rem_sta_c...
0
6,905
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 V8WindowShell::createContext() { if (!m_frame->loader()->activeDocumentLoader()) return; v8::Handle<v8::ObjectTemplate> globalTemplate = V8Window::GetShadowObjectTemplate(m_isolate, m_world->isMainWorld() ? MainWorld : IsolatedWorld); if (globalTemplate.IsEmpty()) return; do...
0
21,306
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 AXObject::nameFromContents() const { switch (roleValue()) { case AnchorRole: case ButtonRole: case CheckBoxRole: case DirectoryRole: case DisclosureTriangleRole: case HeadingRole: case LineBreakRole: case LinkRole: case ListBoxOptionRole: case ListItemRole: case ...
0
18,719
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: dict_param_enumerate(iparam_list * plist, gs_param_enumerator_t * penum, gs_param_key_t * key, ref_type * type) { ref elt[2]; int code; dict_param_list *const pdlist = (dict_param_list *) plist; int index = (penum->intval != 0 ? penum->intval : dict_first(&pdlist->dict)); ...
0
5,332
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 MPEG4Extractor::parseITunesMetaData(off64_t offset, size_t size) { if (size == 0) { return OK; } if (size < 4 || size == SIZE_MAX) { return ERROR_MALFORMED; } uint8_t *buffer = new (std::nothrow) uint8_t[size + 1]; if (buffer == NULL) { return ERROR_MALFORMED; } if (mDataSource->readAt( ...
0
2,315
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 clean_live_states(struct bpf_verifier_env *env, int insn, struct bpf_verifier_state *cur) { struct bpf_verifier_state_list *sl; int i; sl = env->explored_states[insn]; if (!sl) return; while (sl != STATE_LIST_MARK) { if (sl->state.curframe != cur->curframe) goto next; for (i =...
0
24,575
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: cluster_hash_cmp (const void *p1, const void *p2) { const struct cluster_list * cluster1 = p1; const struct cluster_list * cluster2 = p2; return (cluster1->length == cluster2->length && memcmp (cluster1->list, cluster2->list, cluster1->length) == 0); } Commit Message: CWE ID:
0
12,881
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: SPL_METHOD(SplHeap, valid) { spl_heap_object *intern = (spl_heap_object*)zend_object_store_get_object(getThis() TSRMLS_CC); if (zend_parse_parameters_none() == FAILURE) { return; } RETURN_BOOL(intern->heap->count != 0); } Commit Message: CWE ID:
0
14,146
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 ip_vs_dest *ip_vs_find_dest(int af, const union nf_inet_addr *daddr, __be16 dport, const union nf_inet_addr *vaddr, __be16 vport, __u16 protocol) { struct ip_vs_dest *dest; struct ip_vs_service *svc; svc = ip_vs_service_get(af, 0, protocol, vaddr, vport); if (!svc) return NULL; ...
0
29,515
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: TmEcode StreamTcp (ThreadVars *tv, Packet *p, void *data, PacketQueue *pq, PacketQueue *postpq) { StreamTcpThread *stt = (StreamTcpThread *)data; SCLogDebug("p->pcap_cnt %"PRIu64, p->pcap_cnt); if (!(PKT_IS_TCP(p))) { return TM_ECODE_OK; } if (p->flow == NULL) { StatsIncr(tv...
0
7,760
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 i2d_ECParameters(EC_KEY *a, unsigned char **out) { if (a == NULL) { ECerr(EC_F_I2D_ECPARAMETERS, ERR_R_PASSED_NULL_PARAMETER); return 0; } return i2d_ECPKParameters(a->group, out); } Commit Message: CWE ID:
0
22,716
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 reflectedTreatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) { TestObject* imp = V8TestObject::toNative(info.Holder()); v8SetReturnValueString(info, imp->fastGetAttribute(HTMLNames::reflectedtreatnullasnullstringtreatundefin...
0
4,322
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: NetworkView* OobeUI::GetNetworkView() { return network_view_; } Commit Message: One polymer_config.js to rule them all. R=michaelpg@chromium.org,fukino@chromium.org,mfoltz@chromium.org BUG=425626 Review URL: https://codereview.chromium.org/1224783005 Cr-Commit-Position: refs/heads/master@{#337882} CWE ID: C...
0
10,324
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 tref_del(GF_Box *s) { GF_TrackReferenceBox *ptr = (GF_TrackReferenceBox *)s; if (ptr == NULL) return; gf_free(ptr); } Commit Message: fixed 2 possible heap overflows (inc. #1088) CWE ID: CWE-125
0
4,925
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 dump_masked_av_helper(void *k, void *d, void *args) { struct perm_datum *pdatum = d; char **permission_names = args; BUG_ON(pdatum->value < 1 || pdatum->value > 32); permission_names[pdatum->value - 1] = (char *)k; return 0; } Commit Message: SELinux: Fix kernel BUG on empty security contexts...
0
12,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: ExecutableAllocator::~ExecutableAllocator() { } Commit Message: Add missing sys/mman.h include on Mac https://bugs.webkit.org/show_bug.cgi?id=98089 Patch by Jonathan Liu <net147@gmail.com> on 2013-01-16 Reviewed by Darin Adler. The madvise function and MADV_FREE constant require sys/mman.h. * jit/ExecutableAl...
0
19,366
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 DownloadManagerImpl::ImportInProgressDownloads(uint32_t id) { for (auto& download : in_progress_downloads_) { auto item = std::move(download); if (item->GetId() == download::DownloadItem::kInvalidId) { item->SetDownloadId(id++); next_download_id_++; if (!should_persist_new_downloa...
0
27,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: static void conditionalOrLongAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) { ExceptionState exceptionState(ExceptionState::SetterContext, "conditionalOrLongAttribute", "TestObjectPython", info.Holder(), info.GetIsolate()); TestObjectPython* imp = V8Test...
0
3,748
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 ExtensionList* ExtensionService::terminated_extensions() const { return &terminated_extensions_; } Commit Message: Limit extent of webstore app to just chrome.google.com/webstore. BUG=93497 TEST=Try installing extensions and apps from the webstore, starting both being initially logged in, and not. Rev...
0
13,648
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: pdf14_create_clist_device(gs_memory_t *mem, gs_gstate * pgs, gx_device ** ppdev, gx_device * target, const gs_pdf14trans_t * pdf14pct) { pdf14_clist_device * dev_proto; pdf14_clist_device * pdev, temp_dev_proto; int code; bool has_tag...
0
19,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: void ChromeDownloadManagerDelegate::CheckClientDownloadDone( int32 download_id, DownloadProtectionService::DownloadCheckResult result) { DownloadItem* item = download_manager_->GetDownload(download_id); if (!item || (item->GetState() != DownloadItem::IN_PROGRESS)) return; VLOG(2) << __FUNCTION_...
0
22,512
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 u64 btrfs_inc_tree_mod_seq(struct btrfs_fs_info *fs_info) { return atomic64_inc_return(&fs_info->tree_mod_seq); } Commit Message: Btrfs: make xattr replace operations atomic Replacing a xattr consists of doing a lookup for its existing value, delete the current value from the respective leaf, rel...
0
4,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: void HeapDoesNotContainCache::addEntry(Address address) { ASSERT(ThreadState::current()->isInGC()); m_hasEntries = true; size_t index = hash(address); ASSERT(!(index & 1)); Address cachePage = roundToBlinkPageStart(address); m_entries[index + 1] = m_entries[index]; m_entries[index] = cachePage; } ...
0
12,444
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 ChromeRenderMessageFilter::OnCanTriggerClipboardRead( const GURL& origin, bool* allowed) { *allowed = extension_info_map_->SecurityOriginHasAPIPermission( origin, render_process_id_, APIPermission::kClipboardRead); } Commit Message: Disable tcmalloc profile files. BUG=154983 TBR=darin@chromium....
0
6,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: int32 RenderThread::RoutingIDForCurrentContext() { int32 routing_id = MSG_ROUTING_CONTROL; if (v8::Context::InContext()) { WebFrame* frame = WebFrame::frameForCurrentContext(); if (frame) { RenderView* view = RenderView::FromWebView(frame->view()); if (view) routing_id = view->rout...
0
9,985
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: process_remove_identity(SocketEntry *e, int version) { size_t blen; int r, success = 0; struct sshkey *key = NULL; u_char *blob; #ifdef WITH_SSH1 u_int bits; #endif /* WITH_SSH1 */ switch (version) { #ifdef WITH_SSH1 case 1: if ((key = sshkey_new(KEY_RSA1)) == NULL) { error("%s: sshkey_new failed", _...
0
26,483
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 regulator_notifier_call_chain(struct regulator_dev *rdev, unsigned long event, void *data) { _notifier_call_chain(rdev, event, data); return NOTIFY_DONE; } Commit Message: regulator: core: Fix regualtor_ena_gpio_free not to access pin after freeing After freeing pin from regulator_ena_gpio_free, lo...
0
26,392
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::CreateRenderViewForRenderManager( RenderViewHost* render_view_host, int opener_route_id) { TRACE_EVENT0("browser", "WebContentsImpl::CreateRenderViewForRenderManager"); RenderWidgetHostView* rwh_view = view_->CreateViewForWidget(render_view_host); if (rwh_view) rwh_view->SetSi...
0
21,018
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: MPEG4Source::MPEG4Source( const sp<MetaData> &format, const sp<DataSource> &dataSource, int32_t timeScale, const sp<SampleTable> &sampleTable, Vector<SidxEntry> &sidx, off64_t firstMoofOffset) : mFormat(format), mDataSource(dataSource), mTimescale(timeScale), mSampleTable(sampleTable), ...
0
13,881
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 WebGraphicsContext3DCommandBufferImpl::OnContextLost( ContentGLContext::ContextLostReason reason) { context_lost_reason_ = convertReason(reason); if (context_lost_callback_) { context_lost_callback_->onContextLost(); } if (attributes_.shareResources) ClearSharedContexts(); if (ShouldUse...
0
15,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: void GranularityStrategyTest::TestDirectionShrink() { Selection().MoveRangeSelectionExtent(word_middles_[4]); EXPECT_EQ_SELECTED_TEXT("pqr iiinmni"); IntPoint p = word_middles_[4]; p.Move(letter_pos_[28].X() - letter_pos_[29].X(), 0); Selection().MoveRangeSelectionExtent(p); EXPECT_EQ_SELECTED_TEXT("p...
0
2,489
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 fm10k_init_queueing_scheme(struct fm10k_intfc *interface) { int err; /* Number of supported queues */ fm10k_set_num_queues(interface); /* Configure MSI-X capability */ err = fm10k_init_msix_capability(interface); if (err) { dev_err(&interface->pdev->dev, "Unable to initialize MSI-X capability\n")...
0
19,785
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 MediaStreamManager::WillDestroyCurrentMessageLoop() { DVLOG(3) << "MediaStreamManager::WillDestroyCurrentMessageLoop()"; DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO) || !BrowserThread::IsThreadInitialized(BrowserThread::IO)); if (media_devices_manager_) media_devices_manager_->Stop...
0
29,778
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: newhnamemem(netdissect_options *ndo) { register struct hnamemem *p; static struct hnamemem *ptr = NULL; static u_int num = 0; if (num <= 0) { num = 64; ptr = (struct hnamemem *)calloc(num, sizeof (*ptr)); if (ptr == NULL) (*ndo->ndo_error)(ndo, "newhnamemem: calloc"); } --num; p = ptr++; return...
0
24,672
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 set_tsc_khz(struct kvm_vcpu *vcpu, u32 user_tsc_khz, bool scale) { u64 ratio; /* Guest TSC same frequency as host TSC? */ if (!scale) { vcpu->arch.tsc_scaling_ratio = kvm_default_tsc_scaling_ratio; return 0; } /* TSC scaling supported? */ if (!kvm_has_tsc_control) { if (user_tsc_khz > tsc...
0
20,004
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 ChromeClientImpl::didChangeValueInTextField(HTMLInputElement& inputElement) { if (!m_webView->autofillClient()) return; m_webView->autofillClient()->textFieldDidChange(WebInputElement(&inputElement)); } Commit Message: Delete apparently unused geolocation declarations and include. BUG=33626...
0
28,000
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::DispatchEventsForPrinting() { if (!scripted_animation_controller_) return; scripted_animation_controller_->DispatchEventsAndCallbacksForPrinting(); } Commit Message: Cleanup and remove dead code in SetFocusedElement This early-out was added in: https://crrev.com/ce8ea3446283965c7eabab592...
0
27,166
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 is_marantz_denon_dac(unsigned int id) { switch (id) { case USB_ID(0x154e, 0x1003): /* Denon DA-300USB */ case USB_ID(0x154e, 0x3005): /* Marantz HD-DAC1 */ case USB_ID(0x154e, 0x3006): /* Marantz SA-14S1 */ return true; } return false; } Commit Message: ALSA: usb-audio: Fix NULL dereference i...
0
26,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: magic_close(struct magic_set *ms) { if (ms == NULL) return; file_ms_free(ms); } Commit Message: - Add a limit to the number of ELF notes processed (Suggested by Alexander Cherepanov) - Restructure ELF note printing so that we don't print the same message multiple times on repeated notes of the same kind....
0
7,133
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 RenderFrameHostImpl::UpdatePendingWebUI(const GURL& dest_url, int entry_bindings) { WebUI::TypeID new_web_ui_type = WebUIControllerFactoryRegistry::GetInstance()->GetWebUIType( GetSiteInstance()->GetBrowserContext(), dest_url); if (new_web_ui_...
0
20,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: static int fixup_bpf_calls(struct bpf_verifier_env *env) { struct bpf_prog *prog = env->prog; struct bpf_insn *insn = prog->insnsi; const struct bpf_func_proto *fn; const int insn_cnt = prog->len; const struct bpf_map_ops *ops; struct bpf_insn_aux_data *aux; struct bpf_insn insn_buf[16]; struct bpf_prog *...
1
12,147
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 mif_hdr_t *mif_makehdrfromimage(jas_image_t *image) { mif_hdr_t *hdr; int cmptno; mif_cmpt_t *cmpt; if (!(hdr = mif_hdr_create(jas_image_numcmpts(image)))) { return 0; } hdr->magic = MIF_MAGIC; hdr->numcmpts = jas_image_numcmpts(image); for (cmptno = 0; cmptno < hdr->numcmpts; ++cmptno) { hdr-...
0
4,047
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: OutOfProcessInstance::OutOfProcessInstance(PP_Instance instance) : pp::Instance(instance), pp::Find_Private(this), pp::Printing_Dev(this), cursor_(PP_CURSORTYPE_POINTER), zoom_(1.0), device_scale_(1.0), full_(false), paint_manager_(this, this, true), first_paint...
0
24,260
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 RELOC_PTRS_BEGIN(pattern2_instance_reloc_ptrs) { RELOC_PREFIX(st_pattern_instance); RELOC_SUPER(gs_pattern2_instance_t, st_pattern2_template, templat); } RELOC_PTRS_END Commit Message: CWE ID: CWE-704
0
2,096
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: t1_parse_font_matrix( T1_Face face, T1_Loader loader ) { T1_Parser parser = &loader->parser; FT_Matrix* matrix = &face->type1.font_matrix; FT_Vector* offset = &face->type1.font_offset; FT_Face root = (FT_Face)&face->root; FT_Fixed temp[6]; FT_Fi...
1
19,472
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 RenderFrameHostImpl::IsCrossProcessSubframe() { if (!parent_) return false; return GetSiteInstance() != parent_->GetSiteInstance(); } Commit Message: Correctly reset FP in RFHI whenever origin changes Bug: 713364 Change-Id: Id8bb923750e20f3db6fc9358b1d44120513ac95f CQ_INCLUDE_TRYBOTS=master.tryser...
0
2,213