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: long Chapters::Display::Parse( IMkvReader* pReader, long long pos, long long size) { const long long stop = pos + size; while (pos < stop) { long long id, size; long status = ParseElementHeader( pReader, pos, ...
1
28,839
Analyze the following 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_DEFINE1(inotify_init1, int, flags) { struct fsnotify_group *group; struct user_struct *user; int ret; /* Check the IN_* constants for consistency. */ BUILD_BUG_ON(IN_CLOEXEC != O_CLOEXEC); BUILD_BUG_ON(IN_NONBLOCK != O_NONBLOCK); if (flags & ~(IN_CLOEXEC | IN_NONBLOCK)) return -EINVAL; user ...
1
11,079
Analyze the following 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 rdma_resolve_route(struct rdma_cm_id *id, int timeout_ms) { struct rdma_id_private *id_priv; int ret; id_priv = container_of(id, struct rdma_id_private, id); if (!cma_comp_exch(id_priv, RDMA_CM_ADDR_RESOLVED, RDMA_CM_ROUTE_QUERY)) return -EINVAL; atomic_inc(&id_priv->refcount); switch (rdma_node_get...
0
27,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: PHP_FUNCTION(openssl_encrypt) { zend_long options = 0, tag_len = 16; char *data, *method, *password, *iv = "", *aad = ""; size_t data_len, method_len, password_len, iv_len = 0, aad_len = 0; zval *tag = NULL; const EVP_CIPHER *cipher_type; EVP_CIPHER_CTX *cipher_ctx; struct php_openssl_cipher_mode mode; in...
0
12,570
Analyze the following 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 license_free(rdpLicense* license) { if (license) { free(license->Modulus); certificate_free(license->certificate); license_free_product_info(license->ProductInfo); license_free_binary_blob(license->ErrorInfo); license_free_binary_blob(license->KeyExchangeList); license_free_binary_blob(license-...
0
13,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 enum test_return test_binary_incrq(void) { return test_binary_incr_impl("test_binary_incrq", PROTOCOL_BINARY_CMD_INCREMENTQ); } Commit Message: Issue 102: Piping null to the server will crash it CWE ID: CWE-20
0
17,700
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void ServiceWorkerContextCore::ClearAllServiceWorkersForTest( base::OnceClosure callback) { DCHECK_CURRENTLY_ON(BrowserThread::IO); auto helper = base::MakeRefCounted<ClearAllServiceWorkersHelper>(std::move(callback)); if (!was_service_worker_registered_) return; was_service_worker_registere...
0
9,148
Analyze the following 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 AudioHandler::AdjustVolumeByPercent(double adjust_by_percent) { const double old_volume_db = mixer_->GetVolumeDb(); const double old_percent = VolumeDbToPercent(old_volume_db); SetVolumePercent(old_percent + adjust_by_percent); } Commit Message: chromeos: Move audio, power, and UI files into subdirs. ...
0
19,448
Analyze the following 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(date_create) { zval *timezone_object = NULL; char *time_str = NULL; int time_str_len = 0; zval datetime_object; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) { R...
0
15,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 mxf_get_stream_index(AVFormatContext *s, KLVPacket *klv, int body_sid) { int i; for (i = 0; i < s->nb_streams; i++) { MXFTrack *track = s->streams[i]->priv_data; /* SMPTE 379M 7.3 */ if (track && (!body_sid || !track->body_sid || track->body_sid == body_sid) && !memcmp(...
0
7,719
Analyze the following 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 i8042_pm_thaw(struct device *dev) { i8042_interrupt(0, NULL); return 0; } Commit Message: Input: i8042 - fix crash at boot time The driver checks port->exists twice in i8042_interrupt(), first when trying to assign temporary "serio" variable, and second time when deciding whether it should call se...
0
13,193
Analyze the following 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 rewind_dns_packet(DnsPacketRewinder *rewinder) { if (rewinder->packet) dns_packet_rewind(rewinder->packet, rewinder->saved_rindex); } Commit Message: resolved: bugfix of null pointer p->question dereferencing (#6020) See https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/...
0
15,253
Analyze the following 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 rm_read_header(AVFormatContext *s) { RMDemuxContext *rm = s->priv_data; AVStream *st; AVIOContext *pb = s->pb; unsigned int tag; int tag_size; unsigned int start_time, duration; unsigned int data_off = 0, indx_off = 0; char buf[128], mime[128]; int flags = 0; int...
0
25,732
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: std::string TestURLLoader::TestBasicGET() { pp::URLRequestInfo request(instance_); request.SetURL("test_url_loader_data/hello.txt"); return LoadAndCompareBody(request, "hello\n"); } Commit Message: Fix one implicit 64-bit -> 32-bit implicit conversion in a PPAPI test. ../../ppapi/tests/test_url_loader.cc:...
0
906
Analyze the following 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 vhost_dev_init(struct vhost_dev *dev, struct vhost_virtqueue **vqs, int nvqs) { struct vhost_virtqueue *vq; int i; dev->vqs = vqs; dev->nvqs = nvqs; mutex_init(&dev->mutex); dev->log_ctx = NULL; dev->log_file = NULL; dev->memory = NULL; dev->mm = NULL; spin_lock_init(&dev->work_lock); INIT_...
0
148
Analyze the following 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 AwContents::SetSaveFormData(bool enabled) { DCHECK_CURRENTLY_ON(BrowserThread::UI); InitAutofillIfNecessary(enabled); if (AwAutofillClient::FromWebContents(web_contents_.get())) { AwAutofillClient::FromWebContents(web_contents_.get())-> SetSaveFormData(enabled); } } Commit Message: sync ...
0
24,285
Analyze the following 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 analyzeOneTable( Parse *pParse, /* Parser context */ Table *pTab, /* Table whose indices are to be analyzed */ Index *pOnlyIdx, /* If not NULL, only analyze this one index */ int iStatCur, /* Index of VdbeCursor that writes the sqlite_stat1 table */ int iMem, /* Available mem...
0
23,068
Analyze the following 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 jpc_dequantize(jas_matrix_t *x, jpc_fix_t absstepsize) { int i; int j; int t; assert(absstepsize >= 0); if (absstepsize == jpc_inttofix(1)) { return; } for (i = 0; i < jas_matrix_numrows(x); ++i) { for (j = 0; j < jas_matrix_numcols(x); ++j) { t = jas_matrix_get(x, i, j); if (t) { ...
0
7,017
Analyze the following 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 pv_eoi_get_pending(struct kvm_vcpu *vcpu) { u8 val; if (pv_eoi_get_user(vcpu, &val) < 0) apic_debug("Can't read EOI MSR value: 0x%llx\n", (unsigned long long)vcpi->arch.pv_eoi.msr_val); return val & 0x1; } Commit Message: KVM: x86: fix guest-initiated crash with x2apic (CVE-2013-6376) A g...
0
10,838
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: UseNewLEDField(enum led_field field, LedInfo *old, LedInfo *new, bool report, enum led_field *collide) { if (!(old->defined & field)) return true; if (new->defined & field) { if (report) *collide |= field; if (new->merge != MERGE_AUGMENT) re...
0
7,426
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: HttpBridge::RequestContext::~RequestContext() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); delete http_transaction_factory(); } Commit Message: Use URLFetcher::Create instead of new in http_bridge.cc. This change modified http_bridge so that it uses a factory to construct the URLFetcher. Moreov...
0
7,231
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SessionService::FindClosestNavigationWithIndex( std::vector<TabNavigation>* navigations, int index) { DCHECK(navigations); for (std::vector<TabNavigation>::iterator i = navigations->begin(); i != navigations->end(); ++i) { if (i->index() >= index) return i; } return navigations-...
0
25,353
Analyze the following 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 testEquals() { testEqualsHelper("http://host"); testEqualsHelper("http://host:123"); testEqualsHelper("http://foo:bar@host:123"); testEqualsHelper("http://foo:bar@host:123/"); testEqualsHelper("http://foo:bar@host:123/path"); testEqualsHelper("http://foo:bar@host:123/path?query"); testEqualsHe...
0
3,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: void RenderWidgetHostImpl::RendererIsResponsive() { if (is_unresponsive_) { is_unresponsive_ = false; NotifyRendererResponsive(); } } Commit Message: Implement TextureImageTransportSurface using texture mailbox This has a couple of advantages: - allow tearing down and recreating the UI parent contex...
0
19,747
Analyze the following 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 Camera3Device::convertMetadataListToRequestListLocked( const List<const CameraMetadata> &metadataList, RequestList *requestList) { if (requestList == NULL) { CLOGE("requestList cannot be NULL."); return BAD_VALUE; } int32_t burstId = 0; for (List<const CameraMetadata>::const_iterator it = ...
0
9,510
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: DownloadUrlSBClient( const content::DownloadItem& item, const DownloadProtectionService::CheckDownloadCallback& callback, const scoped_refptr<SafeBrowsingUIManager>& ui_manager, const scoped_refptr<SafeBrowsingDatabaseManager>& database_manager) : DownloadSBClient(item, callback, u...
0
27,911
Analyze the following 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) { LutContext *s = ctx->priv; const enum AVPixelFormat *pix_fmts = s->is_rgb ? rgb_pix_fmts : s->is_yuv ? yuv_pix_fmts : all_pix_fmts; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); return 0; } Comm...
0
12,900
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xfs_inode_alloc( struct xfs_mount *mp, xfs_ino_t ino) { struct xfs_inode *ip; /* * if this didn't occur in transactions, we could use * KM_MAYFAIL and return NULL here on ENOMEM. Set the * code up to do this anyway. */ ip = kmem_zone_alloc(xfs_inode_zone, KM_SLEEP); if (!ip) return NULL; if (in...
0
16,996
Analyze the following 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 btif_dm_set_oob_for_io_req(tBTA_OOB_DATA *p_oob_data) { if (oob_cb.sp_c[0] == 0 && oob_cb.sp_c[1] == 0 && oob_cb.sp_c[2] == 0 && oob_cb.sp_c[3] == 0 ) { *p_oob_data = FALSE; } else { *p_oob_data = TRUE; } BTIF_TRACE_DEBUG("btif_dm_set_oob_for_io_req *p_oob_data=%d", *p_oob_data); } Comm...
0
5,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: static RefPtr<Image> ImageFromNode(const Node& node) { DCHECK(!node.GetDocument().NeedsLayoutTreeUpdate()); DocumentLifecycle::DisallowTransitionScope disallow_transition( node.GetDocument().Lifecycle()); LayoutObject* layout_object = node.GetLayoutObject(); if (!layout_object) return nullptr; ...
0
10,122
Analyze the following 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 FileBrowserPrivatePinDriveFileFunction::RunAsync() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); using extensions::api::file_browser_private::PinDriveFile::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); drive::FileSystemInterface* ...
0
10,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: iter_first_in_series (DBusMessageDataIter *iter) { int i; i = iter->depth; while (i < _DBUS_MESSAGE_DATA_MAX_NESTING) { if (iter->sequence_nos[i] != 0) return FALSE; ++i; } return TRUE; } Commit Message: CWE ID: CWE-399
0
22,094
Analyze the following 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 i2d_ECPrivateKey_fp(FILE *fp, EC_KEY *eckey) { return ASN1_i2d_fp_of(EC_KEY,i2d_ECPrivateKey,fp,eckey); } Commit Message: Fix various certificate fingerprint issues. By using non-DER or invalid encodings outside the signed portion of a certificate the fingerprint can be changed without breaking the signa...
0
21,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: _krb5_pk_cert_free(struct krb5_pk_cert *cert) { if (cert->cert) { hx509_cert_free(cert->cert); } free(cert); } Commit Message: CVE-2019-12098: krb5: always confirm PA-PKINIT-KX for anon PKINIT RFC8062 Section 7 requires verification of the PA-PKINIT-KX key excahnge when anonymous PKINIT is used. F...
0
17,878
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: zend_class_entry *zend_fetch_class(zend_string *class_name, int fetch_type) /* {{{ */ { zend_class_entry *ce; int fetch_sub_type = fetch_type & ZEND_FETCH_CLASS_MASK; check_fetch_type: switch (fetch_sub_type) { case ZEND_FETCH_CLASS_SELF: if (UNEXPECTED(!EG(scope))) { zend_throw_or_error(fetch_type, ...
0
21,760
Analyze the following 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 AutofillPopupBaseView::DoHide() { delegate_ = NULL; RemoveWidgetObservers(); if (GetWidget()) { GetWidget()->Close(); } else { delete this; } } Commit Message: [Autofill] Remove AutofillPopupViewViews and associated feature. Bug: 906135,831603 Change-Id: I3c982f8b3ffb4928c7c878e74e10113...
0
20,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: static void wake_up_sem_queue_do(struct list_head *pt) { struct sem_queue *q, *t; int did_something; did_something = !list_empty(pt); list_for_each_entry_safe(q, t, pt, list) { wake_up_process(q->sleeper); /* q can disappear immediately after writing q->status. */ smp_wmb(); q->status = q->pid; } i...
0
12,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: void FakeBluetoothAgentManagerClient::RequestDefaultAgent( const dbus::ObjectPath& agent_path, const base::Closure& callback, const ErrorCallback& error_callback) { VLOG(1) << "RequestDefaultAgent: " << agent_path.value(); callback.Run(); } Commit Message: Refactor to support default Bluetooth pa...
0
10,416
Analyze the following 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 TEE_Result op_attr_bignum_from_user(void *attr, const void *buffer, size_t size) { struct bignum **bn = attr; return crypto_bignum_bin2bn(buffer, size, *bn); } Commit Message: svc: check for allocation overflow in crypto calls part 2 Without checking for overflow there is a risk of allocating ...
0
17,284
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: CastTrayView::~CastTrayView() { } Commit Message: Allow the cast tray to function as expected when the installed extension is missing API methods. BUG=489445 Review URL: https://codereview.chromium.org/1145833003 Cr-Commit-Position: refs/heads/master@{#330663} CWE ID: CWE-79
0
29,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: static void vmxnet3_put_ring_to_file(QEMUFile *f, Vmxnet3Ring *r) { qemu_put_be64(f, r->pa); qemu_put_be32(f, r->size); qemu_put_be32(f, r->cell_size); qemu_put_be32(f, r->next); qemu_put_byte(f, r->gen); } Commit Message: CWE ID: CWE-200
0
12,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: spnego_gss_export_sec_context( OM_uint32 *minor_status, gss_ctx_id_t *context_handle, gss_buffer_t interprocess_token) { OM_uint32 ret; ret = gss_export_sec_context(minor_status, context_handle, interprocess_token); return (ret); } Commit Message: Fix null deref in SPNEG...
0
28,627
Analyze the following 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 set_wake_alarm(uint64_t delay_millis, bool should_wake, alarm_cb cb, void *data) { static timer_t timer; static bool timer_created; if (!timer_created) { struct sigevent sigevent; memset(&sigevent, 0, sizeof(sigevent)); sigevent.sigev_notify = SIGEV_THREAD; sigevent.sigev_notify_funct...
0
16,283
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void Direct_Move( EXEC_OPS PGlyph_Zone zone, Int point, TT_F26Dot6 distance ) { TT_F26Dot6 v; v = CUR.GS.freeVector.x; if ( v != 0 ) { zone->cur_x[point] += MulDiv_Round( distance, ...
0
21,991
Analyze the following 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 mailimf_date_time_parse(const char * message, size_t length, size_t * indx, struct mailimf_date_time ** result) { size_t cur_token; int day_of_week; struct mailimf_date_time * date_time; int day; int month; int year; int hour; int min; int sec; int zone; int r; cur_token...
0
6,917
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void SkiaOutputSurfaceImpl::ScheduleDCLayers( std::vector<DCLayerOverlay> overlays) { auto task = base::BindOnce(&SkiaOutputSurfaceImplOnGpu::ScheduleDCLayers, base::Unretained(impl_on_gpu_.get()), std::move(overlays)); ScheduleGpuTask(std::move(task), {}); } Commit Message: Sk...
0
18,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: int PermissionsBubbleDialogDelegateView::GetDefaultDialogButton() const { return ui::DIALOG_BUTTON_NONE; } Commit Message: Elide the permission bubble title from the head of the string. Long URLs can be used to spoof other origins in the permission bubble title. This CL customises the title to be elided from ...
0
17,326
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: virDomainPMWakeup(virDomainPtr dom, unsigned int flags) { virConnectPtr conn; VIR_DOMAIN_DEBUG(dom, "flags=%x", flags); virResetLastError(); virCheckDomainReturn(dom, -1); conn = dom->conn; virCheckReadOnlyGoto(conn->flags, error); if (conn->driver->domainPMWakeu...
0
12,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: MSG_PROCESS_RETURN tls_process_cert_verify(SSL *s, PACKET *pkt) { EVP_PKEY *pkey = NULL; const unsigned char *sig, *data; #ifndef OPENSSL_NO_GOST unsigned char *gost_data = NULL; #endif int al, ret = MSG_PROCESS_ERROR; int type = 0, j; unsigned int len; X509 *peer; const EVP_MD *md...
0
23,122
Analyze the following 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 WebContentsImpl::ShouldPreserveAbortedURLs() { if (!delegate_) return false; return delegate_->ShouldPreserveAbortedURLs(this); } Commit Message: Don't call WebContents::DownloadImage() callback if the WebContents were deleted BUG=583718 Review URL: https://codereview.chromium.org/1685343004 Cr-C...
0
11,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: UrlData::~UrlData() { UMA_HISTOGRAM_MEMORY_KB("Media.BytesReadFromCache", BytesReadFromCache() >> 10); UMA_HISTOGRAM_MEMORY_KB("Media.BytesReadFromNetwork", BytesReadFromNetwork() >> 10); DCHECK_EQ(0, playing_); DCHECK_EQ(0, preloading_); } Commit Messa...
0
7,923
Analyze the following 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 AirPDcapScanForKeys( PAIRPDCAP_CONTEXT ctx, const guint8 *data, const guint mac_header_len, const guint tot_len, AIRPDCAP_SEC_ASSOCIATION_ID id ) { const UCHAR *addr; guint bodyLength; PAIRPDCAP_SEC_ASSOCIATION sta_sa; PAIRPDCAP_SEC_ASSOCIATION sa; guint offset =...
0
19,683
Analyze the following 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 fuse_file *fuse_file_alloc(struct fuse_conn *fc) { struct fuse_file *ff; ff = kmalloc(sizeof(struct fuse_file), GFP_KERNEL); if (unlikely(!ff)) return NULL; ff->fc = fc; ff->reserved_req = fuse_request_alloc(); if (unlikely(!ff->reserved_req)) { kfree(ff); return NULL; } INIT_LIST_HEAD(&ff...
0
2,342
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: std::string SessionStore::GetHeaderStorageKey(const std::string& session_tag) { return EncodeStorageKey(session_tag, TabNodePool::kInvalidTabNodeID); } Commit Message: Add trace event to sync_sessions::OnReadAllMetadata() It is likely a cause of janks on UI thread on Android. Add a trace event to get metrics ...
0
19,719
Analyze the following 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 CanRequestURL(const GURL& url) { DCHECK(!url.SchemeIsBlob() && !url.SchemeIsFileSystem()) << "inner_url extraction should be done already."; auto scheme_judgment = scheme_map_.find(url.scheme()); if (scheme_judgment != scheme_map_.end()) return true; if (CanRequestOrigin(url:...
0
2,483
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool ExtensionService::IsExtensionEnabled( const std::string& extension_id) const { return extension_prefs_->GetExtensionState(extension_id) == Extension::ENABLED; } Commit Message: Unrevert: Show the install dialog for the initial load of an unpacked extension with plugins. First landing broke some...
0
4,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: PageGroupLoadDeferrer::PageGroupLoadDeferrer(Page* page, bool deferSelf) { const HashSet<Page*>& pages = page->group().pages(); HashSet<Page*>::const_iterator end = pages.end(); for (HashSet<Page*>::const_iterator it = pages.begin(); it != end; ++it) { Page* otherPage = *it; if ((defe...
1
22,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: void RenderFrameImpl::JavaScriptExecuteRequestInIsolatedWorld( const base::string16& javascript, int32_t world_id, JavaScriptExecuteRequestInIsolatedWorldCallback callback) { TRACE_EVENT_INSTANT0("test_tracing", "JavaScriptExecuteRequestInIsolatedWorld", ...
0
4,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: extractContigSamplesShifted24bits (uint8 *in, uint8 *out, uint32 cols, tsample_t sample, uint16 spp, uint16 bps, tsample_t count, uint32 start, uint32 end, int shift) { int ready_bits = 0, sindex = 0; uint32 col,...
0
28,919
Analyze the following 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 ~Private() {} Commit Message: CWE ID: CWE-290
0
9,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: PassRefPtr<Range> BackwardsCharacterIterator::range() const { RefPtr<Range> r = m_textIterator.range(); if (!m_textIterator.atEnd()) { if (m_textIterator.length() <= 1) ASSERT(m_runOffset == 0); else { Node* n = r->startContainer(); ASSERT(n == r->endCon...
0
740
Analyze the following 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 dev_ifsioc(struct net *net, struct ifreq *ifr, unsigned int cmd) { int err; struct net_device *dev = __dev_get_by_name(net, ifr->ifr_name); const struct net_device_ops *ops; if (!dev) return -ENODEV; ops = dev->netdev_ops; switch (cmd) { case SIOCSIFFLAGS: /* Set interface flags */ return...
0
16,626
Analyze the following 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 IsMetadataImgRsrc ( XMP_Uns16 id ) { if ( id == 0 ) return false; int i; for ( i = 0; id < kPSIR_MetadataIDs[i]; ++i ) {} if ( id == kPSIR_MetadataIDs[i] ) return true; return false; } // IsMetadataImgRsrc Commit Message: CWE ID: CWE-125
0
11,548
Analyze the following 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_tsc_scaling(void) { return vmcs_config.cpu_based_2nd_exec_ctrl & SECONDARY_EXEC_TSC_SCALING; } Commit Message: KVM: x86: work around infinite loop in microcode when #AC is delivered It was found that a guest can DoS a host by triggering an infinite stream of "alignment check" (...
0
20,938
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void __net_exit ip_vs_control_net_cleanup(struct net *net) { struct netns_ipvs *ipvs = net_ipvs(net); ip_vs_trash_cleanup(net); ip_vs_stop_estimator(net, &ipvs->tot_stats); ip_vs_control_net_cleanup_sysctl(net); proc_net_remove(net, "ip_vs_stats_percpu"); proc_net_remove(net, "ip_vs_stats"); proc_net_remo...
0
16,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: static int mov_change_extradata(MOVStreamContext *sc, AVPacket *pkt) { uint8_t *side, *extradata; int extradata_size; /* Save the current index. */ sc->last_stsd_index = sc->stsc_data[sc->stsc_index].id - 1; /* Notify the decoder that extradata changed. */ extradata_size = sc->extradata_...
0
4,432
Analyze the following 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 NPIdentifierInfo *npidentifier_cache_lookup(NPIdentifier ident) { if (G_UNLIKELY(g_npidentifier_cache == NULL)) return NULL; return g_hash_table_lookup(g_npidentifier_cache, ident); } Commit Message: Support all the new variables added CWE ID: CWE-264
0
23,554
Analyze the following 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 PrintRenderFrameHelper::CopyMetafileDataToSharedMem( const PdfMetafileSkia& metafile, base::SharedMemoryHandle* shared_mem_handle) { uint32_t buf_size = metafile.GetDataSize(); if (buf_size == 0) return false; std::unique_ptr<base::SharedMemory> shared_buf( content::RenderThread::Get...
0
957
Analyze the following 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 airo_handle_link(struct airo_info *ai) { union iwreq_data wrqu; int scan_forceloss = 0; u16 status; /* Get new status and acknowledge the link change */ status = le16_to_cpu(IN4500(ai, LINKSTAT)); OUT4500(ai, EVACK, EV_LINK); if ((status == STAT_FORCELOSS) && (ai->scan_timeout > 0)) scan_fo...
0
8,145
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: hook_info_get_hashtable (struct t_weechat_plugin *plugin, const char *info_name, struct t_hashtable *hashtable) { struct t_hook *ptr_hook, *next_hook; struct t_hashtable *value; /* make C compiler happy */ (void) plugin; if (!info_name || !info_name[0]) retur...
0
26,402
Analyze the following 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 av_cold int vqa_decode_init(AVCodecContext *avctx) { VqaContext *s = avctx->priv_data; int i, j, codebook_index; s->avctx = avctx; avctx->pix_fmt = PIX_FMT_PAL8; /* make sure the extradata made it */ if (s->avctx->extradata_size != VQA_HEADER_SIZE) { av_log(s->avctx, AV_LO...
1
24,269
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int vmx_vm_has_apicv(struct kvm *kvm) { return enable_apicv && irqchip_in_kernel(kvm); } 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's correct. Thi...
0
592
Analyze the following 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 spl_fit_get_image_name(const void *fit, int images, const char *type, int index, const char **outname) { struct udevice *board; const char *name, *str; __maybe_unused int node; int conf_node; int len, i; bool found = true; conf_node = fit_find_config_node(fit); if (conf_node < 0) {...
0
14,474
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gsf_infile_tar_child_by_name (GsfInfile *infile, char const *name, GError **err) { GsfInfileTar *tar = GSF_INFILE_TAR (infile); unsigned ui; for (ui = 0; ui < tar->children->len; ui++) { const TarChild *c = &g_array_index (tar->children, TarChild, ui); if (strcmp (name, c->name) == 0) ...
0
14,100
Analyze the following 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_qtdemux_move_stream (GstQTDemux * qtdemux, QtDemuxStream * str, guint32 index) { /* no change needed */ if (index == str->sample_index) return; GST_DEBUG_OBJECT (qtdemux, "moving to sample %u of %u", index, str->n_samples); /* position changed, we have a discont */ str->sample_index ...
0
8,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: ShellMainDelegate::~ShellMainDelegate() { } Commit Message: Fix content_shell with network service enabled not loading pages. This regressed in my earlier cl r528763. This is a reland of r547221. Bug: 833612 Change-Id: I4c2649414d42773f2530e1abe5912a04fcd0ed9b Reviewed-on: https://chromium-review.googlesou...
0
25,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: void RenderThreadImpl::OnUpdateScrollbarTheme( float initial_button_delay, float autoscroll_button_delay, bool jump_on_track_click, blink::ScrollerStyle preferred_scroller_style, bool redraw) { EnsureWebKitInitialized(); static_cast<WebScrollbarBehaviorImpl*>( webkit_platform_support...
0
16,554
Analyze the following 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_log_lost_samples(struct perf_event *event, u64 lost) { struct perf_output_handle handle; struct perf_sample_data sample; int ret; struct { struct perf_event_header header; u64 lost; } lost_samples_event = { .header = { .type = PERF_RECORD_LOST_SAMPLES, .misc = 0, .size = sizeof(l...
0
8,005
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: BOOL UserCanAccessDriveDevice () { UNICODE_STRING name; RtlInitUnicodeString (&name, L"\\Device\\MountPointManager"); return IsAccessibleByUser (&name, FALSE); } Commit Message: Windows: fix low severity vulnerability in driver that allowed reading 3 bytes of kernel stack memory (with a rare possibility of 2...
0
12,400
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void RenderFrameHostImpl::RegisterMojoInterfaces() { #if !defined(OS_ANDROID) registry_->AddInterface(base::Bind(&InstalledAppProviderImplDefault::Create)); #endif // !defined(OS_ANDROID) PermissionControllerImpl* permission_controller = PermissionControllerImpl::FromBrowserContext( GetProce...
1
11,316
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void *__prb_previous_block(struct packet_sock *po, struct packet_ring_buffer *rb, int status) { unsigned int previous = prb_previous_blk_num(rb); return prb_lookup_block(po, rb, previous, status); } Commit Message: net: rework recvmsg handler msg_name and msg_namelen logic This patch now al...
0
19,151
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: std::unique_ptr<DragImage> DragController::DragImageForSelection( const LocalFrame& frame, float opacity) { if (!frame.Selection().ComputeVisibleSelectionInDOMTreeDeprecated().IsRange()) return nullptr; frame.View()->UpdateAllLifecyclePhasesExceptPaint(); DCHECK(frame.GetDocument()->IsActive())...
0
13,617
Analyze the following 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 add_bit (char bit, byte *fout) { if ((bloc&7) == 0) { fout[(bloc>>3)] = 0; } fout[(bloc>>3)] |= bit << (bloc&7); bloc++; } Commit Message: Fix/improve buffer overflow in MSG_ReadBits/MSG_WriteBits Prevent reading past end of message in MSG_ReadBits. If read past end of msg->data buffer (16348 ...
0
20,179
Analyze the following 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_MINIT_FUNCTION(gd) { le_gd = zend_register_list_destructors_ex(php_free_gd_image, NULL, "gd", module_number); le_gd_font = zend_register_list_destructors_ex(php_free_gd_font, NULL, "gd font", module_number); #if HAVE_GD_BUNDLED && HAVE_LIBFREETYPE gdFontCacheMutexSetup(); #endif #if HAVE_LIBT1 T1_SetBitm...
0
4,000
Analyze the following 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 free_user_ns(struct user_namespace *ns) { struct user_namespace *parent; do { parent = ns->parent; proc_free_inum(ns->proc_inum); kmem_cache_free(user_ns_cachep, ns); ns = parent; } while (atomic_dec_and_test(&parent->count)); } Commit Message: userns: Don't let unprivileged users trick privileg...
0
20,796
Analyze the following 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_attr_get_int( struct xfs_inode *ip, struct xfs_name *name, unsigned char *value, int *valuelenp, int flags) { xfs_da_args_t args; int error; if (!xfs_inode_hasattr(ip)) return ENOATTR; /* * Fill in the arg structure for this request. */ memset((char *)&args, 0, sizeof(arg...
0
23,757
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MagickExport MagickBooleanType BilevelImage(Image *image,const double threshold, ExceptionInfo *exception) { #define ThresholdImageTag "Threshold/Image" CacheView *image_view; MagickBooleanType status; MagickOffsetType progress; ssize_t y; assert(image != (Image *) NULL); asser...
0
15,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 void Ins_RTDG( INS_ARG ) { (void)args; CUR.GS.round_state = TT_Round_To_Double_Grid; CUR.func_round = (TRound_Function)Round_To_Double_Grid; } Commit Message: CWE ID: CWE-125
0
11,404
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void ContainerNode::removeChild(Node* oldChild, ExceptionState& es) { ASSERT(refCount() || parentOrShadowHostNode()); RefPtr<Node> protect(this); if (!oldChild || oldChild->parentNode() != this) { es.throwUninformativeAndGenericDOMException(NotFoundError); return; } RefPtr<N...
0
23,975
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: slurmd_req(slurm_msg_t *msg) { int rc; if (msg == NULL) { if (startup == 0) startup = time(NULL); FREE_NULL_LIST(waiters); slurm_mutex_lock(&job_limits_mutex); if (job_limits_list) { FREE_NULL_LIST(job_limits_list); job_limits_loaded = false; } slurm_mutex_unlock(&job_limits_mutex); retu...
0
20,646
Analyze the following 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 gdImageCreateFromGd2Part (FILE * inFile, int srcx, int srcy, int w, int h) { gdImagePtr im; gdIOCtx *in = gdNewFileCtx(inFile); im = gdImageCreateFromGd2PartCtx(in, srcx, srcy, w, h); in->gd_free(in); return im; } Commit Message: Fixed #72339 Integer Overflow in _gd2GetHeader() resulting in he...
0
26,931
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PepperMediaDeviceManager* PepperMediaDeviceManager::GetForRenderFrame( RenderFrame* render_frame) { PepperMediaDeviceManager* handler = PepperMediaDeviceManager::Get(render_frame); if (!handler) handler = new PepperMediaDeviceManager(render_frame); return handler; } Commit Message: Pepp...
1
4,006
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xsltExtModuleFunctionLookup(const xmlChar * name, const xmlChar * URI) { xmlXPathFunction ret; if ((xsltFunctionsHash == NULL) || (name == NULL) || (URI == NULL)) return (NULL); xmlMutexLock(xsltExtMutex); XML_CAST_FPTR(ret) = xmlHashLookup2(xsltFunctionsHash, name, URI); xmlMutexU...
0
14,486
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static MagickBooleanType WriteMAPImage(const ImageInfo *image_info,Image *image) { MagickBooleanType status; register const IndexPacket *indexes; register const PixelPacket *p; register ssize_t i, x; register unsigned char *q; size_t depth, packet_size; ssize_t ...
1
11,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: void ResourceDispatcherHostImpl::DidStartRequest(ResourceLoader* loader) { if (!update_load_states_timer_->IsRunning()) { update_load_states_timer_->Start(FROM_HERE, TimeDelta::FromMilliseconds(kUpdateLoadStatesIntervalMsec), this, &ResourceDispatcherHostImpl::UpdateLoadStates); } } Commi...
0
11,725
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: eval_op_xor(uschar **sptr, BOOL decimal, uschar **error) { uschar *s = *sptr; int_eximarith_t x = eval_op_and(&s, decimal, error); if (*error == NULL) { while (*s == '^') { int_eximarith_t y; s++; y = eval_op_and(&s, decimal, error); if (*error != NULL) break; x ^= y; } } *sptr =...
0
7,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 QQuickWebView::reload() { Q_D(QQuickWebView); WebFrameProxy* mainFrame = d->webPageProxy->mainFrame(); if (mainFrame && !mainFrame->unreachableURL().isEmpty() && mainFrame->url() != blankURL()) { d->webPageProxy->loadURL(mainFrame->unreachableURL()); return; } const bool...
0
1,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: static void dns_resolver_describe(const struct key *key, struct seq_file *m) { int err = key->type_data.x[0]; seq_puts(m, key->description); if (key_is_instantiated(key)) { if (err) seq_printf(m, ": %d", err); else seq_printf(m, ": %u", key->datalen); } } Commit Message: KEYS: Remove key_type::mat...
0
15,385
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PrintingContext* PrintingContext::Create(const std::string& app_locale) { return static_cast<PrintingContext*>(new PrintingContextCairo(app_locale)); } Commit Message: Fix print preview workflow to reflect settings of selected printer. BUG=95110 TEST=none Review URL: http://codereview.chromium.org/7831041 ...
0
11,428
Analyze the following 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::processArguments(const String& features, void* data, ArgumentsCallback callback) { int keyBegin, keyEnd; int valueBegin, valueEnd; int i = 0; int length = features.length(); String buffer = features.lower(); while (i < length) { while (isSeparator(buffer[i])) { ...
0
7,257