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: NTSTATUS smb1cli_session_protect_session_key(struct smbXcli_session *session) { if (session->smb1.protected_key) { /* already protected */ return NT_STATUS_OK; } if (session->smb1.application_key.length != 16) { return NT_STATUS_INVALID_PARAMETER_MIX; } smb_key_derivation(session->smb1.application_ke...
0
2,425
Analyze the following 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 activityLoggedInIsolatedWorldsAttrSetterAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeGetter(info); TRACE_EVENT_S...
0
121,544
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MPEG4Extractor::~MPEG4Extractor() { Track *track = mFirstTrack; while (track) { Track *next = track->next; delete track; track = next; } mFirstTrack = mLastTrack = NULL; SINF *sinf = mFirstSINF; while (sinf) { SINF *next = sinf->next; delete[] sinf->IPMPData; delete sinf; ...
0
157,216
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SWFInput_getUInt16(SWFInput input) { int num = SWFInput_getChar(input); num += SWFInput_getChar(input) << 8; return num; } Commit Message: Fix left shift of a negative value in SWFInput_readSBits. Check for number before before left-shifting by (number-1). CWE ID: CWE-190
0
89,556
Analyze the following 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(HttpParams, offsetUnset) { char *name_str; int name_len; zval *zparams; if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name_str, &name_len)) { return; } zparams = php_http_zsep(1, IS_ARRAY, zend_read_property(php_http_params_class_entry, getThis(), ZEND_STRL("params"), ...
0
93,983
Analyze the following 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 sock *sctp_err_lookup(int family, struct sk_buff *skb, struct sctphdr *sctphdr, struct sctp_association **app, struct sctp_transport **tpp) { union sctp_addr saddr; union sctp_addr daddr; struct sctp_af *af; struct sock *sk = NULL; struct sctp_association *asoc; struct sctp_tr...
0
34,623
Analyze the following 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 is_kernel_event(struct perf_event *event) { return event->owner == EVENT_OWNER_KERNEL; } Commit Message: perf: Fix event->ctx locking There have been a few reported issues wrt. the lack of locking around changing event->ctx. This patch tries to address those. It avoids the whole rwsem thing; and w...
0
50,442
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: set_test_type(struct magic *mstart, struct magic *m) { switch (m->type) { case FILE_BYTE: case FILE_SHORT: case FILE_LONG: case FILE_DATE: case FILE_BESHORT: case FILE_BELONG: case FILE_BEDATE: case FILE_LESHORT: case FILE_LELONG: case FILE_LEDATE: case FILE_LDATE: case FILE_BELDATE: case FILE_LELDA...
0
37,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: void RenderWidgetHostViewAura::SetCompositionText( const ui::CompositionText& composition) { if (!host_) return; COMPILE_ASSERT(sizeof(ui::CompositionUnderline) == sizeof(WebKit::WebCompositionUnderline), ui_CompositionUnderline__WebKit_WebCompositionUnderline_diff);...
0
114,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: static int next_free_minor(int *minor) { int r; idr_preload(GFP_KERNEL); spin_lock(&_minor_lock); r = idr_alloc(&_minor_idr, MINOR_ALLOCED, 0, 1 << MINORBITS, GFP_NOWAIT); spin_unlock(&_minor_lock); idr_preload_end(); if (r < 0) return r; *minor = r; return 0; } Commit Message: dm: fix race between...
0
85,966
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void ContainerNode::childrenChanged(const ChildrenChange& change) { document().incDOMTreeVersion(); if (!change.byParser && change.type != TextChanged) document().updateRangesAfterChildrenChanged(this); invalidateNodeListCachesInAncestors(); if (change.isChildInsertion() && !childNeedsStyl...
0
125,064
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: crm_recv_remote_msg(void *session, gboolean encrypted) { char *reply = NULL; xmlNode *xml = NULL; if (encrypted) { #ifdef HAVE_GNUTLS_GNUTLS_H reply = cib_recv_tls(session); #else CRM_ASSERT(encrypted == FALSE); #endif } else { reply = cib_recv_plaintext(GPOINTER_...
1
166,163
Analyze the following 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 RenderProcessHostImpl::UpdateProcessPriority() { if (!child_process_launcher_.get() || child_process_launcher_->IsStarting()) { is_process_backgrounded_ = false; return; } if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kDisableRendererPriorityManagement)) { retu...
0
128,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: void GDataFileSystem::OnFeedFromServerLoaded() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); FOR_EACH_OBSERVER(GDataFileSystemInterface::Observer, observers_, OnFeedFromServerLoaded()); } Commit Message: Remove parent* arg from GDataEntry ctor. * Remove static FromDocumentEnt...
0
116,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: void ImageResource::ReloadIfLoFiOrPlaceholderImage( ResourceFetcher* fetcher, ReloadLoFiOrPlaceholderPolicy policy) { if (policy == kReloadIfNeeded && !ShouldReloadBrokenPlaceholder()) return; DCHECK(!IsLoaded() || HasServerLoFiResponseHeaders(GetResponse()) == static_cast<b...
0
149,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: do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) { return 0; } Commit Message: perf: Remove the nmi parameter from the swevent and overflow interface The nmi parameter indicated if we could do wakeups from the current context, if not, we would set some state and self-IPI and let the re...
0
25,354
Analyze the following 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 samldb_allocate_sid(struct samldb_ctx *ac) { uint32_t rid; struct dom_sid *sid; struct ldb_context *ldb = ldb_module_get_ctx(ac->module); int ret; ret = ridalloc_allocate_rid(ac->module, &rid, ac->req); if (ret != LDB_SUCCESS) { return ret; } sid = dom_sid_add_rid(ac, samdb_domain_sid(ldb),...
0
5
Analyze the following 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 Chapters::Display::Init() { m_string = NULL; m_language = NULL; m_country = NULL; } 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: 574045edd4ecbeb802ee3...
1
174,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 PaymentRequest::SatisfiesSkipUIConstraints() const { return base::FeatureList::IsEnabled(features::kWebPaymentsSingleAppUiSkip) && base::FeatureList::IsEnabled(::features::kServiceWorkerPaymentApps) && is_show_user_gesture_ && state()->is_get_all_instruments_finished() && state()...
1
173,086
Analyze the following 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 oz_cdev_open(struct inode *inode, struct file *filp) { struct oz_cdev *dev = container_of(inode->i_cdev, struct oz_cdev, cdev); oz_dbg(ON, "major = %d minor = %d\n", imajor(inode), iminor(inode)); filp->private_data = dev; return 0; } Commit Message: staging: ozwpan: prevent overflow in oz_cdev_...
0
29,485
Analyze the following 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 TabStripModelObserver::TabMiniStateChanged(WebContents* contents, int index) { } Commit Message: Remove TabContents from TabStripModelObserver::TabDetachedAt. BUG=107201 TEST=no visible change Review URL: https://chromiumcodereview.appspot.com/11293205 git...
0
118,254
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static const struct nft_expr_type *nft_expr_type_get(u8 family, struct nlattr *nla) { const struct nft_expr_type *type; if (nla == NULL) return ERR_PTR(-EINVAL); type = __nft_expr_type_get(family, nla); if (type != NULL && try_module_get(type->owner)) return type; #ifdef CONFIG_MODULES if (...
0
58,021
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int mnt_make_readonly(struct mount *mnt) { int ret = 0; lock_mount_hash(); mnt->mnt.mnt_flags |= MNT_WRITE_HOLD; /* * After storing MNT_WRITE_HOLD, we'll read the counters. This store * should be visible before we do. */ smp_mb(); /* * With writers on hold, if this value is zero, then there...
0
36,217
Analyze the following 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 int sequencer_poll(int dev, struct file *file, poll_table * wait) { unsigned long flags; unsigned int mask = 0; dev = dev >> 4; spin_lock_irqsave(&lock,flags); /* input */ poll_wait(file, &midi_sleeper, wait); if (iqlen) mask |= POLLIN | POLLRDNORM; /* output */ poll_wait(file, &seq_sleeper...
0
27,620
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void netlink_clear_multicast_users(struct sock *ksk, unsigned int group) { netlink_table_grab(); __netlink_clear_multicast_users(ksk, group); netlink_table_ungrab(); } Commit Message: af_netlink: force credentials passing [CVE-2012-3520] Pablo Neira Ayuso discovered that avahi and potentially NetworkManager ...
0
19,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: static void __exit sha1_neon_mod_fini(void) { crypto_unregister_shash(&alg); } 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, as demonstrated by Mathi...
0
46,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 RAND_DRBG *rand_drbg_new(int secure, int type, unsigned int flags, RAND_DRBG *parent) { RAND_DRBG *drbg = secure ? OPENSSL_secure_zalloc(sizeof(*drbg)) : OPENSSL_zalloc(sizeof(*d...
1
165,144
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void ossl_statem_set_renegotiate(SSL *s) { s->statem.state = MSG_FLOW_RENEGOTIATE; s->statem.in_init = 1; } Commit Message: CWE ID: CWE-416
0
9,363
Analyze the following 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 Parcel::readUtf8VectorFromUtf16Vector( std::unique_ptr<std::vector<std::unique_ptr<std::string>>>* val) const { return readNullableTypedVector(val, &Parcel::readUtf8FromUtf16); } Commit Message: Add bound checks to utf16_to_utf8 Bug: 29250543 Change-Id: I518e7b2fe10aaa3f1c1987586a09b1110aff7e1...
0
163,597
Analyze the following 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 dl_bw_cpus(int i) { struct root_domain *rd = cpu_rq(i)->rd; int cpus = 0; RCU_LOCKDEP_WARN(!rcu_read_lock_sched_held(), "sched RCU must be held"); for_each_cpu_and(i, rd->span, cpu_active_mask) cpus++; return cpus; } Commit Message: Merge branch 'stacking-fixes' (vfs stacking fixes...
0
55,522
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: std::unique_ptr<TracedValue> GenericIdleCallbackEvent(ExecutionContext* context, int id) { std::unique_ptr<TracedValue> value = TracedValue::Create(); value->SetInteger("id", id); if (LocalFrame* frame = FrameForExecutionContext(context)) value->SetS...
0
138,675
Analyze the following 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 LayerTreeHostImpl::UpdateTileManagerMemoryPolicy( const ManagedMemoryPolicy& policy) { if (!resource_pool_) return; global_tile_state_.hard_memory_limit_in_bytes = 0; global_tile_state_.soft_memory_limit_in_bytes = 0; if (visible_ && policy.bytes_limit_when_visible > 0) { global_tile_sta...
0
137,396
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: print_browse(netdissect_options *ndo, const u_char *param, int paramlen, const u_char *data, int datalen) { const u_char *maxbuf = data + datalen; int command; ND_TCHECK(data[0]); command = data[0]; smb_fdata(ndo, param, "BROWSE PACKET\n|Param ", param+paramlen, unicodestr); ...
0
93,142
Analyze the following 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 DataReductionProxySettings::InitPrefMembers() { DCHECK(thread_checker_.CalledOnValidThread()); spdy_proxy_auth_enabled_.Init( prefs::kDataSaverEnabled, GetOriginalProfilePrefs(), base::Bind(&DataReductionProxySettings::OnProxyEnabledPrefChange, base::Unretained(this))); } Co...
1
172,553
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Error* Automation::CompareVersion(int client_build_no, int client_patch_no, bool* is_newer_or_equal) { std::string version = automation()->server_version(); std::vector<std::string> split_version; base::SplitString(version, '.', &split_vers...
0
100,698
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: base::WeakPtr<CastTrayView> CastTrayView::AsWeakPtr() { return weak_ptr_factory_.GetWeakPtr(); } Commit Message: Allow the cast tray to function as expected when the installed extension is missing API methods. BUG=489445 Review URL: https://codereview.chromium.org/1145833003 Cr-Commit-Position: refs/heads/m...
0
119,708
Analyze the following 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 hns_nic_update_stats(struct net_device *netdev) { struct hns_nic_priv *priv = netdev_priv(netdev); struct hnae_handle *h = priv->ae_handle; h->dev->ops->update_stats(h, &netdev->stats); } Commit Message: net: hns: Fix a skb used after free bug skb maybe freed in hns_nic_net_xmit_hw() and return NETDEV_...
0
85,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: bool HTMLElement::hasDirectionAuto() const { const AtomicString& direction = fastGetAttribute(dirAttr); return (hasTagName(bdiTag) && direction == nullAtom) || equalIgnoringCase(direction, "auto"); } Commit Message: There are too many poorly named functions to create a fragment from markup https://bugs.w...
0
100,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 BrowserWindowGtk::GetExtraRenderViewHeight() const { int sum = infobar_container_->TotalHeightOfAnimatingBars(); if (IsBookmarkBarSupported() && bookmark_bar_->IsAnimating()) sum += bookmark_bar_->GetHeight(); if (download_shelf_.get() && download_shelf_->IsClosing()) sum += download_shelf_->Get...
0
117,934
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: FLAC__bool read_subframe_constant_(FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps, FLAC__bool do_full_decode) { FLAC__Subframe_Constant *subframe = &decoder->private_->frame.subframes[channel].data.constant; FLAC__int32 x; unsigned i; FLAC__int32 *output = decoder->private_->output[channel]; d...
0
161,239
Analyze the following 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 task_struct *find_lock_task_mm(struct task_struct *p) { struct task_struct *t; rcu_read_lock(); for_each_thread(p, t) { task_lock(t); if (likely(t->mm)) goto found; task_unlock(t); } t = NULL; found: rcu_read_unlock(); return t; } Commit Message: mm, oom_reaper: gather each vma to preve...
0
85,978
Analyze the following 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::FocusPreviousPane() { UserMetrics::RecordAction(UserMetricsAction("FocusPreviousPane"), profile_); window_->RotatePaneFocus(false); } Commit Message: chromeos: fix bug where "aw snap" page replaces first tab if it was a NTP when closing window with > 1 tab. BUG=chromium-os:12088 TEST=verify bu...
0
98,235
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static PolygonInfo **AcquirePolygonThreadSet( const PrimitiveInfo *primitive_info) { PathInfo *magick_restrict path_info; PolygonInfo **polygon_info; register ssize_t i; size_t number_threads; number_threads=(size_t) GetMagickResourceLimit(ThreadResource); polygon_info=(PolygonIn...
0
52,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: bool Browser::SupportsLocationBar() const { if (is_type_tabbed()) return true; if (!is_app()) return !is_trusted_source(); if (hosted_app_controller_) return true; return false; } Commit Message: Don't focus the location bar for NTP navigations in non-selected tabs. BUG=677716 TEST=See bu...
0
139,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: EmulationHandler::EmulationHandler() : DevToolsDomainHandler(Emulation::Metainfo::domainName), touch_emulation_enabled_(false), device_emulation_enabled_(false), host_(nullptr) { } Commit Message: DevTools: speculative fix for crash in NetworkHandler::Disable This keeps BrowserContext* and...
0
148,440
Analyze the following 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::implicitClose() { ASSERT(!inStyleRecalc()); if (processingLoadEvent() || !m_parser) return; if (frame() && frame()->navigationScheduler().locationChangePending()) { suppressLoadEvent(); return; } RefPtrWillBeRawPtr<LocalDOMWindow> protectedWindow(this->d...
0
124,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: struct pcm_device_profile *get_pcm_device(usecase_type_t uc_type, audio_devices_t devices) { int i; devices &= ~AUDIO_DEVICE_BIT_IN; if (!devices) return NULL; for (i = 0; pcm_devices[i] != NULL; i++) { if ((pcm_devices[i]->type == uc_type) && (devices & pcm_devices[i]->devices) == devices) return p...
0
162,273
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: media::GpuVideoAcceleratorFactories* RenderThreadImpl::GetGpuFactories() { DCHECK(IsMainThread()); if (!gpu_factories_.empty()) { scoped_refptr<ui::ContextProviderCommandBuffer> shared_context_provider = gpu_factories_.back()->ContextProviderMainThread(); if (shared_context_provider) { ...
0
150,518
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: comics_document_class_init (ComicsDocumentClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); EvDocumentClass *ev_document_class = EV_DOCUMENT_CLASS (klass); gobject_class->finalize = comics_document_finalize; ev_document_class->load = comics_document_load; ev_document_class->save = co...
0
59,074
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void HTMLInputElement::AccessKeyAction(bool send_mouse_events) { input_type_view_->AccessKeyAction(send_mouse_events); } 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 tex...
0
125,986
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ScriptPromise ImageBitmapFactories::createImageBitmap(EventTarget& eventTarget, ImageBitmap* bitmap, int sx, int sy, int sw, int sh, ExceptionState& exceptionState) { if (!bitmap) { exceptionState.throwTypeError("The ImageBitmap provided is invalid."); return ScriptPromise(); } if (!sw...
0
115,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: PHP_FUNCTION(imagefilledarc) { zval *IM; long cx, cy, w, h, ST, E, col, style; gdImagePtr im; int e, st; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllllllll", &IM, &cx, &cy, &w, &h, &ST, &E, &col, &style) == FAILURE) { return; } ZEND_FETCH_RESOURCE(im, gdImagePtr, &IM, -1, "Image", le_gd); ...
0
50,195
Analyze the following 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 struct perf_event_attr *perf_event_attrs(struct perf_event *event) { if (!event) return ERR_PTR(-EINVAL); return &event->attr; } Commit Message: perf: Fix race in swevent hash There's a race on CPU unplug where we free the swevent hash array while it can still have events on. This will result in a us...
0
56,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 inline __u32 f2fs_mask_flags(umode_t mode, __u32 flags) { if (S_ISDIR(mode)) return flags; else if (S_ISREG(mode)) return flags & F2FS_REG_FLMASK; else return flags & F2FS_OTHER_FLMASK; } Commit Message: ->splice_write() via ->write_iter() iter_file_splice_write() - a ->splice_write() instance t...
0
46,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: static int vsock_stream_setsockopt(struct socket *sock, int level, int optname, char __user *optval, unsigned int optlen) { int err; struct sock *sk; struct vsock_sock *vsk; u64 val; if (level != AF_VSOCK) return -ENOPROTOOPT; #define COPY_IN(_v) ...
0
30,366
Analyze the following 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 inode *btrfs_lookup_dentry(struct inode *dir, struct dentry *dentry) { struct inode *inode; struct btrfs_root *root = BTRFS_I(dir)->root; struct btrfs_root *sub_root = root; struct btrfs_key location; int index; int ret = 0; if (dentry->d_name.len > BTRFS_NAME_LEN) return ERR_PTR(-ENAMETOOLONG); ...
0
34,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: std::wstring GetEnvironmentString16(const wchar_t* variable_name) { DWORD value_length = ::GetEnvironmentVariableW(variable_name, nullptr, 0); if (!value_length) return std::wstring(); std::wstring value(value_length, L'\0'); value_length = ::GetEnvironmentVariableW(variable_name, &value[0], val...
0
152,629
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: json_t *json_true(void) { static json_t the_true = {JSON_TRUE, (size_t)-1}; return &the_true; } Commit Message: CVE-2013-6401: Change hash function, randomize hashes Thanks to Florian Weimer and Eric Sesterhenn for reporting, reviewing and testing. CWE ID: CWE-310
0
40,938
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int has_prec(int val) { if (val < 2) { return 1; } if (val < 4) { return 2; } if (val < 8) { return 3; } if (val < 16) { return 4; } if (val < 32) { return 5; } if (val < 64) { return 6; } if (val < 128) { ...
0
61,887
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void tg3_process_error(struct tg3 *tp) { u32 val; bool real_error = false; if (tg3_flag(tp, ERROR_PROCESSED)) return; /* Check Flow Attention register */ val = tr32(HOSTCC_FLOW_ATTN); if (val & ~HOSTCC_FLOW_ATTN_MBUF_LWM) { netdev_err(tp->dev, "FLOW Attention error. Resetting chip.\n"); real...
0
32,688
Analyze the following 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 fib_unmerge(struct net *net) { struct fib_table *old, *new; /* attempt to fetch local table if it has been allocated */ old = fib_get_table(net, RT_TABLE_LOCAL); if (!old) return 0; new = fib_trie_unmerge(old); if (!new) return -ENOMEM; /* replace merged table with clean table */ if (new != old...
0
54,128
Analyze the following 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 get_fpexc_mode(struct task_struct *tsk, unsigned long adr) { unsigned int val; if (tsk->thread.fpexc_mode & PR_FP_EXC_SW_ENABLE) #ifdef CONFIG_SPE if (cpu_has_feature(CPU_FTR_SPE)) { /* * When the sticky exception bits are set * directly by userspace, it must call prctl * with PR_GET_FPEXC...
0
38,629
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: init_render_context(ASS_Renderer *render_priv, ASS_Event *event) { render_priv->state.event = event; render_priv->state.parsed_tags = 0; render_priv->state.has_clips = 0; render_priv->state.evt_type = EVENT_NORMAL; reset_render_context(render_priv, NULL); render_priv->state.wrap_style = r...
0
73,371
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static pgprot_t vm_pgprot_modify(pgprot_t oldprot, unsigned long vm_flags) { return pgprot_modify(oldprot, vm_get_page_prot(vm_flags)); } Commit Message: coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping The core dumping code has always run without holding the mmap_sem for wr...
0
90,604
Analyze the following 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 Browser::IsPopupOrPanel(const TabContents* source) const { return is_type_popup() || is_type_panel(); } 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 implemented...
0
97,252
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: sc_file_t * sc_file_new(void) { sc_file_t *file = (sc_file_t *)calloc(1, sizeof(sc_file_t)); if (file == NULL) return NULL; file->magic = SC_FILE_MAGIC; return file; } Commit Message: fixed out of bounds writes Thanks to Eric Sesterhenn from X41 D-SEC GmbH for reporting the problems. CWE ID: CWE-415
0
78,837
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: OMX_ERRORTYPE SoftG711::internalSetParameter( OMX_INDEXTYPE index, const OMX_PTR params) { switch (index) { case OMX_IndexParamAudioPcm: { OMX_AUDIO_PARAM_PCMMODETYPE *pcmParams = (OMX_AUDIO_PARAM_PCMMODETYPE *)params; if (pcmParams->nPortIndex != 0 && pcmP...
1
174,206
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: auth_get_serialnr(struct sc_card *card, struct sc_serial_number *serial) { if (!serial) LOG_FUNC_RETURN(card->ctx, SC_ERROR_INVALID_ARGUMENTS); if (card->serialnr.len==0) LOG_FUNC_RETURN(card->ctx, SC_ERROR_INTERNAL); memcpy(serial, &card->serialnr, sizeof(*serial)); LOG_FUNC_RETURN(card->ctx, SC_SUCCE...
0
78,543
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: png_get_uint_32)(png_const_bytep buf) { png_uint_32 uval = ((png_uint_32)(*(buf )) << 24) + ((png_uint_32)(*(buf + 1)) << 16) + ((png_uint_32)(*(buf + 2)) << 8) + ((png_uint_32)(*(buf + 3)) ) ; return uval; } Commit Message: [libpng16] Fix the calculation of row_factor...
0
79,727
Analyze the following 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 dentry *__d_alloc(struct super_block *sb, const struct qstr *name) { struct dentry *dentry; char *dname; dentry = kmem_cache_alloc(dentry_cache, GFP_KERNEL); if (!dentry) return NULL; /* * We guarantee that the inline name is always NUL-terminated. * This way the memcpy() done by the name swit...
0
94,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: void WebContentsImpl::CreateNewWindow( SiteInstance* source_site_instance, int32_t route_id, int32_t main_frame_route_id, int32_t main_frame_widget_route_id, const ViewHostMsg_CreateWindow_Params& params, SessionStorageNamespace* session_storage_namespace) { bool is_guest = BrowserPlugin...
0
131,777
Analyze the following 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 _zval_internal_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC) /* {{{ */ { if (Z_REFCOUNTED_P(zval_ptr)) { Z_DELREF_P(zval_ptr); if (Z_REFCOUNT_P(zval_ptr) == 0) { _zval_internal_dtor_for_ptr(zval_ptr ZEND_FILE_LINE_CC); } } } /* }}} */ Commit Message: Use format string CWE ID: CWE-134
0
57,301
Analyze the following 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 RenderWidgetHostViewAura::OnTouchEvent(ui::TouchEvent* event) { event_handler_->OnTouchEvent(event); } Commit Message: Allocate a FrameSinkId for RenderWidgetHostViewAura in mus+ash RenderWidgetHostViewChildFrame expects its parent to have a valid FrameSinkId. Make sure RenderWidgetHostViewAura has a Fra...
0
132,280
Analyze the following 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 domStringListFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); TestObjectV8Internal::domStringListFunctionMethod(info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); } Commit Message: document.location bi...
0
121,651
Analyze the following 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 ScriptProfiler::collectGarbage() { v8::V8::LowMemoryNotification(); } Commit Message: Fix clobbered build issue. TBR=jochen@chromium.org NOTRY=true BUG=269698 Review URL: https://chromiumcodereview.appspot.com/22425005 git-svn-id: svn://svn.chromium.org/blink/trunk@155711 bbb929c8-8fbe-4397-9dbb-9b2b...
0
102,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: scoped_refptr<AudioRendererHost> RenderProcessHostImpl::audio_renderer_host() const { return audio_renderer_host_; } Commit Message: Switching AudioOutputAuthorizationHandler from using AudioManager interface to AudioSystem one. BUG=672468 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_...
0
128,334
Analyze the following 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 virtio_scsi_get_lun(uint8_t *lun) { return ((lun[2] << 8) | lun[3]) & 0x3FFF; } Commit Message: CWE ID: CWE-119
0
15,621
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void RenderFrameImpl::BeginNavigation( std::unique_ptr<blink::WebNavigationInfo> info) { const GURL& url = info->url_request.Url(); #ifdef OS_ANDROID bool render_view_was_created_by_renderer = render_view_->was_created_by_renderer_; if (!IsURLHandledByNetworkStack(url) && !url.is_empty() && ...
0
152,837
Analyze the following 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 uint64_t vmxnet3_get_mac_high(MACAddr *addr) { return VMXNET3_MAKE_BYTE(0, addr->a[4]) | VMXNET3_MAKE_BYTE(1, addr->a[5]); } Commit Message: CWE ID: CWE-200
0
8,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: bool smbXcli_conn_is_connected(struct smbXcli_conn *conn) { if (conn == NULL) { return false; } if (conn->sock_fd == -1) { return false; } return true; } Commit Message: CWE ID: CWE-20
0
2,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: GBool DCTStream::readProgressiveDataUnit(DCTHuffTable *dcHuffTable, DCTHuffTable *acHuffTable, int *prevDC, int data[64]) { int run, size, amp, bit, c; int i, j, k; i = scanInfo.firstCoeff; if (i == 0) { if (scanInfo.ah == 0) { if ((size = readHuffSym(dcHuffTable)) == 9999) { retur...
0
4,022
Analyze the following 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 boolean parse_uint( const char **pcur, uint *val ) { const char *cur = *pcur; if (is_digit( cur )) { *val = *cur++ - '0'; while (is_digit( cur )) *val = *val * 10 + *cur++ - '0'; *pcur = cur; return TRUE; } return FALSE; } Commit Message: CWE ID: CWE-119
0
9,143
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SYSCALL_DEFINE2(ftruncate64, unsigned int, fd, loff_t, length) { return do_sys_ftruncate(fd, length, 0); } Commit Message: get rid of s_files and files_lock The only thing we need it for is alt-sysrq-r (emergency remount r/o) and these days we can do just as well without going through the list of files. Signe...
0
46,140
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void ValidateAllTraceMacrosCreatedData(const ListValue& trace_parsed) { const DictionaryValue* item = NULL; #define EXPECT_FIND_(string) \ item = FindTraceEntry(trace_parsed, string); \ EXPECT_TRUE(item); #define EXPECT_NOT_FIND_(string) \ item = FindTraceEntry(trace_parsed, string); \ EXPECT_F...
0
121,406
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static uint32_t find_object_pos(const unsigned char *sha1) { struct object_entry *entry = packlist_find(writer.to_pack, sha1, NULL); if (!entry) { die("Failed to write bitmap index. Packfile doesn't have full closure " "(object %s is missing)", sha1_to_hex(sha1)); } return entry->in_pack_pos; } Comm...
0
54,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: void kvm_apic_update_irr(struct kvm_vcpu *vcpu, u32 *pir) { u32 i, pir_val; struct kvm_lapic *apic = vcpu->arch.apic; for (i = 0; i <= 7; i++) { pir_val = xchg(&pir[i], 0); if (pir_val) *((u32 *)(apic->regs + APIC_IRR + i * 0x10)) |= pir_val; } } Commit Message: KVM: x86: fix guest-initiated crash wi...
0
28,763
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: StyleResolver::~StyleResolver() { m_fontSelector->unregisterForInvalidationCallbacks(this); m_fontSelector->clearDocument(); m_viewportStyleResolver->clearDocument(); } Commit Message: Remove the Simple Default Stylesheet, it's just a foot-gun. We've been bitten by the Simple Default Stylesheet bein...
0
119,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: const AtomicString& Document::alinkColor() const { return BodyAttributeValue(alinkAttr); } Commit Message: Inherit CSP when self-navigating to local-scheme URL As the linked bug example shows, we should inherit CSP when we navigate to a local-scheme URL (even if we are in a main browsing context). Bug: 79974...
0
144,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 int ax25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) { struct sock *sk = sock->sk; void __user *argp = (void __user *)arg; int res = 0; lock_sock(sk); switch (cmd) { case TIOCOUTQ: { long amount; amount = sk->sk_sndbuf - sk_wmem_alloc_get(sk); if (amount < 0) amount = 0...
0
41,458
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int vmx_restore_fixed0_msr(struct vcpu_vmx *vmx, u32 msr_index, u64 data) { u64 *msr; switch (msr_index) { case MSR_IA32_VMX_CR0_FIXED0: msr = &vmx->nested.msrs.cr0_fixed0; break; case MSR_IA32_VMX_CR4_FIXED0: msr = &vmx->nested.msrs.cr4_fixed0; break; default: BUG(); } /* * 1 bits (wh...
0
81,059
Analyze the following 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 fetch_robust_entry(struct robust_list __user **entry, struct robust_list __user * __user *head, unsigned int *pi) { unsigned long uentry; if (get_user(uentry, (unsigned long __user *)head)) return -EFAULT; *entry = (void __user *)(uentry & ~1UL); *pi = uentry & 1; ret...
0
38,197
Analyze the following 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 boolean parse_property( struct translate_ctx *ctx ) { struct tgsi_full_property prop; uint property_name; uint values[8]; uint advance; char id[64]; if (!eat_white( &ctx->cur )) { report_error( ctx, "Syntax error" ); return FALSE; } if (!parse_identifier( &ctx->cur, id,...
0
9,735
Analyze the following 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 TestURLFetcher::response_code() const { return fake_response_code_; } Commit Message: Use URLFetcher::Create instead of new in http_bridge.cc. This change modified http_bridge so that it uses a factory to construct the URLFetcher. Moreover, it modified sync_backend_host_unittest.cc to use an URLFetcher f...
0
100,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: bool SetIntArrayProperty(XID window, const std::string& name, const std::string& type, const std::vector<int>& value) { DCHECK(!value.empty()); Atom name_atom = GetAtom(name.c_str()); Atom type_atom = GetAtom(type.c_str()); scoped...
0
119,210
Analyze the following 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 anon_vma *find_mergeable_anon_vma(struct vm_area_struct *vma) { struct anon_vma *anon_vma; struct vm_area_struct *near; near = vma->vm_next; if (!near) goto try_prev; anon_vma = reusable_anon_vma(near, vma, near); if (anon_vma) return anon_vma; try_prev: near = vma->vm_prev; if (!near) goto...
0
90,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: static void tg3_serdes_parallel_detect(struct tg3 *tp) { if (tp->serdes_counter) { /* Give autoneg time to complete. */ tp->serdes_counter--; return; } if (!tp->link_up && (tp->link_config.autoneg == AUTONEG_ENABLE)) { u32 bmcr; tg3_readphy(tp, MII_BMCR, &bmcr); if (bmcr & BMCR_ANENABLE) { ...
0
32,740
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void WebMediaPlayerMS::OnBecamePersistentVideo(bool value) { get_client()->OnBecamePersistentVideo(value); } Commit Message: Simplify "WouldTaintOrigin" concept in media/blink Currently WebMediaPlayer has three predicates: - DidGetOpaqueResponseFromServiceWorker - HasSingleSecurityOrigin - DidPassCORSAcces...
0
144,158
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: OperationID FileSystemOperationRunner::Write( const FileSystemURL& url, mojo::ScopedDataPipeConsumerHandle data_pipe, int64_t offset, const WriteCallback& callback) { base::File::Error error = base::File::FILE_OK; std::unique_ptr<FileSystemOperation> operation = base::WrapUnique( file_sy...
0
152,197
Analyze the following 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 LinearHistogram::PrintEmptyBucket(uint32_t index) const { return bucket_description_.find(ranges(index)) == bucket_description_.end(); } Commit Message: Convert DCHECKs to CHECKs for histogram types When a histogram is looked up by name, there is currently a DCHECK that verifies the type of the stored hi...
0
140,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: garp_group_garp_interval_handler(vector_t *strvec) { garp_delay_t *delay = LIST_TAIL_DATA(garp_delay); double val; if (!read_double_strvec(strvec, 1, &val, 0, INT_MAX / 1000000, true)) { report_config_error(CONFIG_GENERAL_ERROR, "garp_group garp_interval '%s' invalid", FMT_STR_VSLOT(strvec, 1)); return; ...
0
75,973