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 int macvlan_device_event(struct notifier_block *unused, unsigned long event, void *ptr) { struct net_device *dev = ptr; struct macvlan_dev *vlan, *next; struct macvlan_port *port; LIST_HEAD(list_kill); if (!macvlan_port_exists(dev)) return NOTIFY_DONE; port = macvlan_port_get(dev); switch (...
0
3,812
Analyze the following 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 OnGetManifest(const GURL& manifest_url, const Manifest& manifest) { manifest_url_ = manifest_url; manifest_ = manifest; message_loop_runner_->Quit(); } Commit Message: Fail the web app manifest fetch if the document is sandboxed. This ensures that sandboxed pages are regarded as non-PWAs, a...
0
29,454
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: OVS_REQUIRES(ofproto_mutex) { enum ofperr error; error = ofproto_check_ofpacts(ofproto, opo->ofpacts, opo->ofpacts_len); if (error) { return error; } return ofproto->ofproto_class->packet_xlate(ofproto, opo); } Commit Message: ofproto: Fix OVS crash when reverting old flows in b...
0
25,146
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void PrintWebViewHelper::PrintNode(const WebKit::WebNode& node) { if (node.isNull() || !node.document().frame()) { return; } if (is_preview_enabled_) { print_preview_context_.InitWithNode(node); RequestPrintPreview(PRINT_PREVIEW_USER_INITIATED_CONTEXT_NODE); } else { WebKit::WebNode ...
1
20,151
Analyze the following 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 ipv6_push_nfrag_opts(struct sk_buff *skb, struct ipv6_txoptions *opt, u8 *proto, struct in6_addr **daddr) { if (opt->srcrt) { ipv6_push_rthdr(skb, proto, opt->srcrt, daddr); /* * IPV6_RTHDRDSTOPTS is ignored * unless IPV6_RTHDR is set (RFC3542). */ if (opt->dst0opt) ipv6_push_ext...
0
24,747
Analyze the following 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_do_ecn_cwr_work(struct sctp_association *asoc, __u32 lowest_tsn) { /* Turn off ECNE getting auto-prepended to every outgoing * packet */ asoc->need_ecne = 0; } Commit Message: sctp: Prevent soft lockup when sctp_accept() is called during a timeout event A case can occur when sctp_acc...
0
18,603
Analyze the following 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 sas_ata_qc_fill_rtf(struct ata_queued_cmd *qc) { struct domain_device *dev = qc->ap->private_data; ata_tf_from_fis(dev->sata_dev.fis, &qc->result_tf); return true; } Commit Message: scsi: libsas: direct call probe and destruct In commit 87c8331fcf72 ("[SCSI] libsas: prevent domain rediscovery co...
0
7,222
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int phar_hex_str(const char *digest, size_t digest_len, char **signature) /* {{{ */ { int pos = -1; size_t len = 0; *signature = (char*)safe_pemalloc(digest_len, 2, 1, PHAR_G(persist)); for (; len < digest_len; ++len) { (*signature)[++pos] = hexChars[((const unsigned char *)digest)[len] >> 4]; (*...
0
22,713
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xsltShallowCopyElem(xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr insert, int isLRE) { xmlNodePtr copy; if ((node->type == XML_DTD_NODE) || (insert == NULL)) return(NULL); if ((node->type == XML_TEXT_NODE) || (node->type == XML_CDATA_SECTION_NODE)) return(xsltCopyText(ctxt, inser...
1
22,114
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: isatap_chksrc(struct sk_buff *skb, const struct iphdr *iph, struct ip_tunnel *t) { struct ip_tunnel_prl_entry *p; int ok = 1; rcu_read_lock(); p = __ipip6_tunnel_locate_prl(t, iph->saddr); if (p) { if (p->flags & PRL_DEFAULT) skb->ndisc_nodetype = NDISC_NODETYPE_DEFAULT; else skb->ndisc_nodetype =...
0
14,836
Analyze the following 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 ShelfLayoutManager::OnWindowRemovedFromLayout(aura::Window* child) { } Commit Message: ash: Add launcher overflow bubble. - Host a LauncherView in bubble to display overflown items; - Mouse wheel and two-finger scroll to scroll the LauncherView in bubble in case overflow bubble is overflown; - Fit bubble w...
0
29,087
Analyze the following 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 RenderViewImpl::OnUpdateWebPreferences(const WebPreferences& prefs) { webkit_preferences_ = prefs; ApplyWebPreferencesInternal(webkit_preferences_, webview()); } Commit Message: Prevent renderer initiated back navigation to cancel a browser one. Renderer initiated back/forward navigations must not be a...
0
9,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: static void intel_pmu_disable_all(void) { struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); wrmsrl(MSR_CORE_PERF_GLOBAL_CTRL, 0); if (test_bit(X86_PMC_IDX_FIXED_BTS, cpuc->active_mask)) intel_pmu_disable_bts(); intel_pmu_pebs_disable_all(); intel_pmu_lbr_disable_all(); } Commit Message: perf:...
0
18,150
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: v8::Local<v8::Value> PrivateScriptRunner::installClassIfNeeded( Document* document, String className) { if (!document->contextDocument()->frame()) return v8::Local<v8::Value>(); v8::HandleScope handleScope(toIsolate(document)); ScriptState* scriptState = ScriptState::forWorld(document->co...
0
22,980
Analyze the following 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 rm_sync(AVFormatContext *s, int64_t *timestamp, int *flags, int *stream_index, int64_t *pos){ RMDemuxContext *rm = s->priv_data; AVIOContext *pb = s->pb; AVStream *st; uint32_t state=0xFFFFFFFF; while(!avio_feof(pb)){ int len, num, i; int mlti_id; *pos= avio...
0
18,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: ColorChooserWin::~ColorChooserWin() { DCHECK(!color_chooser_dialog_); } Commit Message: ColorChooserWin::End should act like the dialog has closed This is only a problem on Windows. When the page closes itself while the color chooser dialog is open, ColorChooserDialog::DidCloseDialog was called after the l...
0
18,372
Analyze the following 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 dwc3_gadget_wakeup(struct usb_gadget *g) { struct dwc3 *dwc = gadget_to_dwc(g); unsigned long flags; int ret; spin_lock_irqsave(&dwc->lock, flags); ret = __dwc3_gadget_wakeup(dwc); spin_unlock_irqrestore(&dwc->lock, flags); return ret; } Commit Message: usb: dwc3: gadget: never call ->com...
0
15,403
Analyze the following 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::BubbleLogicalScrollInParentFrame( ScrollDirection direction, ScrollGranularity granularity) { web_frame_->Client()->BubbleLogicalScrollInParentFrame(direction, granularity); } Commit Message: Prevent renderer initiated ...
0
16,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: param_double( const char *name, double default_value, double min_value, double max_value, ClassAd *me, ClassAd *target, bool use_param_table ) { if(use_param_table) { int tbl_default_valid; double tbl_default_value = param_default_double( name, &tbl_default_valid ); param_range_double(n...
0
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: void __blk_mq_complete_request(struct request *rq) { struct request_queue *q = rq->q; if (!q->softirq_done_fn) blk_mq_end_request(rq, rq->errors); else blk_mq_ipi_complete_request(rq); } Commit Message: blk-mq: fix race between timeout and freeing request Inside timeout handler, blk_mq_tag_to_rq() is ca...
0
19,537
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WindowController::TypeFilter type_filters() { if (params_->get_info.get() && params_->get_info->window_types.get()) return WindowController::GetFilterFromWindowTypes( *params_->get_info->window_types); return WindowController::kNoWindowFilter; } Commit Message: Call CanCaptureVisibleP...
0
1,665
Analyze the following 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 bb_store(struct md_rdev *rdev, const char *page, size_t len) { int rv = badblocks_store(&rdev->badblocks, page, len, 0); /* Maybe that ack was all we needed */ if (test_and_clear_bit(BlockedBadBlocks, &rdev->flags)) wake_up(&rdev->blocked_wait); return rv; } Commit Message: md: use kzalloc()...
0
3,373
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ref_param_key(const iparam_list * plist, gs_param_name pkey, ref * pkref) { if (plist->int_keys) { long key; if (sscanf(pkey, "%ld", &key) != 1) return_error(gs_error_rangecheck); make_int(pkref, key); return 0; } else return name_ref(plist->memory, (co...
0
17,108
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: AddInterp(CompatInfo *info, SymInterpInfo *new, bool same_file) { SymInterpInfo *old = FindMatchingInterp(info, new); if (old) { const int verbosity = xkb_context_get_log_verbosity(info->ctx); const bool report = (same_file && verbosity > 0) || verbosity > 9; enum si_field collide ...
0
17,591
Analyze the following 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 param_get_location( const char *parameter, MyString &filename, int &line_number) { bool found_it; if (parameter != NULL && extra_info != NULL) { found_it = extra_info->GetParam(parameter, filename, line_number); } else { found_it = false; } return found_it; } Commit Message: CWE ID: CWE...
0
8,673
Analyze the following 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 OPJ_SIZE_T JP2WriteHandler(void *buffer,OPJ_SIZE_T length,void *context) { Image *image; ssize_t count; image=(Image *) context; count=WriteBlob(image,(ssize_t) length,(unsigned char *) buffer); return((OPJ_SIZE_T) count); } Commit Message: https://github.com/ImageMagick/ImageMagick/is...
0
8,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: bool InputHandler::setBatchEditingActive(bool active) { if (!isActiveTextEdit()) return false; ASSERT(m_currentFocusElement->document()); ASSERT(m_currentFocusElement->document()->frame()); BackingStoreClient* backingStoreClient = m_webPage->backingStoreClient(); ASSERT(backingStoreC...
0
6,155
Analyze the following 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 samldb_generate_sAMAccountName(struct ldb_context *ldb, struct ldb_message *msg) { char *name; /* Format: $000000-000000000000 */ name = talloc_asprintf(msg, "$%.6X-%.6X%.6X", (unsigned int)generate_random(), (unsigned int)generate_random(), (unsigned int)generate_random()); if...
0
25,785
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int compat_do_ebt_set_ctl(struct sock *sk, int cmd, void __user *user, unsigned int len) { int ret; struct net *net = sock_net(sk); if (!ns_capable(net->user_ns, CAP_NET_ADMIN)) return -EPERM; switch (cmd) { case EBT_SO_SET_ENTRIES: ret = compat_do_replace(net, user, len); break; case EBT_S...
0
25,121
Analyze the following 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 pfkey_register(struct sock *sk, struct sk_buff *skb, const struct sadb_msg *hdr, void * const *ext_hdrs) { struct pfkey_sock *pfk = pfkey_sk(sk); struct sk_buff *supp_skb; if (hdr->sadb_msg_satype > SADB_SATYPE_MAX) return -EINVAL; if (hdr->sadb_msg_satype != SADB_SATYPE_UNSPEC) { if (pfk->re...
0
2,246
Analyze the following 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 verify_stack(unsigned long sp) { if (sp < PAGE_OFFSET || (sp > (unsigned long)high_memory && high_memory != NULL)) return -EFAULT; return 0; } Commit Message: ARM: 7735/2: Preserve the user r/w register TPIDRURW on context switch and fork Since commit 6a1c53124aa1 the user writeable TLS reg...
0
23,079
Analyze the following 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 activityLoggingAccessPerWorldBindingsLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) { TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); v8SetReturnValueInt(info, imp->activityLoggingAccessPerWorldBindingsLongAttribute()); } Commit Message: doc...
0
3,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: free_side (ProxySide *side) { g_clear_object (&side->connection); g_clear_pointer (&side->extra_input_data, g_bytes_unref); g_list_free_full (side->buffers, (GDestroyNotify) buffer_unref); g_list_free_full (side->control_messages, (GDestroyNotify) g_object_unref); if (side->in_source) g_source_des...
0
26,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: void RenderFrameHostImpl::SetSubframeUnloadTimeoutForTesting( const base::TimeDelta& timeout) { subframe_unload_timeout_ = timeout; } Commit Message: Convert FrameHostMsg_DidAddMessageToConsole to Mojo. Note: Since this required changing the test RenderViewImplTest.DispatchBeforeUnloadCanDetachFrame, I ma...
0
2,410
Analyze the following 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 get_file_caps(struct linux_binprm *bprm, bool *effective, bool *has_cap) { struct dentry *dentry; int rc = 0; struct cpu_vfs_cap_data vcaps; bprm_clear_caps(bprm); if (!file_caps_enabled) return 0; if (bprm->file->f_vfsmnt->mnt_flags & MNT_NOSUID) return 0; dentry = dget(bprm->file->f_de...
0
4,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: static int decode_modrm(struct x86_emulate_ctxt *ctxt, struct operand *op) { u8 sib; int index_reg, base_reg, scale; int rc = X86EMUL_CONTINUE; ulong modrm_ea = 0; ctxt->modrm_reg = ((ctxt->rex_prefix << 1) & 8); /* REX.R */ index_reg = (ctxt->rex_prefix << 2) & 8; /* REX.X */ base_reg = (ctxt->rex_pre...
0
15,408
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: std::string DownloadItemImpl::DebugString(bool verbose) const { std::string description = base::StringPrintf("{ id = %d" " state = %s", download_id_.local(), DebugDownloadStateString(GetState())); std::string url_list("<none>");...
0
23,036
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PP_Bool StartPpapiProxy(PP_Instance instance) { if (CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableNaClIPCProxy)) { ChannelHandleMap& map = g_channel_handle_map.Get(); ChannelHandleMap::iterator it = map.find(instance); if (it == map.end()) return PP_FALSE; IPC::C...
1
26,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: static int http_send_data(HTTPContext *c) { int len, ret; for(;;) { if (c->buffer_ptr >= c->buffer_end) { ret = http_prepare_data(c); if (ret < 0) return -1; else if (ret) /* state change requested */ break; ...
0
29,439
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: path_out(PG_FUNCTION_ARGS) { PATH *path = PG_GETARG_PATH_P(0); PG_RETURN_CSTRING(path_encode(path->closed ? PATH_CLOSED : PATH_OPEN, path->npts, path->p)); } Commit Message: Predict integer overflow to avoid buffer overruns. Several functions, mostly type input functions, calculated an allocation size suc...
0
3,836
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WebRect WebLocalFrameImpl::GetSelectionBoundsRectForTesting() const { return HasSelection() ? WebRect(PixelSnappedIntRect( GetFrame()->Selection().AbsoluteUnclippedBounds())) : WebRect(); } Commit Message: Do not forward resource timing to parent frame after back-fo...
0
29,347
Analyze the following 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 zend_set_timeout(zend_long seconds, int reset_signals) /* {{{ */ { EG(timeout_seconds) = seconds; #ifdef ZEND_WIN32 if(!seconds) { return; } /* Don't use ChangeTimerQueueTimer() as it will not restart an expired timer, so we could end up with just an ignored timeout. Instead delete and re...
0
14,686
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: virtual ~AcceleratorControllerTest() {}; Commit Message: accelerators: Remove deprecated Accelerator ctor that takes booleans. BUG=128242 R=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/10399085 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137957 0039d316-1c4b-4281-b951-d872f208...
0
23,293
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: cmsBool isabsolutepath(const char *path) { char ThreeChars[4]; if(path == NULL) return FALSE; if (path[0] == 0) return FALSE; strncpy(ThreeChars, path, 3); ThreeChars[3] = 0; if(ThreeChars[0] == DIR_CHAR) return TRUE; #ifdef CMS_IS_WINDOWS_ if (isalpha((int...
0
10,477
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: DRM_ENUM_NAME_FN(drm_get_dirty_info_name, drm_dirty_info_enum_list) struct drm_conn_prop_enum_list { int type; char *name; int count; }; Commit Message: drm: integer overflow in drm_mode_dirtyfb_ioctl() There is a potential integer overflow in drm_mode_dirtyfb_ioctl() if userspace passes in a large num_c...
0
3,257
Analyze the following 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 mov_write_ms_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track) { int ret; int64_t pos = avio_tell(pb); avio_wb32(pb, 0); avio_wl32(pb, track->tag); // store it byteswapped track->par->codec_tag = av_bswap16(track->tag >> 16); if ((ret = ff_put_wav_header(s, pb, track->pa...
0
19,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: int touch(const char *path) { return touch_file(path, false, USEC_INFINITY, UID_INVALID, GID_INVALID, MODE_INVALID); } Commit Message: basic: fix touch() creating files with 07777 mode mode_t is unsigned, so MODE_INVALID < 0 can never be true. This fixes a possible DoS where any user could fill /run by...
0
19,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: static void nss_update_connecting_state(ssl_connect_state state, void *secret) { struct ssl_connect_data *connssl = (struct ssl_connect_data *)secret; if(PR_GetError() != PR_WOULD_BLOCK_ERROR) /* an unrelated error is passing by */ return; switch(connssl->connecting_state) { case ssl_connect_2: ...
0
3,897
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: XineramaGetCursorScreen(DeviceIntPtr pDev) { if (!noPanoramiXExtension) { return pDev->spriteInfo->sprite->screen->myNum; } else { return 0; } } Commit Message: CWE ID: CWE-119
0
27,218
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: std::string EscapeCacheFileName(const std::string& filename) { std::string escaped; for (size_t i = 0; i < filename.size(); ++i) { char c = filename[i]; if (c == '%' || c == '.' || c == '/') { base::StringAppendF(&escaped, "%%%02X", c); } else { escaped.push_back(c); } } return...
0
9,031
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SYSCALL_DEFINE2(mkdir, const char __user *, pathname, umode_t, mode) { return sys_mkdirat(AT_FDCWD, pathname, mode); } Commit Message: fs: umount on symlink leaks mnt count Currently umount on symlink blocks following umount: /vz is separate mount # ls /vz/ -al | grep test drwxr-xr-x. 2 root root 4096...
0
10,138
Analyze the following 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 withScriptStateObjMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { TestObject* imp = V8TestObject::toNative(info.Holder()); ScriptState* currentState = ScriptState::current(); if (!currentState) return; ScriptState& state = *currentState; RefPtr<TestObject> result ...
0
14,830
Analyze the following 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 RenderFrameSubmissionObserver::WaitForMetadataChange() { Wait(); } Commit Message: Apply ExtensionNavigationThrottle filesystem/blob checks to all frames. BUG=836858 Change-Id: I34333a72501129fd40b5a9aa6378c9f35f1e7fc2 Reviewed-on: https://chromium-review.googlesource.com/1028511 Reviewed-by: Devlin <rd...
0
29,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: UINT32 GKI_get_os_tick_count(void) { struct timespec timespec; clock_gettime(CLOCK_BOOTTIME, &timespec); return (timespec.tv_sec * 1000) + (timespec.tv_nsec / 1000000); } Commit Message: DO NOT MERGE Fix potential DoS caused by delivering signal to BT process Bug: 28885210 Change-Id: I63866d894bfca47464d6e4...
0
3,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: static int proc_id_map_open(struct inode *inode, struct file *file, const struct seq_operations *seq_ops) { struct user_namespace *ns = NULL; struct task_struct *task; struct seq_file *seq; int ret = -EINVAL; task = get_proc_task(inode); if (task) { rcu_read_lock(); ns = get_user_ns(task_cred_xxx(task...
0
23,881
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: row_copy(png_bytep toBuffer, png_const_bytep fromBuffer, unsigned int bitWidth) { memcpy(toBuffer, fromBuffer, bitWidth >> 3); if ((bitWidth & 7) != 0) { unsigned int mask; toBuffer += bitWidth >> 3; fromBuffer += bitWidth >> 3; /* The remaining bits are in the top of the byte, th...
1
18,255
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ScriptExecutor* ExecuteCodeInTabFunction::GetScriptExecutor() { Browser* browser = NULL; content::WebContents* contents = NULL; bool success = GetTabById(execute_tab_id_, browser_context(), include_incognito(), &browser, nullptr, &contents, nullptr, &error_) && contents && brow...
0
12,461
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: OneClickSigninSyncStarter::SigninDialogDelegate::SigninDialogDelegate( base::WeakPtr<OneClickSigninSyncStarter> sync_starter) : sync_starter_(sync_starter) { } Commit Message: Display confirmation dialog for untrusted signins BUG=252062 Review URL: https://chromiumcodereview.appspot.com/17482002 git-svn...
0
23,125
Analyze the following 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 get_seek_page_info(stb_vorbis *f, ProbedPage *z) { uint8 header[27], lacing[255]; int i,len; z->page_start = stb_vorbis_get_file_offset(f); getn(f, header, 27); if (header[0] != 'O' || header[1] != 'g' || header[2] != 'g' || header[3] != 'S') return 0; getn(f, lacing, header[2...
0
18,936
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void SimpleExtensionLoadPrompt::InstallUIProceed() { if (extension_service_.get()) extension_service_->OnExtensionInstalled( extension_, false, 0); // Not from web store. delete this; } Commit Message: Limit extent of webstore app to just chrome.google.com/webstore. BUG=93497 TEST=Try installin...
0
17,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: void AppCacheUpdateJob::ClearPendingMasterEntries() { for (PendingMasters::iterator it = pending_master_entries_.begin(); it != pending_master_entries_.end(); ++it) { PendingHosts& hosts = it->second; for (PendingHosts::iterator host_it = hosts.begin(); host_it != hosts.end(); ++host_it)...
0
260
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: unsigned int XKeyEventKeyCode(ui::KeyboardCode key_code, int flags, Display* display) { const int keysym = XKeysymForWindowsKeyCode(key_code, flags & ui::EF_SHIFT_DOWN); return (keysym == XK_less) ? 59 : ...
0
22,767
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: NameValueParserGetData(void * d, const char * datas, int l) { struct NameValueParserData * data = (struct NameValueParserData *)d; if(strcmp(data->curelt, "NewPortListing") == 0) { /* specific case for NewPortListing which is a XML Document */ data->portListing = malloc(l + 1); if(!data->portListing) ...
0
8,219
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: calc_load_n(unsigned long load, unsigned long exp, unsigned long active, unsigned int n) { return calc_load(load, fixed_power_int(exp, FSHIFT, n), active); } Commit Message: Sched: fix skip_clock_update optimization idle_balance() drops/retakes rq->lock, leaving the previous task vulnerable to set_tsk_ne...
0
29,506
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: DesktopMediaID MediaStreamManager::ResolveTabCaptureDeviceIdOnUIThread( const std::string& capture_device_id, int requesting_process_id, int requesting_frame_id, const GURL& origin) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); return DesktopStreamsRegistry::GetInstance()->RequestMediaFor...
0
21,641
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void pop_fetch_mail(void) { char buffer[LONG_STRING]; char msgbuf[SHORT_STRING]; char *url = NULL, *p = NULL; int delanswer, last = 0, msgs, bytes, rset = 0, ret; struct Connection *conn = NULL; struct Context ctx; struct Message *msg = NULL; struct Account acct; struct PopData *pop_data = NULL;...
0
22,956
Analyze the following 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_drop_xobject_imp(fz_context *ctx, fz_storable *xobj_) { pdf_xobject *xobj = (pdf_xobject *)xobj_; pdf_drop_obj(ctx, xobj->obj); fz_free(ctx, xobj); } Commit Message: CWE ID: CWE-20
0
17,459
Analyze the following 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 process_metadata(AVFormatContext *s, const uint8_t *name, uint16_t name_len, uint16_t val_len, uint16_t type, AVDictionary **met) { int ret; ff_asf_guid guid; if (val_len) { switch (type) { case ASF_UNICODE: asf_read_value(s, name, va...
0
14,599
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ops_make_string_pool(regex_t* reg) { int i; int len; int size; UChar* pool; UChar* curr; size = ops_calc_size_of_string_pool(reg); if (size <= 0) { return 0; } curr = pool = (UChar* )xmalloc((size_t )size); CHECK_NULL_RETURN_MEMERR(pool); for (i = 0; i < (int )reg->ops_used; i++) { ...
0
23,868
Analyze the following 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 cgsleep_us_r(cgtimer_t *ts_start, int64_t us) { struct timespec ts_diff; us_to_timespec(&ts_diff, us); cgsleep_spec(&ts_diff, ts_start); } Commit Message: stratum: parse_notify(): Don't die on malformed bbversion/prev_hash/nbit/ntime. Might have introduced a memory leak, don't have time to check. :( S...
0
29,106
Analyze the following 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
7,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: static void power_pmu_setup(int cpu) { struct cpu_hw_events *cpuhw = &per_cpu(cpu_hw_events, cpu); if (!ppmu) return; memset(cpuhw, 0, sizeof(*cpuhw)); cpuhw->mmcr[0] = MMCR0_FC; } Commit Message: perf, powerpc: Handle events that raise an exception without overflowing Events on POWER7 can roll back if a...
0
1,090
Analyze the following 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 crypto_inc_byte(u8 *a, unsigned int size) { u8 *b = (a + size); u8 c; for (; size; size--) { c = *--b + 1; *b = c; if (c) break; } } Commit Message: crypto: include crypto- module prefix in template This adds the module loading prefix "crypto-" to the template lookup as well. F...
0
5,182
Analyze the following 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 sha1_final(struct shash_desc *desc, u8 *out) { struct sha1_state *sctx = shash_desc_ctx(desc); unsigned int i, index, padlen; __be32 *dst = (__be32 *)out; __be64 bits; static const u8 padding[SHA1_BLOCK_SIZE] = { 0x80, }; bits = cpu_to_be64(sctx->count << 3); /* Pad out to 56 mod 64 and append...
0
10,375
Analyze the following 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 t2p_read_tiff_init(T2P* t2p, TIFF* input){ tdir_t directorycount=0; tdir_t i=0; uint16 pagen=0; uint16 paged=0; uint16 xuint16=0; directorycount=TIFFNumberOfDirectories(input); t2p->tiff_pages = (T2P_PAGE*) _TIFFmalloc(TIFFSafeMultiply(tmsize_t,directorycount,sizeof(T2P_PAGE))); if(t2p->tiff_pages=...
0
16,604
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void ChromeContentBrowserClient::GetSchemesBypassingSecureContextCheckWhitelist( std::set<std::string>* schemes) { *schemes = secure_origin_whitelist::GetSchemesBypassingSecureContextCheck(); } Commit Message: Move IsDataSaverEnabledByUser to be a static method and use it This method now officially become...
0
25,140
Analyze the following 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 tcp_simple_retransmit(struct sock *sk) { const struct inet_connection_sock *icsk = inet_csk(sk); struct tcp_sock *tp = tcp_sk(sk); struct sk_buff *skb; unsigned int mss = tcp_current_mss(sk); u32 prior_lost = tp->lost_out; tcp_for_write_queue(skb, sk) { if (skb == tcp_send_head(sk)) break; if (...
0
29,079
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: char *jas_image_fmttostr(int fmt) { jas_image_fmtinfo_t *fmtinfo; if (!(fmtinfo = jas_image_lookupfmtbyid(fmt))) { return 0; } return fmtinfo->name; } Commit Message: The generation of the configuration file jas_config.h has been completely reworked in order to avoid pollution of the global namespace. Som...
0
938
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: make_NegHints(OM_uint32 *minor_status, spnego_gss_cred_id_t spcred, gss_buffer_t *outbuf) { gss_buffer_desc hintNameBuf; gss_name_t hintName = GSS_C_NO_NAME; gss_name_t hintKerberosName; gss_OID hintNameType; OM_uint32 major_status; OM_uint32 minor; unsigned int tlen = 0; unsigned int hintNameSize ...
0
20,836
Analyze the following 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 TargetHandler::Throttle::Clear() { CleanupPointers(); if (agent_host_) { agent_host_ = nullptr; Resume(); } } Commit Message: DevTools: speculative fix for crash in NetworkHandler::Disable This keeps BrowserContext* and StoragePartition* instead of RenderProcessHost* in an attemp to resolve U...
0
4,471
Analyze the following 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 DevToolsWindow::GetMinimizedHeight() { const int kMinimizedDevToolsHeight = 24; return kMinimizedDevToolsHeight; } Commit Message: DevTools: handle devtools renderer unresponsiveness during beforeunload event interception This patch fixes the crash which happenes under the following conditions: 1. DevT...
0
13,819
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: dissect_cpch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, struct fp_info *p_fp_info) { gboolean is_control_frame; /* Header CRC */ proto_tree_add_item(tree, hf_fp_header_crc, tvb, offset, 1, ENC_BIG_ENDIAN); /* Frame Type */ is_contr...
0
1,759
Analyze the following 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 ctl_table_header *__register_sysctl_paths( struct ctl_table_root *root, struct nsproxy *namespaces, const struct ctl_path *path, struct ctl_table *table) { struct ctl_table_header *header; struct ctl_table *new, **prevp; unsigned int n, npath; struct ctl_table_set *set; /* Count the path component...
0
8,238
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: create_property_node(Node **np, ScanEnv* env, const char* propname) { int r; CClassNode* cc; *np = node_new_cclass(); if (IS_NULL(*np)) return ONIGERR_MEMORY; cc = NCCLASS(*np); r = add_property_to_cc(cc, propname, 0, env); if (r != 0) onig_node_free(*np); return r; } Commit Message: Merge p...
0
9,176
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ResourceFetcher::~ResourceFetcher() { m_documentLoader = 0; m_document = nullptr; clearPreloads(); ASSERT(!m_requestCount); } Commit Message: Enforce SVG image security rules SVG images have unique security rules that prevent them from loading any external resources. This patch enforces these ...
0
22,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 int _nfs41_test_stateid(struct nfs_server *server, nfs4_stateid *stateid) { int status; struct nfs41_test_stateid_args args = { .stateid = stateid, }; struct nfs41_test_stateid_res res; struct rpc_message msg = { .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_TEST_STATEID], .rpc_argp = &args, .rpc...
0
12,643
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WebContents* GetEmbedderForGuest(content::WebContents* guest) { CHECK(guest); return static_cast<content::WebContentsImpl*>(guest)->GetOuterWebContents(); } Commit Message: Apply ExtensionNavigationThrottle filesystem/blob checks to all frames. BUG=836858 Change-Id: I34333a72501129fd40b5a9aa6378c9f35f1e7fc...
0
11,408
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool PPB_Widget_Impl::GetLocation(PP_Rect* location) { *location = location_; return true; } Commit Message: Maintain a map of all resources in the resource tracker and clear instance back pointers when needed, BUG=85808 Review URL: http://codereview.chromium.org/7196001 git-svn-id: svn://svn.chromium.org/...
0
17,471
Analyze the following 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 sas_target_destroy(struct scsi_target *starget) { struct domain_device *found_dev = starget->hostdata; if (!found_dev) return; starget->hostdata = NULL; sas_put_device(found_dev); } Commit Message: scsi: libsas: defer ata device eh commands to libata When ata device doing EH, some commands still at...
0
29,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: megasas_read_fw_status_reg_xscale(struct megasas_instance *instance) { return readl(&instance->reg_set->outbound_msg_0); } Commit Message: scsi: megaraid_sas: return error when create DMA pool failed when create DMA pool for cmd frames failed, we should return -ENOMEM, instead of 0. In some case in: megas...
0
21,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: static void __fire_sched_in_preempt_notifiers(struct task_struct *curr) { struct preempt_notifier *notifier; hlist_for_each_entry(notifier, &curr->preempt_notifiers, link) notifier->ops->sched_in(notifier, raw_smp_processor_id()); } Commit Message: Merge branch 'stacking-fixes' (vfs stacking fixes from Jann...
0
29,154
Analyze the following 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 OxideQQuickWebView::goBack() { Q_D(OxideQQuickWebView); if (!d->proxy_) { return; } d->proxy_->goBack(); } Commit Message: CWE ID: CWE-20
0
16,385
Analyze the following 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::didFailLoad(WebFrame* frame, const WebURLError& error) { FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidFailLoad(frame, error)); } Commit Message: DevTools: move DevToolsAgent/Client into content. BUG=84078 TEST= Review URL: http://codereview.chromium.org/7461019 git-svn-id: svn://svn...
0
10,951
Analyze the following 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 timerfd_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) { struct timerfd_ctx *ctx = file->private_data; ssize_t res; u64 ticks = 0; if (count < sizeof(ticks)) return -EINVAL; spin_lock_irq(&ctx->wqh.lock); if (file->f_flags & O_NONBLOCK) res = -EAGAIN; else ...
0
1,427
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int kvm_vm_ioctl_deassign_device(struct kvm *kvm, struct kvm_assigned_pci_dev *assigned_dev) { int r = 0; struct kvm_assigned_dev_kernel *match; mutex_lock(&kvm->lock); match = kvm_find_assigned_dev(&kvm->arch.assigned_dev_head, assigned_dev->assigned_dev_id); if (!match) { printk(KERN...
0
20,343
Analyze the following 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 XMLHttpRequest::send(const String& body, ExceptionState& es) { if (!initSend(es)) return; if (!body.isNull() && areMethodAndURLValidForSend()) { String contentType = getRequestHeader("Content-Type"); if (contentType.isEmpty()) { setRequestHeaderInternal("Content-T...
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: void DatabaseImpl::IDBThreadHelper::AbortWithError( int64_t transaction_id, scoped_refptr<IndexedDBCallbacks> callbacks, const IndexedDBDatabaseError& error) { DCHECK(idb_thread_checker_.CalledOnValidThread()); callbacks->OnError(error); if (!connection_->IsConnected()) return; IndexedD...
0
2,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: ofpact_hdrs_equal(const struct ofpact_hdrs *a, const struct ofpact_hdrs *b) { return (a->vendor == b->vendor && a->type == b->type && a->ofp_version == b->ofp_version); } Commit Message: ofp-actions: Avoid buffer overread in BUNDLE action decoding. Reported-at: http...
0
11,399
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xsltUnregisterAllExtModuleElement(void) { xmlMutexLock(xsltExtMutex); xmlHashFree(xsltElementsHash, (xmlHashDeallocator) xsltFreeExtElement); xsltElementsHash = NULL; xmlMutexUnlock(xsltExtMutex); } Commit Message: Roll libxslt to 891681e3e948f31732229f53cb6db7215f740fc7 BUG=583156,583171 Rev...
0
8,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 RenderWidgetHostViewAndroid::SelectionChanged(const string16& text, size_t offset, const ui::Range& range) { RenderWidgetHostViewBase::SelectionChanged(text, offset, range); if (text.empty() || range.is...
0
23,085