instruction
stringclasses
1 value
input
stringlengths
56
241k
output
int64
0
1
__index_level_0__
int64
0
175k
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static inline void gen_op_st_v(DisasContext *s, int idx, TCGv t0, TCGv a0) { tcg_gen_qemu_st_tl(t0, a0, s->mem_index, idx | MO_LE); } Commit Message: tcg/i386: Check the size of instruction being translated This fixes the bug: 'user-to-root privesc inside VM via bad translation caching' reported by Jann Hor...
0
66,381
Analyze the following 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 cm_timewait_info * cm_insert_remote_id(struct cm_timewait_info *timewait_info) { struct rb_node **link = &cm.remote_id_table.rb_node; struct rb_node *parent = NULL; struct cm_timewait_info *cur_timewait_info; __be64 remote_ca_guid = timewait_info->remote_ca_guid; __be32 remote_id = t...
0
38,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: static int __xfrm6_tunnel_spi_check(struct net *net, u32 spi) { struct xfrm6_tunnel_net *xfrm6_tn = xfrm6_tunnel_pernet(net); struct xfrm6_tunnel_spi *x6spi; int index = xfrm6_tunnel_spi_hash_byspi(spi); struct hlist_node *pos; hlist_for_each_entry(x6spi, pos, &xfrm6_tn->spi_byspi[index], li...
0
27,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: static void vmx_set_virtual_x2apic_mode(struct kvm_vcpu *vcpu, bool set) { u32 sec_exec_control; /* Postpone execution until vmcs01 is the current VMCS. */ if (is_guest_mode(vcpu)) { to_vmx(vcpu)->nested.change_vmcs01_virtual_x2apic_mode = true; return; } if (!cpu_has_vmx_virtualize_x2apic_mode()) re...
0
63,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: void SyncManager::SyncInternal::OnIPAddressChanged() { DVLOG(1) << "IP address change detected"; if (!observing_ip_address_changes_) { DVLOG(1) << "IP address change dropped."; return; } OnIPAddressChangedImpl(); } Commit Message: [Sync] Cleanup all tab sync enabling logic now that its on by def...
0
105,144
Analyze the following 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 php_rshutdown_session_globals(TSRMLS_D) /* {{{ */ { if (PS(http_session_vars)) { zval_ptr_dtor(&PS(http_session_vars)); PS(http_session_vars) = NULL; } /* Do NOT destroy PS(mod_user_names) here! */ if (PS(mod_data) || PS(mod_user_implemented)) { zend_try { PS(mod)->s_close(&PS(mod_...
0
9,623
Analyze the following 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 sk_filter_charge(struct sock *sk, struct sk_filter *fp) { atomic_inc(&fp->refcnt); atomic_add(sk_filter_size(fp->len), &sk->sk_omem_alloc); } Commit Message: filter: prevent nla extensions to peek beyond the end of the message The BPF_S_ANC_NLATTR and BPF_S_ANC_NLATTR_NEST extensions fail to check for a ...
0
38,250
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool Browser::ShouldCloseWindow() { if (!CanCloseWithInProgressDownloads()) return false; if (HasCompletedUnloadProcessing()) return IsClosingPermitted(); is_attempting_to_close_browser_ = true; if (!TabsNeedBeforeUnloadFired()) return IsClosingPermitted(); ProcessPendingTabs(); return...
0
97,369
Analyze the following 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 InspectorClientImpl::clearBrowserCache() { if (WebDevToolsAgentImpl* agent = devToolsAgent()) agent->clearBrowserCache(); } Commit Message: [4/4] Process clearBrowserCahce/cookies commands in browser. BUG=366585 Review URL: https://codereview.chromium.org/251183005 git-svn-id: svn://svn.chrom...
1
171,346
Analyze the following 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_BOOL bmp_read_rle4_data(FILE* IN, OPJ_UINT8* pData, OPJ_UINT32 stride, OPJ_UINT32 width, OPJ_UINT32 height) { OPJ_UINT32 x, y; OPJ_UINT8 *pix; const OPJ_UINT8 *beyond; beyond = pData + stride * height; pix = pData; x = y = 0U; while(y < height) { int c = getc(IN); if(c == EOF) break; ...
0
70,086
Analyze the following 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 ptrace_getxregs(struct task_struct *child, void __user *uregs) { struct pt_regs *regs = task_pt_regs(child); struct thread_info *ti = task_thread_info(child); elf_xtregs_t __user *xtregs = uregs; int ret = 0; if (!access_ok(VERIFY_WRITE, uregs, sizeof(elf_xtregs_t))) return -EIO; #if XTENSA_HAVE_COPR...
0
26,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: gen_svm_check_intercept_param(DisasContext *s, target_ulong pc_start, uint32_t type, uint64_t param) { /* no SVM activated; fast case */ if (likely(!(s->flags & HF_SVMI_MASK))) return; gen_update_cc_op(s); gen_jmp_im(pc_start - s->cs_base); gen_helper_svm_...
0
66,419
Analyze the following 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 MediaPlayerService::Client::setDataSource( const sp<IStreamSource> &source) { player_type playerType = MediaPlayerFactory::getPlayerType(this, source); sp<MediaPlayerBase> p = setDataSource_pre(playerType); if (p == NULL) { return NO_INIT; } setDataSource_post(p, p->setDataSource(source)...
0
158,029
Analyze the following 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 virtio_net_set_netclient_name(VirtIONet *n, const char *name, const char *type) { /* * The name can be NULL, the netclient name will be type.x. */ assert(type != NULL); if (n->netclient_name) { g_free(n->netclient_name); n->netclient_n...
0
15,857
Analyze the following 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 JBIG2Stream::readProfilesSeg(Guint length) { Guint i; for (i = 0; i < length; ++i) { curStr->getChar(); } } Commit Message: CWE ID: CWE-189
0
1,213
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: krb5_encode_histkey(osa_princ_ent_rec *princ_ent) { unsigned int i; krb5_error_code err = 0; struct berval **ret = NULL; if (princ_ent->old_key_len <= 0) return NULL; ret = k5calloc(princ_ent->old_key_len + 1, sizeof(struct berval *), &err); if (ret == NULL) goto cleanup;...
0
54,374
Analyze the following 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 CoordinatorImpl::RequestGlobalMemoryDumpAndAppendToTrace( MemoryDumpType dump_type, MemoryDumpLevelOfDetail level_of_detail, const RequestGlobalMemoryDumpAndAppendToTraceCallback& callback) { auto adapter = [](const RequestGlobalMemoryDumpAndAppendToTraceCallback& callback, ...
1
172,916
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: entry_guard_add_to_sample(guard_selection_t *gs, const node_t *node) { log_info(LD_GUARD, "Adding %s as to the entry guard sample set.", node_describe(node)); /* make sure that the guard is not already sampled. */ if (BUG(have_sampled_guard_with_id(gs, (const uint8_t*)n...
0
69,662
Analyze the following 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 sd_read_protection_type(struct scsi_disk *sdkp, unsigned char *buffer) { struct scsi_device *sdp = sdkp->device; u8 type; if (scsi_device_protection(sdp) == 0 || (buffer[12] & 1) == 0) return; type = ((buffer[12] >> 1) & 7) + 1; /* P_TYPE 0 = Type 1 */ if (type == sdkp->protection_type || !s...
0
94,406
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: image_pixel_setf(image_pixel *this, unsigned int max) { this->redf = this->red / (double)max; this->greenf = this->green / (double)max; this->bluef = this->blue / (double)max; this->alphaf = this->alpha / (double)max; if (this->red < max) this->rede = this->redf * DBL_EPSILON; else ...
1
173,618
Analyze the following 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 Track::Info::Copy(Info& dst) const { if (&dst == this) return 0; dst.type = type; dst.number = number; dst.defaultDuration = defaultDuration; dst.codecDelay = codecDelay; dst.seekPreRoll = seekPreRoll; dst.uid = uid; dst.lacing = lacing; dst.settings = settings; if (int status = CopyStr(...
0
164,190
Analyze the following 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 BrowserView::Activate() { frame_->Activate(); } Commit Message: Remove TabContents from TabStripModelObserver::TabDetachedAt. BUG=107201 TEST=no visible change Review URL: https://chromiumcodereview.appspot.com/11293205 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167122 0039d316-1c4b-4281-b951...
0
118,298
Analyze the following 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 cmd_getquotaroot(const char *tag, const char *name) { mbentry_t *mbentry = NULL; struct mailbox *mailbox = NULL; int myrights; int r, doclose = 0; char *intname = mboxname_from_external(name, &imapd_namespace, imapd_userid); r = mlookup(tag, name, intname, &mbentry); if (r...
0
95,148
Analyze the following 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 crypto_ahash *mcryptd_ahash_child(struct mcryptd_ahash *tfm) { struct mcryptd_hash_ctx *ctx = crypto_ahash_ctx(&tfm->base); return ctx->child; } Commit Message: crypto: mcryptd - Check mcryptd algorithm compatibility Algorithms not compatible with mcryptd could be spawned by mcryptd with a direct cryp...
0
71,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 FileSystemOperation::CreateDirectory(const GURL& path_url, bool exclusive, bool recursive, const StatusCallback& callback) { DCHECK(SetPendingOperationType(kOperationCreateDirectory...
0
104,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: BluetoothApiSocket* BluetoothSocketAsyncApiFunction::GetSocket( int api_resource_id) { return manager_->Get(extension_id(), api_resource_id); } Commit Message: chrome.bluetoothSocket: Fix regression in send() In https://crrev.com/c/997098, params_ was changed to a local variable, but it needs to last long...
0
154,064
Analyze the following 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 perf_event_init_context(struct task_struct *child, int ctxn) { struct perf_event_context *child_ctx, *parent_ctx; struct perf_event_context *cloned_ctx; struct perf_event *event; struct task_struct *parent = current; int inherited_all = 1; unsigned long flags; int ret = 0; if (likely(!parent->perf_ev...
0
26,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: KURL Element::getNonEmptyURLAttribute(const QualifiedName& name) const { #if !ASSERT_DISABLED if (elementData()) { if (const Attribute* attribute = getAttributeItem(name)) ASSERT(isURLAttribute(*attribute)); } #endif String value = stripLeadingAndTrailingHTMLSpaces(getAttribute(nam...
0
112,278
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void rtnl_fdb_notify(struct net_device *dev, u8 *addr, u16 vid, int type, u16 ndm_state) { struct net *net = dev_net(dev); struct sk_buff *skb; int err = -ENOBUFS; skb = nlmsg_new(rtnl_fdb_nlmsg_size(), GFP_ATOMIC); if (!skb) goto errout; err = nlmsg_populate_fdb_fill(skb, dev, addr, vid, ...
0
53,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: SafeBrowsingState::~SafeBrowsingState() {} 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 tests that test the auto-open...
0
106,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: void switch_booke_debug_regs(struct debug_reg *new_debug) { if ((current->thread.debug.dbcr0 & DBCR0_IDM) || (new_debug->dbcr0 & DBCR0_IDM)) prime_debug_regs(new_debug); } Commit Message: powerpc/tm: Fix crash when forking inside a transaction When we fork/clone we currently don't copy any of the TM state...
0
38,653
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void *Type_MPEmatrix_Read(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, cmsUInt32Number* nItems, cmsUInt32Number SizeOfTag) { cmsStage* mpe; cmsUInt16Number InputChans, OutputChans; cmsUInt32Number nElems, i; cmsFloat64Number* Matrix; cmsFloat64Number* Offsets; if (!_cmsRead...
0
71,022
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: nbt_udp137_print(netdissect_options *ndo, const u_char *data, int length) { const u_char *maxbuf = data + length; int name_trn_id, response, opcode, nm_flags, rcode; int qdcount, ancount, nscount, arcount; const u_char *p; int total, i; ND_TCHECK2(data[10], 2); name_t...
0
93,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: inconsistent_match(enum ofputil_protocol *usable_protocols) { *usable_protocols &= OFPUTIL_P_OF10_ANY; } Commit Message: ofp-actions: Avoid buffer overread in BUNDLE action decoding. Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9052 Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Just...
0
76,972
Analyze the following 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 RaisesExceptionVoidMethodTestCallbackInterfaceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { ExceptionState exception_state(info.GetIsolate(), ExceptionState::kExecutionContext, "TestObject", "raisesExceptionVoidMethodTestCallbackInterfaceArg"); TestObject* impl = V8TestObject::ToIm...
0
135,058
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: __xmlDefaultSAXHandler(void) { if (IS_MAIN_THREAD) return (&xmlDefaultSAXHandler); else return (&xmlGetGlobalState()->xmlDefaultSAXHandler); } Commit Message: Attempt to address libxml crash. BUG=129930 Review URL: https://chromiumcodereview.appspot.com/10458051 git-svn-id: svn://svn.chromium.org/chr...
0
107,290
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: exsltCryptoGcryptRc4Decrypt (xmlXPathParserContextPtr ctxt, const unsigned char *key, const unsigned char *msg, int msglen, unsigned char *dest, int destlen) { gcry_cipher_hd_t cipher; gcry_error_t rc = 0; exsltCryptoGcryptInit (); rc = gcry_cipher_open (&cipher, GCRY_CIP...
0
156,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: int OPENSSL_atexit(void (*handler)(void)) { OPENSSL_INIT_STOP *newhand; #if !defined(OPENSSL_USE_NODELETE)\ && !defined(OPENSSL_NO_PINSHARED) { union { void *sym; void (*func)(void); } handlersym; handlersym.func = handler; # if defined(DSO_WIN32) && !...
0
12,011
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void __init early_trap_pf_init(void) { #ifdef CONFIG_X86_64 set_intr_gate(X86_TRAP_PF, page_fault); #endif } Commit Message: x86_64, traps: Stop using IST for #SS On a 32-bit kernel, this has no effect, since there are no IST stacks. On a 64-bit kernel, #SS can only happen in user code, on a failed iret to us...
0
35,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: void InFlightBackendIO::DoomEntry(const std::string& key, const net::CompletionCallback& callback) { scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback)); operation->DoomEntry(key); PostOperation(FROM_HERE, operation.get()); } Commit Message: Blockfi...
0
147,315
Analyze the following 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 doWriteAlgorithmId(blink::WebCryptoAlgorithmId id) { switch (id) { case blink::WebCryptoAlgorithmIdAesCbc: return doWriteUint32(AesCbcTag); case blink::WebCryptoAlgorithmIdHmac: return doWriteUint32(HmacTag); case blink::WebCryptoAlgorithmIdRsaS...
0
120,466
Analyze the following 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 RBinElfSymbol *Elf_(r_bin_elf_get_phdr_symbols)(ELFOBJ *bin) { if (!bin) { return NULL; } if (bin->phdr_symbols) { return bin->phdr_symbols; } bin->phdr_symbols = get_symbols_from_phdr (bin, R_BIN_ELF_SYMBOLS); return bin->phdr_symbols; } Commit Message: Fix #8764 - huge vd_aux caused pointer wr...
0
60,065
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void MediaStreamManager::StopDevice(MediaStreamType type, int session_id) { DCHECK_CURRENTLY_ON(BrowserThread::IO); DVLOG(1) << "StopDevice" << "{type = " << type << "}" << "{session_id = " << session_id << "}"; auto request_it = requests_.begin(); while (request_it != requests_.end(...
0
153,207
Analyze the following 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 SetConfig(const ClientConfig& config) { config_run_loop_ = std::make_unique<base::RunLoop>(); config_ = config; } Commit Message: Disable all DRP URL fetches when holdback is enabled Disable secure proxy checker, warmup url fetcher and client config fetch when the client is in DRP (Data Reduc...
0
137,849
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void HTMLMediaElement::FinishSeek() { BLINK_MEDIA_LOG << "finishSeek(" << (void*)this << ")"; seeking_ = false; SetOfficialPlaybackPosition(CurrentPlaybackPosition()); ScheduleTimeupdateEvent(false); ScheduleEvent(EventTypeNames::seeked); SetDisplayMode(kVideo); } Commit Message: Simplify "Would...
0
144,553
Analyze the following 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_attr_fs_locations(struct xdr_stream *xdr, uint32_t *bitmap, struct nfs4_fs_locations *res) { int n; __be32 *p; int status = -EIO; if (unlikely(bitmap[0] & (FATTR4_WORD0_FS_LOCATIONS -1U))) goto out; status = 0; if (unlikely(!(bitmap[0] & FATTR4_WORD0_FS_LOCATIONS))) goto out; dprintk...
0
23,263
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: mgmt_body_print(netdissect_options *ndo, uint16_t fc, const uint8_t *src, const u_char *p, u_int length) { ND_PRINT((ndo, "%s", tok2str(st_str, "Unhandled Management subtype(%x)", FC_SUBTYPE(fc)))); /* There may be a problem w/ AP not having this bit set */ if (FC_PROTECTED(fc)) return wep_p...
0
62,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: void InterstitialPageImpl::FocusThroughTabTraversal(bool reverse) { if (!enabled()) return; render_view_host_->SetInitialFocus(reverse); } Commit Message: Don't show current RenderWidgetHostView while interstitial is showing. Also moves interstitial page tracking from RenderFrameHostManager to WebConten...
0
136,092
Analyze the following 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 CameraService::removeListener( const sp<ICameraServiceListener>& listener) { ALOGV("%s: Remove listener %p", __FUNCTION__, listener.get()); if (listener == 0) { ALOGE("%s: Listener must not be null", __FUNCTION__); return BAD_VALUE; } Mutex::Autolock lock(mServiceLock); Vector<sp<ICa...
0
161,699
Analyze the following 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 vrend_set_stencil_ref(struct vrend_context *ctx, struct pipe_stencil_ref *ref) { if (ctx->sub->stencil_refs[0] != ref->ref_value[0] || ctx->sub->stencil_refs[1] != ref->ref_value[1]) { ctx->sub->stencil_refs[0] = ref->ref_value[0]; ctx->sub->stencil_refs[1] = ...
0
8,943
Analyze the following 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 GLES2Implementation::GetInteger64i_vHelper(GLenum pname, GLuint index, GLint64* data) { return false; } Commit Message: Add GL_PROGRAM_COMPLETION_QUERY_CHROMIUM This makes the query of GL_COMPLETION_STATUS_KHR...
0
140,997
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool InspectorPageAgent::CachedResourceContent(Resource* cached_resource, String* result, bool* base64_encoded) { bool has_zero_size; if (!PrepareResourceBuffer(cached_resource, &has_zero_size)) return false; ...
0
138,549
Analyze the following 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 ConvertYUY2ToYUV(const uint8* src, uint8* yplane, uint8* uplane, uint8* vplane, int width, int height) { ConvertYUY2ToYUV_C(src, yplane, uplane, vplane, width, height); } Commit Message: Add check...
0
98,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: int udf_CS0toUTF8(struct ustr *utf_o, const struct ustr *ocu_i) { const uint8_t *ocu; uint8_t cmp_id, ocu_len; int i; ocu_len = ocu_i->u_len; if (ocu_len == 0) { memset(utf_o, 0, sizeof(struct ustr)); return 0; } cmp_id = ocu_i->u_cmpID; if (cmp_id != 8 && cmp_id != 16) { memset(utf_o, 0, sizeof(s...
0
45,268
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PermissionsData::AccessType PermissionsData::GetPageAccess( const Extension* extension, const GURL& document_url, int tab_id, std::string* error) const { base::AutoLock auto_lock(runtime_lock_); const PermissionSet* tab_permissions = GetTabSpecificPermissions(tab_id); return CanRunOnPage( ...
0
155,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: mm_ssh_gssapi_checkmic(Gssctxt *ctx, gss_buffer_t gssbuf, gss_buffer_t gssmic) { Buffer m; OM_uint32 major; buffer_init(&m); buffer_put_string(&m, gssbuf->value, gssbuf->length); buffer_put_string(&m, gssmic->value, gssmic->length); mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_GSSCHECKMIC, &m); mm_req...
0
42,166
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int adev_set_master_volume(struct audio_hw_device *dev, float volume) { UNUSED(dev); UNUSED(volume); FNLOG(); return -ENOSYS; } Commit Message: DO NOT MERGE Fix potential DoS caused by delivering signal to BT process Bug: 28885210 Change-Id: I63866d894bfca47464d6e42e3fb0357c4f94d360 Conf...
0
158,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 lock_buffer_pool(BufferPool *const pool) { #if CONFIG_MULTITHREAD pthread_mutex_lock(&pool->pool_mutex); #else (void)pool; #endif } Commit Message: DO NOT MERGE libvpx: Cherry-pick 8b4c315 from upstream Description from upstream: vp9_alloc_context_buffers: clear cm->mi* on failure this fixes a crash in...
0
157,757
Analyze the following 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 ValidatePCPMsg(pcp_info_t *pcp_msg_info) { if (pcp_msg_info->result_code) { return 0; } /* RFC 6887, section 8.2: MUST return address mismatch if NAT * in middle. */ if (memcmp(pcp_msg_info->int_ip, &pcp_msg_info->sender_ip, sizeof(pcp_msg_info->sender_ip)) != 0) { pcp_msg_info->re...
0
89,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: static void collectTargetNodes(Node* node, NodeVector& nodes) { if (node->nodeType() != Node::DOCUMENT_FRAGMENT_NODE) { nodes.append(node); return; } getChildNodes(node, nodes); } Commit Message: https://bugs.webkit.org/show_bug.cgi?id=93587 Node::replaceChild() can create bad DOM top...
0
98,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: daemon_linux_lvm2_vg_set_name_authorized_cb (Daemon *daemon, Device *device, DBusGMethodInvocation *context, const gchar *action_id, g...
0
11,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: int Range::startOffset(ExceptionCode& ec) const { if (!m_start.container()) { ec = INVALID_STATE_ERR; return 0; } return m_start.offset(); } Commit Message: There are too many poorly named functions to create a fragment from markup https://bugs.webkit.org/show_bug.cgi?id=87339 Revie...
0
100,281
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void UkmPageLoadMetricsObserver::ReportMainResourceTimingMetrics( const page_load_metrics::mojom::PageLoadTiming& timing, ukm::builders::PageLoad* builder) { DCHECK(main_frame_timing_.has_value()); builder->SetMainFrameResource_SocketReused(main_frame_timing_->socket_reused); int64_t dns_start_ms ...
0
140,179
Analyze the following 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 __f2fs_replace_block(struct f2fs_sb_info *sbi, struct f2fs_summary *sum, block_t old_blkaddr, block_t new_blkaddr, bool recover_curseg, bool recover_newaddr) { struct sit_info *sit_i = SIT_I(sbi); struct curseg_info *curseg; unsigned int segno, old_cursegno; struct seg_entry *se; int type; unsi...
0
85,329
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: internalSubsetDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID) { callbacks++; if (quiet) return; fprintf(SAXdebug, "SAX.internalSubset(%s,", name); if (ExternalID == NULL) fprintf(SAXdebug, " ,"); else fprintf(SAXdebug, " %s,...
0
59,595
Analyze the following 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_port_get_stats(const struct ofport *port, struct netdev_stats *stats) { struct ofproto *ofproto = port->ofproto; int error; if (ofproto->ofproto_class->port_get_stats) { error = ofproto->ofproto_class->port_get_stats(port, stats); } else { error = EOPNOTSUPP; } re...
0
77,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 SocketStreamDispatcherHost::OnClose(net::SocketStream* socket) { int socket_id = SocketStreamHost::SocketIdFromSocketStream(socket); DVLOG(1) << "SocketStreamDispatcherHost::OnClosed socket_id=" << socket_id; if (socket_id == content::kNoSocketId) { LOG(ERROR) << "NoSocketId in OnClose"; return...
0
107,921
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void pdf_run_G(fz_context *ctx, pdf_processor *proc, float g) { pdf_run_processor *pr = (pdf_run_processor *)proc; pr->dev->flags &= ~FZ_DEVFLAG_STROKECOLOR_UNDEFINED; pdf_set_colorspace(ctx, pr, PDF_STROKE, fz_device_gray(ctx)); pdf_set_color(ctx, pr, PDF_STROKE, &g); } Commit Message: CWE ID: CWE-4...
0
484
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: struct commit *get_revision(struct rev_info *revs) { struct commit *c; struct commit_list *reversed; if (revs->reverse) { reversed = NULL; while ((c = get_revision_internal(revs))) commit_list_insert(c, &reversed); revs->commits = reversed; revs->reverse = 0; revs->reverse_output_stage = 1; } ...
0
54,996
Analyze the following 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 ContainerNode::willRemoveChild(Node& child) { ASSERT(child.parentNode() == this); ChildListMutationScope(*this).willRemoveChild(child); child.notifyMutationObserversNodeWillDetach(); dispatchChildRemovalEvents(child); ChildFrameDisconnector(child).disconnect(); if (document() != child...
0
125,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: void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu) { kvm_arm_set_running_vcpu(NULL); } Commit Message: ARM: KVM: prevent NULL pointer dereferences with KVM VCPU ioctl Some ARM KVM VCPU ioctls require the vCPU to be properly initialized with the KVM_ARM_VCPU_INIT ioctl before being used with further requests. KVM_RU...
0
28,963
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xfs_init_security( struct inode *inode, struct inode *dir, const struct qstr *qstr) { return security_inode_init_security(inode, dir, qstr, &xfs_initxattrs, NULL); } Commit Message: xfs: fix missing ILOCK unlock when xfs_setattr_nonsize fails due to EDQUOT Benjamin Moody reported to Debian that XF...
0
88,330
Analyze the following 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 load_balance(int this_cpu, struct rq *this_rq, struct sched_domain *sd, enum cpu_idle_type idle, int *continue_balancing) { int ld_moved, cur_ld_moved, active_balance = 0; struct sched_domain *sd_parent = sd->parent; struct sched_group *group; struct rq *busiest; struct rq_flags rf; struct ...
0
92,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: void setJSTestObjVoidSequenceAttr(ExecState* exec, JSObject* thisObject, JSValue value) { JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); TestObj* impl = static_cast<TestObj*>(castedThis->impl()); impl->setVoidSequenceAttr(toNativeArray<void>(exec, value)); } Commit Message: [JSC] Implement a...
0
101,365
Analyze the following 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_fiel_tag(AVIOContext *pb, MOVTrack *track, int field_order) { unsigned mov_field_order = 0; if (field_order < FF_ARRAY_ELEMS(fiel_data)) mov_field_order = fiel_data[field_order]; else return 0; avio_wb32(pb, 10); ffio_wfourcc(pb, "fiel"); avio_wb16(pb, ...
0
79,351
Analyze the following 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 webkit_web_view_select_all(WebKitWebView* webView) { g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView)); g_signal_emit(webView, webkit_web_view_signals[SELECT_ALL], 0); } Commit Message: 2011-06-02 Joone Hur <joone.hur@collabora.co.uk> Reviewed by Martin Robinson. [GTK] Only load dic...
0
100,632
Analyze the following 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 ClientDiscardableSharedMemoryManager::ReleaseSpan( std::unique_ptr<DiscardableSharedMemoryHeap::Span> span) { base::AutoLock lock(lock_); if (!span->shared_memory()) return; heap_->MergeIntoFreeLists(std::move(span)); MemoryUsageChanged(heap_->GetSize(), heap_->GetSizeOfFreeLists()); } Co...
0
149,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: static jboolean android_net_wifi_set_log_handler(JNIEnv *env, jclass cls, jint iface, jint id) { JNIHelper helper(env); wifi_interface_handle handle = getIfaceHandle(helper, cls, iface); ALOGD("android_net_wifi_set_log_handler = %p", handle); wifi_ring_buffer_data_handler handler; handler.on_ri...
0
159,104
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void authenc_esn_geniv_ahash_done(struct crypto_async_request *areq, int err) { struct aead_request *req = areq->data; struct crypto_aead *authenc_esn = crypto_aead_reqtfm(req); struct crypto_authenc_esn_ctx *ctx = crypto_aead_ctx(authenc_esn); struct authenc_esn_request_ctx *areq_ctx = aead_requ...
0
45,534
Analyze the following 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 SetterRaisesExceptionLongAttributeAttributeSetter( v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) { v8::Isolate* isolate = info.GetIsolate(); ALLOW_UNUSED_LOCAL(isolate); v8::Local<v8::Object> holder = info.Holder(); ALLOW_UNUSED_LOCAL(holder); TestObje...
0
135,160
Analyze the following 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 sparc_pmu_event_init(struct perf_event *event) { struct perf_event_attr *attr = &event->attr; struct perf_event *evts[MAX_HWEVENTS]; struct hw_perf_event *hwc = &event->hw; unsigned long events[MAX_HWEVENTS]; int current_idx_dmy[MAX_HWEVENTS]; const struct perf_event_map *pmap; int n; if (atom...
0
25,669
Analyze the following 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 FramebufferManager::RemoveFramebuffer(GLuint client_id) { FramebufferMap::iterator it = framebuffers_.find(client_id); if (it != framebuffers_.end()) { it->second->MarkAsDeleted(); framebuffers_.erase(it); } } Commit Message: Framebuffer clear() needs to consider the situation some draw buffer...
0
120,711
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: std::string MockGetHostName() { return "WTC-WIN7"; } Commit Message: Sanitize headers in Proxy Authentication Required responses BUG=431504 Review URL: https://codereview.chromium.org/769043003 Cr-Commit-Position: refs/heads/master@{#310014} CWE ID: CWE-19
0
129,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: static unsigned char *read_chunk(struct mschm_decompressor_p *self, struct mschmd_header *chm, struct mspack_file *fh, unsigned int chunk_num) { struct mspack_system *sys = self->system; unsigned char *buf; /* check arguments - most are already checked by chmd_fast_find */ if (chun...
0
76,341
Analyze the following 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 ExpectLabelsAndTypes(const char* html, const std::vector<base::string16>& id_attributes, const std::vector<base::string16>& name_attributes, const std::vector<base::string16>& labels, const std::...
0
151,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: R_API RBinFile *r_bin_file_new_from_bytes(RBin *bin, const char *file, const ut8 *bytes, ut64 sz, ut64 file_sz, int rawstr, ut64 baseaddr, ut64 loadaddr, int fd, const char *pluginname, const char *xtrname, ut64 offset, bool steal_ptr) { ut8 binfile_created = false; RBinPlugin *plugin = NULL; RBinXtrPlugin *xt...
0
82,813
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PHP_FUNCTION(curl_error) { zval *zid; php_curl *ch; if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zid) == FAILURE) { return; } if ((ch = (php_curl*)zend_fetch_resource(Z_RES_P(zid), le_curl_name, le_curl)) == NULL) { RETURN_FALSE; } ch->err.str[CURL_ERROR_SIZE] = 0; RETURN_STRING(ch->err.str); ...
0
50,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 void crypto_rfc4106_free(struct crypto_instance *inst) { crypto_drop_spawn(crypto_instance_ctx(inst)); kfree(inst); } Commit Message: crypto: include crypto- module prefix in template This adds the module loading prefix "crypto-" to the template lookup as well. For example, attempting to load 'vfat(bl...
0
45,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: ExtensionTtsPlatformImplWin* ExtensionTtsPlatformImplWin::GetInstance() { return Singleton<ExtensionTtsPlatformImplWin>::get(); } Commit Message: Extend TTS extension API to support richer events returned from the engine to the client. Previously we just had a completed event; this adds start, word boundary...
0
99,676
Analyze the following 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 close_connection(h2o_http2_conn_t *conn) { conn->state = H2O_HTTP2_CONN_STATE_IS_CLOSING; if (conn->_write.buf_in_flight != NULL || h2o_timeout_is_linked(&conn->_write.timeout_entry)) { /* there is a pending write, let on_write_complete actually close the connection */ } else { ...
1
167,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: static int nfs4_lookup_root(struct nfs_server *server, struct nfs_fh *fhandle, struct nfs_fsinfo *info) { struct nfs4_exception exception = { }; int err; do { err = _nfs4_lookup_root(server, fhandle, info); switch (err) { case 0: case -NFS4ERR_WRONGSEC: goto out; default: err = nfs4_handle_ex...
0
29,177
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int perf_event_set_bpf_handler(struct perf_event *event, u32 prog_fd) { return -EOPNOTSUPP; } Commit Message: perf/core: Fix concurrent sys_perf_event_open() vs. 'move_group' race Di Shen reported a race between two concurrent sys_perf_event_open() calls where both try and move the same pre-existing sof...
0
68,379
Analyze the following 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 active_load_balance_cpu_stop(void *data) { struct rq *busiest_rq = data; int busiest_cpu = cpu_of(busiest_rq); int target_cpu = busiest_rq->push_cpu; struct rq *target_rq = cpu_rq(target_cpu); struct sched_domain *sd; struct task_struct *p = NULL; struct rq_flags rf; rq_lock_irq(busiest_rq, &r...
0
92,458
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: trace_recursive_lock(struct ring_buffer_per_cpu *cpu_buffer) { unsigned int val = cpu_buffer->current_context; int bit; if (in_interrupt()) { if (in_nmi()) bit = RB_CTX_NMI; else if (in_irq()) bit = RB_CTX_IRQ; else bit = RB_CTX_SOFTIRQ; } else bit = RB_CTX_NORMAL; if (unlikely(val & (1 <<...
0
72,642
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Element* Document::getElementById(const AtomicString& id) const { return TreeScope::getElementById(id); } Commit Message: Unreviewed, rolling out r147402. http://trac.webkit.org/changeset/147402 https://bugs.webkit.org/show_bug.cgi?id=112903 Source/WebCore: * dom/Document.cpp: (WebCore::Document::processH...
0
105,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: 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
163,042
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static inline int __btrfs_submit_dio_bio(struct bio *bio, struct inode *inode, int rw, u64 file_offset, int skip_sum, int async_submit) { int write = rw & REQ_WRITE; struct btrfs_root *root = BTRFS_I(inode)->root; int ret; if (async_submit) async_submit = !atomic_read(&BTRFS_I(inode)->sync_writ...
0
34,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: magic_setparam(struct magic_set *ms, int param, const void *val) { switch (param) { case MAGIC_PARAM_INDIR_MAX: ms->indir_max = *(const size_t *)val; return 0; case MAGIC_PARAM_NAME_MAX: ms->name_max = *(const size_t *)val; return 0; case MAGIC_PARAM_ELF_PHNUM_MAX: ms->elf_phnum_max = *(const size_t...
1
166,775
Analyze the following 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 CWebServer::RType_Users(WebEmSession & session, const request& req, Json::Value &root) { bool bHaveUser = (session.username != ""); int urights = 3; if (bHaveUser) { int iUser = FindUser(session.username.c_str()); if (iUser != -1) urights = static_cast<int>(m_users[iUser].userrig...
0
91,067
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: UsbTabHelper::~UsbTabHelper() {} Commit Message: Ensure device choosers are closed on navigation The requestDevice() IPCs can race with navigation. This change ensures that choosers are closed on navigation and adds browser tests to exercise this for Web Bluetooth and WebUSB. Bug: 723503 Change-Id: I6676016122...
0
155,096