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 WebContentsImpl::OnDidRunInsecureContent( const std::string& security_origin, const GURL& target_url) { LOG(INFO) << security_origin << " ran insecure content from " << target_url.possibly_invalid_spec(); RecordAction(UserMetricsAction("SSL.RanInsecureContent")); if (EndsWith(security_o...
0
110,722
Analyze the following 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 CornerStart(const LayoutBox& box, int min_x, int max_x, int thickness) { if (box.ShouldPlaceBlockDirectionScrollbarOnLogicalLeft()) return min_x + box.StyleRef().BorderLeftWidth(); return max_x - thickness - box.StyleRef().Bor...
0
130,029
Analyze the following 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 _gdScaleRow(gdImagePtr pSrc, unsigned int src_width, gdImagePtr dst, unsigned int dst_width, unsigned int row, LineContribType *contrib) { int *p_src_row = pSrc->tpixels[row]; int *p_dst_row = dst->tpixels[row]; unsigned int x; for (x = 0; x < dst_width - 1; x++) { register unsigned cha...
0
58,405
Analyze the following 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 visitDOMNodes(DOMWrapperMap<Node>::Visitor* visitor) { v8::HandleScope scope; DOMDataList& list = DOMDataStore::allStores(); for (size_t i = 0; i < list.size(); ++i) { DOMDataStore* store = list[i]; store->domNodeMap().visit(store, visitor); } } Commit Message: [V8] ASSERT ...
0
107,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: static int show_numa_map(struct seq_file *m, void *v) { struct numa_maps_private *numa_priv = m->private; struct proc_maps_private *proc_priv = &numa_priv->proc_maps; struct vm_area_struct *vma = v; struct numa_maps *md = &numa_priv->md; struct file *file = vma->vm_file; struct mm_struct *mm = vma->vm_mm; ...
0
90,501
Analyze the following 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 SoftVorbis::isConfigured() const { return mInputBufferCount >= 2; } Commit Message: DO NOT MERGE codecs: check OMX buffer size before use in (vorbis|opus)dec Bug: 27833616 Change-Id: I1ccdd16a00741da072527a6d13e87fd7c7fe8c54 CWE ID: CWE-20
0
160,624
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Ins_LTEQ( FT_Long* args ) { args[0] = ( args[0] <= args[1] ); } Commit Message: CWE ID: CWE-476
0
10,622
Analyze the following 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 PlatformSensorAmbientLightMac::StopSensor() { light_sensor_port_.reset(); light_sensor_notification_.reset(); light_sensor_busy_notification_.reset(); light_sensor_object_.reset(); light_sensor_service_.reset(); current_lux_ = 0.0; } Commit Message: android: Fix sensors in device service. This ...
0
148,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: GLES2DecoderPassthroughImpl::GLenumToTextureTarget(GLenum target) { switch (target) { case GL_TEXTURE_2D: return TextureTarget::k2D; case GL_TEXTURE_CUBE_MAP: return TextureTarget::kCubeMap; case GL_TEXTURE_2D_ARRAY: return TextureTarget::k2DArray; case GL_TEXTURE_3D: ret...
0
141,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: virtual bool IsSpeaking() { error_ = kNotSupportedError; return false; } Commit Message: Extend TTS extension API to support richer events returned from the engine to the client. Previously we just had a completed event; this adds start, word boundary, sentence boundary, and marker boundary. In add...
0
99,672
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: config_qos( config_tree *ptree ) { attr_val * my_qc; char * s; #ifdef HAVE_IPTOS_SUPPORT unsigned int qtos = 0; #endif my_qc = HEAD_PFIFO(ptree->qos); for (; my_qc != NULL; my_qc = my_qc->link) { s = my_qc->value.s; #ifdef HAVE_IPTOS_SUPPORT if (!strcmp(s, "lowdelay")) qtos = CONF_QOS_LOWDELAY; ...
0
74,140
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static ssize_t aio_setup_vectored_rw(int type, struct kiocb *kiocb, bool compat) { ssize_t ret; #ifdef CONFIG_COMPAT if (compat) ret = compat_rw_copy_check_uvector(type, (struct compat_iovec __user *)kiocb->ki_buf, kiocb->ki_nbytes, 1, &kiocb->ki_inline_vec, &kiocb->ki_iovec, 1); else #endif r...
1
167,613
Analyze the following 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 nsv_parse_NSVf_header(AVFormatContext *s) { NSVContext *nsv = s->priv_data; AVIOContext *pb = s->pb; unsigned int av_unused file_size; unsigned int size; int64_t duration; int strings_size; int table_entries; int table_entries_used; nsv->state = NSV_UNSYNC; /* in ca...
0
66,016
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: XcursorImage* SkBitmapToXcursorImage(const SkBitmap* cursor_image, const gfx::Point& hotspot) { DCHECK(cursor_image->config() == SkBitmap::kARGB_8888_Config); gfx::Point hotspot_point = hotspot; SkBitmap scaled; const float kMaxPixel = 64.f; bool needs_scale = false...
0
119,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: static int output_open(h2_stream *stream) { switch (stream->state) { case H2_STREAM_ST_OPEN: case H2_STREAM_ST_CLOSED_INPUT: return 1; default: return 0; } } Commit Message: SECURITY: CVE-2016-8740 mod_http2: properly crafted, endless HTTP/2 CONTINUATION ...
0
48,722
Analyze the following 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 tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb, void *frame, struct net_device *dev, void *data, int tp_len, __be16 proto, unsigned char *addr, int hlen, int copylen, const struct sockcm_cookie *sockc) { union tpacket_uhdr ph; int to_write, offset, len, nr_frags, len_max; struct ...
0
60,431
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void PrintWebViewHelper::OnInitiatePrintPreview() { DCHECK(is_preview_); WebFrame* frame; if (GetPrintFrame(&frame)) { print_preview_context_.InitWithFrame(frame); RequestPrintPreview(); } } Commit Message: Fix print preview workflow to reflect settings of selected printer. BUG=95110 TEST=none ...
0
97,526
Analyze the following 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 SSLManager::DidCommitProvisionalLoad( const content::NotificationDetails& in_details) { content::LoadCommittedDetails* details = content::Details<content::LoadCommittedDetails>(in_details).ptr(); NavigationEntryImpl* entry = NavigationEntryImpl::FromNavigationEntry(controller_->GetActive...
0
107,947
Analyze the following 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 Cluster* BlockEntry::GetCluster() const { return m_pCluster; } Commit Message: external/libvpx/libwebm: Update snapshot Update libwebm snapshot. This update contains security fixes from upstream. Upstream git hash: 229f49347d19b0ca0941e072b199a242ef6c5f2b BUG=23167726 Change-Id: Id3e140e7b31ae11294724...
0
160,738
Analyze the following 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 WebLocalFrameImpl::ExtractSmartClipData(WebRect rect_in_viewport, WebString& clip_text, WebString& clip_html, WebRect& clip_rect) { SmartClipData clip_data = SmartClip(GetF...
0
145,727
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void BrowserPpapiHostImpl::HostMessageFilter::OnHostMsgLogInterfaceUsage( int hash) const { UMA_HISTOGRAM_SPARSE_SLOWLY("Pepper.InterfaceUsed", hash); } Commit Message: Validate in-process plugin instance messages. Bug: 733548, 733549 Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolatio...
0
135,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: void TestClearSectionWithNodeContainingSelectOne(const char* html, bool unowned) { LoadHTML(html); WebLocalFrame* web_frame = GetMainFrame(); ASSERT_NE(nullptr, web_frame); FormCache form_cache(web_frame); std::vector<FormData> forms = form...
0
151,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: void queue_dir(char *pathname, struct dir *dir) { struct squashfs_file *file = malloc(sizeof(struct squashfs_file)); if(file == NULL) EXIT_UNSQUASH("queue_dir: unable to malloc file\n"); file->fd = -1; file->mode = dir->mode; file->gid = dir->guid; file->uid = dir->uid; file->time = dir->mtime; file->p...
0
74,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: static void cmd_syncrestore(const char *tag, struct dlist *kin, struct sync_reserve_list *reserve_list) { struct sync_state sync_state = { imapd_userid, imapd_userisadmin || imapd_userisproxyadmin, imapd_authstate, &imapd_namespace, imapd_out...
0
95,175
Analyze the following 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 btrfs_get_block_group_info(struct list_head *groups_list, struct btrfs_ioctl_space_info *space) { struct btrfs_block_group_cache *block_group; space->total_bytes = 0; space->used_bytes = 0; space->flags = 0; list_for_each_entry(block_group, groups_list, list) { space->flags = block_group->flags; ...
0
34,397
Analyze the following 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 UrlmonUrlRequestManager::OnResponseStarted(int request_id, const char* mime_type, const char* headers, int size, base::Time last_modified, const std::string& redirect_url, int redirect_status, const net::HostPortPair& socket_address) { DCHECK_NE(request_id, -1); DVLOG(1) << __FUNCTION__; DC...
0
100,961
Analyze the following 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 Unpack<WebGLImageConversion::kDataFormatARGB8, uint8_t, uint8_t>( const uint8_t* source, uint8_t* destination, unsigned pixels_per_row) { for (unsigned i = 0; i < pixels_per_row; ++i) { destination[0] = source[1]; destination[1] = source[2]; destination[2] = source[3]; destinati...
0
146,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: void WebContentsImpl::NotifyNavigationListPruned( const PrunedDetails& pruned_details) { for (auto& observer : observers_) observer.NavigationListPruned(pruned_details); } Commit Message: If a page shows a popup, end fullscreen. This was implemented in Blink r159834, but it is susceptible to a popup/f...
0
150,898
Analyze the following 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 *_xmlwriter_get_valid_file_path(char *source, char *resolved_path, int resolved_path_len TSRMLS_DC) { xmlURI *uri; xmlChar *escsource; char *file_dest; int isFileUri = 0; uri = xmlCreateURI(); escsource = xmlURIEscapeStr((xmlChar *)source, (xmlChar *) ":"); xmlParseURIReference(uri, (char *)e...
0
15,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: PHPAPI php_stream *_php_stream_temp_create(int mode, size_t max_memory_usage STREAMS_DC TSRMLS_DC) { php_stream_temp_data *self; php_stream *stream; self = ecalloc(1, sizeof(*self)); self->smax = max_memory_usage; self->mode = mode; self->meta = NULL; stream = php_stream_alloc_rel(&php_stream_temp_ops, se...
0
17,931
Analyze the following 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 sched_cfs_bandwidth_slice(void) { return (u64)sysctl_sched_cfs_bandwidth_slice * NSEC_PER_USEC; } Commit Message: sched/fair: Fix infinite loop in update_blocked_averages() by reverting a9e7f6544b9c Zhipeng Xie, Xie XiuQi and Sargun Dhillon reported lockups in the scheduler under high loads, ...
0
92,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: void ZLIB_INTERNAL inflate_fast(strm, start) z_streamp strm; unsigned start; /* inflate()'s starting value for strm->avail_out */ { struct inflate_state FAR *state; z_const unsigned char FAR *in; /* local strm->next_in */ z_const unsigned char FAR *last; /* have enough input while in <...
1
168,674
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GLES2DecoderWithShaderTest() : GLES2DecoderWithShaderTestBase() { } Commit Message: Revert "Revert 100494 - Fix bug in SimulateAttrib0.""" TEST=none BUG=95625 TBR=apatrick@chromium.org Review URL: http://codereview.chromium.org/7796016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100507 003...
0
99,351
Analyze the following 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 check_content(CMS_ContentInfo *cms) { ASN1_OCTET_STRING **pos = CMS_get0_content(cms); if (!pos || !*pos) { CMSerr(CMS_F_CHECK_CONTENT, CMS_R_NO_CONTENT); return 0; } return 1; } Commit Message: Canonicalise input in CMS_verify. If content is detached and not binary mode translate the in...
0
44,191
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void LogVideoCaptureEvent(VideoCaptureEvent event) { UMA_HISTOGRAM_ENUMERATION("Media.VideoCaptureManager.Event", event, NUM_VIDEO_CAPTURE_EVENT); } Commit Message: Make MediaStreamDispatcherHost per-request instead of per-frame. Instead of having RenderFrameHost own a single MSDH ...
0
153,240
Analyze the following 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 inet6_dev *ipv6_add_dev(struct net_device *dev) { struct inet6_dev *ndev; int err = -ENOMEM; ASSERT_RTNL(); if (dev->mtu < IPV6_MIN_MTU) return ERR_PTR(-EINVAL); ndev = kzalloc(sizeof(struct inet6_dev), GFP_KERNEL); if (ndev == NULL) return ERR_PTR(err); rwlock_init(&ndev->lock); nde...
0
41,859
Analyze the following 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 scsi_disk_emulate_mode_sense(SCSIDiskReq *r, uint8_t *outbuf) { SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev); uint64_t nb_sectors; int page, dbd, buflen, ret, page_control; uint8_t *p; uint8_t dev_specific_param; dbd = r->req.cmd.buf[1] & 0x8; page = r->re...
0
41,255
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: std::unique_ptr<base::SharedMemory> GetShmFromMojoHandle( mojo::ScopedSharedBufferHandle handle) { base::SharedMemoryHandle memory_handle; size_t memory_size = 0; bool read_only_flag = false; const MojoResult result = mojo::UnwrapSharedMemoryHandle( std::move(handle), &memory_handle, &memo...
1
172,859
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: RendererResourceDelegate() : ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { } Commit Message: Disable tcmalloc profile files. BUG=154983 TBR=darin@chromium.org NOTRY=true Review URL: https://chromiumcodereview.appspot.com/11087041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161048 003...
0
102,145
Analyze the following 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 AddPrepopulatedPages(MostVisitedURLList* urls) { return top_sites()->AddPrepopulatedPages(urls, 0u); } Commit Message: TopSites: Clear thumbnails from the cache when their URLs get removed We already cleared the thumbnails from persistent storage, but they remained in the in-memory cache, so they r...
0
147,103
Analyze the following 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 default_lockmgr_cb(void **arg, enum AVLockOp op) { void * volatile * mutex = arg; int err; switch (op) { case AV_LOCK_CREATE: return 0; case AV_LOCK_OBTAIN: if (!*mutex) { pthread_mutex_t *tmp = av_malloc(sizeof(pthread_mutex_t)); if (!tmp) ...
0
67,012
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gethttp (const struct url *u, struct url *original_url, struct http_stat *hs, int *dt, struct url *proxy, struct iri *iri, int count) { struct request *req = NULL; char *type = NULL; char *user, *passwd; char *proxyauth; int statcode; int write_error; wgint contlen, contrange; const stru...
0
15,481
Analyze the following 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 releaseintf(struct usb_dev_state *ps, unsigned int ifnum) { struct usb_device *dev; struct usb_interface *intf; int err; err = -EINVAL; if (ifnum >= 8*sizeof(ps->ifclaimed)) return err; dev = ps->dev; intf = usb_ifnum_to_if(dev, ifnum); if (!intf) err = -ENOENT; else if (test_and_clear_bi...
0
53,247
Analyze the following 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 __usbnet_status_stop_force(struct usbnet *dev) { if (dev->interrupt) { mutex_lock(&dev->interrupt_mutex); usb_kill_urb(dev->interrupt); dev_dbg(&dev->udev->dev, "killed interrupt URB for suspend\n"); mutex_unlock(&dev->interrupt_mutex); } } Commit Message: usbnet: cleanup after bind() in pr...
0
94,877
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void OxideQQuickWebViewPrivate::URLChanged() { Q_Q(OxideQQuickWebView); emit q->urlChanged(); } Commit Message: CWE ID: CWE-20
0
17,060
Analyze the following 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 ip4ip6_gro_complete(struct sk_buff *skb, int nhoff) { skb->encapsulation = 1; skb_shinfo(skb)->gso_type |= SKB_GSO_IPXIP6; return inet_gro_complete(skb, nhoff); } Commit Message: ipv6: Prevent overrun when parsing v6 header options The KASAN warning repoted below was discovered with a syzkaller pr...
0
65,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: raptor_rss_uplift_items(raptor_parser* rdf_parser) { raptor_rss_parser* rss_parser = (raptor_rss_parser*)rdf_parser->context; int i; raptor_rss_item* item; for(i = 0; i< RAPTOR_RSS_COMMON_SIZE; i++) { for(item = rss_parser->model.common[i]; item; item = item->next) { raptor_rss_uplift_fields(...
0
22,052
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: pkcs7_decrypt(krb5_context context, pkinit_identity_crypto_context id_cryptoctx, PKCS7 *p7, BIO *data) { BIO *tmpmem = NULL; int retval = 0, i = 0; char buf[4096]; if(p7 == NULL) return 0; if(!PKCS7_type_is_enveloped(p7)) { pkiDebug("...
0
33,646
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Editor::Editor(LocalFrame& frame) : m_frame(&frame), m_undoStack(UndoStack::create()), m_preventRevealSelection(0), m_shouldStartNewKillRingSequence(false), m_shouldStyleWithCSS(false), m_killRing(WTF::wrapUnique(new KillRing)), m_areMarkedTextMatchesHighlighted(false), ...
0
129,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: WORD32 ih264d_end_of_pic(dec_struct_t *ps_dec, UWORD8 u1_is_idr_slice, UWORD16 u2_frame_num) { dec_slice_params_t *ps_cur_slice = ps_dec->ps_cur_slice; WORD32 ret; ps_dec->u1_first_pb_nal_in_pic = 1; ps_dec->u2_mbx = 0xffff; ps_dec->u2_mby = 0; { d...
0
159,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 uint64_t get_free_space_available(const char *path) { struct statvfs stat; if (statvfs(path, &stat) != 0) { syslog(LOG_WARNING, "file-xfer: failed to get free space, statvfs error: %s", strerror(errno)); return G_MAXUINT64; } return stat.f_bsize * stat.f_bavai...
0
17,302
Analyze the following 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 kvm *kvm_create_vm(unsigned long type) { int r, i; struct kvm *kvm = kvm_arch_alloc_vm(); if (!kvm) return ERR_PTR(-ENOMEM); spin_lock_init(&kvm->mmu_lock); atomic_inc(&current->mm->mm_count); kvm->mm = current->mm; kvm_eventfd_init(kvm); mutex_init(&kvm->lock); mutex_init(&kvm->irq_loc...
0
71,197
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void port_outl(const struct si_sm_io *io, unsigned int offset, unsigned char b) { unsigned int addr = io->addr_data; outl(b << io->regshift, addr+(offset * io->regspacing)); } Commit Message: ipmi_si: fix use-after-free of resource->name When we excute the following commands, we got oops rmmod...
0
90,283
Analyze the following 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 time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */ { /* This is how the time string is formatted: snprintf(p, sizeof(p), "%02d%02d%02d%02d%02d%02dZ",ts->tm_year%100, ts->tm_mon+1,ts->tm_mday,ts->tm_hour,ts->tm_min,ts->tm_sec); */ time_t ret; struct tm thetime; char * strb...
0
14,230
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: enum act_return http_action_reject(struct act_rule *rule, struct proxy *px, struct session *sess, struct stream *s, int flags) { channel_abort(&s->req); channel_abort(&s->res); s->req.analysers = 0; s->res.analysers = 0; HA_ATOMIC_ADD(&s->be->be_counters.denied_req, 1); H...
0
6,808
Analyze the following 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 GraphicsContext::strokeRect(const FloatRect& rect, float lineWidth) { if (paintingDisabled()) return; if (!isRectSkiaSafe(getCTM(), rect)) return; SkPaint paint; platformContext()->setupPaintForStroking(&paint, 0, 0); paint.setStrokeWidth(WebCoreFloatToSkScalar(lineWidth...
0
107,614
Analyze the following 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 V8TestObject::ActivityLoggingAccessPerWorldBindingsLongAttributeAttributeGetterCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) { RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_activityLoggingAccessPerWorldBindingsLongAttribute_Getter"); ScriptStat...
0
134,481
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void WebContentsImpl::RenderWidgetWasResized( RenderWidgetHostImpl* render_widget_host, const ScreenInfo& screen_info, bool width_changed) { RenderFrameHostImpl* rfh = GetMainFrame(); if (!rfh || render_widget_host != rfh->GetRenderWidgetHost()) return; SendPageMessage(new PageMsg_UpdateScr...
0
145,027
Analyze the following 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 mk_request_premature_close(int http_status, struct client_session *cs) { struct session_request *sr; struct mk_list *sr_list = &cs->request_list; struct mk_list *host_list = &config->hosts; /* * If the connection is too premature, we need to allocate a temporal session_request ...
0
36,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 void VoidMethodStringFrozenArrayMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { ExceptionState exception_state(info.GetIsolate(), ExceptionState::kExecutionContext, "TestObject", "voidMethodStringFrozenArrayMethod"); TestObject* impl = V8TestObject::ToImpl(info.Holder()); if (UNLIKE...
0
135,481
Analyze the following 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 ext4_acquire_dquot(struct dquot *dquot) { int ret, err; handle_t *handle; handle = ext4_journal_start(dquot_to_inode(dquot), EXT4_HT_QUOTA, EXT4_QUOTA_INIT_BLOCKS(dquot->dq_sb)); if (IS_ERR(handle)) return PTR_ERR(handle); ret = dquot_acquire(dquot); err = ext4_journal_stop(handle); i...
0
56,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: sfnt_stream_close( FT_Stream stream ) { FT_Memory memory = stream->memory; FT_FREE( stream->base ); stream->size = 0; stream->base = NULL; stream->close = NULL; } Commit Message: CWE ID: CWE-787
0
7,527
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: png_push_crc_skip(png_structp png_ptr, png_uint_32 skip) { png_ptr->process_mode = PNG_SKIP_MODE; png_ptr->skip_length = skip; } Commit Message: third_party/libpng: update to 1.2.54 TBR=darin@chromium.org BUG=560291 Review URL: https://codereview.chromium.org/1467263003 Cr-Commit-Position: refs/heads/ma...
0
131,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: MiniMoveAnimation(TabStripGtk* tabstrip, int from_index, int to_index, const gfx::Rect& start_bounds) : TabAnimation(tabstrip, MINI_MOVE), tab_(tabstrip->GetTabAt(to_index)), start_bounds_(start_bounds), from_index_(from_i...
0
118,131
Analyze the following 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 reflectTestInterfaceAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); TestObjectPythonV8Internal::reflectTestInterfaceAttributeAttributeGetter(info); TRACE_EVENT_SET_SAMPLING_STAT...
0
122,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 RenderWidgetHostViewGuest::SetIsLoading(bool is_loading) { NOTIMPLEMENTED(); } Commit Message: Implement TextureImageTransportSurface using texture mailbox This has a couple of advantages: - allow tearing down and recreating the UI parent context without losing the renderer contexts - do not require a co...
0
115,051
Analyze the following 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 comedi_close(struct inode *inode, struct file *file) { const unsigned minor = iminor(inode); struct comedi_device_file_info *dev_file_info = comedi_get_device_file_info(minor); struct comedi_device *dev = dev_file_info->device; struct comedi_subdevice *s = NULL; int i; mutex_lock(&dev->mute...
0
41,274
Analyze the following 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 proxy_preadv(FsContext *ctx, V9fsFidOpenState *fs, const struct iovec *iov, int iovcnt, off_t offset) { ssize_t ret; #ifdef CONFIG_PREADV ret = preadv(fs->fd, iov, iovcnt, offset); #else ret = lseek(fs->fd, offset, SEEK_SET); i...
0
7,643
Analyze the following 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 cmd_getacl(const char *tag, const char *name) { int r, access; char *acl; char *rights, *nextid; char *freeme = NULL; mbentry_t *mbentry = NULL; char *intname = mboxname_from_external(name, &imapd_namespace, imapd_userid); r = mlookup(tag, name, intname, &mbentry); if...
0
95,144
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void GDataFileSystem::OnFilePathUpdated(const FileOperationCallback& callback, GDataFileError error, const FilePath& /* file_path */) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (!callback.is_null()) callback.R...
0
116,985
Analyze the following 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 emulator_io_permited(struct x86_emulate_ctxt *ctxt, u16 port, u16 len) { if (ctxt->perm_ok) return true; if (emulator_bad_iopl(ctxt)) if (!emulator_io_port_access_allowed(ctxt, port, len)) return false; ctxt->perm_ok = true; return true; } Commit Message: KVM: x86: fix missing chec...
0
21,814
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: check_type(mrb_state *mrb, mrb_value val, enum mrb_vtype t, const char *c, const char *m) { mrb_value tmp; tmp = mrb_check_convert_type(mrb, val, t, c, m); if (mrb_nil_p(tmp)) { mrb_raisef(mrb, E_TYPE_ERROR, "expected %S", mrb_str_new_cstr(mrb, c)); } return tmp; } Commit Message: `mrb_class_real(...
0
82,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 int may_delete(struct inode *dir, struct dentry *victim, bool isdir) { struct inode *inode = victim->d_inode; int error; if (d_is_negative(victim)) return -ENOENT; BUG_ON(!inode); BUG_ON(victim->d_parent->d_inode != dir); audit_inode_child(dir, victim, AUDIT_TYPE_CHILD_DELETE); error = inode_pe...
0
36,347
Analyze the following 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 ssl2_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p) { long l; if (p != NULL) { l = c->id; if ((l & 0xff000000) != 0x02000000 && l != SSL3_CK_FALLBACK_SCSV) return (0); p[0] = ((unsigned char)(l >> 16L)) & 0xFF; p[1] = ((unsigned char)(l >> 8L)) &...
0
6,114
Analyze the following 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 RenderThreadImpl::ProcessPurgeAndSuspend() { if (!RendererIsHidden()) return; if (!base::FeatureList::IsEnabled(features::kPurgeAndSuspend)) return; base::MemoryCoordinatorClientRegistry::GetInstance()->PurgeMemory(); needs_to_record_first_active_paint_ = true; RendererMemoryMetrics memo...
0
150,569
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: nvmet_fc_format_rjt(void *buf, u16 buflen, u8 ls_cmd, u8 reason, u8 explanation, u8 vendor) { struct fcnvme_ls_rjt *rjt = buf; nvmet_fc_format_rsp_hdr(buf, FCNVME_LSDESC_RQST, fcnvme_lsdesc_len(sizeof(struct fcnvme_ls_rjt)), ls_cmd); rjt->rjt.desc_tag = cpu_to_be32(FCNVME_LSDESC_RJT); rjt->rjt.desc_...
0
93,606
Analyze the following 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 h264bsdComputeSliceGroupMap(storage_t *pStorage, u32 sliceGroupChangeCycle) { /* Variables */ /* Code */ h264bsdDecodeSliceGroupMap(pStorage->sliceGroupMap, pStorage->activePps, sliceGroupChangeCycle, pStorage->activeSps->picWidthInMbs, ...
0
160,452
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: populate_recordset_scalar(void *state, char *token, JsonTokenType tokentype) { PopulateRecordsetState *_state = (PopulateRecordsetState *) state; if (_state->lex->lex_level == 0) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("cannot call %s on a scalar", _state->function_nam...
0
2,646
Analyze the following 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 kvm_destroy_dirty_bitmap(struct kvm_memory_slot *memslot) { if (!memslot->dirty_bitmap) return; kvfree(memslot->dirty_bitmap); memslot->dirty_bitmap = NULL; } Commit Message: KVM: use after free in kvm_ioctl_create_device() We should move the ops->destroy(dev) after the list_del(&dev->vm_node)...
0
71,202
Analyze the following 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 voidMethodBooleanArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); TestObjectPythonV8Internal::voidMethodBooleanArgMethod(info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); } Commit Message: document.locatio...
0
122,797
Analyze the following 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 setJSTestObjSequenceAttr(ExecState* exec, JSObject* thisObject, JSValue value) { JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); TestObj* impl = static_cast<TestObj*>(castedThis->impl()); impl->setSequenceAttr(toNativeArray<ScriptProfile>(exec, value)); } Commit Message: [JSC] Implement ...
0
101,350
Analyze the following 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_callback_up_net(int minorversion, struct svc_serv *serv, struct net *net, struct rpc_xprt *xprt) { struct nfs_net *nn = net_generic(net, nfs_net_id); int ret; if (nn->cb_users[minorversion]++) return 0; dprintk("NFS: create per-net callback data; net=%p\n", net); ret = svc_bind(...
0
65,248
Analyze the following 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 stream_int_shutw(struct stream_interface *si) { si->ob->flags &= ~CF_SHUTW_NOW; if (si->ob->flags & CF_SHUTW) return; si->ob->flags |= CF_SHUTW; si->ob->wex = TICK_ETERNITY; si->flags &= ~SI_FL_WAIT_DATA; switch (si->state) { case SI_ST_EST: /* we have to shut before closing, otherwise som...
0
9,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: pim_print(netdissect_options *ndo, register const u_char *bp, register u_int len, const u_char *bp2) { register const u_char *ep; register const struct pim *pim = (const struct pim *)bp; ep = (const u_char *)ndo->ndo_snapend; if (bp >= ep) return; #ifdef notyet /* currently we see only ve...
1
167,854
Analyze the following 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_AddRealLoopingSound(int entityNum, const vec3_t origin, const vec3_t velocity, const int range, sfxHandle_t sfx) { S_AL_SrcLoop(SRCPRI_AMBIENT, sfx, origin, velocity, entityNum, 255); } Commit Message: All: Don't open .pk3 files as OpenAL drivers CWE ID: CWE-269
0
95,627
Analyze the following 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 in_release_pcm_devices(struct stream_in *in) { struct pcm_device *pcm_device; struct listnode *node; struct listnode *next; list_for_each_safe(node, next, &in->pcm_dev_list) { pcm_device = node_to_item(node, struct pcm_device, stream_list_node); list_remove(node); free(p...
0
162,292
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: CSSStyleDeclaration* Document::getOverrideStyle(Element*, const String&) { return 0; } Commit Message: Refactoring: Move m_mayDisplaySeamlesslyWithParent down to Document The member is used only in Document, thus no reason to stay in SecurityContext. TEST=none BUG=none R=haraken@chromium.org, abarth, harak...
0
102,739
Analyze the following 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 iowarrior_write_callback(struct urb *urb) { struct iowarrior *dev; int status = urb->status; dev = urb->context; /* sync/async unlink faults aren't errors */ if (status && !(status == -ENOENT || status == -ECONNRESET || status == -ESHUTDOWN)) { dev_dbg(&dev->interface->dev, "non...
0
55,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: bool CheckClientDownloadRequest::ShouldUploadBinary( DownloadCheckResultReason reason) { bool upload_for_dlp = ShouldUploadForDlpScan(); bool upload_for_malware = ShouldUploadForMalwareScan(reason); if (!upload_for_dlp && !upload_for_malware) return false; return !!Profile::FromBrowserContext(Get...
0
136,709
Analyze the following 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 PushSequence(input_translation_t *table, uint16_t Type, uint32_t *offset, void *stack) { uint32_t i = table->number_of_sequences; uint32_t index = cache.lookup_info[Type].index; if ( !CheckSequenceMap(table) ) return; table->sequence[i].skip_count = 0; table->sequence[i].type = Type; if ( cach...
0
88,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 void __always_inline vmx_set_intercept_for_msr(unsigned long *msr_bitmap, u32 msr, int type, bool value) { if (value) vmx_enable_intercept_for_msr(msr_bitmap, msr, type); else vmx_disable_intercept_for_msr(msr_bitmap, msr, type); } Commit Message: kvm: nVMX: Enforce cpl=0 for VMX in...
0
81,072
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: hook_exec_end () { if (hook_exec_recursion > 0) hook_exec_recursion--; if (hook_exec_recursion == 0) hook_remove_deleted (); } Commit Message: CWE ID: CWE-20
0
7,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: IrcViewMimeData(const QTextDocumentFragment& _fragment): fragment(_fragment) {} Commit Message: CWE ID:
0
1,731
Analyze the following 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 cxusb_mygica_d689_tuner_attach(struct dvb_usb_adapter *adap) { struct dvb_frontend *fe; fe = dvb_attach(max2165_attach, adap->fe_adap[0].fe, &adap->dev->i2c_adap, &mygica_d689_max2165_cfg); return (fe == NULL) ? -EIO : 0; } Commit Message: [media] cxusb: Use a dma capable buffer also for reading...
0
66,742
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static const struct k_clock *clockid_to_kclock(const clockid_t id) { clockid_t idx = id; if (id < 0) { return (id & CLOCKFD_MASK) == CLOCKFD ? &clock_posix_dynamic : &clock_posix_cpu; } if (id >= ARRAY_SIZE(posix_clocks)) return NULL; return posix_clocks[array_index_nospec(idx, ARRAY_SIZE(posix_clo...
0
81,157
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: cdf_tole4(uint32_t sv) { return CDF_TOLE4(sv); } Commit Message: Fix bounds checks again. CWE ID: CWE-119
0
20,946
Analyze the following 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 check_ta_store(void) { const struct user_ta_store_ops *op = NULL; SCATTERED_ARRAY_FOREACH(op, ta_stores, struct user_ta_store_ops) DMSG("TA store: \"%s\"", op->description); return TEE_SUCCESS; } Commit Message: core: clear the entire TA area Previously we cleared (memset to zero) the s...
0
86,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: Cues::~Cues() { const long n = m_count + m_preload_count; CuePoint** p = m_cue_points; CuePoint** const q = p + n; while (p != q) { CuePoint* const pCP = *p++; assert(pCP); delete pCP; } delete[] m_cue_points; } Commit Message: external/libvpx/libwebm: Update snapshot Update libwebm snapshot. Th...
0
160,857
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GF_Err video_sample_entry_Write(GF_Box *s, GF_BitStream *bs) { GF_Err e; GF_MPEGVisualSampleEntryBox *ptr = (GF_MPEGVisualSampleEntryBox *)s; e = gf_isom_box_write_header(s, bs); if (e) return e; gf_isom_video_sample_entry_write((GF_VisualSampleEntryBox *)s, bs); /*mp4v*/ if (ptr->esd) { e = gf_isom_box...
0
91,902
Analyze the following 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::UpdateTitle(const String& title) { if (raw_title_ == title) return; raw_title_ = title; String old_title = title_; if (raw_title_.IsEmpty()) title_ = String(); else if (raw_title_.Is8Bit()) title_ = CanonicalizedTitle<LChar>(this, raw_title_); else title_ = Canonicaliz...
0
129,923