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: void VaapiVideoDecodeAccelerator::SurfaceReady( const scoped_refptr<VaapiDecodeSurface>& dec_surface) { if (!task_runner_->BelongsToCurrentThread()) { task_runner_->PostTask( FROM_HERE, base::Bind(&VaapiVideoDecodeAccelerator::SurfaceReady, weak_this_, dec_surface))...
0
29,380
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: HTMLCanvasElement* Document::getCSSCanvasElement(const String& name) { RefPtr<HTMLCanvasElement>& element = m_cssCanvasElements.add(name, 0).iterator->value; if (!element) element = HTMLCanvasElement::create(this); return element.get(); } Commit Message: Unreviewed, rolling out r147402. http:...
0
27,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: AP_DECLARE(void) ap_add_version_component(apr_pool_t *pconf, const char *component) { if (! banner_locked) { /* * If the version string is null, register our cleanup to reset the * pointer on pool destruction. We also know that, if NULL, * we are adding the original SERVER_B...
0
664
Analyze the following 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 pgoff_t vma_hugecache_offset(struct hstate *h, struct vm_area_struct *vma, unsigned long address) { return ((address - vma->vm_start) >> huge_page_shift(h)) + (vma->vm_pgoff >> huge_page_order(h)); } Commit Message: hugetlb: fix resv_map leak in error path When called for anonymous (non-shared) ma...
0
2,648
Analyze the following 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 eth_can_rx(NetClientState *nc) { struct xlx_ethlite *s = qemu_get_nic_opaque(nc); unsigned int rxbase = s->rxbuf * (0x800 / 4); return !(s->regs[rxbase + R_RX_CTRL0] & CTRL_S); } Commit Message: CWE ID: CWE-119
0
6,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: static inline int nd_alloc_stack(struct nameidata *nd) { if (likely(nd->depth != EMBEDDED_LEVELS)) return 0; if (likely(nd->stack != nd->internal)) return 0; return __nd_alloc_stack(nd); } Commit Message: vfs: Test for and handle paths that are unreachable from their mnt_root In rare cases a directory...
0
8,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: static int ext4_blkdev_put(struct block_device *bdev) { bd_release(bdev); return blkdev_put(bdev, FMODE_READ|FMODE_WRITE); } Commit Message: ext4: use ext4_get_block_write in buffer write Allocate uninitialized extent before ext4 buffer write and convert the extent to initialized after io completes. The purpo...
0
20,189
Analyze the following 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 ssl_parse_certificate_request( mbedtls_ssl_context *ssl ) { const mbedtls_ssl_ciphersuite_t *ciphersuite_info = ssl->transform_negotiate->ciphersuite_info; MBEDTLS_SSL_DEBUG_MSG( 2, ( "=> parse certificate request" ) ); if( ! mbedtls_ssl_ciphersuite_cert_req_allowed( ciphersuite_i...
0
13,303
Analyze the following 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 CloudPolicyCacheBase::AddObserver(Observer* observer) { observer_list_.AddObserver(observer); } 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-id: svn://svn.chromium.o...
0
16,340
Analyze the following 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 ide_cfata_identify_size(IDEState *s) { uint16_t *p = (uint16_t *)s->identify_data; put_le16(p + 7, s->nb_sectors >> 16); /* Sectors per card */ put_le16(p + 8, s->nb_sectors); /* Sectors per card */ put_le16(p + 60, s->nb_sectors); /* Total LBA sectors */ put_le16(p +...
0
6,517
Analyze the following 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 trace_printk_start_stop_comm(int enabled) { if (!buffers_allocated) return; if (enabled) tracing_start_cmdline_record(); else tracing_stop_cmdline_record(); } Commit Message: Merge tag 'trace-v4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing fixes...
0
3,688
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ProcUnmapWindow(ClientPtr client) { WindowPtr pWin; REQUEST(xResourceReq); int rc; REQUEST_SIZE_MATCH(xResourceReq); rc = dixLookupWindow(&pWin, stuff->id, client, DixHideAccess); if (rc != Success) return rc; UnmapWindow(pWin, FALSE); /* update cache to say it is mapped ...
0
11,805
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: CommandBuffer::State CommandBufferProxyImpl::GetLastState() { base::AutoLock lock(last_state_lock_); TryUpdateState(); return last_state_; } Commit Message: Correct mojo::WrapSharedMemoryHandle usage Fixes some incorrect uses of mojo::WrapSharedMemoryHandle which were assuming that the call actually has a...
0
18,121
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: find_auth_end (FlatpakProxyClient *client, Buffer *buffer) { guchar *match; int i; /* First try to match any leftover at the start */ if (client->auth_end_offset > 0) { gsize left = strlen (AUTH_END_STRING) - client->auth_end_offset; gsize to_match = MIN (left, buffer->pos); /* ...
1
5,171
Analyze the following 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 FrameLoader::didLayout(LayoutMilestones milestones) { m_client->dispatchDidLayout(milestones); } Commit Message: Don't wait to notify client of spoof attempt if a modal dialog is created. BUG=281256 TEST=See bug for repro steps. Review URL: https://chromiumcodereview.appspot.com/23620020 git-svn-id: ...
0
4,019
Analyze the following 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 IsStrongEtag(const std::string& etag) { return etag.size() > 2 && etag[0] == '"'; } Commit Message: Simplify "WouldTaintOrigin" concept in media/blink Currently WebMediaPlayer has three predicates: - DidGetOpaqueResponseFromServiceWorker - HasSingleSecurityOrigin - DidPassCORSAccessCheck . These are u...
0
6,651
Analyze the following 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::CanBookmarkAllTabs() const { BookmarkModel* model = profile()->GetBookmarkModel(); return (model && model->IsLoaded() && (tab_count() > 1)); } Commit Message: Rename the TabContentWrapper pieces to be "TabHelper"s. (Except for the PasswordManager... for now.) Also, just pre-create them up-front...
0
19,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: static int veth_set_tx_csum(struct net_device *dev, u32 data) { if (data) dev->features |= NETIF_F_NO_CSUM; else dev->features &= ~NETIF_F_NO_CSUM; return 0; } Commit Message: veth: Dont kfree_skb() after dev_forward_skb() In case of congestion, netif_rx() frees the skb, so we must assume dev_forward_skb...
0
16,556
Analyze the following 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 TreeView::GetAccessibleState(ui::AccessibleViewState* state) { state->role = ui::AccessibilityTypes::ROLE_OUTLINE; state->state = ui::AccessibilityTypes::STATE_READONLY; } Commit Message: Add OVERRIDE to ui::TreeModelObserver overridden methods. BUG=None TEST=None R=sky@chromium.org Review URL: http:...
0
20,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: static void update_idle_timeout(h2o_http2_conn_t *conn) { h2o_timeout_unlink(&conn->_timeout_entry); if (conn->num_streams.pull.half_closed + conn->num_streams.push.half_closed == 0) { assert(h2o_linklist_is_empty(&conn->_pending_reqs)); conn->_timeout_entry.cb = on_idle_timeout; ...
0
6,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: void PermissionsData::ClearTabSpecificPermissions(int tab_id) const { AutoLockOnValidThread lock(runtime_lock_, thread_checker_.get()); CHECK_GE(tab_id, 0); tab_specific_permissions_.erase(tab_id); } Commit Message: Call CanCaptureVisiblePage in page capture API. Currently the pageCapture permission allow...
0
12,113
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: memcheck_seq_cmp(MEMCHECK *m1, MEMCHECK *m2) { return m1->seq_num - m2->seq_num; } Commit Message: When opening files for write, ensure they aren't symbolic links Issue #1048 identified that if, for example, a non privileged user created a symbolic link from /etc/keepalvied.data to /etc/passwd, writing to /etc...
0
12,680
Analyze the following 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 HB_Error Load_MarkArray ( HB_MarkArray* ma, HB_Stream stream ) { HB_Error error; HB_UShort n, m, count; HB_UInt cur_offset, new_offset, base_offset; HB_MarkRecord* mr; base_offset = FILE_Pos(); if ( ACCESS_Frame( 2L ) ) return error; count = ma->MarkCo...
0
9,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: gst_asf_demux_check_first_ts (GstASFDemux * demux, gboolean force) { if (G_UNLIKELY (!GST_CLOCK_TIME_IS_VALID (demux->first_ts))) { GstClockTime first_ts = GST_CLOCK_TIME_NONE; int i; /* go trhough each stream, find smallest timestamp */ for (i = 0; i < demux->num_streams; ++i) { AsfStrea...
0
27,130
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool ContentSecurityPolicy::allowRequest( WebURLRequest::RequestContext context, const KURL& url, const String& nonce, const IntegrityMetadataSet& integrityMetadata, ParserDisposition parserDisposition, RedirectStatus redirectStatus, SecurityViolationReportingPolicy reportingPolicy) co...
0
11,512
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static struct nlm_lockowner *__nlm_find_lockowner(struct nlm_host *host, fl_owner_t owner) { struct nlm_lockowner *lockowner; list_for_each_entry(lockowner, &host->h_lockowners, list) { if (lockowner->owner != owner) continue; return nlm_get_lockowner(lockowner); } return NULL; } Commit Message: NLM: ...
0
27,176
Analyze the following 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 jpc_qmfb_join_col(jpc_fix_t *a, int numrows, int stride, int parity) { int bufsize = JPC_CEILDIVPOW2(numrows, 1); jpc_fix_t joinbuf[QMFB_JOINBUFSIZE]; jpc_fix_t *buf = joinbuf; register jpc_fix_t *srcptr; register jpc_fix_t *dstptr; register int n; int hstartcol; /* Allocate memory for the join b...
0
2,797
Analyze the following 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 doubleAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); TestObjectPythonV8Internal::doubleAttributeAttributeGetter(info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); } C...
0
672
Analyze the following 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 WebMediaPlayerImpl::ExitedFullscreen() { overlay_info_.is_fullscreen = false; if (!always_enable_overlays_ && overlay_enabled_) DisableOverlay(); if (!decoder_requires_restart_for_overlay_) MaybeSendOverlayInfoToDecoder(); } Commit Message: Simplify "WouldTaintOrigin" concept in media/blink ...
0
11,436
Analyze the following 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 HTMLInputElement::value() const { String value; if (m_inputType->getTypeSpecificValue(value)) return value; value = m_valueIfDirty; if (!value.isNull()) return value; AtomicString valueString = fastGetAttribute(valueAttr); value = sanitizeValue(valueString); if...
0
11,027
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void QuotaManager::DidSetTemporaryGlobalOverrideQuota( const QuotaCallback& callback, const int64* new_quota, bool success) { QuotaStatusCode status = kQuotaErrorInvalidAccess; DidDatabaseWork(success); if (success) { temporary_quota_override_ = *new_quota; status = kQuotaStatusOk; } ...
0
3,667
Analyze the following 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(setdomainname, char __user *, name, int, len) { int errno; char tmp[__NEW_UTS_LEN]; if (!ns_capable(current->nsproxy->uts_ns->user_ns, CAP_SYS_ADMIN)) return -EPERM; if (len < 0 || len > __NEW_UTS_LEN) return -EINVAL; down_write(&uts_sem); errno = -EFAULT; if (!copy_from_user(tmp, nam...
0
29,575
Analyze the following 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 LoadExtensionFromPath(const base::FilePath& path) { ExtensionService* service = extensions::ExtensionSystem::Get( browser()->profile())->extension_service(); size_t num_before = service->extensions()->size(); { content::NotificationRegistrar registrar; registrar.Add(this, ch...
0
24,319
Analyze the following 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_cert(char *filename, X509 **retcert) { X509 *cert = NULL; BIO *tmp = NULL; int code; krb5_error_code retval; if (filename == NULL || retcert == NULL) return EINVAL; *retcert = NULL; tmp = BIO_new(BIO_s_file()); if (tmp == NULL) return ENOMEM; code = BIO_...
0
28,504
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: copy_prev_row(Jbig2Image *image, int row) { if (!row) { /* no previous row */ memset(image->data, 0, image->stride); } else { /* duplicate data from the previous row */ uint8_t *src = image->data + (row - 1) * image->stride; memcpy(src + image->stride, src, image->...
0
25,387
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: decompileENUMERATE(int n, SWF_ACTION *actions, int maxn, int is_type2) { int i=0; while (i < maxn && i < 5 && OpCode(actions, n+i, maxn)) i++; INDENT println("/* a for-var-in loop should follow below: */" ); return i-1; // preserve some code for decompileIF()... } // ... and let decompileIF() do...
0
24,414
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PassRefPtrWillBeRawPtr<NodeIterator> Document::createNodeIterator(Node* root, unsigned whatToShow, PassRefPtrWillBeRawPtr<NodeFilter> filter, ExceptionState& exceptionState) { return NodeIterator::create(root, whatToShow, filter); } Commit Message: Don't change Document load progress in any page dismissal ev...
0
19,064
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void Reinitialize(ReinitTestCase test_case) { feature_list_.InitAndEnableFeature(network::features::kNetworkService); ASSERT_TRUE(temp_directory_.CreateUniqueTempDir()); AppCacheDatabase db(temp_directory_.GetPath().AppendASCII("Index")); EXPECT_TRUE(db.LazyOpen(true)); if (test_case == C...
1
14,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: int URI_FUNC(ComposeQueryEngine)(URI_CHAR * dest, const URI_TYPE(QueryList) * queryList, int maxChars, int * charsWritten, int * charsRequired, UriBool spaceToPlus, UriBool normalizeBreaks) { UriBool firstItem = URI_TRUE; int ampersandLen = 0; /* increased to 1 from second item on */ URI_CHAR * write = ...
1
9,490
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void HTMLMediaElement::SourceWasAdded(HTMLSourceElement* source) { BLINK_MEDIA_LOG << "sourceWasAdded(" << (void*)this << ", " << source << ")"; KURL url = source->GetNonEmptyURLAttribute(srcAttr); BLINK_MEDIA_LOG << "sourceWasAdded(" << (void*)this << ") - 'src' is " << UrlForLoggingMedi...
0
3,023
Analyze the following 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 UnpackWPGRaster(Image *image,int bpp) { int x, y, i; unsigned char bbuf, *BImgBuff, RunCount; ssize_t ldblk; x=0; y=0; ldblk=(ssize_t) ((bpp*image->columns+7)/8); BImgBuff=(unsigned char *) AcquireQuantumMemory((size_t) ldblk, 8*sizeof(*BImgBuff)); if...
0
8,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: static int vmx_get_cpl(struct kvm_vcpu *vcpu) { struct vcpu_vmx *vmx = to_vmx(vcpu); if (unlikely(vmx->rmode.vm86_active)) return 0; else { int ar = vmx_read_guest_seg_ar(vmx, VCPU_SREG_SS); return AR_DPL(ar); } } Commit Message: x86,kvm,vmx: Preserve CR4 across VM entry CR4 isn't constant; at least ...
0
15,944
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void Browser::OnIsPageTranslatedChanged(content::WebContents* source) { DCHECK(source); if (tab_strip_model_->GetActiveWebContents() == source) { window_->SetTranslateIconToggled( ChromeTranslateClient::FromWebContents( source)->GetLanguageState().IsPageTranslated()); } } Commit Mes...
0
26,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 int get_snippetargs(struct snippetargs **sap) { int c; struct snippetargs **prevp = sap; struct snippetargs *sa = NULL; struct buf arg = BUF_INITIALIZER; uint32_t uid; char *intname = NULL; c = prot_getc(imapd_in); if (c != '(') goto syntax_error; for (;;) { c ...
0
3,590
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int usb_unlocked_disable_lpm(struct usb_device *udev) { return 0; } Commit Message: USB: fix invalid memory access in hub_activate() Commit 8520f38099cc ("USB: change hub initialization sleeps to delayed_work") changed the hub_activate() routine to make part of it run in a workqueue. However, the commit faile...
0
23,011
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int validate_group(struct perf_event *event) { struct perf_event *leader = event->group_leader; struct cpu_hw_events *fake_cpuc; int ret, n; ret = -ENOMEM; fake_cpuc = kmalloc(sizeof(*fake_cpuc), GFP_KERNEL | __GFP_ZERO); if (!fake_cpuc) goto out; /* * the event is not yet connected with its ...
0
13,559
Analyze the following 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 insert_free_list(struct cache *cache, struct cache_entry *entry) { if(cache->free_list) { entry->free_next = cache->free_list; entry->free_prev = cache->free_list->free_prev; cache->free_list->free_prev->free_next = entry; cache->free_list->free_prev = entry; } else { cache->free_list = entry; ...
0
27,569
Analyze the following 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 nfs4_lock_delegation_recall(struct nfs4_state *state, struct file_lock *fl) { struct nfs_server *server = NFS_SERVER(state->inode); struct nfs4_exception exception = { }; int err; err = nfs4_set_lock_state(state, fl); if (err != 0) goto out; do { err = _nfs4_do_setlk(state, F_SETLK, fl, NFS_LOCK_NE...
0
28,305
Analyze the following 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::clearFocusedElement() { setFocusedElement(nullptr, FocusParams(SelectionBehaviorOnFocus::None, WebFocusTypeNone, nullptr)); } Commit Message: Change Document::detach() to RELEASE_ASSERT all subframes are gone. BUG=556724,577105 Review URL: https://codereview.chromium.org/1667573002 Cr-Commi...
0
769
Analyze the following 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 Parcel::readInt64Vector(std::unique_ptr<std::vector<int64_t>>* val) const { return readNullableTypedVector(val, &Parcel::readInt64); } Commit Message: Add bound checks to utf16_to_utf8 Bug: 29250543 Change-Id: I518e7b2fe10aaa3f1c1987586a09b1110aff7e1a (cherry picked from commit 7e93b2ddcb49b5365fbe1da...
0
17,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: ObjectState(v8::Handle<v8::Object> object, StateBase* next) : AbstractObjectState(object, next) { } Commit Message: Replace further questionable HashMap::add usages in bindings BUG=390928 R=dcarney@chromium.org Review URL: https://codereview.chromium.org/411273002 git-svn-i...
0
13,138
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xsltReleaseLocalRVTs(xsltTransformContextPtr ctxt, xmlDocPtr base) { xmlDocPtr cur = ctxt->localRVT, tmp; while ((cur != NULL) && (cur != base)) { if (cur->psvi == (void *) ((long) 1)) { cur = (xmlDocPtr) cur->next; } else { tmp = cur; cur = (xmlDocPtr) cur->next; if (tmp == ctxt->...
0
18,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: test_bson_append_int64 (void) { bson_t *b; bson_t *b2; b = bson_new (); BSON_ASSERT (bson_append_int64 (b, "a", -1, 100000000000000ULL)); b2 = get_bson ("test34.bson"); BSON_ASSERT_BSON_EQUAL (b, b2); bson_destroy (b); bson_destroy (b2); } Commit Message: Fix for CVE-2018-16790 -- Verify...
0
7,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 vmx_set_nmi_mask(struct kvm_vcpu *vcpu, bool masked) { struct vcpu_vmx *vmx = to_vmx(vcpu); vmx->loaded_vmcs->nmi_known_unmasked = !masked; if (masked) vmcs_set_bits(GUEST_INTERRUPTIBILITY_INFO, GUEST_INTR_STATE_NMI); else vmcs_clear_bits(GUEST_INTERRUPTIBILITY_INFO, GUEST_INTR_S...
0
27,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: bool MessageLoopForIO::WaitForIOCompletion(DWORD timeout, IOHandler* filter) { return ToPumpIO(pump_.get())->WaitForIOCompletion(timeout, filter); } Commit Message: Introduce RunLoop::Type::NESTABLE_TASKS_ALLOWED to replace MessageLoop::ScopedNestableTaskAllower. (as well as MessageLoop::SetNestableTasksAllow...
0
2,830
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: encode_SET_VLAN_PCP(const struct ofpact_vlan_pcp *vlan_pcp, enum ofp_version ofp_version, struct ofpbuf *out) { uint8_t pcp = vlan_pcp->vlan_pcp; /* Push a VLAN tag, if none is present and this form of the action calls * for such a feature. */ if (ofp_version > OFP10_VERSION ...
0
6,802
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: _bdf_parse_start( char* line, unsigned long linelen, unsigned long lineno, void* call_data, void* client_data ) { unsigned long slen; _bdf_line_func_t* next; _bdf_parse_t* p; ...
0
19,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: smb_init_nttransact(const __u16 sub_command, const int setup_count, const int parm_len, struct cifs_tcon *tcon, void **ret_buf) { int rc; __u32 temp_offset; struct smb_com_ntransact_req *pSMB; rc = small_smb_init(SMB_COM_NT_TRANSACT, 19 + setup_count, tcon, (void **)&pSMB); if (rc) return rc...
0
21,575
Analyze the following 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 DevToolsSession::MojoConnectionDestroyed() { binding_.Close(); session_ptr_.reset(); io_session_ptr_.reset(); } Commit Message: DevTools: speculative fix for crash in NetworkHandler::Disable This keeps BrowserContext* and StoragePartition* instead of RenderProcessHost* in an attemp to resolve UAF of ...
0
24,472
Analyze the following 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 sta_info_cleanup_expire_buffered_ac(struct ieee80211_local *local, struct sta_info *sta, int ac) { unsigned long flags; struct sk_buff *skb; /* * First check for frames that should expire on the filtered * queue. Frames here were rejected by the driver and are on * a separate queue to ...
0
9,356
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropertyID propertyID) const { return getPropertyCSSValue(propertyID, UpdateLayout); } Commit Message: Rename isPositioned to isOutOfFlowPositioned for clarity https://bugs.webkit.org/show_bug.cgi?id=89836 Reviewed by Antti Koivisto. ...
0
22,111
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static ZEND_RESULT_CODE to_utf16(parse_mb_func fn, const char *u8, uint16_t **u16, size_t *len TSRMLS_DC) { size_t offset = 0, u8_len = strlen(u8); *u16 = ecalloc(4 * sizeof(uint16_t), u8_len + 1); *len = 0; while (offset < u8_len) { unsigned wc; uint16_t buf[2], *ptr = buf; size_t consumed = fn(&wc, ...
0
26,861
Analyze the following 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 Camera2Client::unlock() { ATRACE_CALL(); ALOGV("%s: E", __FUNCTION__); Mutex::Autolock icl(mBinderSerializationLock); ALOGV("%s: Camera %d: Unlock call from pid %d; current client pid %d", __FUNCTION__, mCameraId, getCallingPid(), mClientPid); if (mClientPid == getCallingPid())...
0
23
Analyze the following 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 limitedWithInvalidAndMissingDefaultAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; ...
0
15,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: megasas_read_fw_status_reg_xscale(struct megasas_instance *instance) { return readl(&instance->reg_set->outbound_msg_0); } Commit Message: scsi: megaraid_sas: return error when create DMA pool failed when create DMA pool for cmd frames failed, we should return -ENOMEM, instead of 0. In some case in: megas...
0
7,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: void *ASN1_d2i_bio(void *(*xnew) (void), d2i_of_void *d2i, BIO *in, void **x) { BUF_MEM *b = NULL; const unsigned char *p; void *ret = NULL; int len; len = asn1_d2i_read_bio(in, &b); if (len < 0) goto err; p = (unsigned char *)b->data; ret = d2i(x, &p, len); err: BUF...
0
21,676
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void gfs2_size_hint(struct file *filep, loff_t offset, size_t size) { struct inode *inode = file_inode(filep); struct gfs2_sbd *sdp = GFS2_SB(inode); struct gfs2_inode *ip = GFS2_I(inode); size_t blks = (size + sdp->sd_sb.sb_bsize - 1) >> sdp->sd_sb.sb_bsize_shift; int hint = min_t(size_t, INT_MAX, bl...
0
21,912
Analyze the following 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 get_block_rate(MpegEncContext *s, int16_t block[64], int block_last_index, uint8_t scantable[64]) { int last = 0; int j; int rate = 0; for (j = 1; j <= block_last_index; j++) { const int index = scantable[j]; int level = block[ind...
0
1,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: UserCloudPolicyManagerChromeOS::~UserCloudPolicyManagerChromeOS() {} Commit Message: Make the policy fetch for first time login blocking The CL makes policy fetching for first time login blocking for all users, except the ones that are known to be non-enterprise users. BUG=334584 Review URL: https://coderevie...
0
7,084
Analyze the following 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 p4_hw_watchdog_set_attr(struct perf_event_attr *wd_attr) { /* * Watchdog ticks are special on Netburst, we use * that named "non-sleeping" ticks as recommended * by Intel SDM Vol3b. */ WARN_ON_ONCE(wd_attr->type != PERF_TYPE_HARDWARE || wd_attr->config != PERF_COUNT_HW_CPU_CYCLES); ...
0
1,274
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: CMYKGrayEncoder::~CMYKGrayEncoder() { if (str->isEncoder()) delete str; } Commit Message: CWE ID: CWE-119
0
3,439
Analyze the following 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 Reset() { loop_runner_ = new content::MessageLoopRunner(); } Commit Message: Disable AutofillInteractiveTest.OnChangeAfterAutofill test. Failing due to http://src.chromium.org/viewvc/blink?view=revision&revision=170278. BUG=353691 TBR=isherman@chromium.org, dbeam@chromium.org Review URL: https://...
0
18,263
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int BrowserWindowGtk::GetVerticalOffset() { return (IsMaximized() || (!UseCustomFrame())) ? -kCustomFrameBackgroundVerticalOffset : 0; } Commit Message: Remove TabContents from TabStripModelObserver::TabDetachedAt. BUG=107201 TEST=no visible change Review URL: https://chromiumcodereview.appspot.com/11...
0
23,915
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool appendFileInfo(const File* file, int* index) { if (!m_blobInfo) return false; long long size = -1; double lastModified = invalidFileTime(); file->captureSnapshot(size, lastModified); *index = m_blobInfo->size(); m_blobInfo->append(blink::We...
0
26,754
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: user_get_user_name (User *user) { return accounts_user_get_user_name (ACCOUNTS_USER (user)); } Commit Message: CWE ID: CWE-22
0
10,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: ssize_t IMemory::offset() const { ssize_t offset; getMemory(&offset); return offset; } Commit Message: Sanity check IMemory access versus underlying mmap Bug 26877992 Change-Id: Ibbf4b1061e4675e4e96bc944a865b53eaf6984fe CWE ID: CWE-264
0
20,487
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: HandleRegisterDNSMessage(void) { DWORD err; HANDLE thread = NULL; /* Delegate this job to a sub-thread */ thread = CreateThread(NULL, 0, RegisterDNS, NULL, 0, NULL); /* * We don't add these thread handles to the undo list -- the thread and * processes it spawns are all supposed to ...
0
2,905
Analyze the following 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 vorbis_book_decodev_set(codebook *book,ogg_int32_t *a, oggpack_buffer *b,int n,int point){ if(book->used_entries>0){ ogg_int32_t *v = book->dec_buf;//(ogg_int32_t *)alloca(sizeof(*v)*book->dim); int i,j; if (!v) return -1; for(i=0;i<n;){ if(decode_map(book,b,v,point))...
1
6,596
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void get_global(u_int cmd, struct au1200_lcd_global_regs_t *pdata) { unsigned int hi1, divider; pdata->xsize = ((lcd->screen & LCD_SCREEN_SX) >> 19) + 1; pdata->ysize = ((lcd->screen & LCD_SCREEN_SY) >> 8) + 1; pdata->backcolor = lcd->backcolor; pdata->colorkey = lcd->colorkey; pdata->mask = lcd->c...
0
18,972
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void OnBeforeHeadersSent(const ProxyInfo& proxy_info, HttpRequestHeaders* request_headers) { observed_before_headers_sent_ = true; if (!proxy_info.is_http() && !proxy_info.is_https() && !proxy_info.is_quic()) { return; } observed_before_headers_sent_with_...
0
20,918
Analyze the following 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 ProcessAllPendingMessages() { loop_.RunAllPending(); } Commit Message: Refactors to simplify rename pathway in DownloadFileManager. This is https://chromiumcodereview.appspot.com/10668004 / r144817 (reverted due to CrOS failure) with the completion logic moved to after the auto-opening. The test...
0
10,734
Analyze the following 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 crypto_authenc_module_init(void) { return crypto_register_template(&crypto_authenc_tmpl); } Commit Message: crypto: include crypto- module prefix in template This adds the module loading prefix "crypto-" to the template lookup as well. For example, attempting to load 'vfat(blowfish)' via AF_...
0
18,019
Analyze the following 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 vnc_write_u8(VncState *vs, uint8_t value) { vnc_write(vs, (char *)&value, 1); } Commit Message: CWE ID: CWE-264
0
6,461
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ui::PageTransition GetTransitionType(ui::PageTransition default_transition, bool replaces_current_item, bool is_main_frame, WebNavigationType navigation_type) { if (replaces_current_item && !is_main_fr...
0
20,255
Analyze the following 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::enableNetworkInformation(bool enable) { RuntimeEnabledFeatures::setNetworkInformationEnabled(enable); } Commit Message: Remove SpeechSynthesis runtime flag (status=stable) BUG=402536 Review URL: https://codereview.chromium.org/482273005 git-svn-id: svn://svn.chromium.org/blink/tru...
0
20,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: static struct sk_buff *fm10k_fetch_rx_buffer(struct fm10k_ring *rx_ring, union fm10k_rx_desc *rx_desc, struct sk_buff *skb) { unsigned int size = le16_to_cpu(rx_desc->w.length); struct fm10k_rx_buffer *rx_buffer; struct page *page; rx_buffer = &rx_ring->rx_buffer[rx_ring->next_to_clean]; ...
0
7,293
Analyze the following 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 Element::webkitMatchesSelector(const String& selector, ExceptionCode& ec) { if (selector.isEmpty()) { ec = SYNTAX_ERR; return false; } SelectorQuery* selectorQuery = document()->selectorQueryCache()->add(selector, document(), ec); if (!selectorQuery) return false; ...
0
7,651
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bsearch_2short(short e1, short *ent1, short e2, short *ent2, int base, short *indexarray, int nent) { int n = nent; int k = 0; int e = e1 * base + e2; while (n > 0) { int nn = n / 2; int idx = indexarray[k + nn]; int ne = ent1[idx] * base + ent2[idx]; if (ne == e) { k += nn; ...
0
25,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: void rd_module_exit(void) { transport_subsystem_release(&rd_mcp_template); } Commit Message: target/rd: Refactor rd_build_device_space + rd_release_device_space This patch refactors rd_build_device_space() + rd_release_device_space() into rd_allocate_sgl_table() + rd_release_device_space() so that they may be ...
0
28,677
Analyze the following 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 macvtap_forward(struct net_device *dev, struct sk_buff *skb) { struct macvtap_queue *q = macvtap_get_queue(dev, skb); if (!q) goto drop; if (skb_queue_len(&q->sk.sk_receive_queue) >= dev->tx_queue_len) goto drop; skb_queue_tail(&q->sk.sk_receive_queue, skb); wake_up_interruptible_poll(sk_sle...
0
7,242
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void *Type_Signature_Read(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, cmsUInt32Number* nItems, cmsUInt32Number SizeOfTag) { cmsSignature* SigPtr = (cmsSignature*) _cmsMalloc(self ->ContextID, sizeof(cmsSignature)); if (SigPtr == NULL) return NULL; if (!_cmsReadUInt32Number(io, SigPtr)) r...
0
7,864
Analyze the following 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::IsDialogButtonEnabled(ui::DialogButton button) const { return delegate_->IsDialogButtonEnabled(button); } 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: CWE-20
0
7,868
Analyze the following 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 Automation::GetCookiesDeprecated(int tab_id, const GURL& gurl, std::string* cookies, bool* success) { int windex = 0, tab_index = 0; scoped_ptr<Error> error(GetIndicesForTab(tab_id, &windex, ...
0
8,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: SCTP_STATIC int sctp_do_peeloff(struct sctp_association *asoc, struct socket **sockp) { struct sock *sk = asoc->base.sk; struct socket *sock; struct inet_sock *inetsk; int err = 0; /* An association cannot be branched off from an already peeled-off * socket, nor is this supported for tcp style sockets...
0
9,060
Analyze the following 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 udf_destroy_inode(struct inode *inode) { call_rcu(&inode->i_rcu, udf_i_callback); } Commit Message: udf: Avoid run away loop when partition table length is corrupted Check provided length of partition table so that (possibly maliciously) corrupted partition table cannot cause accessing data beyond ...
0
15,625
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: asmlinkage void do_fpe(struct pt_regs *regs, unsigned long fcr31) { siginfo_t info = {0}; if (notify_die(DIE_FP, "FP exception", regs, 0, regs_to_trapnr(regs), SIGFPE) == NOTIFY_STOP) return; die_if_kernel("FP exception in kernel code", regs); if (fcr31 & FPU_CSR_UNI_X) { int sig; void __user *fa...
0
4,425
Analyze the following 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 SoftAMR::onReset() { mSignalledError = false; mOutputPortSettingsChange = NONE; } Commit Message: SoftAMR: check output buffer size to avoid overflow. Bug: 27662364 Change-Id: I7b26892c41d6f2e690e77478ab855c2fed1ff6b0 CWE ID: CWE-264
0
23,665
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: CommonNavigationParams MakeCommonNavigationParams( const WebSecurityOrigin& current_origin, std::unique_ptr<blink::WebNavigationInfo> info, int load_flags, bool has_download_sandbox_flag, bool from_ad) { DCHECK(!info->url_request.RequestorOrigin().IsNull()); Referrer referrer( GURL(...
0
8,004
Analyze the following 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 dump_mem(const char *lvl, const char *str, unsigned long bottom, unsigned long top) { unsigned long first; mm_segment_t fs; int i; /* * We need to switch to kernel mode so that we can use __get_user * to safely read from kernel space. Note that we now dump the * code first, just in ...
0
9,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: virtual status_t dequeueBuffer(int *buf, sp<Fence>* fence, bool async, uint32_t width, uint32_t height, PixelFormat format, uint32_t usage) { Parcel data, reply; data.writeInterfaceToken(IGraphicBufferProducer::getInterfaceDescriptor()); data.writeInt32(static_cast<int32_t>(async)); da...
0
9,285