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: static void free_req(struct xen_blkif *blkif, struct pending_req *req) { unsigned long flags; int was_empty; spin_lock_irqsave(&blkif->pending_free_lock, flags); was_empty = list_empty(&blkif->pending_free); list_add(&req->free_list, &blkif->pending_free); spin_unlock_irqrestore(&blkif->pending_free_lock, ...
0
19,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: int GenerateRandomNumber(const int range) { if (p == ((unsigned char *) (&entropy + 1))) { switch (entropy.which) { case 0: entropy.t += time (NULL); accSeed ^= entropy.t; break; case 1: entropy.c += clock(); break; case 2: entropy.counter++; break; } entropy.which =...
0
1,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: const LineInfo& lineInfo() const { return m_lineInfo; } Commit Message: Update containtingIsolate to go back all the way to top isolate from current root, rather than stopping at the first isolate it finds. This works because the current root is always updated with each isolate run. BUG=279277 Review URL: ...
0
18,931
Analyze the following 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 OnQuerySelector(std::unique_ptr<dom::QuerySelectorResult> result) { EXPECT_EQ(nullptr, result); FinishAsynchronousTest(); } Commit Message: Implicitly bypass localhost when proxying requests. This aligns Chrome's behavior with the Windows and macOS proxy resolvers (but not Firefox). Concretely...
0
20,597
Analyze the following 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 sds *cliSplitArgs(char *line, int *argc) { if (config.eval_ldb && (strstr(line,"eval ") == line || strstr(line,"e ") == line)) { sds *argv = sds_malloc(sizeof(sds)*2); *argc = 2; int len = strlen(line); int elen = line[1] == ' ' ? 2 : 5; /...
0
28,720
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xsltUnregisterExtModuleTopLevel(const xmlChar * name, const xmlChar * URI) { int ret; if ((xsltTopLevelsHash == NULL) || (name == NULL) || (URI == NULL)) return (-1); xmlMutexLock(xsltExtMutex); ret = xmlHashRemoveEntry2(xsltTopLevelsHash, name, URI, NULL); xmlMutexUnlock(xsltExtMu...
0
4,289
Analyze the following 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 netif_schedule_queue(struct netdev_queue *txq) { rcu_read_lock(); if (!(txq->state & QUEUE_STATE_ANY_XOFF)) { struct Qdisc *q = rcu_dereference(txq->qdisc); __netif_schedule(q); } rcu_read_unlock(); } Commit Message: tunnels: Don't apply GRO to multiple layers of encapsulation. When drivers expres...
0
11,794
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int copy_counters_to_user(struct ebt_table *t, const struct ebt_counter *oldcounters, void __user *user, unsigned int num_counters, unsigned int nentries) { struct ebt_counter *counterstmp; int ret = 0; /* userspace might not need the counters */ if (num_counters == 0) return 0; ...
0
24,736
Analyze the following 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 SVGLayoutSupport::screenScaleFactorChanged(const LayoutObject* ancestor) { for (; ancestor; ancestor = ancestor->parent()) { if (ancestor->isSVGRoot()) return toLayoutSVGRoot(ancestor)->didScreenScaleFactorChange(); if (ancestor->isSVGTransformableContainer()) retu...
0
6,657
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: expand_dfs_referral(const unsigned int xid, struct cifs_ses *ses, struct smb_vol *volume_info, struct cifs_sb_info *cifs_sb, int check_prefix) { int rc; unsigned int num_referrals = 0; struct dfs_info3_param *referrals = NULL; char *full_path = NULL, *ref_path = NULL, *mdata = NULL; full_path = ...
0
12,959
Analyze the following 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 RenderWidgetHostViewGuest::PluginFocusChanged(bool focused, int plugin_id) { NOTIMPLEMENTED(); } Commit Message: Implement TextureImageTransportSurface using texture mailbox This has a couple of advantages: - allow tearing down and recreating the UI pare...
0
21,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: ndp_find_msgrcv_handler_item(struct ndp *ndp, ndp_msgrcv_handler_func_t func, enum ndp_msg_type msg_type, uint32_t ifindex, void *priv) { struct ndp_msgrcv_handler_item *handler_item; list_for_each_node_entry(handler_item, &ndp->msgrcv_handler_list, list) if (handler_item->func == fun...
0
23,452
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: sigend(__attribute__((unused)) void *v, __attribute__((unused)) int sig) { int status; int ret; int wait_count = 0; struct timeval start_time, now; #ifdef HAVE_SIGNALFD struct timeval timeout = { .tv_sec = child_wait_time, .tv_usec = 0 }; int signal_fd = master->signal_fd; fd_set read_set; struct sig...
0
6,561
Analyze the following 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 toggle_eb_comment(void) { /* The page doesn't exist with report-only option */ if (pages[PAGENO_EDIT_COMMENT].page_widget == NULL) return; bool good = gtk_text_buffer_get_char_count(gtk_text_view_get_buffer(g_tv_comment)) >= 10 || gtk_toggle_button_get_active(GTK_T...
0
12,562
Analyze the following 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 asf_read_packet(AVFormatContext *s, AVPacket *pkt) { ASFContext *asf = s->priv_data; for (;;) { int ret; /* parse cached packets, if any */ if ((ret = asf_parse_packet(s, s->pb, pkt)) <= 0) return ret; if ((ret = asf_get_packet(s, s->pb)) < 0) ...
0
14,829
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MODRET set_uselastlog(cmd_rec *cmd) { #ifdef PR_USE_LASTLOG int bool; config_rec *c; CHECK_ARGS(cmd, 1); CHECK_CONF(cmd, CONF_ROOT|CONF_VIRTUAL|CONF_GLOBAL); bool = get_boolean(cmd, 1); if (bool == -1) CONF_ERROR(cmd, "expected Boolean parameter"); c = add_config_param(cmd->argv[0], 1, NULL);...
0
28,020
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: XRenderFindDisplay (Display *dpy) { XRenderExtDisplayInfo *dpyinfo; dpyinfo = XRenderExtFindDisplay (&XRenderExtensionInfo, dpy); if (!dpyinfo) dpyinfo = XRenderExtAddDisplay (&XRenderExtensionInfo, dpy, XRenderExtensionName); return dpyinfo; } Commit Mes...
0
1,389
Analyze the following 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 RenderBlock::updateLogicalWidthAndColumnWidth() { LayoutUnit oldWidth = logicalWidth(); LayoutUnit oldColumnWidth = desiredColumnWidth(); updateLogicalWidth(); calcColumnWidth(); bool hasBorderOrPaddingLogicalWidthChanged = m_hasBorderOrPaddingLogicalWidthChanged; m_hasBorderOrPaddi...
0
27,915
Analyze the following 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 f2fs_quota_off(struct super_block *sb, int type) { struct inode *inode = sb_dqopt(sb)->files[type]; int err; if (!inode || !igrab(inode)) return dquot_quota_off(sb, type); f2fs_quota_sync(sb, type); err = dquot_quota_off(sb, type); if (err) goto out_put; inode_lock(inode); F2FS_I(inode)...
0
12,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: static void perf_swevent_start(struct perf_event *event, int flags) { event->hw.state = 0; } Commit Message: perf: Remove the nmi parameter from the swevent and overflow interface The nmi parameter indicated if we could do wakeups from the current context, if not, we would set some state and self-IPI and let t...
0
4,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: status_t OMX::enableGraphicBuffers( node_id node, OMX_U32 port_index, OMX_BOOL enable) { return findInstance(node)->enableGraphicBuffers(port_index, enable); } Commit Message: Add VPX output buffer size check and handle dead observers more gracefully Bug: 27597103 Change-Id: Id7acb25d5ef69b197da15ec20...
0
14,120
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void kvm_before_handle_nmi(struct kvm_vcpu *vcpu) { percpu_write(current_vcpu, vcpu); } Commit Message: KVM: X86: Don't report L2 emulation failures to user-space This patch prevents that emulation failures which result from emulating an instruction for an L2-Guest results in being reported to userspace. Witho...
0
9,717
Analyze the following 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_smooth_render_lcd( FT_Renderer render, FT_GlyphSlot slot, FT_Render_Mode mode, const FT_Vector* origin ) { FT_Error error; error = ft_smooth_render_generic( render, slot, mode, origin, ...
0
25,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: R_API RConfigNode* r_config_node_new(const char *name, const char *value) { RConfigNode *node; if (STRNULL (name)) { return NULL; } node = R_NEW0 (RConfigNode); if (!node) { return NULL; } node->name = strdup (name); node->value = strdup (value? value: ""); node->flags = CN_RW | CN_STR; node->i_valu...
0
25,804
Analyze the following 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 acm_start_wb(struct acm *acm, struct acm_wb *wb) { int rc; acm->transmitting++; wb->urb->transfer_buffer = wb->buf; wb->urb->transfer_dma = wb->dmah; wb->urb->transfer_buffer_length = wb->len; wb->urb->dev = acm->dev; rc = usb_submit_urb(wb->urb, GFP_ATOMIC); if (rc < 0) { dev_err(&acm->da...
0
10,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: protocol::ClipboardStub* ChromotingInstance::GetClipboardStub() { return this; } Commit Message: Restrict the Chromoting client plugin to use by extensions & apps. BUG=160456 Review URL: https://chromiumcodereview.appspot.com/11365276 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168289 0039d316-1c4b...
0
11,732
Analyze the following 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 LocalSiteCharacteristicsDataImpl::DecrementNumLoadedBackgroundTabs() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_GT(loaded_tabs_in_background_count_, 0U); loaded_tabs_in_background_count_--; if (loaded_tabs_in_background_count_ > 0U) return; DCHECK(!background_session_begin_.i...
0
273
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int __init slab_proc_init(void) { #ifdef CONFIG_DEBUG_SLAB_LEAK proc_create("slab_allocators", 0, NULL, &proc_slabstats_operations); #endif return 0; } Commit Message: mm/slab.c: fix SLAB freelist randomization duplicate entries This patch fixes a bug in the freelist randomization code. When a high ra...
0
22,850
Analyze the following 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 sctp_assoc_free_asconf_acks(struct sctp_association *asoc) { struct sctp_chunk *ack; struct sctp_chunk *tmp; list_for_each_entry_safe(ack, tmp, &asoc->asconf_ack_list, transmitted_list) { list_del_init(&ack->transmitted_list); sctp_chunk_free(ack); } } Commit Message: net: sctp: inherit ...
0
23,467
Analyze the following 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 Textfield::SetFontList(const gfx::FontList& font_list) { GetRenderText()->SetFontList(font_list); OnCaretBoundsChanged(); PreferredSizeChanged(); } Commit Message: MacViews: Enable secure text input for password Textfields. In Cocoa the NSTextInputContext automatically enables secure text input when ...
0
19,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: Handle<JSArray> ElementsAccessor::Concat(Isolate* isolate, Arguments* args, uint32_t concat_size, uint32_t result_len) { ElementsKind result_elements_kind = GetInitialFastElementsKind(); bool has_raw_doubles = false; { DisallowHeapAllocation no_gc; bool is_holey = false; for (uint32_t i = 0; i < concat_si...
0
21,908
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int do_cmd_ioctl(struct comedi_device *dev, struct comedi_cmd __user *cmd, void *file) { struct comedi_cmd user_cmd; struct comedi_subdevice *s; struct comedi_async *async; int ret = 0; unsigned int __user *chanlist_saver = NULL; if (copy_from_user(&user_cmd, cmd, sizeof(struct comedi_cmd))) { ...
0
8,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: qboolean Com_PlayerNameToFieldString( char *str, int length, const char *name ) { const char *p; int i; int x1, x2; if( str == NULL || name == NULL ) return qfalse; if( length <= 0 ) return qtrue; *str = '\0'; p = name; for( i = 0; *p != '\0'; i++, p++ ) { if( i + 1 >= length ) break; if(...
0
21,172
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ikev2_auth_print(netdissect_options *ndo, u_char tpay, const struct isakmp_gen *ext, u_int item_len _U_, const u_char *ep, uint32_t phase _U_, uint32_t doi _U_, uint32_t proto _U_, int depth _U_) { struct ikev2_auth a; const char *v2_auth[]={ "invalid", "rsasig", "shared-secret", "dsssig" }; const ...
0
16,282
Analyze the following 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 ext4_ext_rm_idx(handle_t *handle, struct inode *inode, struct ext4_ext_path *path) { int err; ext4_fsblk_t leaf; /* free index block */ path--; leaf = idx_pblock(path->p_idx); BUG_ON(path->p_hdr->eh_entries == 0); err = ext4_ext_get_access(handle, inode, path); if (err) return err; le16_...
0
6,297
Analyze the following 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 AVHWAccel *find_hwaccel(enum AVCodecID codec_id, enum AVPixelFormat pix_fmt) { AVHWAccel *hwaccel = NULL; while ((hwaccel = av_hwaccel_next(hwaccel))) if (hwaccel->id == codec_id && hwaccel->pix_fmt == pix_fmt) return hwaccel; retu...
0
22,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: void WebDevToolsAgent::interruptAndDispatch(MessageDescriptor* rawDescriptor) { OwnPtr<MessageDescriptor> descriptor = adoptPtr(rawDescriptor); OwnPtr<DebuggerTask> task = adoptPtr(new DebuggerTask(descriptor.release())); PageScriptDebugServer::interruptAndRun(task.release()); } Commit Message: [4/4]...
0
26,793
Analyze the following 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 ehci_trace_guest_bug(EHCIState *s, const char *message) { trace_usb_ehci_guest_bug(message); fprintf(stderr, "ehci warning: %s\n", message); } Commit Message: CWE ID: CWE-772
0
2,991
Analyze the following 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 NavigationControllerImpl::UpdateVirtualURLToURL( NavigationEntryImpl* entry, const GURL& new_url) { GURL new_virtual_url(new_url); if (BrowserURLHandlerImpl::GetInstance()->ReverseURLRewrite( &new_virtual_url, entry->GetVirtualURL(), browser_context_)) { entry->SetVirtualURL(new_virtual...
0
16,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: void Compositor::RemoveObserver(CompositorObserver* observer) { observer_list_.RemoveObserver(observer); } Commit Message: Fix PIP window being blank after minimize/show DesktopWindowTreeHostX11::SetVisible only made the call into OnNativeWidgetVisibilityChanged when transitioning from shown to minimized and ...
0
23,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: png_read_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver, png_size_t png_struct_size) { #ifdef PNG_SETJMP_SUPPORTED jmp_buf tmp_jmp; /* to save current jump buffer */ #endif int i = 0; png_structp png_ptr=*ptr_ptr; if (png_ptr == NULL) return; do { if (user_png_v...
1
17,635
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static unsigned int irq_mod_ticks(unsigned int usecs, unsigned int resolution) { if (usecs == 0) return 0; if (usecs < resolution) return 1; /* never round down to 0 */ return usecs / resolution; } Commit Message: sfc: Fix maximum number of TSO segments and minimum TX queue size [ Upstream commit 7e6d06f...
0
20,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: static int skb_checksum_setup_ipv6(struct sk_buff *skb, bool recalculate) { int err; u8 nexthdr; unsigned int off; unsigned int len; bool fragment; bool done; __sum16 *csum; fragment = false; done = false; off = sizeof(struct ipv6hdr); err = skb_maybe_pull_tail(skb, off, MAX_IPV6_HDR_LEN); if (err ...
0
24,929
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: pdf_xref_find_subsection(fz_context *ctx, pdf_document *doc, int64_t ofs, int len) { pdf_xref *xref = &doc->xref_sections[doc->num_xref_sections-1]; pdf_xref_subsec *sub; int new_max; /* Different cases here. Case 1) We might be asking for a * subsection (or a subset of a subsection) that we already * ha...
0
6,872
Analyze the following 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_Reconnect_f( void ) { if ( !strlen( cl_reconnectArgs ) ) return; Cvar_Set("ui_singlePlayerActive", "0"); Cbuf_AddText( va("connect %s\n", cl_reconnectArgs ) ); } Commit Message: All: Don't load .pk3s as .dlls, and don't load user config files from .pk3s CWE ID: CWE-269
0
23,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: explicit FullscreenLayoutManager(aura::Window* owner) : owner_(owner) {} Commit Message: Start rendering timer after first navigation Currently the new content rendering timer in the browser process, which clears an old page's contents 4 seconds after a navigation if the new page doesn't draw in that time, is...
0
18,890
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: virtual void BeginPassHook(unsigned int /*pass*/) { psnr_ = kMaxPsnr; nframes_ = 0; } Commit Message: Merge Conflict Fix CL to lmp-mr1-release for ag/849478 DO NOT MERGE - libvpx: Pull from upstream Current HEAD: 7105df53d7dc13d5e575bc8df714ec8d1da36b06 BUG=23452792 Change-Id: Ic78176fc369e0bac...
0
27,827
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void postSetNeedsRedrawToMainThread() { callOnMainThread(CCLayerTreeHostTest::dispatchSetNeedsRedraw, this); } Commit Message: [chromium] Fix shutdown race when posting main thread task to CCThreadProxy and enable tests https://bugs.webkit.org/show_bug.cgi?id=70161 Reviewed by David Levin....
0
5,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: JSObject* createReferenceError(ExecState* exec, const UString& message) { return createReferenceError(exec->lexicalGlobalObject(), message); } Commit Message: [JSC] Implement a helper method createNotEnoughArgumentsError() https://bugs.webkit.org/show_bug.cgi?id=85102 Reviewed by Geoffrey Garen. In bug 847...
0
5,679
Analyze the following 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 WebGLRenderingContextBase::clearDepth(GLfloat depth) { if (isContextLost()) return; clear_depth_ = depth; ContextGL()->ClearDepthf(depth); } Commit Message: Reset ES3 pixel pack parameters and PIXEL_PACK_BUFFER binding in DrawingBuffer before ReadPixels() and recover them later. BUG=740603 TEST=n...
0
6,283
Analyze the following 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::OnMojoError(int render_process_id, const std::string& error) { LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; base::debug::ScopedCrashKeyString error_key_value( bad_message::GetMojoErrorCrashKey(), error); ...
0
1,677
Analyze the following 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 llc2_init(void) { int rc = proto_register(&llc_proto, 0); if (rc != 0) goto out; llc_build_offset_table(); llc_station_init(); llc_ui_sap_last_autoport = LLC_SAP_DYN_START; rc = llc_proc_init(); if (rc != 0) { printk(llc_proc_err_msg); goto out_station; } rc = llc_sysctl_init();...
0
14,885
Analyze the following 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 SetQuantumDepth(const Image *image, QuantumInfo *quantum_info,const size_t depth) { size_t extent, quantum; /* Allocate the quantum pixel buffer. */ assert(image != (Image *) NULL); assert(image->signature == MagickCoreSignature); if (image->debug != Magic...
0
12,124
Analyze the following 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 LocalFrameClientImpl::DispatchDidChangeThemeColor() { if (web_frame_->Client()) web_frame_->Client()->DidChangeThemeColor(); } Commit Message: Prevent renderer initiated back navigation to cancel a browser one. Renderer initiated back/forward navigations must not be able to cancel ongoing browser ini...
0
13,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: crm_client_get(qb_ipcs_connection_t * c) { if (client_connections) { return g_hash_table_lookup(client_connections, c); } crm_trace("No client found for %p", c); return NULL; } Commit Message: High: libcrmcommon: fix CVE-2016-7035 (improper IPC guarding) It was discovered that at some n...
0
12,393
Analyze the following 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 sched_power_savings_store(const char *buf, size_t count, int smt) { unsigned int level = 0; if (sscanf(buf, "%u", &level) != 1) return -EINVAL; /* * level is always be positive so don't check for * level < POWERSAVINGS_BALANCE_NONE which is 0 * What happens on 0 or 1 byte write, * ne...
0
16,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: check_authorization_challenge_cb (AuthenticationAgent *agent, PolkitSubject *subject, PolkitIdentity *user_of_subject, PolkitSubject *caller, ...
0
7,334
Analyze the following 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 Plugin::Init(int argc, char* argn[], char* argv[]) { PLUGIN_PRINTF(("Plugin::Init (instance=%p)\n", static_cast<void*>(this))); #ifdef NACL_OSX pp::TextInput_Dev(this).SetTextInputType(PP_TEXTINPUT_TYPE_NONE); #endif argn_ = new char*[argc]; argv_ = new char*[argc]; argc_ = 0; for (int i = 0; i...
0
28,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 RenderViewHostImpl::OnRenderAutoResized(const gfx::Size& new_size) { delegate_->ResizeDueToAutoResize(new_size); } Commit Message: Filter more incoming URLs in the CreateWindow path. BUG=170532 Review URL: https://chromiumcodereview.appspot.com/12036002 git-svn-id: svn://svn.chromium.org/chrome/trunk/s...
0
29,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: PredictorEncodeRow(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s) { TIFFPredictorState *sp = PredictorState(tif); assert(sp != NULL); assert(sp->encodepfunc != NULL); assert(sp->encoderow != NULL); /* XXX horizontal differencing alters user's data XXX */ if( !(*sp->encodepfunc)(tif, bp, cc) ) return...
0
19,758
Analyze the following 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 padlock_sha1_update_nano(struct shash_desc *desc, const u8 *data, unsigned int len) { struct sha1_state *sctx = shash_desc_ctx(desc); unsigned int partial, done; const u8 *src; /*The PHE require the out buffer must 128 bytes and 16-bytes aligned*/ u8 buf[128 + PADLOCK_ALIGNMENT - STACK_ALIGN] _...
0
22,165
Analyze the following 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 CCThreadProxy::finishAllRenderingOnCCThread(CCCompletionEvent* completion) { TRACE_EVENT("CCThreadProxy::finishAllRenderingOnCCThread", this, 0); ASSERT(isImplThread()); if (m_schedulerOnCCThread->redrawPending()) { drawLayersOnCCThread(); m_layerTreeHostImpl->present(); m...
0
28,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: static int __crc32c_intel_finup(u32 *crcp, const u8 *data, unsigned int len, u8 *out) { *(__le32 *)out = ~cpu_to_le32(crc32c_intel_le_hw(*crcp, data, len)); return 0; } Commit Message: crypto: prefix module autoloading with "crypto-" This prefixes all crypto module loading with "crypto-" so we never run t...
0
12,326
Analyze the following 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 DiskCacheBackendTest::BackendDoomAll2() { EXPECT_EQ(2, cache_->GetEntryCount()); EXPECT_THAT(DoomAllEntries(), IsOk()); disk_cache::Entry* entry; ASSERT_THAT(CreateEntry("Something new", &entry), IsOk()); entry->Close(); EXPECT_EQ(1, cache_->GetEntryCount()); } Commit Message: Blockfile cache:...
0
2,616
Analyze the following 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 _xvmc_create_surface ( Display *dpy, XvMCContext *context, XvMCSurface *surface, int *priv_count, CARD32 **priv_data ) { XExtDisplayInfo *info = xvmc_find_display(dpy); xvmcCreateSurfaceReply rep; xvmcCreateSurfaceReq *req; *priv_count = 0; *priv_data = NULL; ...
0
4,880
Analyze the following 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 WebGraphicsContext3DCommandBufferImpl::SetParent( WebGraphicsContext3DCommandBufferImpl* new_parent) { if (parent_ == new_parent) return true; uint32 new_parent_texture_id = 0; if (command_buffer_) { if (new_parent) { int32 token = new_parent->gles2_helper_->InsertToken(); new_...
0
8,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: bus_activation_entry_unref (BusActivationEntry *entry) { if (entry == NULL) /* hash table requires this */ return; _dbus_assert (entry->refcount > 0); entry->refcount--; if (entry->refcount > 0) return; dbus_free (entry->name); dbus_free (entry->exec); dbus_free (entry->user); dbus_free...
0
25,131
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: set_path(const struct passwd* pw) { int r; if (pw->pw_uid) r = logindefs_setenv("PATH", "ENV_PATH", _PATH_DEFPATH); else if ((r = logindefs_setenv("PATH", "ENV_ROOTPATH", NULL)) != 0) r = logindefs_setenv("PATH", "ENV_SUPATH", _PATH_DEFPATH_ROOT); if (r != 0) err (EXIT_FAILURE, _("failed to...
0
17,981
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WebKit::WebBlobRegistry* TestWebKitPlatformSupport::blobRegistry() { return blob_registry_.get(); } Commit Message: Use a new scheme for swapping out RenderViews. BUG=118664 TEST=none Review URL: http://codereview.chromium.org/9720004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127986 0039d316-1c4b...
0
19,743
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: mm_need_new_owner(struct mm_struct *mm, struct task_struct *p) { /* * If there are other users of the mm and the owner (us) is exiting * we need to find a new owner to take on the responsibility. */ if (atomic_read(&mm->mm_users) <= 1) return 0; if (mm->owner != p) return 0; return 1; } Commit Mess...
0
1,569
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: double Performance::ClampTimeResolution(double time_seconds) { DEFINE_THREAD_SAFE_STATIC_LOCAL(TimeClamper, clamper, ()); return clamper.ClampTimeResolution(time_seconds); } Commit Message: Fix timing allow check algorithm for service workers This CL uses the OriginalURLViaServiceWorker() in the timing allo...
0
16,396
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MediaElementAudioSourceNode* MediaElementAudioSourceNode::Create( AudioContext* context, const MediaElementAudioSourceOptions& options, ExceptionState& exception_state) { return Create(*context, *options.mediaElement(), exception_state); } Commit Message: Simplify "WouldTaintOrigin" concept in medi...
0
29,299
Analyze the following 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 DataReductionProxyConfig::InitializeOnIOThread( scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, WarmupURLFetcher::CreateCustomProxyConfigCallback create_custom_proxy_config_callback, NetworkPropertiesManager* manager, const std::string& user_agent) { DCHECK(thread...
1
20,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: void ContextState::RestoreProgramSettings( const ContextState* prev_state, bool restore_transform_feedback_bindings) const { bool flag = (restore_transform_feedback_bindings && feature_info_->IsES3Capable()); if (flag && prev_state) { if (prev_state->bound_transform_feedback.get() &...
0
20,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: int dump_fpu(struct pt_regs *regs, struct user_i387_struct *ufpu) { struct task_struct *tsk = current; struct fpu *fpu = &tsk->thread.fpu; int fpvalid; fpvalid = fpu->fpstate_active; if (fpvalid) fpvalid = !fpregs_get(tsk, NULL, 0, sizeof(struct user_i387_ia32_struct), ufpu, NULL); r...
0
28,396
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: HTMLFormControlsCollection* HTMLFormElement::elements() { return ensureCachedCollection<HTMLFormControlsCollection>(FormControls); } Commit Message: Enforce form-action CSP even when form.target is present. BUG=630332 Review-Url: https://codereview.chromium.org/2464123004 Cr-Commit-Position: refs/heads/maste...
0
6,450
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: sd_show_provisioning_mode(struct device *dev, struct device_attribute *attr, char *buf) { struct scsi_disk *sdkp = to_scsi_disk(dev); return snprintf(buf, 20, "%s\n", lbp_mode[sdkp->provisioning_mode]); } Commit Message: block: fail SCSI passthrough ioctls on partition devices Linux allows executing the...
0
27,874
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: const char* XMLRPC_GetVersionString() { return XMLRPC_VERSION_STR; } Commit Message: CWE ID: CWE-119
0
6,195
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: insertEmphasisEnd(const EmphasisInfo *buffer, const int at, const EmphRuleNumber emphRule, const EmphasisClass class, const TranslationTableHeader *table, int pos, const InString *input, OutString *output, int *posMapping, int *cursorPosition, int *cursorStatus) { if (buffer[at].end & class) { const Tran...
0
29,161
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MediaControlOverlayEnclosureElement::create(MediaControls& mediaControls) { MediaControlOverlayEnclosureElement* enclosure = new MediaControlOverlayEnclosureElement(mediaControls); enclosure->setShadowPseudoId( AtomicString("-webkit-media-controls-overlay-enclosure")); return enclosure; } Commi...
0
7,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: gamma_info_imp(gamma_display *dp, png_structp pp, png_infop pi) { /* Reuse the standard stuff as appropriate. */ standard_info_part1(&dp->this, pp, pi); /* If requested strip 16 to 8 bits - this is handled automagically below * because the output bit depth is read from the library. Note that there...
1
15,153
Analyze the following 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 ImageCapture::ResolveWithNothing(ScriptPromiseResolver* resolver) { DCHECK(resolver); resolver->Resolve(); } Commit Message: Convert MediaTrackConstraints to a ScriptValue IDLDictionaries such as MediaTrackConstraints should not be stored on the heap which would happen when binding one as a parameter t...
0
18,200
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: tst_QQuickWebView::tst_QQuickWebView() { addQtWebProcessToPath(); prepareWebViewComponent(); } Commit Message: [Qt][WK2] Allow transparent WebViews https://bugs.webkit.org/show_bug.cgi?id=80608 Reviewed by Tor Arne Vestbø. Added support for transparentBackground in QQuickWebViewExperimental. This uses ...
0
11,325
Analyze the following 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_init_locked(struct inode *inode, void *opaque) { struct nfs_find_desc *desc = (struct nfs_find_desc *)opaque; struct nfs_fattr *fattr = desc->fattr; set_nfs_fileid(inode, fattr->fileid); nfs_copy_fh(NFS_FH(inode), desc->fh); return 0; } Commit Message: NFSv4: Convert the open and close ops to use fmode...
0
27,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: static struct napi_struct *napi_by_id(unsigned int napi_id) { unsigned int hash = napi_id % HASH_SIZE(napi_hash); struct napi_struct *napi; hlist_for_each_entry_rcu(napi, &napi_hash[hash], napi_hash_node) if (napi->napi_id == napi_id) return napi; return NULL; } Commit Message: tunnels: Don't apply GR...
0
7,523
Analyze the following 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_cpus_allowed_ptr(struct task_struct *p, const struct cpumask *new_mask, bool check) { const struct cpumask *cpu_valid_mask = cpu_active_mask; unsigned int dest_cpu; struct rq_flags rf; struct rq *rq; int ret = 0; rq = task_rq_lock(p, &rf); if (p->flags & PF_KTHREAD) { /* * Ker...
0
3,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: void serverLog(int level, const char *fmt, ...) { va_list ap; char msg[LOG_MAX_LEN]; if ((level&0xff) < server.verbosity) return; va_start(ap, fmt); vsnprintf(msg, sizeof(msg), fmt, ap); va_end(ap); serverLogRaw(level,msg); } Commit Message: Security: Cross Protocol Scripting prote...
0
6,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: ofputil_decode_port_stats(struct ofputil_port_stats *ps, struct ofpbuf *msg) { enum ofperr error; enum ofpraw raw; memset(&(ps->stats), 0xFF, sizeof (ps->stats)); error = (msg->header ? ofpraw_decode(&raw, msg->header) : ofpraw_pull(&raw, msg)); if (error) { return error...
0
12,051
Analyze the following 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 ext2_quota_read(struct super_block *sb, int type, char *data, size_t len, loff_t off) { struct inode *inode = sb_dqopt(sb)->files[type]; sector_t blk = off >> EXT2_BLOCK_SIZE_BITS(sb); int err = 0; int offset = off & (sb->s_blocksize - 1); int tocopy; size_t toread; struct buffer_h...
0
334
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: nfsd4_get_nfs4_acl(struct svc_rqst *rqstp, struct dentry *dentry, struct nfs4_acl **acl) { struct inode *inode = d_inode(dentry); int error = 0; struct posix_acl *pacl = NULL, *dpacl = NULL; unsigned int flags = 0; int size = 0; pacl = get_acl(inode, ACL_TYPE_ACCESS); if (!pacl) pacl = posix_acl_from_...
0
7,174
Analyze the following 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 tls1_enc(SSL *s, int send) { SSL3_RECORD *rec; EVP_CIPHER_CTX *ds; unsigned long l; int bs,i,j,k,pad=0,ret,mac_size=0; const EVP_CIPHER *enc; if (send) { if (EVP_MD_CTX_md(s->write_hash)) { int n=EVP_MD_CTX_size(s->write_hash); OPENSSL_assert(n >= 0); } ds=s->enc_write_ctx; rec= &(...
0
12,359
Analyze the following 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 em_sysenter(struct x86_emulate_ctxt *ctxt) { const struct x86_emulate_ops *ops = ctxt->ops; struct desc_struct cs, ss; u64 msr_data; u16 cs_sel, ss_sel; u64 efer = 0; ops->get_msr(ctxt, MSR_EFER, &efer); /* inject #GP if in real mode */ if (ctxt->mode == X86EMUL_MODE_REAL) return emulate_gp(...
1
350
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void blkif_notify_work(struct xen_blkif_ring *ring) { ring->waiting_reqs = 1; wake_up(&ring->wq); } Commit Message: xen-blkback: don't leak stack data via response ring Rather than constructing a local structure instance on the stack, fill the fields directly on the shared ring, just like other backend...
0
4,225
Analyze the following 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 Tar::ReadHeaders( void ) { FILE *in; TarHeader lHeader; TarRecord lRecord; unsigned int iBegData = 0; char buf_header[512]; in = fopen(mFilePath.fn_str(), "rb"); if(in == NULL) { wxLogFatalError(_("Error: File '%s' not found! Cannot read data."), mFilePath.c_str()); return...
1
23,858
Analyze the following 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::setAutofocusElement(Element* element) { if (!element) { m_autofocusElement = nullptr; return; } if (m_hasAutofocused) return; m_hasAutofocused = true; ASSERT(!m_autofocusElement); m_autofocusElement = element; m_taskRunner->postTask(BLINK_FROM_HER...
0
27,340
Analyze the following 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 inet_fill_link_af(struct sk_buff *skb, const struct net_device *dev, u32 ext_filter_mask) { struct in_device *in_dev = rcu_dereference_rtnl(dev->ip_ptr); struct nlattr *nla; int i; if (!in_dev) return -ENODATA; nla = nla_reserve(skb, IFLA_INET_CONF, IPV4_DEVCONF_MAX * 4); if (!nla) ...
0
22,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: TransportDIB::Id TransportDIB::id() const { return key_; } 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 URL: https://chromiumcodereview.appspot.com/10854242 git-svn-id: svn://svn.chromium.org/chrome/t...
0
14,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: static int nl80211_tx_mgmt_cancel_wait(struct sk_buff *skb, struct genl_info *info) { struct cfg80211_registered_device *rdev = info->user_ptr[0]; struct net_device *dev = info->user_ptr[1]; u64 cookie; if (!info->attrs[NL80211_ATTR_COOKIE]) return -EINVAL; if (!rdev->ops->mgmt_tx_cancel_wait) return -...
0
29,751
Analyze the following 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 ip_rt_frag_needed(struct net *net, const struct iphdr *iph, unsigned short new_mtu, struct net_device *dev) { unsigned short old_mtu = ntohs(iph->tot_len); unsigned short est_mtu = 0; struct inet_peer *peer; peer = inet_getpeer_v4(iph->daddr, 1); if (peer) { unsigned short mtu = n...
0
20,109
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GahpClient::globus_gram_client_job_status(const char * job_contact, int * job_status, int * failure_code) { static const char* command = "GRAM_JOB_STATUS"; if (server->m_commands_supported->contains_anycase(command)==FALSE) { return GAHPCLIENT_COMMAND_NOT_SUPPORTED; } if (!job_contact) job_contact=NULL...
0
11,917