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: virDomainReset(virDomainPtr domain, unsigned int flags) { virConnectPtr conn; VIR_DOMAIN_DEBUG(domain, "flags=%x", flags); virResetLastError(); virCheckDomainReturn(domain, -1); conn = domain->conn; virCheckReadOnlyGoto(conn->flags, error); if (conn->driver->domainReset) { ...
0
93,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: gfx::Point AwContents::GetLocationOnScreen() { DCHECK_CURRENTLY_ON(BrowserThread::UI); JNIEnv* env = AttachCurrentThread(); ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); if (obj.is_null()) return gfx::Point(); std::vector<int> location; base::android::JavaIntArrayToIntVector( env, ...
0
119,589
Analyze the following 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 request *__get_request(struct request_list *rl, unsigned int op, struct bio *bio, blk_mq_req_flags_t flags, gfp_t gfp_mask) { struct request_queue *q = rl->q; struct request *rq; struct elevator_type *et = q->elevator->type; struct io_context *ioc = rq_ioc(bio); struct io_cq *icq = NULL; con...
0
91,952
Analyze the following 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 WriteIndices(Image *image, const DDSVector3 start, const DDSVector3 end, unsigned char* indices) { register ssize_t i; size_t a, b; unsigned char remapped[16]; const unsigned char *ind; a = ColorTo565(start); b = ColorTo565(end); for (i=0; i<16; i++) { if...
0
65,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: static inline u64 btrfs_inc_tree_mod_seq(struct btrfs_fs_info *fs_info) { return atomic64_inc_return(&fs_info->tree_mod_seq); } Commit Message: Btrfs: make xattr replace operations atomic Replacing a xattr consists of doing a lookup for its existing value, delete the current value from the respective leaf, rel...
0
45,305
Analyze the following 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 page_referenced(struct page *page, int is_locked, struct mem_cgroup *memcg, unsigned long *vm_flags) { int ret; int we_locked = 0; struct page_referenced_arg pra = { .mapcount = page_mapcount(page), .memcg = memcg, }; struct rmap_walk_control rwc = { .rmap_one = page_referenced_on...
0
38,315
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: OxideQQuickWebView::ContentType OxideQQuickWebView::blockedContent() const { Q_D(const OxideQQuickWebView); Q_STATIC_ASSERT( ContentTypeNone == static_cast<ContentTypeFlags>(oxide::qt::CONTENT_TYPE_NONE)); Q_STATIC_ASSERT( ContentTypeMixedDisplay == static_cast<ContentTypeFlags>...
0
17,069
Analyze the following 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 MemBackendImpl::CalculateSizeOfEntriesBetween( base::Time initial_time, base::Time end_time, const CompletionCallback& callback) { if (end_time.is_null()) end_time = Time::Max(); DCHECK_GE(end_time, initial_time); int size = 0; base::LinkNode<MemEntryImpl>* node = lru_list_.head(); ...
0
147,359
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: R_API RBinFile *r_bin_file_new(RBin *bin, const char *file, const ut8 *bytes, ut64 sz, ut64 file_sz, int rawstr, int fd, const char *xtrname, Sdb *sdb, bool steal_ptr) { RBinFile *binfile = R_NEW0 (RBinFile); if (!binfile) { return NULL; } if (!r_id_pool_grab_id (bin->file_ids, &binfile->id)) { if (steal_...
0
82,812
Analyze the following 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 DevToolsWindow::DoAction() { UpdateFrontendDockSide(); switch (action_on_load_.type()) { case DevToolsToggleAction::kShowConsole: CallClientFunction("InspectorFrontendAPI.showConsole", NULL, NULL, NULL); break; case DevToolsToggleAction::kInspect: CallClientFunction("InspectorF...
0
113,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: file_getbuffer(struct magic_set *ms) { char *pbuf, *op, *np; size_t psize, len; if (ms->event_flags & EVENT_HAD_ERR) return NULL; if (ms->flags & MAGIC_RAW) return ms->o.buf; if (ms->o.buf == NULL) return NULL; /* * 4 is for octal representation, + 1 is for NUL */ len = strlen(ms->o.buf); if (le...
0
35,637
Analyze the following 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_der_decoding (asn1_node * element, const void *ider, int ider_len, char *errorDescription) { return asn1_der_decoding2 (element, ider, &ider_len, 0, errorDescription); } Commit Message: CWE ID: CWE-399
0
11,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: ZEND_INI_MH(OnUpdateDecode) { if (new_value) { const zend_encoding **return_list; size_t return_size; if (FAILURE == zend_multibyte_parse_encoding_list(new_value, new_value_length, &return_list, &return_size, 0 TSRMLS_CC)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal encoding ignored: '%s'", ...
0
6,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: UsbTabHelper::GetPermissionProvider(RenderFrameHost* render_frame_host) { FrameUsbServices* frame_usb_services = GetFrameUsbService(render_frame_host); if (!frame_usb_services->permission_provider) { frame_usb_services->permission_provider.reset( new WebUSBPermissionProvider(render_frame_host)); ...
0
155,090
Analyze the following 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 Textfield::SetReadOnly(bool read_only) { read_only_ = read_only; if (GetInputMethod()) GetInputMethod()->OnTextInputTypeChanged(this); SetColor(GetTextColor()); UpdateBackgroundColor(); } Commit Message: MacViews: Enable secure text input for password Textfields. In Cocoa the NSTextInputContext...
0
126,424
Analyze the following 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 gint on_key_press_event_in_item_list(GtkTreeView *treeview, GdkEventKey *key, gpointer unused) { int k = key->keyval; if (k == GDK_KEY_Delete || k == GDK_KEY_KP_Delete) { delete_item(treeview); return TRUE; } return FALSE; } Commit Message: wizard: fix save users chang...
0
42,847
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void Curl_up_free(struct Curl_easy *data) { struct urlpieces *up = &data->state.up; Curl_safefree(up->scheme); Curl_safefree(up->hostname); Curl_safefree(up->port); Curl_safefree(up->user); Curl_safefree(up->password); Curl_safefree(up->options); Curl_safefree(up->path); Curl_safefree(up->query)...
0
77,778
Analyze the following 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 HTMLSelectElement::searchOptionsForValue(const String& value, size_t listIndexStart, size_t listIndexEnd) const { const Vector<HTMLElement*>& items = listItems(); size_t loopEndIndex = std::min(items.size(), listIndexEnd); for (size_t i = listIndexStart; i < loopEndIndex; ++i) { if (!it...
0
103,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 void VoidMethodDefaultNullableTestInterfaceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { TestObject* impl = V8TestObject::ToImpl(info.Holder()); TestInterfaceImplementation* default_test_interface_arg; if (!info[0]->IsUndefined()) { default_test_interface_arg = V8TestInterface::To...
0
135,383
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WandExport void ProcessScriptOptions(MagickCLI *cli_wand,const char *filename, int argc,char **argv,int index) { ScriptTokenInfo *token_info; CommandOptionFlags option_type; int count; char *option, *arg1, *arg2; assert(filename != (char *) NULL ); /* at least one argument ...
0
71,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: Track::~Track() { Info& info = const_cast<Info&>(m_info); info.Clear(); ContentEncoding** i = content_encoding_entries_; ContentEncoding** const j = content_encoding_entries_end_; while (i != j) { ContentEncoding* const encoding = *i++; delete encoding; } delete [...
1
174,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 int mxf_read_track(void *arg, AVIOContext *pb, int tag, int size, UID uid, int64_t klv_offset) { MXFTrack *track = arg; switch(tag) { case 0x4801: track->track_id = avio_rb32(pb); break; case 0x4804: avio_read(pb, track->track_number, 4); break; case 0x48...
0
61,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: static int pfkey_xfrm_policy2msg_size(const struct xfrm_policy *xp) { const struct xfrm_tmpl *t; int sockaddr_size = pfkey_sockaddr_size(xp->family); int socklen = 0; int i; for (i=0; i<xp->xfrm_nr; i++) { t = xp->xfrm_vec + i; socklen += pfkey_sockaddr_len(t->encap_family); } return sizeof(struct sa...
0
31,475
Analyze the following 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 perf_event_task_tick(void) { struct list_head *head = &__get_cpu_var(rotation_list); struct perf_cpu_context *cpuctx, *tmp; struct perf_event_context *ctx; int throttled; WARN_ON(!irqs_disabled()); __this_cpu_inc(perf_throttled_seq); throttled = __this_cpu_xchg(perf_throttled_count, 0); list_for_e...
0
31,955
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void RenderView::didReceiveDocumentData( WebFrame* frame, const char* data, size_t data_len, bool& prevent_default) { NavigationState* navigation_state = NavigationState::FromDataSource(frame->dataSource()); navigation_state->set_use_error_page(false); } Commit Message: DevTools: move DevToolsA...
0
99,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: static void save_state_to_tss32(struct x86_emulate_ctxt *ctxt, struct tss_segment_32 *tss) { /* CR3 and ldt selector are not saved intentionally */ tss->eip = ctxt->_eip; tss->eflags = ctxt->eflags; tss->eax = reg_read(ctxt, VCPU_REGS_RAX); tss->ecx = reg_read(ctxt, VCPU_REGS_RCX); tss->edx = reg_read(c...
0
35,598
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int ext4_map_blocks(handle_t *handle, struct inode *inode, struct ext4_map_blocks *map, int flags) { struct extent_status es; int retval; int ret = 0; #ifdef ES_AGGRESSIVE_TEST struct ext4_map_blocks orig_map; memcpy(&orig_map, map, sizeof(*map)); #endif map->m_flags = 0; ext_debug("ext4_map_blocks...
1
168,270
Analyze the following 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 AutofillManager::DisambiguateNameUploadTypes( FormStructure* form, size_t current_index, const ServerFieldTypeSet& upload_types) { bool has_found_previous_type = false; bool is_previous_credit_card = false; size_t index = current_index; while (index != 0 && !has_found_previous_type) { ...
0
154,941
Analyze the following 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 tty_ldisc_deref(struct tty_ldisc *ld) { ldsem_up_read(&ld->tty->ldisc_sem); } Commit Message: tty: Prevent ldisc drivers from re-using stale tty fields Line discipline drivers may mistakenly misuse ldisc-related fields when initializing. For example, a failure to initialize tty->receive_room in the N_GIGA...
0
55,989
Analyze the following 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 messagePortArrayAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) { TestObject* imp = V8TestObject::toNative(info.Holder()); v8SetReturnValue(info, v8Array(imp->messagePortArray(), info.GetIsolate())); } Commit Message: document.location bindings fix BUG=352374 R=jochen@chromi...
0
121,761
Analyze the following 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_header(struct oom_control *oc, struct task_struct *p) { pr_warn("%s invoked oom-killer: gfp_mask=%#x(%pGg), nodemask=%*pbl, order=%d, oom_score_adj=%hd\n", current->comm, oc->gfp_mask, &oc->gfp_mask, nodemask_pr_args(oc->nodemask), oc->order, current->signal->oom_score_adj); if (!IS_ENAB...
0
85,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: static int mlx5_ib_dct_query_qp(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *mqp, struct ib_qp_attr *qp_attr, int qp_attr_mask, struct ib_qp_init_attr *qp_init_attr) { struct mlx5_core_dct *dct = &mqp->dct.mdct; u32 *out; u32 access_flags = 0; int outlen = MLX5_ST_SZ_BYTES(query_dct_out); void *dctc; ...
0
92,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: static void linear_map_bio(struct dm_target *ti, struct bio *bio) { struct linear_c *lc = ti->private; bio->bi_bdev = lc->dev->bdev; if (bio_sectors(bio)) bio->bi_sector = linear_map_sector(ti, bio->bi_sector); } Commit Message: dm: do not forward ioctls from logical volumes to the underlying device A log...
0
23,564
Analyze the following 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 GetTransforms(const Cmd& cmd, GLuint num_paths, GLenum transform_type, const GLfloat** out_transforms) { if (transform_type == GL_NONE) { *out_transforms = nullptr; return true; } uint32_t transforms_shm_id = sta...
0
141,498
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void xenvif_up(struct xenvif *vif) { xen_netbk_add_xenvif(vif); enable_irq(vif->irq); xen_netbk_check_rx_xenvif(vif); } Commit Message: xen/netback: shutdown the ring if it contains garbage. A buggy or malicious frontend should not be able to confuse netback. If we spot anything which is not as it sho...
0
34,036
Analyze the following 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 ext4_ext_show_path(struct inode *inode, struct ext4_ext_path *path) { int k, l = path->p_depth; ext_debug("path:"); for (k = 0; k <= l; k++, path++) { if (path->p_idx) { ext_debug(" %d->%llu", le32_to_cpu(path->p_idx->ei_block), ext4_idx_pblock(path->p_idx)); } else if (path->p_ext...
0
44,884
Analyze the following 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_next( TT_CMap4 cmap ) { FT_UInt charcode; if ( cmap->cur_charcode >= 0xFFFFUL ) goto Fail; charcode = cmap->cur_charcode + 1; if ( charcode < cmap->cur_start ) charcode = cmap->cur_start; for ( ;; ) { FT_Byte* values = cmap->cur_values; FT_UInt ...
0
4,190
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: test_bson_clear (void) { bson_t *doc = NULL; bson_clear (&doc); BSON_ASSERT (doc == NULL); doc = bson_new (); BSON_ASSERT (doc != NULL); bson_clear (&doc); BSON_ASSERT (doc == NULL); } Commit Message: Fix for CVE-2018-16790 -- Verify bounds before binary length read. As reported here: htt...
0
77,905
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: CloudPolicyCacheBase::CloudPolicyCacheBase() : notifier_(NULL), initialization_complete_(false), is_unmanaged_(false) { public_key_version_.version = 0; public_key_version_.valid = false; } Commit Message: Reset the device policy machinery upon retrying enrollment. BUG=chromium-os:18208 TEST...
0
97,745
Analyze the following 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 ping_proc_register(struct net *net, struct ping_seq_afinfo *afinfo) { struct proc_dir_entry *p; p = proc_create_data(afinfo->name, S_IRUGO, net->proc_net, afinfo->seq_fops, afinfo); if (!p) return -ENOMEM; return 0; } Commit Message: ping: prevent NULL pointer dereference on write to msg_name ...
0
28,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: int FrameLoader::numPendingOrLoadingRequests(bool recurse) const { if (!recurse) return m_frame->document()->fetcher()->requestCount(); int count = 0; for (Frame* frame = m_frame; frame; frame = frame->tree()->traverseNext(m_frame)) count += frame->document()->fetcher()->requestCount(...
0
111,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: bool RenderLayerScrollableArea::usesCompositedScrolling() const { if (box().isIntristicallyScrollable(VerticalScrollbar) || box().isIntristicallyScrollable(HorizontalScrollbar)) return false; DisableCompositingQueryAsserts disabler; return layer()->hasCompositedLayerMapping() && layer()->comp...
0
120,046
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int cifs_ci_hash(const struct dentry *dentry, const struct inode *inode, struct qstr *q) { struct nls_table *codepage = CIFS_SB(dentry->d_sb)->local_nls; unsigned long hash; int i; hash = init_name_hash(); for (i = 0; i < q->len; i++) hash = partial_name_hash(nls_tolower(codepage, q->name[i]), ...
0
21,477
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: UWORD32 ih264d_correct_level_idc(UWORD32 u4_level_idc, UWORD32 u4_total_mbs) { UWORD32 u4_max_mbs_allowed; switch(u4_level_idc) { case H264_LEVEL_1_0: u4_max_mbs_allowed = MAX_MBS_LEVEL_10; break; case H264_LEVEL_1_1: u4_max_mbs_allowed = MAX_MBS_LEVEL_11; break; case H264_LEVE...
0
159,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: void SoftVorbis::initPorts() { OMX_PARAM_PORTDEFINITIONTYPE def; InitOMXParams(&def); def.nPortIndex = 0; def.eDir = OMX_DirInput; def.nBufferCountMin = kNumBuffers; def.nBufferCountActual = def.nBufferCountMin; def.nBufferSize = 8192; def.bEnabled = OMX_TRUE; def.bPopulated = OM...
0
160,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 set_breakpoint(struct arch_hw_breakpoint *brk) { preempt_disable(); __set_breakpoint(brk); preempt_enable(); } Commit Message: powerpc/tm: Check for already reclaimed tasks Currently we can hit a scenario where we'll tm_reclaim() twice. This results in a TM bad thing exception because the second reclai...
0
56,450
Analyze the following 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 calc_group_runnable(struct cfs_rq *cfs_rq, long shares) { long runnable, load_avg; load_avg = max(cfs_rq->avg.load_avg, scale_load_down(cfs_rq->load.weight)); runnable = max(cfs_rq->avg.runnable_load_avg, scale_load_down(cfs_rq->runnable_weight)); runnable *= shares; if (load...
0
92,471
Analyze the following 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 FileUtilProxy::Truncate( scoped_refptr<MessageLoopProxy> message_loop_proxy, PlatformFile file, int64 length, StatusCallback* callback) { return Start(FROM_HERE, message_loop_proxy, new RelayTruncatePlatformFile(file, length, callback)); } Commit Message: Fix a small leak in...
0
97,689
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int target) { struct sched_domain *this_sd; u64 avg_cost, avg_idle; u64 time, cost; s64 delta; int cpu, nr = INT_MAX; this_sd = rcu_dereference(*this_cpu_ptr(&sd_llc)); if (!this_sd) return -1; /* * Due to large variance we n...
0
92,669
Analyze the following 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 cdrom_ioctl_closetray(struct cdrom_device_info *cdi) { cd_dbg(CD_DO_IOCTL, "entering CDROMCLOSETRAY\n"); if (!CDROM_CAN(CDC_CLOSE_TRAY)) return -ENOSYS; return cdi->ops->tray_move(cdi, 0); } Commit Message: cdrom: fix improper type cast, which can leat to information leak. There is another cast...
0
76,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: dump_xml_element(xmlNode * data, int options, char **buffer, int *offset, int *max, int depth) { const char *name = NULL; CRM_ASSERT(max != NULL); CRM_ASSERT(offset != NULL); CRM_ASSERT(buffer != NULL); if (data == NULL) { crm_trace("Nothing to dump"); return; } if (...
0
44,041
Analyze the following 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_mount_req(struct nfs_priv *npriv) { uint32_t data[1024]; uint32_t *p; int len; int pathlen; struct packet *nfs_packet; pathlen = strlen(npriv->path); debug("%s: %s\n", __func__, npriv->path); p = &(data[0]); p = rpc_add_credentials(p); *p++ = hton32(pathlen); if (pathlen & 3) *(p +...
0
1,344
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int main(int argc, char **argv) { int frame_cnt = 0; FILE *outfile = NULL; vpx_codec_ctx_t codec; VpxVideoReader *reader = NULL; const VpxVideoInfo *info = NULL; const VpxInterface *decoder = NULL; exec_name = argv[0]; if (argc != 3) die("Invalid number of arguments."); reader = vpx_video_reader...
1
174,474
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int ep_loop_check(struct eventpoll *ep, struct file *file) { int ret; struct eventpoll *ep_cur, *ep_next; ret = ep_call_nested(&poll_loop_ncalls, EP_MAX_NESTS, ep_loop_check_proc, file, ep, current); /* clear visited list */ list_for_each_entry_safe(ep_cur, ep_next, &visited_list, vis...
0
19,567
Analyze the following 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 everybody_uninteresting(struct commit_list *orig, struct commit **interesting_cache) { struct commit_list *list = orig; if (*interesting_cache) { struct commit *commit = *interesting_cache; if (!(commit->object.flags & UNINTERESTING)) return 0; } while (list) { struct commit *comm...
0
54,987
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int handle_vf_guid(struct net_device *dev, struct ifla_vf_guid *ivt, int guid_type) { if (dev->type != ARPHRD_INFINIBAND) return -EOPNOTSUPP; return handle_infiniband_guid(dev, ivt, guid_type); } Commit Message: net: fix infoleak in rtnetlink The stack object “map” has a total size of 32 bytes. Its ...
0
53,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: static long dm_dax_direct_access(struct dax_device *dax_dev, pgoff_t pgoff, long nr_pages, void **kaddr, pfn_t *pfn) { struct mapped_device *md = dax_get_private(dax_dev); sector_t sector = pgoff * PAGE_SECTORS; struct dm_target *ti; long len, ret = -EIO; int srcu_idx; ti = dm_dax_get_live_target(md, sec...
0
85,878
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xsltExtModuleFunctionLookup(const xmlChar * name, const xmlChar * URI) { xmlXPathFunction ret; if ((xsltFunctionsHash == NULL) || (name == NULL) || (URI == NULL)) return (NULL); xmlMutexLock(xsltExtMutex); XML_CAST_FPTR(ret) = xmlHashLookup2(xsltFunctionsHash, name, URI); xmlMutexU...
0
156,678
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void BrowserView::FocusToolbar() { std::unique_ptr<ImmersiveRevealedLock> focus_reveal_lock( immersive_mode_controller_->GetRevealedLock( ImmersiveModeController::ANIMATE_REVEAL_YES)); toolbar_button_provider_->FocusToolbar(); } Commit Message: Mac: turn popups into new tabs while in fullscr...
0
155,160
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int override_release(char __user *release, int len) { int ret = 0; char buf[65]; if (current->personality & UNAME26) { char *rest = UTS_RELEASE; int ndots = 0; unsigned v; while (*rest) { if (*rest == '.' && ++ndots >= 3) break; if (!isdigit(*rest) && *rest != '.') break...
1
165,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 int mptsas_scsi_device_find(MPTSASState *s, int bus, int target, uint8_t *lun, SCSIDevice **sdev) { if (bus != 0) { return MPI_IOCSTATUS_SCSI_INVALID_BUS; } if (target >= s->max_devices) { return MPI_IOCSTATUS_SCSI_INVALID_TARGETID; } ...
0
8,384
Analyze the following 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 iscsi_release_extra_responses(struct iscsi_param_list *param_list) { struct iscsi_extra_response *er, *er_tmp; list_for_each_entry_safe(er, er_tmp, &param_list->extra_response_list, er_list) { list_del(&er->er_list); kfree(er); } } Commit Message: iscsi-target: fix heap buffer overflow on ...
0
30,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: static int ipgre_open(struct net_device *dev) { struct ip_tunnel *t = netdev_priv(dev); if (ipv4_is_multicast(t->parms.iph.daddr)) { struct flowi fl = { .oif = t->parms.link, .nl_u = { .ip4_u = { .daddr = t->parms.iph.daddr, .saddr = t->parms.iph.saddr, .tos = RT_TOS(t->parms.i...
0
27,493
Analyze the following 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::OnSyntheticGestureCompleted( SyntheticGesture::Result result) { Send(new InputMsg_SyntheticGestureCompleted(GetRoutingID())); } Commit Message: Check that RWHI isn't deleted manually while owned by a scoped_ptr in RVHI BUG=590284 Review URL: https://codereview.chromium.org/1747...
0
131,002
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static inline void add_to_write_order(struct object_entry **wo, unsigned int *endp, struct object_entry *e) { if (e->filled) return; wo[(*endp)++] = e; e->filled = 1; } Commit Message: list-objects: pass full pathname to callbacks When we find a blob at "a/b/c", we currently pass this t...
0
54,830
Analyze the following 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 mem_cgroup_event_ratelimit(struct mem_cgroup *memcg, enum mem_cgroup_events_target target) { unsigned long val, next; val = __this_cpu_read(memcg->stat->events[MEM_CGROUP_EVENTS_COUNT]); next = __this_cpu_read(memcg->stat->targets[target]); /* from time_after() in jiffies.h */ if ((lo...
0
21,057
Analyze the following 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 munlock_vma_pages_range(struct vm_area_struct *vma, unsigned long start, unsigned long end) { vma->vm_flags &= ~VM_LOCKED; while (start < end) { struct page *page = NULL; unsigned int page_mask; unsigned long page_increm; struct pagevec pvec; struct zone *zone; int zoneid; pagevec_i...
0
38,277
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WebKit::WebString TestWebKitPlatformSupport::queryLocalizedString( WebKit::WebLocalizedString::Name name) { switch (name) { case WebKit::WebLocalizedString::ValidationValueMissing: case WebKit::WebLocalizedString::ValidationValueMissingForCheckbox: case WebKit::WebLocalizedString::ValidationValu...
0
108,638
Analyze the following 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 ssize_t lbs_lowrssi_read(struct file *file, char __user *userbuf, size_t count, loff_t *ppos) { return lbs_threshold_read(TLV_TYPE_RSSI_LOW, CMD_SUBSCRIBE_RSSI_LOW, file, userbuf, count, ppos); } Commit Message: libertas: potential oops in debugfs If we do a zero size allocation then it will o...
0
28,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: static void cypress_unthrottle(struct tty_struct *tty) { struct usb_serial_port *port = tty->driver_data; struct cypress_private *priv = usb_get_serial_port_data(port); int actually_throttled, result; spin_lock_irq(&priv->lock); actually_throttled = priv->rx_flags & ACTUALLY_THROTTLED; priv->rx_flags = 0; ...
0
54,249
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: poppler_page_finalize (GObject *object) { PopplerPage *page = POPPLER_PAGE (object); g_object_unref (page->document); page->document = NULL; if (page->annots != NULL) delete page->annots; #if defined (HAVE_CAIRO) if (page->text != NULL) page->text->decRefCnt(); #else if (page->gfx != NULL) ...
0
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: void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask) { if (p->sched_class && p->sched_class->set_cpus_allowed) p->sched_class->set_cpus_allowed(p, new_mask); else { cpumask_copy(&p->cpus_allowed, new_mask); p->rt.nr_cpus_allowed = cpumask_weight(new_mask); } } Commit Message: ...
0
26,279
Analyze the following 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 PaintArtifactCompositor::Update( const PaintArtifact& paint_artifact, CompositorElementIdSet& composited_element_ids) { DCHECK(root_layer_); cc::LayerTreeHost* host = root_layer_->layer_tree_host(); if (!host) return; if (extra_data_for_testing_enabled_) extra_data_for_testing_.rese...
0
125,542
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PersistentMemoryAllocator::Reference PersistentSampleMapRecords::GetNext() { DCHECK(user_); if (records_.size() == seen_) { if (!data_manager_->LoadRecords(this)) return false; } DCHECK_LT(seen_, records_.size()); return records_[seen_++]; } Commit Message: Remove UMA.CreatePersistentHistog...
0
131,118
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: jbig2_image_compose_unopt(Jbig2Ctx *ctx, Jbig2Image *dst, Jbig2Image *src, int x, int y, Jbig2ComposeOp op) { int i, j; int sw = src->width; int sh = src->height; int sx = 0; int sy = 0; /* clip to the dst image boundaries */ if (x < 0) { sx += -x; sw -= -x; ...
1
165,490
Analyze the following 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 DeviceTokenFetcher::Initialize(DeviceManagementService* service, CloudPolicyCacheBase* cache, CloudPolicyDataStore* data_store, PolicyNotifier* notifier, DelayedWork...
0
97,790
Analyze the following 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 CreateMagnetometer() { auto callback = base::Bind(&PlatformSensorFusionTest::MagnetometerCallback, base::Unretained(this)); provider_->CreateSensor(SensorType::MAGNETOMETER, callback); EXPECT_TRUE(magnetometer_callback_called_); EXPECT_TRUE(magnetometer_); ...
0
148,963
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool RenderThreadImpl::IsWebFrameValid(WebKit::WebFrame* web_frame) { if (!web_frame) return false; // We must be shutting down. RenderViewImpl* render_view = RenderViewImpl::FromWebView(web_frame->view()); if (!render_view) return false; // We must be shutting down. return true; } Commit Messa...
0
107,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: static void stringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); TestObjectV8Internal::stringAttrAttributeSetter(jsValue, info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V...
0
121,998
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void __f2fs_replace_block(struct f2fs_sb_info *sbi, struct f2fs_summary *sum, block_t old_blkaddr, block_t new_blkaddr, bool recover_curseg, bool recover_newaddr) { struct sit_info *sit_i = SIT_I(sbi); struct curseg_info *curseg; unsigned int segno, old_cursegno; struct seg_entry *se; int type; unsi...
0
86,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: context_switch(struct rq *rq, struct task_struct *prev, struct task_struct *next, struct pin_cookie cookie) { struct mm_struct *mm, *oldmm; prepare_task_switch(rq, prev, next); mm = next->mm; oldmm = prev->active_mm; /* * For paravirt, this is coupled with an exit in switch_to to * combine the ...
0
55,498
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int setcalrgbspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int CIESubst) { ref rgbdict; int code = 0; float gamma[3], white[3], black[3], matrix[9]; static const float dflt_gamma[3] = { 1.0, 1.0, 1.0 }; static const float dflt_black[3] = {0,0,0}, df...
0
3,134
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ExtensionUninstallDialog* AppLauncherHandler::GetExtensionUninstallDialog() { if (!extension_uninstall_dialog_.get()) { Browser* browser = chrome::FindBrowserWithWebContents( web_ui()->GetWebContents()); extension_uninstall_dialog_.reset( ExtensionUninstallDialog::Create(extension_servic...
0
110,332
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: IntPoint FrameView::convertFromRenderer(const RenderObject& renderer, const IntPoint& rendererPoint) const { IntPoint point = roundedIntPoint(renderer.localToAbsolute(rendererPoint, UseTransforms)); point.moveBy(-scrollPosition()); return point; } Commit Message: Defer call to updateWidgetPositions(...
0
119,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 int sctp_getsockopt_sctp_status(struct sock *sk, int len, char __user *optval, int __user *optlen) { struct sctp_status status; struct sctp_association *asoc = NULL; struct sctp_transport *transport; sctp_assoc_t associd; int retval = 0; if (len < sizeof(status)) { retval = -...
0
33,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: static Image *ReadXCFImage(const ImageInfo *image_info,ExceptionInfo *exception) { char magick[14]; Image *image; int foundPropEnd = 0; MagickBooleanType status; MagickOffsetType offset; register ssize_t i; size_t image_type, length; ssize_t count; XCF...
1
168,329
Analyze the following 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 nf_ingress(struct sk_buff *skb, struct packet_type **pt_prev, int *ret, struct net_device *orig_dev) { #ifdef CONFIG_NETFILTER_INGRESS if (nf_hook_ingress_active(skb)) { int ingress_retval; if (*pt_prev) { *ret = deliver_skb(skb, *pt_prev, orig_dev); *pt_prev = NULL; } r...
0
93,453
Analyze the following 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_status_t AMediaCodec_releaseOutputBuffer(AMediaCodec *mData, size_t idx, bool render) { if (render) { return translate_error(mData->mCodec->renderOutputBufferAndRelease(idx)); } else { return translate_error(mData->mCodec->releaseOutputBuffer(idx)); } } Commit Message: Check for overflow of crypto siz...
0
163,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 GLES2DecoderPassthroughImpl::RestoreDeviceWindowRectangles() const {} Commit Message: Add GL_PROGRAM_COMPLETION_QUERY_CHROMIUM This makes the query of GL_COMPLETION_STATUS_KHR to programs much cheaper by minimizing the round-trip to the GPU thread. Bug: 881152, 957001 Change-Id: Iadfa798af29225e752c710ca5...
0
141,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 int paging64_init_context_common(struct kvm_vcpu *vcpu, struct kvm_mmu *context, int level) { context->nx = is_nx(vcpu); context->root_level = level; reset_rsvds_bits_mask(vcpu, context); update_permission_bitmask(vcpu, context, false); update_last_pte_bitmap(vcpu, context); ASSERT(is_pae...
0
37,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: json_t *json_rpc_call(CURL *curl, const char *url, const char *userpass, const char *rpc_req, bool probe, bool longpoll, int *rolltime, struct pool *pool, bool share) { long timeout = longpoll ? (60 * 60) : 60; struct data_buffer all_data = {NULL, 0}; struct header_info hi = {NULL, 0, N...
0
36,663
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SegmentInfo::SegmentInfo( Segment* pSegment, long long start, long long size_, long long element_start, long long element_size) : m_pSegment(pSegment), m_start(start), m_size(size_), m_element_start(element_start), m_element_size(element_size), m_pMuxingAppAsUTF8(NULL),...
1
174,439
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: FilePath GDataCache::GetCacheRootPath(Profile* profile) { FilePath cache_base_path; chrome::GetUserCacheDirectory(profile->GetPath(), &cache_base_path); FilePath cache_root_path = cache_base_path.Append(chrome::kGDataCacheDirname); return cache_root_path.Append(kGDataCacheVersionDir); } Commit Me...
0
105,929
Analyze the following 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 split_huge_page(struct page *page) { struct anon_vma *anon_vma; int ret = 1; BUG_ON(!PageAnon(page)); anon_vma = page_lock_anon_vma(page); if (!anon_vma) goto out; ret = 0; if (!PageCompound(page)) goto out_unlock; BUG_ON(!PageSwapBacked(page)); __split_huge_page(page, anon_vma); count_vm_even...
0
35,135
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: _kdc_fix_time(time_t **t) { if(*t == NULL){ ALLOC(*t); **t = MAX_TIME; } if(**t == 0) **t = MAX_TIME; /* fix for old clients */ } Commit Message: Security: Avoid NULL structure pointer member dereference This can happen in the error path when processing malformed AS requests with a NULL client nam...
0
59,222
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ctx_pinned_sched_in(struct perf_event_context *ctx, struct perf_cpu_context *cpuctx) { struct perf_event *event; list_for_each_entry(event, &ctx->pinned_groups, group_entry) { if (event->state <= PERF_EVENT_STATE_OFF) continue; if (!event_filter_match(event)) continue; /* may need to reset t...
0
25,991
Analyze the following 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 StartServerOnHandlerThread( base::WeakPtr<DevToolsHttpHandler> handler, std::unique_ptr<base::Thread> thread, std::unique_ptr<DevToolsSocketFactory> socket_factory, const base::FilePath& output_directory, const base::FilePath& debug_frontend_dir, const std::string& browser_guid, b...
0
148,278
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WebKit::WebNotificationPresenter* RenderView::notificationPresenter() { return notification_provider_; } Commit Message: DevTools: move DevToolsAgent/Client into content. BUG=84078 TEST= Review URL: http://codereview.chromium.org/7461019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93596 0039d316-1c4...
0
99,033
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void DataReductionProxyConfigServiceClient::RetrieveRemoteConfig() { DCHECK(thread_checker_.CalledOnValidThread()); CreateClientConfigRequest request; std::string serialized_request; #if defined(OS_ANDROID) request.set_telephony_network_operator( net::android::GetTelephonyNetworkOperator()); #e...
1
172,420
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xdr_cpol_arg(XDR *xdrs, cpol_arg *objp) { if (!xdr_ui_4(xdrs, &objp->api_version)) { return (FALSE); } if (!_xdr_kadm5_policy_ent_rec(xdrs, &objp->rec, objp->api_version)) { return (FALSE); } if (!xdr_long(xdrs, &objp->mask)) { return (FALSE); } return (TRUE); } Commit Message: Fix kadm5/...
0
46,046