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 path_get(struct path *path) { mntget(path->mnt); dget(path->dentry); } Commit Message: fix autofs/afs/etc. magic mountpoint breakage We end up trying to kfree() nd.last.name on open("/mnt/tmp", O_CREAT) if /mnt/tmp is an autofs direct mount. The reason is that nd.last_type is bogus here; we want LAST_BI...
0
25,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 Part::resetGui() { m_messageWidget->hide(); m_commentView->clear(); m_commentBox->hide(); m_infoPanel->setIndex(QModelIndex()); m_compressionOptions = CompressionOptions(); } Commit Message: CWE ID: CWE-78
0
14,811
Analyze the following 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 WebRuntimeFeatures::enableWebGLDraftExtensions(bool enable) { RuntimeEnabledFeatures::setWebGLDraftExtensionsEnabled(enable); } Commit Message: Remove SpeechSynthesis runtime flag (status=stable) BUG=402536 Review URL: https://codereview.chromium.org/482273005 git-svn-id: svn://svn.chromium.org/blink...
0
19,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 remove_deferred_open_smb_message(uint16 mid) { struct pending_message_list *pml; for (pml = deferred_open_queue; pml; pml = pml->next) { if (mid == SVAL(pml->buf.data,smb_mid)) { DEBUG(10,("remove_deferred_open_smb_message: " "deleting mid %u len %u\n", (unsigned int)mid, (unsigned ...
0
3,497
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int svc_rdma_xdr_encode_error(struct svcxprt_rdma *xprt, struct rpcrdma_msg *rmsgp, enum rpcrdma_errcode err, __be32 *va) { __be32 *startp = va; *va++ = rmsgp->rm_xid; *va++ = rmsgp->rm_vers; *va++ = xprt->sc_fc_credits; *va++ = rdma_error; *va++ = cpu_to_be32(err); if (err == ERR_VERS) {...
1
1,932
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: pseudo_get_job_info(ClassAd *&ad, bool &delete_ad) { ClassAd * the_ad; delete_ad = false; the_ad = thisRemoteResource->getJobAd(); ASSERT( the_ad ); thisRemoteResource->filetrans.Init( the_ad, false, PRIV_USER, false ); std::string file; if ( the_ad->LookupString( ATTR_JOB_OUTPUT, file ) && strcmp( f...
0
1,065
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: align_column_to_tab (parser_line_counter_t column) /**< current column */ { /* Tab aligns to zero column start position. */ return (parser_line_counter_t) (((column + (8u - 1u)) & ~ECMA_STRING_CONTAINER_MASK) + 1u); } /* align_column_to_tab */ Commit Message: Do not allocate memory for zero length strings. ...
0
13,383
Analyze the following 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 sched_irq_time_avg_update(struct rq *rq, u64 curr_irq_time) { } Commit Message: Sched: fix skip_clock_update optimization idle_balance() drops/retakes rq->lock, leaving the previous task vulnerable to set_tsk_need_resched(). Clear it after we return from balancing instead, and in setup_thread_stack...
0
11,811
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: UINT32 UIPC_Read(tUIPC_CH_ID ch_id, UINT16 *p_msg_evt, UINT8 *p_buf, UINT32 len) { int n; int n_read = 0; int fd = uipc_main.ch[ch_id].fd; struct pollfd pfd; UNUSED(p_msg_evt); if (ch_id >= UIPC_CH_NUM) { BTIF_TRACE_ERROR("UIPC_Read : invalid ch id %d", ch_id); return 0; } if (fd == UIPC_DI...
1
20,103
Analyze the following 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 FixedLengthEncoder::getChar() { if (length >= 0 && count >= length) return EOF; ++count; return str->getChar(); } Commit Message: CWE ID: CWE-119
0
3,704
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void Editor::copyImage(const HitTestResult& result) { writeImageNodeToPasteboard(Pasteboard::generalPasteboard(), result.innerNodeOrImageMapImage(), result.altDisplayString()); } Commit Message: Make TypingCommand::insertText() to take SelectionInDOMTre...
0
23,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: bool ImageLoader::getImageAnimationPolicy(ImageAnimationPolicy& policy) { if (!element()->document().settings()) return false; policy = element()->document().settings()->getImageAnimationPolicy(); return true; } Commit Message: Move ImageLoader timer to frame-specific TaskRunnerTimer. Move ImageLoade...
0
2,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: static void camellia_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) { camellia_dec_blk(crypto_tfm_ctx(tfm), dst, src); } Commit Message: crypto: prefix module autoloading with "crypto-" This prefixes all crypto module loading with "crypto-" so we never run the risk of exposing module auto-loading to u...
0
12,645
Analyze the following 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 pat_parse_meth(const char *text, struct pattern *pattern, int mflags, char **err) { int len, meth; len = strlen(text); meth = find_http_meth(text, len); pattern->val.i = meth; if (meth == HTTP_METH_OTHER) { pattern->ptr.str = (char *)text; pattern->len = len; } else { pattern->ptr.str =...
0
11,202
Analyze the following 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 handle_rc_features() { btrc_remote_features_t rc_features = BTRC_FEAT_NONE; bt_bdaddr_t rc_addr; bdcpy(rc_addr.address, btif_rc_cb.rc_addr); if (btif_rc_cb.rc_features & BTA_AV_FEAT_BROWSE) { rc_features |= BTRC_FEAT_BROWSE; } if ( (btif_rc_cb.rc_features & BTA_AV_FEAT_ADV_CTRL) && (bti...
0
5,416
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: String XMLHttpRequest::responseMIMEType() const { String mimeType = extractMIMETypeFromMediaType(m_mimeTypeOverride); if (mimeType.isEmpty()) { if (m_response.isHTTP()) mimeType = extractMIMETypeFromMediaType(m_response.httpHeaderField("Content-Type")); else mimeTyp...
0
3,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: void OxideQQuickWebViewPrivate::LoadEvent(const OxideQLoadEvent& event) { Q_Q(OxideQQuickWebView); emit q->loadEvent(event); if (!using_old_load_event_signal_ || event.type() == OxideQLoadEvent::TypeCommitted || event.type() == OxideQLoadEvent::TypeRedirected) { return; } emit q->load...
0
7,821
Analyze the following 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_t xdr_authgssapi_init_arg( XDR *xdrs, auth_gssapi_init_arg *init_arg) { if (! xdr_u_int32(xdrs, &init_arg->version) || ! xdr_gss_buf(xdrs, &init_arg->token)) return FALSE; return TRUE; } Commit Message: Fix kadm5/gssrpc XDR double free [CVE-2014-9421] [MITKRB5-SA-2015-001] In auth_...
0
19,622
Analyze the following 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 BrowserView::CanClose() { if (tabstrip_ && !tabstrip_->IsTabStripCloseable()) return false; if (!browser_->ShouldCloseWindow()) return false; bool fast_tab_closing_enabled = base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableFastUnload); if (!browser_->tab_...
0
28,402
Analyze the following 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 PageInfo::OnSiteDataAccessed() { PresentSiteData(); } Commit Message: Revert "PageInfo: decouple safe browsing and TLS statii." This reverts commit ee95bc44021230127c7e6e9a8cf9d3820760f77c. Reason for revert: suspect causing unit_tests failure on Linux MSAN Tests: https://ci.chromium.org/p/chromium/buil...
0
14,782
Analyze the following 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 Browser::RunUnloadEventsHelper(WebContents* contents) { if (contents->NeedToFireBeforeUnload()) { contents->GetRenderViewHost()->FirePageBeforeUnload(false); return true; } return false; } Commit Message: Remove TabContents from TabStripModelObserver::TabDetachedAt. BUG=107201 TEST=no visible...
0
15,069
Analyze the following 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_short (FILE *dumpfile, int format, char *dump_tag, uint16 data) { int j, k; char dump_array[20]; unsigned char bitset; if (dumpfile == NULL) { TIFFError ("", "Invalid FILE pointer for dump file"); return (1); } if (format == DUMP_TEXT) { fprintf (dumpfile," %...
0
21,382
Analyze the following 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 Ins_CALL( INS_ARG ) { PCallRecord pCrec; if ( BOUNDS( args[0], CUR.numFDefs ) || !CUR.FDefs[args[0]].Active ) { CUR.error = TT_Err_Invalid_Reference; return; } if ( CUR.callTop >= CUR.callSize ) { CUR.error = TT_Err_Stack_Overflow; return; } ...
0
23,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: void HTMLMediaElement::RemovedFrom(ContainerNode* insertion_point) { BLINK_MEDIA_LOG << "removedFrom(" << (void*)this << ", " << insertion_point << ")"; HTMLElement::RemovedFrom(insertion_point); if (insertion_point->InActiveDocument()) { UpdateControlsVisibility(); if (network_st...
0
6,825
Analyze the following 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 doDeserialize() { v8::Local<v8::Value> value; if (!m_reader.read(&value, *this)) return false; if (!value.IsEmpty()) push(value); return true; } Commit Message: Replace further questionable HashMap::add usages in bindings BUG=390928 R=dcar...
0
18,536
Analyze the following 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 long disk_events_poll_jiffies(struct gendisk *disk) { struct disk_events *ev = disk->ev; long intv_msecs = 0; /* * If device-specific poll interval is set, always use it. If * the default is being used, poll iff there are events which * can't be monitored asynchronously. */ if (ev->p...
0
4,541
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xmlParseExternalEntity(xmlDocPtr doc, xmlSAXHandlerPtr sax, void *user_data, int depth, const xmlChar *URL, const xmlChar *ID, xmlNodePtr *lst) { return(xmlParseExternalEntityPrivate(doc, NULL, sax, user_data, depth, URL, ID, lst)); } Commit Message: Detect infinite recursion in p...
0
5,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: static void read_huffman_code_simple(WebPContext *s, HuffReader *hc) { hc->nb_symbols = get_bits1(&s->gb) + 1; if (get_bits1(&s->gb)) hc->simple_symbols[0] = get_bits(&s->gb, 8); else hc->simple_symbols[0] = get_bits1(&s->gb); if (hc->nb_symbols == 2) hc->simple_symbols[1...
0
29,281
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void radeon_restore_bios_scratch_regs(struct radeon_device *rdev) { uint32_t scratch_reg; int i; if (rdev->family >= CHIP_R600) scratch_reg = R600_BIOS_0_SCRATCH; else scratch_reg = RADEON_BIOS_0_SCRATCH; for (i = 0; i < RADEON_BIOS_NUM_SCRATCH; i++) WREG32(scratch_reg + (i * 4), rdev->bios_scratch[i...
0
16,455
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: parse_string(struct xkb_compose_table *table, const char *string, size_t len, const char *file_name) { struct scanner s; scanner_init(&s, table->ctx, string, len, file_name, NULL); if (!parse(table, &s, 0)) return false; /* Maybe the allocator can use the excess space. */ ...
0
27,725
Analyze the following 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 CuePoint::TrackPosition::Parse( IMkvReader* pReader, long long start_, long long size_) { const long long stop = start_ + size_; long long pos = start_; m_track = -1; m_pos = -1; m_block = 1; //default while (pos < stop) { long len; const long lo...
1
23,724
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WebRunnerContentBrowserClient::CreateBrowserMainParts( const content::MainFunctionParams& parameters) { DCHECK(context_channel_); return new WebRunnerBrowserMainParts(std::move(context_channel_)); } Commit Message: [fuchsia] Implement browser tests for WebRunner Context service. Tests may interact w...
1
11,234
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WebNotificationPermission Notification::checkPermission(ExecutionContext* context) { SecurityOrigin* origin = context->securityOrigin(); ASSERT(origin); return notificationManager()->checkPermission(WebSecurityOrigin(origin)); } Commit Message: Notification actions may have an icon url. This is beh...
0
21,809
Analyze the following 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 RenderView::OnViewContextSwapBuffersPosted() { RenderWidget::OnSwapBuffersPosted(); } Commit Message: DevTools: move DevToolsAgent/Client into content. BUG=84078 TEST= Review URL: http://codereview.chromium.org/7461019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93596 0039d316-1c4b-4281-b951-d8...
0
16,250
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: clnp_print(netdissect_options *ndo, const uint8_t *pptr, u_int length) { const uint8_t *optr,*source_address,*dest_address; u_int li,tlen,nsap_offset,source_address_length,dest_address_length, clnp_pdu_type, clnp_flags; const struct clnp_header_t *clnp_header; const struct clnp_segment_heade...
0
11,104
Analyze the following 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 shm_open(struct vm_area_struct *vma) { int err = __shm_open(vma); /* * We raced in the idr lookup or with shm_destroy(). * Either way, the ID is busted. */ WARN_ON_ONCE(err); } Commit Message: ipc/shm: Fix shmat mmap nil-page protection The issue is described here, with a nice testcase: ...
0
16,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: static void kvm_timer_init(void) { int cpu; max_tsc_khz = tsc_khz; cpu_notifier_register_begin(); if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC)) { #ifdef CONFIG_CPU_FREQ struct cpufreq_policy policy; memset(&policy, 0, sizeof(policy)); cpu = get_cpu(); cpufreq_get_policy(&policy, cpu); if (policy.cp...
0
15,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: std::unique_ptr<content::WebContents> CreateAndNavigateWebContents() { std::unique_ptr<content::WebContents> web_contents = CreateTestWebContents(); ResourceCoordinatorTabHelper::CreateForWebContents(web_contents.get()); content::WebContentsTester::For(web_contents.get()) ->NavigateA...
0
27,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: static const char *rdev_get_name(struct regulator_dev *rdev) { if (rdev->constraints && rdev->constraints->name) return rdev->constraints->name; else if (rdev->desc->name) return rdev->desc->name; else return ""; } Commit Message: regulator: core: Fix regualtor_ena_gpio_free not to access pin after free...
0
7,228
Analyze the following 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 f2fs_get_block(struct dnode_of_data *dn, pgoff_t index) { struct extent_info ei; struct inode *inode = dn->inode; if (f2fs_lookup_extent_cache(inode, index, &ei)) { dn->data_blkaddr = ei.blk + index - ei.fofs; return 0; } return f2fs_reserve_block(dn, index); } Commit Message: f2fs: fix a dead loo...
0
24,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: static size_t proc_skip_spaces(char **buf) { size_t ret; char *tmp = skip_spaces(*buf); ret = tmp - *buf; *buf = tmp; return ret; } Commit Message: sysctl: restrict write access to dmesg_restrict When dmesg_restrict is set to 1 CAP_SYS_ADMIN is needed to read the kernel ring buffer. But a root user withou...
0
16,061
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: uint16_t tcp_port_number_get(struct tcp_sock_t *sock) { sock->info_size = sizeof sock->info; int query_status = getsockname( sock->sd, (struct sockaddr *) &(sock->info), &(sock->info_size)); if (query_status == -1) ...
0
26,118
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start, int nr_pages, int write, int force, struct page **pages, struct vm_area_struct **vmas) { int flags = FOLL_TOUCH; if (pages) flags |= FOLL_GET; if (write) flags |= FOLL_WRITE; if (force) flags |= FOLL_FORCE; ret...
0
18,287
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void LogClientServiceForInfo( T* /* info */, GLuint /* client_id */, const char* /* function_name */) { } 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 con...
0
13,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: hasevery (struct tree const *a, struct tree const *b) { if (!b) return 1; if (!hasevery(a, b->llink)) return 0; if (!hasevery(a, b->rlink)) return 0; while (a && b->label != a->label) if (b->label < a->label) a = a->llink; else a = a->rlink; return !!a; } Commit Message:...
0
28,421
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xmlCreateEntityParserCtxtInternal(const xmlChar *URL, const xmlChar *ID, const xmlChar *base, xmlParserCtxtPtr pctx) { xmlParserCtxtPtr ctxt; xmlParserInputPtr inputStream; char *directory = NULL; xmlChar *uri; ctxt = xmlNewParserCtxt(); if (ctxt == NULL) { return(NULL); } if (pctx != NULL...
0
4,455
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: mojo::PendingRemote<mojom::InputChannel> CreatePendingRemote() { return receiver_.BindNewPipeAndPassRemote(); } Commit Message: ime-service: Delete InputEngine.ProcessText. It is deprecated and no longer used. Bug: 1009903 Change-Id: I6774a4506bd0bb41a5d1a5909a40a2a781564b16 Reviewed-on: https://chrom...
0
2,983
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MockAutofillDriver() {} Commit Message: [Autofill] Remove AutofillPopupViewViews and associated feature. Bug: 906135,831603 Change-Id: I3c982f8b3ffb4928c7c878e74e10113999106499 Reviewed-on: https://chromium-review.googlesource.com/c/1387124 Reviewed-by: Robert Kaplow <rkaplow@chromium.org> Reviewed-by: Vasili...
0
14,937
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GLvoid StubGLUseProgram(GLuint program) { glUseProgram(program); } Commit Message: Add chromium_code: 1 to surface.gyp and gl.gyp to pick up -Werror. It looks like this was dropped accidentally in http://codereview.chromium.org/6718027 (surface.gyp) and http://codereview.chromium.org/6722026 (gl.gyp) Remove ...
0
15,167
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: QNetworkAccessManager* WebContext::GetCustomNetworkAccessManager() { return client_->GetCustomNetworkAccessManager(); } Commit Message: CWE ID: CWE-20
0
4,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: struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata, const u8 *addr, gfp_t gfp) { struct ieee80211_local *local = sdata->local; struct sta_info *sta; struct timespec uptime; struct ieee80211_tx_latency_bin_ranges *tx_latency; int i; sta = kzalloc(sizeof(*sta) + local->hw.sta_data_size, ...
1
8,600
Analyze the following 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 __sys_connect(int fd, struct sockaddr __user *uservaddr, int addrlen) { struct socket *sock; struct sockaddr_storage address; int err, fput_needed; sock = sockfd_lookup_light(fd, &err, &fput_needed); if (!sock) goto out; err = move_addr_to_kernel(uservaddr, addrlen, &address); if (err < 0) goto ou...
0
21,697
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: record_loop_stats( double offset, /* offset */ double freq, /* frequency (PPM) */ double jitter, /* jitter */ double wander, /* wander (PPM) */ int spoll ) { l_fp now; u_long day; if (!stats_control) return; get_systime(&now); filegen_setup(&loopstats, now.l_ui); day = now.l_ui / 86400 + MJD_1...
0
16,274
Analyze the following 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 usbnet_link_change(struct usbnet *dev, bool link, bool need_reset) { /* update link after link is reseted */ if (link && !need_reset) netif_carrier_on(dev->net); else netif_carrier_off(dev->net); if (need_reset && link) usbnet_defer_kevent(dev, EVENT_LINK_RESET); else usbnet_defer_kevent(dev, E...
0
1,984
Analyze the following 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 HasGzipHeader(const base::RefCountedMemory& maybe_gzipped) { net::GZipHeader header; net::GZipHeader::Status header_status = net::GZipHeader::INCOMPLETE_HEADER; const char* header_end = nullptr; while (header_status == net::GZipHeader::INCOMPLETE_HEADER) { header_status = header.ReadMore(maybe_gz...
0
7,621
Analyze the following 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 fetchProc fetchProcForPicture (PicturePtr pict) { switch(pict->format) { case PICT_a8r8g8b8: return fbFetch_a8r8g8b8; case PICT_x8r8g8b8: return fbFetch_x8r8g8b8; case PICT_a8b8g8r8: return fbFetch_a8b8g8r8; case PICT_x8b8g8r8: return fbFetch_x8b8g8r8; /* 24bpp formats */ c...
0
9,177
Analyze the following 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 size_t ComplexTextLayout(const Image *image,const DrawInfo *draw_info, const char *text,const size_t length,const FT_Face face,const FT_Int32 flags, GraphemeInfo **grapheme,ExceptionInfo *exception) { #if defined(MAGICKCORE_RAQM_DELEGATE) const char *features; raqm_t *rq; raqm_glyph_t ...
0
15,349
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static inline void futex_get_mm(union futex_key *key) { mmgrab(key->private.mm); /* * Ensure futex_get_mm() implies a full barrier such that * get_futex_key() implies a full barrier. This is relied upon * as smp_mb(); (B), see the ordering comment above. */ smp_mb__after_atomic(); } Commit Message: fu...
0
25,126
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ovsinst_bitmap_to_openflow(uint32_t ovsinst_bitmap, enum ofp_version version) { uint32_t ofpit_bitmap = 0; const struct ovsinst_map *x; for (x = get_ovsinst_map(version); x->ofpit >= 0; x++) { if (ovsinst_bitmap & (1u << x->ovsinst)) { ofpit_bitmap |= 1u << x->ofpit; } ...
0
18,233
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: hook_connect_gnutls_verify_certificates (gnutls_session_t tls_session) { struct t_hook *ptr_hook; int rc; rc = -1; ptr_hook = weechat_hooks[HOOK_TYPE_CONNECT]; while (ptr_hook) { /* looking for the right hook using to the gnutls session pointer */ if (!ptr_hook->deleted ...
0
11,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: void PermissionsData::SetActivePermissions( const PermissionSet* permissions) const { base::AutoLock auto_lock(runtime_lock_); active_permissions_unsafe_ = permissions; } Commit Message: Have the Debugger extension api check that it has access to the tab Check PermissionsData::CanAccessTab() prior to...
0
16,550
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void WebGL2RenderingContextBase::uniformMatrix3x4fv( const WebGLUniformLocation* location, GLboolean transpose, MaybeShared<DOMFloat32Array> value, GLuint src_offset, GLuint src_length) { if (isContextLost() || !ValidateUniformMatrixParameters( "uniformMatrix3x4f...
0
25,453
Analyze the following 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 FreeList::AddToFreeList(Address address, size_t size) { DCHECK_LT(size, BlinkPagePayloadSize()); DCHECK(!((reinterpret_cast<uintptr_t>(address) + sizeof(HeapObjectHeader)) & kAllocationMask)); DCHECK(!(size & kAllocationMask)); ASAN_UNPOISON_MEMORY_REGION(address, size); FreeListEntry* e...
0
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: freefileinfo (struct fileinfo *f) { while (f) { struct fileinfo *next = f->next; xfree (f->name); if (f->linkto) xfree (f->linkto); xfree (f); f = next; } } Commit Message: CWE ID: CWE-200
0
20,168
Analyze the following 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 SkiaOutputSurfaceImpl::Reshape(const gfx::Size& size, float device_scale_factor, const gfx::ColorSpace& color_space, bool has_alpha, bool use_stencil) { DCHECK_CA...
1
29,547
Analyze the following 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 xen_vbd_resize(struct xen_blkif *blkif) { struct xen_vbd *vbd = &blkif->vbd; struct xenbus_transaction xbt; int err; struct xenbus_device *dev = xen_blkbk_xenbus(blkif->be); unsigned long long new_size = vbd_sz(vbd); pr_info(DRV_PFX "VBD Resize: Domid: %d, Device: (%d, %d)\n", blkif->domid, M...
0
26,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: static void VoidMethodAnyArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { TestObject* impl = V8TestObject::ToImpl(info.Holder()); if (UNLIKELY(info.Length() < 1)) { V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::FailedToExecute("voidMethodAnyArg", "TestObject", Excepti...
0
8,988
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: check_compat_entry_size_and_hooks(struct compat_ip6t_entry *e, struct xt_table_info *newinfo, unsigned int *size, const unsigned char *base, const unsigned char *limit, const unsigned int *hook_entries, const unsigned int *underflows, const char *name) { struct xt_entry_...
1
1,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 ssize_t __fuse_direct_read(struct fuse_io_priv *io, struct iov_iter *iter, loff_t *ppos) { ssize_t res; struct file *file = io->file; struct inode *inode = file_inode(file); if (is_bad_inode(inode)) return -EIO; res = fuse_direct_io(io, iter, ppos, 0); fuse_invalidate_attr(inode); ...
0
3,217
Analyze the following 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 ScreenPositionController::ConvertPointFromScreen( const aura::Window* window, gfx::Point* point) { const aura::Window* root = window->GetRootWindow(); const gfx::Point display_origin = Shell::GetScreen()->GetDisplayNearestWindow( const_cast<aura::Window*>(root)).bounds().origin(); point->...
0
4,052
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gs_setdevice_no_erase(gs_gstate * pgs, gx_device * dev) { int open_code = 0, code; gs_lib_ctx_t *libctx = gs_lib_ctx_get_interp_instance(pgs->memory); /* If the ICC manager is not yet initialized, set it up now. But only if we have file io capability now */ if (libctx->io_device_table != ...
0
12,694
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: 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
10,914
Analyze the following 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 kvm_resume(void) { if (kvm_usage_count) { WARN_ON(raw_spin_is_locked(&kvm_count_lock)); hardware_enable_nolock(NULL); } } Commit Message: KVM: Improve create VCPU parameter (CVE-2013-4587) In multiple functions the vcpu_id is used as an offset into a bitfield. Ag malicious user could specify ...
0
28,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: static void php_xml_free_wrapper(void *ptr) { if (ptr != NULL) { efree(ptr); } } Commit Message: CWE ID: CWE-119
0
17,731
Analyze the following 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 __init ipv4_proc_init(void) { int rc = 0; if (raw_proc_init()) goto out_raw; if (tcp4_proc_init()) goto out_tcp; if (udp4_proc_init()) goto out_udp; if (ping_proc_init()) goto out_ping; if (ip_misc_proc_init()) goto out_misc; out: return rc; out_misc: ping_proc_exit(); out_ping: udp...
0
16,391
Analyze the following 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 kvm_vcpu_ioctl_x86_get_debugregs(struct kvm_vcpu *vcpu, struct kvm_debugregs *dbgregs) { unsigned long val; memcpy(dbgregs->db, vcpu->arch.db, sizeof(vcpu->arch.db)); kvm_get_dr(vcpu, 6, &val); dbgregs->dr6 = val; dbgregs->dr7 = vcpu->arch.dr7; dbgregs->flags = 0; memset(&dbgregs->re...
0
7,718
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WebPlugin* ChromeContentRendererClient::CreatePlugin( RenderView* render_view, WebFrame* frame, const WebPluginParams& original_params) { bool found = false; CommandLine* cmd = CommandLine::ForCurrentProcess(); webkit::npapi::WebPluginInfo info; GURL url(original_params.url); std::stri...
0
26,263
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: mrb_class_defined(mrb_state *mrb, const char *name) { mrb_value sym = mrb_check_intern_cstr(mrb, name); if (mrb_nil_p(sym)) { return FALSE; } return mrb_const_defined(mrb, mrb_obj_value(mrb->object_class), mrb_symbol(sym)); } Commit Message: `mrb_class_real()` did not work for `BasicObject`; fix #403...
0
12,577
Analyze the following 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 pit_has_pending_timer(struct kvm_vcpu *vcpu) { struct kvm_pit *pit = vcpu->kvm->arch.vpit; if (pit && kvm_vcpu_is_bsp(vcpu) && pit->pit_state.irq_ack) return atomic_read(&pit->pit_state.pit_timer.pending); return 0; } Commit Message: KVM: PIT: control word is write-only PIT control word (address 0x43)...
0
8,011
Analyze the following 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 pmcraid_io_done(struct pmcraid_cmd *cmd) { u32 ioasc = le32_to_cpu(cmd->ioa_cb->ioasa.ioasc); u32 reslen = le32_to_cpu(cmd->ioa_cb->ioasa.residual_data_length); if (_pmcraid_io_done(cmd, reslen, ioasc) == 0) pmcraid_return_cmd(cmd); } Commit Message: [SCSI] pmcraid: reject negative request size...
0
5,400
Analyze the following 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 *listening_get_next(struct seq_file *seq, void *cur) { struct tcp_iter_state *st = seq->private; struct net *net = seq_file_net(seq); struct inet_listen_hashbucket *ilb; struct sock *sk = cur; if (!sk) { get_head: ilb = &tcp_hashinfo.listening_hash[st->bucket]; spin_lock_bh(&ilb->lock); sk...
0
14,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: ia64_patch_vtop (unsigned long start, unsigned long end) { s32 *offp = (s32 *) start; u64 ip; while (offp < (s32 *) end) { ip = (u64) offp + *offp; /* replace virtual address with corresponding physical address: */ ia64_patch_imm64(ip, ia64_tpa(get_imm64(ip))); ia64_fc((void *) ip); ++offp; } ia6...
0
27,974
Analyze the following 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 jas_image_cmpt_domains_same(jas_image_t *image) { int cmptno; jas_image_cmpt_t *cmpt; jas_image_cmpt_t *cmpt0; cmpt0 = image->cmpts_[0]; for (cmptno = 1; cmptno < image->numcmpts_; ++cmptno) { cmpt = image->cmpts_[cmptno]; if (cmpt->tlx_ != cmpt0->tlx_ || cmpt->tly_ != cmpt0->tly_ || cmpt->hste...
0
5,465
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: cifs_uncached_readv_complete(struct work_struct *work) { struct cifs_readdata *rdata = container_of(work, struct cifs_readdata, work); complete(&rdata->done); kref_put(&rdata->refcount, cifs_uncached_readdata_release); } Commit Message: cifs: ensure that uncached writes handle unmapped areas correctly ...
0
4,083
Analyze the following 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 mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg, struct zone *zone) { unsigned long inactive_ratio; int nid = zone_to_nid(zone); int zid = zone_idx(zone); unsigned long inactive; unsigned long active; unsigned long gb; inactive = mem_cgroup_zone_nr_lru_pages(memcg, nid, zid, BIT(LRU_INA...
0
11,111
Analyze the following 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 parse_features(struct dm_arg_set *as, struct multipath *m) { int r; unsigned argc; struct dm_target *ti = m->ti; const char *arg_name; static struct dm_arg _args[] = { {0, 5, "invalid number of feature args"}, {1, 50, "pg_init_retries must be between 1 and 50"}, {0, 60000, "pg_init_delay_ms...
0
15,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: void WebRuntimeFeatures::EnableNotifications(bool enable) { RuntimeEnabledFeatures::SetNotificationsEnabled(enable); } Commit Message: Remove RequireCSSExtensionForFile runtime enabled flag. The feature has long since been stable (since M64) and doesn't seem to be a need for this flag. BUG=788936 Change-Id:...
0
8,969
Analyze the following 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_pointer_type_change(Notifier *notifier, void *data) { VncState *vs = container_of(notifier, VncState, mouse_mode_notifier); int absolute = qemu_input_is_absolute(); if (vnc_has_feature(vs, VNC_FEATURE_POINTER_TYPE_CHANGE) && vs->absolute != absolute) { vnc_write_u8(vs, 0); ...
1
26,955
Analyze the following 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 mnt_drop_write(struct vfsmount *mnt) { __mnt_drop_write(mnt); sb_end_write(mnt->mnt_sb); } Commit Message: vfs: Carefully propogate mounts across user namespaces As a matter of policy MNT_READONLY should not be changable if the original mounter had more privileges than creator of the mount namespace. Ad...
0
29,308
Analyze the following 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 __exit crypto_ccm_module_exit(void) { crypto_unregister_template(&crypto_rfc4309_tmpl); crypto_unregister_template(&crypto_ccm_tmpl); crypto_unregister_template(&crypto_ccm_base_tmpl); crypto_unregister_template(&crypto_cbcmac_tmpl); } Commit Message: crypto: ccm - move cbcmac input off the stack...
0
4,430
Analyze the following 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 ieee80211_assign_perm_addr(struct ieee80211_local *local, struct net_device *dev, enum nl80211_iftype type) { struct ieee80211_sub_if_data *sdata; u64 mask, start, addr, val, inc; u8 *m; u8 tmp_addr[ETH_ALEN]; int i; /* default ... something at least */ memcpy(dev->perm_a...
0
17,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: int cifs_close(struct inode *inode, struct file *file) { if (file->private_data != NULL) { cifsFileInfo_put(file->private_data); file->private_data = NULL; } /* return code from the ->release op is always ignored */ return 0; } Commit Message: cifs: ensure that uncached writes handle unmapped areas corr...
0
8,304
Analyze the following 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_xdr_enc_close(struct rpc_rqst *req, struct xdr_stream *xdr, struct nfs_closeargs *args) { struct compound_hdr hdr = { .minorversion = nfs4_xdr_minorversion(&args->seq_args), }; encode_compound_hdr(xdr, req, &hdr); encode_sequence(xdr, &args->seq_args, &hdr); encode_putfh(xdr, ar...
0
10,916
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: asmlinkage void __sched schedule(void) { struct task_struct *prev, *next; unsigned long *switch_count; struct rq *rq; int cpu; need_resched: preempt_disable(); cpu = smp_processor_id(); rq = cpu_rq(cpu); rcu_note_context_switch(cpu); prev = rq->curr; schedule_debug(prev); if (sched_feat(HRTICK)) h...
0
13,739
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Page* ChromeClientImpl::CreateWindow(LocalFrame* frame, const FrameLoadRequest& r, const WebWindowFeatures& features, NavigationPolicy navigation_policy, SandboxFlags...
1
16,043
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: views::View* TrayCast::CreateDetailedView(user::LoginStatus status) { Shell::GetInstance()->metrics()->RecordUserMetricsAction( ash::UMA_STATUS_AREA_DETAILED_CAST_VIEW); CHECK(detailed_ == nullptr); detailed_ = new tray::CastDetailedView(this, cast_config_delegate_, status); return detailed_; } Com...
0
8,135
Analyze the following 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 git_pack_config(const char *k, const char *v, void *cb) { if (!strcmp(k, "pack.window")) { window = git_config_int(k, v); return 0; } if (!strcmp(k, "pack.windowmemory")) { window_memory_limit = git_config_ulong(k, v); return 0; } if (!strcmp(k, "pack.depth")) { depth = git_config_int(k,...
0
22,541
Analyze the following 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 validate_t2(struct smb_t2_rsp *pSMB) { unsigned int total_size; /* check for plausible wct */ if (pSMB->hdr.WordCount < 10) goto vt2_err; /* check for parm and data offset going beyond end of smb */ if (get_unaligned_le16(&pSMB->t2_rsp.ParameterOffset) > 1024 || get_unaligned_le16(&pSMB->...
0
4,639
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: eth_pkt_types_e net_tx_pkt_get_packet_type(struct NetTxPkt *pkt) { assert(pkt); return pkt->packet_type; } Commit Message: CWE ID: CWE-190
0
25,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: int board_early_init_f(void) { ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); bool cpuwd_flag = false; /* configure mode for uP reset request */ qrio_uprstreq(UPREQ_CORE_RST); /* board only uses the DDR_MCK0, so disable the DDR_MCK1/2/3 */ setbits_be32(&gur->ddrclkdr, 0x001f000f); /* set rese...
0
19,114