instruction
stringclasses
1 value
input
stringlengths
64
129k
output
int64
0
1
__index_level_0__
int64
0
30k
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void dec_mnt_namespaces(struct ucounts *ucounts) { dec_ucount(ucounts, UCOUNT_MNT_NAMESPACES); } Commit Message: mnt: Add a per mount namespace limit on the number of mounts CAI Qian <caiqian@redhat.com> pointed out that the semantics of shared subtrees make it possible to create an exponentially increa...
0
21,098
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: dcchkstr(int size) { while( (strsize+size) > strmaxsize ) { dcstr=realloc(dcstr,strmaxsize+DCSTRSIZE); strmaxsize+=DCSTRSIZE; dcptr=dcstr+strsize; } } Commit Message: decompileAction: Prevent heap buffer overflow and underflow with using OpCode CWE ID: CWE-119
0
9,412
Analyze the following 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::NotifyStorageModifiedInternal( QuotaClient::ID client_id, const GURL& origin, StorageType type, int64 delta, base::Time modified_time) { LazyInitialize(); GetUsageTracker(type)->UpdateUsageCache(client_id, origin, delta); PostTaskAndReplyWithResultForDBThread( F...
0
12,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: void ExpectCanDiscardFalseAllReasons(const LifecycleUnit* lifecycle_unit, DecisionFailureReason failure_reason) { ExpectCanDiscardFalse(lifecycle_unit, failure_reason, DiscardReason::kExternal); ExpectCanDiscardFalse(lifecycle_unit, failure_reason, ...
0
11,951
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ProfilingService::ProfilingService() : weak_factory_(this) {} Commit Message: memory-infra: split up memory-infra coordinator service into two This allows for heap profiler to use its own service with correct capabilities and all other instances to use the existing coordinator service. Bug: 792028 Change-Id: I...
0
22,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: dispatchRaw(Parcel &p, RequestInfo *pRI) { int32_t len; status_t status; const void *data; status = p.readInt32(&len); if (status != NO_ERROR) { goto invalid; } if (((int)len) == -1) { data = NULL; len = 0; } data = p.readInplace(len); startRequest; appendPrintBuf("%sr...
0
18,822
Analyze the following 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 RenderFrameImpl::DidAddContentSecurityPolicies( const blink::WebVector<blink::WebContentSecurityPolicy>& policies) { std::vector<ContentSecurityPolicy> content_policies; for (const auto& policy : policies) content_policies.push_back(BuildContentSecurityPolicy(policy)); Send(new FrameHostMsg_Di...
0
14,123
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PlatformThreadId WorkerThread::platformThreadId() { if (!m_started) return 0; return backingThread().platformThread().threadId(); } Commit Message: Correctly keep track of isolates for microtask execution BUG=487155 R=haraken@chromium.org Review URL: https://codereview.chromium.org/1161823002 ...
0
28,299
Analyze the following 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_mdtm(ftpbuf_t *ftp, const char *path) { time_t stamp; struct tm *gmt, tmbuf; struct tm tm; char *ptr; int n; if (ftp == NULL) { return -1; } if (!ftp_putcmd(ftp, "MDTM", path)) { return -1; } if (!ftp_getresp(ftp) || ftp->resp != 213) { return -1; } /* parse out the timestamp */ for (pt...
0
5,686
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SendTabToSelfInfoBarDelegate::SendTabToSelfInfoBarDelegate( const SendTabToSelfEntry* entry) { entry_ = entry; } Commit Message: [SendTabToSelf] Added logic to display an infobar for the feature. This CL is one of many to come. It covers: * Creation of the infobar from the SendTabToSelfInfoBarControll...
1
1,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: vmci_transport_queue_pair_alloc(struct vmci_qp **qpair, struct vmci_handle *handle, u64 produce_size, u64 consume_size, u32 peer, u32 flags, bool trusted) { int err = 0; if (trusted) { /* Try to allocate our queue pair as trusted. This will only * work if vsock is running in the host. *...
0
25,831
Analyze the following 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_DEFINE3(osf_fstatfs, unsigned long, fd, struct osf_statfs __user *, buffer, unsigned long, bufsiz) { struct kstatfs linux_stat; int error = fd_statfs(fd, &linux_stat); if (!error) error = linux_to_osf_statfs(&linux_stat, buffer, bufsiz); return error; } Commit Message: alpha: fix several security...
0
19,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: static uint8_t* add_attr(uint8_t* p, tSDP_DISCOVERY_DB* p_db, tSDP_DISC_REC* p_rec, uint16_t attr_id, tSDP_DISC_ATTR* p_parent_attr, uint8_t nest_level) { tSDP_DISC_ATTR* p_attr; uint32_t attr_len; uint32_t total_len; uint16_t attr_type; uint16_t id; uint8_...
0
13,338
Analyze the following 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 vorbis_book_clear(codebook *b){ /* static book is not cleared; we're likely called on the lookup and the static codebook belongs to the info struct */ if(b->q_val)_ogg_free(b->q_val); if(b->dec_table)_ogg_free(b->dec_table); if(b->dec_buf)_ogg_free(b->dec_buf); memset(b,0,sizeof(*b)); } Commit M...
0
23,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 void filter(GradFunContext *ctx, uint8_t *dst, const uint8_t *src, int width, int height, int dst_linesize, int src_linesize, int r) { int bstride = FFALIGN(width, 16) / 2; int y; uint32_t dc_factor = (1 << 21) / (r * r); uint16_t *dc = ctx->buf + 16; uint16_t *buf = ctx->buf + bstride ...
0
29,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 CURLcode imap_doing(struct connectdata *conn, bool *dophase_done) { CURLcode result; result = imap_multi_statemach(conn, dophase_done); if(*dophase_done) { result = imap_dophase_done(conn, FALSE /* not connected */); DEBUGF(infof(conn->data, "DO phase is compl...
0
3,744
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xfs_icache_free_eofblocks( struct xfs_mount *mp, struct xfs_eofblocks *eofb) { return __xfs_icache_free_eofblocks(mp, eofb, xfs_inode_free_eofblocks, XFS_ICI_EOFBLOCKS_TAG); } Commit Message: xfs: validate cached inodes are free when allocated A recent fuzzed filesystem image cached random dcache corrupti...
0
8,073
Analyze the following 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 md_make_request(struct request_queue *q, struct bio *bio) { const int rw = bio_data_dir(bio); struct mddev *mddev = q->queuedata; unsigned int sectors; int cpu; if (mddev == NULL || mddev->pers == NULL || !mddev->ready) { bio_io_error(bio); return; } if (mddev->ro == 1 && unlikely(rw ...
0
26,827
Analyze the following 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 ktime_t common_hrtimer_remaining(struct k_itimer *timr, ktime_t now) { struct hrtimer *timer = &timr->it.real.timer; return __hrtimer_expires_remaining_adjusted(timer, now); } Commit Message: posix-timers: Sanitize overrun handling The posix timer overrun handling is broken because the forwarding func...
0
1,429
Analyze the following 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_on_rx_done_update_stats(VMXNET3State *s, int qidx, Vmxnet3PktStatus status) { struct UPT1_RxStats *stats = &s->rxq_descr[qidx].rxq_stats; size_t tot_len = vmxnet_rx_pkt_get_total_len(s->rx_pkt); switch (status) { case VMXNET3...
0
16,174
Analyze the following 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 ovl_create_object(struct dentry *dentry, int mode, dev_t rdev, const char *link) { int err; err = ovl_want_write(dentry); if (!err) { err = ovl_create_or_link(dentry, mode, rdev, link, NULL); ovl_drop_write(dentry); } return err; } Commit Message: ovl: verify upper dentry before unl...
0
17,729
Analyze the following 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 XSyncHandler::PushPaintCounter(Display* display, Picture picture, Pixmap pixmap, const base::Closure& completion_callback) { backing_store_events_.push( new BackingStoreEvents(display, picture,...
0
26,847
Analyze the following 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::MaybeQueueSendDidEditFieldInInsecureContext() { if (logged_field_edit_ || sensitive_input_edited_task_.IsActive() || IsSecureContext()) { return; } logged_field_edit_ = true; sensitive_input_edited_task_ = PostCancellableTask( *GetTaskRunner(TaskType::kUserInteraction), FROM...
0
8,761
Analyze the following 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 V8ContextNativeHandler::GetModuleSystem( const v8::FunctionCallbackInfo<v8::Value>& args) { CHECK_EQ(args.Length(), 1); CHECK(args[0]->IsObject()); ScriptContext* context = ScriptContextSet::GetContextByObject( v8::Local<v8::Object>::Cast(args[0])); if (blink::WebFrame::scriptCanAccess(cont...
0
18,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: bool BitStack::top() const { if (!m_size) return false; unsigned shift = (m_size - 1) & bitInWordMask; return m_words.last() & (1U << shift); } Commit Message: Upgrade a TextIterator ASSERT to a RELEASE_ASSERT as a defensive measure. BUG=156930,177197 R=inferno@chromium.org Review URL: http...
0
29,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: linux_md_create_data_new (DBusGMethodInvocation *context, Daemon *daemon, const char *first_component_objpath) { LinuxMdCreateData *data; data = g_new0 (LinuxMdCreateData, 1); data->refcount = 1; data->context = context; data->daemon = g_object_ref (...
0
2,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: static inline bool cpu_has_vmx_ept_execute_only(void) { return vmx_capability.ept & VMX_EPT_EXECUTE_ONLY_BIT; } Commit Message: x86,kvm,vmx: Preserve CR4 across VM entry CR4 isn't constant; at least the TSD and PCE bits can vary. TBH, treating CR0 and CR3 as constant scares me a bit, too, but it looks like it...
0
3,716
Analyze the following 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 perf_cgroup_connect(int fd, struct perf_event *event, struct perf_event_attr *attr, struct perf_event *group_leader) { struct perf_cgroup *cgrp; struct cgroup_subsys_state *css; struct fd f = fdget(fd); int ret = 0; if (!f.file) return -EBADF; css = css_tryget_onlin...
0
18,704
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: pdf14_clist_begin_image(gx_device * dev, const gs_gstate * pgs, const gs_image_t * pim, gs_image_format_t format, const gs_int_rect * prect, const gx_drawing_color * pdcolor, const gx_clip_path * pcpath, ...
0
23,233
Analyze the following 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 BluetoothAdapter::NotifyDiscoveryError(CallbackQueue callback_queue) { while (!callback_queue.empty()) { std::unique_ptr<StartOrStopDiscoveryCallback> callbacks = std::move(callback_queue.front()); callback_queue.pop(); if (callbacks->start_error_callback) callbacks->start_error_c...
0
7,465
Analyze the following 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 vrend_decode_create_object(struct vrend_decode_ctx *ctx, int length) { if (length < 1) return EINVAL; uint32_t header = get_buf_entry(ctx, VIRGL_OBJ_CREATE_HEADER); uint32_t handle = get_buf_entry(ctx, VIRGL_OBJ_CREATE_HANDLE); uint8_t obj_type = (header >> 8) & 0xff; int ret = 0;...
0
22,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 __inet_check_established(struct inet_timewait_death_row *death_row, struct sock *sk, __u16 lport, struct inet_timewait_sock **twp) { struct inet_hashinfo *hinfo = death_row->hashinfo; struct inet_sock *inet = inet_sk(sk); __be32 daddr = inet->inet_rcv_saddr; __be32 saddr = inet->ine...
0
15,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: static int get_crl_score(X509_STORE_CTX *ctx, X509 **pissuer, unsigned int *preasons, X509_CRL *crl, X509 *x) { int crl_score = 0; unsigned int tmp_reasons = *preasons, crl_reasons; /* First see if we can reject CRL straight away */ /* Invalid IDP cannot be processed */...
0
5,523
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool srv_send_smb(int fd, char *buffer, bool do_signing, uint32_t seqnum, bool do_encrypt, struct smb_perfcount_data *pcd) { size_t len = 0; size_t nwritten=0; ssize_t ret; char *buf_out = buffer; if (do_signing) { /* Sign the outgoing packet if required. */ srv_calculate_sign_mac(smbd_serve...
0
20,720
Analyze the following 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 get_crl_score(X509_STORE_CTX *ctx, X509 **pissuer, unsigned int *preasons, X509_CRL *crl, X509 *x) { int crl_score = 0; unsigned int tmp_reasons = *preasons, crl_reasons; /* First see if we can reject CRL straight away */ /* Invalid IDP cannot be processed */...
0
24,800
Analyze the following 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::DestroyOnRenderFrameGone() { scoped_refptr<RenderFrameDevToolsAgentHost> protect(this); if (IsAttached()) RevokePolicy(); ForceDetachAllSessions(); frame_host_ = nullptr; agent_ptr_.reset(); SetFrameTreeNode(nullptr); Release(); } Commit Message: [DevTools] Do...
0
23,259
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: _prevA(int visited) { HmarkerList *hl = Currentbuf->hmarklist; BufferPoint *po; Anchor *an, *pan; int i, x, y, n = searchKeyNum(); ParsedURL url; if (Currentbuf->firstLine == NULL) return; if (!hl || hl->nmark == 0) return; an = retrieveCurrentAnchor(Currentbuf); if (visite...
0
7,508
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ar6000_ready_event(void *devt, u8 *datap, u8 phyCap, u32 sw_ver, u32 abi_ver) { struct ar6_softc *ar = (struct ar6_softc *)devt; struct net_device *dev = ar->arNetDev; memcpy(dev->dev_addr, datap, AR6000_ETH_ADDR_LEN); AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("mac address = %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%...
0
18,739
Analyze the following 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 ResetScreenHandler::SetDelegate(Delegate* delegate) { delegate_ = delegate; if (page_is_ready()) Initialize(); } Commit Message: Rollback option put behind the flag. BUG=368860 Review URL: https://codereview.chromium.org/267393011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269753 0039d31...
0
15,951
Analyze the following 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 ssh_hostport_setup(const char *host, int port, Conf *conf, char **savedhost, int *savedport, char **loghost_ret) { char *loghost = conf_get_str(conf, CONF_loghost); if (loghost_ret) *loghost_ret = loghost; if (*loghost)...
0
20,983
Analyze the following 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 DownloadProtectionService::ShowDetailsForDownload( const content::DownloadItem& item, content::PageNavigator* navigator) { GURL learn_more_url(chrome::kDownloadScanningLearnMoreURL); learn_more_url = google_util::AppendGoogleLocaleParam( learn_more_url, g_browser_process->GetApplicationLoca...
0
29,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: Luv24fromLuv48(LogLuvState* sp, uint8* op, tmsize_t n) { uint32* luv = (uint32*) sp->tbuf; int16* luv3 = (int16*) op; while (n-- > 0) { int Le, Ce; if (luv3[0] <= 0) Le = 0; else if (luv3[0] >= (1<<12)+3314) Le = (1<<10) - 1; else if (sp->encode_meth == SGILOGENCODE_NODITHER) Le = (luv3[0]...
0
22,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: bool TracingControllerImpl::StopTracing( const scoped_refptr<TraceDataEndpoint>& trace_data_endpoint, const std::string& agent_label) { if (!IsTracing() || drainer_) return false; DCHECK_CURRENTLY_ON(BrowserThread::UI); #if defined(OS_ANDROID) base::trace_event::TraceLog::GetInstance()->AddCloc...
0
5,778
Analyze the following 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 ResourceDispatcherHostImpl::OnShutdown() { DCHECK(io_thread_task_runner_->BelongsToCurrentThread()); is_shutdown_ = true; weak_factory_on_io_.InvalidateWeakPtrs(); pending_loaders_.clear(); update_load_info_timer_.reset(); std::set<GlobalFrameRoutingId> ids; for (const auto& blocked_loader...
0
1,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: RenderMessageFilter::RenderMessageFilter( int render_process_id, PluginServiceImpl* plugin_service, BrowserContext* browser_context, net::URLRequestContextGetter* request_context, RenderWidgetHelper* render_widget_helper, MediaInternals* media_internals, DOMStorageContextImpl* dom_stor...
0
18,239
Analyze the following 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 co64_del(GF_Box *s) { GF_ChunkLargeOffsetBox *ptr; ptr = (GF_ChunkLargeOffsetBox *) s; if (ptr == NULL) return; if (ptr->offsets) gf_free(ptr->offsets); gf_free(ptr); } Commit Message: fixed 2 possible heap overflows (inc. #1088) CWE ID: CWE-125
0
5,507
Analyze the following 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 ChildProcessSecurityPolicyImpl::CanCreateReadWriteFileSystemFile( int child_id, const storage::FileSystemURL& url) { return HasPermissionsForFileSystemFile(child_id, url, CREATE_READ_WRITE_FILE_GRANT); } Commit Message: This patch implements a mechanism for...
0
24,334
Analyze the following 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_disable(struct perf_event *event) { struct perf_event_context *ctx; ctx = perf_event_ctx_lock(event); _perf_event_disable(event); perf_event_ctx_unlock(event, ctx); } Commit Message: perf: Fix race in swevent hash There's a race on CPU unplug where we free the swevent hash array while it ca...
0
11,825
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xmlParseDTD(const xmlChar *ExternalID, const xmlChar *SystemID) { return(xmlSAXParseDTD(NULL, ExternalID, SystemID)); } Commit Message: Detect infinite recursion in parameter entities When expanding a parameter entity in a DTD, infinite recursion could lead to an infinite loop or memory exhaustion. Thanks ...
0
12,088
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gfx::Rect RenderWidgetHostViewAura::GetViewBounds() const { return window_->GetBoundsInScreen(); } 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 contexts - do n...
0
15,565
Analyze the following 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 __init taskstats_init(void) { int rc; rc = genl_register_family(&family); if (rc) return rc; rc = genl_register_ops(&family, &taskstats_ops); if (rc < 0) goto err; rc = genl_register_ops(&family, &cgroupstats_ops); if (rc < 0) goto err_cgroup_ops; family_registered = 1; pr_info("regi...
0
3,526
Analyze the following 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 Reverb_getDescriptor(effect_handle_t self, effect_descriptor_t *pDescriptor) { android::ReverbContext * pContext = (android::ReverbContext *)self; const effect_descriptor_t *desc; if (pContext == NULL || pDescriptor == NULL) { ALOGV("Reverb_getDescriptor() invalid param"); return -EINVAL; ...
0
2,794
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gdImagePtr gdImageScaleBicubicFixed(gdImagePtr src, const unsigned int width, const unsigned int height) { const long new_width = MAX(1, width); const long new_height = MAX(1, height); const int src_w = gdImageSX(src); const int src_h = gdImageSY(src); const gdFixed f_dx = gd_ftofx((float)src_w / (float)new_...
0
26,365
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void ipa_region_frame(wmfAPI * API, wmfPolyRectangle_t * poly_rect) { /* Save graphic wand */ (void) PushDrawingWand(WmfDrawingWand); if (TO_FILL(poly_rect) || TO_DRAW(poly_rect)) { long i; draw_fill_color_string(WmfDrawingWand,"none"); util_set_brush(API, poly_rect->d...
0
18,618
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int rtnl_net_valid_getid_req(struct sk_buff *skb, const struct nlmsghdr *nlh, struct nlattr **tb, struct netlink_ext_ack *extack) { int i, err; if (!netlink_strict_get_check(skb)) return nlmsg_parse(nlh, sizeof(struct rtgenmsg), tb, NETNSA_MAX, rtnl_net_policy, extack); ...
0
14,614
Analyze the following 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 UrlData::IncreaseLoadersInState( UrlDataWithLoadingState::LoadingState state) { switch (state) { case UrlDataWithLoadingState::LoadingState::kIdle: break; case UrlDataWithLoadingState::LoadingState::kPreload: preloading_++; break; case UrlDataWithLoadingState::LoadingState...
0
19,009
Analyze the following 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 WebPluginDelegateProxy::UseSynchronousGeometryUpdates() { if (info_.name.find(ASCIIToUTF16("Windows Media Player")) != string16::npos) return true; std::vector<webkit::WebPluginMimeType>::iterator index; for (index = info_.mime_types.begin(); index != info_.mime_types.end(); index++) { ...
0
26,281
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: rdp_send_fonts(uint16 seq) { STREAM s; logger(Protocol, Debug, "%s()", __func__); s = rdp_init_data(8); out_uint16(s, 0); /* number of fonts */ out_uint16_le(s, 0); /* pad? */ out_uint16_le(s, seq); /* unknown */ out_uint16_le(s, 0x32); /* entry size */ s_mark_end(s); rdp_send_data(s, RDP_DATA_PDU_FO...
0
14,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: int AecGetParameter(preproc_effect_t *effect, void *pParam, uint32_t *pValueSize, void *pValue) { int status = 0; uint32_t param = *(uint32_t *)pParam; if (*pValueSize < sizeof(uint32_t)) { return -EINVAL; } switch (param) { case AEC_PARAM_ECHO_DELAY: case AEC_PARAM_PROPERTIES: *(uint32_t *)pValue = ...
0
5,413
Analyze the following 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 OfflinePageDownloadBridge::Destroy(JNIEnv* env, const JavaParamRef<jobject>&) { delete this; } Commit Message: Open Offline Pages in CCT from Downloads Home. When the respective feature flag is enabled, offline pages opened from the Downloads Home will use CCT inst...
0
20,292
Analyze the following 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 vop_dev_remove(struct vop_info *pvi, struct mic_device_ctrl *devp, struct vop_device *vpdev) { struct mic_bootparam *bootparam = vpdev->hw_ops->get_dp(vpdev); s8 db; int ret, retry; DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wake); devp->config_change = MIC_VIRTIO_PARAM_DEV_REMOVE; db = bootparam->h...
0
6,055
Analyze the following 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 reds_set_client_mouse_allowed(int is_client_mouse_allowed, int x_res, int y_res) { reds->monitor_mode.x_res = x_res; reds->monitor_mode.y_res = y_res; reds->dispatcher_allows_client_mouse = is_client_mouse_allowed; reds_update_mouse_mode(); if (reds->is_client_mouse_allowed && inputs_has_...
0
17,924
Analyze the following 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 xhci_ep_kick_timer(void *opaque) { XHCIEPContext *epctx = opaque; xhci_kick_epctx(epctx, 0); } Commit Message: CWE ID: CWE-835
0
9,225
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void pdf_run_S(fz_context *ctx, pdf_processor *proc) { pdf_run_processor *pr = (pdf_run_processor *)proc; pdf_show_path(ctx, pr, 0, 0, 1, 0); } Commit Message: CWE ID: CWE-416
0
12,457
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int load_state_from_tss32(struct x86_emulate_ctxt *ctxt, struct tss_segment_32 *tss) { int ret; u8 cpl; if (ctxt->ops->set_cr(ctxt, 3, tss->cr3)) return emulate_gp(ctxt, 0); ctxt->_eip = tss->eip; ctxt->eflags = tss->eflags | 2; /* General purpose registers */ *reg_write(ctxt, VCPU_REGS_RAX...
0
28,013
Analyze the following 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 ChromeNetworkDelegate::OnBeforeSendHeaders( net::URLRequest* request, const net::CompletionCallback& callback, net::HttpRequestHeaders* headers) { TRACE_EVENT_ASYNC_STEP_PAST0("net", "URLRequest", request, "SendRequest"); return ExtensionWebRequestEventRouter::GetInstance()->OnBeforeSendHeader...
0
28,652
Analyze the following 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 SoftHEVC::deInitDecoder() { size_t i; IV_API_CALL_STATUS_T status; if (mCodecCtx) { ivdext_delete_ip_t s_delete_ip; ivdext_delete_op_t s_delete_op; s_delete_ip.s_ivd_delete_ip_t.u4_size = sizeof(ivdext_delete_ip_t); s_delete_ip.s_ivd_delete_ip_t.e_cmd = IVD_CMD_DELETE; ...
0
20,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: Buffer::Buffer(const HostResource& resource, const base::SharedMemoryHandle& shm_handle, uint32_t size) : Resource(OBJECT_IS_PROXY, resource), shm_(shm_handle, false), size_(size), map_count_(0) { } Commit Message: Add permission checks for PPB_Buffer. BUG=1163...
0
3,338
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SoftAACEncoder::~SoftAACEncoder() { delete[] mInputFrame; mInputFrame = NULL; if (mEncoderHandle) { CHECK_EQ(VO_ERR_NONE, mApiHandle->Uninit(mEncoderHandle)); mEncoderHandle = NULL; } delete mApiHandle; mApiHandle = NULL; delete mMemOperator; mMemOperator = NULL; } Commit Mess...
0
8,927
Analyze the following 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 uint8ArrayMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); v8SetReturnValue(info, imp->uint8ArrayMethod()); } Commit Message: document.location bindings fix BUG=352374 R=jochen@chromium.org Review URL: https...
0
16,405
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool IsElementEditable(const blink::WebInputElement& element) { return element.isEnabled() && !element.isReadOnly(); } Commit Message: Remove WeakPtrFactory from PasswordAutofillAgent Unlike in AutofillAgent, the factory is no longer used in PAA. R=dvadym@chromium.org BUG=609010,609007,608100,608101,433486 ...
0
27,980
Analyze the following 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_async_commit(struct work_struct *work) { struct btrfs_async_commit *ac = container_of(work, struct btrfs_async_commit, work.work); /* * We've got freeze protection passed with the transaction. * Tell lockdep about it. */ if (ac->newtrans->type < TRANS_JOIN_NOLOCK) rwsem_acquire_read( ...
0
7,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: static TRBCCode xhci_configure_slot(XHCIState *xhci, unsigned int slotid, uint64_t pictx, bool dc) { dma_addr_t ictx, octx; uint32_t ictl_ctx[2]; uint32_t slot_ctx[4]; uint32_t islot_ctx[4]; uint32_t ep_ctx[5]; int i; TRBCCode res; trace_usb_xhci_...
0
15,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: static void vmx_vcpu_load(struct kvm_vcpu *vcpu, int cpu) { struct vcpu_vmx *vmx = to_vmx(vcpu); u64 phys_addr = __pa(per_cpu(vmxarea, cpu)); if (!vmm_exclusive) kvm_cpu_vmxon(phys_addr); else if (vmx->loaded_vmcs->cpu != cpu) loaded_vmcs_clear(vmx->loaded_vmcs); if (per_cpu(current_vmcs, cpu) != vmx->...
0
11,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: static int init(struct MACH0_(obj_t)* bin) { union { ut16 word; ut8 byte[2]; } endian = { 1 }; little_ = endian.byte[0]; if (!init_hdr(bin)) { bprintf ("Warning: File is not MACH0\n"); return false; } if (!init_items (bin)) { bprintf ("Warning: Cannot initialize items\n"); } bin->baddr = MACH0_(...
0
9,141
Analyze the following 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 PasswordAutofillManager::DidAcceptSuggestion(const base::string16& value, int identifier, int position) { autofill_client_->ExecuteCommand(identifier); if (identifier == autofill::POPUP_ITEM_ID_GENERATE_PA...
0
6,418
Analyze the following 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 netlink_mmap_sendmsg(struct sock *sk, struct msghdr *msg, u32 dst_portid, u32 dst_group, struct sock_iocb *siocb) { struct netlink_sock *nlk = nlk_sk(sk); struct netlink_ring *ring; struct nl_mmap_hdr *hdr; struct sk_buff *skb; unsigned int maxlen; bool excl = true; int err = 0, len = 0;...
0
15,184
Analyze the following 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 size_t StringSize(const uint8_t *start, uint8_t encoding) { if (encoding == 0x00 || encoding == 0x03) { return strlen((const char *)start) + 1; } size_t n = 0; while (start[n] != '\0' || start[n + 1] != '\0') { n += 2; } return n + 2; } Commit Message: better validation lengths of strings...
0
19,988
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: String CSSStyleSheet::href() const { return contents_->OriginalURL(); } Commit Message: Disallow access to opaque CSS responses. Bug: 848786 Change-Id: Ie53fbf644afdd76d7c65649a05c939c63d89b4ec Reviewed-on: https://chromium-review.googlesource.com/1088335 Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Commit-...
0
19,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: bool Browser::CanSaveContents(content::WebContents* web_contents) const { return chrome::CanSavePage(this); } 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.chr...
0
25,850
Analyze the following 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::didRemoveAllPendingStylesheet() { m_needsNotifyRemoveAllPendingStylesheet = false; styleResolverChanged(RecalcStyleDeferred, AnalyzedStyleUpdate); executeScriptsWaitingForResourcesIfNeeded(); if (m_gotoAnchorNeededAfterStylesheetsLoad && view()) view()->scrollToFragment(m_...
0
9,093
Analyze the following 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 vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf) { struct page *page; page = vmalloc_to_page((void *)(vmf->pgoff << PAGE_SHIFT)); if (!page) return VM_FAULT_SIGBUS; get_page(page); vmf->page = page; return 0; } Commit Message: IB/security: Restrict use of the write() interface T...
0
21,660
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: _SSL_context_init (void (*info_cb_func), int server) { SSL_CTX *ctx; #ifdef WIN32 int i, r; #endif SSLeay_add_ssl_algorithms (); SSL_load_error_strings (); ctx = SSL_CTX_new (server ? SSLv23_server_method() : SSLv23_client_method ()); SSL_CTX_set_session_cache_mode (ctx, SSL_SESS_CACHE_BOTH); SSL_CTX_set...
0
21,351
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool Tab::OnKeyPressed(const ui::KeyEvent& event) { controller_->UpdateHoverCard(this, false); if (event.key_code() == ui::VKEY_SPACE && !IsSelected()) { controller_->SelectTab(this, event); return true; } return false; } Commit Message: Paint tab groups with the group color. * The background o...
0
14,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: void WebContentsImpl::OnMoveValidationMessage( RenderViewHostImpl* source, const gfx::Rect& anchor_in_root_view) { if (delegate_) delegate_->MoveValidationMessage(this, anchor_in_root_view); } Commit Message: If JavaScript shows a dialog, cause the page to lose fullscreen. BUG=670135, 550017, 7267...
0
17,852
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ExtensionsAPIClient::CreateVirtualKeyboardDelegate( content::BrowserContext* context) const { return nullptr; } Commit Message: Hide DevTools frontend from webRequest API Prevent extensions from observing requests for remote DevTools frontends and add regression tests. And update ExtensionTestApi to supp...
0
8,166
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void bio_free(struct bio *bio) { struct bio_set *bs = bio->bi_pool; void *p; bio_uninit(bio); if (bs) { bvec_free(bs->bvec_pool, bio->bi_io_vec, BVEC_POOL_IDX(bio)); /* * If we have front padding, adjust the bio pointer before freeing */ p = bio; p -= bs->front_pad; mempool_free(p, ...
0
24,175
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ipgre_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd) { int err = 0; struct ip_tunnel_parm p; struct ip_tunnel *t; struct net *net = dev_net(dev); struct ipgre_net *ign = net_generic(net, ipgre_net_id); switch (cmd) { case SIOCGETTUNNEL: t = NULL; if (dev == ign->fb_tunnel_dev) { ...
0
6,926
Analyze the following 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_sync_fs(struct super_block *sb, int wait) { struct udf_sb_info *sbi = UDF_SB(sb); mutex_lock(&sbi->s_alloc_mutex); if (sbi->s_lvid_dirty) { /* * Blockdevice will be synced later so we don't have to submit * the buffer for IO */ mark_buffer_dirty(sbi->s_lvid_bh); sb->s_dirt = 0; ...
0
3,807
Analyze the following 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 Image *ReadImage(const ImageInfo *image_info, ExceptionInfo *exception) { char filename[MagickPathExtent], magick[MagickPathExtent], magick_filename[MagickPathExtent]; const char *value; const DelegateInfo *delegate_info; const MagickInfo *magick_info; Exceptio...
0
27,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: id_sys(struct sh_fpu_soft_struct *fregs, struct pt_regs *regs, u16 code) { int n = ((code >> 8) & 0xf); unsigned long *reg = (code & 0x0010) ? &FPUL : &FPSCR; switch (code & 0xf0ff) { case 0x005a: case 0x006a: Rn = *reg; break; case 0x405a: case 0x406a: *reg = Rn; break; case 0x4052: case 0x4062...
0
24,033
Analyze the following 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 UrlData::OnRedirect(const RedirectCB& cb) { DCHECK(thread_checker_.CalledOnValidThread()); redirect_callbacks_.push_back(cb); } Commit Message: Simplify "WouldTaintOrigin" concept in media/blink Currently WebMediaPlayer has three predicates: - DidGetOpaqueResponseFromServiceWorker - HasSingleSecurity...
0
29,826
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: raptor_object_options_copy_state(raptor_object_options* to, raptor_object_options* from) { int rc = 0; int i; to->area = from->area; for(i = 0; !rc && i <= RAPTOR_OPTION_LAST; i++) { if(raptor_option_value_is_numeric((raptor_option)i)) to->options[i].integer =...
0
11,809
Analyze the following 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_init_acl(struct btrfs_trans_handle *trans, struct inode *inode, struct inode *dir) { struct posix_acl *default_acl, *acl; int ret = 0; /* this happens with subvols */ if (!dir) return 0; ret = posix_acl_create(dir, &inode->i_mode, &default_acl, &acl); if (ret) return ret; if (default_...
0
16,964
Analyze the following 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 RenderBox::computeInlineDirectionMargins(RenderBlock* containingBlock, int containerWidth, int childWidth) { const RenderStyle* containingBlockStyle = containingBlock->style(); Length marginStartLength = style()->marginStartUsing(containingBlockStyle); Length marginEndLength = style()->marginEndU...
0
21,870
Analyze the following 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 *t_hash_start(struct seq_file *m, loff_t *pos) { struct ftrace_iterator *iter = m->private; void *p = NULL; loff_t l; if (!(iter->flags & FTRACE_ITER_DO_HASH)) return NULL; if (iter->func_pos > *pos) return NULL; iter->hidx = 0; for (l = 0; l <= (*pos - iter->func_pos); ) { p = t_hash_...
0
18,165
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gboolean webkit_web_view_can_copy_clipboard(WebKitWebView* webView) { g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), FALSE); Frame* frame = core(webView)->focusController()->focusedOrMainFrame(); return frame->editor()->canCopy() || frame->editor()->canDHTMLCopy(); } Commit Message: 2011-06-02 J...
0
3,546
Analyze the following 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_rd_pa_reply(krb5_context context, const char *realm, void *c, krb5_enctype etype, const krb5_krbhst_info *hi, unsigned nonce, const krb5_data *req_buffer, PA_DATA *pa, krb5_keyblock **key) { krb5_pk_init_ctx ctx = c; krb5_error_code ret; ...
0
17,640
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool BaseMultipleFieldsDateAndTimeInputType::hasBadInput() const { DateTimeEditElement* edit = dateTimeEditElement(); return element()->value().isEmpty() && edit && edit->anyEditableFieldsHaveValues(); } Commit Message: Fix reentrance of BaseMultipleFieldsDateAndTimeInputType::destroyShadowSubtree. dest...
0
4,863
Analyze the following 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 XPointer alloc_mem_cache(void) { struct mem_cache_str *cache; /* note that an error will go unnoticed */ cache = (struct mem_cache_str *) Xmalloc(sizeof(struct mem_cache_str)); if (cache) { cache->display_closed = False; cache->inter_data = NULL; cache->inter_data_count = 0; cache->rep...
0
22,396