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 ShellSurface::WindowClosing() { if (resizer_) EndDrag(true /* revert */); SetEnabled(false); widget_ = nullptr; } Commit Message: exo: Reduce side-effects of dynamic activation code. This code exists for clients that need to managed their own system modal dialogs. Since the addition of the remote...
0
120,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: static int mov_read_seek(AVFormatContext *s, int stream_index, int64_t sample_time, int flags) { AVStream *st; int64_t seek_timestamp, timestamp; int sample; int i; if (stream_index >= s->nb_streams) return AVERROR_INVALIDDATA; if (sample_time < 0) sample_time = 0; st...
0
54,537
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: pp::VarDictionary PDFiumEngine::TraverseBookmarks(FPDF_BOOKMARK bookmark, unsigned int depth) { pp::VarDictionary dict; base::string16 title; unsigned long buffer_size = FPDFBookmark_GetTitle(bookmark, nullptr, 0); if (buffer_size > 0) { PDFiumAPIStrin...
0
146,220
Analyze the following 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 CLASS smal_v6_load_raw() { unsigned seg[2][2]; fseek (ifp, 16, SEEK_SET); seg[0][0] = 0; seg[0][1] = get2(); seg[1][0] = raw_width * raw_height; seg[1][1] = INT_MAX; smal_decode_segment (seg, 0); } Commit Message: Avoid overflow in ljpeg_start(). CWE ID: CWE-189
0
43,377
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MYSQLND_METHOD(mysqlnd_protocol, get_sha256_pk_request_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC) { struct st_mysqlnd_packet_sha256_pk_request * packet = mnd_pecalloc(1, packet_methods[PROT_SHA256_PK_REQUEST_PACKET].struct_size, persistent); DBG_ENTER("mysqlnd_protocol::get_sha25...
0
49,924
Analyze the following 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 comedi_set_subdevice_runflags(struct comedi_subdevice *s, unsigned mask, unsigned bits) { unsigned long flags; spin_lock_irqsave(&s->spin_lock, flags); s->runflags &= ~mask; s->runflags |= (bits & mask); spin_unlock_irqrestore(&s->spin_lock, flags); } Commit Message: staging: comedi: fix...
0
41,289
Analyze the following 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 ResetStorage() { service_->storage_.reset(new MockAppCacheStorage(service_.get())); } Commit Message: Reland "AppCache: Add padding to cross-origin responses." This is a reland of 85b389caa7d725cdd31f59e9a2b79ff54804b7b7 Initialized CacheRecord::padding_size to 0. Original change's description: >...
0
151,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: static inline char * _php_pgsql_trim_result(PGconn * pgsql, char **buf) { return *buf = _php_pgsql_trim_message(PQerrorMessage(pgsql), NULL); } Commit Message: CWE ID:
0
5,219
Analyze the following 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 BookmarksRemoveFunction::RunImpl() { if (!EditBookmarksEnabled()) return false; scoped_ptr<bookmarks::Remove::Params> params( bookmarks::Remove::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); int64 id; if (!base::StringToInt64(params->id, &id)) { error_ = keys::...
0
115,704
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: double yr_object_get_float( YR_OBJECT* object, const char* field, ...) { YR_OBJECT* double_obj; va_list args; va_start(args, field); if (field != NULL) double_obj = _yr_object_lookup(object, 0, field, args); else double_obj = object; va_end(args); if (double_obj == NULL) ...
0
66,047
Analyze the following 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 index_entry_free(git_index_entry *entry) { if (!entry) return; memset(&entry->id, 0, sizeof(entry->id)); git__free(entry); } Commit Message: index: convert `read_entry` to return entry size via an out-param The function `read_entry` does not conform to our usual coding style of returning stuff...
0
83,730
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xsltFreeAttrElemList(xsltAttrElemPtr list) { xsltAttrElemPtr next; while (list != NULL) { next = list->next; xsltFreeAttrElem(list); list = next; } } Commit Message: Roll libxslt to 891681e3e948f31732229f53cb6db7215f740fc7 BUG=583156,583171 Review URL: https://codereview.chromium.org/1853083002...
0
156,658
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: acpi_ns_get_node(struct acpi_namespace_node *prefix_node, const char *pathname, u32 flags, struct acpi_namespace_node **return_node) { acpi_status status; ACPI_FUNCTION_TRACE_PTR(ns_get_node, ACPI_CAST_PTR(char, pathname)); status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); if (ACPI_FAILURE(status)) ...
0
63,327
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: g_NPN_MemFree(void *ptr) { D(bugiI("NPN_MemFree ptr=%p\n", ptr)); NPW_MemFree(ptr); D(bugiD("NPN_MemFree done\n")); } Commit Message: Support all the new variables added CWE ID: CWE-264
0
27,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: const Document& SerializerMarkupAccumulator::document() { return *m_document; } Commit Message: Escape "--" in the page URL at page serialization This patch makes page serializer to escape the page URL embed into a HTML comment of result HTML[1] to avoid inserting text as HTML from URL by introducing a stat...
0
125,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: static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum, int asnum, struct usb_host_interface *ifp, int num_ep, unsigned char *buffer, int size) { unsigned char *buffer0 = buffer; struct usb_endpoint_descriptor *d; struct usb_host_endpoint *endpoint; int n, i, j, retval; unsigned int m...
0
59,748
Analyze the following 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 ~MockAudioRendererHost() { EXPECT_TRUE(delegates_.empty()); } Commit Message: Switching AudioOutputAuthorizationHandler from using AudioManager interface to AudioSystem one. BUG=672468 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:m...
0
128,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: static inline int resolve_named_entity_html(const char *start, size_t length, const entity_ht *ht, unsigned *uni_cp1, unsigned *uni_cp2) { const entity_cp_map *s; ulong hash = zend_inline_hash_func(start, length); s = ht->buckets[hash % ht->num_elems]; while (s->entity) { if (s->entity_len == length) { ...
0
52,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: static long kvm_device_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg) { struct kvm_device *dev = filp->private_data; switch (ioctl) { case KVM_SET_DEVICE_ATTR: return kvm_device_ioctl_attr(dev, dev->ops->set_attr, arg); case KVM_GET_DEVICE_ATTR: return kvm_device_ioctl_attr(dev, ...
0
29,320
Analyze the following 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::parserAppendChild(PassRefPtr<Node> newChild) { ASSERT(newChild); ASSERT(!newChild->parentNode()); // Use appendChild if you need to handle reparenting (and want DOM mutation events). ASSERT(!newChild->isDocumentFragment()); ASSERT(!hasTagName(HTMLNames::templateTag)); if (...
0
110,515
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static __be32 *encode_entryplus_baggage(struct nfsd3_readdirres *cd, __be32 *p, const char *name, int namlen, u64 ino) { struct svc_fh *fh = &cd->scratch; __be32 err; fh_init(fh, NFS3_FHSIZE); err = compose_entry_fh(cd, fh, name, namlen, ino); if (err) { *p++ = 0; *p++ = 0; goto out; } p = encode_po...
0
65,256
Analyze the following 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::updateLayoutIgnorePendingStylesheets(Document::RunPostLayoutTasks runPostLayoutTasks) { DocumentLifecycle::PreventThrottlingScope preventThrottling(lifecycle()); updateLayoutTreeIgnorePendingStylesheets(); updateLayout(); if (runPostLayoutTasks == RunPostLayoutTasksSynchronously &...
0
124,559
Analyze the following 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 CrosLibrary::TestApi::SetTouchpadLibrary( TouchpadLibrary* library, bool own) { library_->touchpad_lib_.SetImpl(library, own); } Commit Message: chromeos: Replace copy-and-pasted code with macros. This replaces a bunch of duplicated-per-library cros function definitions and comments. BUG=none TEST=b...
1
170,648
Analyze the following 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 GDataCache::RequestInitializeOnUIThread() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); pool_->GetSequencedTaskRunner(sequence_token_)->PostTask( FROM_HERE, base::Bind(&GDataCache::Initialize, base::Unretained(this))); } Commit Message: Revert 144993 - gdata: Remove invalid files...
0
105,949
Analyze the following 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_disable_callback(struct rdma_id_private *id_priv, enum rdma_cm_state state) { mutex_lock(&id_priv->handler_mutex); if (id_priv->state != state) { mutex_unlock(&id_priv->handler_mutex); return -EINVAL; } return 0; } Commit Message: IB/core: Don't resolve passive side RoCE L2 address in ...
0
38,472
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void mpol_rebind_default(struct mempolicy *pol, const nodemask_t *nodes, enum mpol_rebind_step step) { } Commit Message: mm: thp: fix pmd_bad() triggering in code paths holding mmap_sem read mode commit 1a5a9906d4e8d1976b701f889d8f35d54b928f25 upstream. In some cases it may happen that pmd_none_or_c...
0
21,328
Analyze the following 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 runtime_refresh_within(struct cfs_bandwidth *cfs_b, u64 min_expire) { struct hrtimer *refresh_timer = &cfs_b->period_timer; u64 remaining; /* if the call-back is running a quota refresh is already occurring */ if (hrtimer_callback_running(refresh_timer)) return 1; /* is a quota refresh about t...
0
92,656
Analyze the following 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 base::TimeDelta GetSwapDelay() { CommandLine* cmd_line = CommandLine::ForCurrentProcess(); int delay = 0; if (cmd_line->HasSwitch(switches::kGpuSwapDelay)) { base::StringToInt(cmd_line->GetSwitchValueNative( switches::kGpuSwapDelay).c_str(), &delay); } return base::TimeDelta::FromMil...
0
114,460
Analyze the following 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 methodWithCallbackInterfaceAndOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); TestObjectV8Internal::methodWithCallbackInterfaceAndOptionalArgMethod(info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");...
0
121,772
Analyze the following 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 ide_sector_read(IDEState *s) { int64_t sector_num; int n; s->status = READY_STAT | SEEK_STAT; s->error = 0; /* not needed by IDE spec, but needed by Windows */ sector_num = ide_get_sector(s); n = s->nsector; if (n == 0) { ide_transfer_stop(s); return; } ...
0
6,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: static int l2tp_ip_disconnect(struct sock *sk, int flags) { if (sock_flag(sk, SOCK_ZAPPED)) return 0; return __udp_disconnect(sk, flags); } Commit Message: l2tp: fix racy SOCK_ZAPPED flag check in l2tp_ip{,6}_bind() Lock socket before checking the SOCK_ZAPPED flag in l2tp_ip6_bind(). Without lock, a concur...
0
70,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: smp_fetch_capture_req_uri(struct proxy *px, struct session *l4, void *l7, unsigned int opt, const struct arg *args, struct sample *smp, const char *kw) { struct chunk *temp; struct http_txn *txn = l7; char *ptr; if (!txn->uri) return 0; ptr = txn->uri; while (*ptr != ' ' &&...
0
9,841
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ASN1_TIME *X509_time_adj(ASN1_TIME *s, long offset_sec, time_t *in_tm) { return X509_time_adj_ex(s, 0, offset_sec, in_tm); } Commit Message: CWE ID: CWE-254
0
5,023
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: OfflinePageModelImpl::OfflinePageModelImpl( std::unique_ptr<OfflinePageMetadataStore> store, std::unique_ptr<ArchiveManager> archive_manager, const scoped_refptr<base::SequencedTaskRunner>& task_runner) : store_(std::move(store)), is_loaded_(false), policy_controller_(new ClientPolicyC...
0
155,901
Analyze the following 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 WebMediaPlayerImpl::Seeking() const { DCHECK(main_task_runner_->BelongsToCurrentThread()); if (ready_state_ == WebMediaPlayer::kReadyStateHaveNothing) return false; return seeking_; } Commit Message: Simplify "WouldTaintOrigin" concept in media/blink Currently WebMediaPlayer has three predicate...
0
144,499
Analyze the following 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_DEFINE3(getresgid, gid_t __user *, rgidp, gid_t __user *, egidp, gid_t __user *, sgidp) { const struct cred *cred = current_cred(); int retval; gid_t rgid, egid, sgid; rgid = from_kgid_munged(cred->user_ns, cred->gid); egid = from_kgid_munged(cred->user_ns, cred->egid); sgid = from_kgid_munged(cred...
0
21,535
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WavpackContext *WavpackOpenFileInputEx64 (WavpackStreamReader64 *reader, void *wv_id, void *wvc_id, char *error, int flags, int norm_offset) { WavpackContext *wpc = malloc (sizeof (WavpackContext)); WavpackStream *wps; int num_blocks = 0; unsigned char first_byte; uint32_t bcount; if (!wp...
0
70,881
Analyze the following 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_sched_topology(struct sched_domain_topology_level *tl) { sched_domain_topology = tl; } Commit Message: Merge branch 'stacking-fixes' (vfs stacking fixes from Jann) Merge filesystem stacking fixes from Jann Horn. * emailed patches from Jann Horn <jannh@google.com>: sched: panic on corrupted stack en...
0
55,653
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static enum hrtimer_restart pit_timer_fn(struct hrtimer *data) { struct kvm_kpit_state *ps = container_of(data, struct kvm_kpit_state, timer); struct kvm_pit *pt = ps->kvm->arch.vpit; if (ps->reinject || !atomic_read(&ps->pending)) { atomic_inc(&ps->pending); queue_kthread_work(&pt->worker, &pt->expired);...
0
37,729
Analyze the following 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 BluetoothDeviceChromeOS::IsPaired() const { BluetoothDeviceClient::Properties* properties = DBusThreadManager::Get()->GetBluetoothDeviceClient()-> GetProperties(object_path_); DCHECK(properties); return properties->paired.value() || properties->trusted.value(); } Commit Message: Refac...
0
112,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: RenderWidgetHost* TabLoader::GetRenderWidgetHost(NavigationController* tab) { WebContents* web_contents = tab->GetWebContents(); if (web_contents) { RenderWidgetHostView* render_widget_host_view = web_contents->GetRenderWidgetHostView(); if (render_widget_host_view) return render_widget_...
0
108,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: set_reply_serial (DBusMessage *message) { if (message == NULL) _dbus_assert_not_reached ("oom"); if (!dbus_message_set_reply_serial (message, 100)) _dbus_assert_not_reached ("oom"); } Commit Message: CWE ID: CWE-399
0
7,502
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SyncError ExtensionService::MergeDataAndStartSyncing( syncable::ModelType type, const SyncDataList& initial_sync_data, SyncChangeProcessor* sync_processor) { CHECK(sync_processor); SyncBundle* bundle = NULL; switch (type) { case syncable::EXTENSIONS: bundle = &extension_sync_bundle_;...
0
98,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: get_h_kerning(hb_font_t *font, void *font_data, hb_codepoint_t first, hb_codepoint_t second, void *user_data) { FT_Face face = font_data; FT_Vector kern; if (FT_Get_Kerning(face, first, second, FT_KERNING_DEFAULT, &kern)) return 0; return kern.x; } Commit Message: shape...
0
73,295
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ext_t_1_wml_10(tvbuff_t *tvb, guint32 value, guint32 str_tbl) { char *str = wmem_strdup_printf(wmem_packet_scope(), "Variable substitution - unescaped: '%s'", tvb_get_const_stringz(tvb, str_tbl + value, NULL)); return str; } Commit Message: WBXML: add a basic sanity check for offset overflow This is a...
0
51,707
Analyze the following 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 WT_UpdateEG2 (S_WT_VOICE *pWTVoice, const S_ENVELOPE *pEnv) { EAS_I32 temp; switch (pWTVoice->eg2State) { case eEnvelopeStateAttack: temp = pWTVoice->eg2Value + pWTVoice->eg2Increment; /* check if we have reached peak amplitude */ if (temp >= SYNTH_FULL_SCALE_EG1_GAIN) { /* li...
0
161,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: views::View* TrayPower::CreateDetailedView(user::LoginStatus status) { return NULL; } Commit Message: ash: Fix right-alignment of power-status text. It turns out setting ALING_RIGHT on a Label isn't enough to get proper right-aligned text. Label has to be explicitly told that it is multi-lined. BUG=none TEST...
0
106,586
Analyze the following 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 TreeView::CreateRootItems() { DCHECK(model_); DCHECK(tree_view_); TreeModelNode* root = model_->GetRoot(); if (root_shown_) { CreateItem(NULL, TVI_LAST, root); } else { for (int i = 0; i < model_->GetChildCount(root); ++i) CreateItem(NULL, TVI_LAST, model_->GetChild(root, i)); } } ...
0
100,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: static zval *spl_array_read_dimension_ex(int check_inherited, zval *object, zval *offset, int type TSRMLS_DC) /* {{{ */ { zval **ret; if (check_inherited) { spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); if (intern->fptr_offset_get) { zval *rv; if (!offs...
0
49,871
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int nfs_init(void) { rootnfsopts = xstrdup("v3,tcp"); globalvar_add_simple_string("linux.rootnfsopts", &rootnfsopts); return register_fs_driver(&nfs_driver); } Commit Message: CWE ID: CWE-119
0
1,339
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MarginInfo::MarginInfo(RenderBlockFlow* blockFlow, LayoutUnit beforeBorderPadding, LayoutUnit afterBorderPadding) : m_canCollapseMarginAfterWithLastChild(true) , m_atBeforeSideOfBlock(true) , m_atAfterSideOfBlock(false) , m_hasMarginBeforeQuirk(false) , m_hasMarginAfterQuirk(false) , m_det...
0
116,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: void RenderWidgetHostImpl::ForwardGestureEventWithLatencyInfo( const blink::WebGestureEvent& gesture_event, const ui::LatencyInfo& latency) { TRACE_EVENT1("input", "RenderWidgetHostImpl::ForwardGestureEvent", "type", WebInputEvent::GetName(gesture_event.GetType())); if (ShouldDropInputE...
0
145,454
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: server_unresponsive(struct TCP_Server_Info *server) { /* * We need to wait 2 echo intervals to make sure we handle such * situations right: * 1s client sends a normal SMB request * 2s client gets a response * 30s echo workqueue job pops, and decides we got a response recently * and don't need t...
0
29,862
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gfx::Rect GetSplitViewRightWindowBounds(aura::Window* window) { return split_view_controller()->GetSnappedWindowBoundsInScreen( window, SplitViewController::RIGHT); } Commit Message: cros: Enable some tests in //ash/wm in ash_unittests --mash For the ones that fail, disable them via filter file ...
0
133,213
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: tt_cmap4_char_map_linear( TT_CMap cmap, FT_UInt32* pcharcode, FT_Bool next ) { FT_UInt num_segs2, start, end, offset; FT_Int delta; FT_UInt i, num_segs; FT_UInt32 charcode = *pcharcode; FT_UInt gindex = 0; ...
0
4,186
Analyze the following 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 intel_pmu_drain_bts_buffer(void) { struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); struct debug_store *ds = cpuc->ds; struct bts_record { u64 from; u64 to; u64 flags; }; struct perf_event *event = cpuc->events[X86_PMC_IDX_FIXED_BTS]; struct bts_record *at, *top; struct perf_out...
1
165,821
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: get_conjunctions(const struct ofputil_flow_mod *fm, struct cls_conjunction **conjsp, size_t *n_conjsp) { struct cls_conjunction *conjs = NULL; int n_conjs = 0; const struct ofpact *ofpact; OFPACT_FOR_EACH (ofpact, fm->ofpacts, fm->ofpacts_len) { if (ofpact->type == OFPACT...
0
77,227
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xmlParseDocument(xmlParserCtxtPtr ctxt) { xmlChar start[4]; xmlCharEncoding enc; xmlInitParser(); if ((ctxt == NULL) || (ctxt->input == NULL)) return(-1); GROW; /* * SAX: detecting the level. */ xmlDetectSAX2(ctxt); /* * SAX: beginning of the document pr...
1
171,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: void GrantPermissionsForFileSystem(const std::string& filesystem_id, int permissions) { if (!base::ContainsKey(filesystem_permissions_, filesystem_id)) storage::IsolatedContext::GetInstance()->AddReference(filesystem_id); filesystem_permissions_[filesystem_id] ...
0
143,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: void AsyncReadPixelsCompletedQuery::Destroy(bool /* have_context */) { if (!IsDeleted()) { MarkAsDeleted(); } } Commit Message: Add bounds validation to AsyncPixelTransfersCompletedQuery::End BUG=351852 R=jbauman@chromium.org, jorgelo@chromium.org Review URL: https://codereview.chromium.org/198253002 ...
0
121,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: static void vmx_write_tsc_offset(struct kvm_vcpu *vcpu, u64 offset) { if (is_guest_mode(vcpu)) { /* * We're here if L1 chose not to trap WRMSR to TSC. According * to the spec, this should set L1's TSC; The offset that L1 * set for L2 remains unchanged, and still needs to be added * to the newly set...
0
37,320
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ResourceFetcher* XSLStyleSheet::fetcher() { Document* document = ownerDocument(); if (!document) return 0; return document->fetcher(); } Commit Message: Avoid reparsing an XSLT stylesheet after the first failure. Certain libxslt versions appear to leave the doc in an invalid state when parsi...
0
111,466
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void Type_Signature_Free(struct _cms_typehandler_struct* self, void* Ptr) { _cmsFree(self ->ContextID, Ptr); } Commit Message: Added an extra check to MLU bounds Thanks to Ibrahim el-sayed for spotting the bug CWE ID: CWE-125
0
71,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: static void dump(int fd) { btif_debug_dump(fd); } Commit Message: Add guest mode functionality (2/3) Add a flag to enable() to start Bluetooth in restricted mode. In restricted mode, all devices that are paired during restricted mode are deleted upon leaving restricted mode. Right now restricted mode is onl...
0
159,631
Analyze the following 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 UrlData::set_valid_until(base::Time valid_until) { DCHECK(thread_checker_.CalledOnValidThread()); valid_until_ = valid_until; } Commit Message: Simplify "WouldTaintOrigin" concept in media/blink Currently WebMediaPlayer has three predicates: - DidGetOpaqueResponseFromServiceWorker - HasSingleSecurity...
0
144,358
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: line_construct_pts(LINE *line, Point *pt1, Point *pt2) { if (FPeq(pt1->x, pt2->x)) { /* vertical */ /* use "x = C" */ line->A = -1; line->B = 0; line->C = pt1->x; #ifdef GEODEBUG printf("line_construct_pts- line is vertical\n"); #endif } else if (FPeq(pt1->y, pt2->y)) { /* horizontal */...
0
38,897
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void ext4_ext_truncate(struct inode *inode) { struct address_space *mapping = inode->i_mapping; struct super_block *sb = inode->i_sb; ext4_lblk_t last_block; handle_t *handle; int err = 0; /* * finish any pending end_io work so we won't run the risk of * converting any truncated blocks to initialized l...
0
34,770
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void set_excluded_envvar(void) { struct strbuf *item_list = strbuf_new(); const char *fmt = "%s"; GtkTreeIter iter; if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(g_ls_details), &iter)) { do { gchar *item_name = NULL; gboolean checked = 0; ...
0
42,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: static int sixel_put_flash(sixel_output_t *const context) { int n; int nwrite; #if defined(USE_VT240) /* VT240 Max 255 ? */ while (context->save_count > 255) { nwrite = spritf((char *)context->buffer + context->pos, "!255%c", context->save_pixel); if (nwrite <= 0) { ...
0
71,702
Analyze the following 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 pxa2xx_ssp_fifo_update(PXA2xxSSPState *s) { s->sssr &= ~(0xf << 12); /* Clear RFL */ s->sssr &= ~(0xf << 8); /* Clear TFL */ s->sssr &= ~SSSR_TFS; s->sssr &= ~SSSR_TNF; if (s->enable) { s->sssr |= ((s->rx_level - 1) & 0xf) << 12; if (s->rx_level >= SSCR1_RFT(s->sscr...
0
15,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: bool Extension::HasAPIPermissionForTab(int tab_id, APIPermission::ID permission) const { base::AutoLock auto_lock(runtime_data_lock_); if (runtime_data_.GetActivePermissions()->HasAPIPermission(permission)) return true; scoped_refptr<const PermissionSet> tab_speci...
0
114,310
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: nfsd_init_raparms(struct file *file) { struct inode *inode = file_inode(file); dev_t dev = inode->i_sb->s_dev; ino_t ino = inode->i_ino; struct raparms *ra, **rap, **frap = NULL; int depth = 0; unsigned int hash; struct raparm_hbucket *rab; hash = jhash_2words(dev, ino, 0xfeedbeef) & RAPARM_HASH_MASK; r...
0
65,892
Analyze the following 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::RequestToLockMouse(bool user_gesture, bool last_unlocked_by_target) { delegate_->RequestToLockMouse(user_gesture, last_unlocked_by_target); } Commit Message: Filter more incoming URLs in the CreateWindow path. BUG=170532 Review URL: https:/...
0
117,290
Analyze the following 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 inverse_mdct(float *buffer, int n, vorb *f, int blocktype) { mdct_lookup *M; if (M1.n == n) M = &M1; else if (M2.n == n) M = &M2; else if (M1.n == 0) { mdct_init(&M1, n); M = &M1; } else { if (M2.n) __asm int 3; mdct_init(&M2, n); M = &M2; } mdct_backward(M, buffer, b...
0
75,276
Analyze the following 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 vmsvga_invalidate_display(void *opaque) { struct vmsvga_state_s *s = opaque; if (!s->enable) { s->vga.hw_ops->invalidate(&s->vga); return; } s->invalidated = 1; } Commit Message: CWE ID: CWE-787
0
8,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: ScriptPromise VRDisplay::exitPresent(ScriptState* script_state) { ScriptPromiseResolver* resolver = ScriptPromiseResolver::Create(script_state); ScriptPromise promise = resolver->Promise(); if (!is_presenting_) { DOMException* exception = DOMException::Create( kInvalidStateError, "VRDisplay...
1
172,001
Analyze the following 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 prb_curr_blk_in_use(struct tpacket_kbdq_core *pkc, struct tpacket_block_desc *pbd) { return TP_STATUS_USER & BLOCK_STATUS(pbd); } Commit Message: net: rework recvmsg handler msg_name and msg_namelen logic This patch now always passes msg->msg_namelen as 0. recvmsg handlers must set msg_nam...
0
40,645
Analyze the following 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 __audit_file(const struct file *file) { __audit_inode(NULL, file->f_path.dentry, 0); } Commit Message: audit: fix a double fetch in audit_log_single_execve_arg() There is a double fetch problem in audit_log_single_execve_arg() where we first check the execve(2) argumnets for any "bad" characters which wou...
0
51,121
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int WavpackStoreMD5Sum (WavpackContext *wpc, unsigned char data [16]) { return add_to_metadata (wpc, data, 16, (wpc->config.qmode & 0xff) ? ID_ALT_MD5_CHECKSUM : ID_MD5_CHECKSUM); } Commit Message: issue #53: error out on zero sample rate CWE ID: CWE-835
0
75,645
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static ZIPARCHIVE_METHOD(statIndex) { struct zip *intern; zval *self = getThis(); zend_long index, flags = 0; struct zip_stat sb; if (!self) { RETURN_FALSE; } ZIP_FROM_OBJECT(intern, self); if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l", &index, &flags) == FAILURE) { return; } if (zip_stat...
0
54,394
Analyze the following 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 shift_data(AVFormatContext *s) { int ret = 0, moov_size; MOVMuxContext *mov = s->priv_data; int64_t pos, pos_end = avio_tell(s->pb); uint8_t *buf, *read_buf[2]; int read_buf_id = 0; int read_size[2]; AVIOContext *read_pb; if (mov->flags & FF_MOV_FLAG_FRAGMENT) m...
0
79,447
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ComputedAccessibleNode* Document::GetOrCreateComputedAccessibleNode( AXID ax_id, WebComputedAXTree* tree) { if (computed_node_mapping_.find(ax_id) == computed_node_mapping_.end()) { ComputedAccessibleNode* node = ComputedAccessibleNode::Create(ax_id, tree, this); computed_node_mapping_.i...
0
129,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: void ImageInputType::createShadowSubtree() { if (!m_useFallbackContent) { BaseButtonInputType::createShadowSubtree(); return; } HTMLImageFallbackHelper::createAltTextShadowTree(element()); } Commit Message: ImageInputType::ensurePrimaryContent should recreate UA shadow tree. Once the...
0
133,005
Analyze the following 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 AddChromeOSUserStrings(content::WebUIDataSource* html_source, Profile* profile) { user_manager::UserManager* user_manager = user_manager::UserManager::Get(); const user_manager::User* user = chromeos::ProfileHelper::Get()->GetUserByProfile(profile); const user_manager...
0
148,756
Analyze the following 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 lsi_resume_script(LSIState *s) { if (s->waiting != 2) { s->waiting = LSI_NOWAIT; lsi_execute_script(s); } else { s->waiting = LSI_NOWAIT; } } Commit Message: CWE ID: CWE-835
0
3,696
Analyze the following 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 LayerTreeHost::InitializeThreaded( scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner) { task_runner_provider_ = TaskRunnerProvider::Create(main_task_runner, impl_task_runner); std::unique_ptr<ProxyMain> proxy_main = ...
0
137,126
Analyze the following 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 toplevelWindowResizeGripVisibilityChanged(GObject* object, GParamSpec*, WebKitWebViewBase* webViewBase) { webkitWebViewBaseNotifyResizerSizeForWindow(webViewBase, GTK_WINDOW(object)); } Commit Message: [GTK] Inspector should set a default attached height before being attached https://bugs.webkit....
0
108,862
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SPICE_GNUC_VISIBLE int spice_server_set_agent_mouse(SpiceServer *s, int enable) { spice_assert(reds == s); agent_mouse = enable; reds_update_mouse_mode(); return 0; } Commit Message: CWE ID: CWE-119
0
1,975
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: vrrp_vroutes_handler(vector_t *strvec) { alloc_value_block(alloc_vrrp_vroute, vector_slot(strvec, 0)); } Commit Message: When opening files for write, ensure they aren't symbolic links Issue #1048 identified that if, for example, a non privileged user created a symbolic link from /etc/keepalvied.data to /etc/p...
0
76,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 Framebuffer::UnbindTexture( GLenum target, TextureRef* texture_ref) { bool done; do { done = true; for (AttachmentMap::const_iterator it = attachments_.begin(); it != attachments_.end(); ++it) { Attachment* attachment = it->second.get(); if (attachment->IsTexture(texture_...
0
120,719
Analyze the following 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 channel_exec (lua_State *L, int status, lua_KContext ctx) { int rc; LIBSSH2_CHANNEL **channel = (LIBSSH2_CHANNEL **) lua_touserdata(L, 2); const char *cmd = luaL_checkstring(L, 3); while ((rc = libssh2_channel_exec(*channel, cmd)) == LIBSSH2_ERROR_EAGAIN) { luaL_getmetafield(L,...
0
93,469
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int adev_set_master_mute(struct audio_hw_device *dev, bool muted) { (void)dev; (void)muted; return -ENOSYS; } Commit Message: Fix audio record pre-processing proc_buf_out consistently initialized. intermediate scratch buffers consistently initialized. prevent read failure from overwriting memory. Te...
0
162,253
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SetCriticalEvent(int event) { if (event >= MAXEVENTS) FatalError("SetCriticalEvent: bogus event number"); criticalEvents[event >> 3] |= 1 << (event & 7); } Commit Message: CWE ID: CWE-119
0
4,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: InputHandler::ScrollStatus LayerTreeHostImpl::ScrollAnimated( const gfx::Point& viewport_point, const gfx::Vector2dF& scroll_delta, base::TimeDelta delayed_by) { InputHandler::ScrollStatus scroll_status; scroll_status.main_thread_scrolling_reasons = MainThreadScrollingReason::kNotScrollingOn...
0
137,337
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int call_netdevice_notifiers(unsigned long val, struct net_device *dev) { return raw_notifier_call_chain(&netdev_chain, val, dev); } Commit Message: veth: Dont kfree_skb() after dev_forward_skb() In case of congestion, netif_rx() frees the skb, so we must assume dev_forward_skb() also consume skb. Bug introdu...
0
32,083
Analyze the following 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 GetTabId(base::DictionaryValue* tab) { int id = kUndefinedId; if (tab) tab->GetInteger(keys::kIdKey, &id); return id; } Commit Message: Change TemporaryAddressSpoof test to not depend on PDF OpenActions. OpenActions that navigate to URIs are going to be blocked when https://pdfium-review.googlesou...
0
144,826
Analyze the following 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 PrintRenderFrameHelper::OnFramePreparedForPrintPages() { PrintPages(); FinishFramePrinting(); } Commit Message: Correct mojo::WrapSharedMemoryHandle usage Fixes some incorrect uses of mojo::WrapSharedMemoryHandle which were assuming that the call actually has any control over the memory protection appl...
0
149,120
Analyze the following 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 status_t createPlugin(const uint8_t uuid[16]) { Parcel data, reply; data.writeInterfaceToken(IDrm::getInterfaceDescriptor()); data.write(uuid, 16); status_t status = remote()->transact(CREATE_PLUGIN, data, &reply); if (status != OK) { return status; } return reply.readInt32(); } ...
0
161,281
Analyze the following 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 Effect_Init(preproc_effect_t *effect, uint32_t procId) { if (HasReverseStream(procId)) { effect->itfe = &sEffectInterfaceReverse; } else { effect->itfe = &sEffectInterface; } effect->ops = sPreProcOps[procId]; effect->procId = procId; effect->state = PREPROC_EFFECT_STATE_INIT; ...
0
157,470
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ChromeContentBrowserClient::AllowWebBluetooth( content::BrowserContext* browser_context, const url::Origin& requesting_origin, const url::Origin& embedding_origin) { if (variations::GetVariationParamValue( PermissionContextBase::kPermissionsKillSwitchFieldStudy, "Bluetooth") == ...
0
142,590