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 struct alien_cache **alloc_alien_cache(int node, int limit, gfp_t gfp) { struct alien_cache **alc_ptr; size_t memsize = sizeof(void *) * nr_node_ids; int i; if (limit > 1) limit = 12; alc_ptr = kzalloc_node(memsize, gfp, node); if (!alc_ptr) return NULL; for_each_node(i) { if (i == node || !...
0
14,864
Analyze the following 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 pskb_expand_head(struct sk_buff *skb, int nhead, int ntail, gfp_t gfp_mask) { int i; u8 *data; int size = nhead + skb_end_offset(skb) + ntail; long off; BUG_ON(nhead < 0); if (skb_shared(skb)) BUG(); size = SKB_DATA_ALIGN(size); if (skb_pfmemalloc(skb)) gfp_mask |= __GFP_MEMALLOC; data...
0
17,319
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PHP_FUNCTION(openssl_csr_new) { struct php_x509_request req; zval * args = NULL, * dn, *attribs = NULL; zval * out_pkey; X509_REQ * csr = NULL; int we_made_the_key = 1; zend_resource *key_resource; if (zend_parse_parameters(ZEND_NUM_ARGS(), "az/|a!a!", &dn, &out_pkey, &args, &attribs) == FAILURE) { retu...
0
10,317
Analyze the following 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 clgi_interception(struct vcpu_svm *svm) { if (nested_svm_check_permissions(svm)) return 1; svm->next_rip = kvm_rip_read(&svm->vcpu) + 3; skip_emulated_instruction(&svm->vcpu); disable_gif(svm); /* After a CLGI no interrupts should come */ svm_clear_vintr(svm); svm->vmcb->control.int_ctl &= ...
0
25,667
Analyze the following 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 OverloadedMethodGMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { scheduler::CooperativeSchedulingManager::Instance()->Safepoint(); bool is_arity_error = false; switch (std::min(1, info.Length())) { case 0: if (true) { OverloadedMethodG2Method(info); return; ...
0
25,986
Analyze the following 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 DoImagesMatch(const gfx::Image& a, const gfx::Image& b) { SkBitmap a_bitmap = a.AsBitmap(); SkBitmap b_bitmap = b.AsBitmap(); if (a_bitmap.width() != b_bitmap.width() || a_bitmap.height() != b_bitmap.height()) { return false; } return memcmp(a_bitmap.getPixels(), b_bitmap.getPixels(), ...
0
2,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: void GpuCommandBufferStub::OnEnsureBackbuffer() { if (!surface_) return; surface_->SetBufferAllocation( gfx::GLSurface::BUFFER_ALLOCATION_FRONT_AND_BACK); } Commit Message: Convert plugin and GPU process to brokered handle duplication. BUG=119250 Review URL: https://chromiumcodereview.appspot.com/...
0
23,426
Analyze the following 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 Browser::GetIndexForInsertionDuringRestore(int relative_index) { return (tab_handler_->GetTabStripModel()->insertion_policy() == TabStripModel::INSERT_AFTER) ? tab_count() : relative_index; } Commit Message: Implement a bubble that appears at the top of the screen when a tab enters fullscreen mode v...
0
9,612
Analyze the following 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 ceph_aes_encrypt(const void *key, int key_len, void *dst, size_t *dst_len, const void *src, size_t src_len) { struct scatterlist sg_in[2], prealloc_sg; struct sg_table sg_out; struct crypto_skcipher *tfm = ceph_crypto_alloc_cipher(); SKCIPHER_REQUEST_ON_STACK(req, tfm); int ret; cha...
0
6,485
Analyze the following 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 DelegatedFrameHost::CheckResizeLock() { if (!resize_lock_ || resize_lock_->expected_size() != current_frame_size_in_dip_) return; resize_lock_->UnlockCompositor(); ui::Compositor* compositor = client_->GetCompositor(); if (compositor) { if (!compositor->HasObserver(this)) composi...
0
19,226
Analyze the following 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 scoped_refptr<ui::Texture> CreateTransportClient( const gfx::Size& size, float device_scale_factor, uint64 transport_handle) { if (!shared_context_.get()) return NULL; scoped_refptr<ImageTransportClientTexture> image( new ImageTransportClientTexture(share...
1
9,705
Analyze the following 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 hns_roce_add_gid(struct ib_device *device, u8 port_num, unsigned int index, const union ib_gid *gid, const struct ib_gid_attr *attr, void **context) { struct hns_roce_dev *hr_dev = to_hr_dev(device); u8 port = port_num - 1; unsigned long flags; int ret; if (port >= hr_dev->caps.num_...
0
10,269
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SpoolssReplyOpenPrinter_r(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep _U_) { dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data; e_ctx_hnd policy_hnd; proto_item *hnd_item; guint32 status; /* Parse packet */ offset = dissect_nt_...
0
3,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: decompileArithmeticOp(int n, SWF_ACTION *actions, int maxn) { struct SWF_ACTIONPUSHPARAM *left, *right; int op_l = OpCode(actions, n, maxn); int op_r = OpCode(actions, n+1, maxn); right=pop(); left=pop(); switch(OpCode(actions, n, maxn)) { /* case SWFACTION_GETMEMBER: decompilePUSHPARAM(peek(),0); br...
0
3,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: void conn_worker_readd(conn *c) { c->ev_flags = EV_READ | EV_PERSIST; event_set(&c->event, c->sfd, c->ev_flags, event_handler, (void *)c); event_base_set(c->thread->base, &c->event); c->state = conn_new_cmd; if (event_add(&c->event, 0) == -1) { perror("event_add"); } } Commit Mes...
0
3,397
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gpu::SharedMemoryLimits GetCompositorContextSharedMemoryLimits( gfx::NativeWindow window) { const gfx::Size screen_size = display::Screen::GetScreen() ->GetDisplayNearestWindow(window) .GetSizeInPixel(); return gpu::SharedMemoryLimits...
0
2,735
Analyze the following 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* Type_Data_Dup(struct _cms_typehandler_struct* self, const void *Ptr, cmsUInt32Number n) { cmsICCData* BinData = (cmsICCData*) Ptr; return _cmsDupMem(self ->ContextID, Ptr, sizeof(cmsICCData) + BinData ->len - 1); cmsUNUSED_PARAMETER(n); } Commit Message: Added an extra check to MLU bounds Th...
0
2,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 posix_get_hrtimer_res(clockid_t which_clock, struct timespec64 *tp) { tp->tv_sec = 0; tp->tv_nsec = hrtimer_resolution; return 0; } Commit Message: posix-timers: Sanitize overrun handling The posix timer overrun handling is broken because the forwarding functions can return a huge number of overru...
0
4,678
Analyze the following 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 PaintPatcher::RefPatch() { if (refcount_ == 0) { DCHECK(!begin_paint_.is_patched()); DCHECK(!end_paint_.is_patched()); begin_paint_.Patch(L"riched20.dll", "user32.dll", "BeginPaint", &BeginPaintIntercept); end_paint_.Patch(L"riched20.dll", "user32.dll", "EndPaint", ...
0
20,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: void Gfx::saveState() { out->saveState(state); state = state->save(); stackHeight++; } Commit Message: CWE ID: CWE-20
0
902
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: inline void Splash::pipeInit(SplashPipe *pipe, int x, int y, SplashPattern *pattern, SplashColorPtr cSrc, SplashCoord aInput, GBool usesShape, GBool nonIsolatedGroup) { pipeSetXY(pipe, x, y); pipe->pattern = NULL; if (pattern) { if (pattern->isStatic()) { pattern->getColor...
0
4,376
Analyze the following 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 rgbvalidate(i_ctx_t *i_ctx_p, ref *space, float *values, int num_comps) { os_ptr op = osp; int i; if (num_comps < 3) return_error(gs_error_stackunderflow); op -= 2; for (i=0;i<3;i++) { if (!r_has_type(op, t_integer) && !r_has_type(op, t_real)) return_er...
0
8,236
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: traverse_wingate (int print_fd, int sok, char *serverAddr, int port) { char buf[128]; snprintf (buf, sizeof (buf), "%s %d\r\n", serverAddr, port); send (sok, buf, strlen (buf), 0); return 0; } Commit Message: ssl: Validate hostnames Closes #524 CWE ID: CWE-310
0
12,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: ofputil_protocol_to_base(enum ofputil_protocol protocol) { return ofputil_protocol_set_tid(protocol, false); } Commit Message: ofp-group: Don't assert-fail decoding bad OF1.5 group mod type or command. When decoding a group mod, the current code validates the group type and command after the whole group mod...
0
23,689
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ofproto_set_datapath_id(struct ofproto *p, uint64_t datapath_id) { uint64_t old_dpid = p->datapath_id; p->datapath_id = datapath_id ? datapath_id : pick_datapath_id(p); if (p->datapath_id != old_dpid) { /* Force all active connections to reconnect, since there is no way to * notify a ...
0
10,214
Analyze the following 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 vmx_set_constant_host_state(struct vcpu_vmx *vmx) { u32 low32, high32; unsigned long tmpl; struct desc_ptr dt; unsigned long cr4; vmcs_writel(HOST_CR0, read_cr0() & ~X86_CR0_TS); /* 22.2.3 */ vmcs_writel(HOST_CR3, read_cr3()); /* 22.2.3 FIXME: shadow tables */ /* Save the most likely value...
0
18,723
Analyze the following 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 DOMPatchSupport::innerPatchNode(Digest* oldDigest, Digest* newDigest, ExceptionCode& ec) { if (oldDigest->m_sha1 == newDigest->m_sha1) return true; Node* oldNode = oldDigest->m_node; Node* newNode = newDigest->m_node; if (newNode->nodeType() != oldNode->nodeType() || newNode->nodeNa...
0
11,913
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: XItoCoreType(int xitype) { int coretype = 0; if (xitype == DeviceMotionNotify) coretype = MotionNotify; else if (xitype == DeviceButtonPress) coretype = ButtonPress; else if (xitype == DeviceButtonRelease) coretype = ButtonRelease; else if (xitype == DeviceKeyPress) ...
0
7,032
Analyze the following 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 test_gf2m_mod_sqrt(BIO *bp, BN_CTX *ctx) { BIGNUM *a, *b[2], *c, *d, *e, *f; int i, j, ret = 0; int p0[] = { 163, 7, 6, 3, 0, -1 }; int p1[] = { 193, 15, 0, -1 }; a = BN_new(); b[0] = BN_new(); b[1] = BN_new(); c = BN_new(); d = BN_new(); e = BN_new(); f = BN_new()...
0
18,414
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: e1000e_intrmgr_pci_unint(E1000ECore *core) { int i; timer_del(core->radv.timer); timer_free(core->radv.timer); timer_del(core->rdtr.timer); timer_free(core->rdtr.timer); timer_del(core->raid.timer); timer_free(core->raid.timer); timer_del(core->tadv.timer); timer_free(core->t...
0
6,755
Analyze the following 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 DBusHelperProxy::hasToStopAction() { QEventLoop loop; loop.processEvents(QEventLoop::AllEvents); return m_stopRequest; } Commit Message: CWE ID: CWE-290
0
23,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: void hns_ppe_update_stats(struct hns_ppe_cb *ppe_cb) { struct hns_ppe_hw_stats *hw_stats = &ppe_cb->hw_stats; hw_stats->rx_pkts_from_sw += dsaf_read_dev(ppe_cb, PPE_HIS_RX_SW_PKT_CNT_REG); hw_stats->rx_pkts += dsaf_read_dev(ppe_cb, PPE_HIS_RX_WR_BD_OK_PKT_CNT_REG); hw_stats->rx_drop_no_bd += dsaf_read_...
0
7,698
Analyze the following 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 LocationWithPerWorldBindingsAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) { v8::Local<v8::Object> holder = info.Holder(); TestObject* impl = V8TestObject::ToImpl(holder); V8SetReturnValueFast(info, WTF::GetPtr(impl->locationWithPerWorldBindings()), impl); } Commit Message: ...
0
9,486
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int handle_invalid_guest_state(struct kvm_vcpu *vcpu) { struct vcpu_vmx *vmx = to_vmx(vcpu); enum emulation_result err = EMULATE_DONE; int ret = 1; u32 cpu_exec_ctrl; bool intr_window_requested; unsigned count = 130; cpu_exec_ctrl = vmcs_read32(CPU_BASED_VM_EXEC_CONTROL); intr_window_requested = c...
0
1,982
Analyze the following 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 ksm_memory_callback(struct notifier_block *self, unsigned long action, void *arg) { struct memory_notify *mn = arg; struct stable_node *stable_node; switch (action) { case MEM_GOING_OFFLINE: /* * Keep it very simple for now: just lock out ksmd and * MADV_UNMERGEABLE while any mem...
0
26,203
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: tilde_expand_paths(char **paths, u_int num_paths) { u_int i; char *cp; for (i = 0; i < num_paths; i++) { cp = tilde_expand_filename(paths[i], original_real_uid); free(paths[i]); paths[i] = cp; } } Commit Message: CWE ID: CWE-254
0
1,496
Analyze the following 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 vcpu_mmio_gva_to_gpa(struct kvm_vcpu *vcpu, unsigned long gva, gpa_t *gpa, struct x86_exception *exception, bool write) { u32 access = ((kvm_x86_ops->get_cpl(vcpu) == 3) ? PFERR_USER_MASK : 0) | (write ? PFERR_WRITE_MASK : 0); if (vcpu_match_mmio_gva(vcpu, gva) && !permission_fault(vc...
0
15,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: Block::Block(long long start, long long size_, long long discard_padding) : m_start(start), m_size(size_), m_track(0), m_timecode(-1), m_flags(0), m_frames(NULL), m_frame_count(-1), m_discard_padding(discard_padding) {} Commit Message: external/libvpx/libwebm: Update s...
0
6,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 ipx_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) { struct sock *sk = sock->sk; struct ipx_sock *ipxs = ipx_sk(sk); DECLARE_SOCKADDR(struct sockaddr_ipx *, usipx, msg->msg_name); struct sockaddr_ipx local_sipx; int rc = -EINVAL; int flags = msg->msg_flags; lock_sock(sk); /* Sock...
0
2,449
Analyze the following 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 URLPatternSet PermissionsData::policy_allowed_hosts() const { base::AutoLock auto_lock(runtime_lock_); return PolicyAllowedHostsUnsafe(); } Commit Message: Call CanCaptureVisiblePage in page capture API. Currently the pageCapture permission allows access to arbitrary local files and chrome:// pages wh...
0
23,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: void ScriptProcessorHandler::SetChannelCount(unsigned long channel_count, ExceptionState& exception_state) { DCHECK(IsMainThread()); BaseAudioContext::GraphAutoLocker locker(Context()); if (channel_count != channel_count_) { exception_state.ThrowDOMException...
0
28,211
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: XFixesCopyRegion (Display *dpy, XserverRegion dst, XserverRegion src) { XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); xXFixesCopyRegionReq *req; XFixesSimpleCheckExtension (dpy, info); LockDisplay (dpy); GetReq (XFixesCopyRegion, req); req->reqType = info->codes->major_opcode; ...
0
14,946
Analyze the following 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 Element::createPseudoElementIfNeeded(PseudoId pseudoId) { if (!document()->styleSheetCollection()->usesBeforeAfterRules()) return; if (!renderer() || !pseudoElementRendererIsNeeded(renderer()->getCachedPseudoStyle(pseudoId))) return; if (!renderer()->canHaveGeneratedChildren()) ...
0
9,861
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MojoResult Core::AttachMessageContext(MojoMessageHandle message_handle, uintptr_t context, MojoMessageContextSerializer serializer, MojoMessageContextDestructor destructor) { if (!message_handle || ...
0
2,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: json_t *json_real(double value) { json_real_t *real; if(isnan(value) || isinf(value)) return NULL; real = jsonp_malloc(sizeof(json_real_t)); if(!real) return NULL; json_init(&real->json, JSON_REAL); real->value = value; return &real->json; } Commit Message: CVE-2013...
0
14,101
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: unsigned long mmap_region(struct file *file, unsigned long addr, unsigned long len, vm_flags_t vm_flags, unsigned long pgoff, struct list_head *uf) { struct mm_struct *mm = current->mm; struct vm_area_struct *vma, *prev; int error; struct rb_node **rb_link, *rb_parent; unsigned long charged = 0; /* Che...
0
15,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: base::Time DownloadItemImpl::GetEndTime() const { return end_time_; } Commit Message: Refactors to simplify rename pathway in DownloadFileManager. This is https://chromiumcodereview.appspot.com/10668004 / r144817 (reverted due to CrOS failure) with the completion logic moved to after the auto-opening. The te...
0
29,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: void DevToolsUIBindings::IndexingDone(int request_id, const std::string& file_system_path) { indexing_jobs_.erase(request_id); DCHECK_CURRENTLY_ON(BrowserThread::UI); base::FundamentalValue request_id_value(request_id); base::StringValue file_system_path_value(file_sy...
0
18,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: void Framebuffer::OnTextureRefDetached(TextureRef* texture) { manager_->OnTextureRefDetached(texture); } Commit Message: Framebuffer clear() needs to consider the situation some draw buffers are disabled. This is when we expose DrawBuffers extension. BUG=376951 TEST=the attached test case, webgl conformance ...
0
8,818
Analyze the following 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 jpc_ns_fwdlift_col(jpc_fix_t *a, int numrows, int stride, int parity) { jpc_fix_t *lptr; jpc_fix_t *hptr; register jpc_fix_t *lptr2; register jpc_fix_t *hptr2; register int n; int llen; llen = (numrows + 1 - parity) >> 1; if (numrows > 1) { /* Apply the first lifting step. */ lptr = &a[0]; ...
0
20,744
Analyze the following 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_bsf(struct x86_emulate_ctxt *ctxt) { u8 zf; __asm__ ("bsf %2, %0; setz %1" : "=r"(ctxt->dst.val), "=q"(zf) : "r"(ctxt->src.val)); ctxt->eflags &= ~X86_EFLAGS_ZF; if (zf) { ctxt->eflags |= X86_EFLAGS_ZF; /* Disable writeback. */ ctxt->dst.type = OP_NONE; } return X86EMUL_CONTINUE;...
0
14,463
Analyze the following 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 WebContentsImpl::OnFirstVisuallyNonEmptyPaint(RenderViewHostImpl* source) { for (auto& observer : observers_) observer.DidFirstVisuallyNonEmptyPaint(); did_first_visually_non_empty_paint_ = true; if (theme_color_ != last_sent_theme_color_) { for (auto& observer : observers_) observer.Di...
0
7,883
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: RenderFrameHostManager::GetSiteInstanceForNavigationRequest( const NavigationRequest& request) { SiteInstance* current_site_instance = render_frame_host_->GetSiteInstance(); bool no_renderer_swap_allowed = false; bool was_server_redirect = request.navigation_handle() && requ...
1
29,795
Analyze the following 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_mmu_page_unlink_children(struct kvm *kvm, struct kvm_mmu_page *sp) { unsigned i; for (i = 0; i < PT64_ENT_PER_PAGE; ++i) mmu_page_zap_pte(kvm, sp, sp->spt + i); } Commit Message: nEPT: Nested INVEPT If we let L1 use EPT, we should probably also support the INVEPT instruction. In our ...
0
4,204
Analyze the following 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 tmx_pretran_link_safe(int slotid) { if(_tmx_proc_ptran==NULL) return; if(_tmx_ptran_table[slotid].plist==NULL) { _tmx_ptran_table[slotid].plist = _tmx_proc_ptran; _tmx_proc_ptran->linked = 1; return; } _tmx_proc_ptran->next = _tmx_ptran_table[slotid].plist; _tmx_ptran_table[slotid].plist->prev ...
0
55
Analyze the following 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 sock_sendmsg_nosec(struct socket *sock, struct msghdr *msg, size_t size) { return do_sock_sendmsg(sock, msg, size, true); } Commit Message: net: validate the range we feed to iov_iter_init() in sys_sendto/sys_recvfrom Cc: stable@vger.kernel.org # v3.19 Signed-off-by: Al Viro <viro@zeniv.linux.org.uk...
0
19,941
Analyze the following 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 regulator_get_mode(struct regulator *regulator) { return _regulator_get_mode(regulator->rdev); } Commit Message: regulator: core: Fix regualtor_ena_gpio_free not to access pin after freeing After freeing pin from regulator_ena_gpio_free, loop can access the pin. So this patch fixes not to access p...
0
21,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: hash_delegation_locked(struct nfs4_delegation *dp, struct nfs4_file *fp) { int status; struct nfs4_client *clp = dp->dl_stid.sc_client; lockdep_assert_held(&state_lock); lockdep_assert_held(&fp->fi_lock); status = nfs4_get_existing_delegation(clp, fp); if (status) return status; ++fp->fi_delegees; ato...
0
26,771
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GC_INNER void * GC_generic_malloc_inner(size_t lb, int k) { void *op; if(SMALL_OBJ(lb)) { struct obj_kind * kind = GC_obj_kinds + k; size_t lg = GC_size_map[lb]; void ** opp = &(kind -> ok_freelist[lg]); op = *opp; if (EXPECT(0 == op, FALSE)) { if (GC_...
0
9,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: int BlockSizeLog2Min1() const { switch (block_size_) { case 16: return 3; case 8: return 2; default: return 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 Cha...
0
26,640
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: CStarter::RemoteShutdownFast(int) { bool fast_in_progress = false; if( jic ) { fast_in_progress = jic->isFastShutdown(); jic->gotShutdownFast(); } if( fast_in_progress == false ) { return ( this->ShutdownFast( ) ); } else { return ( false ); } } Commit Message: CWE ID: CWE-134
0
6,159
Analyze the following 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 timeout_doall_arg(SSL_SESSION *s, TIMEOUT_PARAM *p) { if ((p->time == 0) || (p->time > (s->time + s->timeout))) { /* timeout */ /* * The reason we don't call SSL_CTX_remove_session() is to save on * locking overhead */ (void)lh_SSL_SESSION_delete(p->cache...
0
29,548
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool CardUnmaskPromptViews::ExpirationDateIsValid() const { if (!controller_->ShouldRequestExpirationDate()) return true; return controller_->InputExpirationIsValid( month_input_->GetTextForRow(month_input_->selected_index()), year_input_->GetTextForRow(year_input_->selected_index())); } Com...
0
23,783
Analyze the following 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 V8TestObject::PerWorldBindingsVoidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) { RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_perWorldBindingsVoidMethod"); test_object_v8_internal::PerWorldBindingsVoidMethodMethodForMainWorld(info...
0
15,682
Analyze the following 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 xfrm_aevent_state_notify(struct xfrm_state *x, const struct km_event *c) { struct net *net = xs_net(x); struct sk_buff *skb; skb = nlmsg_new(xfrm_aevent_msgsize(x), GFP_ATOMIC); if (skb == NULL) return -ENOMEM; if (build_aevent(skb, x, c) < 0) BUG(); return nlmsg_multicast(net->xfrm.nlsk, ...
0
29,464
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ATSParser::PSISection::PSISection() : mSkipBytes(0) { } Commit Message: Check section size when verifying CRC Bug: 28333006 Change-Id: Ief7a2da848face78f0edde21e2f2009316076679 CWE ID: CWE-119
0
15,405
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static ssize_t nr_hugepages_mempolicy_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { return nr_hugepages_show_common(kobj, attr, buf); } Commit Message: hugetlb: fix resv_map leak in error path When called for anonymous (non-shared) mappings, hugetlb_reserve_pages() does a resv...
0
25,661
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static _INLINE_ void check_modem_status(struct mp_port *mtpt) { int status; status = serial_in(mtpt, UART_MSR); if ((status & UART_MSR_ANY_DELTA) == 0) return; if (status & UART_MSR_TERI) mtpt->port.icount.rng++; if (status & UART_MSR_DDSR) mtpt->port.icount.dsr++; if (status & UART_MSR_DDCD) sb_...
0
26,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 PaintLayerScrollableArea::HasVerticalOverflow() const { LayoutUnit client_height = LayoutContentRect(kIncludeScrollbars).Height() - HorizontalScrollbarHeight(kIgnorePlatformAndCSSOverlayScrollbarSize); LayoutUnit scroll_height(ScrollHeight()); LayoutUnit box_y = GetLayoutBox()->Location().Y...
0
18,420
Analyze the following 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 gettimerpid(char *name,int cpu){ pid_t pid; char temp[500]; if(name==NULL) name=&temp[0]; sprintf(name,"softirq-timer/%d",cpu); pid=name2pid(name); if(pid==-1){ sprintf(name,"ksoftirqd/%d",cpu); pid=name2pid(name); } return pid; } Commit Message: Fix memory overflow if...
0
18,088
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: e1000_autoneg_timer(void *opaque) { E1000State *s = opaque; s->nic->nc.link_down = false; e1000_link_up(s); s->phy_reg[PHY_STATUS] |= MII_SR_AUTONEG_COMPLETE; DBGOUT(PHY, "Auto negotiation is completed\n"); } Commit Message: CWE ID: CWE-119
0
28,730
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MockQuotaManagerProxy() : QuotaManagerProxy(NULL, NULL) {} Commit Message: Fix possible map::end() dereference in AppCacheUpdateJob triggered by a compromised renderer. BUG=551044 Review URL: https://codereview.chromium.org/1418783005 Cr-Commit-Position: refs/heads/master@{#358815} CWE ID:
0
26,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: void StorageHandler::ClearDataForOrigin( const std::string& origin, const std::string& storage_types, std::unique_ptr<ClearDataForOriginCallback> callback) { if (!process_) return callback->sendFailure(Response::InternalError()); StoragePartition* partition = process_->GetStoragePartitio...
1
23,688
Analyze the following 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_SHP( INS_ARG ) { TGlyph_Zone zp; Int refp; TT_F26Dot6 dx, dy; Long point; (void)args; if ( CUR.top < CUR.GS.loop ) { CUR.error = TT_Err_Invalid_Reference; return; } if ( COMPUTE_Point_Displacement( &dx, &dy, &z...
0
29,015
Analyze the following 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 ProfileSyncService::GetModelSafeRoutingInfo( browser_sync::ModelSafeRoutingInfo* out) const { if (backend_.get() && backend_initialized_) { backend_->GetModelSafeRoutingInfo(out); } else { NOTREACHED(); } } Commit Message: [Sync] Cleanup all tab sync enabling logic now that its on by defau...
0
19,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: void btif_hl_soc_thread_init(void){ BTIF_TRACE_DEBUG("%s", __FUNCTION__); soc_queue = list_new(NULL); if (soc_queue == NULL) LOG_ERROR("%s unable to allocate resources for thread", __func__); select_thread_id = create_thread(btif_hl_select_thread, NULL); } Commit Message: DO NOT MERGE Fix po...
0
23,424
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: base::TaskRunner* RenderMessageFilter::OverrideTaskRunnerForMessage( const IPC::Message& message) { #if defined(OS_WIN) if (message.type() == ViewHostMsg_GetMonitorColorProfile::ID) return BrowserThread::GetBlockingPool(); #endif return NULL; } Commit Message: Follow-on fixes and naming changes for h...
0
17,818
Analyze the following 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_u3v_stream_payload(proto_tree *u3v_telegram_tree, tvbuff_t *tvb, packet_info *pinfo, usb_conv_info_t *usb_conv_info _U_) { proto_item *item = NULL; /* Subtree initialization for Stream Leader */ item = proto_tree_add_item(u3v_telegram_tree, hf_u3v_stream_payload, tvb, 0, -1, ENC_NA); u3v_...
0
15,209
Analyze the following 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 yam_info_open(struct inode *inode, struct file *file) { return seq_open(file, &yam_seqops); } Commit Message: hamradio/yam: fix info leak in ioctl The yam_ioctl() code fails to initialise the cmd field of the struct yamdrv_ioctl_cfg. Add an explicit memset(0) before filling the structure to avoid th...
0
20,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: 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
3,333
Analyze the following 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 vmx_free_vcpu(struct kvm_vcpu *vcpu) { struct vcpu_vmx *vmx = to_vmx(vcpu); if (enable_pml) vmx_destroy_pml_buffer(vmx); free_vpid(vmx->vpid); leave_guest_mode(vcpu); vmx_free_vcpu_nested(vcpu); free_loaded_vmcs(vmx->loaded_vmcs); kfree(vmx->guest_msrs); kvm_vcpu_uninit(vcpu); kmem_cache_f...
0
22,307
Analyze the following 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 RenderFrameDevToolsAgentHost::AttachSession(DevToolsSession* session) { if (!ShouldAllowSession(session)) return false; protocol::EmulationHandler* emulation_handler = new protocol::EmulationHandler(); session->AddHandler(base::WrapUnique(new protocol::BrowserHandler())); session->AddHa...
1
3,845
Analyze the following 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 WebTransformOperations::initialize(const WebTransformOperations& other) { if (m_private.get() != other.m_private.get()) m_private.reset(new WebTransformOperationsPrivate(*other.m_private.get())); else initialize(); } Commit Message: [chromium] We should accelerate all transformatio...
0
20,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: dissect_common_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, struct fp_info *p_fp_info) { /* Common control frame type */ guint8 control_frame_type = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_fp_common_control_frame_type, tvb, offset, 1...
0
28,361
Analyze the following 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 net_bridge_mdb_entry *br_mdb_ip4_get( struct net_bridge_mdb_htable *mdb, __be32 dst, __u16 vid) { struct br_ip br_dst; br_dst.u.ip4 = dst; br_dst.proto = htons(ETH_P_IP); br_dst.vid = vid; return br_mdb_ip_get(mdb, &br_dst); } Commit Message: bridge: fix some kernel warning in multicast tim...
0
21,875
Analyze the following 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 __btrfs_end_transaction(struct btrfs_trans_handle *trans, struct btrfs_root *root, int throttle) { struct btrfs_transaction *cur_trans = trans->transaction; struct btrfs_fs_info *info = root->fs_info; int count = 0; int lock = (trans->type != TRANS_JOIN_NOLOCK); int err = 0; if (--trans->us...
0
8,425
Analyze the following 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 dst_entry *inet6_csk_update_pmtu(struct sock *sk, u32 mtu) { struct flowi6 fl6; struct dst_entry *dst = inet6_csk_route_socket(sk, &fl6); if (IS_ERR(dst)) return NULL; dst->ops->update_pmtu(dst, sk, NULL, mtu); dst = inet6_csk_route_socket(sk, &fl6); return IS_ERR(dst) ? NULL : dst; } Commit Mes...
0
29,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: virtual void PSNRPktHook(const vpx_codec_cx_pkt_t *pkt) { if (!frame0_psnr_) frame0_psnr_ = pkt->data.psnr.psnr[0]; EXPECT_NEAR(pkt->data.psnr.psnr[0], frame0_psnr_, 2.0); } Commit Message: Merge Conflict Fix CL to lmp-mr1-release for ag/849478 DO NOT MERGE - libvpx: Pull from upstream Current...
0
22,741
Analyze the following 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 SyncManager::SyncInternal::SetDecryptionPassphrase( const std::string& passphrase) { if (passphrase.empty()) { NOTREACHED() << "Cannot decrypt with an empty passphrase."; return; } WriteTransaction trans(FROM_HERE, GetUserShare()); Cryptographer* cryptographer = trans.GetCryptographer();...
0
3,456
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: scoped_refptr<AwQuotaManagerBridge> AwMainDelegate::CreateAwQuotaManagerBridge( AwBrowserContext* browser_context) { return AwQuotaManagerBridgeImpl::Create(browser_context); } Commit Message: [Android WebView] Fix a couple of typos Fix a couple of typos in variable names/commentary introduced in: https:/...
0
28,544
Analyze the following 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 ring_buffer_normalize_time_stamp(struct ring_buffer *buffer, int cpu, u64 *ts) { /* Just stupid testing the normalize function and deltas */ *ts >>= DEBUG_SHIFT; } Commit Message: ring-buffer: Prevent overflow of size in ring_buffer_resize() If the size passed to ring_buffer_resize() is greater...
0
29,961
Analyze the following 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 nlmsg_notify(struct sock *sk, struct sk_buff *skb, u32 portid, unsigned int group, int report, gfp_t flags) { int err = 0; if (group) { int exclude_portid = 0; if (report) { atomic_inc(&skb->users); exclude_portid = portid; } /* errors reported via destination sk->sk_err, but propagate ...
0
13,838
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: DeleteWindowFromAnyEvents(WindowPtr pWin, Bool freeResources) { WindowPtr parent; DeviceIntPtr mouse = inputInfo.pointer; DeviceIntPtr keybd = inputInfo.keyboard; FocusClassPtr focus; OtherClientsPtr oc; GrabPtr passive; GrabPtr grab; /* Deactivate any grabs performed on this wind...
0
7,922
Analyze the following 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 isNodeAriaVisible(Node* node) { if (!node) return false; if (!node->isElementNode()) return false; return equalIgnoringCase(toElement(node)->getAttribute(aria_hiddenAttr), "false"); } Commit Message: Switch to equalIgnoringASCIICase throughout modules/accessibi...
1
17,806
Analyze the following 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 packet_notifier(struct notifier_block *this, unsigned long msg, void *data) { struct sock *sk; struct hlist_node *node; struct net_device *dev = data; struct net *net = dev_net(dev); rcu_read_lock(); sk_for_each_rcu(sk, node, &net->packet.sklist) { struct packet_sock *po = pkt_sk(sk); switc...
0
1,522
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static boolean t1_open_fontfile(const char *open_name_prefix) { if (!t1_open()) { char *msg = concat ("! Couldn't find font file ", cur_file_name); error(msg); } t1_init_params(open_name_prefix); return true; /* font file found */ } Commit Message: writet1 protection ...
0
27,612
Analyze the following 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 HTMLSelectElement::defaultEventHandler(Event* event) { if (!renderer()) return; if (isDisabledFormControl()) { HTMLFormControlElementWithState::defaultEventHandler(event); return; } if (usesMenuList()) menuListDefaultEventHandler(event); else lis...
0
19,703
Analyze the following 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 show_stack(struct task_struct *tsk, unsigned long *sp) { #ifdef CONFIG_KALLSYMS extern void sh64_unwind(struct pt_regs *regs); struct pt_regs *regs; regs = tsk ? tsk->thread.kregs : NULL; sh64_unwind(regs); #else printk(KERN_ERR "Can't backtrace on sh64 without CONFIG_KALLSYMS\n"); #endif } Commit Me...
0
21,331
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: NavigationRequest::NavigationRequest( FrameTreeNode* frame_tree_node, const CommonNavigationParams& common_params, mojom::BeginNavigationParamsPtr begin_params, const RequestNavigationParams& request_params, bool browser_initiated, bool from_begin_navigation, const FrameNavigationEntry...
0
14,203
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ActionReply DBusHelperProxy::executeAction(const QString &action, const QString &helperID, const QVariantMap &arguments) { if (!m_actionsInProgress.isEmpty()) { return ActionReply::HelperBusyReply; } QByteArray blob; QDataStream stream(&blob, QIODevice::WriteOnly); stream << argument...
0
12,633