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: bool HTMLTextAreaElement::shouldUseInputMethod() { return true; } Commit Message: Add HTMLFormControlElement::supportsAutofocus to fix a FIXME comment. This virtual function should return true if the form control can hanlde 'autofocucs' attribute if it is specified. Note: HTMLInputElement::supportsAutofocu...
0
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: std::string ExtensionTabsZoomTest::RunSetZoomExpectError(int tab_id, double zoom_factor) { scoped_refptr<TabsSetZoomFunction> set_zoom_function( new TabsSetZoomFunction()); set_zoom_function->set_extension(extension_.get()); set_zoom_function->s...
0
12,282
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void crypto_inc(u8 *a, unsigned int size) { __be32 *b = (__be32 *)(a + size); u32 c; for (; size >= 4; size -= 4) { c = be32_to_cpu(*--b) + 1; *b = cpu_to_be32(c); if (c) return; } crypto_inc_byte(a, size); } Commit Message: crypto: include crypto- module prefix in template This adds the module ...
0
20,790
Analyze the following 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 nested_vmx_vmexit(struct kvm_vcpu *vcpu) { struct vcpu_vmx *vmx = to_vmx(vcpu); int cpu; struct vmcs12 *vmcs12 = get_vmcs12(vcpu); /* trying to cancel vmlaunch/vmresume is a bug */ WARN_ON_ONCE(vmx->nested.nested_run_pending); leave_guest_mode(vcpu); prepare_vmcs12(vcpu, vmcs12); cpu = get_...
0
10,835
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void CL_SendPureChecksums( void ) { char cMsg[MAX_INFO_VALUE]; Com_sprintf(cMsg, sizeof(cMsg), "cp %d %s", cl.serverId, FS_ReferencedPakPureChecksums()); CL_AddReliableCommand(cMsg, qfalse); } Commit Message: All: Don't load .pk3s as .dlls, and don't load user config files from .pk3s CWE ID: CWE-269
0
11,071
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: LayoutObject* SVGLayoutSupport::findClosestLayoutSVGText(LayoutObject* layoutObject, const FloatPoint& point) { return searchTreeForFindClosestLayoutSVGText(layoutObject, point).candidateLayoutObject; } Commit Message: Avoid using forced layout to trigger paint invalidation for SVG containers Currently, SVG...
0
26,393
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void anyAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); TestObjectPythonV8Internal::anyAttributeAttributeSetter(jsValue, info); TRACE_EVENT_SET_SAMPLING_STAT...
0
26,411
Analyze the following 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 raw_probe_proto_opt(struct raw_frag_vec *rfv, struct flowi4 *fl4) { int err; if (fl4->flowi4_proto != IPPROTO_ICMP) return 0; /* We only need the first two bytes. */ rfv->hlen = 2; err = memcpy_from_msg(rfv->hdr.c, rfv->msg, rfv->hlen); if (err) return err; fl4->fl4_icmp_type = rfv->hdr....
0
25,792
Analyze the following 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 reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); CustomElementCallbackDispatcher::CallbackDeli...
0
14,237
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Strcat_m_charp(Str x, ...) { va_list ap; char *p; va_start(ap, x); while ((p = va_arg(ap, char *)) != NULL) Strcat_charp_n(x, p, strlen(p)); } Commit Message: Merge pull request #27 from kcwu/fix-strgrow Fix potential heap buffer corruption due to Strgrow CWE ID: CWE-119
0
550
Analyze the following 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 RenderFrameDevToolsAgentHost::OnSignedExchangeCertificateResponseReceived( FrameTreeNode* frame_tree_node, const base::UnguessableToken& request_id, const base::UnguessableToken& loader_id, const GURL& url, const network::ResourceResponseHead& head) { DispatchToAgents(frame_tree_node, &...
0
26,386
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Eina_Bool ewk_frame_visible_content_geometry_get(const Evas_Object* ewkFrame, Eina_Bool includeScrollbars, int* x, int* y, int* width, int* height) { if (x) *x = 0; if (y) *y = 0; if (width) *width = 0; if (height) *height = 0; EWK_FRAME_SD_GET_OR_RETURN(ewkFram...
0
25,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: MojoResult Core::CreateSharedBufferWrapper( base::SharedMemoryHandle shared_memory_handle, size_t num_bytes, bool read_only, MojoHandle* mojo_wrapper_handle) { DCHECK(num_bytes); scoped_refptr<PlatformSharedBuffer> platform_buffer = PlatformSharedBuffer::CreateFromSharedMemoryHandle(num_...
0
9,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 ChromeWebContentsDelegateAndroid::LoadingStateChanged( WebContents* source, bool to_different_document) { bool has_stopped = source == NULL || !source->IsLoading(); WebContentsDelegateAndroid::LoadingStateChanged( source, to_different_document); LoadProgressChanged(source, has_stopped ? 1 : 0...
0
25,167
Analyze the following 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 attrWithGetterExceptionAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) { INC_STATS("DOM.TestObj.attrWithGetterException._set"); TestObj* imp = V8TestObj::toNative(info.Holder()); int v = toInt32(value); ExceptionCode ec = 0; imp->set...
0
1,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: explicit RenderFrameHostDestructionObserver(RenderFrameHost* rfh) : WebContentsObserver(WebContents::FromRenderFrameHost(rfh)), message_loop_runner_(new MessageLoopRunner), deleted_(false), render_frame_host_(rfh) {} Commit Message: Fix issue with pending NavigationEntry being dis...
0
27,700
Analyze the following 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 numa_group_count_active_nodes(struct numa_group *numa_group) { unsigned long faults, max_faults = 0; int nid, active_nodes = 0; for_each_online_node(nid) { faults = group_faults_cpu(numa_group, nid); if (faults > max_faults) max_faults = faults; } for_each_online_node(nid) { faults = g...
0
24,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 PDFiumEngine::DrawSelections(int progressive_index, pp::ImageData* image_data) { DCHECK_GE(progressive_index, 0); DCHECK_LT(static_cast<size_t>(progressive_index), progressive_paints_.size()); DCHECK(image_data); int page_index = progressive_paints_[progressive_inde...
0
14,483
Analyze the following 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 ImeObserver::OnReset(const std::string& component_id) { if (extension_id_.empty() || !HasListener(input_ime::OnReset::kEventName)) return; std::unique_ptr<base::ListValue> args( input_ime::OnReset::Create(component_id)); DispatchEventToExtension(extensions::events::INPUT_IME_ON_RESET, ...
0
13,721
Analyze the following 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 sem_more_checks(struct kern_ipc_perm *ipcp, struct ipc_params *params) { struct sem_array *sma; sma = container_of(ipcp, struct sem_array, sem_perm); if (params->u.nsems > sma->sem_nsems) return -EINVAL; return 0; } Commit Message: ipc,sem: fine grained locking for semtimedop Intro...
0
1,185
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SYSCALL_DEFINE4(timerfd_settime, int, ufd, int, flags, const struct itimerspec __user *, utmr, struct itimerspec __user *, otmr) { struct itimerspec new, old; int ret; if (copy_from_user(&new, utmr, sizeof(new))) return -EFAULT; ret = do_timerfd_settime(ufd, flags, &new, &old); if (ret) return ret; ...
0
24,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: MOCK_IMPL(size_t, buf_datalen, (const buf_t *buf)) { return buf->datalen; } Commit Message: Add a one-word sentinel value of 0x0 at the end of each buf_t chunk This helps protect against bugs where any part of a buf_t's memory is passed to a function that expects a NUL-terminated input. It also closes TROVE-...
0
3,970
Analyze the following 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 void r_bin_java_bootstrap_methods_attr_free(void /*RBinJavaAttrInfo*/ *a) { RBinJavaAttrInfo *attr = a; if (attr && attr->type == R_BIN_JAVA_ATTR_TYPE_BOOTSTRAP_METHODS_ATTR) { free (attr->name); free (attr->metas); r_list_free (attr->info.bootstrap_methods_attr.bootstrap_methods); free (attr); }...
0
24,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: int MemBackendImpl::CreateEntry(const std::string& key, Entry** entry, const CompletionCallback& callback) { std::pair<EntryMap::iterator, bool> create_result = entries_.insert(EntryMap::value_type(key, nullptr)); const bool did_insert = cr...
0
21,634
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void pdf_run_b(fz_context *ctx, pdf_processor *proc) { pdf_run_processor *pr = (pdf_run_processor *)proc; pdf_show_path(ctx, pr, 1, 1, 1, 0); } Commit Message: CWE ID: CWE-416
0
12,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: int BN_ucmp(const BIGNUM *a, const BIGNUM *b) { int i; BN_ULONG t1,t2,*ap,*bp; bn_check_top(a); bn_check_top(b); i=a->top-b->top; if (i != 0) return(i); ap=a->d; bp=b->d; for (i=a->top-1; i>=0; i--) { t1= ap[i]; t2= bp[i]; if (t1 != t2) return((t1 > t2) ? 1 : -1); } return(0); } Commit...
0
1,610
Analyze the following 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::UpdateMaxPageIDForSiteInstance( SiteInstance* site_instance, int32 page_id) { if (GetMaxPageIDForSiteInstance(site_instance) < page_id) max_page_ids_[site_instance->GetId()] = page_id; } Commit Message: Cancel JavaScript dialogs when an interstitial appears. BUG=295695 TEST=See b...
0
8,323
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: get_tv32(struct timeval *o, struct timeval32 __user *i) { return (!access_ok(VERIFY_READ, i, sizeof(*i)) || (__get_user(o->tv_sec, &i->tv_sec) | __get_user(o->tv_usec, &i->tv_usec))); } Commit Message: alpha: fix several security issues Fix several security issues in Alpha-specific syscalls. Untested, bu...
0
20,650
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: DownloadManagerImpl::UniqueUrlDownloadHandlerPtr BeginResourceDownload( std::unique_ptr<DownloadUrlParameters> params, std::unique_ptr<ResourceRequest> request, scoped_refptr<URLLoaderFactoryGetter> url_loader_factory_getter, scoped_refptr<storage::FileSystemContext> file_system_context, uint3...
0
21,237
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static unsigned int n_tty_poll(struct tty_struct *tty, struct file *file, poll_table *wait) { struct n_tty_data *ldata = tty->disc_data; unsigned int mask = 0; poll_wait(file, &tty->read_wait, wait); poll_wait(file, &tty->write_wait, wait); if (input_available_p(tty, 1)) mask |= POLLIN | POLLRDNORM...
0
26,777
Analyze the following 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 makeBitReader( const void *data, size_t size, ogg_buffer *buf, ogg_reference *ref, oggpack_buffer *bits) { buf->data = (uint8_t *)data; buf->size = size; buf->refcount = 1; buf->ptr.owner = NULL; ref->buffer = buf; ref->begin = 0; ref->length = size; ref->next...
0
23,047
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GetValueFromNameValueList(struct NameValueParserData * pdata, const char * Name) { struct NameValue * nv; char * p = NULL; for(nv = pdata->l_head; (nv != NULL) && (p == NULL); nv = nv->l_next) { if(strcmp(nv->name, Name) == 0) p = nv->v...
0
19,865
Analyze the following 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 ConvertSubpixelRendering( gfx::FontRenderParams::SubpixelRendering rendering) { switch (rendering) { case gfx::FontRenderParams::SUBPIXEL_RENDERING_NONE: return 0; case gfx::FontRenderParams::SUBPIXEL_RENDERING_RGB: return 1; case gfx::FontRenderParams::SUBPIXEL_RENDERING_BGR: ...
0
12,395
Analyze the following 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 ip_multipath_l3_keys(const struct sk_buff *skb, struct flow_keys *hash_keys) { const struct iphdr *outer_iph = ip_hdr(skb); const struct iphdr *key_iph = outer_iph; const struct iphdr *inner_iph; const struct icmphdr *icmph; struct iphdr _inner_iph; struct icmphdr _icmph; if (likely(outer...
0
4,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: void SkiaOutputSurfaceImpl::BindFramebuffer() { } Commit Message: SkiaRenderer: Support changing color space SkiaOutputSurfaceImpl did not handle the color space changing after it was created previously. The SkSurfaceCharacterization color space was only set during the first time Reshape() ran when the characti...
0
2,273
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void WallpaperManager::OnPolicyFetched(const std::string& policy, const AccountId& account_id, std::unique_ptr<std::string> data) { if (!data) return; user_image_loader::StartWithData( task_runner_, std::move(data), Image...
0
18,938
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static inline void put_tty_queue(unsigned char c, struct n_tty_data *ldata) { *read_buf_addr(ldata, ldata->read_head++) = c; } Commit Message: n_tty: Fix n_tty_write crash when echoing in raw mode The tty atomic_write_lock does not provide an exclusion guarantee for the tty driver if the termios settings are L...
0
9,932
Analyze the following 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 S_AL_SrcShutdown( void ) { int i; src_t *curSource; if(!alSourcesInitialised) return; for(i = 0; i < srcCount; i++) { curSource = &srcList[i]; if(curSource->isLocked) Com_DPrintf( S_COLOR_YELLOW "WARNING: Source %d is locked\n", i); if(curSource->entity > 0) entityList[curSource->ent...
0
25,256
Analyze the following 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 EnterpriseEnrollmentScreen::OnClientLoginFailure( const GoogleServiceAuthError& error) { HandleAuthError(error); } Commit Message: Reset the device policy machinery upon retrying enrollment. BUG=chromium-os:18208 TEST=See bug description Review URL: http://codereview.chromium.org/7676005 git-svn-i...
0
28,205
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int acm_start_wb(struct acm *acm, struct acm_wb *wb) { int rc; acm->transmitting++; wb->urb->transfer_buffer = wb->buf; wb->urb->transfer_dma = wb->dmah; wb->urb->transfer_buffer_length = wb->len; wb->urb->dev = acm->dev; rc = usb_submit_urb(wb->urb, GFP_ATOMIC); if (rc < 0) { dev_err(&acm->da...
0
22,218
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int ip_vs_genl_parse_service(struct ip_vs_service_user_kern *usvc, struct nlattr *nla, int full_entry) { struct nlattr *attrs[IPVS_SVC_ATTR_MAX + 1]; struct nlattr *nla_af, *nla_port, *nla_fwmark, *nla_protocol, *nla_addr; /* Parse mandatory identifying service fields first */ if (nla == NULL ...
0
18,117
Analyze the following 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 AudioOutputDevice::AudioThreadCallback::Process(int pending_data) { if (pending_data == kPauseMark) { memset(shared_memory_.memory(), 0, memory_length_); SetActualDataSizeInBytes(&shared_memory_, memory_length_, 0); return; } int audio_delay_milliseconds = pending_data / bytes_per_ms_; ...
0
9,395
Analyze the following 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 jp2_getuint64(jas_stream_t *in, uint_fast64_t *val) { uint_fast64_t tmpval; int i; int c; tmpval = 0; for (i = 0; i < 8; ++i) { tmpval <<= 8; if ((c = jas_stream_getc(in)) == EOF) { return -1; } tmpval |= (c & 0xff); } *val = tmpval; return 0; } Commit Message: Fixed bugs due to u...
0
22,898
Analyze the following 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 __init biovec_init_slabs(void) { int i; for (i = 0; i < BVEC_POOL_NR; i++) { int size; struct biovec_slab *bvs = bvec_slabs + i; if (bvs->nr_vecs <= BIO_INLINE_VECS) { bvs->slab = NULL; continue; } size = bvs->nr_vecs * sizeof(struct bio_vec); bvs->slab = kmem_cache_create(bvs->...
0
20,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: ModuleExport void UnregisterRLEImage(void) { (void) UnregisterMagickInfo("RLE"); } Commit Message: Check for EOF conditions for RLE image format CWE ID: CWE-20
0
23,621
Analyze the following 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 _php_curl_reset_handlers(php_curl *ch) { if (!Z_ISUNDEF(ch->handlers->write->stream)) { zval_ptr_dtor(&ch->handlers->write->stream); ZVAL_UNDEF(&ch->handlers->write->stream); } ch->handlers->write->fp = NULL; ch->handlers->write->method = PHP_CURL_STDOUT; if (!Z_ISUNDEF(ch->handlers->write_h...
0
2,076
Analyze the following 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::NativeViewAccessible RenderWidgetHostViewGtk::GetNativeViewAccessible() { NOTIMPLEMENTED(); return NULL; } Commit Message: Implement TextureImageTransportSurface using texture mailbox This has a couple of advantages: - allow tearing down and recreating the UI parent context without losing the renderer ...
0
19,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: void ChildProcessLauncherHelper::AfterLaunchOnLauncherThread( const ChildProcessLauncherHelper::Process& process, const base::LaunchOptions& options) { } Commit Message: android: Stop child process in GetTerminationInfo Android currently abuses TerminationStatus to pass whether process is "oom protected...
0
12,895
Analyze the following 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 SetterCallWithExecutionContextStringAttributeAttributeSetter( 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); ...
0
13,473
Analyze the following 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 exit_pi_state_list(struct task_struct *curr) { struct list_head *next, *head = &curr->pi_state_list; struct futex_pi_state *pi_state; struct futex_hash_bucket *hb; union futex_key key = FUTEX_KEY_INIT; if (!futex_cmpxchg_enabled) return; /* * We are a ZOMBIE and nobody can enqueue itself on * pi...
0
28,139
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int btrfs_commit_transaction(struct btrfs_trans_handle *trans, struct btrfs_root *root) { unsigned long joined = 0; struct btrfs_transaction *cur_trans = trans->transaction; struct btrfs_transaction *prev_trans = NULL; DEFINE_WAIT(wait); int ret; int should_grow = 0; unsigned long now = get_seconds...
0
19,069
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: exsltDateTime (const xmlChar *dateTime) { exsltDateValPtr dt = NULL; xmlChar *ret = NULL; if (dateTime == NULL) { #ifdef WITH_TIME dt = exsltDateCurrent(); if (dt == NULL) #endif return NULL; } else { dt = exsltDateParse(dateTime); if (dt == NULL) return NULL; if ((dt->type != XS_D...
0
18,072
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: TT_Run_Context( TT_ExecContext exec, FT_Bool debug ) { FT_Error error; if ( ( error = TT_Goto_CodeRange( exec, tt_coderange_glyph, 0 ) ) != TT_Err_Ok ) return error; exec->zp0 = exec->pts; exec->zp1 = exec->pts; exec->zp2 = exec->pts; e...
0
19,792
Analyze the following 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::checkForChildrenAdjacentRuleChanges() { bool hasDirectAdjacentRules = childrenAffectedByDirectAdjacentRules(); bool hasIndirectAdjacentRules = childrenAffectedByIndirectAdjacentRules(); if (!hasDirectAdjacentRules && !hasIndirectAdjacentRules) return; unsigned forceCh...
0
21,707
Analyze the following 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 PrintWebViewHelper::PrintPages(WebFrame* frame, const WebNode& node) { const PrintMsg_PrintPages_Params& params = *print_pages_params_; const PrintMsg_Print_Params& print_params = params.params; PrepareFrameAndViewForPrint prep_frame_view(print_params, frame, node); UpdateFrameAndViewFromCssPageLayou...
0
28,350
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: mget(struct magic_set *ms, const unsigned char *s, struct magic *m, size_t nbytes, size_t o, unsigned int cont_level, int mode, int text, int flip, int recursion_level, int *printed_something, int *need_separator, int *returnval) { uint32_t soffset, offset = ms->offset; uint32_t lhs; int rv, oneed_...
0
13,433
Analyze the following 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 mmtimer_setup_int_1(int cpu, u64 expires) { u64 val; HUB_S((u64 *)LOCAL_MMR_ADDR(SH_RTC2_INT_ENABLE), 0UL); HUB_S((u64 *)LOCAL_MMR_ADDR(SH_INT_CMPC), -1L); mmtimer_clr_int_pending(1); val = ((u64)SGI_MMTIMER_VECTOR << SH_RTC2_INT_CONFIG_IDX_SHFT) | ((u64)cpu_physical_id(cpu) << SH_RTC2_I...
0
28,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 bool _vmxnet3_assert_interrupt_line(VMXNET3State *s, uint32_t int_idx) { PCIDevice *d = PCI_DEVICE(s); if (s->msix_used && msix_enabled(d)) { VMW_IRPRN("Sending MSI-X notification for vector %u", int_idx); msix_notify(d, int_idx); return false; } if (s->msi_used && ...
0
12,989
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: swp_entry_t get_swap_page_of_type(int type) { struct swap_info_struct *si; pgoff_t offset; spin_lock(&swap_lock); si = swap_info[type]; if (si && (si->flags & SWP_WRITEOK)) { nr_swap_pages--; /* This is called for allocating swap entry, not cache */ offset = scan_swap_map(si, 1); if (offset) { sp...
0
21,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: static unsigned int vfio_pci_set_vga_decode(void *opaque, bool single_vga) { struct vfio_pci_device *vdev = opaque; struct pci_dev *tmp = NULL, *pdev = vdev->pdev; unsigned char max_busnr; unsigned int decodes; if (single_vga || !vfio_vga_disabled() || pci_is_root_bus(pdev->bus)) return VGA_RSRC_NORMAL_IO...
0
27,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: static int ion_dma_buf_begin_cpu_access(struct dma_buf *dmabuf, size_t start, size_t len, enum dma_data_direction direction) { struct ion_buffer *buffer = dmabuf->priv; void *vaddr; if (!buffer->heap->ops->map_kernel) { pr_err("%s: map kernel is not implemented by this heap.\n", __func__)...
0
14,388
Analyze the following 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 create_rss_raw_qp_tir(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp, struct ib_pd *pd, struct ib_qp_init_attr *init_attr, struct ib_udata *udata) { struct ib_uobject *uobj = pd->uobject; struct ib_ucontext *ucontext = uobj->context; struct mlx5_ib_ucontext *mucontext = to_mucontext(u...
0
23,879
Analyze the following 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 bool skb_needs_check(struct sk_buff *skb, bool tx_path) { if (tx_path) return skb->ip_summed != CHECKSUM_PARTIAL; else return skb->ip_summed == CHECKSUM_NONE; } Commit Message: tunnels: Don't apply GRO to multiple layers of encapsulation. When drivers express support for TSO of encapsulated ...
0
10,410
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: choose_volume(struct archive_read *a, struct iso9660 *iso9660) { struct file_info *file; int64_t skipsize; struct vd *vd; const void *block; char seenJoliet; vd = &(iso9660->primary); if (!iso9660->opt_support_joliet) iso9660->seenJoliet = 0; if (iso9660->seenJoliet && vd->location > iso9660->joliet....
0
16,143
Analyze the following 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 btrfs_compare_trees(struct btrfs_root *left_root, struct btrfs_root *right_root, btrfs_changed_cb_t changed_cb, void *ctx) { int ret; int cmp; struct btrfs_path *left_path = NULL; struct btrfs_path *right_path = NULL; struct btrfs_key left_key; struct btrfs_key right_key; char *tmp_buf = NULL; i...
0
29,693
Analyze the following 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 ExtensionWindowLastFocusedTest::GetTabId( const base::DictionaryValue* value) const { const base::ListValue* tabs = NULL; if (!value->GetList(keys::kTabsKey, &tabs)) return -2; const base::Value* tab = NULL; if (!tabs->Get(0, &tab)) return -2; const base::DictionaryValue* tab_dict = NULL...
0
5,810
Analyze the following 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 RenderFrameHostManager::OnDidAddContentSecurityPolicies( const std::vector<ContentSecurityPolicyHeader>& headers) { for (const auto& pair : proxy_hosts_) { pair.second->Send(new FrameMsg_AddContentSecurityPolicies( pair.second->GetRoutingID(), headers)); } } Commit Message: Fix issue wit...
0
15,421
Analyze the following 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::EnterFullscreen(const GURL& url, ExclusiveAccessBubbleType bubble_type) { if (IsFullscreen()) return; // Nothing to do. ProcessFullscreen(true, url, bubble_type); } Commit Message: Mac: turn popups into new tabs while in fullscreen. It's platform con...
0
27,421
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ftp_retrieve_dirs (struct url *u, struct fileinfo *f, ccon *con) { char *container = NULL; int container_size = 0; for (; f; f = f->next) { int size; char *odir, *newdir; if (opt.quota && total_downloaded_bytes > opt.quota) break; if (f->type != FT_DIRECTORY) co...
0
4,296
Analyze the following 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 ShowCreatedWindow(int route_id, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, bool user_gesture) {} Commit Message: Add unit test for AllowBindings check. BUG=117418 TEST=none R...
0
21,070
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void ExtensionWebContentsObserver::OnRequest( content::RenderFrameHost* render_frame_host, const ExtensionHostMsg_Request_Params& params) { dispatcher_.Dispatch(params, render_frame_host); } Commit Message: This patch implements a mechanism for more granular link URL permissions (filtering on scheme/ho...
0
18,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: const std::vector<std::string> CSPHandler::Keys() const { const std::string& key = is_platform_app_ ? keys::kPlatformAppContentSecurityPolicy : keys::kContentSecurityPolicy; return SingleKey(key); } Commit Message: Disallow CSP source * matching of data:, blob:, and filesystem: URLs The CSP spec speci...
0
7,633
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: FLAC__bool read_metadata_seektable_(FLAC__StreamDecoder *decoder, FLAC__bool is_last, unsigned length) { FLAC__uint32 i, x; FLAC__uint64 xx; FLAC__ASSERT(FLAC__bitreader_is_consumed_byte_aligned(decoder->private_->input)); decoder->private_->seek_table.type = FLAC__METADATA_TYPE_SEEKTABLE; decoder->private...
0
621
Analyze the following 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 close_file_picker(FileSelectorData* fs_data) { evas_object_event_callback_del(fs_data->parent, EVAS_CALLBACK_DEL, on_filepicker_parent_deletion); evas_object_del(fs_data->window); ewk_file_chooser_request_unref(fs_data->request); free(fs_data); } Commit Message: [EFL][WK2] Add --windo...
0
11,348
Analyze the following 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 bt_sock_unregister(int proto) { if (proto < 0 || proto >= BT_MAX_PROTO) return; write_lock(&bt_proto_lock); bt_proto[proto] = NULL; write_unlock(&bt_proto_lock); } Commit Message: net: rework recvmsg handler msg_name and msg_namelen logic This patch now always passes msg->msg_namelen as 0. recvmsg h...
0
24,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 inline int nfs4_server_supports_labels(struct nfs_server *server) { return server->caps & NFS_CAP_SECURITY_LABEL; } Commit Message: NFS: Fix a NULL pointer dereference of migration recovery ops for v4.2 client ---Steps to Reproduce-- <nfs-server> # cat /etc/exports /nfs/referal *(rw,insecure,no_subtree...
0
6,560
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SYSCALL_DEFINE2(clock_adjtime, const clockid_t, which_clock, struct timex __user *, utx) { const struct k_clock *kc = clockid_to_kclock(which_clock); struct timex ktx; int err; if (!kc) return -EINVAL; if (!kc->clock_adj) return -EOPNOTSUPP; if (copy_from_user(&ktx, utx, sizeof(ktx))) return -EFAU...
0
7,945
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xsltParseFindTopLevelElem(xsltCompilerCtxtPtr cctxt, xmlNodePtr cur, const xmlChar *name, const xmlChar *namespaceURI, int breakOnOtherElem, xmlNodePtr *resultNode) { if (name == NULL) return(-1); *resultNode = NULL; while (cur != NULL) { if (cur->type =...
0
21,947
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: recursive_call_check(Node* node) { int r; switch (NODE_TYPE(node)) { case NODE_LIST: case NODE_ALT: r = 0; do { r |= recursive_call_check(NODE_CAR(node)); } while (IS_NOT_NULL(node = NODE_CDR(node))); break; case NODE_ANCHOR: if (! ANCHOR_HAS_BODY(ANCHOR_(node))) { r = ...
0
25,135
Analyze the following 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 bool enable_si_irq(struct smi_info *smi_info) { if ((smi_info->io.irq) && (smi_info->interrupt_disabled)) { smi_info->interrupt_disabled = false; start_check_enables(smi_info); return true; } return false; } Commit Message: ipmi_si: fix use-after-free of resource->name When we excute the ...
0
3,510
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: pimv2_addr_print(netdissect_options *ndo, const u_char *bp, enum pimv2_addrtype at, int silent) { int af; int len, hdrlen; ND_TCHECK(bp[0]); if (pimv2_addr_len == 0) { ND_TCHECK(bp[1]); switch (bp[0]) { case 1: af = AF_INET; len = sizeof(struct in_addr); break; cas...
1
23,363
Analyze the following 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 ff_amf_read_number(GetByteContext *bc, double *val) { uint64_t read; if (bytestream2_get_byte(bc) != AMF_DATA_TYPE_NUMBER) return AVERROR_INVALIDDATA; read = bytestream2_get_be64(bc); *val = av_int2double(read); return 0; } Commit Message: avformat/rtmppkt: Convert ff_amf_get_fiel...
0
13,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 int GetCharacter(j_decompress_ptr jpeg_info) { if (jpeg_info->src->bytes_in_buffer == 0) { (void) (*jpeg_info->src->fill_input_buffer)(jpeg_info); if (jpeg_info->err->msg_code == JWRN_JPEG_EOF) return EOF; } jpeg_info->src->bytes_in_buffer--; return((int) GETJOCTET(*jpeg_i...
0
19,078
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: set_var(WebKitWebView *page, GArray *argv, GString *result) { (void) page; (void) result; if(!argv_idx(argv, 0)) return; gchar **split = g_strsplit(argv_idx(argv, 0), "=", 2); if (split[0] != NULL) { gchar *value = parseenv(split[1] ? g_strchug(split[1]) : " "); set_var_v...
0
19,953
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: check(FILE *fp, int argc, const char **argv, png_uint_32p flags/*out*/, display *d, int set_callback) { int i, npasses, ipass; png_uint_32 height; d->keep = PNG_HANDLE_CHUNK_AS_DEFAULT; d->before_IDAT = 0; d->after_IDAT = 0; /* Some of these errors are permanently fatal and cause an exit here, ...
1
7,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: InitEvents(void) { int i; QdEventPtr qe, tmp; inputInfo.numDevices = 0; inputInfo.devices = (DeviceIntPtr) NULL; inputInfo.off_devices = (DeviceIntPtr) NULL; inputInfo.keyboard = (DeviceIntPtr) NULL; inputInfo.pointer = (DeviceIntPtr) NULL; for (i = 0; i < MAXDEVICES; i++) { ...
0
17,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: status_t CameraDeviceClient::dump(int fd, const Vector<String16>& args) { String8 result; result.appendFormat("CameraDeviceClient[%d] (%p) PID: %d, dump:\n", mCameraId, getRemoteCallback()->asBinder().get(), mClientPid); result.append(" State: "); mFramePr...
1
11,271
Analyze the following 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 mcf_fec_do_tx(mcf_fec_state *s) { uint32_t addr; uint32_t addr; mcf_fec_bd bd; int frame_size; int len; uint8_t frame[FEC_MAX_FRAME_SIZE]; uint8_t *ptr; ptr = frame; ptr = frame; frame_size = 0; addr = s->tx_descriptor; while (1) { mcf...
1
2,674
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool WebGLRenderingContextBase::ValidateString(const char* function_name, const String& string) { for (size_t i = 0; i < string.length(); ++i) { if (!ValidateCharacter(string[i])) { SynthesizeGLError(GL_INVALID_VALUE, function_name, "string not ASCII"); ...
0
19,375
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void RenderWidgetHostImpl::WindowSnapshotReachedScreen(int snapshot_id) { DCHECK(base::MessageLoopForUI::IsCurrent()); gfx::Rect view_bounds = GetView()->GetViewBounds(); gfx::Rect snapshot_bounds(view_bounds.size()); std::vector<unsigned char> png; if (ui::GrabViewSnapshot( GetView()->GetNative...
0
18,867
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PanoramiXRenderAddTraps (ClientPtr client) { PanoramiXRes *picture; int result = Success, j; REQUEST(xRenderAddTrapsReq); char *extra; int extra_len; INT16 x_off, y_off; REQUEST_AT_LEAST_SIZE (xRenderAddTrapsReq); VERIFY_XIN_PICTURE (picture, stuff->pictur...
0
19,577
Analyze the following 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 ExtensionDevToolsClientHost::SendMessageToBackend( DebuggerSendCommandFunction* function, const std::string& method, SendCommand::Params::CommandParams* command_params) { base::DictionaryValue protocol_request; int request_id = ++last_request_id_; pending_requests_[request_id] = function; ...
0
29,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: MagickExport MagickBooleanType SetImageClipMask(Image *image, const Image *clip_mask) { assert(image != (Image *) NULL); if (image->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"..."); assert(image->signature == MagickSignature); if (clip_mask != (const Image *) NULL) ...
0
16,606
Analyze the following 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 GpuProcessHostUIShim::OnUpdateVSyncParameters(int surface_id, base::TimeTicks timebase, base::TimeDelta interval) { int render_process_id = 0; int render_widget_id = 0; if (!GpuSurfaceTracker::Get()->GetRenderWid...
0
6,746
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ChromeExtensionsAPIClient::GetNonNativeFileSystemDelegate() { if (!non_native_file_system_delegate_) { non_native_file_system_delegate_ = base::MakeUnique<NonNativeFileSystemDelegateChromeOS>(); } return non_native_file_system_delegate_.get(); } Commit Message: Hide DevTools frontend from webRe...
0
4,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: void Document::loadEventDelayTimerFired(Timer<Document>*) { if (frame()) frame()->loader()->checkCompleted(); } Commit Message: Refactoring: Move m_mayDisplaySeamlesslyWithParent down to Document The member is used only in Document, thus no reason to stay in SecurityContext. TEST=none BUG=none R=ha...
0
6,637
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: AriaCurrentState AXNodeObject::ariaCurrentState() const { const AtomicString& attributeValue = getAOMPropertyOrARIAAttribute(AOMStringProperty::kCurrent); if (attributeValue.isNull()) return AriaCurrentStateUndefined; if (attributeValue.isEmpty() || equalIgnoringCase(attributeValue, "false")) ...
1
10,633
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: router_dir_info_changed(void) { need_to_update_have_min_dir_info = 1; rend_hsdir_routers_changed(); } Commit Message: Consider the exit family when applying guard restrictions. When the new path selection logic went into place, I accidentally dropped the code that considered the _family_ of the exit node wh...
0
26,342
Analyze the following 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 n_tty_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg) { struct n_tty_data *ldata = tty->disc_data; int retval; switch (cmd) { case TIOCOUTQ: return put_user(tty_chars_in_buffer(tty), (int __user *) arg); case TIOCINQ: down_write(&tty->termios_rws...
0
16,940
Analyze the following 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 ExtensionInstallDialogView::Cancel() { if (handled_result_) return true; handled_result_ = true; UpdateInstallResultHistogram(false); if (sampling_event_) sampling_event_->CreateUserDecisionEvent(ExperienceSamplingEvent::kDeny); base::ResetAndReturn(&done_callback_) .Run(ExtensionIns...
0
1,657