instruction
stringclasses
1 value
input
stringlengths
64
129k
output
int64
0
1
__index_level_0__
int64
0
30k
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bt_status_t btif_hh_connect(bt_bdaddr_t *bd_addr) { btif_hh_device_t *dev; btif_hh_added_device_t *added_dev = NULL; char bda_str[20]; int i; BD_ADDR *bda = (BD_ADDR*)bd_addr; CHECK_BTHH_INIT(); dev = btif_hh_find_dev_by_bda(bd_addr); BTIF_TRACE_DEBUG("Connect _hh"); sprintf(bda_str, "%02X...
0
19,633
Analyze the following 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 DocumentThreadableLoader::cancel() { cancelWithError(ResourceError()); } Commit Message: DocumentThreadableLoader: Add guards for sync notifyFinished() in setResource() In loadRequest(), setResource() can call clear() synchronously: DocumentThreadableLoader::clear() DocumentThreadableLoader::handle...
0
11,602
Analyze the following 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 ewk_frame_text_matches_mark(Evas_Object* ewkFrame, const char* string, Eina_Bool caseSensitive, Eina_Bool highlight, unsigned int limit) { EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, smartData, 0); EINA_SAFETY_ON_NULL_RETURN_VAL(smartData->frame, 0); EINA_SAFETY_ON_NULL_RETURN_VAL(string, 0); ...
0
2,660
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void fb_set_suspend(struct fb_info *info, int state) { struct fb_event event; event.info = info; if (state) { fb_notifier_call_chain(FB_EVENT_SUSPEND, &event); info->state = FBINFO_STATE_SUSPENDED; } else { info->state = FBINFO_STATE_RUNNING; fb_notifier_call_chain(FB_EVENT_RESUME, &event); } } Com...
0
4,443
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int perf_event_read(struct perf_event *event, bool group) { int ret = 0; /* * If event is enabled and currently active on a CPU, update the * value in the event structure: */ if (event->state == PERF_EVENT_STATE_ACTIVE) { struct perf_read_data data = { .event = event, .group = group, ....
0
13,183
Analyze the following 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 ip_rt_dump(struct sk_buff *skb, struct netlink_callback *cb) { struct rtable *rt; int h, s_h; int idx, s_idx; struct net *net; net = sock_net(skb->sk); s_h = cb->args[0]; if (s_h < 0) s_h = 0; s_idx = idx = cb->args[1]; for (h = s_h; h <= rt_hash_mask; h++, s_idx = 0) { if (!rt_hash_table[h].c...
0
28,250
Analyze the following 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 V4L2JpegEncodeAccelerator::EncodedInstance::Initialize() { device_ = V4L2Device::Create(); if (!device_) { VLOGF(1) << "Failed to Create V4L2Device"; return false; } output_buffer_pixelformat_ = V4L2_PIX_FMT_JPEG_RAW; if (!device_->Open(V4L2Device::Type::kJpegEncoder, ...
0
28,506
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void netdev_stats_to_stats64(struct rtnl_link_stats64 *stats64, const struct net_device_stats *netdev_stats) { #if BITS_PER_LONG == 64 BUILD_BUG_ON(sizeof(*stats64) < sizeof(*netdev_stats)); memcpy(stats64, netdev_stats, sizeof(*stats64)); /* zero out counters that only exist in rtnl_link_stats64 */ m...
0
6,869
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: AppListSyncableService::FindSyncItem(const std::string& item_id) { SyncItemMap::iterator iter = sync_items_.find(item_id); if (iter == sync_items_.end()) return NULL; return iter->second; } Commit Message: [Extensions] Add GetInstalledExtension() method to ExtensionRegistry This CL adds GetInstalledEx...
0
6,607
Analyze the following 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 pdu_free(V9fsPDU *pdu) { V9fsState *s = pdu->s; g_assert(!pdu->cancelled); QLIST_REMOVE(pdu, next); QLIST_INSERT_HEAD(&s->free_list, pdu, next); } Commit Message: CWE ID: CWE-362
0
20,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: void AssertObjectHasGCInfo(const void* payload, size_t gc_info_index) { HeapObjectHeader::CheckFromPayload(payload); #if !defined(COMPONENT_BUILD) DCHECK_EQ(HeapObjectHeader::FromPayload(payload)->GcInfoIndex(), gc_info_index); #endif } Commit Message: [oilpan] Fix GCInfoTable for multiple thread...
0
29,904
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: _dbus_header_toggle_flag (DBusHeader *header, dbus_uint32_t flag, dbus_bool_t value) { unsigned char *flags_p; flags_p = _dbus_string_get_data_len (&header->data, FLAGS_OFFSET, 1); if (value) *flags_p |= flag; else *flags_p &= ~flag; } Com...
0
16,127
Analyze the following 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 convert_context_handle_invalid_context(struct context *context) { char *s; u32 len; if (selinux_enforcing) return -EINVAL; if (!context_struct_to_string(context, &s, &len)) { printk(KERN_WARNING "SELinux: Context %s would be invalid if enforcing\n", s); kfree(s); } return 0; } Co...
0
22,124
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void Free_LigatureArray( HB_LigatureArray* la, HB_UShort num_classes ) { HB_UShort n, count; HB_LigatureAttach* lat; if ( la->LigatureAttach ) { count = la->LigatureCount; lat = la->LigatureAttach; for ( n = 0; n < count; n++ ) Free_LigatureAttac...
0
10,844
Analyze the following 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 inet_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh) { struct net *net = sock_net(skb->sk); struct in_ifaddr *ifa; struct in_ifaddr *ifa_existing; __u32 valid_lft = INFINITY_LIFE_TIME; __u32 prefered_lft = INFINITY_LIFE_TIME; ASSERT_RTNL(); ifa = rtm_to_ifaddr(net, nlh, &valid_lft, &pre...
0
9,691
Analyze the following 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 av_cold int aac_parse_init(AVCodecParserContext *s1) { AACAC3ParseContext *s = s1->priv_data; s->header_size = AAC_ADTS_HEADER_SIZE; s->sync = aac_sync; return 0; } Commit Message: CWE ID: CWE-125
0
24,749
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: jbig2_decode_generic_template2a(Jbig2Ctx *ctx, Jbig2Segment *segment, const Jbig2GenericRegionParams *params, Jbig2ArithState *as, Jbig2Image *image, Jbig2ArithCx *GB_stats) { const int GBW = image->width; const int GBH = image->height; c...
0
9,916
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: eval_acl(uschar ** sub, int nsub, uschar ** user_msgp) { int i; uschar *tmp; int sav_narg = acl_narg; int ret; extern int acl_where; if(--nsub > sizeof(acl_arg)/sizeof(*acl_arg)) nsub = sizeof(acl_arg)/sizeof(*acl_arg); for (i = 0; i < nsub && sub[i+1]; i++) { tmp = acl_arg[i]; acl_arg[i] = sub[i+1]; /* pl...
0
17,462
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int decode_entropy_coded_image(WebPContext *s, enum ImageRole role, int w, int h) { ImageContext *img; HuffReader *hg; int i, j, ret, x, y, width; img = &s->image[role]; img->role = role; if (!img->frame) { img->frame = av_frame_...
0
10,149
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: struct file *do_filp_open(int dfd, struct filename *pathname, const struct open_flags *op) { struct nameidata nd; int flags = op->lookup_flags; struct file *filp; filp = path_openat(dfd, pathname, &nd, op, flags | LOOKUP_RCU); if (unlikely(filp == ERR_PTR(-ECHILD))) filp = path_openat(dfd, pathname, &nd...
0
19,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: static int parse_options(char *options, struct super_block *sb) { char *p; struct ext2_sb_info *sbi = EXT2_SB(sb); substring_t args[MAX_OPT_ARGS]; int option; kuid_t uid; kgid_t gid; if (!options) return 1; while ((p = strsep (&options, ",")) != NULL) { int token; if (!*p) continue; token = ...
0
15,524
Analyze the following 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 packet_alloc_pending(struct packet_sock *po) { po->rx_ring.pending_refcnt = NULL; po->tx_ring.pending_refcnt = alloc_percpu(unsigned int); if (unlikely(po->tx_ring.pending_refcnt == NULL)) return -ENOBUFS; return 0; } Commit Message: packet: fix race condition in packet_set_ring When packet_s...
0
9,514
Analyze the following 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 decode_and_reconstruct_block_intra (SAMPLE *rec, int stride, int size, int qp, SAMPLE *pblock, int16_t *coeffq, int tb_split, int upright_available,int downleft_available, intra_mode_t intra_mode,int ypos,int xpos,int width,int comp, int bitdepth, ...
0
18,242
Analyze the following 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 yr_object_has_undefined_value( YR_OBJECT* object, const char* field, ...) { YR_OBJECT* field_obj; va_list args; va_start(args, field); if (field != NULL) field_obj = _yr_object_lookup(object, 0, field, args); else field_obj = object; va_end(args); if (field_obj == NULL) ...
0
20,035
Analyze the following 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 IndexedDBDatabase::CreateObjectStore(IndexedDBTransaction* transaction, int64_t object_store_id, const base::string16& name, const IndexedDBKeyPath& key_path, ...
0
4,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: ScopedFrameBufferBinder::ScopedFrameBufferBinder(GLES2DecoderImpl* decoder, GLuint id) : decoder_(decoder) { ScopedGLErrorSuppressor suppressor(decoder_); glBindFramebufferEXT(GL_FRAMEBUFFER, id); } Commit Message: Revert "Revert 100494 - Fix bug in Simula...
0
7,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: static int afiucv_pm_restore_thaw(struct device *dev) { struct sock *sk; #ifdef CONFIG_PM_DEBUG printk(KERN_WARNING "afiucv_pm_restore_thaw\n"); #endif read_lock(&iucv_sk_list.lock); sk_for_each(sk, &iucv_sk_list.head) { switch (sk->sk_state) { case IUCV_CONNECTED: sk->sk_err = EPIPE; sk->sk_state ...
0
26,345
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Response EmulationHandler::SetVisibleSize(int width, int height) { if (width < 0 || height < 0) return Response::InvalidParams("Width and height must be non-negative"); if (GetWebContents()) GetWebContents()->SetDeviceEmulationSize(gfx::Size(width, height)); else return Response::Error("Can't f...
0
2,049
Analyze the following 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 firstarg; config.hostip = sdsnew("127.0.0.1"); config.hostport = 6379; config.hostsocket = NULL; config.repeat = 1; config.interval = 0; config.dbnum = 0; config.interactive = 0; config.shutdown = 0; config.monitor_mode = 0; config...
0
19,056
Analyze the following 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 MediaRecorderHandler::OnEncodedVideo( const media::WebmMuxer::VideoParameters& params, std::unique_ptr<std::string> encoded_data, std::unique_ptr<std::string> encoded_alpha, TimeTicks timestamp, bool is_key_frame) { DCHECK(main_render_thread_checker_.CalledOnValidThread()); if (Updat...
0
2,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: status_t CameraClient::cancelAutoFocus() { LOG1("cancelAutoFocus (pid %d)", getCallingPid()); Mutex::Autolock lock(mLock); status_t result = checkPidAndHardware(); if (result != NO_ERROR) return result; return mHardware->cancelAutoFocus(); } Commit Message: Camera: Disallow dumping clients directly Ca...
0
16,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: size_t iov_iter_copy_from_user_atomic(struct page *page, struct iov_iter *i, unsigned long offset, size_t bytes) { char *kaddr; size_t copied; kaddr = kmap_atomic(page); if (likely(i->nr_segs == 1)) { int left; char __user *buf = i->iov->iov_base + i->iov_offset; left = __copy_from_user_inatomic(kadd...
0
11,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: PrintingContext::Result PrintingContextCairo::PageDone() { if (abort_printing_) return CANCEL; DCHECK(in_print_job_); return OK; } Commit Message: Fix print preview workflow to reflect settings of selected printer. BUG=95110 TEST=none Review URL: http://codereview.chromium.org/7831041 git-svn-id:...
0
25,100
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Element* Document::createElement(const AtomicString& local_name, const StringOrDictionary& string_or_options, ExceptionState& exception_state) { if (!IsValidElementName(this, local_name)) { exception_state.ThrowDOMException( kInvalidC...
0
29,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: static int decode_user_data(Mpeg4DecContext *ctx, GetBitContext *gb) { MpegEncContext *s = &ctx->m; char buf[256]; int i; int e; int ver = 0, build = 0, ver2 = 0, ver3 = 0; char last; for (i = 0; i < 255 && get_bits_count(gb) < gb->size_in_bits; i++) { if (show_bits(gb, 23) ==...
0
12,224
Analyze the following 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 GetPermissionAnchorRect(Browser* browser) { return bubble_anchor_util::GetPageInfoAnchorRect(browser); } Commit Message: Elide the permission bubble title from the head of the string. Long URLs can be used to spoof other origins in the permission bubble title. This CL customises the title to be elid...
0
13,506
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: read_image_data(Gif_Context *gfc, Gif_Reader *grr) { /* we need a bit more than GIF_MAX_BLOCK in case a single code is split across blocks */ uint8_t buffer[GIF_MAX_BLOCK + 5]; int i; uint32_t accum; int bit_position; int bit_length; Gif_Code code; Gif_Code old_code; Gif_Code clear_code; ...
0
5,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: omx_vdec::omx_vdec(): m_error_propogated(false), m_state(OMX_StateInvalid), m_app_data(NULL), m_inp_mem_ptr(NULL), m_out_mem_ptr(NULL), input_flush_progress (false), output_flush_progress (false), input_use_buffer (false), output_use_buffer (false), ouput_egl_buffers(false), ...
1
1,172
Analyze the following 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::OnCSSInsertRequest(const std::wstring& frame_xpath, const std::string& css, const std::string& id) { WebFrame* frame = GetChildFrame(frame_xpath); if (!frame) return; frame->document().insertStyleText(WebString::fr...
0
13,496
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gss_krb5int_extract_authz_data_from_sec_context( OM_uint32 *minor_status, const gss_ctx_id_t context_handle, const gss_OID desired_object, gss_buffer_set_t *data_set) { OM_uint32 major_status; krb5_gss_ctx_id_rec *ctx; int ad_type = 0; size_t i; *data_set = GSS_C_NO_BUFFER_SET...
0
24,686
Analyze the following 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 RenderThread::IsRegisteredExtension( const std::string& v8_extension_name) const { return v8_extensions_.find(v8_extension_name) != v8_extensions_.end(); } Commit Message: DevTools: move DevToolsAgent/Client into content. BUG=84078 TEST= Review URL: http://codereview.chromium.org/7461019 git-svn-id...
0
21,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: std::string GpuChannel::GetChannelName() { return channel_id_; } Commit Message: Convert plugin and GPU process to brokered handle duplication. BUG=119250 Review URL: https://chromiumcodereview.appspot.com/9958034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132303 0039d316-1c4b-4281-b951-d872f2087c98...
0
27,803
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool TextTrack::IsVisualKind() const { return kind() == SubtitlesKeyword() || kind() == CaptionsKeyword(); } Commit Message: Support negative timestamps of TextTrackCue Ensure proper behaviour for negative timestamps of TextTrackCue. 1. Cues with negative startTime should become active from 0s. 2. Cues with n...
0
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: static int old_bridge_ioctl(compat_ulong_t __user *argp) { compat_ulong_t tmp; if (get_user(tmp, argp)) return -EFAULT; if (tmp == BRCTL_GET_VERSION) return BRCTL_VERSION + 1; return -EINVAL; } Commit Message: Fix order of arguments to compat_put_time[spec|val] Commit 644595f89620 ("compat: Handle COMP...
0
8,462
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int proc_pid_auxv(struct task_struct *task, char *buffer) { struct mm_struct *mm = mm_for_maps(task); int res = PTR_ERR(mm); if (mm && !IS_ERR(mm)) { unsigned int nwords = 0; do { nwords += 2; } while (mm->saved_auxv[nwords - 2] != 0); /* AT_NULL */ res = nwords * sizeof(mm->saved_auxv[0]); ...
0
4,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: PassRefPtrWillBeRawPtr<File> readFileHelper() { if (m_version < 3) return nullptr; ASSERT(!m_blobInfo); String path; String name; String relativePath; String uuid; String type; uint32_t hasSnapshot = 0; uint64_t size = 0; ...
0
23,890
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: QuarantineLinuxTest() : source_url_("http://www.source.com"), referrer_url_("http://www.referrer.com"), is_xattr_supported_(false) {} Commit Message: Disable setxattr calls from quarantine subsystem on Chrome OS. BUG=733943 Change-Id: I6e743469a8dc91536e180ecf4ff0df0cf427037c Reviewed-o...
0
6,728
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int x86_setup_perfctr(struct perf_event *event) { struct perf_event_attr *attr = &event->attr; struct hw_perf_event *hwc = &event->hw; u64 config; if (!is_sampling_event(event)) { hwc->sample_period = x86_pmu.max_period; hwc->last_period = hwc->sample_period; local64_set(&hwc->period_left, hwc->...
0
1,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: svc_prepare_thread(struct svc_serv *serv, struct svc_pool *pool, int node) { struct svc_rqst *rqstp; rqstp = svc_rqst_alloc(serv, pool, node); if (!rqstp) return ERR_PTR(-ENOMEM); serv->sv_nrthreads++; spin_lock_bh(&pool->sp_lock); pool->sp_nrthreads++; list_add_rcu(&rqstp->rq_all, &pool->sp_all_thread...
0
26,375
Analyze the following 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 jv_parser_remaining(struct jv_parser* p) { if (p->curr_buf == 0) return 0; return (p->curr_buf_length - p->curr_buf_pos); } Commit Message: Heap buffer overflow in tokenadd() (fix #105) This was an off-by one: the NUL terminator byte was not allocated on resize. This was triggered by JSON-encoded n...
0
21,900
Analyze the following 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 async_removepending(struct async *as) { struct usb_dev_state *ps = as->ps; unsigned long flags; spin_lock_irqsave(&ps->lock, flags); list_del_init(&as->asynclist); spin_unlock_irqrestore(&ps->lock, flags); } Commit Message: USB: usbfs: fix potential infoleak in devio The stack object “ci” has ...
0
8,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 bool vmci_transport_stream_is_active(struct vsock_sock *vsk) { return !vmci_handle_is_invalid(vmci_trans(vsk)->qp_handle); } Commit Message: VSOCK: vmci - fix possible info leak in vmci_transport_dgram_dequeue() In case we received no data on the call to skb_recv_datagram(), i.e. skb->data is NULL, vmci...
0
3,444
Analyze the following 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::SetHaveScrollEventHandlers(bool have_event_handlers) { if (have_scroll_event_handlers_ == have_event_handlers) return; have_scroll_event_handlers_ = have_event_handlers; SetNeedsCommit(); } Commit Message: (Reland) Discard compositor frames from unloaded web content This is a rela...
0
19,019
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void RenderFrameDevToolsAgentHost::UpdateFrameHost( RenderFrameHostImpl* frame_host) { if (frame_host == frame_host_) { if (frame_host && !render_frame_alive_) { render_frame_alive_ = true; for (auto* inspector : protocol::InspectorHandler::ForAgentHost(this)) inspector->TargetReload...
0
7,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: static CParaNdisAbstractPath *GetPathByMessageId(PARANDIS_ADAPTER *pContext, ULONG MessageId) { CParaNdisAbstractPath *path = NULL; UINT bundleId = MessageId / 2; if (bundleId >= pContext->nPathBundles) { path = &pContext->CXPath; } else if (MessageId % 2) { path = &(p...
0
8,387
Analyze the following 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 jpc_poc_getparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *in) { jpc_poc_t *poc = &ms->parms.poc; jpc_pocpchg_t *pchg; int pchgno; uint_fast8_t tmp; poc->numpchgs = (cstate->numcomps > 256) ? (ms->len / 9) : (ms->len / 7); if (!(poc->pchgs = jas_alloc2(poc->numpchgs, sizeof(jpc_pocpchg...
0
25,581
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static byte cdecrypt(byte cipher, unsigned short *cr) { const byte plain = (cipher ^ (*cr >> 8)); *cr = (cipher + *cr) * t1_c1 + t1_c2; return plain; } Commit Message: writet1 protection against buffer overflow git-svn-id: svn://tug.org/texlive/trunk/Build/source@48697 c570f23f-e606-0410-a88d-b1316a...
0
7,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: WebKit::WebMimeRegistry* TestWebKitPlatformSupport::mimeRegistry() { return &mime_registry_; } Commit Message: Use a new scheme for swapping out RenderViews. BUG=118664 TEST=none Review URL: http://codereview.chromium.org/9720004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127986 0039d316-1c4b-4281...
0
25,926
Analyze the following 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 DataReductionProxyConfig::InitializeOnIOThread( scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, WarmupURLFetcher::CreateCustomProxyConfigCallback create_custom_proxy_config_callback, NetworkPropertiesManager* manager, const std::string& user_agent) { DCHECK(thread...
1
16,402
Analyze the following 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 TEE_Result op_attr_value_to_binary(void *attr, void *data, size_t data_len, size_t *offs) { uint32_t *v = attr; return op_u32_to_binary_helper(*v, data, data_len, offs); } Commit Message: svc: check for allocation overflow in crypto calls part 2 Without checking for overflow there is a risk of ...
0
2,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: void WallpaperManagerBase::CacheUsersWallpapers() { DCHECK(thread_checker_.CalledOnValidThread()); user_manager::UserList users = user_manager::UserManager::Get()->GetUsers(); if (!users.empty()) { user_manager::UserList::const_iterator it = users.begin(); it++; for (int cached = 0; it != users...
0
16,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: vmci_transport_recv_connecting_client_invalid(struct sock *sk, struct vmci_transport_packet *pkt) { int err = 0; struct vsock_sock *vsk = vsock_sk(sk); if (vsk->sent_request) { vsk->sent_request = false; vsk->ignore_connecting_rst = true; err = vmci_transport_send_conn_request( sk, vmci_t...
0
3,767
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void LoginDisplayHostDestroyed() { login_display_host_ = nullptr; } Commit Message: cros: Check initial auth type when showing views login. Bug: 859611 Change-Id: I0298db9bbf4aed6bd40600aef2e1c5794e8cd058 Reviewed-on: https://chromium-review.googlesource.com/1123056 Reviewed-by: Xiaoyin Hu <xiaoyinh@chromium....
0
14,159
Analyze the following 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 __always_inline void slab_lock(struct page *page) { bit_spin_lock(PG_locked, &page->flags); } Commit Message: remove div_long_long_rem x86 is the only arch right now, which provides an optimized for div_long_long_rem and it has the downside that one has to be very careful that the divide doesn't overflo...
0
23,794
Analyze the following 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 fuse_request_send_background_locked(struct fuse_conn *fc, struct fuse_req *req) { req->isreply = 1; fuse_request_send_nowait_locked(fc, req); } Commit Message: fuse: check size of FUSE_NOTIFY_INVAL_ENTRY message FUSE_NOTIFY_INVAL_ENTRY didn't check the length of the write so the message processing ...
0
882
Analyze the following 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 sys_debug_setcontext(struct ucontext __user *ctx, int ndbg, struct sig_dbg_op __user *dbg, int r6, int r7, int r8, struct pt_regs *regs) { struct sig_dbg_op op; int i; unsigned char tmp; unsigned long new_msr = regs->msr; #ifdef CONFIG_PPC_ADV_DEBUG_REGS unsigned long new_dbcr0 = current->thr...
0
18,953
Analyze the following 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 InputDispatcher::synthesizeCancelationEventsForAllConnectionsLocked( const CancelationOptions& options) { for (size_t i = 0; i < mConnectionsByFd.size(); i++) { synthesizeCancelationEventsForConnectionLocked( mConnectionsByFd.valueAt(i), options); } } Commit Message: Add new Motio...
0
9,951
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: isoent_cmp_node_iso9660(const struct archive_rb_node *n1, const struct archive_rb_node *n2) { const struct idrent *e1 = (const struct idrent *)n1; const struct idrent *e2 = (const struct idrent *)n2; return (isoent_cmp_iso9660_identifier(e2->isoent, e1->isoent)); } Commit Message: Issue 711: Be more car...
0
29,616
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: viz::LocalSurfaceIdAllocation CompositorImpl::GenerateLocalSurfaceId() const { if (enable_surface_synchronization_) { viz::ParentLocalSurfaceIdAllocator& allocator = CompositorDependencies::Get().surface_id_allocator; allocator.GenerateId(); return allocator.GetCurrentLocalSurfaceIdAllocatio...
0
19,410
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void migrate_tasks(unsigned int dead_cpu) { struct rq *rq = cpu_rq(dead_cpu); struct task_struct *next, *stop = rq->stop; int dest_cpu; /* * Fudge the rq selection such that the below task selection loop * doesn't get stuck on the currently eligible stop task. * * We're currently inside stop_m...
0
18,683
Analyze the following 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 CachedAttributeRaisesExceptionGetterAnyAttributeAttributeSetter( v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) { v8::Isolate* isolate = info.GetIsolate(); ALLOW_UNUSED_LOCAL(isolate); v8::Local<v8::Object> holder = info.Holder(); ALLOW_UNUSED_LOCAL(holder...
0
28,389
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: IPC::Message* AutomationProviderBookmarkModelObserver::ReleaseReply() { return reply_message_.release(); } Commit Message: Remove TabContents from TabStripModelObserver::TabDetachedAt. BUG=107201 TEST=no visible change Review URL: https://chromiumcodereview.appspot.com/11293205 git-svn-id: svn://svn.chromi...
0
15,087
Analyze the following 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_Curve_Read(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, cmsUInt32Number* nItems, cmsUInt32Number SizeOfTag) { cmsUInt32Number Count; cmsToneCurve* NewGamma; *nItems = 0; if (!_cmsReadUInt32Number(io, &Count)) return NULL; switch (Count) { case 0: // Li...
0
8,570
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void DocumentLoader::BlockParser() { parser_blocked_count_++; } 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: 799747 Change-Id: I8413aa8e80494...
0
2,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: DecodeDateTime(char **field, int *ftype, int nf, int *dtype, struct tm * tm, fsec_t *fsec, bool EuroDates) { int fmask = 0, tmask, type; int ptype = 0; /* "prefix type" for ISO y2001m02d04 format */ int i; int val; int mer = HR24; int haveTextMonth = FALSE; int is2digits = FALS...
0
20,183
Analyze the following 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 mem_cgroup_move_task(struct cgroup_subsys *ss, struct cgroup *cont, struct cgroup_taskset *tset) { struct task_struct *p = cgroup_taskset_first(tset); struct mm_struct *mm = get_task_mm(p); if (mm) { if (mc.to) mem_cgroup_move_charge(mm); put_swap_token(mm); mmput(mm); } if (mc....
0
4,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: session_x11_req(Session *s) { int success; if (s->auth_proto != NULL || s->auth_data != NULL) { error("session_x11_req: session %d: " "x11 forwarding already active", s->self); return 0; } s->single_connection = packet_get_char(); s->auth_proto = packet_get_string(NULL); s->auth_data = packet_get...
0
3,038
Analyze the following 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 pack_pkt(git_pkt **out) { git_pkt *pkt; pkt = git__malloc(sizeof(git_pkt)); GITERR_CHECK_ALLOC(pkt); pkt->type = GIT_PKT_PACK; *out = pkt; return 0; } Commit Message: smart_pkt: treat empty packet lines as error The Git protocol does not specify what should happen in the case of an empty pac...
0
16,767
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gboolean try_write_to_ui(gpointer data, gint fd, b_input_condition cond) { struct file_transfer *ft = data; struct prpl_xfer_data *px = ft->data; struct stat fs; off_t tx_bytes; /* If we don't have the file opened yet, there's no data so wait. */ if (px->fd < 0 || !px->ui_wants_data) { return FALSE; } ...
0
1,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: OJPEGReadBlock(OJPEGState* sp, uint16 len, void* mem) { uint16 mlen; uint8* mmem; uint16 n; assert(len>0); mlen=len; mmem=mem; do { if (sp->in_buffer_togo==0) { if (OJPEGReadBufferFill(sp)==0) return(0); assert(sp->in_buffer_togo>0); } n=mlen; if (n>sp->in_buffer_togo) n=sp->in_buff...
0
21,348
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WebViewImpl* WebView() { return web_view_helper_->GetWebView(); } Commit Message: [BGPT] Add a fast-path for transform-origin changes. This patch adds a fast-path for updating composited transform-origin changes without requiring a PaintArtifactCompositor update. This closely follows the approach of https://c...
0
12,804
Analyze the following 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 rx_desc_base(E1000State *s) { uint64_t bah = s->mac_reg[RDBAH]; uint64_t bal = s->mac_reg[RDBAL] & ~0xf; return (bah << 32) + bal; } Commit Message: CWE ID: CWE-119
0
6,096
Analyze the following 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_ucode_info(struct ucode_cpu_info *uci, unsigned int date) { int cpu = smp_processor_id(); pr_info("CPU%d microcode updated early to revision 0x%x, date = %04x-%02x-%02x\n", cpu, uci->cpu_sig.rev, date & 0xffff, date >> 24, (date >> 16) & 0xff); } Commit Message: x86/microcode/intel: Guard agai...
0
1,024
Analyze the following 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 d_rehash(struct dentry * entry) { spin_lock(&entry->d_lock); _d_rehash(entry); spin_unlock(&entry->d_lock); } Commit Message: dcache: Handle escaped paths in prepend_path A rename can result in a dentry that by walking up d_parent will never reach it's mnt_root. For lack of a better term I call this an...
0
17,605
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static char *ask_helper(const char *msg, void *args, bool password) { GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(g_wnd_assistant), GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, "%s", msg); char *ta...
0
15,205
Analyze the following 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 tcp_clean_rtx_queue(struct sock *sk, int prior_fackets, u32 prior_snd_una) { struct tcp_sock *tp = tcp_sk(sk); const struct inet_connection_sock *icsk = inet_csk(sk); struct sk_buff *skb; u32 now = tcp_time_stamp; int fully_acked = 1; int flag = 0; u32 pkts_acked = 0; u32 reord = tp->...
0
8,817
Analyze the following 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 kvp_update_file(int pool) { FILE *filep; size_t bytes_written; /* * We are going to write our in-memory registry out to * disk; acquire the lock first. */ kvp_acquire_lock(pool); filep = fopen(kvp_file_info[pool].fname, "w"); if (!filep) { kvp_release_lock(pool); syslog(LOG_ERR, "Fai...
0
18,119
Analyze the following 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 GotSystemSlotOnUIThread( base::Callback<void(crypto::ScopedPK11Slot)> callback_ui_thread, crypto::ScopedPK11Slot system_slot) { callback_ui_thread.Run(std::move(system_slot)); } Commit Message: Add a fake DriveFS launcher client. Using DriveFS requires building and deploying ChromeOS. Add a clien...
0
7,750
Analyze the following 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_write_udta_sdp(AVIOContext *pb, MOVTrack *track) { AVFormatContext *ctx = track->rtp_ctx; char buf[1000] = ""; int len; ff_sdp_write_media(buf, sizeof(buf), ctx->streams[0], track->src_track, NULL, NULL, 0, 0, ctx); av_strlcatf(buf, sizeof(buf), "a=contro...
0
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: xmlParseConditionalSections(xmlParserCtxtPtr ctxt) { int id = ctxt->input->id; SKIP(3); SKIP_BLANKS; if (CMP7(CUR_PTR, 'I', 'N', 'C', 'L', 'U', 'D', 'E')) { SKIP(7); SKIP_BLANKS; if (RAW != '[') { xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID, NULL); xmlHaltParser(ctxt); return; } ...
0
25,964
Analyze the following 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 __udp4_lib_mcast_deliver(struct net *net, struct sk_buff *skb, struct udphdr *uh, __be32 saddr, __be32 daddr, struct udp_table *udptable) { struct sock *sk, *stack[256 / sizeof(struct sock *)]; struct udp_hslot *hslot = udp_hashslot(udptable, net, ntohs(uh->dest)); int dif; ...
0
12,795
Analyze the following 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::WasShown(const ui::LatencyInfo& latency_info) { if (!is_hidden_) return; TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::WasShown"); is_hidden_ = false; if (new_content_rendering_timeout_ && new_content_rendering_timeout_->IsRunning()) { new_content_renderi...
1
19,779
Analyze the following 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 perf_event_set_bpf_prog(struct perf_event *event, u32 prog_fd) { return -ENOENT; } 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 use-after-free which is BAD. Simply do not fre...
0
14,712
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void nfc_llcp_recv_snl(struct nfc_llcp_local *local, struct sk_buff *skb) { struct nfc_llcp_sock *llcp_sock; u8 dsap, ssap, *tlv, type, length, tid, sap; u16 tlv_len, offset; char *service_name; size_t service_name_len; struct nfc_llcp_sdp_tlv *sdp; HLIST_HEAD(llc_sdres_list); size_t sdres...
0
15,858
Analyze the following 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 CairoImageOutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, Stream *maskStr, int maskWidth, int maskHeight, GBool maskInvert) { cairo_t *cr; cairo_surface_t *surface; double x1, y1, x2, y2; doubl...
0
16,592
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: first_named_child(xmlNode * parent, const char *name) { xmlNode *match = NULL; for (match = __xml_first_child(parent); match != NULL; match = __xml_next(match)) { /* * name == NULL gives first child regardless of name; this is * semantically incorrect in this funciton, but may b...
0
25,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 S_AL_BufferLoad(sfxHandle_t sfx, qboolean cache) { ALenum error; ALuint format; void *data; snd_info_t info; alSfx_t *curSfx = &knownSfx[sfx]; if(curSfx->filename[0] == '\0') return; if(curSfx->filename[0] == '*') return; if((curSfx->inMemory) || (curSfx->isDefault) || (!cache && curSf...
0
17,937
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ptaCreate(l_int32 n) { PTA *pta; PROCNAME("ptaCreate"); if (n <= 0) n = INITIAL_PTR_ARRAYSIZE; pta = (PTA *)LEPT_CALLOC(1, sizeof(PTA)); pta->n = 0; pta->nalloc = n; ptaChangeRefcount(pta, 1); /* sets to 1 */ pta->x = (l_float32 *)LEPT_CALLOC(n, sizeof(l_float32)); p...
0
27,595
Analyze the following 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 cirrus_read_hidden_dac(CirrusVGAState * s) { if (++s->cirrus_hidden_dac_lockindex == 5) { s->cirrus_hidden_dac_lockindex = 0; return s->cirrus_hidden_dac_data; } return 0xff; } Commit Message: CWE ID: CWE-119
0
25,752
Analyze the following 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_ftrace_pid_function(ftrace_func_t func) { /* do not set ftrace_pid_function to itself! */ if (func != ftrace_pid_func) ftrace_pid_function = func; } Commit Message: tracing: Fix possible NULL pointer dereferences Currently set_ftrace_pid and set_graph_function files use seq_lseek for their f...
0
12,343