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: bool shouldInvalidateNodeListCachesForAttr<numNodeListInvalidationTypes>(const unsigned[], const QualifiedName&) { return false; } Commit Message: Change Document::detach() to RELEASE_ASSERT all subframes are gone. BUG=556724,577105 Review URL: https://codereview.chromium.org/1667573002 Cr-Commit-Position...
0
124,527
Analyze the following 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 QQuickWebView::canGoForward() const { Q_D(const QQuickWebView); return d->webPageProxy->canGoForward(); } Commit Message: [Qt][WK2] Allow transparent WebViews https://bugs.webkit.org/show_bug.cgi?id=80608 Reviewed by Tor Arne Vestbø. Added support for transparentBackground in QQuickWebViewExperime...
0
101,677
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int ati_remote2_setkeycode(struct input_dev *idev, const struct input_keymap_entry *ke, unsigned int *old_keycode) { struct ati_remote2 *ar2 = input_get_drvdata(idev); unsigned int mode; int offset; unsigned int index; unsigned int scancode; if (ke->flags & INPUT_KEYMAP_BY_INDEX) { if ...
0
55,226
Analyze the following 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_set_matrix(pdf_text_object_state *tos, float a, float b, float c, float d, float e, float f) { tos->tm.a = a; tos->tm.b = b; tos->tm.c = c; tos->tm.d = d; tos->tm.e = e; tos->tm.f = f; tos->tlm = tos->tm; } Commit Message: CWE ID: CWE-20
0
598
Analyze the following 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 ImeObserver::ConvertInputContextSpellCheck( ui::IMEEngineHandlerInterface::InputContext input_context) { return !(input_context.flags & ui::TEXT_INPUT_FLAG_SPELLCHECK_OFF); } Commit Message: Fix the regression caused by http://crrev.com/c/1288350. Bug: 900124,856135 Change-Id: Ie11ad406bd1ea383dc2a83...
0
144,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: bool SendTabToSelfEntry::IsExpired(base::Time current_time) const { return (current_time.ToDeltaSinceWindowsEpoch() - GetSharedTime().ToDeltaSinceWindowsEpoch() >= kExpiryTime); } Commit Message: [SendTabToSelf] Added logic to display an infobar for the feature. This CL is one of man...
0
142,397
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: encode_SET_L4_DST_PORT(const struct ofpact_l4_port *l4_port, enum ofp_version ofp_version, struct ofpbuf *out) { uint8_t proto = l4_port->flow_ip_proto; enum mf_field_id field = (proto == IPPROTO_TCP ? MFF_TCP_DST : proto == IPPRO...
0
76,894
Analyze the following 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 CSPSourceList::allowEval() const { return m_allowEval; } Commit Message: Disallow CSP source * matching of data:, blob:, and filesystem: URLs The CSP spec specifically excludes matching of data:, blob:, and filesystem: URLs with the source '*' wildcard. This adds checks to make sure that doesn't happen...
0
125,386
Analyze the following 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_drop_document(fz_context *ctx, pdf_document *doc) { fz_drop_document(ctx, &doc->super); } Commit Message: CWE ID: CWE-119
0
16,697
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: wb_print(netdissect_options *ndo, register const void *hdr, register u_int len) { register const struct pkt_hdr *ph; ph = (const struct pkt_hdr *)hdr; if (len < sizeof(*ph) || !ND_TTEST(*ph)) { ND_PRINT((ndo, "%s", tstr)); return; } len -= sizeof(*ph); if (ph->ph_flags) ND_PRINT((ndo, "*"))...
1
167,879
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: blink::WebDisplayMode Browser::GetDisplayMode( const WebContents* web_contents) const { if (window_->IsFullscreen()) return blink::WebDisplayModeFullscreen; if (is_type_popup()) return blink::WebDisplayModeStandalone; return blink::WebDisplayModeBrowser; } Commit Message: Don't focus the loca...
0
138,998
Analyze the following 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 sycc420_to_rgb(opj_image_t *img) { int *d0, *d1, *d2, *r, *g, *b, *nr, *ng, *nb; const int *y, *cb, *cr, *ny; size_t maxw, maxh, max, offx, loopmaxw, offy, loopmaxh; int offset, upb; size_t i; upb = (int)img->comps[0].prec; offset = 1 << (upb - 1); upb = (1 << upb) - 1...
0
91,909
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: irc_server_get_prefix_char_index (struct t_irc_server *server, char prefix_char) { const char *prefix_chars; char *pos; if (server) { prefix_chars = irc_server_get_prefix_chars (server); pos = strchr (prefix_chars, prefix_char); if (po...
0
3,487
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: circle_div_pt(PG_FUNCTION_ARGS) { CIRCLE *circle = PG_GETARG_CIRCLE_P(0); Point *point = PG_GETARG_POINT_P(1); CIRCLE *result; Point *p; result = circle_copy(circle); p = DatumGetPointP(DirectFunctionCall2(point_div, PointPGetDatum(&circle->center), PointPGetDatum(poi...
0
38,847
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static bool HasAccessorsImpl(JSObject* holder, FixedArrayBase* backing_store) { FixedArray* parameter_map = FixedArray::cast(backing_store); FixedArrayBase* arguments = FixedArrayBase::cast(parameter_map->get(1)); return ArgumentsAccessor::HasAccessorsImpl(holder, arguments); } Commit Message: Backport: Fi...
0
163,129
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: sp<MediaPlayerBase> MediaPlayerService::Client::setDataSource_pre( player_type playerType) { ALOGV("player type = %d", playerType); sp<MediaPlayerBase> p = createPlayer(playerType); if (p == NULL) { return p; } sp<IServiceManager> sm = defaultServiceManager(); sp<IBinder> binder = sm-...
0
158,032
Analyze the following 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 voidMethodSequenceStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); TestObjectPythonV8Internal::voidMethodSequenceStringArgMethod(info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); } Commit Message: do...
0
122,877
Analyze the following 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::OnClientError( CloudPolicyClient* cloud_policy_client) { DCHECK_EQ(client(), cloud_policy_client); if (wait_for_policy_fetch_) { UMA_HISTOGRAM_SPARSE_SLOWLY(kUMAInitialFetchClientError, cloud_policy_client->status()); } CancelWai...
0
110,392
Analyze the following 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 handle_vmptrld(struct kvm_vcpu *vcpu) { struct vcpu_vmx *vmx = to_vmx(vcpu); gpa_t vmptr; u32 exec_control; if (!nested_vmx_check_permission(vcpu)) return 1; if (nested_vmx_check_vmptr(vcpu, EXIT_REASON_VMPTRLD, &vmptr)) return 1; if (vmx->nested.current_vmptr != vmptr) { struct vmcs12 *...
0
37,095
Analyze the following 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_av_event_deep_copy(uint16_t event, char* p_dest, char* p_src) { BTIF_TRACE_DEBUG("%s", __func__); tBTA_AV* av_src = (tBTA_AV*)p_src; tBTA_AV* av_dest = (tBTA_AV*)p_dest; maybe_non_aligned_memcpy(av_dest, av_src, sizeof(*av_src)); switch (event) { case BTA_AV_META_MSG_EVT: if (av_src->meta_ms...
1
174,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 reflectUrlStringAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) { v8::Local<v8::Object> holder = info.Holder(); TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(holder); v8SetReturnValueString(info, impl->getURLAttribute(HTMLNames::reflecturlstringattributeAt...
0
119,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 int load_segment_descriptor(struct x86_emulate_ctxt *ctxt, u16 selector, int seg) { u8 cpl = ctxt->ops->cpl(ctxt); return __load_segment_descriptor(ctxt, selector, seg, cpl, false, NULL); } Commit Message: KVM: emulate: avoid accessing NULL ctxt->memopp A failure to decode the instruction can ca...
0
35,581
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static inline int netlink_allowed(const struct socket *sock, unsigned int flag) { return (nl_table[sock->sk->sk_protocol].flags & flag) || ns_capable(sock_net(sock->sk)->user_ns, CAP_NET_ADMIN); } Commit Message: netlink: Fix dump skb leak/double free When we free cb->skb after a dump, we do it after releasi...
0
47,734
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void op_attr_value_clear(void *attr) { uint32_t *v = attr; *v = 0; } Commit Message: svc: check for allocation overflow in crypto calls part 2 Without checking for overflow there is a risk of allocating a buffer with size smaller than anticipated and as a consequence of that it might lead to a heap ba...
0
86,850
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: DownloadRequestLimiter::GetDownloadState( content::WebContents* web_contents, content::WebContents* originating_web_contents, bool create) { DCHECK(web_contents); StateMap::iterator i = state_map_.find(web_contents); if (i != state_map_.end()) return i->second; if (!create) return nul...
0
154,724
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void booleanAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) { TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); v8SetReturnValueBool(info, imp->booleanAttribute()); } Commit Message: document.location bindings fix BUG=352374 R=jochen@chromium.org Revi...
0
122,154
Analyze the following 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 er_supported(ERContext *s) { if(s->avctx->hwaccel && s->avctx->hwaccel->decode_slice || !s->cur_pic.f || s->cur_pic.field_picture || s->avctx->profile == FF_PROFILE_MPEG4_SIMPLE_...
1
169,154
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: rule_criteria_init(struct rule_criteria *criteria, uint8_t table_id, const struct match *match, int priority, ovs_version_t version, ovs_be64 cookie, ovs_be64 cookie_mask, ofp_port_t out_port, uint32_t out_group) { criteria->table_id ...
0
77,427
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xmlErrAttributeDup(xmlParserCtxtPtr ctxt, const xmlChar * prefix, const xmlChar * localname) { if ((ctxt != NULL) && (ctxt->disableSAX != 0) && (ctxt->instate == XML_PARSER_EOF)) return; if (ctxt != NULL) ctxt->errNo = XML_ERR_ATTRIBUTE_REDEFINED; if (prefix == NULL) ...
0
59,430
Analyze the following 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 MeasureOverloadedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) { ExceptionState exception_state(info.GetIsolate(), ExceptionState::kExecutionContext, "TestObject", "measureOverloadedMethod"); TestObject* impl = V8TestObject::ToImpl(info.Holder()); int32_t arg; arg = NativeVa...
0
134,872
Analyze the following 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 NavigateToURLImpl(const GURL& dest_url) const { EXPECT_TRUE(prerender_manager()->FindEntry(dest_url_) != NULL); ui_test_utils::NavigateToURL(browser(), dest_url); EXPECT_TRUE(prerender_manager()->FindEntry(dest_url_) == NULL); if (call_javascript_) { bool display_test_result = fals...
0
99,959
Analyze the following 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 ath_tx_aggr_sleep(struct ieee80211_sta *sta, struct ath_softc *sc, struct ath_node *an) { struct ath_atx_tid *tid; struct ath_atx_ac *ac; struct ath_txq *txq; bool buffered; int tidno; for (tidno = 0, tid = &an->tid[tidno]; tidno < IEEE80211_NUM_TIDS; tidno++, tid++) { if (!tid->s...
1
166,395
Analyze the following 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 RebuildState(const std::vector<flags_ui::FeatureEntry>& entries) { flags_state_ = std::make_unique<flags_ui::FlagsState>(entries, this); } Commit Message: Add feature and flag to enable incognito Chrome Custom Tabs kCCTIncognito feature and flag are added to enable/disable incognito Chrome Custom T...
0
137,033
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: prism_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p) { u_int caplen = h->caplen; u_int length = h->len; uint32_t msgcode; if (caplen < 4) { ND_PRINT((ndo, "%s", tstr)); return caplen; } msgcode = EXTRACT_32BITS(p); if (msgcode == WLANCAP_MAGIC_COOKIE_V1...
0
62,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: void DocumentLoader::DidCommitNavigation() { if (GetFrameLoader().StateMachine()->CreatingInitialEmptyDocument()) return; if (!frame_->Loader().StateMachine()->CommittedMultipleRealLoads() && load_type_ == kFrameLoadTypeStandard) { frame_->Loader().StateMachine()->AdvanceTo( FrameLoader...
0
134,443
Analyze the following 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 wp512_mod_init(void) { return crypto_register_shashes(wp_algs, ARRAY_SIZE(wp_algs)); } Commit Message: crypto: prefix module autoloading with "crypto-" This prefixes all crypto module loading with "crypto-" so we never run the risk of exposing module auto-loading to userspace via a crypto API...
0
47,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: xmlParseXMLDecl(xmlParserCtxtPtr ctxt) { xmlChar *version; /* * This value for standalone indicates that the document has an * XML declaration but it does not have a standalone attribute. * It will be overwritten later if a standalone attribute is found. */ ctxt->input->standalone = ...
0
163,506
Analyze the following 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 FrameSelection::SelectionHasFocus() const { GetDocument().UpdateStyleAndLayoutIgnorePendingStylesheets(); if (ComputeVisibleSelectionInFlatTree().IsNone()) return false; const Node* current = ComputeVisibleSelectionInFlatTree().Start().ComputeContainerNode(); if (!current) return false;...
0
125,861
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: HandleCacheRedirectRequest(const net::test_server::HttpRequest& request) { if (!base::StartsWith(request.relative_url, "/cached-redirect?", base::CompareCase::INSENSITIVE_ASCII)) { return std::unique_ptr<net::test_server::HttpResponse>(); } GURL request_url = request...
0
136,877
Analyze the following 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::didClearWindowObject(WebFrame* frame) { FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidClearWindowObject(frame)); GURL frame_url = frame->document().url(); if (BindingsPolicy::is_web_ui_enabled(enabled_bindings_) && (frame_url.SchemeIs(chrome::kChromeUISchem...
0
99,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 struct tcp_md5sig_key *tcp_v6_md5_do_lookup(const struct sock *sk, const struct in6_addr *addr) { return tcp_md5_do_lookup(sk, (union tcp_md5_addr *)addr, AF_INET6); } Commit Message: tcp: take care of truncations done by sk_filter() With syzkaller help, Marco Grassi found a bug in TCP stack, c...
0
49,297
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void ssh_pkt_addstring(struct Packet *pkt, const char *data) { ssh_pkt_addstring_start(pkt); ssh_pkt_addstring_str(pkt, data); } Commit Message: CWE ID: CWE-119
0
8,571
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: EntrySync* EntrySync::moveTo(DirectoryEntrySync* parent, const String& name, ExceptionState& exceptionState) const { RefPtr<EntrySyncCallbackHelper> helper = EntrySyncCallbackHelper::create(); m_fileSystem->move(this, parent, name, helper->successCallback(), helper->errorCallback(), DOMFileSystemBase::...
1
171,422
Analyze the following 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
161,427
Analyze the following 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 BrowserCommandController::TabDetachedAt(TabContents* contents, int index) { RemoveInterstitialObservers(contents); } Commit Message: Remove TabContents from TabStripModelObserver::TabDetachedAt. BUG=107201 TEST=no visible change Review URL: https://chromiumcodereview.appspot.com/11293205 git-svn-id:...
1
171,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: PHP_FUNCTION(file) { char *filename; int filename_len; char *target_buf=NULL, *p, *s, *e; register int i = 0; int target_len; char eol_marker = '\n'; long flags = 0; zend_bool use_include_path; zend_bool include_new_line; zend_bool skip_blank_lines; php_stream *stream; zval *zcontext = NULL; php_stre...
0
52,149
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: RenderThreadImpl::~RenderThreadImpl() { FOR_EACH_OBSERVER( RenderProcessObserver, observers_, OnRenderProcessShutdown()); if (web_database_observer_impl_.get()) web_database_observer_impl_->WaitForAllDatabasesToClose(); RemoveFilter(devtools_agent_message_filter_.get()); devtools_agent_message...
0
107,124
Analyze the following 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 int _object_init_ex(zval *arg, zend_class_entry *class_type ZEND_FILE_LINE_DC TSRMLS_DC) /* {{{ */ { return _object_and_properties_init(arg, class_type, 0 ZEND_FILE_LINE_RELAY_CC TSRMLS_CC); } /* }}} */ Commit Message: CWE ID: CWE-416
0
13,714
Analyze the following 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 nl80211_valid_4addr(struct cfg80211_registered_device *rdev, struct net_device *netdev, u8 use_4addr, enum nl80211_iftype iftype) { if (!use_4addr) { if (netdev && (netdev->priv_flags & IFF_BRIDGE_PORT)) return -EBUSY; return 0; } switch (iftype) { case NL80211_IFTYPE_AP...
0
26,781
Analyze the following 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 LargeObjectPage::removeFromHeap() { static_cast<LargeObjectArena*>(arena())->freeLargeObjectPage(this); } Commit Message: Call HeapObjectHeader::checkHeader solely for its side-effect. This requires changing its signature. This is a preliminary stage to making it private. BUG=633030 Review-Url: https:/...
0
147,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: ignorableWhitespaceDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len) { char output[40]; int i; callbacks++; if (quiet) return; for (i = 0;(i<len) && (i < 30);i++) output[i] = ch[i]; output[i] = 0; fprintf(SAXdebug, "SAX.ignorableWhitespace(%s, %d)\n", output, len); } Co...
0
59,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: TestingProfile* GetProfile() { return profile_.get(); } Commit Message: Don't downcast DownloadManagerDelegate to ChromeDownloadManagerDelegate. DownloadManager has public SetDelegate method and tests and or other subsystems can install their own implementations of the delegate. Bug: 805905 Change-Id: ...
0
154,274
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void LayerWebKitThread::setBounds(const IntSize& size) { if (m_bounds == size) return; bool firstResize = !m_bounds.width() && !m_bounds.height() && size.width() && size.height(); m_bounds = size; boundsChanged(); if (firstResize) setNeedsDisplay(); else setNeed...
0
119,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: QuicPacket* ConstructDataPacket(QuicPacketSequenceNumber number, QuicFecGroupNumber fec_group) { header_.packet_sequence_number = number; header_.flags = PACKET_FLAGS_NONE; header_.fec_group = fec_group; QuicFrames frames; QuicFrame frame(&frame1_); ...
1
171,410
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int igmp_marksources(struct ip_mc_list *pmc, int nsrcs, __be32 *srcs) { struct ip_sf_list *psf; int i, scount; if (pmc->sfmode == MCAST_EXCLUDE) return igmp_xmarksources(pmc, nsrcs, srcs); /* mark INCLUDE-mode sources */ scount = 0; for (psf=pmc->sources; psf; psf=psf->sf_next) { if (scount == ...
0
21,594
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: do_trap_no_signal(struct task_struct *tsk, int trapnr, char *str, struct pt_regs *regs, long error_code) { if (v8086_mode(regs)) { /* * Traps 0, 1, 3, 4, and 5 should be forwarded to vm86. * On nmi (interrupt 2), do_trap should not be called. */ if (trapnr < X86_TRAP_UD) { if (!handle_vm86_tr...
0
83,496
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: BpMemory::~BpMemory() { } Commit Message: Sanity check IMemory access versus underlying mmap Bug 26877992 Change-Id: Ibbf4b1061e4675e4e96bc944a865b53eaf6984fe CWE ID: CWE-264
0
161,498
Analyze the following 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 AudioOutputDeviceTest::WaitUntilRenderCallback() { io_loop_.PostDelayedTask(FROM_HERE, MessageLoop::QuitClosure(), TestTimeouts::action_timeout()); io_loop_.Run(); } Commit Message: Revert r157378 as it caused WebRTC to dereference null pointers when restarting a call. I've k...
0
103,040
Analyze the following 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 ChromePluginServiceFilter::RegisterResourceContext( PluginPrefs* plugin_prefs, const void* context) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); base::AutoLock lock(lock_); resource_context_map_[context] = plugin_prefs; } Commit Message: Follow-on fixes and naming changes for https...
0
116,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: void SendKeyEvent(ui::KeyboardCode key_code) { SendKeyEvent(key_code, false, false); } Commit Message: MacViews: Enable secure text input for password Textfields. In Cocoa the NSTextInputContext automatically enables secure text input when activated and it's in the secure text entry mode. RenderWidgetH...
0
126,495
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: do_rc_files(Session *s, const char *shell) { FILE *f = NULL; char cmd[1024]; int do_xauth; struct stat st; do_xauth = s->display != NULL && s->auth_proto != NULL && s->auth_data != NULL; /* ignore _PATH_SSH_USER_RC for subsystems and admin forced commands */ if (!s->is_subsystem && options.adm_force...
0
14,395
Analyze the following 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 ctl_table * __net_init ipv6_icmp_sysctl_init(struct net *net) { struct ctl_table *table; table = kmemdup(ipv6_icmp_table_template, sizeof(ipv6_icmp_table_template), GFP_KERNEL); if (table) table[0].data = &net->ipv6.sysctl.icmpv6_time; return table; } Commit Message: net: handle no dst on s...
0
47,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: static int unix_dgram_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) { struct sock *sk = sock->sk; struct net *net = sock_net(sk); struct unix_sock *u = unix_sk(sk); DECLARE_SOCKADDR(struct sockaddr_un *, sunaddr, msg->msg_name); struct sock *other = NULL; int namelen = 0; /* fake GCC...
0
54,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: void RunCloseWithAppMenuCallback(Browser* browser) { base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindOnce(&CloseWindowCallback, browser)); chrome::ShowAppMenu(browser); } Commit Message: If a dialog is shown, drop fullscreen. BUG=875066, 817809, 792876, 812769, 813815 TEST=included...
0
146,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: cf2_builder_moveTo( CF2_OutlineCallbacks callbacks, const CF2_CallbackParams params ) { /* downcast the object pointer */ CF2_Outline outline = (CF2_Outline)callbacks; CFF_Builder* builder; (void)params; /* only used in debug mode */ FT_ASSERT( outl...
0
13,076
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void check_mutex_acquired(void) { BUG_ON(!mutex_is_locked(&slab_mutex)); } Commit Message: mm/slab.c: fix SLAB freelist randomization duplicate entries This patch fixes a bug in the freelist randomization code. When a high random number is used, the freelist will contain duplicate entries. It will res...
0
68,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: static int codeEqualityTerm( Parse *pParse, /* The parsing context */ WhereTerm *pTerm, /* The term of the WHERE clause to be coded */ WhereLevel *pLevel, /* The level of the FROM clause we are working on */ int iEq, /* Index of the equality term within this level */ int bRev, ...
0
151,711
Analyze the following 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 IncrementRefCount(const std::string& uuid) { context_->IncrementBlobRefCount(uuid); } Commit Message: [BlobStorage] Fixing potential overflow Bug: 779314 Change-Id: I74612639d20544e4c12230569c7b88fbe669ec03 Reviewed-on: https://chromium-review.googlesource.com/747725 Reviewed-by: Victor Costan <pwn...
0
150,313
Analyze the following 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::WebInputEvent::Type GetTouchEventType(const std::string& type) { if (type == Input::DispatchTouchEvent::TypeEnum::TouchStart) return blink::WebInputEvent::kTouchStart; if (type == Input::DispatchTouchEvent::TypeEnum::TouchEnd) return blink::WebInputEvent::kTouchEnd; if (type == Input::Dispatc...
0
148,467
Analyze the following 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_enable_log_dirty_pt_masked(struct kvm *kvm, struct kvm_memory_slot *memslot, gfn_t offset, unsigned long mask) { kvm_mmu_clear_dirty_pt_masked(kvm, memslot, offset, mask); } Commit Message: KVM: x86: work around infinite loop in microcode when #AC is delivered It was found that ...
0
42,743
Analyze the following 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 RuntimeEnabledOverloadedVoidMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) { ExceptionState exception_state(info.GetIsolate(), ExceptionState::kExecutionContext, "TestObject", "runtimeEnabledOverloadedVoidMethod"); TestObject* impl = V8TestObject::ToImpl(info.Holder()); int32_t...
0
135,130
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: cifs_find_tcon(struct cifsSesInfo *ses, const char *unc) { struct list_head *tmp; struct cifsTconInfo *tcon; spin_lock(&cifs_tcp_ses_lock); list_for_each(tmp, &ses->tcon_list) { tcon = list_entry(tmp, struct cifsTconInfo, tcon_list); if (tcon->tidStatus == CifsExiting) continue; if (strncmp(tcon->tr...
0
24,482
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gboolean webkit_web_view_can_show_mime_type(WebKitWebView* webView, const gchar* mimeType) { g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), FALSE); Frame* frame = core(webkit_web_view_get_main_frame(webView)); if (FrameLoader* loader = frame->loader()) return loader->canShowMIMEType(String...
0
100,527
Analyze the following 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 open_handlers(void) { struct dirent **dirent_list; int num_handlers; int num_good = 0; int i; num_handlers = scandir(handler_path, &dirent_list, is_handler, alphasort); if (num_handlers == -1) return -1; for (i = 0; i < num_handlers; i++) { char *path; void *handle; int (*handler_init...
0
59,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 ACodec::UninitializedState::onSetup( const sp<AMessage> &msg) { if (onAllocateComponent(msg) && mCodec->mLoadedState->onConfigureComponent(msg)) { mCodec->mLoadedState->onStart(); } } Commit Message: Fix initialization of AAC presentation struct Otherwise the new size checks trip on this. Bug:...
0
164,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 RenderWidgetHostImpl::ScheduleComposite() { if (is_hidden_ || !is_accelerated_compositing_active_) { return; } if (!repaint_ack_pending_ && !resize_ack_pending_ && !view_being_painted_) { repaint_start_time_ = TimeTicks::Now(); repaint_ack_pending_ = true; Send(new ViewMsg_Repaint(ro...
0
114,697
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: DOMHighResTimeStamp PerformanceNavigationTiming::unloadEventStart() const { bool allow_redirect_details = GetAllowRedirectDetails(); DocumentLoadTiming* timing = GetDocumentLoadTiming(); if (!allow_redirect_details || !timing || !timing->HasSameOriginAsPreviousDocument()) return 0; return Perfo...
0
155,558
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gray_cubic_to( const FT_Vector* control1, const FT_Vector* control2, const FT_Vector* to, PWorker worker ) { gray_render_cubic( RAS_VAR_ control1, control2, to ); return 0; } Commit Message: CWE ID: CWE-189
0
10,298
Analyze the following 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 GetInputValue(RenderFrameHostImpl* frame) { std::string result; EXPECT_TRUE(ExecuteScriptAndExtractString( frame, "window.domAutomationController.send(input.value);", &result)); return result; } Commit Message: Avoid sharing process for blob URLs with null origin. Previously,...
0
154,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 WebContentsImpl::ShouldTransferNavigation(bool is_main_frame_navigation) { if (!delegate_) return true; return delegate_->ShouldTransferNavigation(is_main_frame_navigation); } Commit Message: If JavaScript shows a dialog, cause the page to lose fullscreen. BUG=670135, 550017, 726761, 728276 Review...
0
135,893
Analyze the following 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 ArcVoiceInteractionFrameworkServiceFactory* GetInstance() { return base::Singleton<ArcVoiceInteractionFrameworkServiceFactory>::get(); } Commit Message: arc: add test for blocking incognito windows in screenshot BUG=778852 TEST=ArcVoiceInteractionFrameworkServiceUnittest. CapturingScreenshotBlo...
0
152,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: static int rsa_item_verify(EVP_MD_CTX *ctx, const ASN1_ITEM *it, void *asn, X509_ALGOR *sigalg, ASN1_BIT_STRING *sig, EVP_PKEY *pkey) { int rv = -1; int saltlen; const EVP_MD *mgf1md = NULL, *md = NULL; RSA_PSS_PARAMS *pss; X509_ALGOR *mask...
0
3,615
Analyze the following 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 cma_check_linklocal(struct rdma_dev_addr *dev_addr, struct sockaddr *addr) { #if IS_ENABLED(CONFIG_IPV6) struct sockaddr_in6 *sin6; if (addr->sa_family != AF_INET6) return 0; sin6 = (struct sockaddr_in6 *) addr; if (!(ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LINKLOCAL)) return ...
0
38,462
Analyze the following 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 pirlvl_destroy(jpc_pirlvl_t *rlvl) { if (rlvl->prclyrnos) { jas_free(rlvl->prclyrnos); } } Commit Message: Fixed an integer overflow problem in the JPC codec that later resulted in the use of uninitialized data. CWE ID: CWE-190
0
70,368
Analyze the following 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 js_replace(js_State* J, int idx) { idx = idx < 0 ? TOP + idx : BOT + idx; if (idx < BOT || idx >= TOP) js_error(J, "stack error!"); STACK[idx] = STACK[--TOP]; } Commit Message: CWE ID: CWE-119
0
13,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: v8::Local<v8::Object> Document::wrap(v8::Isolate* isolate, v8::Local<v8::Object> creationContext) { RefPtrWillBeRawPtr<Document> protect(this); ASSERT(!DOMDataStore::containsWrapper(this, isolate)); const WrapperTypeInfo* wrapperType = wrapperTypeInfo(); if (frame() && frame()->script().initial...
0
124,576
Analyze the following 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 RenderViewHostImpl::OnUpdateState(int32 page_id, const std::string& state) { delegate_->UpdateState(this, page_id, state); } Commit Message: Filter more incoming URLs in the CreateWindow path. BUG=170532 Review URL: https://chromiumcodereview.appspot.com/12036002 ...
0
117,282
Analyze the following 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 h2_session_ev_stream_ready(h2_session *session, int arg, const char *msg) { switch (session->state) { case H2_SESSION_ST_WAIT: transit(session, "stream ready", H2_SESSION_ST_BUSY); break; default: /* nop */ break; } } Commit Mess...
0
48,652
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: read_colormap(bmp_source_ptr sinfo, int cmaplen, int mapentrysize) /* Read the colormap from a BMP file */ { int i, gray = 1; switch (mapentrysize) { case 3: /* BGR format (occurs in OS/2 files) */ for (i = 0; i < cmaplen; i++) { sinfo->colormap[2][i] = (JSAMPLE)read_byte(sinfo); sinfo-...
0
84,769
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: http_PutStatus(struct http *to, uint16_t status) { assert(status >= 100 && status <= 999); to->status = status; } Commit Message: Check for duplicate Content-Length headers in requests If a duplicate CL header is in the request, we fail the request with a 400 (Bad Request) Fix a test case that was sending d...
0
56,431
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: FPSObserver::FPSObserver( AutomationProvider* automation, IPC::Message* reply_message, base::ProcessId renderer_id, int routing_id) : automation_(automation->AsWeakPtr()), reply_message_(reply_message), renderer_id_(renderer_id), routing_id_(routing_id) { registrar_.Add( ...
0
117,527
Analyze the following 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 fib_nh_exception *fnhe_oldest(struct fnhe_hash_bucket *hash) { struct fib_nh_exception *fnhe, *oldest; oldest = rcu_dereference(hash->chain); for (fnhe = rcu_dereference(oldest->fnhe_next); fnhe; fnhe = rcu_dereference(fnhe->fnhe_next)) { if (time_before(fnhe->fnhe_stamp, oldest->fnhe_st...
0
44,317
Analyze the following 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 toggle_fpga_eeprom_bus(bool cpu_own) { qrio_gpio_direction_output(GPIO_A, PROM_SEL_L, !cpu_own); } Commit Message: Merge branch '2020-01-22-master-imports' - Re-add U8500 platform support - Add bcm968360bg support - Assorted Keymile fixes - Other assorted bugfixes CWE ID: CWE-787
1
169,634
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: XRenderHasDepths (Display *dpy) { int s; for (s = 0; s < ScreenCount (dpy); s++) { CARD32 depths = 0; CARD32 missing; Screen *scr = ScreenOfDisplay (dpy, s); int d; for (d = 0; d < scr->ndepths; d++) depths |= DEPTH_MASK(scr->depths[d].depth); missing = ~depths & REQUI...
0
8,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 mpeg4_get_block_length(MpegEncContext *s, int16_t *block, int n, int intra_dc, uint8_t *scan_table) { int i, last_non_zero; uint8_t *len_tab; const int last_index = s->block_last_index[n]; int len = 0; if (s->mb_in...
0
81,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 irqreturn_t irq_handler(int intno, void *dev_id) { int irq_bit; unsigned long flags; spin_lock_irqsave(&irqbits_lock, flags); irq_bit = 1 << intno; if ((irqbits & irq_bit) || !vm86_irqs[intno].tsk) goto out; irqbits |= irq_bit; if (vm86_irqs[intno].sig) send_sig(vm86_irqs[intno].sig, vm86_irqs[...
0
20,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: static int no_givdecrypt(struct skcipher_givcrypt_request *req) { return -ENOSYS; } Commit Message: crypto: user - fix info leaks in report API Three errors resulting in kernel memory disclosure: 1/ The structures used for the netlink based crypto algorithm report API are located on the stack. As snprintf() d...
0
31,202
Analyze the following 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 struct task_struct *task_of(struct sched_entity *se) { return container_of(se, struct task_struct, se); } Commit Message: sched/fair: Fix infinite loop in update_blocked_averages() by reverting a9e7f6544b9c Zhipeng Xie, Xie XiuQi and Sargun Dhillon reported lockups in the scheduler under high loa...
0
92,720
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: list_del_event(struct perf_event *event, struct perf_event_context *ctx) { struct perf_cpu_context *cpuctx; /* * We can have double detach due to exit/hot-unplug + close. */ if (!(event->attach_state & PERF_ATTACH_CONTEXT)) return; event->attach_state &= ~PERF_ATTACH_CONTEXT; if (is_cgroup_event(even...
0
31,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: status_t MediaPlayer::setDataSource(const sp<IStreamSource> &source) { ALOGV("setDataSource"); status_t err = UNKNOWN_ERROR; const sp<IMediaPlayerService>& service(getMediaPlayerService()); if (service != 0) { sp<IMediaPlayer> player(service->create(this, mAudioSessionId)); ...
1
173,539