instruction
stringclasses
1 value
input
stringlengths
56
241k
output
int64
0
1
__index_level_0__
int64
0
175k
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: struct key *key_alloc(struct key_type *type, const char *desc, kuid_t uid, kgid_t gid, const struct cred *cred, key_perm_t perm, unsigned long flags, struct key_restriction *restrict_link) { struct key_user *user = NULL; struct key *key; size_t desclen, quotalen; int ret; key = ERR_P...
0
60,224
Analyze the following 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 decode_attr_files_free(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res) { __be32 *p; int status = 0; *res = 0; if (unlikely(bitmap[0] & (FATTR4_WORD0_FILES_FREE - 1U))) return -EIO; if (likely(bitmap[0] & FATTR4_WORD0_FILES_FREE)) { p = xdr_inline_decode(xdr, 8); if (unlikely(!p)) ...
0
23,261
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SetMaskForEvent(int deviceid, Mask mask, int event) { if (deviceid < 0 || deviceid >= MAXDEVICES) FatalError("SetMaskForEvent: bogus device id"); event_filters[deviceid][event] = mask; } Commit Message: CWE ID: CWE-119
0
4,895
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gs_main_run_string(gs_main_instance * minst, const char *str, int user_errors, int *pexit_code, ref * perror_object) { return gs_main_run_string_with_length(minst, str, (uint) strlen(str), user_errors, pexit...
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: static int file_write(jas_stream_obj_t *obj, char *buf, int cnt) { jas_stream_fileobj_t *fileobj = JAS_CAST(jas_stream_fileobj_t *, obj); return write(fileobj->fd, buf, cnt); } Commit Message: The memory stream interface allows for a buffer size of zero. The case of a zero-sized buffer was not handled correctl...
0
73,201
Analyze the following 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(bcmath) { REGISTER_INI_ENTRIES(); return SUCCESS; } Commit Message: CWE ID: CWE-20
0
11,010
Analyze the following 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 RenderView::OnThemeChanged() { #if defined(OS_WIN) gfx::NativeThemeWin::instance()->CloseHandles(); if (webview()) webview()->themeChanged(); #else // defined(OS_WIN) NOTIMPLEMENTED(); #endif } Commit Message: DevTools: move DevToolsAgent/Client into content. BUG=84078 TEST= Review URL: http://...
0
98,966
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: _tiffCloseProc(thandle_t fd) { return (CloseHandle(fd) ? 0 : -1); } Commit Message: * libtiff/tif_{unix,vms,win32}.c (_TIFFmalloc): ANSI C does not require malloc() to return NULL pointer if requested allocation size is zero. Assure that _TIFFmalloc does. CWE ID: CWE-369
0
86,806
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: OVS_EXCLUDED(ofproto_mutex) { ovs_mutex_lock(&ofproto_mutex); remove_rule_rcu__(rule); ovs_mutex_unlock(&ofproto_mutex); } Commit Message: ofproto: Fix OVS crash when reverting old flows in bundle commit During bundle commit flows which are added in bundle are applied to ofproto in-order. In cas...
0
77,117
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int CameraClient::getOrientation(int degrees, bool mirror) { if (!mirror) { if (degrees == 0) return 0; else if (degrees == 90) return HAL_TRANSFORM_ROT_90; else if (degrees == 180) return HAL_TRANSFORM_ROT_180; else if (degrees == 270) return HAL_TRANSFORM_ROT_270; } else { // Do mirror (horizontal flip) ...
0
161,775
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: nfsd4_decode_open_confirm(struct nfsd4_compoundargs *argp, struct nfsd4_open_confirm *open_conf) { DECODE_HEAD; if (argp->minorversion >= 1) return nfserr_notsupp; status = nfsd4_decode_stateid(argp, &open_conf->oc_req_stateid); if (status) return status; READ_BUF(4); open_conf->oc_seqid = be32_to_cpu...
0
65,763
Analyze the following 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_METHOD(Phar, extractTo) { char *error = NULL; php_stream *fp; php_stream_statbuf ssb; phar_entry_info *entry; char *pathto, *filename; size_t pathto_len, filename_len; int ret, i; int nelems; zval *zval_files = NULL; zend_bool overwrite = 0; PHAR_ARCHIVE_OBJECT(); if (zend_parse_p...
1
165,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: upnp_event_var_change_notify(enum subscriber_service_enum service) { struct subscriber * sub; for(sub = subscriberlist.lh_first; sub != NULL; sub = sub->entries.le_next) { if(sub->service == service && sub->notify == NULL) upnp_event_create_notify(sub); } } Commit Message: upnp_event_prepare(): check the...
0
89,887
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int tls1_heartbeat(SSL *s) { unsigned char *buf, *p; int ret; unsigned int payload = 18; /* Sequence number + random bytes */ unsigned int padding = 16; /* Use minimum padding */ /* Only send if peer supports and accepts HB requests... */ if (!(s->tlsext_heartbeat & SSL_TLSEXT_HB_ENABLE...
0
6,172
Analyze the following 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 __sk_free(struct sock *sk) { struct sk_filter *filter; if (sk->sk_destruct) sk->sk_destruct(sk); filter = rcu_dereference_check(sk->sk_filter, atomic_read(&sk->sk_wmem_alloc) == 0); if (filter) { sk_filter_uncharge(sk, filter); RCU_INIT_POINTER(sk->sk_filter, NULL); } sock_di...
0
58,674
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: OMX_ERRORTYPE SoftAVC::setEncMode(IVE_ENC_MODE_T e_enc_mode) { IV_STATUS_T status; ive_ctl_set_enc_mode_ip_t s_enc_mode_ip; ive_ctl_set_enc_mode_op_t s_enc_mode_op; s_enc_mode_ip.e_cmd = IVE_CMD_VIDEO_CTL; s_enc_mode_ip.e_sub_cmd = IVE_CMD_CTL_SET_ENC_MODE; s_enc_mode_ip.e_enc_mode = e_enc_mod...
0
163,965
Analyze the following 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::BindFrameNavigationControl( mojom::FrameNavigationControlAssociatedRequest request) { frame_navigation_control_binding_.Bind(std::move(request)); } Commit Message: If a page calls |window.focus()|, kick it out of fullscreen. BUG=776418, 800056 Change-Id: I1880fe600e4814c073f247c43b1...
0
147,733
Analyze the following 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 GetHostedDocumentURLBlockingThread(const FilePath& gdata_cache_path, GURL* url) { std::string json; if (!file_util::ReadFileToString(gdata_cache_path, &json)) { NOTREACHED() << "Unable to read file " << gdata_cache_path.value(); return; } DVLOG(1) << "H...
0
105,985
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PdfMetafileSkia* PrintWebViewHelper::PrintPreviewContext::metafile() { DCHECK(IsRendering()); return metafile_.get(); } Commit Message: Crash on nested IPC handlers in PrintWebViewHelper Class is not designed to handle nested IPC. Regular flows also does not expect them. Still during printing of plugging th...
0
126,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: KURL Document::openSearchDescriptionURL() { static const char openSearchMIMEType[] = "application/opensearchdescription+xml"; static const char openSearchRelation[] = "search"; if (!frame() || frame()->tree().parent()) return KURL(); if (!loadEventFinished()) return KURL(); ...
0
124,449
Analyze the following 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 ip6_datagram_recv_ctl(struct sock *sk, struct msghdr *msg, struct sk_buff *skb) { ip6_datagram_recv_common_ctl(sk, msg, skb); ip6_datagram_recv_specific_ctl(sk, msg, skb); } Commit Message: ipv6: add complete rcu protection around np->opt This patch addresses multiple problems : UDP/RAW sendmsg() n...
0
53,661
Analyze the following 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 ass_shaper_skip_characters(TextInfo *text_info) { int i; GlyphInfo *glyphs = text_info->glyphs; for (i = 0; i < text_info->length; i++) { if ((glyphs[i].symbol <= 0x202e && glyphs[i].symbol >= 0x202a) || (glyphs[i].symbol <= 0x200f && glyphs[i].symbol >= 0x200b) ...
0
73,286
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: blink::WebString RenderFrameImpl::GetDevToolsFrameToken() { return devtools_frame_token_; } Commit Message: If a page calls |window.focus()|, kick it out of fullscreen. BUG=776418, 800056 Change-Id: I1880fe600e4814c073f247c43b1c1ac80c8fc017 Reviewed-on: https://chromium-review.googlesource.com/852378 Reviewe...
0
147,795
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: server_request_direct_streamlocal(void) { Channel *c = NULL; char *target, *originator; u_short originator_port; target = packet_get_string(NULL); originator = packet_get_string(NULL); originator_port = packet_get_int(); packet_check_eom(); debug("server_request_direct_streamlocal: originator %s port %d...
1
168,662
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: encode_METER(const struct ofpact_meter *meter, enum ofp_version ofp_version, struct ofpbuf *out) { if (ofp_version >= OFP13_VERSION) { instruction_put_OFPIT13_METER(out)->meter_id = htonl(meter->meter_id); } } Commit Message: ofp-actions: Avoid buffer overread in BUNDLE action decodi...
0
76,871
Analyze the following 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 snd_ctl_dev_register(struct snd_device *device) { struct snd_card *card = device->device_data; int err, cardnum; char name[16]; if (snd_BUG_ON(!card)) return -ENXIO; cardnum = card->number; if (snd_BUG_ON(cardnum < 0 || cardnum >= SNDRV_CARDS)) return -ENXIO; sprintf(name, "controlC%i", car...
0
36,452
Analyze the following 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_write_mfra_tag(AVIOContext *pb, MOVMuxContext *mov) { int64_t pos = avio_tell(pb); int i; avio_wb32(pb, 0); /* size placeholder */ ffio_wfourcc(pb, "mfra"); /* An empty mfra atom is enough to indicate to the publishing point that * the stream has ended. */ if (mov->fla...
0
79,375
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: CSSPropertyID SVGElement::CssPropertyIdForSVGAttributeName( const QualifiedName& attr_name) { if (!attr_name.NamespaceURI().IsNull()) return CSSPropertyInvalid; static HashMap<StringImpl*, CSSPropertyID>* property_name_to_id_map = nullptr; if (!property_name_to_id_map) { property_name_to_id_map...
0
152,749
Analyze the following 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 decode_wdlt(GetByteContext *gb, uint8_t *frame, int width, int height) { const uint8_t *frame_end = frame + width * height; uint8_t *line_ptr; int count, i, v, lines, segments; int y = 0; lines = bytestream2_get_le16(gb); if (lines > height) return AVERROR_INVALIDDATA...
0
64,092
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: e1000e_intrmgr_initialize_all_timers(E1000ECore *core, bool create) { int i; core->radv.delay_reg = RADV; core->rdtr.delay_reg = RDTR; core->raid.delay_reg = RAID; core->tadv.delay_reg = TADV; core->tidv.delay_reg = TIDV; core->radv.delay_resolution_ns = E1000_INTR_DELAY_NS_RES; ...
0
5,985
Analyze the following 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 long sys_oabi_bind(int fd, struct sockaddr __user *addr, int addrlen) { sa_family_t sa_family; if (addrlen == 112 && get_user(sa_family, &addr->sa_family) == 0 && sa_family == AF_UNIX) addrlen = 110; return sys_bind(fd, addr, addrlen); } Commit Message: ARM: 6891/1: prevent heap corrup...
0
27,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 bool validateKeyEvent(int32_t action) { if (! isValidKeyAction(action)) { ALOGE("Key event has invalid action code 0x%x", action); return false; } return true; } Commit Message: Add new MotionEvent flag for partially obscured windows. Due to more complex window layouts resulting in lots of ov...
0
163,856
Analyze the following 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_object_destroy(struct pdf_object *object) { switch (object->type) { case OBJ_stream: case OBJ_image: free(object->stream.text); break; case OBJ_page: flexarray_clear(&object->page.children); break; case OBJ_bookmark: flexarray_clear(&obje...
0
83,014
Analyze the following 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 ExtensionInstallDialogView::UpdateInstallResultHistogram(bool accepted) const { if (prompt_->type() == ExtensionInstallPrompt::INSTALL_PROMPT) UMA_HISTOGRAM_BOOLEAN("Extensions.InstallPrompt.Accepted", accepted); } Commit Message: Make the webstore inline install dialog be tab-modal Also clean up...
0
131,752
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: AXTreeSnapshotCallback AddFrame(bool is_root) { return base::Bind(&AXTreeSnapshotCombiner::ReceiveSnapshot, this, is_root); } Commit Message: If JavaScript shows a dialog, cause the page to lose fullscreen. BUG=670135, 550017, 726761, 728276 Review-Url: https...
0
135,630
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: pdf_tos_move_after_char(fz_context *ctx, pdf_text_object_state *tos) { fz_union_rect(&tos->text_bbox, &tos->char_bbox); fz_pre_translate(&tos->tm, tos->char_tx, tos->char_ty); } Commit Message: CWE ID: CWE-20
0
593
Analyze the following 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 parse_extranonce(struct pool *pool, json_t *val) { char *nonce1; int n2size; nonce1 = json_array_string(val, 0); if (!nonce1) { return false; } n2size = json_integer_value(json_array_get(val, 1)); if (!n2size) { free(nonce1); return false; } cg_wlock(&pool->data_lock); pool->nonce1 =...
0
36,609
Analyze the following 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 WallpaperManagerBase::CacheUsersWallpapers() { DCHECK(thread_checker_.CalledOnValidThread()); user_manager::UserList users = user_manager::UserManager::Get()->GetUsers(); if (!users.empty()) { user_manager::UserList::const_iterator it = users.begin(); it++; for (int cached = 0; it != users...
0
128,046
Analyze the following 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 ChromeContentBrowserClient::SiteInstanceDeleting( SiteInstance* site_instance) { if (!site_instance->HasProcess()) return; Profile* profile = Profile::FromBrowserContext( site_instance->GetBrowserContext()); ExtensionService* service = extensions::ExtensionSystem::Get(profile)->ext...
0
115,787
Analyze the following 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 AXObjectCacheImpl::postNotification(AXObject* object, AXNotification notification) { if (!object) return; m_modificationCount++; m_notificationsToPost.push_back(std::make_pair(object, notification)); if (!m_notificationPostTimer.isActive()) m_notifica...
0
127,374
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: flx_set_color (FlxColorSpaceConverter * flxpal, guint colr, guint red, guint green, guint blue, gint scale) { g_return_if_fail (flxpal != NULL); g_return_if_fail (colr < 0x100); flxpal->palvec[(colr * 3)] = red << scale; flxpal->palvec[(colr * 3) + 1] = green << scale; flxpal->palvec[(colr * 3) + ...
0
13,518
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: tChecksumCheckResult ParaNdis_CheckRxChecksum( PARANDIS_ADAPTER *pContext, ULONG virtioFlags, tCompletePhysicalAddress *pPacketPages, ULON...
1
168,887
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void CheckClientDownloadRequest::NotifyRequestFinished( DownloadCheckResult result, DownloadCheckResultReason reason) { DCHECK_CURRENTLY_ON(BrowserThread::UI); weakptr_factory_.InvalidateWeakPtrs(); DVLOG(2) << "SafeBrowsing download verdict for: " << item_->DebugString(true) << " verdic...
0
136,705
Analyze the following 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 vt_reset_keyboard(int fd) { int kb; /* If we can't read the default, then default to unicode. It's 2017 after all. */ kb = vt_default_utf8() != 0 ? K_UNICODE : K_XLATE; if (ioctl(fd, KDSKBMODE, kb) < 0) return -errno; return 0; } Commit Messa...
1
169,776
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: cib_construct_reply(xmlNode * request, xmlNode * output, int rc) { int lpc = 0; xmlNode *reply = NULL; const char *name = NULL; const char *value = NULL; const char *names[] = { F_CIB_OPERATION, F_CIB_CALLID, F_CIB_CLIENTID, F_CIB_CALLOPTS }; static int...
0
33,854
Analyze the following 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_SVTCA( INS_ARG ) { Short A, B; (void)args; if ( CUR.opcode & 1 ) A = 0x4000; else A = 0; B = A ^ 0x4000; CUR.GS.freeVector.x = A; CUR.GS.projVector.x = A; CUR.GS.dualVector.x = A; CUR.GS.freeVector.y = B; CUR.GS.projVector.y = B; ...
0
5,466
Analyze the following 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 FileReaderLoader::OnDataPipeReadable(MojoResult result) { if (result != MOJO_RESULT_OK) { if (!received_all_data_) Failed(FileError::kNotReadableErr); return; } while (true) { uint32_t num_bytes; const void* buffer; MojoResult result = consumer_handle_->BeginReadData( ...
0
155,406
Analyze the following 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 codeCursorHintFixExpr(Walker *pWalker, Expr *pExpr){ int rc = WRC_Continue; struct CCurHint *pHint = pWalker->u.pCCurHint; if( pExpr->op==TK_COLUMN ){ if( pExpr->iTable!=pHint->iTabCur ){ Vdbe *v = pWalker->pParse->pVdbe; int reg = ++pWalker->pParse->nMem; /* Register for column...
0
136,407
Analyze the following 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 HTMLInputElement::setSelectionRangeForBinding( unsigned start, unsigned end, const String& direction, ExceptionState& exception_state) { if (!input_type_->SupportsSelectionAPI()) { exception_state.ThrowDOMException(kInvalidStateError, "The input ele...
0
126,156
Analyze the following 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_MSHUTDOWN_FUNCTION(gd) { T1_CloseLib(); #if HAVE_GD_BUNDLED && HAVE_LIBFREETYPE gdFontCacheMutexShutdown(); #endif UNREGISTER_INI_ENTRIES(); return SUCCESS; } Commit Message: Fixed bug #66356 (Heap Overflow Vulnerability in imagecrop()) And also fixed the bug: arguments are altered after some calls CWE ...
0
39,235
Analyze the following 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_has_selection(WebKitWebView* webView) { g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), FALSE); return !core(webView)->selection().isNone(); } Commit Message: 2011-06-02 Joone Hur <joone.hur@collabora.co.uk> Reviewed by Martin Robinson. [GTK] Only load dict...
0
100,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: pvscsi_init(PCIDevice *pci_dev) { PVSCSIState *s = PVSCSI(pci_dev); trace_pvscsi_state("init"); /* PCI subsystem ID, subsystem vendor ID, revision */ if (PVSCSI_USE_OLD_PCI_CONFIGURATION(s)) { pci_set_word(pci_dev->config + PCI_SUBSYSTEM_ID, 0x1000); } else { pci_set_word(pci...
0
8,415
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void kvm_inject_pit_timer_irqs(struct kvm_vcpu *vcpu) { struct kvm_pit *pit = vcpu->kvm->arch.vpit; struct kvm *kvm = vcpu->kvm; struct kvm_kpit_state *ps; if (pit) { int inject = 0; ps = &pit->pit_state; /* Try to inject pending interrupts when * last one has been acked. */ spin_lock(&ps->inj...
0
43,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: void QQuickWebViewFlickablePrivate::onComponentComplete() { Q_Q(QQuickWebView); ASSERT(!flickProvider); flickProvider = new QtFlickProvider(q, pageView.data()); const QQuickWebViewExperimental* experimental = q->experimental(); QObject::connect(flickProvider, SIGNAL(contentWidthChanged()), e...
0
101,746
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static struct page **nfs4_alloc_pages(size_t size, gfp_t gfp_flags) { struct page **pages; int i; pages = kcalloc(size, sizeof(struct page *), gfp_flags); if (!pages) { dprintk("%s: can't alloc array of %zu pages\n", __func__, size); return NULL; } for (i = 0; i < size; i++) { pages[i] = alloc_page(...
0
29,140
Analyze the following 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_attr3_rmt_hdr_set( struct xfs_mount *mp, void *ptr, xfs_ino_t ino, uint32_t offset, uint32_t size, xfs_daddr_t bno) { struct xfs_attr3_rmt_hdr *rmt = ptr; if (!xfs_sb_version_hascrc(&mp->m_sb)) return 0; rmt->rm_magic = cpu_to_be32(XFS_ATTR3_RMT_MAGIC); rmt->rm_offset = cpu_to_be32(offset)...
0
44,969
Analyze the following 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 tls1_get_formatlist(SSL *s, const unsigned char **pformats, size_t *num_formats) { /* * If we have a custom point format list use it otherwise use default */ if (s->tlsext_ecpointformatlist) { *pformats = s->tlsext_ecpointformatlist; *n...
0
6,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 start_auth_vnc(VncState *vs) { make_challenge(vs); /* Send client a 'random' challenge */ vnc_write(vs, vs->challenge, sizeof(vs->challenge)); vnc_flush(vs); vnc_read_when(vs, protocol_client_auth_vnc, sizeof(vs->challenge)); } Commit Message: CWE ID: CWE-264
0
7,986
Analyze the following 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_API void _zend_ts_hash_init_ex(TsHashTable *ht, uint nSize, dtor_func_t pDestructor, zend_bool persistent, zend_bool bApplyProtection ZEND_FILE_LINE_DC) { #ifdef ZTS ht->mx_reader = tsrm_mutex_alloc(); ht->mx_writer = tsrm_mutex_alloc(); ht->reader = 0; #endif _zend_hash_init_ex(TS_HASH(ht), nSize, pDest...
0
7,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: static int compat_calc_match(struct ebt_entry_match *m, int *off) { *off += ebt_compat_match_offset(m->u.match, m->match_size); *off += ebt_compat_entry_padsize(); return 0; } Commit Message: bridge: netfilter: fix information leak Struct tmp is copied from userspace. It is not checked whether the "name" fi...
0
27,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: static void __init dcache_init_early(void) { unsigned int loop; /* If hashes are distributed across NUMA nodes, defer * hash allocation until vmalloc space is available. */ if (hashdist) return; dentry_hashtable = alloc_large_system_hash("Dentry cache", sizeof(struct hlist_bl_head), dhash_...
0
67,331
Analyze the following 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_public_encrypt) { zval **key, *crypted; EVP_PKEY *pkey; int cryptedlen; unsigned char *cryptedbuf; int successful = 0; long keyresource = -1; long padding = RSA_PKCS1_PADDING; char * data; int data_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "szZ|l", &data, &data_len,...
0
14,221
Analyze the following 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 OfflinePageModelTaskified::SavePage( const SavePageParams& save_page_params, std::unique_ptr<OfflinePageArchiver> archiver, const SavePageCallback& callback) { auto task = base::MakeUnique<CreateArchiveTask>( GetArchiveDirectory(save_page_params.client_id.name_space), save_page_para...
0
155,855
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: NO_INLINE void jspeBlockNoBrackets() { if (JSP_SHOULD_EXECUTE) { while (lex->tk && lex->tk!='}') { JsVar *a = jspeStatement(); jsvCheckReferenceError(a); jsvUnLock(a); if (JSP_HAS_ERROR) { if (lex && !(execInfo.execute&EXEC_ERROR_LINE_REPORTED)) { execInfo.execute =...
0
82,343
Analyze the following 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 MultibufferDataSource::StartCallback() { DCHECK(render_task_runner_->BelongsToCurrentThread()); if (!init_cb_) { SetReader(nullptr); return; } bool success = reader_ && reader_->Available() > 0 && url_data() && (!assume_fully_buffered() || url_data()->leng...
1
172,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: UsbFindDevicesFunction::UsbFindDevicesFunction() { } Commit Message: Remove fallback when requesting a single USB interface. This reverts commit 2d475d0ed37bf8f19385537ad31e361f1b21624b. The permission broker now supports opening devices that are partially claimed through the OpenPath method and RequestPathAcce...
0
123,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: size_t ContentLayerCount() { return paint_artifact_compositor() ->GetExtraDataForTesting() ->content_layers.size(); } Commit Message: [BGPT] Add a fast-path for transform-origin changes. This patch adds a fast-path for updating composited transform-origin changes without requiring a Pain...
0
140,110
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: magic_setflags(struct magic_set *ms, int flags) { if (ms == NULL) return -1; #if !defined(HAVE_UTIME) && !defined(HAVE_UTIMES) if (flags & MAGIC_PRESERVE_ATIME) return -1; #endif ms->flags = flags; return 0; } Commit Message: - Add a limit to the number of ELF notes processed (Suggested by Alexander Ch...
0
45,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 Handle<Object> GetInternalImpl(Handle<JSObject> holder, uint32_t entry) { return GetImpl(holder, entry); } Commit Message: Backport: Fix Object.entries/values with changing elements Bug: 111274046 Test: m -j proxy_resolver_v8_unittest && adb sync && adb shell \ /data/nativetest64/proxy_resolver_v8_un...
0
163,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: VOID ixheaacd_fwd_modulation(const WORD32 *p_time_in1, WORD32 *real_subband, WORD32 *imag_subband, ia_sbr_qmf_filter_bank_struct *qmf_bank, ia_qmf_dec_tables_struct *qmf_dec_tables_ptr) { WORD32 i; const WORD32 *p_time_in2 =...
0
162,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: void *Sys_LoadGameDll(const char *name, intptr_t (QDECL **entryPoint)(int, ...), intptr_t (*systemcalls)(intptr_t, ...)) { void *libHandle; void (*dllEntry)(intptr_t (*syscallptr)(intptr_t, ...)); assert(name); Com_Printf( "Loading DLL file: %s\n", name); libHandle = Sys_LoadLibrary(name); if(!libHandl...
0
96,070
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void FileAPIMessageFilter::OnOpen( int request_id, const GURL& origin_url, fileapi::FileSystemType type, int64 requested_size, bool create) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); if (type == fileapi::kFileSystemTypeTemporary) { RecordAction(UserMetricsAction("OpenFileSystemTempor...
0
119,031
Analyze the following 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_packet(AVFormatContext *s, AVPacket *pkt) { RMDemuxContext *rm = s->priv_data; AVStream *st = NULL; // init to silence compiler warning int i, len, res, seq = 1; int64_t timestamp, pos; int flags; for (;;) { if (rm->audio_pkt_cnt) { st = s->streams[r...
0
61,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 int count_cow_clusters(BDRVQcowState *s, int nb_clusters, uint64_t *l2_table, int l2_index) { int i; for (i = 0; i < nb_clusters; i++) { uint64_t l2_entry = be64_to_cpu(l2_table[l2_index + i]); int cluster_type = qcow2_get_cluster_type(l2_entry); switch(cluster_type) {...
0
16,921
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: HttpNetworkTransactionTest() : spdy_util_(GetParam()), session_deps_(GetParam()), old_max_group_sockets_(ClientSocketPoolManager::max_sockets_per_group( HttpNetworkSession::NORMAL_SOCKET_POOL)), old_max_pool_sockets_(ClientSocketPoolManager::max_sockets_per_pool( ...
0
129,278
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int sparc_pmu_add(struct perf_event *event, int ef_flags) { struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); int n0, ret = -EAGAIN; unsigned long flags; local_irq_save(flags); perf_pmu_disable(event->pmu); n0 = cpuc->n_events; if (n0 >= MAX_HWEVENTS) goto out; cpuc->event[n0] = even...
0
25,661
Analyze the following 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 *BlobToImage(const ImageInfo *image_info,const void *blob, const size_t length,ExceptionInfo *exception) { const MagickInfo *magick_info; Image *image; ImageInfo *blob_info, *clone_info; MagickBooleanType status; assert(image_info != (ImageInfo *) NULL); as...
0
96,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: ImageBitmapFactories& ImageBitmapFactories::fromInternal(DOMWindow& object) { ImageBitmapFactories* supplement = static_cast<ImageBitmapFactories*>(Supplement<DOMWindow>::from(object, supplementName())); if (!supplement) { supplement = new ImageBitmapFactories(); Supplement<DOMWindow>::pro...
0
115,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: int writepng_encode_image(mainprog_info *mainprog_ptr) { png_structp png_ptr = (png_structp)mainprog_ptr->png_ptr; png_infop info_ptr = (png_infop)mainprog_ptr->info_ptr; /* as always, setjmp() must be called in every function that calls a * PNG-writing libpng function */ if (setjmp(mainprog_ptr...
0
159,812
Analyze the following 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 set_plugin_info_called() const { return set_plugin_info_called_; } Commit Message: Follow-on fixes and naming changes for https://codereview.chromium.org/12086077/ BUG=172573 Review URL: https://codereview.chromium.org/12177018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180600 0039d316-1c...
0
116,828
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ExclusiveAccessContext* BrowserView::GetExclusiveAccessContext() { return this; } Commit Message: Mac: turn popups into new tabs while in fullscreen. It's platform convention to show popups as new tabs while in non-HTML5 fullscreen. (Popups cause tabs to lose HTML5 fullscreen.) This was implemented for Cocoa...
0
155,185
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int platform_get_irq_byname(struct platform_device *dev, const char *name) { struct resource *r; if (IS_ENABLED(CONFIG_OF_IRQ) && dev->dev.of_node) { int ret; ret = of_irq_get_byname(dev->dev.of_node, name); if (ret > 0 || ret == -EPROBE_DEFER) return ret; } r = platform_get_resource_byname(dev, I...
0
63,103
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ProcXvListImageFormats(ClientPtr client) { XvPortPtr pPort; XvImagePtr pImage; int i; xvListImageFormatsReply rep; xvImageFormatInfo info; REQUEST(xvListImageFormatsReq); REQUEST_SIZE_MATCH(xvListImageFormatsReq); VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); rep = (...
0
17,463
Analyze the following 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 ssize_t aac_show_bios_version(struct device *device, struct device_attribute *attr, char *buf) { struct aac_dev *dev = (struct aac_dev*)class_to_shost(device)->hostdata; int len, tmp; tmp = le32_to_cpu(dev->adapter_info.biosrev); len = snprintf(buf, PAGE_SIZE, "%d.%d-%d[%d]\n", tm...
0
28,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: ServiceWorkerProviderHost* ServiceWorkerContextCore::GetProviderHost( int provider_id) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); auto found = providers_->find(provider_id); if (found == providers_->end()) return nullptr; return found->second.get(); } Commit Message: Convert FrameHo...
0
139,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: static int compat_siocwandev(struct net *net, struct compat_ifreq __user *uifr32) { compat_uptr_t uptr32; struct ifreq ifr; void __user *saved; int err; if (copy_from_user(&ifr, uifr32, sizeof(struct compat_ifreq))) return -EFAULT; if (get_user(uptr32, &uifr32->ifr_settings.ifs_ifsu)) return -EFAULT; ...
0
82,254
Analyze the following 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_tcp6_sock(struct seq_file *seq, struct sock *sp, int i) { const struct in6_addr *dest, *src; __u16 destp, srcp; int timer_active; unsigned long timer_expires; const struct inet_sock *inet = inet_sk(sp); const struct tcp_sock *tp = tcp_sk(sp); const struct inet_connection_sock *icsk = inet_c...
0
65,144
Analyze the following 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::RestartHangMonitorTimeout() { if (hang_monitor_timeout_) hang_monitor_timeout_->Restart(hung_renderer_delay_); } Commit Message: Check that RWHI isn't deleted manually while owned by a scoped_ptr in RVHI BUG=590284 Review URL: https://codereview.chromium.org/1747183002 Cr-Comm...
0
131,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: FrameLoadType FrameLoader::DetermineFrameLoadType( const FrameLoadRequest& request) { if (frame_->Tree().Parent() && !state_machine_.CommittedFirstRealDocumentLoad()) return kFrameLoadTypeInitialInChildFrame; if (!frame_->Tree().Parent() && !Client()->BackForwardLength()) { if (Opener() && r...
0
125,785
Analyze the following 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 bindText( sqlite3_stmt *pStmt, /* The statement to bind against */ int i, /* Index of the parameter to bind */ const void *zData, /* Pointer to the data to be bound */ int nData, /* Number of bytes of data to be bound */ void (*xDel)(void*), /* Destructor f...
0
151,662
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void GLES2DecoderImpl::DoGetSamplerParameterfv(GLuint client_id, GLenum pname, GLfloat* params, GLsizei params_size) { Sampler* sampler = GetSampler(client_id); if (!sam...
0
141,325
Analyze the following 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 int create() { int nlctrlFamily = genl_ctrl_resolve(mInfo->cmd_sock, "nlctrl"); int ret = mMsg.create(nlctrlFamily, CTRL_CMD_GETFAMILY, 0, 0); if (ret < 0) { return ret; } ret = mMsg.put_string(CTRL_ATTR_FAMILY_NAME, mName); return ret; } Commit Message: Fix use-after-free in wifi_cleanup...
0
161,939
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: lexer_scan_identifier (parser_context_t *context_p, /**< context */ bool propety_name) /**< property name */ { skip_spaces (context_p); context_p->token.line = context_p->line; context_p->token.column = context_p->column; if (context_p->source_p < context_p->source_end_p && (...
0
64,620
Analyze the following 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 long macvtap_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { return macvtap_ioctl(file, cmd, (unsigned long)compat_ptr(arg)); } Commit Message: macvtap: zerocopy: validate vectors before building skb There're several reasons that the vectors need to be validated: - Return er...
0
34,557
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ~PrintWebViewHelperTestBase() {} Commit Message: Fix print preview workflow to reflect settings of selected printer. BUG=95110 TEST=none Review URL: http://codereview.chromium.org/7831041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102242 0039d316-1c4b-4281-b951-d872f2087c98 CWE ID: CWE-399
0
97,561
Analyze the following 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 FetchManager::Loader::Dispose() { probe::detachClientRequest(execution_context_, this); fetch_manager_ = nullptr; if (threadable_loader_) { if (fetch_request_data_->Keepalive()) threadable_loader_->Detach(); else threadable_loader_->Cancel(); threadable_loader_ = nullptr; } ...
0
154,227
Analyze the following 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 dst_entry *inet_csk_route_req(const struct sock *sk, struct flowi4 *fl4, const struct request_sock *req) { const struct inet_request_sock *ireq = inet_rsk(req); struct net *net = read_pnet(&ireq->ireq_net); struct ip_options_rcu *opt = ireq->opt; struct rtable *rt; flowi4_init_outpu...
0
66,127
Analyze the following 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 WebPagePrivate::releaseLayerResources() { if (!isAcceleratedCompositingActive()) return; if (m_frameLayers) m_frameLayers->releaseLayerResources(); Platform::userInterfaceThreadMessageClient()->dispatchSyncMessage( Platform::createMethodCallMessage(&WebPagePrivate::relea...
0
104,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 inline bool ehci_periodic_enabled(EHCIState *s) { return ehci_enabled(s) && (s->usbcmd & USBCMD_PSE); } Commit Message: CWE ID: CWE-772
0
5,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: uint64 WebContentsImpl::GetUploadPosition() const { return upload_position_; } Commit Message: Cancel JavaScript dialogs when an interstitial appears. BUG=295695 TEST=See bug for repro steps. Review URL: https://chromiumcodereview.appspot.com/24360011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2250...
0
110,670