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 GDataFileSystem::OnGetFileCompleteForUpdateFile( const FileOperationCallback& callback, GDataFileError error, const std::string& resource_id, const std::string& md5, const FilePath& cache_file_path) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (error != GDATA_FILE_OK) ...
0
116,998
Analyze the following 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::enableEncryptedMedia(bool enable) { RuntimeEnabledFeatures::setEncryptedMediaEnabled(enable); RuntimeEnabledFeatures::setEncryptedMediaAnyVersionEnabled( RuntimeEnabledFeatures::encryptedMediaEnabled() || RuntimeEnabledFeatures::prefixedEncryptedMediaEnabled()); } ...
0
116,075
Analyze the following 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 rose_del_route_by_neigh(struct rose_neigh *rose_neigh) { struct rose_route *rose_route, *s; rose_neigh->restarted = 0; rose_stop_t0timer(rose_neigh); rose_start_ftimer(rose_neigh); skb_queue_purge(&rose_neigh->queue); spin_lock_bh(&rose_route_list_lock); rose_route = rose_route_list; whi...
0
22,236
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: handle_deauth(netdissect_options *ndo, const uint8_t *src, const u_char *p, u_int length) { struct mgmt_body_t pbody; const char *reason = NULL; memset(&pbody, 0, sizeof(pbody)); if (!ND_TTEST2(*p, IEEE802_11_REASON_LEN)) return 0; if (length < IEEE802_11_REASON_LEN) return 0; pbody.rea...
0
62,415
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Framebuffer* GetBoundDrawFramebuffer() const { return framebuffer_state_.bound_draw_framebuffer.get(); } Commit Message: Add GL_PROGRAM_COMPLETION_QUERY_CHROMIUM This makes the query of GL_COMPLETION_STATUS_KHR to programs much cheaper by minimizing the round-trip to the GPU thread. Bug: 881152, 957001...
0
141,446
Analyze the following 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 ati_remote2_urb_init(struct ati_remote2 *ar2) { struct usb_device *udev = ar2->udev; int i, pipe, maxp; for (i = 0; i < 2; i++) { ar2->buf[i] = usb_alloc_coherent(udev, 4, GFP_KERNEL, &ar2->buf_dma[i]); if (!ar2->buf[i]) return -ENOMEM; ar2->urb[i] = usb_alloc_urb(0, GFP_KERNEL); if (!a...
0
55,234
Analyze the following 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 query_formats(AVFilterContext *ctx) { static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_GRAY8, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV440P, A...
0
29,755
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void unix_notinflight(struct file *fp) { struct sock *s = unix_get_socket(fp); spin_lock(&unix_gc_lock); if (s) { struct unix_sock *u = unix_sk(s); BUG_ON(list_empty(&u->link)); if (atomic_long_dec_and_test(&u->inflight)) list_del_init(&u->link); unix_tot_inflight--; } fp->f_cred->user->...
1
167,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: zfilenameforall(i_ctx_t *i_ctx_p) { os_ptr op = osp; file_enum *pfen; gx_io_device *iodev = NULL; gs_parsed_file_name_t pname; int code = 0; check_write_type(*op, t_string); check_proc(op[-1]); check_read_type(op[-2], t_string); /* Push a mark, the iodev, devicenamelen, the sc...
0
3,360
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: RenderViewHost* WebContentsImpl::GetRenderViewHost() const { return render_manager_.current_host(); } Commit Message: Cancel JavaScript dialogs when an interstitial appears. BUG=295695 TEST=See bug for repro steps. Review URL: https://chromiumcodereview.appspot.com/24360011 git-svn-id: svn://svn.chromium.or...
0
110,655
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: g_NPN_ReleaseObject_Now(NPObject *npobj) { D(bugiI("NPN_ReleaseObject npobj=%p\n", npobj)); uint32_t refcount = invoke_NPN_ReleaseObject(npobj); D(bugiD("NPN_ReleaseObject done (refcount: %d)\n", refcount)); if ((npobj->referenceCount = refcount) == 0) npobject_destroy(npobj); } Commit Message: Support...
0
27,066
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xid_map_enter(netdissect_options *ndo, const struct sunrpc_msg *rp, const u_char *bp) { const struct ip *ip = NULL; const struct ip6_hdr *ip6 = NULL; struct xid_map_entry *xmep; if (!ND_TTEST(rp->rm_call.cb_vers)) return (0); switch (IP_V((const struct ip *)bp)) { case 4: ip = (const stru...
0
62,480
Analyze the following 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_setsockopt_default_send_param(struct sock *sk, char __user *optval, unsigned int optlen) { struct sctp_sndrcvinfo info; struct sctp_association *asoc; struct sctp_sock *sp = sctp_sk(sk); if (optlen != sizeof(struct sctp_sndrcvinfo)) return -EINVAL; if (copy_from_user(...
0
33,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: RenderThreadImpl::RenderThreadImpl( const InProcessChildThreadParams& params, std::unique_ptr<blink::scheduler::RendererScheduler> scheduler, const scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue) : ChildThreadImpl(Options::Builder() .InBrowserProcess(par...
0
150,582
Analyze the following 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 device *rdev_get_dev(struct regulator_dev *rdev) { return &rdev->dev; } Commit Message: regulator: core: Fix regualtor_ena_gpio_free not to access pin after freeing After freeing pin from regulator_ena_gpio_free, loop can access the pin. So this patch fixes not to access pin after freeing. Signed-off-b...
0
74,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 nfs4_check_drain_bc_complete(struct nfs4_session *ses) { if (!test_bit(NFS4_SESSION_DRAINING, &ses->session_state) || ses->bc_slot_table.highest_used_slotid != NFS4_NO_SLOT) return; dprintk("%s COMPLETE: Session Back Channel Drained\n", __func__); complete(&ses->bc_slot_table.complete); } Commit M...
0
19,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: static void __netlink_deliver_tap(struct sk_buff *skb) { int ret; struct netlink_tap *tmp; if (!netlink_filter_tap(skb)) return; list_for_each_entry_rcu(tmp, &netlink_tap_all, list) { ret = __netlink_deliver_tap_skb(skb, tmp->dev); if (unlikely(ret)) break; } } Commit Message: net: rework recvmsg...
0
40,495
Analyze the following 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 DidGetAvailableSpace(QuotaStatusCode status, int64 space) { DCHECK_GE(space, 0); if (quota_status_ == kQuotaStatusUnknown || quota_status_ == kQuotaStatusOk) quota_status_ = status; available_space_ = space; CheckCompleted(); } Commit Message: Wipe out QuotaThreadTask. This is a o...
0
102,164
Analyze the following 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 ChromeDownloadDelegate::OnDownloadStarted(const std::string& filename, const std::string& mime_type) { JNIEnv* env = base::android::AttachCurrentThread(); ScopedJavaLocalRef<jstring> jfilename = ConvertUTF8ToJavaString( env, filename); ScopedJavaL...
1
171,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 void pdf_run_ri(fz_context *ctx, pdf_processor *proc, const char *intent) { pdf_run_processor *pr = (pdf_run_processor *)proc; pdf_gstate *gstate = pdf_flush_text(ctx, pr); gstate->fill.color_params.ri = fz_lookup_rendering_intent(intent); gstate->stroke.color_params.ri = gstate->fill.color_params.ri; ...
0
541
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void ChildProcessSecurityPolicyImpl::GrantRequestScheme( int child_id, const std::string& scheme) { base::AutoLock lock(lock_); auto state = security_state_.find(child_id); if (state == security_state_.end()) return; state->second->GrantRequestScheme(scheme); } Commit Message: Lock down blo...
0
143,735
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int GetIdleSocketCountInTransportSocketPool(net::HttpNetworkSession* session) { return session->GetTransportSocketPool( net::HttpNetworkSession::NORMAL_SOCKET_POOL)->IdleSocketCount(); } Commit Message: Sanitize headers in Proxy Authentication Required responses BUG=431504 Review URL: https://coderevie...
0
129,275
Analyze the following 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 nfs_invalidate_mapping_nolock(struct inode *inode, struct address_space *mapping) { struct nfs_inode *nfsi = NFS_I(inode); if (mapping->nrpages != 0) { int ret = invalidate_inode_pages2(mapping); if (ret < 0) return ret; } spin_lock(&inode->i_lock); nfsi->cache_validity &= ~NFS_INO_INVALI...
0
22,803
Analyze the following 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 free_slots(struct b43_dmaring *ring) { return (ring->nr_slots - ring->used_slots); } Commit Message: b43: allocate receive buffers big enough for max frame len + offset Otherwise, skb_put inside of dma_rx can fail... https://bugzilla.kernel.org/show_bug.cgi?id=32042 Signed-off-by: John W. ...
0
24,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: void DownloadItemImpl::MarkAsComplete() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(all_data_saved_); end_time_ = base::Time::Now(); TransitionTo(COMPLETE); } Commit Message: Refactors to simplify rename pathway in DownloadFileManager. This is https://chromiumcodereview.appspot.com/...
0
106,131
Analyze the following 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 Pack<WebGLImageConversion::kDataFormatR8, WebGLImageConversion::kAlphaDoPremultiply, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixels_per_row) { for (unsigned i = 0; i < pixels_per_row; ++i) { float scale_...
0
146,663
Analyze the following 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 pit_latch_count(struct kvm *kvm, int channel) { struct kvm_kpit_channel_state *c = &kvm->arch.vpit->pit_state.channels[channel]; WARN_ON(!mutex_is_locked(&kvm->arch.vpit->pit_state.lock)); if (!c->count_latched) { c->latched_count = pit_get_count(kvm, channel); c->count_latched = c->rw_mode...
0
37,724
Analyze the following 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::UnforgeableLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_unforgeableLongAttribute_Getter"); test_object_v8_internal::UnforgeableLongAttributeAttributeGetter(info); } ...
0
135,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: void PrintPreviewUI::OnDidGetPreviewPageCount( const PrintHostMsg_DidGetPreviewPageCount_Params& params) { DCHECK_GT(params.page_count, 0); base::FundamentalValue count(params.page_count); base::FundamentalValue request_id(params.preview_request_id); web_ui()->CallJavascriptFunction("onDidGetPreviewPa...
0
105,840
Analyze the following 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 smp_send_pair_fail(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { p_cb->status = p_data->status; p_cb->failure = p_data->status; SMP_TRACE_DEBUG("%s: status=%d failure=%d ", __func__, p_cb->status, p_cb->failure); if (p_cb->status <= SMP_MAX_FAIL_RSN_PER_SPEC && p_cb->status != SMP_...
0
162,784
Analyze the following 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 ChromeContentBrowserClient::IsShuttingDown() { return browser_shutdown::GetShutdownType() != browser_shutdown::NOT_VALID; } Commit Message: Move IsDataSaverEnabledByUser to be a static method and use it This method now officially becomes the source of truth that everything in the code base eventually cal...
0
142,714
Analyze the following 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 size_t RegisterDDSImage(void) { MagickInfo *entry; entry = SetMagickInfo("DDS"); entry->decoder = (DecodeImageHandler *) ReadDDSImage; entry->encoder = (EncodeImageHandler *) WriteDDSImage; entry->magick = (IsImageFormatHandler *) IsDDS; entry->seekable_stream=MagickTrue; entry->de...
0
65,108
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int datablob_parse(char *datablob, const char **format, char **master_desc, char **decrypted_datalen, char **hex_encoded_iv) { substring_t args[MAX_OPT_ARGS]; int ret = -EINVAL; int key_cmd; int key_format; char *p, *keyword; keyword = strsep(&datablob, " \t"); if (!keyword) { pr_info("...
0
57,378
Analyze the following 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 construct_key(struct key *key, const void *callout_info, size_t callout_len, void *aux, struct key *dest_keyring) { struct key_construction *cons; request_key_actor_t actor; struct key *authkey; int ret; kenter("%d,%p,%zu,%p", key->serial, callout_info, callout_len, aux); cons = kmalloc...
0
41,984
Analyze the following 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 IsFormTextArea(PDFiumPage::Area area, int form_type) { if (form_type == FPDF_FORMFIELD_UNKNOWN) return false; DCHECK_EQ(area, PDFiumPage::FormTypeToArea(form_type)); return area == PDFiumPage::FORM_TEXT_AREA; } Commit Message: [pdf] Use a temporary list when unloading pages When traversing the |...
0
146,154
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void webkitWebViewBaseInitializeFullScreenClient(WebKitWebViewBase* webkitWebViewBase, const WKFullScreenClientGtk* wkClient) { webkitWebViewBase->priv->fullScreenClient.initialize(wkClient); } Commit Message: [GTK] Inspector should set a default attached height before being attached https://bugs.webkit.org/...
0
108,887
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GLenum WebGL2RenderingContextBase::clientWaitSync(WebGLSync* sync, GLbitfield flags, GLuint64 timeout) { if (isContextLost() || !ValidateWebGLObject("clientWaitSync", sync)) return GL_WAIT_FAILED; if (time...
0
153,576
Analyze the following 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 predictor_decode_mono_3930(APEContext *ctx, int count) { APEPredictor *p = &ctx->predictor; int32_t *decoded0 = ctx->decoded[0]; ape_apply_filters(ctx, ctx->decoded[0], NULL, count); while (count--) { *decoded0 = predictor_update_3930(p, *decoded0, 0, YDELAYA); decode...
0
63,422
Analyze the following 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 vmci_transport_set_max_buffer_size(struct vsock_sock *vsk, u64 val) { if (val < vmci_trans(vsk)->queue_pair_size) vmci_trans(vsk)->queue_pair_size = val; vmci_trans(vsk)->queue_pair_max_size = val; } Commit Message: VSOCK: vmci - fix possible info leak in vmci_transport_dgram_dequeue(...
0
30,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: static int mov_flush_fragment(AVFormatContext *s, int force) { MOVMuxContext *mov = s->priv_data; int i, first_track = -1; int64_t mdat_size = 0; int ret; int has_video = 0, starts_with_key = 0, first_video_track = 1; if (!(mov->flags & FF_MOV_FLAG_FRAGMENT)) return 0; for (i...
0
79,308
Analyze the following 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::setDesignMode(const String& value) { bool new_value = design_mode_; if (DeprecatedEqualIgnoringCase(value, "on")) { new_value = true; UseCounter::Count(*this, WebFeature::kDocumentDesignModeEnabeld); } else if (DeprecatedEqualIgnoringCase(value, "off")) { new_value = false; } ...
0
144,050
Analyze the following 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 unlink_anon_vmas(struct vm_area_struct *vma) { struct anon_vma_chain *avc, *next; struct anon_vma *root = NULL; /* * Unlink each anon_vma chained to the VMA. This list is ordered * from newest to oldest, ensuring the root anon_vma gets freed last. */ list_for_each_entry_safe(avc, next, &vma->anon...
0
38,327
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: char *vnc_socket_local_addr(const char *format, int fd) { struct sockaddr_storage sa; socklen_t salen; salen = sizeof(sa); if (getsockname(fd, (struct sockaddr*)&sa, &salen) < 0) return NULL; return addr_to_string(format, &sa, salen); } Commit Message: CWE ID: CWE-264
0
8,048
Analyze the following 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 fib6_table *fib6_new_table(struct net *net, u32 id) { return fib6_get_table(net, id); } 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 error in fn = fib6_add_1(), then error codes are encoded into th...
0
28,423
Analyze the following 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 recursive_scan(struct gfs2_inode *ip, struct buffer_head *dibh, struct metapath *mp, unsigned int height, u64 block, int first, struct strip_mine *sm) { struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); struct buffer_head *bh = NULL; __be64 *top, *bottom, *t2; u64 bn; int error; int mh_size...
0
34,678
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: const char* dump_av_sm_event_name(btif_av_sm_event_t event) { switch ((int)event) { CASE_RETURN_STR(BTA_AV_ENABLE_EVT) CASE_RETURN_STR(BTA_AV_REGISTER_EVT) CASE_RETURN_STR(BTA_AV_OPEN_EVT) CASE_RETURN_STR(BTA_AV_CLOSE_EVT) CASE_RETURN_STR(BTA_AV_START_EVT) CASE_RETURN_STR(BTA_AV_STOP_EVT)...
0
163,246
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static BIGNUM *srp_Calc_k(BIGNUM *N, BIGNUM *g) { /* k = SHA1(N | PAD(g)) -- tls-srp draft 8 */ unsigned char digest[SHA_DIGEST_LENGTH]; unsigned char *tmp; EVP_MD_CTX ctxt; int longg ; int longN = BN_num_bytes(N); if ((tmp = OPENSSL_malloc(longN)) == NULL) return N...
1
165,173
Analyze the following 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 sb_is_blkdev_sb(struct super_block *sb) { return sb == blockdev_superblock; } Commit Message: ->splice_write() via ->write_iter() iter_file_splice_write() - a ->splice_write() instance that gathers the pipe buffers, builds a bio_vec-based iov_iter covering those and feeds it to ->write_iter(). A bunch of ...
0
46,286
Analyze the following 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::HandleWaitSyncTokenCHROMIUM( uint32_t immediate_data_size, const volatile void* cmd_data) { const volatile gles2::cmds::WaitSyncTokenCHROMIUM& c = *static_cast<const volatile gles2::cmds::WaitSyncTokenCHROMIUM*>( cmd_data); const gpu::CommandBufferNamesp...
0
145,925
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: media::AudioParameters GetDeviceParametersOnDeviceThread( media::AudioManager* audio_manager, const std::string& unique_id) { DCHECK(audio_manager->GetTaskRunner()->BelongsToCurrentThread()); return media::AudioDeviceDescription::IsDefaultDevice(unique_id) ? audio_manager->GetDefaultOutpu...
1
171,982
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool PowerOverlayEnabled() { return base::CommandLine::ForCurrentProcess()->HasSwitch( ::switches::kEnablePowerOverlay); } Commit Message: [Contextual Search] Change "Now on Tap" to "Contextual Cards" BUG=644934 Review-Url: https://codereview.chromium.org/2361163003 Cr-Commit-Position: refs/heads/maste...
0
120,266
Analyze the following 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 ParamTraits<std::vector<bool> >::Log(const param_type& p, std::string* l) { for (size_t i = 0; i < p.size(); ++i) { if (i != 0) l->push_back(' '); LogParam((p[i]), l); } } Commit Message: Validate that paths don't contain embedded NULLs at deserialization. BUG=166867 Review URL: https://...
0
117,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: psf_fgets (char *buffer, sf_count_t bufsize, SF_PRIVATE *psf) { sf_count_t k = 0 ; sf_count_t count ; while (k < bufsize - 1) { count = read (psf->file.filedes, &(buffer [k]), 1) ; if (count == -1) { if (errno == EINTR) continue ; psf_log_syserr (psf, errno) ; break ; } ; if (count == 0 ...
0
45,212
Analyze the following 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 jas_get_mem_usage() { return jas_mem; } Commit Message: Fixed an integer overflow problem. CWE ID: CWE-190
0
70,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: static inline int may_ptrace_stop(void) { if (!likely(task_ptrace(current))) return 0; /* * Are we in the middle of do_coredump? * If so and our tracer is also part of the coredump stopping * is a deadlock situation, and pointless because our tracer * is dead so don't allow us to stop. * If SIGKILL ...
0
35,181
Analyze the following 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 CheckMpeg2ProgramStream(const uint8_t* buffer, int buffer_size) { RCHECK(buffer_size > 14); int offset = 0; while (offset + 14 < buffer_size) { BitReader reader(buffer + offset, 14); RCHECK(ReadBits(&reader, 24) == 1); RCHECK(ReadBits(&reader, 8) == PACK_START_CODE); int mpeg_...
0
151,874
Analyze the following 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 PixelPacket *GetAuthenticPixelCacheNexus(Image *image, const ssize_t x,const ssize_t y,const size_t columns,const size_t rows, NexusInfo *nexus_info,ExceptionInfo *exception) { CacheInfo *restrict cache_info; PixelPacket *restrict pixels; /* Transfer pixels from the cache. *...
0
73,615
Analyze the following 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 tap_cancel() const { return tap_cancel_; } Commit Message: Pass ui::LatencyInfo correct with unified gesture detector on Aura. BUG=379812 TEST=GestureRecognizerTest.LatencyPassedFromTouchEvent Review URL: https://codereview.chromium.org/309823002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2746...
0
112,133
Analyze the following 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 runsFromLeadingWhitespace() const { return m_runsFromLeadingWhitespace; } Commit Message: Update containtingIsolate to go back all the way to top isolate from current root, rather than stopping at the first isolate it finds. This works because the current root is always updated with each isolate run...
0
111,396
Analyze the following 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 activityLoggingGetterForAllWorldsLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) { TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); v8SetReturnValueInt(info, imp->activityLoggingGetterForAllWorldsLongAttribute()); } Commit Message: document.lo...
0
122,107
Analyze the following 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 extent_map *btrfs_get_extent_fiemap(struct inode *inode, struct page *page, size_t pg_offset, u64 start, u64 len, int create) { struct extent_map *em; struct extent_map *hole_em = NULL; u64 range_start = start; u64 end; u64 found; u64 found_end; int err = 0; em = btrfs_get_extent(i...
0
34,304
Analyze the following 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_cleanup_msi(VMXNET3State *s) { PCIDevice *d = PCI_DEVICE(s); msi_uninit(d); } Commit Message: CWE ID: CWE-200
0
8,979
Analyze the following 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 update_send_desktop_resize(rdpContext* context) { return rdp_server_reactivate(context->rdp); } Commit Message: Fixed CVE-2018-8786 Thanks to Eyal Itkin from Check Point Software Technologies. CWE ID: CWE-119
0
83,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: unsigned int blk_rq_err_bytes(const struct request *rq) { unsigned int ff = rq->cmd_flags & REQ_FAILFAST_MASK; unsigned int bytes = 0; struct bio *bio; if (!(rq->rq_flags & RQF_MIXED_MERGE)) return blk_rq_bytes(rq); /* * Currently the only 'mixing' which can happen is between * different fastfail typ...
0
92,021
Analyze the following 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 PageInfoUI::GetConnectionIconID(PageInfo::SiteConnectionStatus status) { int resource_id = IDR_PAGEINFO_INFO; switch (status) { case PageInfo::SITE_CONNECTION_STATUS_UNKNOWN: case PageInfo::SITE_CONNECTION_STATUS_INTERNAL_PAGE: break; case PageInfo::SITE_CONNECTION_STATUS_ENCRYPTED: ...
0
138,018
Analyze the following 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 unsigned int unix_hash_fold(__wsum n) { unsigned int hash = (__force unsigned int)csum_fold(n); hash ^= hash>>8; return hash&(UNIX_HASH_SIZE-1); } Commit Message: unix: avoid use-after-free in ep_remove_wait_queue Rainer Weikusat <rweikusat@mobileactivedefense.com> writes: An AF_UNIX datagram ...
0
46,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: long kvm_arch_vm_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg) { struct kvm *kvm = filp->private_data; void __user *argp = (void __user *)arg; int r = -ENOTTY; /* * This union makes it completely explicit to gcc-3.x * that these two variables' stack usage should be * combined,...
0
33,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: bool tee_mmu_is_vbuf_intersect_ta_private(const struct user_ta_ctx *utc, const void *va, size_t size) { struct vm_region *r; TAILQ_FOREACH(r, &utc->vm_info->regions, link) { if (r->attr & (TEE_MATTR_EPHEMERAL | TEE_MATTR_PERMANENT)) continue; if (core_is_buffer_intersect(va, size, r->va, r->size)...
0
86,974
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int32_t PepperFlashRendererHost::OnInvokePrinting( ppapi::host::HostMessageContext* host_context) { PPB_PDF_Impl::InvokePrintingForInstance(pp_instance()); return PP_OK; } Commit Message: PPB_Flash.Navigate(): Disallow certain HTTP request headers. With this CL, PPB_Flash.Navigate() fails the operation ...
0
123,701
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: CtcpHandler::CtcpHandler(CoreNetwork *parent) : CoreBasicHandler(parent), XDELIM("\001"), _ignoreListManager(parent->ignoreListManager()) { QByteArray MQUOTE = QByteArray("\020"); ctcpMDequoteHash[MQUOTE + '0'] = QByteArray(1, '\000'); ctcpMDequoteHash[MQUOTE + 'n'] = QByteArray(1, '\n'); ctcpM...
0
7,364
Analyze the following 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 GLES2Implementation::CallDeferredErrorCallbacks() { if (deferred_error_callbacks_.empty()) return; if (error_message_callback_.is_null()) { deferred_error_callbacks_.clear(); return; } std::deque<DeferredErrorCallback> local_callbacks; std::swap(deferred_error_callbacks_, local_callba...
0
140,890
Analyze the following 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 CSPSourceList::parseScheme(const UChar* begin, const UChar* end, String& scheme) { ASSERT(begin <= end); ASSERT(scheme.isEmpty()); if (begin == end) return false; const UChar* position = begin; if (!skipExactly<UChar, isASCIIAlpha>(position, end)) return false; ski...
0
125,398
Analyze the following 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 DeprecateAsSameValueMeasureAsOverloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) { TestObject* impl = V8TestObject::ToImpl(info.Holder()); impl->deprecateAsSameValueMeasureAsOverloadedMethod(); } Commit Message: bindings: Support "attribute FrozenArray<T>?" Adds a quick hac...
0
134,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: static int tm_ppr_set(struct task_struct *target, const struct user_regset *regset, unsigned int pos, unsigned int count, const void *kbuf, const void __user *ubuf) { int ret; if (!cpu_has_feature(CPU_FTR_TM)) return -ENODEV; if (!MSR_TM_ACTIVE(target->thread.regs->msr)) return -E...
0
84,829
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static RList* relocs(RBinFile *bf) { RList *ret = NULL; RBinReloc *ptr = NULL; RBinElfReloc *relocs = NULL; struct Elf_(r_bin_elf_obj_t) *bin = NULL; ut64 got_addr; int i; if (!bf || !bf->o || !bf->o->bin_obj) { return NULL; } bin = bf->o->bin_obj; if (!(ret = r_list_newf (free))) { return NULL; } ...
0
82,941
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MAYBE_WebRtcBrowserTest() {} Commit Message: Rewrite getUseMedia calls to use promises. This removes many uses of waitForVideo() etc. and makes the control flow of the test clearer. Instead of having the all-events-occurred handler magically calling reportTestSuccess, it's laid out explicitly in each test. B...
0
148,784
Analyze the following 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 virtio_load(VirtIODevice *vdev, QEMUFile *f) { int i, ret; uint32_t num; uint32_t features; uint32_t supported_features; BusState *qbus = qdev_get_parent_bus(DEVICE(vdev)); VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus); if (k->load_config) { ret = k->load_config(qbus->par...
1
165,336
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: IW_IMPL(void) iw_utf8_to_ascii(const char *src, char *dst, int dstlen) { struct iw_utf8cvt_struct s; int sp; unsigned char c; unsigned int pending_char; int bytes_expected; s.dst = dst; s.dstlen = dstlen; s.dp = 0; pending_char=0; bytes_expected=0; for(sp=0;src[sp];sp++) { c = (unsigned char)src[sp...
0
66,297
Analyze the following 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(mcrypt_module_get_algo_block_size) { MCRYPT_GET_MODE_DIR_ARGS(algorithms_dir) RETURN_LONG(mcrypt_module_get_algo_block_size(module, dir)); } Commit Message: Fix bug #72455: Heap Overflow due to integer overflows CWE ID: CWE-190
1
167,099
Analyze the following 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 udf_char_to_ustr(struct ustr *dest, const uint8_t *src, int strlen) { if ((!dest) || (!src) || (!strlen) || (strlen > UDF_NAME_LEN - 2)) return 0; memset(dest, 0, sizeof(struct ustr)); memcpy(dest->u_name, src, strlen); dest->u_cmpID = 0x08; dest->u_len = strlen; return strlen; } Commit Me...
0
45,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: bool AutofillDialogViews::SaveDetailsLocally() { DCHECK(save_in_chrome_checkbox_->visible()); return save_in_chrome_checkbox_->checked(); } Commit Message: Clear out some minor TODOs. BUG=none Review URL: https://codereview.chromium.org/1047063002 Cr-Commit-Position: refs/heads/master@{#322959} CWE ID: CW...
0
110,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 op_addSseCC(MCInst *MI, int v) { if (MI->csh->detail) { MI->flat_insn->detail->x86.sse_cc = v; } } Commit Message: x86: fast path checking for X86_insn_reg_intel() CWE ID: CWE-125
0
94,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: dissect_spoolss_uint16uni(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, guint8 *drep _U_, char **data, int hf_name) { gint len, remaining; char *text; if (offset % 2) offset += 2 - (offset % 2); /* Get remaining data in buffer as a string */ remaining = tvb_captured_l...
1
167,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: inline SearchBuffer::~SearchBuffer() { UErrorCode status = U_ZERO_ERROR; usearch_setPattern(WebCore::searcher(), &newlineCharacter, 1, &status); ASSERT(status == U_ZERO_ERROR); unlockSearcher(); } Commit Message: Upgrade a TextIterator ASSERT to a RELEASE_ASSERT as a defensive measure. BUG=1569...
0
113,377
Analyze the following 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 WebContentsAndroid::DidStartNavigationTransitionForFrame(int64 frame_id) { JNIEnv* env = AttachCurrentThread(); Java_WebContentsImpl_didStartNavigationTransitionForFrame( env, obj_.obj(), frame_id); } Commit Message: Revert "Load web contents after tab is created." This reverts commit 4c55f398def...
0
109,874
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: _fep_transceive_control_message (Fep *fep, int fd, FepControlMessage *request, FepControlMessage *response) { FepList *messages = NULL; int retval = 0; retval = _fep_write_control...
0
36,950
Analyze the following 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 hw_break_release_slot(int breakno) { struct perf_event **pevent; int cpu; if (dbg_is_early) return 0; for_each_online_cpu(cpu) { pevent = per_cpu_ptr(breakinfo[breakno].pev, cpu); if (dbg_release_bp_slot(*pevent)) /* * The debugger is responsible for handing the retry on * remove...
0
25,869
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int hns_roce_register_device(struct hns_roce_dev *hr_dev) { int ret; struct hns_roce_ib_iboe *iboe = NULL; struct ib_device *ib_dev = NULL; struct device *dev = hr_dev->dev; iboe = &hr_dev->iboe; spin_lock_init(&iboe->lock); ib_dev = &hr_dev->ib_dev; strlcpy(ib_dev->name, "hns_%d", IB_DEVICE_NAME...
0
87,748
Analyze the following 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 AnimatedPropertyType EmptyValue() { return kAnimatedUnknown; } Commit Message: Fix SVG crash for v0 distribution into foreignObject. We require a parent element to be an SVG element for non-svg-root elements in order to create a LayoutObject for them. However, we checked the light tree parent element, ...
0
152,753
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: DictionaryValue* GetUpdatesResponseToValue( const sync_pb::GetUpdatesResponse& proto, bool include_specifics) { DictionaryValue* value = new DictionaryValue(); value->Set("entries", SyncEntitiesToValue(proto.entries(), include_specifics)); SET_INT64(changes_remaining); SET_REP(new_pro...
0
105,232
Analyze the following 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 Plugin::BitcodeDidTranslate(int32_t pp_error) { PLUGIN_PRINTF(("Plugin::BitcodeDidTranslate (pp_error=%"NACL_PRId32")\n", pp_error)); if (pp_error != PP_OK) { PLUGIN_PRINTF(("Plugin::BitcodeDidTranslate error in Pnacl\n")); return; } EnqueueProgressEvent(kProgressEventProgres...
0
103,333
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SplashError Splash::arbitraryTransformImage(SplashImageSource src, void *srcData, SplashColorMode srcMode, int nComps, GBool srcAlpha, int srcWidth, int srcHeight, SplashCoord *mat, GBool interpolate, GBool tilingPattern) { SplashBitmap *scaledImg; SplashClipRe...
0
4,087
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int filter_frame(AVFilterLink *inlink, AVFrame *in) { DelogoContext *s = inlink->dst->priv; AVFilterLink *outlink = inlink->dst->outputs[0]; const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); AVFrame *out; int hsub0 = desc->log2_chroma_w; int vsub0 = desc->log2_ch...
1
165,998
Analyze the following 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_pk_load_id(krb5_context context, struct krb5_pk_identity **ret_id, const char *user_id, const char *anchor_id, char * const *chain_list, char * const *revoke_list, krb5_prompter_fct prompter, void *prompter_data, char *password) { struct krb5_pk_identity *id = NULL; struct pr...
0
89,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: void GM2TabStyle::PaintBackgroundStroke(gfx::Canvas* canvas, bool active, SkColor stroke_color) const { SkPath outer_path = GetPath(TabStyle::PathType::kBorder, canvas->image_scale(), active); gfx::ScopedCanvas scoped_ca...
1
172,522
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static const char *set_cgi_var(cmd_parms *cmd, void *d_, const char *var, const char *rule_) { core_dir_config *d = d_; char *rule = apr_pstrdup(cmd->pool, rule_); ap_str_tolower(rule); if (!strcmp(var, "REQUEST_URI")) { if (strcmp(rule, "current-uri") && s...
0
64,272
Analyze the following 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 LayerTreeHostImpl::IsActivelyScrolling() const { if (!CurrentlyScrollingNode()) return false; if (settings_.ignore_root_layer_flings && IsCurrentlyScrollingViewport()) return false; return did_lock_scrolling_layer_; } Commit Message: (Reland) Discard compositor frames from unloaded web content...
0
137,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: static int sepinitialproc(i_ctx_t *i_ctx_p, ref *space) { gs_client_color cc; cc.pattern = 0x00; cc.paint.values[0] = 1.0; return gs_setcolor(igs, &cc); } Commit Message: CWE ID: CWE-704
0
3,128
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ssize_t tpm_show_owned(struct device * dev, struct device_attribute * attr, char *buf) { cap_t cap; ssize_t rc; rc = tpm_getcap(dev, TPM_CAP_PROP_OWNER, &cap, "attempting to determine the owner state"); if (rc) return 0; rc = sprintf(buf, "%d\n", cap.owned); return rc; } Commit Message: char/tpm...
0
27,649
Analyze the following 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 btrc_interface_t *btif_rc_get_interface(void) { BTIF_TRACE_EVENT("%s", __FUNCTION__); return &bt_rc_interface; } Commit Message: DO NOT MERGE Fix potential DoS caused by delivering signal to BT process Bug: 28885210 Change-Id: I63866d894bfca47464d6e42e3fb0357c4f94d360 Conflicts: btif/co/bta_hh_co....
0
158,803