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: httpd_start_request( httpd_conn* hc, struct timeval* nowP ) { int r; /* Really start the request. */ r = really_start_request( hc, nowP ); /* And return the status. */ return r; } Commit Message: Fix heap buffer overflow in de_dotdot CWE ID: CWE-119
0
24,336
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: e1000e_do_ps(E1000ECore *core, struct NetRxPkt *pkt, size_t *hdr_len) { bool isip4, isip6, isudp, istcp; bool fragment; if (!e1000e_rx_use_ps_descriptor(core)) { return false; } net_rx_pkt_get_protocols(pkt, &isip4, &isip6, &isudp, &istcp); if (isip4) { fragment = net_rx...
0
16,977
Analyze the following 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
15,383
Analyze the following 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 RAnalValue *anal_fill_reg_ref(RAnal *anal, int reg, st64 size){ RAnalValue *ret = anal_fill_ai_rg (anal, reg); ret->memref = size; return ret; } Commit Message: Fix #9903 - oobread in RAnal.sh CWE ID: CWE-125
0
25,025
Analyze the following 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, mapPhar) { char *alias = NULL, *error; int alias_len = 0; long dataoffset = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!l", &alias, &alias_len, &dataoffset) == FAILURE) { return; } phar_request_initialize(TSRMLS_C); RETVAL_BOOL(phar_open_executed_filename(alias, alias_...
0
18,026
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: dissect_usb_vid_interrupt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { usb_conv_info_t *usb_conv_info; gint bytes_available; int offset = 0; usb_conv_info = (usb_conv_info_t *)data; bytes_available = tvb_reported_length_remaining(tvb, offset); col_set_str(pinfo->...
0
29,889
Analyze the following 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_set_sec_context_option( OM_uint32 *minor_status, gss_ctx_id_t *context_handle, const gss_OID desired_object, const gss_buffer_t value) { OM_uint32 ret; ret = gss_set_sec_context_option(minor_status, context_handle, desired_object, value); return (ret); } Commit Message:...
0
26,866
Analyze the following 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::SetTransformSource(std::unique_ptr<TransformSource> source) { transform_source_ = std::move(source); } Commit Message: Cleanup and remove dead code in SetFocusedElement This early-out was added in: https://crrev.com/ce8ea3446283965c7eabab592cbffe223b1cf2bc Back then, we applied fragment focus...
0
2,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 RegisterProcessForSite(RenderProcessHost* host, const GURL& site_url) { if (!HasProcess(host)) host->AddObserver(this); site_process_set_.insert(SiteProcessIDPair(site_url, host->GetID())); } Commit Message: Correct mojo::WrapSharedMemoryHandle usage Fixes some incorrect uses of mojo::Wra...
0
14,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: const char* SegmentInfo::GetWritingAppAsUTF8() const { return m_pWritingAppAsUTF8; } Commit Message: libwebm: Pull from upstream Rolling mkvparser from upstream. Primarily for fixing a bug on parsing failures with certain Opus WebM files. Upstream commit hash of this pull: 574045edd4ecbeb802ee3f1d214b55102...
1
27,215
Analyze the following 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 XMLHttpRequest::didTimeout() { RefPtr<XMLHttpRequest> protect(this); internalAbort(); clearResponse(); clearRequest(); m_error = true; m_exceptionCode = TimeoutError; if (!m_async) { m_state = DONE; m_exceptionCode = TimeoutError; return; } ...
1
13,650
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool RenderBox::canBeProgramaticallyScrolled() const { return (hasOverflowClip() && (scrollsOverflow() || (node() && node()->rendererIsEditable()))) || (node() && node()->isDocumentNode()); } Commit Message: Source/WebCore: Fix for bug 64046 - Wrong image height in absolutely positioned div in relatively pos...
0
23,610
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: z2restore(i_ctx_t *i_ctx_p) { alloc_save_t *asave; bool saveLockSafety = gs_currentdevice_inline(igs)->LockSafetyParams; int code = restore_check_save(i_ctx_p, &asave); if (code < 0) return code; while (gs_gstate_saved(gs_gstate_saved(igs))) { code = restore_page_device(i_ctx_p, igs,...
0
6,413
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static u64 tg3_calc_crc_errors(struct tg3 *tp) { struct tg3_hw_stats *hw_stats = tp->hw_stats; if (!(tp->phy_flags & TG3_PHYFLG_PHY_SERDES) && (tg3_asic_rev(tp) == ASIC_REV_5700 || tg3_asic_rev(tp) == ASIC_REV_5701)) { u32 val; if (!tg3_readphy(tp, MII_TG3_TEST1, &val)) { tg3_writephy(tp, MI...
0
17,759
Analyze the following 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 apparmor_file_free_security(struct file *file) { struct aa_file_cxt *cxt = file->f_security; aa_free_file_context(cxt); } Commit Message: AppArmor: fix oops in apparmor_setprocattr When invalid parameters are passed to apparmor_setprocattr a NULL deref oops occurs when it tries to record an audit...
0
23,002
Analyze the following 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 CustomGetterLongAttributeAttributeSetter( v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) { v8::Isolate* isolate = info.GetIsolate(); ALLOW_UNUSED_LOCAL(isolate); v8::Local<v8::Object> holder = info.Holder(); ALLOW_UNUSED_LOCAL(holder); TestObject* impl ...
0
19,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: Ins_SWAP( FT_Long* args ) { FT_Long L; L = args[0]; args[0] = args[1]; args[1] = L; } Commit Message: CWE ID: CWE-476
0
10,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: static void testInspectorDefault(InspectorTest* test, gconstpointer) { test->showInWindowAndWaitUntilMapped(GTK_WINDOW_TOPLEVEL); test->resizeView(200, 200); test->loadHtml("<html><body><p>WebKitGTK+ Inspector test</p></body></html>", 0); test->waitUntilLoadFinished(); test->showAndWaitUntilF...
1
12,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: numbered_ref_check(Node* node) { int r = 0; switch (NODE_TYPE(node)) { case NODE_LIST: case NODE_ALT: do { r = numbered_ref_check(NODE_CAR(node)); } while (r == 0 && IS_NOT_NULL(node = NODE_CDR(node))); break; case NODE_ANCHOR: if (IS_NULL(NODE_BODY(node))) break; /* fa...
0
29,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: void UserCloudPolicyManagerChromeOS::EnableWildcardLoginCheck( const std::string& username) { DCHECK(access_token_.empty()); wildcard_username_ = username; } Commit Message: Make the policy fetch for first time login blocking The CL makes policy fetching for first time login blocking for all users, exce...
0
3,605
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: const GURL& TopSitesCache::GetURLFromIterator( CanonicalURLs::const_iterator it) const { DCHECK(it != canonical_urls_.end()); return it->first.first->redirects[it->first.second]; } Commit Message: TopSites: Clear thumbnails from the cache when their URLs get removed We already cleared the thumbnails fro...
0
1,948
Analyze the following 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 ff_rtmp_packet_read_internal(URLContext *h, RTMPPacket *p, int chunk_size, RTMPPacket **prev_pkt, int *nb_prev_pkt, uint8_t hdr) { while (1) { int ret = rtmp_packet_read_one_chunk(h, p, chunk_size, prev_pkt, ...
0
5,123
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool ExtensionApiTest::RunComponentExtensionTest( const std::string& extension_name) { return RunExtensionTestImpl(extension_name, std::string(), NULL, kFlagEnableFileAccess | kFlagLoadAsComponent); } Commit Message: ...
0
26,459
Analyze the following 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 dm_deleting_md(struct mapped_device *md) { return test_bit(DMF_DELETING, &md->flags); } Commit Message: dm: fix race between dm_get_from_kobject() and __dm_destroy() The following BUG_ON was hit when testing repeat creation and removal of DM devices: kernel BUG at drivers/md/dm.c:2919! CPU: 7 PID:...
0
14,770
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: dophn_exec(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num, size_t size, off_t fsize, int *flags, int sh_num) { Elf32_Phdr ph32; Elf64_Phdr ph64; const char *linking_style = "statically"; const char *interp = ""; unsigned char nbuf[BUFSIZ]; char ibuf[BUFSIZ]; ssize_t bufsize; ...
1
20,515
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: parse_codes(struct archive_read *a) { int i, j, val, n, r; unsigned char bitlengths[MAX_SYMBOLS], zerocount, ppmd_flags; unsigned int maxorder; struct huffman_code precode; struct rar *rar = (struct rar *)(a->format->data); struct rar_br *br = &(rar->br); free_codes(a); /* Skip to the next byte ...
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: void WebContentsImpl::OnRequestPpapiBrokerPermission( int routing_id, const GURL& url, const base::FilePath& plugin_path) { if (!delegate_) { OnPpapiBrokerPermissionResult(routing_id, false); return; } if (!delegate_->RequestPpapiBrokerPermission( this, url, plugin_path, bas...
0
18,585
Analyze the following 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 RenderThreadImpl::IsWebFrameValid(WebKit::WebFrame* web_frame) { if (!web_frame) return false; // We must be shutting down. RenderViewImpl* render_view = RenderViewImpl::FromWebView(web_frame->view()); if (!render_view) return false; // We must be shutting down. return true; } Commit Messa...
0
27,300
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: device::mojom::WakeLockContext* WebContentsImpl::GetWakeLockContext() { if (!wake_lock_context_host_) wake_lock_context_host_.reset(new WakeLockContextHost(this)); return wake_lock_context_host_->GetWakeLockContext(); } Commit Message: If JavaScript shows a dialog, cause the page to lose fullscreen. BUG...
0
2,684
Analyze the following 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 HTMLElementAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) { v8::Local<v8::Object> holder = info.Holder(); TestObject* impl = V8TestObject::ToImpl(holder); V8SetReturnValueFast(info, WTF::GetPtr(impl->htmlElementAttribute()), impl); } Commit Message: bindings: Suppor...
0
28,545
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: nfs_setattr(struct dentry *dentry, struct iattr *attr) { struct inode *inode = dentry->d_inode; struct nfs_fattr fattr; int error; nfs_inc_stats(inode, NFSIOS_VFSSETATTR); /* skip mode change if it's just for clearing setuid/setgid */ if (attr->ia_valid & (ATTR_KILL_SUID | ATTR_KILL_SGID)) attr->ia_vali...
0
4,804
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gfx::Size Tab::CalculatePreferredSize() const { return gfx::Size(TabStyle::GetStandardWidth(), GetLayoutConstant(TAB_HEIGHT)); } Commit Message: Paint tab groups with the group color. * The background of TabGroupHeader now uses the group color. * The backgrounds of tabs in the group are tinted with the group ...
0
11,350
Analyze the following 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 ~WorkerTerminationObserver() {} Commit Message: DevTools: handle devtools renderer unresponsiveness during beforeunload event interception This patch fixes the crash which happenes under the following conditions: 1. DevTools window is in undocked state 2. DevTools renderer is unresponsive 3. User at...
0
6,764
Analyze the following 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 char *vhost_scsi_dump_proto_id(struct vhost_scsi_tport *tport) { switch (tport->tport_proto_id) { case SCSI_PROTOCOL_SAS: return "SAS"; case SCSI_PROTOCOL_FCP: return "FCP"; case SCSI_PROTOCOL_ISCSI: return "iSCSI"; default: break; } return "Unknown"; } Commit Message: vhost/scsi: potentia...
0
17,897
Analyze the following 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_nss_crypto(struct crypto_instance *instance) { PK11SlotInfo* crypt_slot = NULL; SECItem crypt_param; if (!cipher_to_nss[instance->crypto_cipher_type]) { return 0; } crypt_param.type = siBuffer; crypt_param.data = instance->private_key; crypt_param.len = cipher_key_len[instance->crypto_...
0
6,198
Analyze the following 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 blk_mq_delay_queue(struct blk_mq_hw_ctx *hctx, unsigned long msecs) { if (unlikely(!blk_mq_hw_queue_mapped(hctx))) return; kblockd_schedule_delayed_work_on(blk_mq_hctx_next_cpu(hctx), &hctx->delay_work, msecs_to_jiffies(msecs)); } Commit Message: blk-mq: fix race between timeout and freeing request ...
0
25,533
Analyze the following 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 netdev_rx_handler_unregister(struct net_device *dev) { ASSERT_RTNL(); RCU_INIT_POINTER(dev->rx_handler, NULL); /* a reader seeing a non NULL rx_handler in a rcu_read_lock() * section has a guarantee to see a non NULL rx_handler_data * as well. */ synchronize_net(); RCU_INIT_POINTER(dev->rx_handle...
0
9,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: static void padstr(char *str, const char *src, int len) { int i, v; for(i = 0; i < len; i++) { if (*src) v = *src++; else v = ' '; str[i^1] = v; } } Commit Message: CWE ID: CWE-399
0
24,020
Analyze the following 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 ldb_context *ldb_dn_get_ldb_context(struct ldb_dn *dn) { return dn->ldb; } Commit Message: CWE ID: CWE-200
0
13,081
Analyze the following 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 efx_fini_port(struct efx_nic *efx) { netif_dbg(efx, drv, efx->net_dev, "shut down port\n"); if (!efx->port_initialized) return; efx->phy_op->fini(efx); efx->port_initialized = false; efx->link_state.up = false; efx_link_status_changed(efx); } Commit Message: sfc: Fix maximum number of TSO ...
0
18,169
Analyze the following 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 QQuickWebViewExperimental::schemeDelegates_Append(QDeclarativeListProperty<QQuickUrlSchemeDelegate>* property, QQuickUrlSchemeDelegate *scheme) { QObject* schemeParent = property->object; scheme->setParent(schemeParent); QQuickWebViewExperimental* webViewExperimental = qobject_cast<QQuickWebViewE...
0
16,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: short HTMLElement::tabIndex() const { if (supportsFocus()) return Element::tabIndex(); return -1; } Commit Message: There are too many poorly named functions to create a fragment from markup https://bugs.webkit.org/show_bug.cgi?id=87339 Reviewed by Eric Seidel. Source/WebCore: Moved all functi...
0
20,160
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void PDFiumEngine::LoadDocument() { if (!doc_ && !doc_loader_.IsDocumentComplete() && !FPDFAvail_IsDocAvail(fpdf_availability_, &download_hints_)) { return; } if (getting_password_) return; ScopedUnsupportedFeature scoped_unsupported_feature(this); bool needs_password = false; if (TryL...
0
1,792
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void pdf_run_sc_color(fz_context *ctx, pdf_processor *proc, int n, float *color) { pdf_run_processor *pr = (pdf_run_processor *)proc; pr->dev->flags &= ~FZ_DEVFLAG_FILLCOLOR_UNDEFINED; pdf_set_color(ctx, pr, PDF_FILL, color); } Commit Message: CWE ID: CWE-416
0
22,827
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WebContentsImpl::~WebContentsImpl() { is_being_destroyed_ = true; ClearAllPowerSaveBlockers(); for (std::set<RenderWidgetHostImpl*>::iterator iter = created_widgets_.begin(); iter != created_widgets_.end(); ++iter) { (*iter)->DetachDelegate(); } created_widgets_.clear(); if (dialog_m...
0
28,869
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool GetInputText(std::string* input_text) { return ExecuteScriptAndExtractString(interstitial_->GetMainFrame(), "get_input_text()", input_text); } Commit Message: Don't show current RenderWidgetHostView while interstitial is showing. Also moves interstitial page...
0
22,388
Analyze the following 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 PaintLayerScrollableArea::HitTestResizerInFragments( const PaintLayerFragments& layer_fragments, const HitTestLocation& hit_test_location) const { if (!GetLayoutBox()->CanResize()) return false; if (layer_fragments.IsEmpty()) return false; for (int i = layer_fragments.size() - 1; i >=...
0
3,699
Analyze the following 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 void invalidate_cursor1(CirrusVGAState *s) { if (s->last_hw_cursor_size) { vga_invalidate_scanlines(&s->vga, s->last_hw_cursor_y + s->last_hw_cursor_y_start, s->last_hw_cursor_y + s->last_hw_cursor_y_end); } } Commit ...
0
12,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 WebContentsImpl::FreezePage() { SendPageMessage(new PageMsg_FreezePage(MSG_ROUTING_NONE)); } Commit Message: Force a flush of drawing to the widget when a dialog is shown. BUG=823353 TEST=as in bug Change-Id: I5da777068fc29c5638ef02d50e59d5d7b2729260 Reviewed-on: https://chromium-review.googlesource.com...
0
6,065
Analyze the following 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 OverloadedMethodD1Method(const v8::FunctionCallbackInfo<v8::Value>& info) { ExceptionState exception_state(info.GetIsolate(), ExceptionState::kExecutionContext, "TestObject", "overloadedMethodD"); TestObject* impl = V8TestObject::ToImpl(info.Holder()); int32_t long_arg; long_arg = NativeValu...
0
5,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: static inline void get_lowest_part_y(H264Context *h, int refs[2][48], int n, int height, int y_offset, int list0, int list1, int *nrefs) { int my; y_offset += 16 * (h->mb_y >> MB_FIELD(h)); if (list0) { int ref_n = ...
0
4,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: ZEND_API void shutdown_memory_manager(int silent, int full_shutdown) { zend_mm_shutdown(AG(mm_heap), full_shutdown, silent); } Commit Message: Fix bug #72742 - memory allocator fails to realloc small block to large one CWE ID: CWE-190
0
25,388
Analyze the following 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 dentry_update_name_case(struct dentry *dentry, const struct qstr *name) { BUG_ON(!inode_is_locked(dentry->d_parent->d_inode)); BUG_ON(dentry->d_name.len != name->len); /* d_lookup gives this */ spin_lock(&dentry->d_lock); write_seqcount_begin(&dentry->d_seq); memcpy((unsigned char *)dentry->d_name.name...
0
2,694
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: RenderWidgetHostImpl::RenderWidgetHostImpl(RenderWidgetHostDelegate* delegate, RenderProcessHost* process, int32_t routing_id, mojom::WidgetPtr widget, ...
0
15,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: void btm_sec_clr_temp_auth_service (BD_ADDR bda) { tBTM_SEC_DEV_REC *p_dev_rec; if ((p_dev_rec = btm_find_dev (bda)) == NULL) { BTM_TRACE_WARNING ("btm_sec_clr_temp_auth_service() - no dev CB"); return; } /* Reset the temporary authorized flag so that next time (untrusted) service is accessed...
0
8,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: static int should_end_transaction(struct btrfs_trans_handle *trans, struct btrfs_root *root) { int ret; ret = btrfs_block_rsv_check(root, &root->fs_info->global_block_rsv, 5); return ret ? 1 : 0; } Commit Message: Btrfs: fix hash overflow handling The handling for directory crc hash overflows was fair...
0
24,310
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: FileSystemManagerImpl::OperationListenerID FileSystemManagerImpl::AddOpListener( blink::mojom::FileSystemOperationListenerPtr listener) { DCHECK_CURRENTLY_ON(BrowserThread::IO); int op_id = next_operation_listener_id_++; listener.set_connection_error_handler( base::BindOnce(&FileSystemManagerImpl:...
0
10,695
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: iperf_get_test_unit_format(struct iperf_test *ipt) { return ipt->settings->unit_format; } Commit Message: Fix a buffer overflow / heap corruption issue that could occur if a malformed JSON string was passed on the control channel. This issue, present in the cJSON library, was already fixed upstream, so was ...
0
7,888
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num, size_t size, off_t fsize, int mach, int strtab, int *flags, uint16_t *notecount) { Elf32_Shdr sh32; Elf64_Shdr sh64; int stripped = 1, has_debug_info = 0; size_t nbadcap = 0; void *nbuf; off_t noff, coff, name_off; uint64_...
0
7,295
Analyze the following 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 GLES2DecoderPassthroughImpl::RestoreBufferBinding(unsigned int target) {} Commit Message: Add GL_PROGRAM_COMPLETION_QUERY_CHROMIUM This makes the query of GL_COMPLETION_STATUS_KHR to programs much cheaper by minimizing the round-trip to the GPU thread. Bug: 881152, 957001 Change-Id: Iadfa798af29225e752c71...
0
9,344
Analyze the following 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 ChromeClientImpl::UpdateCompositedSelection( LocalFrame* frame, const CompositedSelection& selection) { LocalFrame& local_root = frame->LocalFrameRoot(); WebFrameWidgetBase* widget = WebLocalFrameImpl::FromFrame(&local_root)->FrameWidget(); WebWidgetClient* client = widget->Client(); if...
0
29,492
Analyze the following 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_setq(void) { return test_binary_set_impl("test_binary_setq", PROTOCOL_BINARY_CMD_SETQ); } Commit Message: Issue 102: Piping null to the server will crash it CWE ID: CWE-20
0
28,846
Analyze the following 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 smi_start_processing(void *send_info, struct ipmi_smi *intf) { struct smi_info *new_smi = send_info; int enable = 0; new_smi->intf = intf; /* Set up the timer that drives the interface. */ timer_setup(&new_smi->si_timer, smi_timeout, 0); new_smi->timer_can_start = tru...
0
3,403
Analyze the following 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 php_pgsql_fd_set_option(php_stream *stream, int option, int value, void *ptrparam) /* {{{ */ { PGconn *pgsql = (PGconn *) stream->abstract; switch (option) { case PHP_STREAM_OPTION_BLOCKING: return PQ_SETNONBLOCKING(pgsql, value); default: return FAILURE; } } /* }}} */ Commit Message: CW...
0
10,080
Analyze the following 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_cr3(struct kvm_vcpu *vcpu, unsigned long cr3) { unsigned long guest_cr3; u64 eptp; guest_cr3 = cr3; if (enable_ept) { eptp = construct_eptp(cr3); vmcs_write64(EPT_POINTER, eptp); if (is_paging(vcpu) || is_guest_mode(vcpu)) guest_cr3 = kvm_read_cr3(vcpu); else guest_cr3 = vcp...
0
18,992
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: const std::string& TemplateURLRef::GetHost( const SearchTermsData& search_terms_data) const { ParseIfNecessary(search_terms_data); return host_; } Commit Message: [Contextual Search] Change "Now on Tap" to "Contextual Cards" BUG=644934 Review-Url: https://codereview.chromium.org/2361163003 Cr-Commit-Po...
0
668
Analyze the following 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 atl2_read_pci_cfg(struct atl2_hw *hw, u32 reg, u16 *value) { struct atl2_adapter *adapter = hw->back; pci_read_config_word(adapter->pdev, reg, value); } Commit Message: atl2: Disable unimplemented scatter/gather feature atl2 includes NETIF_F_SG in hw_features even though it has no support for non-...
0
29,170
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: parse_encoding( T1_Face face, T1_Loader loader ) { T1_Parser parser = &loader->parser; FT_Byte* cur; FT_Byte* limit = parser->root.limit; PSAux_Service psaux = (PSAux_Service)face->psaux; T1_Skip_Spaces( parser ); cur = parser->root.cursor; if ( cur ...
0
13,689
Analyze the following 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 fixed_mtrr_addr_seg_to_range_index(u64 addr, int seg) { struct fixed_mtrr_segment *mtrr_seg; int index; mtrr_seg = &fixed_seg_table[seg]; index = mtrr_seg->range_start; index += (addr - mtrr_seg->start) >> mtrr_seg->range_shift; return index; } Commit Message: KVM: MTRR: remove MSR 0x2f8 MSR 0...
0
10,613
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WebGLActiveInfo* WebGLRenderingContextBase::getActiveAttrib( WebGLProgram* program, GLuint index) { if (isContextLost() || !ValidateWebGLObject("getActiveAttrib", program)) return nullptr; GLuint program_id = ObjectNonZero(program); GLint max_name_length = -1; ContextGL()->GetProgramiv(program...
0
16,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: static MagickBooleanType load_level(Image *image,XCFDocInfo *inDocInfo, XCFLayerInfo *inLayerInfo) { ExceptionInfo *exception; int destLeft = 0, destTop = 0; Image* tile_image; MagickBooleanType status; MagickOffsetType saved_pos, offset, offset2; register ssize_...
0
4,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: int tcp_gro_complete(struct sk_buff *skb) { struct tcphdr *th = tcp_hdr(skb); skb->csum_start = skb_transport_header(skb) - skb->head; skb->csum_offset = offsetof(struct tcphdr, check); skb->ip_summed = CHECKSUM_PARTIAL; skb_shinfo(skb)->gso_segs = NAPI_GRO_CB(skb)->count; if (th->cwr) skb_shinfo(skb)-...
0
18,469
Analyze the following 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 dvb_usbv2_probe(struct usb_interface *intf, const struct usb_device_id *id) { int ret; struct dvb_usb_device *d; struct usb_device *udev = interface_to_usbdev(intf); struct dvb_usb_driver_info *driver_info = (struct dvb_usb_driver_info *) id->driver_info; dev_dbg(&udev->dev, "%s: bInterfaceNumber=%...
0
25,352
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MATCHER(IsLightDump, "") { return arg.level_of_detail == MemoryDumpLevelOfDetail::LIGHT; } Commit Message: memory-infra: split up memory-infra coordinator service into two This allows for heap profiler to use its own service with correct capabilities and all other instances to use the existing coordinator ser...
0
9,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: static void kvm_resume(void) { if (kvm_usage_count) { WARN_ON(raw_spin_is_locked(&kvm_lock)); hardware_enable_nolock(NULL); } } Commit Message: KVM: unmap pages from the iommu when slots are removed commit 32f6daad4651a748a58a3ab6da0611862175722f upstream. We've been adding new mappings, but not destroyi...
0
24,294
Analyze the following 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 kernel_power_off(void) { kernel_shutdown_prepare(SYSTEM_POWER_OFF); if (pm_power_off_prepare) pm_power_off_prepare(); disable_nonboot_cpus(); syscore_shutdown(); printk(KERN_EMERG "Power down.\n"); kmsg_dump(KMSG_DUMP_POWEROFF); machine_power_off(); } Commit Message: kernel/sys.c: fix stack memory ...
0
11,026
Analyze the following 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_arch_flush_shadow_all(struct kvm *kvm) { } Commit Message: ARM: KVM: prevent NULL pointer dereferences with KVM VCPU ioctl Some ARM KVM VCPU ioctls require the vCPU to be properly initialized with the KVM_ARM_VCPU_INIT ioctl before being used with further requests. KVM_RUN checks whether this initializ...
0
21,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: gfx::Size GLES2DecoderImpl::GetBoundDrawFramebufferSize() { Framebuffer* framebuffer = GetBoundDrawFramebuffer(); if (framebuffer) { return framebuffer->GetFramebufferValidSize(); } else if (offscreen_target_frame_buffer_.get()) { return offscreen_size_; } else { return surface_->GetSize(); ...
0
755
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void decode_cpe(NeAACDecStruct *hDecoder, NeAACDecFrameInfo *hInfo, bitfile *ld, uint8_t id_syn_ele) { uint8_t channels = hDecoder->fr_channels; uint8_t tag = 0; if (channels+2 > MAX_CHANNELS) { hInfo->error = 12; return; } if (hDecoder->fr_ch...
0
26,379
Analyze the following 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 ManifestManager::OnDestruct() {} Commit Message: Fail the web app manifest fetch if the document is sandboxed. This ensures that sandboxed pages are regarded as non-PWAs, and that other features in the browser process which trust the web manifest do not receive the manifest at all if the document itself ca...
0
8,294
Analyze the following 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 main(int argc, char **argv) { int exitcode = 0; int ii = 0, num_cases = 0; for (num_cases = 0; testcases[num_cases].description; num_cases++) { /* Just counting */ } printf("1..%d\n", num_cases); for (ii = 0; testcases[ii].description != NULL; ++ii) { fflush(stdout);...
0
2,619
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: put_stringbuf_mem (struct stringbuf *sb, const char *text, size_t n) { if (sb->out_of_core) return; if (sb->len + n >= sb->size) { char *p; sb->size += n + 100; p = xtryrealloc (sb->buf, sb->size); if ( !p) { sb->out_of_core = 1; return; } ...
0
17,511
Analyze the following 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 gpk_get_serialnr(sc_card_t *card, sc_serial_number_t *serial) { int r; u8 rbuf[10]; sc_apdu_t apdu; if (card->type != SC_CARD_TYPE_GPK_GPK16000) return SC_ERROR_NOT_SUPPORTED; if (!serial) return SC_ERROR_INVALID_ARGUMENTS; /* see if we have cached serial number */ if (card->serialnr.len)...
0
13,337
Analyze the following 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 ZIPARCHIVE_METHOD(unchangeArchive) { struct zip *intern; zval *this = getThis(); if (!this) { RETURN_FALSE; } ZIP_FROM_OBJECT(intern, this); if (zip_unchange_archive(intern) != 0) { RETURN_FALSE; } else { RETURN_TRUE; } } Commit Message: Fix bug #72434: ZipArchive class Use After Free Vul...
0
26,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: void BrowserView::SetDownloadShelfVisible(bool visible) { if (browser_ == NULL) return; if (visible && IsDownloadShelfVisible() != visible) { GetDownloadShelf(); } if (browser_ != NULL) browser_->UpdateDownloadShelfVisibility(visible); ToolbarSizeChanged(false); } Commit Message: Remove ...
0
28,488
Analyze the following 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 set_user_nice(struct task_struct *p, long nice) { int old_prio, delta, queued; struct rq_flags rf; struct rq *rq; if (task_nice(p) == nice || nice < MIN_NICE || nice > MAX_NICE) return; /* * We have to be careful, if called from sys_setpriority(), * the task might be in the middle of scheduling o...
0
17,296
Analyze the following 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_alloc_name_ns(struct net *net, struct net_device *dev, const char *name) { char buf[IFNAMSIZ]; int ret; ret = __dev_alloc_name(net, name, buf); if (ret >= 0) strlcpy(dev->name, buf, IFNAMSIZ); return ret; } Commit Message: tunnels: Don't apply GRO to multiple layers of enca...
0
2,658
Analyze the following 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 cbc_aes_encrypt(struct blkcipher_desc *desc, struct scatterlist *dst, struct scatterlist *src, unsigned int nbytes) { struct s390_aes_ctx *sctx = crypto_blkcipher_ctx(desc->tfm); struct blkcipher_walk walk; if (unlikely(need_fallback(sctx->key_len))) return fallback_blk_enc(desc, dst,...
0
15,942
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void V8TestObject::IndexedPropertySetterCallback( uint32_t index, v8::Local<v8::Value> v8_value, const v8::PropertyCallbackInfo<v8::Value>& info) { test_object_v8_internal::IndexedPropertySetter(index, v8_value, info); } Commit Message: bindings: Support "attribute FrozenArray<T>?" Adds a quick ha...
0
15,013
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: EGLNativeWindowType RenderingHelper::PlatformCreateWindow(int top_left_x, int top_left_y) { int depth = DefaultDepth(x_display_, DefaultScreen(x_display_)); XSetWindowAttributes window_attributes; window_attributes.background_pixel = BlackPixe...
0
29,007
Analyze the following 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 ip6_tnl_dev_setup(struct net_device *dev) { dev->netdev_ops = &ip6_tnl_netdev_ops; dev->destructor = free_netdev; dev->type = ARPHRD_TUNNEL6; dev->hard_header_len = LL_MAX_HEADER + sizeof (struct ipv6hdr); dev->mtu = ETH_DATA_LEN - sizeof (struct ipv6hdr); dev->flags |= IFF_NOARP; dev->addr_le...
0
19,799
Analyze the following 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 HTMLFormElement::didAssociateByParser() { if (!m_didFinishParsingChildren) return; m_hasElementsAssociatedByParser = true; UseCounter::count(document(), UseCounter::FormAssociationByParser); } Commit Message: Enforce form-action CSP even when form.target is present. BUG=630332 Review-Url: https:...
0
11,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: static int nf_tables_dump_sets(struct sk_buff *skb, struct netlink_callback *cb) { const struct nft_set *set; unsigned int idx, s_idx = cb->args[0]; struct nft_af_info *afi; struct nft_table *table, *cur_table = (struct nft_table *)cb->args[2]; struct net *net = sock_net(skb->sk); int cur_family = cb->args[...
0
1,977
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: conn *conn_new(const int sfd, enum conn_states init_state, const int event_flags, const int read_buffer_size, enum network_transport transport, struct event_base *base) { conn *c = conn_from_freelist(); if (NULL == c) { if (!(c = (conn *)calloc(1, s...
0
19,191
Analyze the following 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 venc_dev::venc_set_buf_req(OMX_U32 *min_buff_count, OMX_U32 *actual_buff_count, OMX_U32 *buff_size, OMX_U32 port) { (void)min_buff_count, (void)buff_size; unsigned long temp_count = 0; if (port == 0) { if (*actual_buff_count > m_sInput_buff_property.mincount) { temp_c...
0
1,089
Analyze the following 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 saved_cmdlines_show(struct seq_file *m, void *v) { char buf[TASK_COMM_LEN]; unsigned int *pid = v; __trace_find_cmdline(*pid, buf); seq_printf(m, "%d %s\n", *pid, buf); return 0; } Commit Message: Merge tag 'trace-v4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace P...
0
3,132
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ~Notification() { context.Dispose(); } Commit Message: Call didAccessInitialDocument when javascript: URLs are used. BUG=265221 TEST=See bug for repro. Review URL: https://chromiumcodereview.appspot.com/22572004 git-svn-id: svn://svn.chromium.org/blink/trunk@155790 bbb929c8...
0
14,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: WORD32 ih264d_mv_pred_ref_tfr_nby2_bmb(dec_struct_t * ps_dec, UWORD8 u1_mb_idx, UWORD8 u1_num_mbs) { parse_pmbarams_t * ps_mb_part_info; parse_part_params_t * ps_part; mv_pred_t *ps_mv_nmb, *ps_mv_nmb_start, *ps_mv_ntop, *ps_mv_ntop_star...
0
2,116
Analyze the following 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_common_ctl(struct sock *sk, struct msghdr *msg, struct sk_buff *skb) { struct ipv6_pinfo *np = inet6_sk(sk); bool is_ipv6 = skb->protocol == htons(ETH_P_IPV6); if (np->rxopt.bits.rxinfo) { struct in6_pktinfo src_info; if (is_ipv6) { src_info.ipi6_ifindex = IP6CB(skb)->iif; ...
0
25,981
Analyze the following 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_ofile_getcred(smb_ofile_t *of) { return (of->f_cr); } Commit Message: 7483 SMB flush on pipe triggers NULL pointer dereference in module smbsrv Reviewed by: Gordon Ross <gwr@nexenta.com> Reviewed by: Matt Barden <matt.barden@nexenta.com> Reviewed by: Evan Layton <evan.layton@nexenta.com> Reviewed by: Dan Mc...
0
6,554