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 void *sgpd_parse_entry(u32 grouping_type, GF_BitStream *bs, u32 entry_size, u32 *total_bytes) { Bool null_size_ok = GF_FALSE; GF_DefaultSampleGroupDescriptionEntry *ptr; switch (grouping_type) { case GF_ISOM_SAMPLE_GROUP_ROLL: case GF_ISOM_SAMPLE_GROUP_PROL: { GF_RollRecoveryEntry *ptr; GF_SAFEA...
0
80,406
Analyze the following 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 long gfn_to_hva_memslot(struct kvm_memory_slot *slot, gfn_t gfn) { return gfn_to_hva_many(slot, gfn, NULL); } Commit Message: KVM: use after free in kvm_ioctl_create_device() We should move the ops->destroy(dev) after the list_del(&dev->vm_node) so that we don't use "dev" after freeing it. Fixes...
0
71,175
Analyze the following 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 DiscardableSharedMemoryManager::SetMemoryLimit(size_t limit) { base::AutoLock lock(lock_); memory_limit_ = limit; ReduceMemoryUsageUntilWithinMemoryLimit(); } Commit Message: Correct mojo::WrapSharedMemoryHandle usage Fixes some incorrect uses of mojo::WrapSharedMemoryHandle which were assuming that...
0
149,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: status_t MediaRecorder::release() { ALOGV("release"); if (mMediaRecorder != NULL) { return mMediaRecorder->release(); } return INVALID_OPERATION; } Commit Message: Don't use sp<>& because they may end up pointing to NULL after a NULL check was performed. Bug: 28166152 Change-Id: Iab2ea30395b620628cc6f3...
0
159,533
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: evutil_adjust_hints_for_addrconfig_(struct evutil_addrinfo *hints) { if (!(hints->ai_flags & EVUTIL_AI_ADDRCONFIG)) return; if (hints->ai_family != PF_UNSPEC) return; if (!have_checked_interfaces) evutil_check_interfaces(0); if (had_ipv4_address && !had_ipv6_address) { hints->ai_family = PF_INET; } e...
0
70,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: std::string PrintPropList(IBusPropList *prop_list, int tree_level) { if (!prop_list) { return ""; } std::stringstream stream; for (int i = 0;; ++i) { IBusProperty* prop = ibus_prop_list_get(prop_list, i); if (!prop) { break; } stream << PrintProp(prop, tree_level); } return ...
0
100,863
Analyze the following 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 sprint_nip(char *dest, const char *pre, const uint8_t *ip) { return sprintf(dest, "%s%u.%u.%u.%u", pre, ip[0], ip[1], ip[2], ip[3]); } Commit Message: CWE ID: CWE-125
0
8,779
Analyze the following 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 WebGLRenderingContextBase::PaintRenderingResultsToCanvas( SourceDrawingBuffer source_buffer) { if (isContextLost()) return false; bool must_clear_now = ClearIfComposited() != kSkipped; if (!marked_canvas_dirty_ && !must_clear_now) return false; canvas()->ClearCopiedImage(); marked_can...
0
133,661
Analyze the following 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 IsIDNComponentSafe(base::StringPiece16 label, bool is_tld_ascii) { return g_idn_spoof_checker.Get().SafeToDisplayAsUnicode(label, is_tld_ascii); } Commit Message: Restrict Latin Small Letter Thorn (U+00FE) to Icelandic domains This character (þ) can be confused with both b and p when used in a domain na...
1
172,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: Color Document::themeColor() const { for (HTMLMetaElement* metaElement = head() ? Traversal<HTMLMetaElement>::firstChild(*head()) : 0; metaElement; metaElement = Traversal<HTMLMetaElement>::nextSibling(*metaElement)) { RGBA32 rgb = Color::transparent; if (equalIgnoringCase(metaElement->name(),...
0
125,313
Analyze the following 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::State ExtensionPrefs::GetExtensionState( const std::string& extension_id) const { const DictionaryValue* extension = GetExtensionPref(extension_id); if (!extension) return Extension::ENABLED; int state = -1; if (!extension->GetInteger(kPrefState, &state) || state < 0 || state >=...
0
98,407
Analyze the following 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 neighbour *ipv4_neigh_lookup(const struct dst_entry *dst, const void *daddr) { struct neigh_table *tbl = &arp_tbl; static const __be32 inaddr_any = 0; struct net_device *dev = dst->dev; const __be32 *pkey = daddr; struct neighbour *n; #if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MOD...
0
25,139
Analyze the following 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 orinoco_ioctl_getessid(struct net_device *dev, struct iw_request_info *info, struct iw_point *erq, char *essidbuf) { struct orinoco_private *priv = ndev_priv(dev); int active; int err = 0; unsigned long flags; if (netif_running(dev)) { err = orinoco_hw_get_essid(priv, &active,...
0
27,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: void mem_cgroup_sockets_destroy(struct mem_cgroup *memcg) { struct proto *proto; mutex_lock(&proto_list_mutex); list_for_each_entry_reverse(proto, &proto_list, node) if (proto->destroy_cgroup) proto->destroy_cgroup(memcg); mutex_unlock(&proto_list_mutex); } Commit Message: net: sock: validate data_len ...
0
20,119
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WORD32 ihevcd_allocate_dynamic_bufs(codec_t *ps_codec) { WORD32 max_tile_cols, max_tile_rows; WORD32 max_ctb_rows, max_ctb_cols; WORD32 max_num_cu_cols; WORD32 max_num_cu_rows; WORD32 max_num_4x4_cols; WORD32 max_ctb_cnt; WORD32 wd; WORD32 ht; WORD32 i; WORD32 max_dpb_size;...
0
163,301
Analyze the following 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(openssl_pkey_get_details) { zval *key; EVP_PKEY *pkey; BIO *out; unsigned int pbio_len; char *pbio; long ktype; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &key) == FAILURE) { return; } ZEND_FETCH_RESOURCE(pkey, EVP_PKEY *, &key, -1, "OpenSSL key", le_key); if (!pkey) { R...
0
117
Analyze the following 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 append_ptyname(char **pp, char *name) { char *p; if (!*pp) { *pp = malloc(strlen(name) + strlen("container_ttys=") + 1); if (!*pp) return false; sprintf(*pp, "container_ttys=%s", name); return true; } p = realloc(*pp, strlen(*pp) + strlen(name) + 2); if (!p) return false; *pp = p; ...
0
44,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 ssize_t proc_sessionid_read(struct file * file, char __user * buf, size_t count, loff_t *ppos) { struct inode * inode = file->f_path.dentry->d_inode; struct task_struct *task = get_proc_task(inode); ssize_t length; char tmpbuf[TMPBUFLEN]; if (!task) return -ESRCH; length = scnprintf(tmpbuf, ...
0
26,889
Analyze the following 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 short lebytes2ushort(const u8 *buf) { if (buf == NULL) return 0U; return (unsigned short)buf[1] << 8 | (unsigned short)buf[0]; } Commit Message: fixed out of bounds writes Thanks to Eric Sesterhenn from X41 D-SEC GmbH for reporting the problems. CWE ID: CWE-415
0
78,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 transport_attach(rdpTransport* transport, int sockfd) { transport->TcpIn->sockfd = sockfd; transport->SplitInputOutput = FALSE; transport->TcpOut = transport->TcpIn; } Commit Message: nla: invalidate sec handle after creation If sec pointer isn't invalidated after creation it is not possible to check i...
0
58,552
Analyze the following 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 nfs4_free_lock_state(struct nfs4_lock_state *lsp) { struct nfs_client *clp = lsp->ls_state->owner->so_client; spin_lock(&clp->cl_lock); nfs_free_unique_id(&clp->cl_lockowner_id, &lsp->ls_id); spin_unlock(&clp->cl_lock); rpc_destroy_wait_queue(&lsp->ls_sequence.wait); kfree(lsp); } Commit Messa...
0
22,935
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: uint64_t Histogram::name_hash() const { return samples_->id(); } Commit Message: Convert DCHECKs to CHECKs for histogram types When a histogram is looked up by name, there is currently a DCHECK that verifies the type of the stored histogram matches the expected type. A mismatch represents a significant probl...
0
140,082
Analyze the following 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 multicast_join(int sd, struct sockaddr *sa) { struct ip_mreqn mreq; struct sockaddr_in *sin = (struct sockaddr_in *)sa; memset(&mreq, 0, sizeof(mreq)); mreq.imr_address = sin->sin_addr; mreq.imr_multiaddr.s_addr = inet_addr(MC_SSDP_GROUP); if (setsockopt(sd, IPPROTO_IP, IP_ADD_MEMBERSHIP,...
0
88,802
Analyze the following 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 Con_PageDown( void ) { con.display += 2; if ( con.display > con.current ) { con.display = con.current; } } Commit Message: All: Merge some file writing extension checks CWE ID: CWE-269
0
95,581
Analyze the following 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 GahpClient::dcloud_get_max_name_length( const char *service_url, const char *username, const char *password, int *max_length ) { static const char* command = "DELTACLOUD_GET_MAX_NAME_LENGTH"; if ( server->m_commands_supported->contains_anycase( command ) == FALSE ) { retu...
0
16,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: SettingLevelBubbleDelegateView::~SettingLevelBubbleDelegateView() { view_ = NULL; } Commit Message: chromeos: Move audio, power, and UI files into subdirs. This moves more files from chrome/browser/chromeos/ into subdirectories. BUG=chromium-os:22896 TEST=did chrome os builds both with and without aura TBR=s...
0
109,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: static struct port *find_port_by_vtermno(u32 vtermno) { struct port *port; struct console *cons; unsigned long flags; spin_lock_irqsave(&pdrvdata_lock, flags); list_for_each_entry(cons, &pdrvdata.consoles, list) { if (cons->vtermno == vtermno) { port = container_of(cons, struct port, cons); goto out...
0
66,588
Analyze the following 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 long VideoTrack::GetWidth() const { return m_width; } Commit Message: external/libvpx/libwebm: Update snapshot Update libwebm snapshot. This update contains security fixes from upstream. Upstream git hash: 229f49347d19b0ca0941e072b199a242ef6c5f2b BUG=23167726 Change-Id: Id3e140e7b31ae11294724b1ecfe2e9c8...
0
160,822
Analyze the following 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 GLES2DecoderImpl::DoPopGroupMarkerEXT(void) { debug_marker_manager_.PopGroup(); } Commit Message: Fix SafeAdd and SafeMultiply BUG=145648,145544 Review URL: https://chromiumcodereview.appspot.com/10916165 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155478 0039d316-1c4b-4281-b951-d872f2087c98 C...
0
103,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 struct kvm_vcpu *vmx_create_vcpu(struct kvm *kvm, unsigned int id) { int err; struct vcpu_vmx *vmx = kmem_cache_zalloc(kvm_vcpu_cache, GFP_KERNEL); int cpu; if (!vmx) return ERR_PTR(-ENOMEM); allocate_vpid(vmx); err = kvm_vcpu_init(&vmx->vcpu, kvm, id); if (err) goto free_vcpu; vmx->guest_m...
0
37,230
Analyze the following 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 cc::LayerTreeDebugState& Compositor::GetLayerTreeDebugState() const { return host_->GetDebugState(); } Commit Message: Fix PIP window being blank after minimize/show DesktopWindowTreeHostX11::SetVisible only made the call into OnNativeWidgetVisibilityChanged when transitioning from shown to minimized an...
0
140,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 struct dentry *isofs_export_get_parent(struct dentry *child) { unsigned long parent_block = 0; unsigned long parent_offset = 0; struct inode *child_inode = child->d_inode; struct iso_inode_info *e_child_inode = ISOFS_I(child_inode); struct iso_directory_record *de = NULL; struct buffer_head * bh = NU...
0
34,070
Analyze the following 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 SetCloseOnExec(nacl::Handle fd) { #if defined(OS_POSIX) int flags = fcntl(fd, F_GETFD); CHECK_NE(flags, -1); int rc = fcntl(fd, F_SETFD, flags | FD_CLOEXEC); CHECK_EQ(rc, 0); #endif } Commit Message: Revert 143656 - Add an IPC channel between the NaCl loader process and the renderer. BUG=116317 TEST...
0
103,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: xfs_file_open( struct inode *inode, struct file *file) { if (!(file->f_flags & O_LARGEFILE) && i_size_read(inode) > MAX_NON_LFS) return -EFBIG; if (XFS_FORCED_SHUTDOWN(XFS_M(inode->i_sb))) return -EIO; return 0; } Commit Message: ->splice_write() via ->write_iter() iter_file_splice_write() - a ->splice...
0
46,441
Analyze the following 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 task_will_free_mem(struct task_struct *task) { struct mm_struct *mm = task->mm; struct task_struct *p; bool ret = true; /* * Skip tasks without mm because it might have passed its exit_mm and * exit_oom_victim. oom_reaper could have rescued that but do not rely * on that for now. We can con...
0
85,997
Analyze the following 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 tg3_stop_block(struct tg3 *tp, unsigned long ofs, u32 enable_bit, int silent) { unsigned int i; u32 val; if (tg3_flag(tp, 5705_PLUS)) { switch (ofs) { case RCVLSC_MODE: case DMAC_MODE: case MBFREE_MODE: case BUFMGR_MODE: case MEMARB_MODE: /* We can't enable/disable these bits of the ...
0
32,770
Analyze the following 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 AuthenticatorBlePairingBeginSheetModel::IsAcceptButtonEnabled() const { return true; } Commit Message: chrome/browser/ui/webauthn: long domains may cause a line break. As requested by UX in [1], allow long host names to split a title into two lines. This allows us to show more of the name before eliding,...
0
142,942
Analyze the following 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 sock *x25_find_socket(unsigned int lci, struct x25_neigh *nb) { struct sock *s; read_lock_bh(&x25_list_lock); s = __x25_find_socket(lci, nb); read_unlock_bh(&x25_list_lock); return s; } Commit Message: net: rework recvmsg handler msg_name and msg_namelen logic This patch now always passes msg->msg_...
0
40,779
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: AcpiNsValidateHandle ( ACPI_HANDLE Handle) { ACPI_FUNCTION_ENTRY (); /* Parameter validation */ if ((!Handle) || (Handle == ACPI_ROOT_OBJECT)) { return (AcpiGbl_RootNode); } /* We can at least attempt to verify the handle */ if (ACPI_GET_DESCRIPTOR_TYPE (H...
0
95,296
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: FT_Stream_ReadShort( FT_Stream stream, FT_Error* error ) { FT_Byte reads[2]; FT_Byte* p = 0; FT_Short result = 0; FT_ASSERT( stream ); *error = FT_Err_Ok; if ( stream->pos + 1 < stream->size ) { if ( stream->read ) { if ( stream-...
0
9,711
Analyze the following 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 dref_Read(GF_Box *s, GF_BitStream *bs) { GF_DataReferenceBox *ptr = (GF_DataReferenceBox *)s; if (ptr == NULL) return GF_BAD_PARAM; gf_bs_read_u32(bs); ISOM_DECREASE_SIZE(ptr, 4); return gf_isom_box_array_read(s, bs, dref_AddDataEntry); } Commit Message: fixed 2 possible heap overflows (inc. #1088)...
0
80,067
Analyze the following 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 RenderProcessHostImpl::AppendRendererCommandLine( CommandLine* command_line) const { command_line->AppendSwitchASCII(switches::kProcessType, switches::kRendererProcess); if (is_guest_) command_line->AppendSwitch(switches::kGuestRenderer); const CommandLine& br...
0
114,508
Analyze the following 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 Camera2Client::calculateBufferSize(int width, int height, int format, int stride) { switch (format) { case HAL_PIXEL_FORMAT_YCbCr_422_SP: // NV16 return width * height * 2; case HAL_PIXEL_FORMAT_YCrCb_420_SP: // NV21 return width * height * 3 / 2; case HAL_PIXEL_FORMAT_YCbCr_422_I: // YUY2 return w...
0
161,712
Analyze the following 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 igmp_group_added(struct ip_mc_list *im) { struct in_device *in_dev = im->interface; if (im->loaded == 0) { im->loaded = 1; ip_mc_filter_add(in_dev, im->multiaddr); } #ifdef CONFIG_IP_MULTICAST if (im->multiaddr == IGMP_ALL_HOSTS) return; if (in_dev->dead) return; if (IGMP_V1_SEEN(in_d...
0
21,588
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: lazy_stat(struct archive_write_disk *a) { if (a->pst != NULL) { /* Already have stat() data available. */ return (ARCHIVE_OK); } #ifdef HAVE_FSTAT if (a->fd >= 0 && fstat(a->fd, &a->st) == 0) { a->pst = &a->st; return (ARCHIVE_OK); } #endif /* * XXX At this point, symlinks should not be hit, otherw...
0
43,924
Analyze the following 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 OnSwapOutACKHelper(int render_process_id, int render_view_id, bool timed_out) { RenderViewHostImpl* rvh = RenderViewHostImpl::FromID(render_process_id, render_view_id); if (rvh) rvh->OnSwapOutACK(ti...
0
115,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 int xen_netbk_tx_check_gop(struct xen_netbk *netbk, struct sk_buff *skb, struct gnttab_copy **gopp) { struct gnttab_copy *gop = *gopp; u16 pending_idx = *((u16 *)skb->data); struct pending_tx_info *pending_tx_info = netbk->pending_tx_info; struct xenvif *vif = pending_tx_info[pending_idx].v...
0
34,042
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: kadm5_get_principal_keys(void *server_handle /* IN */, krb5_principal principal /* IN */, krb5_kvno kvno /* IN */, kadm5_key_data **key_data_out /* OUT */, int *n_key_data_out /* OUT */) { krb5_db_entry ...
0
84,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: void PrintJobWorker::OnDocumentChanged(PrintedDocument* new_document) { DCHECK(task_runner_->RunsTasksInCurrentSequence()); DCHECK_EQ(page_number_, PageNumber::npos()); if (page_number_ != PageNumber::npos()) return; document_ = new_document; } Commit Message: If JavaScript shows a dialog, cause th...
0
135,590
Analyze the following 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 ChromeMetricsServiceClient::OnMemoryDetailCollectionDone() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(waiting_for_collect_final_metrics_step_); base::Closure callback = base::Bind( &ChromeMetricsServiceClient::OnHistogramSynchronizationDone, weak_ptr_factory_.GetWeakPtr(...
0
130,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: void skb_set_owner_w(struct sk_buff *skb, struct sock *sk) { skb_orphan(skb); skb->sk = sk; #ifdef CONFIG_INET if (unlikely(!sk_fullsock(sk))) { skb->destructor = sock_edemux; sock_hold(sk); return; } #endif skb->destructor = sock_wfree; skb_set_hash_from_sk(skb, sk); /* * We used to take a refcoun...
0
47,887
Analyze the following 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 MagickBooleanType DrawAffineImage(Image *image, const Image *source,const AffineMatrix *affine) { AffineMatrix inverse_affine; CacheView *image_view, *source_view; ExceptionInfo *exception; MagickBooleanType status; MagickPixelPacket zero; PointInfo exte...
0
71,993
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: extract_job_on_error (AutoarExtractor *extractor, GError *error, gpointer user_data) { ExtractJob *extract_job = user_data; GFile *source_file; gint response_id; source_file = autoar_extractor_get_source_file (extractor); if (IS_IO...
0
61,055
Analyze the following 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 lxc_attach(const char* name, const char* lxcpath, lxc_attach_exec_t exec_function, void* exec_payload, lxc_attach_options_t* options, pid_t* attached_process) { int ret, status; pid_t init_pid, pid, attached_pid, expected; struct lxc_proc_context_info *init_ctx; char* cwd; char* new_cwd; int ipc_sock...
1
168,772
Analyze the following 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_apache_sapi_get_stat(TSRMLS_D) { php_struct *ctx = SG(server_context); ctx->finfo.st_uid = ctx->r->finfo.user; ctx->finfo.st_gid = ctx->r->finfo.group; ctx->finfo.st_dev = ctx->r->finfo.device; ctx->finfo.st_ino = ctx->r->finfo.inode; #if defined(NETWARE) && defined(CLIB_STAT_PATCH) ctx->finfo.st_atime...
0
3,380
Analyze the following 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 ChromeContentRendererClient::RenderThreadStarted() { chrome_observer_.reset(new ChromeRenderProcessObserver()); extension_dispatcher_.reset(new ExtensionDispatcher()); histogram_snapshots_.reset(new RendererHistogramSnapshots()); net_predictor_.reset(new RendererNetPredictor()); spellcheck_.reset(n...
1
170,323
Analyze the following 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::Home(WindowOpenDisposition disposition) { UserMetrics::RecordAction(UserMetricsAction("Home"), profile_); OpenURL(GetHomePage(), GURL(), disposition, PageTransition::AUTO_BOOKMARK); } Commit Message: chromeos: fix bug where "aw snap" page replaces first tab if it was a NTP when closing window w...
0
98,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: StreamPredictor::~StreamPredictor() { gfree(predLine); } Commit Message: CWE ID: CWE-119
0
4,084
Analyze the following 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 LauncherView::GetOverflowItems(std::vector<LauncherItem>* items) { int index = 0; while (index < view_model_->view_size() && view_model_->view_at(index)->visible()) { index++; } while (index < view_model_->view_size()) { const LauncherItem& item = model_->items()[index]; if (item...
0
106,237
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: copy_files (CopyMoveJob *job, const char *dest_fs_id, SourceInfo *source_info, TransferInfo *transfer_info) { CommonJob *common; GList *l; GFile *src; gboolean same_fs; int i; GdkPoint *point; gboolean skipped_file; gboolean unique_names; ...
0
61,023
Analyze the following 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_walk_next(struct skcipher_walk *walk) { unsigned int bsize; unsigned int n; int err; walk->flags &= ~(SKCIPHER_WALK_SLOW | SKCIPHER_WALK_COPY | SKCIPHER_WALK_DIFF); n = walk->total; bsize = min(walk->stride, max(n, walk->blocksize)); n = scatterwalk_clamp(&walk->in, n); n = scatt...
0
64,817
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GLES2Decoder::GLES2Decoder() : initialized_(false), debug_(false), log_commands_(false) { } Commit Message: Framebuffer clear() needs to consider the situation some draw buffers are disabled. This is when we expose DrawBuffers extension. BUG=376951 TEST=the attached test case, webgl conformance...
0
120,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 daemonize(void) { int fd; if (fork() != 0) exit(0); /* parent exits */ setsid(); /* create a new session */ /* Every output goes to /dev/null. If Redis is daemonized but * the 'logfile' is set to 'stdout' in the configuration file * it will not log at all. */ if ((fd = open("/...
0
70,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: void RenderFrameImpl::willSendSubmitEvent(blink::WebLocalFrame* frame, const blink::WebFormElement& form) { DCHECK(!frame_ || frame_ == frame); FOR_EACH_OBSERVER(RenderFrameObserver, observers_, WillSendSubmitEvent(form)); } Commit Message: Connect WebUSB client int...
0
123,275
Analyze the following 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 PageFormAnalyserLogger::Send(std::string message, ConsoleLevel level, std::vector<blink::WebNode> nodes) { node_buffer_[level].push_back(LogEntry{std::move(message), std::move(nodes)}); } Commit Message: [AF] Prevent Logging Password Valu...
0
130,484
Analyze the following 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 IsMotionEvent(XEvent* event) { int type = event->type; if (type == GenericEvent) type = event->xgeneric.evtype; return type == MotionNotify; } Commit Message: Make shared memory segments writable only by their rightful owners. BUG=143859 TEST=Chrome's UI still works on Linux and Chrome OS Review ...
0
119,196
Analyze the following 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 sock *sctp_v6_create_accept_sk(struct sock *sk, struct sctp_association *asoc) { struct sock *newsk; struct ipv6_pinfo *newnp, *np = inet6_sk(sk); struct sctp6_sock *newsctp6sk; newsk = sk_alloc(sock_net(sk), PF_INET6, GFP_KERNEL, sk->sk_prot); if (!newsk) goto out; sock_init_dat...
0
29,637
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: AP_CORE_DECLARE(conn_rec *) ap_create_slave_connection(conn_rec *c) { apr_pool_t *pool; conn_slave_rec *new; conn_rec *sc = (conn_rec *) apr_palloc(c->pool, sizeof(conn_rec)); apr_pool_create(&pool, c->pool); apr_pool_tag(pool, "slave_conn"); memcpy(sc, c, sizeof(conn_rec)); sc->slave...
0
64,189
Analyze the following 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 hns_gmac_get_stats(void *mac_drv, u64 *data) { u32 i; u64 *buf = data; struct mac_driver *drv = (struct mac_driver *)mac_drv; struct mac_hw_stats *hw_stats = NULL; hw_stats = &drv->mac_cb->hw_stats; for (i = 0; i < ARRAY_SIZE(g_gmac_stats_string); i++) { buf[i] = DSAF_STATS_READ(hw_stats, ...
0
85,545
Analyze the following 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 Location::href(USVStringOrTrustedURL& result) const { result.SetUSVString(Url().StrippedForUseAsHref()); } Commit Message: Check the source browsing context's CSP in Location::SetLocation prior to dispatching a navigation to a `javascript:` URL. Makes `javascript:` navigations via window.location.href co...
0
152,589
Analyze the following 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 check_network(Bridge *br) { assert(br); if (br->macvlan == 0) // for bridge devices check network range or arp-scan and assign address net_configure_sandbox_ip(br); else if (br->ipsandbox) { // for macvlan check network range char *rv = in_netrange(br->ipsandbox, br->ip, br->mask); if (rv) { ...
0
69,262
Analyze the following 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::HandleDestroyStreamTextureCHROMIUM( uint32 immediate_data_size, const gles2::DestroyStreamTextureCHROMIUM& c) { GLuint client_id = c.texture; TextureManager::TextureInfo* info = texture_manager()->GetTextureInfo(client_id); if (info && info->IsStreamTexture()) { ...
0
109,008
Analyze the following 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 nx842_crypto_compress(struct crypto_tfm *tfm, const u8 *src, unsigned int slen, u8 *dst, unsigned int *dlen) { struct nx842_ctx *ctx = crypto_tfm_ctx(tfm); struct nx842_crypto_header *hdr; unsigned int tmp_len = *dlen; size_t lzodlen; /* needed for lzo */ int err; *dlen = 0; hdr = (struc...
0
47,093
Analyze the following 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 adjust_ptr_min_max_vals(struct bpf_verifier_env *env, struct bpf_insn *insn, const struct bpf_reg_state *ptr_reg, const struct bpf_reg_state *off_reg) { struct bpf_reg_state *regs = cur_regs(env), *dst_reg; bool known = tnum_is_const(off_reg->var_off); s64 smin_val = off_reg->sm...
0
59,100
Analyze the following 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_count_voltages(struct regulator *regulator) { struct regulator_dev *rdev = regulator->rdev; if (rdev->desc->n_voltages) return rdev->desc->n_voltages; if (!rdev->supply) return -EINVAL; return regulator_count_voltages(rdev->supply); } Commit Message: regulator: core: Fix regualtor_ena_gp...
0
74,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: auth_popup_close(AuthData *auth_data) { ewk_auth_request_unref(auth_data->request); evas_object_del(auth_data->popup); free(auth_data); } Commit Message: [EFL][WK2] Add --window-size command line option to EFL MiniBrowser https://bugs.webkit.org/show_bug.cgi?id=100942 Patch by Mikhail Pozdnyakov <mi...
0
106,601
Analyze the following 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_try_move_page(struct fuse_copy_state *cs, struct page **pagep) { int err; struct page *oldpage = *pagep; struct page *newpage; struct pipe_buffer *buf = cs->pipebufs; struct address_space *mapping; pgoff_t index; unlock_request(cs->fc, cs->req); fuse_copy_finish(cs); err = buf->ops->con...
0
24,634
Analyze the following 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 unsigned int rfcomm_room(struct rfcomm_dlc *dlc) { /* We can't let it be zero, because we don't get a callback when tx_credits becomes nonzero, hence we'd never wake up */ return dlc->mtu * (dlc->tx_credits?:1); } Commit Message: Bluetooth: RFCOMM - Fix info leak in ioctl(RFCOMMGETDEVLIST) T...
0
94,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: rend_get_service_list_mutable(smartlist_t* substitute_service_list) { if (substitute_service_list) { return substitute_service_list; } /* If no special service list is provided, then just use the global one. */ if (BUG(!rend_service_list)) { /* No global HS list, which is a programmer error. */ ...
0
69,598
Analyze the following 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 sideband_progress_pkt(git_pkt **out, const char *line, size_t len) { git_pkt_progress *pkt; size_t alloclen; line++; len--; GITERR_CHECK_ALLOC_ADD(&alloclen, sizeof(git_pkt_progress), len); pkt = git__malloc(alloclen); GITERR_CHECK_ALLOC(pkt); pkt->type = GIT_PKT_PROGRESS; pkt->len = (int) ...
0
71,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: void CCLayerTreeHost::setNeedsCommitThenRedraw() { if (m_settings.enableCompositorThread) { TRACE_EVENT("CCLayerTreeHost::setNeedsRedraw", this, 0); m_proxy->setNeedsCommitThenRedraw(); } else m_client->scheduleComposite(); } Commit Message: [chromium] Fix shutdown race when posti...
0
97,813
Analyze the following 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 release_last_closed_stateid(struct nfs4_openowner *oo) { struct nfsd_net *nn = net_generic(oo->oo_owner.so_client->net, nfsd_net_id); struct nfs4_ol_stateid *s; spin_lock(&nn->client_lock); s = oo->oo_last_closed_stid; if (s) { list_del_init(&oo->oo_close_lru); oo->oo_last_closed_stid...
0
65,689
Analyze the following 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 unlink1(struct usbtest_dev *dev, int pipe, int size, int async) { struct urb *urb; struct completion completion; int retval = 0; init_completion(&completion); urb = simple_alloc_urb(testdev_to_usbdev(dev), pipe, size, 0); if (!urb) return -ENOMEM; urb->context = &completion; urb->complete...
0
59,873
Analyze the following 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 blk_mq_kick_requeue_list(struct request_queue *q) { kblockd_schedule_work(&q->requeue_work); } Commit Message: blk-mq: fix race between timeout and freeing request Inside timeout handler, blk_mq_tag_to_rq() is called to retrieve the request from one tag. This way is obviously wrong because the request can...
0
86,721
Analyze the following 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 enum s_alloc __visit_domain_allocation_hell(struct s_data *d, const struct cpumask *cpu_map) { #ifdef CONFIG_NUMA if (!alloc_cpumask_var(&d->domainspan, GFP_KERNEL)) return sa_none; if (!alloc_cpumask_var(&d->covered, GFP_KERNEL)) return sa_domainspan; if (!alloc_cpumask_var(&d->notcovered,...
0
22,314
Analyze the following 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 HTMLFormElement::removedFrom(ContainerNode* insertionPoint) { if (m_hasElementsAssociatedByParser) { Node& root = NodeTraversal::highestAncestorOrSelf(*this); if (!m_associatedElementsAreDirty) { FormAssociatedElement::List elements(associatedElements()); notifyFormRemovedFromTree(eleme...
0
142,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: void acpi_os_sleep(u64 ms) { msleep(ms); } Commit Message: acpi: Disable ACPI table override if securelevel is set From the kernel documentation (initrd_table_override.txt): If the ACPI_INITRD_TABLE_OVERRIDE compile option is true, it is possible to override nearly any ACPI table provided by the BIOS with...
0
53,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: sector_t dm_get_size(struct mapped_device *md) { return get_capacity(md->disk); } Commit Message: dm: fix race between dm_get_from_kobject() and __dm_destroy() The following BUG_ON was hit when testing repeat creation and removal of DM devices: kernel BUG at drivers/md/dm.c:2919! CPU: 7 PID: 750 Comm:...
0
85,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: static void sha256_transform(u32 *state, const u8 *input) { u32 a, b, c, d, e, f, g, h, t1, t2; u32 W[64]; int i; /* load the input */ for (i = 0; i < 16; i++) LOAD_OP(i, W, input); /* now blend */ for (i = 16; i < 64; i++) BLEND_OP(i, W); /* load the state into our registers */ a=state[0]; b=sta...
0
47,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: pkinit_alg_agility_kdf(krb5_context context, krb5_data *secret, krb5_data *alg_oid, krb5_const_principal party_u_info, krb5_const_principal party_v_info, krb5_enctype enctype, ...
0
60,740
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: sshkey_perm_ok(int fd, const char *filename) { struct stat st; if (fstat(fd, &st) < 0) return SSH_ERR_SYSTEM_ERROR; /* * if a key owned by the user is accessed, then we check the * permissions of the file. if the key owned by a different user, * then we don't care. */ if ((st.st_uid == getuid()) &&...
0
72,312
Analyze the following 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 ExtensionServiceBackend::OnLoadSingleExtension( const scoped_refptr<const Extension>& extension, bool prompt_for_plugins) { CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (frontend_.get()) frontend_->OnLoadSingleExtension(extension, prompt_for_plugins); } Commit Message: Limit extent o...
0
98,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: static void cryptd_blkcipher_exit_tfm(struct crypto_tfm *tfm) { struct cryptd_blkcipher_ctx *ctx = crypto_tfm_ctx(tfm); crypto_free_blkcipher(ctx->child); } Commit Message: crypto: include crypto- module prefix in template This adds the module loading prefix "crypto-" to the template lookup as well. For exa...
0
45,644
Analyze the following 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 nested_vmx_check_io_bitmap_controls(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12) { if (!nested_cpu_has(vmcs12, CPU_BASED_USE_IO_BITMAPS)) return 0; if (!page_address_valid(vcpu, vmcs12->io_bitmap_a) || !page_address_valid(vcpu, vmcs12->io_bitmap_b)) return -EINVAL; return 0; ...
0
62,999
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: media::ResolutionChangePolicy>::ToMojom(media::ResolutionChangePolicy input) { switch (input) { case media::ResolutionChangePolicy::FIXED_RESOLUTION: return media::mojom::ResolutionChangePolicy::FIXED_RESOLUTION; case media::Resolut...
0
140,249
Analyze the following 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 create_history_entry(krb5_context context, krb5_keyblock *hist_key, int n_key_data, krb5_key_data *key_data, osa_pw_hist_ent *hist_out) { int i; krb5_error_code ret = 0; krb5_keyblock key; krb5_keysalt salt; krb5_ui_2 kvno; osa_pw_hist_...
0
84,671
Analyze the following 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 SyncSocket::Close() { if (handle_ == kInvalidHandle) return true; const BOOL result = CloseHandle(handle_); handle_ = kInvalidHandle; return result == TRUE; } Commit Message: Convert ARRAYSIZE_UNSAFE -> arraysize in base/. R=thestig@chromium.org BUG=423134 Review URL: https://codereview.chrom...
0
110,878
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: HB_Error HB_GPOS_Clear_Features( HB_GPOSHeader* gpos ) { HB_UShort i; HB_UInt* properties; if ( !gpos ) return ERR(HB_Err_Invalid_Argument); gpos->FeatureList.ApplyCount = 0; properties = gpos->LookupList.Properties; for ( i = 0; i < gpos->LookupList.LookupCount; i++ ) properties[i] =...
0
13,558
Analyze the following 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 tty_register_driver(struct tty_driver *driver) { int error; int i; dev_t dev; struct device *d; if (!driver->major) { error = alloc_chrdev_region(&dev, driver->minor_start, driver->num, driver->name); if (!error) { driver->major = MAJOR(dev); driver->minor_start = MINOR(dev); } } else...
0
55,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 RunTwoGetTwoGetUserMediaWithDifferentContraints( const std::string& constraints1, const std::string& constraints2, const std::string& expected_result) { ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); GURL url(embedded_test_server()->GetURL("/media/getusermedi...
0
128,383