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: void OfflinePageModelImpl::DeletePagesMissingArchiveFile( const std::set<base::FilePath>& archive_paths) { std::vector<int64_t> ids_of_pages_missing_archive_file; for (const auto& id_page_pair : offline_pages_) { if (archive_paths.count(id_page_pair.second.file_path) == 0UL) ids_of_pages_missing...
0
155,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 inline bool npidentifier_cache_find(NPIdentifierFindArgs *args, NPIdentifier *pident) { args->ident = NULL; #if defined(HAVE_G_HASH_TABLE_FIND) && !defined(BUILD_GENERIC) if (!g_hash_table_find(g_npidentifier_cache, npidentifier_cache_find_info, args)) return false; #else g_hash_table_foreach(g_npid...
0
27,155
Analyze the following 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::UpdateActiveStyle() { DCHECK(IsActive()); DCHECK(IsMainThread()); TRACE_EVENT0("blink", "Document::updateActiveStyle"); GetStyleEngine().UpdateActiveStyle(); } Commit Message: Cleanup and remove dead code in SetFocusedElement This early-out was added in: https://crrev.com/ce8ea3446283965...
0
129,910
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MagickExport MagickBooleanType SetQuantumFormat(const Image *image, QuantumInfo *quantum_info,const QuantumFormatType format) { assert(image != (Image *) NULL); assert(image->signature == MagickSignature); if (image->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->...
0
96,174
Analyze the following 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 hfs_decompress_lzvn_attr(char* rawBuf, uint32_t rawSize, uint64_t uncSize, char** dstBuf, uint64_t* dstSize, int* dstBufFree) { if (rawBuf[0] == 0x06) { return hfs_decompress_noncompressed_attr( rawBuf, rawSize, uncSize, dstBuf, dstSize, dstBufFree); } char* uncBuf = (c...
0
75,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: size_t xmp_string_len(XmpStringPtr s) { CHECK_PTR(s, 0); return reinterpret_cast<const std::string *>(s)->size(); } Commit Message: CWE ID: CWE-416
0
16,058
Analyze the following 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 x86_setup_perfctr(struct perf_event *event) { struct perf_event_attr *attr = &event->attr; struct hw_perf_event *hwc = &event->hw; u64 config; if (!is_sampling_event(event)) { hwc->sample_period = x86_pmu.max_period; hwc->last_period = hwc->sample_period; local64_set(&hwc->period_left, hwc->...
0
25,801
Analyze the following 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 WritePCDImage(const ImageInfo *image_info,Image *image) { Image *pcd_image; MagickBooleanType status; register ssize_t i; assert(image_info != (const ImageInfo *) NULL); assert(image_info->signature == MagickSignature); assert(image != (Image *) NULL); assert(...
0
71,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: static int __chksum_finup(u32 *crcp, const u8 *data, unsigned int len, u8 *out) { *(__le32 *)out = ~cpu_to_le32(__crc32c_le(*crcp, data, len)); return 0; } Commit Message: crypto: prefix module autoloading with "crypto-" This prefixes all crypto module loading with "crypto-" so we never run the risk of exposi...
0
47,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 PrintWebViewHelper::OnFramePreparedForPreviewDocument() { if (reset_prep_frame_view_) { PrepareFrameForPreviewDocument(); return; } DidFinishPrinting(CreatePreviewDocument() ? OK : FAIL_PREVIEW); } Commit Message: Crash on nested IPC handlers in PrintWebViewHelper Class is not designed to han...
0
126,649
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void Browser::ShowCollectedCookiesDialog(TabContentsWrapper* wrapper) { window()->ShowCollectedCookiesDialog(wrapper); } Commit Message: Implement a bubble that appears at the top of the screen when a tab enters fullscreen mode via webkitRequestFullScreen(), telling the user how to exit fullscreen. This is...
0
97,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: sctp_disposition_t sctp_sf_do_6_3_3_rtx(struct net *net, const struct sctp_endpoint *ep, const struct sctp_association *asoc, const sctp_subtype_t type, void *arg, sctp_cmd_seq_t *commands) { struct sctp_transport *transport = arg; SCTP_INC_STATS(net, SCTP_MIB_T3_RTX_EXPIREDS); if (a...
0
31,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: Browser* Browser::GetBrowserForController( const NavigationController* controller, int* index_result) { BrowserList::const_iterator it; for (it = BrowserList::begin(); it != BrowserList::end(); ++it) { int index = (*it)->tab_handler_->GetTabStripModel()->GetIndexOfController( controller); ...
0
97,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: size_t GetReadSocketCount() const { size_t read_sockets = 0; for (const auto& socket : sockets_) { if (socket.second == SocketStatus::kReadFrom) ++read_sockets; } return read_sockets; } Commit Message: Origins should be represented as url::Origin (not as GURL). As pointed out i...
0
136,876
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ~SplashOutFontFileID() {} Commit Message: CWE ID: CWE-189
0
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: static void vga_get_resolution(VGACommonState *s, int *pwidth, int *pheight) { int width, height; if (vbe_enabled(s)) { width = s->vbe_regs[VBE_DISPI_INDEX_XRES]; height = s->vbe_regs[VBE_DISPI_INDEX_YRES]; } else { width = (s->cr[VGA_CRTC_H_DISP] + 1) * 8; height = s-...
0
3,008
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: nsPush(xmlParserCtxtPtr ctxt, const xmlChar *prefix, const xmlChar *URL) { if (ctxt->options & XML_PARSE_NSCLEAN) { int i; for (i = ctxt->nsNr - 2;i >= 0;i -= 2) { if (ctxt->nsTab[i] == prefix) { /* in scope */ if (ctxt->nsTab[i + 1] == URL) return(-2); /* out of scope keep it...
0
59,400
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool AXNodeObject::isModal() const { if (roleValue() != DialogRole && roleValue() != AlertDialogRole) return false; if (hasAttribute(aria_modalAttr)) { const AtomicString& modal = getAttribute(aria_modalAttr); if (equalIgnoringCase(modal, "true")) return true; if (equalIgnoringCase(...
1
171,916
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: zgetdevice(i_ctx_t *i_ctx_p) { os_ptr op = osp; const gx_device *dev; check_type(*op, t_integer); if (op->value.intval != (int)(op->value.intval)) return_error(gs_error_rangecheck); /* won't fit in an int */ dev = gs_getdevice((int)(op->value.intval)); if (dev == 0) /* index out ...
0
1,552
Analyze the following 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 HTMLCanvasElement::PaintsIntoCanvasBuffer() const { if (PlaceholderFrame()) return false; DCHECK(context_); if (!context_->IsComposited()) return true; if (GetLayoutBox() && GetLayoutBox()->HasAcceleratedCompositing()) return false; return true; } Commit Message: Clean up CanvasResour...
0
152,105
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: RList* MACH0_(mach_fields)(RBinFile *arch) { struct MACH0_(mach_header) *mh = MACH0_(get_hdr_from_bytes)(arch->buf); if (!mh) { return NULL; } RList *ret = r_list_new (); if (!ret) { return NULL; } ret->free = free; ut64 addr = 0; #define ROW(nam,siz,val,fmt) \ r_list_append (ret, r_bin_field_new (a...
0
66,833
Analyze the following 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 UDPSocketWin::Core::WatchForWrite() { AddRef(); write_watcher_.StartWatching(write_overlapped_.hEvent, &writer_); } Commit Message: Map posix error codes in bind better, and fix one windows mapping. r=wtc BUG=330233 Review URL: https://codereview.chromium.org/101193008 git-svn-id: svn://svn.chromium...
0
113,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: int follow_up(struct path *path) { struct mount *mnt = real_mount(path->mnt); struct mount *parent; struct dentry *mountpoint; read_seqlock_excl(&mount_lock); parent = mnt->mnt_parent; if (parent == mnt) { read_sequnlock_excl(&mount_lock); return 0; } mntget(&parent->mnt); mountpoint = dget(mnt->mnt...
0
36,318
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: IW_IMPL(void) iw_snprintf(char *buf, size_t buflen, const char *fmt, ...) { va_list ap; va_start(ap, fmt); iw_vsnprintf(buf,buflen,fmt,ap); va_end(ap); } Commit Message: Trying to fix some invalid left shift operations Fixes issue #16 CWE ID: CWE-682
0
66,293
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: list_del_event(struct perf_event *event, struct perf_event_context *ctx) { struct perf_cpu_context *cpuctx; WARN_ON_ONCE(event->ctx != ctx); lockdep_assert_held(&ctx->lock); /* * We can have double detach due to exit/hot-unplug + close. */ if (!(event->attach_state & PERF_ATTACH_CONTEXT)) return; e...
0
56,053
Analyze the following 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::ResetOverrideEncoding() { encoding_.clear(); Send(new ViewMsg_ResetPageEncodingToDefault(GetRoutingID())); } Commit Message: Cancel JavaScript dialogs when an interstitial appears. BUG=295695 TEST=See bug for repro steps. Review URL: https://chromiumcodereview.appspot.com/24360011 gi...
0
110,767
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ReferrerPolicy FrameFetchContext::GetReferrerPolicy() const { if (IsDetached()) return frozen_state_->referrer_policy; return document_->GetReferrerPolicy(); } Commit Message: DevTools: send proper resource type in Network.RequestWillBeSent This patch plumbs resoure type into the DispatchWillSendRequest...
0
138,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 void t1_check_end(PDF pdf) { if (t1_eof()) return; t1_getline(); if (t1_prefix("{restore}")) t1_putline(pdf); } Commit Message: writet1 protection against buffer overflow git-svn-id: svn://tug.org/texlive/trunk/Build/source@48697 c570f23f-e606-0410-a88d-b1316a301751 CWE ID: CW...
0
76,690
Analyze the following 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 NullableLongMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { TestObject* impl = V8TestObject::ToImpl(info.Holder()); base::Optional<int32_t> result = impl->nullableLongMethod(); if (!result) V8SetReturnValueNull(info); else V8SetReturnValueInt(info, result.value()); } ...
0
134,915
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static inline void update_blocked_averages(int cpu) { struct rq *rq = cpu_rq(cpu); struct cfs_rq *cfs_rq = &rq->cfs; const struct sched_class *curr_class; struct rq_flags rf; rq_lock_irqsave(rq, &rf); update_rq_clock(rq); update_cfs_rq_load_avg(cfs_rq_clock_task(cfs_rq), cfs_rq); curr_class = rq->curr->...
0
92,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 void auth_gssapi_display_status_1( char *m, OM_uint32 code, int type, int rec) { OM_uint32 gssstat, minor_stat; gss_buffer_desc msg; OM_uint32 msg_ctx; msg_ctx = 0; while (1) { gssstat = gss_display_status(&minor_stat, code, type, GSS_C_NULL_OID, ...
0
46,093
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: VisiblePosition ApplyBlockElementCommand::endOfNextParagrahSplittingTextNodesIfNeeded(VisiblePosition& endOfCurrentParagraph, Position& start, Position& end) { VisiblePosition endOfNextParagraph = endOfParagraph(endOfCurrentParagraph.next()); Position position = endOfNextParagraph.deepEquivalent(); Re...
0
110,968
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void udf_update_extent_cache(struct inode *inode, loff_t estart, struct extent_position *pos, int next_epos) { struct udf_inode_info *iinfo = UDF_I(inode); spin_lock(&iinfo->i_extent_cache_lock); /* Invalidate previously cached extent */ __udf_clear_extent_cache(inode); if (pos->bh) get_bh(...
0
36,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 int deflate_decomp_init(struct deflate_ctx *ctx) { int ret = 0; struct z_stream_s *stream = &ctx->decomp_stream; stream->workspace = vzalloc(zlib_inflate_workspacesize()); if (!stream->workspace) { ret = -ENOMEM; goto out; } ret = zlib_inflateInit2(stream, -DEFLATE_DEF_WINBITS); if (ret != Z_OK...
0
47,225
Analyze the following 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 PrintWebViewHelper::CopyAndPrint(WebKit::WebFrame* web_frame) { webkit_glue::WebPreferences prefs = render_view()->GetWebkitPreferences(); prefs.javascript_enabled = false; prefs.java_enabled = false; print_web_view_ = WebView::create(this); prefs.Apply(print_web_view_); print_web_view_->initial...
0
105,873
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xmlHaltParser(xmlParserCtxtPtr ctxt) { if (ctxt == NULL) return; ctxt->instate = XML_PARSER_EOF; ctxt->disableSAX = 1; if (ctxt->input != NULL) { /* * in case there was a specific allocation deallocate before * overriding base */ if (ctxt->input->free != NULL) { ctxt->input->free((xmlChar ...
0
163,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: TIFFOpenW(const wchar_t* name, const char* mode) { static const char module[] = "TIFFOpenW"; thandle_t fd; int m; DWORD dwMode; int mbsize; char *mbname; TIFF *tif; m = _TIFFgetMode(mode, module); switch(m) { case O_RDONLY: dwMode = OPEN_EXISTING; break; case O_RDWR: dwMode = OPEN_ALWAYS; bre...
0
86,803
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GpuVideoDecodeAccelerator::GpuVideoDecodeAccelerator( IPC::Message::Sender* sender, int32 host_route_id, GpuCommandBufferStub* stub) : sender_(sender), init_done_msg_(NULL), host_route_id_(host_route_id), stub_(stub), video_decode_accelerator_(NULL) { } Commit Message: Rev...
0
102,982
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GF_Err gf_sm_load_init(GF_SceneLoader *load) { GF_Err e = GF_NOT_SUPPORTED; char *ext, szExt[50]; /*we need at least a scene graph*/ if (!load || (!load->ctx && !load->scene_graph) #ifndef GPAC_DISABLE_ISOM || (!load->fileName && !load->isom && !(load->flags & GF_SM_LOAD_FOR_PLAYBACK) ) #endif ) ...
1
169,793
Analyze the following 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 void PSNRPktHook(const vpx_codec_cx_pkt_t *pkt) { if (!frame0_psnr_) frame0_psnr_ = pkt->data.psnr.psnr[0]; EXPECT_NEAR(pkt->data.psnr.psnr[0], frame0_psnr_, 2.0); } Commit Message: Merge Conflict Fix CL to lmp-mr1-release for ag/849478 DO NOT MERGE - libvpx: Pull from upstream Current...
0
164,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: static int net_set_channel(struct wif *wi, int chan) { uint32_t c = htonl(chan); return net_cmd(wi_priv(wi), NET_SET_CHAN, &c, sizeof(c)); } Commit Message: OSdep: Fixed segmentation fault that happens with a malicious server sending a negative length (Closes #16 on GitHub). git-svn-id: http://svn.aircrack-n...
0
74,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 int ssl_scan_clienthello_tlsext(SSL *s, PACKET *pkt, int *al) { unsigned int type; int renegotiate_seen = 0; PACKET extensions; *al = SSL_AD_DECODE_ERROR; s->servername_done = 0; s->tlsext_status_type = -1; #ifndef OPENSSL_NO_NEXTPROTONEG s->s3->next_proto_neg_seen = 0; #endif ...
0
9,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: void BrowserEventRouter::PageActionExecuted(Profile* profile, const ExtensionAction& page_action, int tab_id, const std::string& url, int ...
0
116,019
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void TabSpecificContentSettings::GeolocationDidNavigate( const content::LoadCommittedDetails& details) { geolocation_settings_state_.DidNavigate(details); } Commit Message: Check the content setting type is valid. BUG=169770 Review URL: https://codereview.chromium.org/11875013 git-svn-id: svn://svn.chr...
0
117,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: ar6000_connect_to_ap(struct ar6_softc *ar) { /* The ssid length check prevents second "essid off" from the user, to be treated as a connect cmd. The second "essid off" is ignored. */ if((ar->arWmiReady == true) && (ar->arSsidLen > 0) && ar->arNetworkType!=AP_NETWORK) { int status; ...
0
24,165
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SPL_METHOD(Array, exchangeArray) { zval *object = getThis(), *tmp, **array; spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); array_init(return_value); zend_hash_copy(HASH_OF(return_value), spl_array_get_hash_table(intern, 0 TSRMLS_CC), (copy_ctor_func_t) zval_add_...
0
49,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 void dn_keepalive(struct sock *sk) { struct dn_scp *scp = DN_SK(sk); /* * By checking the other_data transmit queue is empty * we are double checking that we are not sending too * many of these keepalive frames. */ if (skb_queue_empty(&scp->other_xmit_queue)) dn_nsp_send_link(sk, DN_NOCHANGE,...
0
41,491
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: EventQueue* Document::GetEventQueue() const { if (!dom_window_) return nullptr; return dom_window_->GetEventQueue(); } Commit Message: Fixed bug where PlzNavigate CSP in a iframe did not get the inherited CSP When inheriting the CSP from a parent document to a local-scheme CSP, it does not always get pr...
0
146,754
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: unsigned long probe_memory(void) { unsigned long total = 0; int i; for (i = 0; sp_banks[i].num_bytes; i++) total += sp_banks[i].num_bytes; return total; } Commit Message: perf: Remove the nmi parameter from the swevent and overflow interface The nmi parameter indicated if we could do wakeups from the cu...
0
25,732
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void add_header_grep(struct rev_info *revs, enum grep_header_field field, const char *pattern) { append_header_grep_pattern(&revs->grep_filter, field, pattern); } Commit Message: list-objects: pass full pathname to callbacks When we find a blob at "a/b/c", we currently pass this to our show_object_fn ca...
0
54,962
Analyze the following 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 php_build_argv(char *s, zval *track_vars_array TSRMLS_DC) { zval *arr, *argc, *tmp; int count = 0; char *ss, *space; if (!(SG(request_info).argc || track_vars_array)) { return; } ALLOC_INIT_ZVAL(arr); array_init(arr); /* Prepare argv */ if (SG(request_info).argc) { /* are we in cli sapi?...
0
63,618
Analyze the following 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 ssl3_check_cert_and_algorithm(SSL *s) { int i,idx; long alg_k,alg_a; EVP_PKEY *pkey=NULL; SESS_CERT *sc; #ifndef OPENSSL_NO_RSA RSA *rsa; #endif #ifndef OPENSSL_NO_DH DH *dh; #endif alg_k=s->s3->tmp.new_cipher->algorithm_mkey; alg_a=s->s3->tmp.new_cipher->algorithm_auth; /* we don't have a certifi...
0
45,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: to_json(PG_FUNCTION_ARGS) { Datum val = PG_GETARG_DATUM(0); Oid val_type = get_fn_expr_argtype(fcinfo->flinfo, 0); StringInfo result; JsonTypeCategory tcategory; Oid outfuncoid; if (val_type == InvalidOid) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("could not determine...
0
2,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: WebKitWebInspector* webkit_web_view_get_inspector(WebKitWebView* webView) { g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), 0); return webView->priv->webInspector.get(); } Commit Message: 2011-06-02 Joone Hur <joone.hur@collabora.co.uk> Reviewed by Martin Robinson. [GTK] Only load d...
0
100,563
Analyze the following 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 listenToPort(int port, int *fds, int *count) { int j; /* Force binding of 0.0.0.0 if no bind address is specified, always * entering the loop if j == 0. */ if (server.bindaddr_count == 0) server.bindaddr[0] = NULL; for (j = 0; j < server.bindaddr_count || j == 0; j++) { if (serve...
0
70,039
Analyze the following 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::notificationPostTimerFired(TimerBase*) { m_notificationPostTimer.stop(); unsigned i = 0, count = m_notificationsToPost.size(); for (i = 0; i < count; ++i) { AXObject* obj = m_notificationsToPost[i].first; if (!obj->axObjectID()) continue; if (obj->isDetached()) ...
0
127,370
Analyze the following 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 Equalizer_setParameter (EffectContext *pContext, void *pParam, void *pValue){ int status = 0; int32_t preset; int32_t band; int32_t level; int32_t *pParamTemp = (int32_t *)pParam; int32_t param = *pParamTemp++; switch (param) { case EQ_PARAM_CUR_PRESET: preset = (int32_t)(*(uint16_t *)pValue...
0
157,401
Analyze the following 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 sha1_import(struct shash_desc *desc, const void *in) { struct s390_sha_ctx *sctx = shash_desc_ctx(desc); const struct sha1_state *ictx = in; sctx->count = ictx->count; memcpy(sctx->state, ictx->state, sizeof(ictx->state)); memcpy(sctx->buf, ictx->buffer, sizeof(ictx->buffer)); sctx->func = KIMD_...
0
46,712
Analyze the following 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* tcmu_get_path( struct tcmu_device *dev) { char *config; config = strchr(tcmu_get_dev_cfgstring(dev), '/'); if (!config) { tcmu_err("no configuration found in cfgstring\n"); return NULL; } config += 1; /* get past '/' */ return config; } Commit Message: glfs: discard glfs_check_config ...
0
59,067
Analyze the following 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 normalize_ioctl(unsigned int *cmd, int *size) { int i; for (i = 0; i < ARRAY_SIZE(ioctl_table); i++) { if ((*cmd & 0xffff) == (ioctl_table[i] & 0xffff)) { *size = _IOC_SIZE(*cmd); *cmd = ioctl_table[i]; if (*size > _IOC_SIZE(*cmd)) { pr_info("ioctl not yet supported\n"); return -E...
0
39,401
Analyze the following 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 IDNSpoofChecker::SimilarToTopDomains(base::StringPiece16 hostname) { size_t hostname_length = hostname.length() - (hostname.back() == '.' ? 1 : 0); icu::UnicodeString ustr_host(FALSE, hostname.data(), hostname_length); if (lgc_letters_n_ascii_.span(ustr_host, 0, USET_SPAN_CONTAINED) == ustr_host....
0
148,243
Analyze the following 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 aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) { const struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm); const __le32 *src = (const __le32 *)in; __le32 *dst = (__le32 *)out; u32 b0[4], b1[4]; const u32 *kp = ctx->key_enc + 4; const int key_len = ctx->key_length; b0[0] = le32_to_cpu...
0
47,101
Analyze the following 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 pdf_set_populating_xref_trailer(fz_context *ctx, pdf_document *doc, pdf_obj *trailer) { /* Update the trailer of the xref section being populated */ pdf_xref *xref = &doc->xref_sections[doc->num_xref_sections - 1]; if (xref->trailer) { pdf_drop_obj(ctx, xref->pre_repair_trailer); xref->pre_repair_tra...
0
16,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: void WebContentsImpl::EnterFullscreenMode( const GURL& origin, const blink::WebFullscreenOptions& options) { RenderWidgetHostView* const widget_view = GetFullscreenRenderWidgetHostView(); if (widget_view) { RenderWidgetHostImpl::From(widget_view->GetRenderWidgetHost()) ->ShutdownAndDestroy...
0
144,944
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static __u32 tpacket_get_timestamp(struct sk_buff *skb, struct timespec *ts, unsigned int flags) { struct skb_shared_hwtstamps *shhwtstamps = skb_hwtstamps(skb); if (shhwtstamps && (flags & SOF_TIMESTAMPING_RAW_HARDWARE) && ktime_to_timespec_cond(shhwtstamps->hwtstamp, ts)) return TP_STATUS_...
0
49,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: ModuleSystem::NativesEnabledScope::NativesEnabledScope( ModuleSystem* module_system) : module_system_(module_system) { module_system_->natives_enabled_++; } Commit Message: [Extensions] Don't allow built-in extensions code to be overridden BUG=546677 Review URL: https://codereview.chromium.org/1417513...
0
133,061
Analyze the following 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_zip_get_num_files(struct zip *za TSRMLS_DC) /* {{{ */ { return zip_get_num_files(za); } /* }}} */ Commit Message: Fix bug #72434: ZipArchive class Use After Free Vulnerability in PHP's GC algorithm and unserialize CWE ID: CWE-416
0
51,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 QueryManager::Query::RunCallbacks() { for (size_t i = 0; i < callbacks_.size(); i++) { callbacks_[i].Run(); } callbacks_.clear(); } Commit Message: Add bounds validation to AsyncPixelTransfersCompletedQuery::End BUG=351852 R=jbauman@chromium.org, jorgelo@chromium.org Review URL: https://coderevi...
0
121,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: int snd_timer_global_new(char *id, int device, struct snd_timer **rtimer) { struct snd_timer_id tid; tid.dev_class = SNDRV_TIMER_CLASS_GLOBAL; tid.dev_sclass = SNDRV_TIMER_SCLASS_NONE; tid.card = -1; tid.device = device; tid.subdevice = 0; return snd_timer_new(NULL, id, &tid, rtimer); } Commit Message: A...
0
52,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 is_handler(const struct dirent *dirent) { if (strncmp(dirent->d_name, "handler_", 8)) return 0; return 1; } Commit Message: only allow dynamic UnregisterHandler for external handlers, thereby fixing DoS Trying to unregister an internal handler ended up in a SEGFAULT, because the tcmur_handler...
0
59,054
Analyze the following 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 AwFeatureListCreator::SetUpFieldTrials() { auto* metrics_client = AwMetricsServiceClient::GetInstance(); DCHECK(!field_trial_list_); field_trial_list_ = std::make_unique<base::FieldTrialList>( metrics_client->CreateLowEntropyProvider()); std::unique_ptr<variations::SeedResponse> seed = GetAnd...
1
172,360
Analyze the following 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 unhex4(char* hex) { int r = 0; for (int i=0; i<4; i++) { char c = *hex++; int n; if ('0' <= c && c <= '9') n = c - '0'; else if ('a' <= c && c <= 'f') n = c - 'a' + 10; else if ('A' <= c && c <= 'F') n = c - 'A' + 10; else return -1; r <<= 4; r |= n; } return r; ...
0
56,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: mrb_cloexec_open(mrb_state *mrb, const char *pathname, mrb_int flags, mrb_int mode) { mrb_value emsg; int fd, retry = FALSE; char* fname = mrb_locale_from_utf8(pathname, -1); #ifdef O_CLOEXEC /* O_CLOEXEC is available since Linux 2.6.23. Linux 2.6.18 silently ignore it. */ flags |= O_CLOEXEC; #elif de...
0
83,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: bool HTMLInputElement::ShouldAutocomplete() const { if (autocomplete_ != kUninitialized) return autocomplete_ == kOn; return TextControlElement::ShouldAutocomplete(); } Commit Message: MacViews: Enable secure text input for password Textfields. In Cocoa the NSTextInputContext automatically enables secur...
0
126,109
Analyze the following 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::setToolbarsVisible(bool value) { m_toolbarsVisible = value; } Commit Message: Delete apparently unused geolocation declarations and include. BUG=336263 Review URL: https://codereview.chromium.org/139743014 git-svn-id: svn://svn.chromium.org/blink/trunk@165601 bbb929c8-8fbe-4397-9dbb...
0
118,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: GF_Err stsh_Size(GF_Box *s) { GF_ShadowSyncBox *ptr = (GF_ShadowSyncBox *)s; ptr->size += 4 + (8 * gf_list_count(ptr->entries)); return GF_OK; } Commit Message: fixed 2 possible heap overflows (inc. #1088) CWE ID: CWE-125
0
80,484
Analyze the following 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::inheritHtmlAndBodyElementStyles(StyleRecalcChange change) { ASSERT(inStyleRecalc()); ASSERT(documentElement()); bool didRecalcDocumentElement = false; RefPtr<ComputedStyle> documentElementStyle = documentElement()->mutableComputedStyle(); if (change == Force) documentEl...
0
127,525
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: LRUCanvasResourceProviderCache(size_t capacity) : resource_providers_(capacity) {} Commit Message: Validate all incoming WebGLObjects. A few entry points were missing the correct validation. Tested with improved conformance tests in https://github.com/KhronosGroup/WebGL/pull/2654 . Bug: 848914 Cq-Incl...
0
153,612
Analyze the following 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 vmci_transport_dgram_allow(u32 cid, u32 port) { if (cid == VMADDR_CID_HYPERVISOR) { /* Registrations of PBRPC Servers do not modify VMX/Hypervisor * state and are allowed. */ return port == VMCI_UNITY_PBRPC_REGISTER; } return true; } Commit Message: VSOCK: vmci - fix possible info leak ...
0
30,372
Analyze the following 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 sched_entity *__pick_first_entity(struct cfs_rq *cfs_rq) { struct rb_node *left = rb_first_cached(&cfs_rq->tasks_timeline); if (!left) return NULL; return rb_entry(left, struct sched_entity, run_node); } Commit Message: sched/fair: Fix infinite loop in update_blocked_averages() by reverting a9e7f65...
0
92,441
Analyze the following 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 FakeCrosDisksClient::NotifyRenameCompleted( RenameError error_code, const std::string& device_path) { for (auto& observer : observer_list_) observer.OnRenameCompleted(error_code, device_path); } Commit Message: Add a fake DriveFS launcher client. Using DriveFS requires building and deploying ...
0
124,109
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: DeliverOneEvent(InternalEvent *event, DeviceIntPtr dev, enum InputLevel level, WindowPtr win, Window child, GrabPtr grab) { xEvent *xE = NULL; int count = 0; int deliveries = 0; int rc; switch (level) { case XI2: rc = EventToXI2(event, &xE); count = 1; ...
0
4,818
Analyze the following 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 lxc_proc_context_info *lxc_proc_get_context_info(pid_t pid) { struct lxc_proc_context_info *info = calloc(1, sizeof(*info)); FILE *proc_file; char proc_fn[MAXPATHLEN]; char *line = NULL; size_t line_bufsz = 0; int ret, found; if (!info) { SYSERROR("Could not allocate memory."); return...
0
44,721
Analyze the following 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 flush_tmregs_to_thread(struct task_struct *tsk) { } Commit Message: powerpc/tm: Flush TM only if CPU has TM feature Commit cd63f3c ("powerpc/tm: Fix saving of TM SPRs in core dump") added code to access TM SPRs in flush_tmregs_to_thread(). However flush_tmregs_to_thread() does not check if TM...
0
84,782
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: evdns_server_request_format_response(struct server_request *req, int err) { unsigned char buf[1500]; size_t buf_len = sizeof(buf); off_t j = 0, r; u16 t_; u32 t32_; int i; u16 flags; struct dnslabel_table table; if (err < 0 || err > 15) return -1; /* Set response bit and error code; copy OPCODE and RD...
0
70,647
Analyze the following 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 *parse_errorlog_item(apr_pool_t *p, ap_errorlog_format_item *it, const char **sa) { const char *s = *sa; ap_errorlog_handler *handler; int i; if (*s != '%') { if (*s == ' ') { it->flags |= AP_ERRORLOG_FLAG_FIELD_SEP; } ...
0
64,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: dophn_core(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num, size_t size, off_t fsize, int *flags) { Elf32_Phdr ph32; Elf64_Phdr ph64; size_t offset, len; unsigned char nbuf[BUFSIZ]; ssize_t bufsize; if (size != xph_sizeof) { if (file_printf(ms, ", corrupted program header size")...
0
35,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 inline unsigned long rb_page_entries(struct buffer_page *bpage) { return local_read(&bpage->entries) & RB_WRITE_MASK; } Commit Message: ring-buffer: Prevent overflow of size in ring_buffer_resize() If the size passed to ring_buffer_resize() is greater than MAX_LONG - BUF_PAGE_SIZE then the DIV_ROUND_UP(...
0
72,565
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bits_next (int bits) { bits++; if (bits > 8) bits = 5; return bits; } Commit Message: Do not use "/bin/sh" to run external commands. Picocom no longer uses /bin/sh to run external commands for file-transfer operations. Parsing the command line and spliting it into arguments is now performed internally by pi...
0
73,967
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GraphicsLayer* FrameView::layerForHorizontalScrollbar() const { RenderView* renderView = this->renderView(); if (!renderView) return 0; return renderView->compositor()->layerForHorizontalScrollbar(); } Commit Message: Defer call to updateWidgetPositions() outside of RenderLayerScrollableArea....
0
119,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: NPObjectAccessorWithIdentifier::~NPObjectAccessorWithIdentifier() { Var::PluginReleasePPVar(identifier_); } Commit Message: Fix invalid read in ppapi code BUG=77493 TEST=attached test Review URL: http://codereview.chromium.org/6883059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82172 0039d316-1c4b-4...
0
100,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: void HTMLSelectElement::defaultEventHandler(Event* event) { if (!renderer()) return; if (isDisabledFormControl()) { HTMLFormControlElementWithState::defaultEventHandler(event); return; } if (usesMenuList()) menuListDefaultEventHandler(event); else lis...
0
103,058
Analyze the following 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 RenderProcessImpl::PutSharedMemInCache(TransportDIB* mem) { const int slot = FindFreeCacheSlot(mem->size()); if (slot == -1) return false; shared_mem_cache_[slot] = mem; return true; } Commit Message: Allow browser to handle all WebUI navigations. BUG=113496 TEST="Google Dashboard" link in Syn...
0
108,340
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: krb5_gss_wrap_size_limit(minor_status, context_handle, conf_req_flag, qop_req, req_output_size, max_input_size) OM_uint32 *minor_status; gss_ctx_id_t context_handle; int conf_req_flag; gss_qop_t qop_req; OM_uint32 re...
1
166,824
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: netdutils::Status XfrmController::allocateSpi(const XfrmSaInfo& record, uint32_t minSpi, uint32_t maxSpi, uint32_t* outSpi, const XfrmSocket& sock) { xfrm_userspi_info spiInfo{}; enum { NLMSG_HDR, USERSAID, USERSAID_PAD }; std::vector<iovec> iov = { {NULL, 0}, // reserved for the eventual addition o...
0
162,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: void OnSetIsInert(bool is_inert) { base::PostTaskWithTraits( FROM_HERE, {content::BrowserThread::UI}, base::BindOnce(&SetIsInertMessageFilter::OnSetIsInertOnUI, this, is_inert)); } Commit Message: Add a check for disallowing remote frame navigations to local resourc...
0
143,867
Analyze the following 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 kvm_arm_sys_reg_set_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg) { const struct sys_reg_desc *r; void __user *uaddr = (void __user *)(unsigned long)reg->addr; if ((reg->id & KVM_REG_ARM_COPROC_MASK) == KVM_REG_ARM_DEMUX) return demux_c15_set(reg->id, uaddr); if (KVM_REG_SIZE(reg->id) != s...
0
62,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: static int vfat_create_shortname(struct inode *dir, struct nls_table *nls, wchar_t *uname, int ulen, unsigned char *name_res, unsigned char *lcase) { struct fat_mount_options *opts = &MSDOS_SB(dir->i_sb)->options; wchar_t *ip, *ext_start, *end, *name_start; unsigned char base[9], ext[4], buf[5], *p; ...
0
33,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: void set_task_rq_fair(struct sched_entity *se, struct cfs_rq *prev, struct cfs_rq *next) { u64 p_last_update_time; u64 n_last_update_time; if (!sched_feat(ATTACH_AGE_LOAD)) return; /* * We are supposed to update the task to "current" time, then its up to * date and ready to go to new CPU/cfs_r...
0
92,682
Analyze the following 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 find_next_descriptor(unsigned char *buffer, int size, int dt1, int dt2, int *num_skipped) { struct usb_descriptor_header *h; int n = 0; unsigned char *buffer0 = buffer; /* Find the next descriptor of type dt1 or dt2 */ while (size > 0) { h = (struct usb_descriptor_header *) buffer; if (h-...
0
59,743