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: void WebRuntimeFeatures::EnableAudioOutputDevices(bool enable) { RuntimeEnabledFeatures::SetAudioOutputDevicesEnabled(enable); } Commit Message: Remove RequireCSSExtensionForFile runtime enabled flag. The feature has long since been stable (since M64) and doesn't seem to be a need for this flag. BUG=788936 ...
0
154,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: static NOINLINE char *xmalloc_optname_optval(uint8_t *option, const struct dhcp_optflag *optflag, const char *opt_name) { unsigned upper_length; int len, type, optlen; char *dest, *ret; /* option points to OPT_DATA, need to go back to get OPT_LEN */ len = option[-OPT_DATA + OPT_LEN]; type = optflag->flag...
1
165,349
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ZEND_API int zend_ts_hash_find(TsHashTable *ht, char *arKey, uint nKeyLength, void **pData) { int retval; begin_read(ht); retval = zend_hash_find(TS_HASH(ht), arKey, nKeyLength, pData); end_read(ht); return retval; } Commit Message: CWE ID:
0
7,450
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: status_t CameraDeviceClient::getCameraInfo(/*out*/CameraMetadata* info) { ATRACE_CALL(); ALOGV("%s", __FUNCTION__); status_t res = OK; if ( (res = checkPid(__FUNCTION__) ) != OK) return res; Mutex::Autolock icl(mBinderSerializationLock); if (!mDevice.get()) return DEAD_OBJECT; if (info != NULL) ...
0
161,817
Analyze the following 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 GLES2DecoderImpl::DoGetRenderbufferParameteriv( GLenum target, GLenum pname, GLint* params) { RenderbufferManager::RenderbufferInfo* renderbuffer = GetRenderbufferInfoForTarget(GL_RENDERBUFFER); if (!renderbuffer) { SetGLError(GL_INVALID_OPERATION, "glGetRenderbufferParameter...
0
103,535
Analyze the following 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 char **GetTransformTokens(void *context,const char *text, int *number_tokens) { char **tokens; register const char *p, *q; register ssize_t i; SVGInfo *svg_info; svg_info=(SVGInfo *) context; *number_tokens=0; if (text == (const char *) NULL) return((char **) NUL...
0
71,712
Analyze the following 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 __perf_event_task_sched_out(struct task_struct *task, struct task_struct *next) { int ctxn; if (__this_cpu_read(perf_sched_cb_usages)) perf_pmu_sched_task(task, next, false); if (atomic_read(&nr_switch_events)) perf_event_switch(task, next, false); for_each_task_context_nr(ctxn) perf_event_...
0
56,027
Analyze the following 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 GLES2DecoderImpl::ValidateUniformBlockBackings(const char* func_name) { DCHECK(feature_info_->IsWebGL2OrES3Context()); if (!state_.current_program.get()) return true; int32_t max_index = -1; for (auto info : state_.current_program->uniform_block_size_info()) { int32_t index = static_cast<int3...
0
141,696
Analyze the following 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 did_receive_event() { return did_receive_event_; } Commit Message: Add a check for disallowing remote frame navigations to local resources. Previously, RemoteFrame navigations did not perform any renderer-side checks and relied solely on the browser-side logic to block disallowed navigations via mechanis...
0
143,934
Analyze the following 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 ContentSecurityPolicy::ExperimentalFeaturesEnabled() const { return RuntimeEnabledFeatures:: ExperimentalContentSecurityPolicyFeaturesEnabled(); } Commit Message: Inherit the navigation initiator when navigating instead of the parent/opener Spec PR: https://github.com/w3c/webappsec-csp/pull/358 Bu...
0
152,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: android::SoftOMXComponent *createSoftOMXComponent( const char *name, const OMX_CALLBACKTYPE *callbacks, OMX_PTR appData, OMX_COMPONENTTYPE **component) { return new android::SoftMPEG4Encoder(name, callbacks, appData, component); } Commit Message: codecs: handle onReset() for a few encoders Test: Run ...
0
162,478
Analyze the following 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 IndexedDBDatabase::PutOperation( std::unique_ptr<PutOperationParams> params, IndexedDBTransaction* transaction) { IDB_TRACE2("IndexedDBDatabase::PutOperation", "txn.id", transaction->id(), "size", params->value.SizeEstimate()); DCHECK_NE(transaction->mode(), blink::kWebIDBTransacti...
0
155,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: void cred_to_ucred(struct pid *pid, const struct cred *cred, struct ucred *ucred) { ucred->pid = pid_vnr(pid); ucred->uid = ucred->gid = -1; if (cred) { struct user_namespace *current_ns = current_user_ns(); ucred->uid = from_kuid(current_ns, cred->euid); ucred->gid = from_kgid(current_ns, cred->eg...
0
20,116
Analyze the following 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 PageHuge(struct page *page) { if (!PageCompound(page)) return 0; page = compound_head(page); return page[1].compound_dtor == HUGETLB_PAGE_DTOR; } Commit Message: userfaultfd: hugetlbfs: prevent UFFDIO_COPY to fill beyond the end of i_size This oops: kernel BUG at fs/hugetlbfs/inode.c:484! RIP: re...
0
86,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: static struct nfs4_state *nfs4_try_open_cached(struct nfs4_opendata *opendata) { struct nfs4_state *state = opendata->state; struct nfs_inode *nfsi = NFS_I(state->inode); struct nfs_delegation *delegation; int open_mode = opendata->o_arg.open_flags & O_EXCL; fmode_t fmode = opendata->o_arg.fmode; nfs4_state...
0
23,245
Analyze the following 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 tst_QQuickWebView::loadEmptyPageViewHidden() { QSignalSpy loadSpy(webView(), SIGNAL(loadingChanged(QWebLoadRequest*))); webView()->setUrl(QUrl::fromLocalFile(QLatin1String(TESTS_SOURCE_DIR "/html/basic_page.html"))); QVERIFY(waitForLoadSucceeded(webView())); QCOMPARE(loadSpy.size(), 2); } ...
0
101,811
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: uint32_t get_hex(char **p, int DefaultValue) { uint32_t Value = 0; unsigned char UseDefault; UseDefault = 1; skip_blanks(p); while ( ((**p)<= '9' && (**p)>= '0') || ((**p)<= 'f' && (**p)>= 'a') || ((**p)<= 'F' && (**p)>= 'A') ) { if (**p >= 'a') Value = Value * 16 + (**p) - 'a' + 10; else if (**p >=...
0
159,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: const char *FS_ReferencedPakNames( void ) { static char info[BIG_INFO_STRING]; searchpath_t *search; info[0] = 0; for ( search = fs_searchpaths ; search ; search = search->next ) { if ( search->pack ) { if (search->pack->referenced || Q_stricmpn(search->pack->pakGamename, com_basegame->string, strle...
0
95,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 BrowserViewRenderer::SetDipScale(float dip_scale) { dip_scale_ = dip_scale; CHECK_GT(dip_scale_, 0.f); } Commit Message: sync compositor: pass simple gfx types by const ref See bug for reasoning BUG=159273 Review URL: https://codereview.chromium.org/1417893006 Cr-Commit-Position: refs/heads/master@{...
0
119,545
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void jp2_pclr_dumpdata(jp2_box_t *box, FILE *out) { jp2_pclr_t *pclr = &box->data.pclr; unsigned int i; int j; fprintf(out, "numents=%d; numchans=%d\n", (int) pclr->numlutents, (int) pclr->numchans); for (i = 0; i < pclr->numlutents; ++i) { for (j = 0; j < pclr->numchans; ++j) { fprintf(out, "...
0
67,973
Analyze the following 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 PDFiumEngine::Form_Mail(IPDF_JSPLATFORM* param, void* mail_data, int length, FPDF_BOOL ui, FPDF_WIDESTRING to, FPDF_WIDESTRING subject, ...
0
140,301
Analyze the following 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 _ewk_frame_smart_del(Evas_Object* ewkFrame) { EWK_FRAME_SD_GET(ewkFrame, smartData); if (smartData) { if (smartData->frame) { WebCore::FrameLoaderClientEfl* flc = _ewk_frame_loader_efl_get(smartData->frame); flc->setWebFrame(0); smartData->frame-...
1
170,978
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool kvm_vcpu_is_bsp(struct kvm_vcpu *vcpu) { return (vcpu->arch.apic_base & MSR_IA32_APICBASE_BSP) != 0; } Commit Message: KVM: x86: Reload pit counters for all channels when restoring state Currently if userspace restores the pit counters with a count of 0 on channels 1 or 2 and the guest attempts to read th...
0
57,774
Analyze the following 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::OnUpdateWindowScreenRect(gfx::Rect window_screen_rect) { RenderWidget::OnUpdateWindowScreenRect(window_screen_rect); } Commit Message: If a page calls |window.focus()|, kick it out of fullscreen. BUG=776418, 800056 Change-Id: I1880fe600e4814c073f247c43b1c1ac80c8fc017 Reviewed-on: https:/...
0
148,006
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PassRefPtrWillBeRawPtr<Element> Document::createElement(const AtomicString& localName, const AtomicString& typeExtension, ExceptionState& exceptionState) { if (!isValidName(localName)) { exceptionState.throwDOMException(InvalidCharacterError, "The tag name provided ('" + localName + "') is not a valid...
0
124,316
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: DeviceRequest( int requesting_process_id, int requesting_frame_id, int page_request_id, bool user_gesture, MediaStreamRequestType request_type, const StreamControls& controls, MediaDeviceSaltAndOrigin salt_and_origin, DeviceStoppedCallback device_stopped_cb...
1
173,102
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: dist_pl_internal(Point *pt, LINE *line) { return fabs((line->A * pt->x + line->B * pt->y + line->C) / HYPOT(line->A, line->B)); } Commit Message: Predict integer overflow to avoid buffer overruns. Several functions, mostly type input functions, calculated an allocation size such that the calculation wrappe...
0
38,884
Analyze the following 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 V8Debugger* toV8Debugger(v8::Local<v8::Value> data) { void* p = v8::Local<v8::External>::Cast(data)->Value(); return static_cast<V8Debugger*>(p); } Commit Message: [DevTools] Copy objects from debugger context to inspected context properly. BUG=637594 Review-Url: https://codereview.chromium.org/...
0
130,390
Analyze the following 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 WebsiteSettings::PresentSiteData() { CookieInfoList cookie_info_list; const LocalSharedObjectsCounter& allowed_objects = tab_specific_content_settings()->allowed_local_shared_objects(); const LocalSharedObjectsCounter& blocked_objects = tab_specific_content_settings()->blocked_local_shared_...
0
125,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: int userfaultfd_unmap_prep(struct vm_area_struct *vma, unsigned long start, unsigned long end, struct list_head *unmaps) { for ( ; vma && vma->vm_start < end; vma = vma->vm_next) { struct userfaultfd_unmap_ctx *unmap_ctx; struct userfaultfd_ctx *ctx = vma->vm_userfaultfd_ctx.ctx; if (!ctx || !...
0
86,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: SWFShape_addLineStyle(SWFShape shape, unsigned short width, byte r, byte g, byte b, byte a) { growLineArray(shape); shape->lines[shape->nLines] = newSWFLineStyle(width, r, g, b, a); return ++shape->nLines; } Commit Message: SWFShape_setLeftFillStyle: prevent fill overflow CWE ID: CWE-119
0
89,498
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ppp_disconnect_channel(struct channel *pch) { struct ppp *ppp; int err = -EINVAL; write_lock_bh(&pch->upl); ppp = pch->ppp; pch->ppp = NULL; write_unlock_bh(&pch->upl); if (ppp) { /* remove it from the ppp unit's list */ ppp_lock(ppp); list_del(&pch->clist); if (--ppp->n_channels == 0) wake_up_...
0
52,624
Analyze the following 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 DesktopWindowTreeHostX11::SetFullscreen(bool fullscreen) { if (is_fullscreen_ == fullscreen) return; is_fullscreen_ = fullscreen; if (is_fullscreen_) delayed_resize_task_.Cancel(); bool unmaximize_and_remaximize = !fullscreen && IsMaximized() && ui::GuessWi...
0
140,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: JsArgList SyncManager::SyncInternal::GetClientServerTraffic( const JsArgList& args) { ListValue return_args; ListValue* value = traffic_recorder_.ToValue(); if (value != NULL) return_args.Append(value); return JsArgList(&return_args); } Commit Message: [Sync] Cleanup all tab sync enabling logic n...
0
105,126
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: std::string GetManifestAndIssuedRequests() { base::RunLoop run_loop; browser()->tab_strip_model()->GetActiveWebContents()->GetManifest( base::Bind(&ManifestCallbackAndRun, run_loop.QuitClosure())); run_loop.Run(); return ExecuteScriptAndExtractString( "if (issuedRequests.length !...
0
147,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: bool ProfileSyncService::HasSyncSetupCompleted() const { return sync_prefs_.HasSyncSetupCompleted(); } Commit Message: [Sync] Cleanup all tab sync enabling logic now that its on by default. BUG=none TEST= Review URL: https://chromiumcodereview.appspot.com/10443046 git-svn-id: svn://svn.chromium.org/chrome/...
0
104,942
Analyze the following 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 Sp_charAt(js_State *J) { char buf[UTFmax + 1]; const char *s = checkstring(J, 0); int pos = js_tointeger(J, 1); Rune rune = js_runeat(J, s, pos); if (rune > 0) { buf[runetochar(buf, &rune)] = 0; js_pushstring(J, buf); } else { js_pushliteral(J, ""); } } Commit Message: Bug 700937: Limit ...
0
90,654
Analyze the following 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_gpu_get_display_info(VirtIOGPU *g, struct virtio_gpu_ctrl_command *cmd) { struct virtio_gpu_resp_display_info display_info; trace_virtio_gpu_cmd_get_display_info(); memset(&display_info, 0, sizeof(display_info)); display_info.hdr.type = VIRTIO_GPU_RESP...
0
6,244
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gs_heap_free_object(gs_memory_t * mem, void *ptr, client_name_t cname) { gs_malloc_memory_t *mmem = (gs_malloc_memory_t *) mem; gs_malloc_block_t *bp; gs_memory_type_ptr_t pstype; struct_proc_finalize((*finalize)); if_debug3m('a', mem, "[a-]gs_free(%s) 0x%lx(%u)\n", client_name...
0
3,542
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: map_get_camera_xy(void) { return mk_point2(s_camera_x, s_camera_y); } Commit Message: Fix integer overflow in layer_resize in map_engine.c (#268) * Fix integer overflow in layer_resize in map_engine.c There's a buffer overflow bug in the function layer_resize. It allocates a buffer `tilemap` with size `x_s...
0
75,049
Analyze the following 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 CrostiniUpgrader::Cancel() { CrostiniManager::GetForProfile(profile_)->CancelUpgradeContainer( container_id_, base::BindOnce(&CrostiniUpgrader::OnCancel, weak_ptr_factory_.GetWeakPtr())); } Commit Message: Revert "Creates a WebUI-based Crostini Upgrader" This rev...
0
136,588
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void WebRuntimeFeatures::EnableBackgroundVideoTrackOptimization(bool enable) { RuntimeEnabledFeatures::SetBackgroundVideoTrackOptimizationEnabled(enable); } Commit Message: Remove RequireCSSExtensionForFile runtime enabled flag. The feature has long since been stable (since M64) and doesn't seem to be a need ...
0
154,596
Analyze the following 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 char *mif_getline(jas_stream_t *stream, char *buf, int bufsize) { int c; char *bufptr; assert(bufsize > 0); bufptr = buf; while (bufsize > 1) { if ((c = mif_getc(stream)) == EOF) { break; } *bufptr++ = c; --bufsize; if (c == '\n') { break; } } *bufptr = '\0'; if (!(bufptr = strch...
0
72,944
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ikev2_auth_print(netdissect_options *ndo, u_char tpay, const struct isakmp_gen *ext, u_int item_len _U_, const u_char *ep, uint32_t phase _U_, uint32_t doi _U_, uint32_t proto _U_, int depth _U_) { struct ikev2_auth a; const char *v2_auth[]={ "invalid", "rsasig", "shared-secret", "dsssig" }; const ...
0
62,026
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xsltCompilationCtxtCreate(xsltStylesheetPtr style) { xsltCompilerCtxtPtr ret; ret = (xsltCompilerCtxtPtr) xmlMalloc(sizeof(xsltCompilerCtxt)); if (ret == NULL) { xsltTransformError(NULL, style, NULL, "xsltCompilerCreate: allocation of compiler " "context failed.\n"); return(NULL); } ...
0
156,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: void ACodec::IdleToLoadedState::stateEntered() { ALOGV("[%s] Now Idle->Loaded", mCodec->mComponentName.c_str()); } Commit Message: Fix initialization of AAC presentation struct Otherwise the new size checks trip on this. Bug: 27207275 Change-Id: I1f8f01097e3a88ff041b69279a6121be842f1766 CWE ID: CWE-119
0
164,168
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: vmxnet3_io_bar0_read(void *opaque, hwaddr addr, unsigned size) { if (VMW_IS_MULTIREG_ADDR(addr, VMXNET3_REG_IMR, VMXNET3_MAX_INTRS, VMXNET3_REG_ALIGN)) { g_assert_not_reached(); } VMW_CBPRN("BAR0 unknown read [%" PRIx64 "], size %d", addr, size); return 0; } Commi...
0
15,590
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: error::Error GLES2DecoderImpl::DoCommands(unsigned int num_commands, const volatile void* buffer, int num_entries, int* entries_processed) { if (gpu_debug_commands_) { return DoComma...
0
141,279
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: pvscsi_ring_flush_req(PVSCSIRingInfo *mgr) { RS_SET_FIELD(mgr, reqConsIdx, mgr->consumed_ptr); } Commit Message: CWE ID: CWE-399
0
8,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: dtls1_reassemble_fragment(SSL *s, struct hm_header_st* msg_hdr, int *ok) { hm_fragment *frag = NULL; pitem *item = NULL; int i = -1, is_complete; unsigned char seq64be[8]; unsigned long frag_len = msg_hdr->frag_len, max_len; if ((msg_hdr->frag_off+frag_len) > msg_hdr->msg_len) goto err; /* Determine m...
0
15,407
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static MagickBooleanType ReadPSDChannelZip(Image *image,const size_t channels, const ssize_t type,const PSDCompressionType compression, const size_t compact_size,ExceptionInfo *exception) { MagickBooleanType status; register unsigned char *p; size_t count, length, packet_size, ...
0
91,371
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int FLTValidFilterNode(FilterEncodingNode *psFilterNode) { int bReturn = 0; if (!psFilterNode) return 0; if (psFilterNode->eType == FILTER_NODE_TYPE_UNDEFINED) return 0; if (psFilterNode->psLeftNode) { bReturn = FLTValidFilterNode(psFilterNode->psLeftNode); if (bReturn == 0) retu...
0
69,026
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PlatformSensorProviderAndroid* PlatformSensorProviderAndroid::GetInstance() { return base::Singleton< PlatformSensorProviderAndroid, base::LeakySingletonTraits<PlatformSensorProviderAndroid>>::get(); } Commit Message: android: Fix sensors in device service. This patch fixes a bug that prevented mo...
0
148,976
Analyze the following 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 CustomButton::SetState(ButtonState state) { if (state == state_) return; if (animate_on_state_change_ && (!is_throbbing_ || !hover_animation_->is_animating())) { is_throbbing_ = false; if ((state_ == STATE_HOVERED) && (state == STATE_NORMAL)) { hover_animation_->Hide(); } els...
0
132,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: static int add_push_report_sideband_pkt(git_push *push, git_pkt_data *data_pkt, git_buf *data_pkt_buf) { git_pkt *pkt; const char *line, *line_end; size_t line_len; int error; int reading_from_buf = data_pkt_buf->size > 0; if (reading_from_buf) { /* We had an existing partial packet, so add the new * ...
1
170,110
Analyze the following 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 cpu_shares_write_u64(struct cgroup *cgrp, struct cftype *cftype, u64 shareval) { return sched_group_set_shares(cgroup_tg(cgrp), shareval); } Commit Message: Sched: fix skip_clock_update optimization idle_balance() drops/retakes rq->lock, leaving the previous task vulnerable to set_tsk_need_resch...
0
22,382
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: struct page *new_inode_page(struct inode *inode) { struct dnode_of_data dn; /* allocate inode page for new inode */ set_new_dnode(&dn, inode, NULL, NULL, inode->i_ino); /* caller should f2fs_put_page(page, 1); */ return new_node_page(&dn, 0, NULL); } Commit Message: f2fs: fix race condition in between fre...
0
85,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 int rose_getsockopt(struct socket *sock, int level, int optname, char __user *optval, int __user *optlen) { struct sock *sk = sock->sk; struct rose_sock *rose = rose_sk(sk); int val = 0; int len; if (level != SOL_ROSE) return -ENOPROTOOPT; if (get_user(len, optlen)) return -EFAULT; if (len <...
0
22,202
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void Document::PropagateStyleToViewport() { DCHECK(InStyleRecalc()); DCHECK(documentElement()); HTMLElement* body = this->body(); const ComputedStyle* body_style = body ? body->EnsureComputedStyle() : nullptr; const ComputedStyle* document_element_style = documentElement()->EnsureComputedS...
0
154,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: void DocumentLoader::DetachFromFrame() { DCHECK(frame_); fetcher_->StopFetching(); if (frame_ && !SentDidFinishLoad()) LoadFailed(ResourceError::CancelledError(Url())); fetcher_->ClearContext(); if (!frame_) return; application_cache_host_->DetachFromDocumentLoader(); application_cach...
1
171,851
Analyze the following 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 sctp_cmd_process_sack(sctp_cmd_seq_t *cmds, struct sctp_association *asoc, struct sctp_chunk *chunk) { int err = 0; if (sctp_outq_sack(&asoc->outqueue, chunk)) { struct net *net = sock_net(asoc->base.sk); /* There are no more TSNs awaiting SACK. */ err = sctp_do_sm(net, SCTP_EVENT_...
0
57,005
Analyze the following 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 PluginInfoMessageFilter::Context::DecidePluginStatus( const GetPluginInfo_Params& params, const WebPluginInfo& plugin, PluginFinder* plugin_finder, ChromeViewHostMsg_GetPluginInfo_Status* status, std::string* group_identifier, string16* group_name) const { PluginInstaller* installer...
1
170,708
Analyze the following 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 ALWAYS_INLINE uint32_t random_xid(void) { return rand(); } Commit Message: CWE ID: CWE-125
0
8,772
Analyze the following 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 espruino_snprintf_cb(const char *str, void *userdata) { espruino_snprintf_data *d = (espruino_snprintf_data*)userdata; while (*str) { if (d->idx < d->len) d->outPtr[d->idx] = *str; d->idx++; str++; } } Commit Message: Fix stack size detection on Linux (fix #1427) CWE ID: CWE-190
0
82,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: static void do_free_upto(BIO *f, BIO *upto) { if (upto) { BIO *tbio; do { tbio = BIO_pop(f); BIO_free(f); f = tbio; } while (f && f != upto); } else BIO_free_all(f); } Commit Message: CWE ID: CWE-311
0
11,952
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: LogLuvEncodeStrip(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s) { tmsize_t rowlen = TIFFScanlineSize(tif); if (rowlen == 0) return 0; assert(cc%rowlen == 0); while (cc && (*tif->tif_encoderow)(tif, bp, rowlen, s) == 1) { bp += rowlen; cc -= rowlen; } return (cc == 0); } Commit M...
0
70,244
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: asmlinkage void do_reserved_inst(unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7, struct pt_regs __regs) { struct pt_regs *regs = RELOC_HIDE(&__regs, 0); unsigned long error_code; struct task_struct *tsk = current; #ifdef CONFIG_SH_FPU_EMU unsigned short inst = 0; int err; g...
0
25,552
Analyze the following 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 ioapic_mmio_read(struct kvm_io_device *this, gpa_t addr, int len, void *val) { struct kvm_ioapic *ioapic = to_ioapic(this); u32 result; if (!ioapic_in_range(ioapic, addr)) return -EOPNOTSUPP; ioapic_debug("addr %lx\n", (unsigned long)addr); ASSERT(!(addr & 0xf)); /* check alignment */ ...
0
33,247
Analyze the following 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 Range::expand(const String& unit, ExceptionCode& ec) { VisiblePosition start(startPosition()); VisiblePosition end(endPosition()); if (unit == "word") { start = startOfWord(start); end = endOfWord(end); } else if (unit == "sentence") { start = startOfSentence(start); ...
0
100,245
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WORD32 ih264d_get_vui_params(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op) { ih264d_ctl_get_vui_params_ip_t *ps_ip; ih264d_ctl_get_vui_params_op_t *ps_op; dec_struct_t *ps_dec = dec_hdl->pv_codec_handle; dec_seq_params_t *ps_sps; vui_t *ps_vui; WORD32 i; UWORD32 u4_size; ps_ip = (ih264d...
0
163,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: static int l2tp_ip6_getname(struct socket *sock, struct sockaddr *uaddr, int *uaddr_len, int peer) { struct sockaddr_l2tpip6 *lsa = (struct sockaddr_l2tpip6 *)uaddr; struct sock *sk = sock->sk; struct ipv6_pinfo *np = inet6_sk(sk); struct l2tp_ip6_sock *lsk = l2tp_ip6_sk(sk); lsa->l2tp_family = AF_I...
1
166,183
Analyze the following 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 WTF::Vector<PopupItem*>& PopupContainer:: popupData() const { return m_listBox->items(); } Commit Message: [REGRESSION] Refreshed autofill popup renders garbage https://bugs.webkit.org/show_bug.cgi?id=83255 http://code.google.com/p/chromium/issues/detail?id=118374 The code used to update only the Popu...
0
108,584
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: sc_pkcs15emu_add_object(sc_pkcs15_card_t *p15card, int type, const char *label, void *data, const sc_pkcs15_id_t *auth_id, int obj_flags) { sc_pkcs15_object_t *obj; int df_type; obj = calloc(1, sizeof(*obj)); obj->type = type; obj->data = data; if (label) strncpy(obj->label, label, sizeof(obj->l...
0
78,798
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gsf_infile_tar_name_by_index (GsfInfile *infile, int target) { GsfInfileTar *tar = GSF_INFILE_TAR (infile); if (target < 0 || (unsigned)target >= tar->children->len) return NULL; return g_array_index (tar->children, TarChild, target).name; } Commit Message: tar: fix crash on broken tar file. CWE ID: CWE-4...
0
47,709
Analyze the following 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 QuotaManager::DeleteOriginData( const GURL& origin, StorageType type, int quota_client_mask, const StatusCallback& callback) { LazyInitialize(); if (origin.is_empty() || clients_.empty()) { callback.Run(kQuotaStatusOk); return; } OriginDataDeleter* deleter = new OriginDataDele...
0
102,157
Analyze the following 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 is_al_reg(const Operand *op) { if (op->type & OT_MEMORY) { return 0; } if (op->reg == X86R_AL && op->type & OT_BYTE) { return 1; } return 0; } Commit Message: Fix #12372 and #12373 - Crash in x86 assembler (#12380) 0 ,0,[bP-bL-bP-bL-bL-r-bL-bP-bL-bL- mov ,0,[ax+Bx-ax+Bx-ax+ax+Bx-ax+Bx-- le...
0
75,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: static FilePath GetTestFilePath(const FilePath::StringType& filename) { FilePath path; std::string error; PathService::Get(chrome::DIR_TEST_DATA, &path); path = path.AppendASCII("chromeos") .AppendASCII("gdata") .AppendASCII(filename.c_str()); EXPECT_TRUE(file_util::PathExist...
0
104,636
Analyze the following 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::Uint8ArrayMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_uint8ArrayMethod"); test_object_v8_internal::Uint8ArrayMethodMethod(info); } Commit Message: bindings: Support "attribute Fro...
0
135,267
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: spnego_gss_inquire_context( OM_uint32 *minor_status, const gss_ctx_id_t context_handle, gss_name_t *src_name, gss_name_t *targ_name, OM_uint32 *lifetime_rec, gss_OID *mech_type, OM_uint32 *ctx_flags, int *locally_initiated, int *opened) { OM_uint32 ret = GSS_S_COMPLETE; ret = ...
1
166,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 int vcpu_enter_guest(struct kvm_vcpu *vcpu) { int r; bool req_int_win = dm_request_for_irq_injection(vcpu) && kvm_cpu_accept_dm_intr(vcpu); bool req_immediate_exit = false; if (vcpu->requests) { if (kvm_check_request(KVM_REQ_MMU_RELOAD, vcpu)) kvm_mmu_unload(vcpu); if (kvm_check_request(KV...
0
57,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: connection_ap_mark_as_non_pending_circuit(entry_connection_t *entry_conn) { if (PREDICT_UNLIKELY(NULL == pending_entry_connections)) return; UNMARK(); smartlist_remove(pending_entry_connections, entry_conn); } Commit Message: TROVE-2017-004: Fix assertion failure in relay_send_end_cell_from_edge_ This...
0
69,900
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: wv_csp13_opaque_literal_tag(tvbuff_t *tvb, guint32 offset, const char *token, guint8 codepage _U_, guint32 *length) { guint32 data_len = tvb_get_guintvar(tvb, offset, length); char *str = NULL; if ( token && ( (strcmp(token, "Code") == 0) || (strcmp(token, "ContentSize") == 0) || (strcmp(token, "...
0
51,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 jlong GetAwDrawGLFunction(JNIEnv* env, const JavaParamRef<jclass>&) { return reinterpret_cast<intptr_t>(&DrawGLFunction); } Commit Message: sync compositor: pass simple gfx types by const ref See bug for reasoning BUG=159273 Review URL: https://codereview.chromium.org/1417893006 Cr-Commit-Position: ...
0
119,583
Analyze the following 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::OnCreateChildFrame( int new_routing_id, service_manager::mojom::InterfaceProviderRequest new_interface_provider_provider_request, blink::WebTreeScopeType scope, const std::string& frame_name, const std::string& frame_unique_name, bool is_created_by_script,...
0
153,111
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void addBitsToStream(size_t* bitpointer, ucvector* bitstream, unsigned value, size_t nbits) { size_t i; for(i = 0; i < nbits; i++) addBitToStream(bitpointer, bitstream, (unsigned char)((value >> i) & 1)); } Commit Message: Fixed #5645: realloc return handling CWE ID: CWE-772
0
87,440
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void __exit crypto_ctr_module_exit(void) { crypto_unregister_template(&crypto_rfc3686_tmpl); crypto_unregister_template(&crypto_ctr_tmpl); } Commit Message: crypto: include crypto- module prefix in template This adds the module loading prefix "crypto-" to the template lookup as well. For example, atte...
0
45,687
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: InspectorNetworkAgent::~InspectorNetworkAgent() {} Commit Message: DevTools: send proper resource type in Network.RequestWillBeSent This patch plumbs resoure type into the DispatchWillSendRequest instrumenation. This allows us to report accurate type in Network.RequestWillBeSent event, instead of "Other", that ...
0
138,545
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: size_t estimated_size() const { return estimated_size_; } Commit Message: Always write data to new buffer in SimulateAttrib0 This is to work around linux nvidia driver bug. TEST=asan BUG=118970 Review URL: http://codereview.chromium.org/10019003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13...
0
109,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: void BrowserWindowGtk::InfoBarContainerStateChanged(bool is_animating) { InvalidateInfoBarBits(); } 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/...
0
117,952
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PrintingContext::Result PrintingContextCairo::UseDefaultSettings() { DCHECK(!in_print_job_); ResetSettings(); #if defined(OS_CHROMEOS) int dpi = 300; gfx::Size physical_size_device_units; gfx::Rect printable_area_device_units; int32_t width = 0; int32_t height = 0; UErrorCode error = U_ZERO_ERROR...
0
97,572
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: EnumTraits<media::mojom::VideoCaptureError, media::VideoCaptureError>::ToMojom( media::VideoCaptureError input) { switch (input) { case media::VideoCaptureError::kNone: return media::mojom::VideoCaptureError::kNone; case media::VideoCaptureError:: kVideoCaptureControllerInvalidOrUnsupp...
1
172,513
Analyze the following 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_swevent_add(struct perf_event *event, int flags) { struct swevent_htable *swhash = this_cpu_ptr(&swevent_htable); struct hw_perf_event *hwc = &event->hw; struct hlist_head *head; if (is_sampling_event(event)) { hwc->last_period = hwc->sample_period; perf_swevent_set_period(event); } h...
1
167,462
Analyze the following 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_create(struct xdr_stream *xdr, struct nfs4_change_info *cinfo) { __be32 *p; uint32_t bmlen; int status; status = decode_op_hdr(xdr, OP_CREATE); if (status) return status; if ((status = decode_change_info(xdr, cinfo))) return status; p = xdr_inline_decode(xdr, 4); if (unlikely(!p)) ...
0
23,295
Analyze the following 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 fib6_walker_unlink(struct fib6_walker_t *w) { write_lock_bh(&fib6_walker_lock); list_del(&w->lh); write_unlock_bh(&fib6_walker_lock); } Commit Message: net: fib: fib6_add: fix potential NULL pointer dereference When the kernel is compiled with CONFIG_IPV6_SUBTREES, and we return with an er...
0
28,434
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gfx::Point RenderView::GetScrollOffset() { WebSize scroll_offset = webview()->mainFrame()->scrollOffset(); return gfx::Point(scroll_offset.width, scroll_offset.height); } Commit Message: DevTools: move DevToolsAgent/Client into content. BUG=84078 TEST= Review URL: http://codereview.chromium.org/7461019 gi...
0
98,915
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: server_file(struct httpd *env, struct client *clt) { struct http_descriptor *desc = clt->clt_descreq; struct server_config *srv_conf = clt->clt_srv_conf; char path[PATH_MAX]; const char *stripped, *errstr = NULL; int ret = 500; if (srv_conf->flags & SRVFLAG_FCGI) return (server_fcgi(env, clt)); ...
0
68,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: xfs_attr3_leaf_getvalue( struct xfs_buf *bp, struct xfs_da_args *args) { struct xfs_attr_leafblock *leaf; struct xfs_attr3_icleaf_hdr ichdr; struct xfs_attr_leaf_entry *entry; struct xfs_attr_leaf_name_local *name_loc; struct xfs_attr_leaf_name_remote *name_rmt; int valuelen; leaf = bp->b_addr; xfs_...
0
79,914
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: virtual void TearDown() { EXPECT_TRUE(RenderProcessHost::AllHostsIterator().IsAtEnd()); GetContentClient()->set_browser_for_testing(old_browser_client_); DrainMessageLoops(); } Commit Message: Check for appropriate bindings in process-per-site mode. BUG=174059 TEST=See bug for repro steps. R...
0
116,728
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: opj_pi_iterator_t *pi_create_decode(opj_image_t *image, opj_cp_t *cp, int tileno) { int p, q; int compno, resno, pino; opj_pi_iterator_t *pi = NULL; opj_tcp_t *tcp = NULL; opj_tccp_t *tccp = NULL; tcp = &cp->tcps[tileno]; pi = (opj_pi_iterator_t*) ...
0
92,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: unsigned paravirt_patch_insns(void *insnbuf, unsigned len, const char *start, const char *end) { unsigned insn_len = end - start; if (insn_len > len || start == NULL) insn_len = len; else memcpy(insnbuf, start, insn_len); return insn_len; } Commit Message: x86/paravirt: Fix spectre-v2 mitigati...
0
79,065