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: SPL_METHOD(SplDoublyLinkedList, offsetUnset) { zval *zindex; zend_long index; spl_dllist_object *intern; spl_ptr_llist_element *element; spl_ptr_llist *llist; if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zindex) == FAILURE) { return; } intern = Z_SPLDLLIST_...
0
54,288
Analyze the following 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 RunCommandAndWaitForResponse(FrameTreeNode* node, const std::string& command, const std::string& response) { std::string msg_from_renderer; ASSERT_TRUE( ExecuteScriptAndExtractString(node, command, &msg_from_renderer));...
0
143,886
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: cpu_cgroup_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, struct cgroup *old_cont, struct task_struct *tsk, bool threadgroup) { sched_move_task(tsk); if (threadgroup) { struct task_struct *c; rcu_read_lock(); list_for_each_entry_rcu(c, &tsk->thread_group, thread_group) { sched_move_task(...
0
22,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: AllViewsStoppedLoadingObserver::~AllViewsStoppedLoadingObserver() { } 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.chromium.org/chrome/trunk/src@167122 0039d316...
0
117,654
Analyze the following 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 fwnet_pd_delete(struct fwnet_partial_datagram *old) { struct fwnet_fragment_info *fi, *n; list_for_each_entry_safe(fi, n, &old->fi_list, fi_link) kfree(fi); list_del(&old->pd_link); dev_kfree_skb_any(old->skb); kfree(old); } Commit Message: firewire: net: guard against rx buffer overflows T...
0
49,339
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void i8042_free_irqs(void) { if (i8042_aux_irq_registered) free_irq(I8042_AUX_IRQ, i8042_platform_device); if (i8042_kbd_irq_registered) free_irq(I8042_KBD_IRQ, i8042_platform_device); i8042_aux_irq_registered = i8042_kbd_irq_registered = false; } Commit Message: Input: i8042 - fix crash at boot t...
0
86,219
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void DiskCacheBackendTest::BackendFixEnumerators() { InitCache(); int seed = static_cast<int>(Time::Now().ToInternalValue()); srand(seed); const int kNumEntries = 10; for (int i = 0; i < kNumEntries; i++) { std::string key = GenerateKey(true); disk_cache::Entry* entry; ASSERT_THAT(CreateEn...
0
147,156
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: spnego_gss_import_cred(OM_uint32 *minor_status, gss_buffer_t token, gss_cred_id_t *cred_handle) { OM_uint32 ret; spnego_gss_cred_id_t spcred; gss_cred_id_t mcred; ret = gss_import_cred(minor_status, token, &mcred); if (GSS_ERROR(ret)) return (ret); spcred = malloc(sizeof(*spcred)); if ...
0
36,753
Analyze the following 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 unregisterBlobURLTask(void* context) { OwnPtr<BlobRegistryContext> blobRegistryContext = adoptPtr(static_cast<BlobRegistryContext*>(context)); blobRegistry().unregisterBlobURL(blobRegistryContext->url); } Commit Message: Remove BlobRegistry indirection since there is only one implementati...
1
170,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 int mov_write_dfla_tag(AVIOContext *pb, MOVTrack *track) { int64_t pos = avio_tell(pb); avio_wb32(pb, 0); ffio_wfourcc(pb, "dfLa"); avio_w8(pb, 0); /* version */ avio_wb24(pb, 0); /* flags */ /* Expect the encoder to pass a METADATA_BLOCK_TYPE_STREAMINFO. */ if (track->par->ext...
0
79,338
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SYSCALL_DEFINE5(perf_event_open, struct perf_event_attr __user *, attr_uptr, pid_t, pid, int, cpu, int, group_fd, unsigned long, flags) { struct perf_event *group_leader = NULL, *output_event = NULL; struct perf_event *event, *sibling; struct perf_event_attr attr; struct perf_event_context *ctx; struct f...
0
25,956
Analyze the following 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 ext_wait_queue *wq_get_first_waiter( struct mqueue_inode_info *info, int sr) { struct list_head *ptr; ptr = info->e_wait_q[sr].list.prev; if (ptr == &info->e_wait_q[sr].list) return NULL; return list_entry(ptr, struct ext_wait_queue, list); } Commit Message: mqueue: fix a use-after-free in...
0
63,550
Analyze the following 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_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr) { struct perf_sample_data data; if (WARN_ON_ONCE(!regs)) return; perf_sample_data_init(&data, addr, 0); do_perf_sw_event(PERF_TYPE_SOFTWARE, event_id, nr, &data, regs); } Commit Message: perf: Fix event->ctx locking There have b...
0
50,413
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xmlCtxtGrowAttrs(xmlParserCtxtPtr ctxt, int nr) { const xmlChar **atts; int *attallocs; int maxatts; if (ctxt->atts == NULL) { maxatts = 55; /* allow for 10 attrs by default */ atts = (const xmlChar **) xmlMalloc(maxatts * sizeof(xmlChar *)); if (atts == NULL) goto mem_error; ctxt->atts = atts; ...
0
163,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: pdf_set_pattern(fz_context *ctx, pdf_run_processor *pr, int what, pdf_pattern *pat, float *v) { pdf_gstate *gs; pdf_material *mat; gs = pdf_flush_text(ctx, pr); mat = what == PDF_FILL ? &gs->fill : &gs->stroke; pdf_drop_pattern(ctx, mat->pattern); mat->pattern = NULL; mat->kind = PDF_MAT_PATTERN; if (...
0
554
Analyze the following 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 ceph_x_reset(struct ceph_auth_client *ac) { struct ceph_x_info *xi = ac->private; dout("reset\n"); xi->starting = true; xi->server_challenge = 0; } Commit Message: libceph: do not hard code max auth ticket len We hard code cephx auth ticket buffer size to 256 bytes. This isn't enough for any m...
0
36,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: read_exttime(const char *p, struct rar *rar, const char *endp) { unsigned rmode, flags, rem, j, count; int ttime, i; struct tm *tm; time_t t; long nsec; if (p + 2 > endp) return (-1); flags = archive_le16dec(p); p += 2; for (i = 3; i >= 0; i--) { t = 0; if (i == 3) t = rar-...
0
61,225
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: HKEY GetHKEYFromString(const std::wstring &name) { if (L"HKLM" == name) return HKEY_LOCAL_MACHINE; else if (L"HKCR" == name) return HKEY_CLASSES_ROOT; else if (L"HKCC" == name) return HKEY_CURRENT_CONFIG; else if (L"HKCU" == name) return HKEY_CURRENT_USER; else if (L"HKU" == name) re...
0
106,652
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: const net::LoadStateWithParam& WebContentsImpl::GetLoadState() const { return load_state_; } Commit Message: Cancel JavaScript dialogs when an interstitial appears. BUG=295695 TEST=See bug for repro steps. Review URL: https://chromiumcodereview.appspot.com/24360011 git-svn-id: svn://svn.chromium.org/chrome/...
0
110,642
Analyze the following 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_evict_inode(struct inode *inode) { struct btrfs_trans_handle *trans; struct btrfs_root *root = BTRFS_I(inode)->root; struct btrfs_block_rsv *rsv, *global_rsv; u64 min_size = btrfs_calc_trunc_metadata_size(root, 1); int ret; trace_btrfs_inode_evict(inode); truncate_inode_pages(&inode->i_data, 0...
0
34,298
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WebContents* BrowserView::GetActiveWebContents() const { return chrome::GetActiveWebContents(browser_.get()); } 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.c...
0
118,338
Analyze the following 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 AgcDisable(preproc_effect_t *effect) { ALOGV("AgcDisable"); webrtc::GainControl *agc = static_cast<webrtc::GainControl *>(effect->engine); agc->Enable(false); } Commit Message: audio effects: fix heap overflow Check consistency of effect command reply sizes before copying to reply address. Als...
0
157,464
Analyze the following 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 security_sid_to_context_core(u32 sid, char **scontext, u32 *scontext_len, int force) { struct context *context; int rc = 0; if (scontext) *scontext = NULL; *scontext_len = 0; if (!ss_initialized) { if (sid <= SECINITSID_NUM) { char *scontextp; *scontext_len = strlen(initial_sid_...
0
39,297
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void __audit_mq_notify(mqd_t mqdes, const struct sigevent *notification) { struct audit_context *context = current->audit_context; if (notification) context->mq_notify.sigev_signo = notification->sigev_signo; else context->mq_notify.sigev_signo = 0; context->mq_notify.mqdes = mqdes; context->type = AUD...
0
51,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: hook_modifier (struct t_weechat_plugin *plugin, const char *modifier, t_hook_callback_modifier *callback, void *callback_data) { struct t_hook *new_hook; struct t_hook_modifier *new_hook_modifier; int priority; const char *ptr_modifier; if (!modifier || !modifier[0] || !callbac...
0
7,311
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: IntRect RenderBox::outlineBoundsForRepaint(RenderBoxModelObject* repaintContainer, IntPoint* cachedOffsetToRepaintContainer) const { IntRect box = borderBoundingBox(); adjustRectForOutlineAndShadow(box); FloatQuad containerRelativeQuad = FloatRect(box); if (cachedOffsetToRepaintContainer) ...
0
101,610
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: pp::FloatRect PDFiumEngine::GetCharBounds(int page_index, int char_index) { DCHECK(page_index >= 0 && page_index < static_cast<int>(pages_.size())); return pages_[page_index]->GetCharBounds(char_index); } Commit Message: [pdf] Defer page unloading in JS callback. One of the callbacks from PDFium JavaScript ...
0
140,322
Analyze the following 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 xhci_xfer_unmap(XHCITransfer *xfer) { usb_packet_unmap(&xfer->packet, &xfer->sgl); qemu_sglist_destroy(&xfer->sgl); } Commit Message: CWE ID: CWE-835
0
5,766
Analyze the following 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 double gamma_pow(const double value,const double gamma) { return(value < 0.0 ? value : pow(value,gamma)); } Commit Message: Evaluate lazy pixel cache morphology to prevent buffer overflow (bug report from Ibrahim M. El-Sayed) CWE ID: CWE-125
0
50,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: static vm_fault_t kvm_vcpu_fault(struct vm_fault *vmf) { struct kvm_vcpu *vcpu = vmf->vma->vm_file->private_data; struct page *page; if (vmf->pgoff == 0) page = virt_to_page(vcpu->run); #ifdef CONFIG_X86 else if (vmf->pgoff == KVM_PIO_PAGE_OFFSET) page = virt_to_page(vcpu->arch.pio_data); #endif #ifdef C...
0
91,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: SYSCALL_DEFINE4(timer_settime, timer_t, timer_id, int, flags, const struct itimerspec __user *, new_setting, struct itimerspec __user *, old_setting) { struct itimerspec64 new_spec, old_spec; struct itimerspec64 *rtn = old_setting ? &old_spec : NULL; int error = 0; if (!new_setting) return -EINVAL; i...
0
85,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: R_API void r_bin_iobind(RBin *bin, RIO *io) { r_io_bind (io, &bin->iob); } Commit Message: Fix #8748 - Fix oobread on string search CWE ID: CWE-125
0
60,173
Analyze the following 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 MediaControlVolumeSliderElement::keepEventInNode(Event* event) { return isUserInteractionEventForSlider(event, layoutObject()); } Commit Message: Fixed volume slider element event handling MediaControlVolumeSliderElement::defaultEventHandler has making redundant calls to setVolume() & setMuted() on mouse...
0
126,969
Analyze the following 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 unix_detach_fds(struct scm_cookie *scm, struct sk_buff *skb) { int i; scm->fp = UNIXCB(skb).fp; UNIXCB(skb).fp = NULL; for (i = scm->fp->count-1; i >= 0; i--) unix_notinflight(scm->fp->fp[i]); } Commit Message: af_netlink: force credentials passing [CVE-2012-3520] Pablo Neira Ayuso discovere...
0
19,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 rw_interrupt(void) { int eoc; int ssize; int heads; int nr_sectors; if (R_HEAD >= 2) { /* some Toshiba floppy controllers occasionnally seem to * return bogus interrupts after read/write operations, which * can be recognized by a bad head number (>= 2) */ return; } if (!DRS->first_r...
0
39,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: move_statusbar() { if (!uzbl.gui.scrolled_win && !uzbl.gui.mainbar) return; g_object_ref(uzbl.gui.scrolled_win); g_object_ref(uzbl.gui.mainbar); gtk_container_remove(GTK_CONTAINER(uzbl.gui.vbox), uzbl.gui.scrolled_win); gtk_container_remove(GTK_CONTAINER(uzbl.gui.vbox), uz...
0
18,379
Analyze the following 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 SafeSock::connect( char const *host, int port, bool ) { if (!host || port < 0) return FALSE; _who.clear(); if (!Sock::guess_address_string(host, port, _who)) return FALSE; if (host[0] == '<') { set_connect_addr(host); } else { set_connect_addr(_who.to_sinful().Value()); } addr_changed...
0
16,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: xmlParseVersionNum(xmlParserCtxtPtr ctxt) { xmlChar *buf = NULL; int len = 0; int size = 10; xmlChar cur; buf = (xmlChar *) xmlMallocAtomic(size * sizeof(xmlChar)); if (buf == NULL) { xmlErrMemory(ctxt, NULL); return(NULL); } cur = CUR; if (!((cur >= '0') && (cur <= '9'))) {...
0
59,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: guint_slice_free (gpointer data) { g_slice_free (guint, data); } Commit Message: CWE ID: CWE-20
0
5,556
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: unsigned int blk_plug_queued_count(struct request_queue *q) { struct blk_plug *plug; struct request *rq; struct list_head *plug_list; unsigned int ret = 0; plug = current->plug; if (!plug) goto out; if (q->mq_ops) plug_list = &plug->mq_list; else plug_list = &plug->list; list_for_each_entry(rq, ...
0
91,995
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: InputEventAckState SynchronousCompositorImpl::HandleInputEvent( const blink::WebInputEvent& input_event) { DCHECK(CalledOnValidThread()); return g_factory.Get().synchronous_input_event_filter()->HandleInputEvent( routing_id_, input_event); } Commit Message: sync compositor: pass simple gfx types by...
0
119,666
Analyze the following 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 ssh_pkt_addstring_start(struct Packet *pkt) { ssh_pkt_adduint32(pkt, 0); pkt->savedpos = pkt->length; } Commit Message: CWE ID: CWE-119
0
8,573
Analyze the following 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 irqreturn_t _vop_virtio_intr_handler(int irq, void *data) { struct vop_vdev *vdev = data; struct vop_device *vpdev = vdev->vpdev; vpdev->hw_ops->ack_interrupt(vpdev, vdev->virtio_db); schedule_work(&vdev->virtio_bh_work); return IRQ_HANDLED; } Commit Message: misc: mic: Fix for double fetch security...
0
51,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: ContentClient* RenderViewTest::CreateContentClient() { return new TestContentClient; } Commit Message: Connect WebUSB client interface to the devices app This provides a basic WebUSB client interface in content/renderer. Most of the interface is unimplemented, but this CL hooks up navigator.usb.getDevices() t...
0
123,063
Analyze the following 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 hmac_create(struct crypto_template *tmpl, struct rtattr **tb) { struct shash_instance *inst; struct crypto_alg *alg; struct shash_alg *salg; int err; int ds; int ss; err = crypto_check_attr_type(tb, CRYPTO_ALG_TYPE_SHASH); if (err) return err; salg = shash_attr_alg(tb[1], 0, 0); if (IS_ER...
0
45,786
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: DefragSturgesNovakFirstTest(void) { /* Expected data. */ u_char expected[] = { "AAAAAAAA" "AAAAAAAA" "AAAAAAAA" "JJJJJJJJ" "BBBBBBBB" "BBBBBBBB" "CCCCCCCC" "CCCCCCCC" "CCCCCCCC" "LLLLLLLL" "DDDDDDDD" "LLLLLLLL"...
0
67,848
Analyze the following 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 cms_RecipientInfo_kekri_encrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri) { CMS_EncryptedContentInfo *ec; CMS_KEKRecipientInfo *kekri; AES_KEY actx; unsigned char *wkey = NULL; int wkeylen; int r = 0; ec = cms->d.envelopedData->...
0
11,920
Analyze the following 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 FUZ_mallocTests(unsigned seed, double compressibility, unsigned part) { (void)seed; (void)compressibility; (void)part; return 0; } Commit Message: fixed T36302429 CWE ID: CWE-362
0
90,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: int getttyname_harder(int fd, char **ret) { _cleanup_free_ char *s = NULL; int r; r = getttyname_malloc(fd, &s); if (r < 0) return r; if (streq(s, "tty")) return get_ctty(0, NULL, ret); *ret = TAKE_PTR(s); return 0; } Comm...
0
92,394
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool RenderLayerScrollableArea::userInputScrollable(ScrollbarOrientation orientation) const { if (box().isIntristicallyScrollable(orientation)) return true; EOverflow overflowStyle = (orientation == HorizontalScrollbar) ? box().style()->overflowX() : box().style()->overflowY(); return...
0
120,045
Analyze the following 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 jsvGarbageCollect() { if (isMemoryBusy) return false; isMemoryBusy = MEMBUSY_GC; JsVarRef i; for (i=1;i<=jsVarsSize;i++) { JsVar *var = jsvGetAddressOf(i); if ((var->flags&JSV_VARTYPEMASK) != JSV_UNUSED) { // if it is not unused var->flags |= (JsVarFlags)JSV_GARBAGE_COLLECT; if (j...
0
82,394
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void reds_handle_ticket(void *opaque) { RedLinkInfo *link = (RedLinkInfo *)opaque; char password[SPICE_MAX_PASSWORD_LENGTH]; time_t ltime; time(&ltime); RSA_private_decrypt(link->tiTicketing.rsa_size, link->tiTicketing.encrypted_ticket.encrypted_data, ...
1
164,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: static int kvp_file_init(void) { int fd; FILE *filep; size_t records_read; char *fname; struct kvp_record *record; struct kvp_record *readp; int num_blocks; int i; int alloc_unit = sizeof(struct kvp_record) * ENTRIES_PER_BLOCK; if (access("/var/opt/hyperv", F_OK)) { if (mkdir("/var/opt/hyperv", S_IR...
0
18,463
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: HeadlessDevToolsManagerDelegate::CreateTarget( content::DevToolsAgentHost* agent_host, int session_id, int command_id, const base::DictionaryValue* params) { std::string url; if (const base::Value* url_value = params->FindKey("url")) { url = url_value->GetString(); } else { return C...
0
149,813
Analyze the following 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 MagickBooleanType ClonePixelCacheOnDisk( CacheInfo *magick_restrict cache_info,CacheInfo *magick_restrict clone_info, ExceptionInfo *exception) { MagickSizeType extent; size_t quantum; ssize_t count; struct stat file_stats; unsigned char *buffer; /* Clone pixel ...
0
73,447
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void SavePackage::GetAllSavableResourceLinksForCurrentPage() { if (wait_state_ != START_PROCESS) return; wait_state_ = RESOURCES_LIST; Send(new ViewMsg_GetAllSavableResourceLinksForCurrentPage(routing_id(), page_url_)); } Commit Message: Fix ...
0
115,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: static void kvm_mmu_notifier_change_pte(struct mmu_notifier *mn, struct mm_struct *mm, unsigned long address, pte_t pte) { struct kvm *kvm = mmu_notifier_to_kvm(mn); int idx; idx = srcu_read_lock(&kvm->srcu); spin_lock(&kvm->mmu_lock); kvm->mmu_notifier_seq++; kvm_set_spte_hva(kvm, address, ...
0
20,368
Analyze the following 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 __init tcp_init(void) { struct sk_buff *skb = NULL; unsigned long nr_pages, limit; int order, i, max_share; unsigned long jiffy = jiffies; BUILD_BUG_ON(sizeof(struct tcp_skb_cb) > sizeof(skb->cb)); percpu_counter_init(&tcp_sockets_allocated, 0); percpu_counter_init(&tcp_orphan_count, 0); tcp_hashin...
0
31,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: cmsBool GrowNamedColorList(cmsNAMEDCOLORLIST* v) { cmsUInt32Number size; _cmsNAMEDCOLOR * NewPtr; if (v == NULL) return FALSE; if (v ->Allocated == 0) size = 64; // Initial guess else size = v ->Allocated * 2; if (size > 1024*100) return FALSE; NewPtr = (_cmsNAME...
0
40,978
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: png_inflate(png_structp png_ptr, const png_byte *data, png_size_t size, png_bytep output, png_size_t output_size) { png_size_t count = 0; png_ptr->zstream.next_in = (png_bytep)data; /* const_cast: VALID */ png_ptr->zstream.avail_in = size; while (1) { int ret, avail; /* Reset...
1
172,179
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: error::Error GLES2DecoderImpl::HandleGetInternalformativ( uint32_t immediate_data_size, const volatile void* cmd_data) { if (!feature_info_->IsWebGL2OrES3Context()) return error::kUnknownCommand; const volatile gles2::cmds::GetInternalformativ& c = *static_cast<const volatile gles2::cmds::Ge...
0
141,540
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: LiveSyncTest::~LiveSyncTest() {} Commit Message: Use URLFetcher::Create instead of new in http_bridge.cc. This change modified http_bridge so that it uses a factory to construct the URLFetcher. Moreover, it modified sync_backend_host_unittest.cc to use an URLFetcher factory which will prevent access to www.exa...
0
100,204
Analyze the following 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::vector<RenderFrameHost*> WebContentsImpl::GetAllFrames() { std::vector<RenderFrameHost*> frame_hosts; for (FrameTreeNode* node : frame_tree_.Nodes()) frame_hosts.push_back(node->current_frame_host()); return frame_hosts; } Commit Message: Don't call WebContents::DownloadImage() callback if the Web...
0
131,834
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: pseudo_register_machine_info(char *uiddomain, char *fsdomain, char * starterAddr, char *full_hostname ) { thisRemoteResource->setUidDomain( uiddomain ); thisRemoteResource->setFilesystemDomain( fsdomain ); thisRemoteResource->setStarterAddress( starterAddr ); thisRemoteResource->setMachineName( full...
0
16,374
Analyze the following 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 vrend_renderer_get_cap_set(uint32_t cap_set, uint32_t *max_ver, uint32_t *max_size) { if (cap_set != VREND_CAP_SET) { *max_ver = 0; *max_size = 0; return; } *max_ver = 1; *max_size = sizeof(union virgl_caps); } Commit Message: CWE ID: CWE-772
0
8,903
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xsltFreeCompMatch(xsltCompMatchPtr comp) { xsltStepOpPtr op; int i; if (comp == NULL) return; if (comp->pattern != NULL) xmlFree((xmlChar *)comp->pattern); if (comp->nsList != NULL) xmlFree(comp->nsList); for (i = 0;i < comp->nbStep;i++) { op = &comp->steps[i]; if (op->value != NULL)...
0
106,448
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: VirtQueue *virtio_vector_next_queue(VirtQueue *vq) { return QLIST_NEXT(vq, node); } Commit Message: CWE ID: CWE-20
0
9,251
Analyze the following 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 AppCacheHost* AppCacheHost::GetSpawningHost() const { AppCacheBackendImpl* backend = service_->GetBackend(spawning_process_id_); return backend ? backend->GetHost(spawning_host_id_) : NULL; } Commit Message: Fix possible map::end() dereference in AppCacheUpdateJob triggered by a compromised renderer. ...
0
124,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: SVGStyleElement* SVGStyleElement::Create(Document& document, const CreateElementFlags flags) { return new SVGStyleElement(document, flags); } Commit Message: Do not crash while reentrantly appending to style element. When a node is inserted into a container, it is noti...
0
154,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: static int udp_lib_lport_inuse2(struct net *net, __u16 num, struct udp_hslot *hslot2, struct sock *sk, int (*saddr_comp)(const struct sock *sk1, const struct sock *sk2)) { struct sock *sk2; struct hlist_nulls_node *node; kuid_t uid = sock_i_uid(sk); int res = 0; spin_loc...
0
29,945
Analyze the following 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 PropertyDetails GetDetailsImpl(JSObject* holder, uint32_t entry) { return PropertyDetails(kData, NONE, 0, PropertyCellType::kNoCell); } Commit Message: Backport: Fix Object.entries/values with changing elements Bug: 111274046 Test: m -j proxy_resolver_v8_unittest && adb sync && adb shell \ /data/nativ...
0
163,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: jas_stream_t *jas_stream_fopen(const char *filename, const char *mode) { jas_stream_t *stream; jas_stream_fileobj_t *obj; int openflags; JAS_DBGLOG(100, ("jas_stream_fopen(\"%s\", \"%s\")\n", filename, mode)); /* Allocate a stream object. */ if (!(stream = jas_stream_create())) { return 0; } /* Parse...
0
67,914
Analyze the following 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 WebGLRenderingContextBase::LoseContext(LostContextMode mode) { ForceLostContext(mode, kManual); } Commit Message: Reset ES3 pixel pack parameters and PIXEL_PACK_BUFFER binding in DrawingBuffer before ReadPixels() and recover them later. BUG=740603 TEST=new conformance test R=kbr@chromium.org,piman@chromi...
0
133,648
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void agent_cancel_query(agent_pending_query *q) { assert(0 && "Windows agent queries are never asynchronous!"); } Commit Message: CWE ID: CWE-119
0
8,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: static void __net_exit diag_net_exit(struct net *net) { netlink_kernel_release(net->diag_nlsk); net->diag_nlsk = NULL; } Commit Message: sock_diag: Fix out-of-bounds access to sock_diag_handlers[] Userland can send a netlink message requesting SOCK_DIAG_BY_FAMILY with a family greater or equal then AF_MAX -- ...
0
33,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 RenderWidgetHostImpl::OnMsgSetCursor(const WebCursor& cursor) { if (!view_) { return; } view_->UpdateCursor(cursor); } Commit Message: Implement TextureImageTransportSurface using texture mailbox This has a couple of advantages: - allow tearing down and recreating the UI parent context without lo...
0
114,665
Analyze the following 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 venc_dev::venc_set_idr_period(OMX_U32 nPFrames, OMX_U32 nIDRPeriod) { int rc = 0; struct v4l2_control control; DEBUG_PRINT_LOW("venc_set_idr_period: nPFrames = %u, nIDRPeriod: %u", (unsigned int)nPFrames, (unsigned int)nIDRPeriod); if (m_sVenc_cfg.codectype != V4L2_PIX_FMT_H264) { DEBUG_PRIN...
0
159,290
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void GDataDirectoryService::SaveToDB() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (!blocking_task_runner_ || !directory_service_db_.get()) { NOTREACHED(); return; } size_t serialized_size = 0; SerializedMap serialized_resources; for (ResourceMap::const_iterator iter = resour...
0
117,112
Analyze the following 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 v8::Handle<v8::Value> convert1Callback(const v8::Arguments& args) { INC_STATS("DOM.TestObj.convert1"); if (args.Length() < 1) return V8Proxy::throwNotEnoughArgumentsError(); TestObj* imp = V8TestObj::toNative(args.Holder()); EXCEPTION_BLOCK(a*, , V8a::HasInstance(MAYBE_MISSING_...
1
171,077
Analyze the following 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 IntRect cornerRect(const RenderStyle* style, const Scrollbar* horizontalScrollbar, const Scrollbar* verticalScrollbar, const IntRect& bounds) { int horizontalThickness; int verticalThickness; if (!verticalScrollbar && !horizontalScrollbar) { horizontalThickness = ScrollbarTheme::theme()...
0
119,977
Analyze the following 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 ftrace_function_check_pred(struct filter_pred *pred) { struct ftrace_event_field *field = pred->field; /* * Check the predicate for function trace, verify: * - only '==' and '!=' is used * - the 'ip' field is used */ if ((pred->op != OP_EQ) && (pred->op != OP_NE)) return -EINVAL; if (...
0
81,582
Analyze the following 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 macvtap_exit(void) { rtnl_link_unregister(&macvtap_link_ops); unregister_netdevice_notifier(&macvtap_notifier_block); class_unregister(macvtap_class); cdev_del(&macvtap_cdev); unregister_chrdev_region(macvtap_major, MACVTAP_NUM_DEVS); } Commit Message: macvtap: zerocopy: validate vectors before ...
0
34,562
Analyze the following 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
12,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: bool Editor::SelectionStartHasStyle(CSSPropertyID property_id, const String& value) const { EditingStyle* style_to_check = EditingStyle::Create(property_id, value); EditingStyle* style_at_start = EditingStyleUtilities::CreateStyleAtSelectionStart( GetFrame()...
0
124,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 pppoe_create(struct net *net, struct socket *sock) { struct sock *sk; sk = sk_alloc(net, PF_PPPOX, GFP_KERNEL, &pppoe_sk_proto); if (!sk) return -ENOMEM; sock_init_data(sock, sk); sock->state = SS_UNCONNECTED; sock->ops = &pppoe_ops; sk->sk_backlog_rcv = pppoe_rcv_core; sk->sk_state = PP...
0
40,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: gst_asf_demux_pull_data (GstASFDemux * demux, guint64 offset, guint size, GstBuffer ** p_buf, GstFlowReturn * p_flow) { gsize buffer_size; GstFlowReturn flow; GST_LOG_OBJECT (demux, "pulling buffer at %" G_GUINT64_FORMAT "+%u", offset, size); flow = gst_pad_pull_range (demux->sinkpad, offset, ...
0
68,575
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gst_qtdemux_handle_sink_event (GstPad * sinkpad, GstEvent * event) { GstQTDemux *demux = GST_QTDEMUX (GST_PAD_PARENT (sinkpad)); gboolean res; switch (GST_EVENT_TYPE (event)) { case GST_EVENT_NEWSEGMENT: /* We need to convert it to a GST_FORMAT_TIME new segment */ gst_event_unref (event); ...
0
4,945
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GLvoid StubGLGenFramebuffers(GLsizei n, GLuint* framebuffers) { glGenFramebuffersEXT(n, framebuffers); } Commit Message: Add chromium_code: 1 to surface.gyp and gl.gyp to pick up -Werror. It looks like this was dropped accidentally in http://codereview.chromium.org/6718027 (surface.gyp) and http://codereview....
0
99,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: size_t ZSTD_compress_usingCDict(ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize, const ZSTD_CDict* cdict) { ZSTD_frameParameters const fParams = { 1 /*content*/, 0 /*checksum*/, 0 /*...
0
90,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: static int find_next_best_node(int node, nodemask_t *used_nodes) { int i, n, val, min_val, best_node = -1; min_val = INT_MAX; for (i = 0; i < nr_node_ids; i++) { /* Start at @node */ n = (node + i) % nr_node_ids; if (!nr_cpus_node(n)) continue; /* Skip already used nodes */ if (node_isset(n, *...
0
26,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 void dn_user_copy(struct sk_buff *skb, struct optdata_dn *opt) { unsigned char *ptr = skb->data; u16 len = *ptr++; /* yes, it's 8bit on the wire */ BUG_ON(len > 16); /* we've checked the contents earlier */ opt->opt_optl = cpu_to_le16(len); opt->opt_status = 0; memcpy(opt->opt_data, ptr, len); sk...
0
41,516
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: invoke_NPN_PushPopupsEnabledState(PluginInstance *plugin, NPBool enabled) { npw_return_if_fail(rpc_method_invoke_possible(g_rpc_connection)); int error = rpc_method_invoke(g_rpc_connection, RPC_METHOD_NPN_PUSH_POPUPS_ENABLED_STATE, RPC_TYPE_NPW_PLUGIN_INSTANCE, plugin, RPC_TYPE_UINT32...
0
27,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: bool ClipboardMessageFilter::OnMessageReceived(const IPC::Message& message, bool* message_was_ok) { bool handled = true; IPC_BEGIN_MESSAGE_MAP_EX(ClipboardMessageFilter, message, *message_was_ok) IPC_MESSAGE_HANDLER(ClipboardHostMsg_WriteObjectsAsync, OnWrite...
0
122,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: static void validate_coredump_safety(void) { #ifdef CONFIG_COREDUMP if (suid_dumpable == SUID_DUMP_ROOT && core_pattern[0] != '/' && core_pattern[0] != '|') { printk(KERN_WARNING "Unsafe core_pattern used with "\ "suid_dumpable=2. Pipe handler or fully qualified "\ "core dump path required.\n"); } ...
0
51,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: hfs_write_resource_fork_header(struct archive_write_disk *a) { unsigned char *buff; uint32_t rsrc_bytes; uint32_t rsrc_header_bytes; /* * Write resource fork header + block info. */ buff = a->resource_fork; rsrc_bytes = a->compressed_rsrc_position - RSRC_F_SIZE; rsrc_header_bytes = RSRC_H_SIZE + /*...
0
43,923
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: smp_fetch_http_auth(struct proxy *px, struct session *l4, void *l7, unsigned int opt, const struct arg *args, struct sample *smp, const char *kw) { if (!args || args->type != ARGT_USR) return 0; CHECK_HTTP_MESSAGE_FIRST(); if (!get_http_auth(l4)) return 0; smp->type = SMP_T_BOOL; ...
0
9,853
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void RenderWidgetHostViewAura::FocusedNodeChanged( bool editable, const gfx::Rect& node_bounds_in_screen) { #if defined(OS_WIN) if (!editable && virtual_keyboard_requested_) { virtual_keyboard_requested_ = false; RenderViewHost* rvh = RenderViewHost::From(host_); if (rvh && rvh->GetDelegate...
0
132,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: base::Value* CreateChoiceData( const Experiment& experiment, const std::set<std::string>& enabled_experiments) { DCHECK(experiment.type == Experiment::MULTI_VALUE || experiment.type == Experiment::ENABLE_DISABLE_VALUE); base::ListValue* result = new base::ListValue; for (int i = 0; i < expe...
0
110,300
Analyze the following 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 InitializeExtraHeaders(browser::NavigateParams* params, Profile* profile, std::string* extra_headers) { #if defined(OS_WIN) #if defined(GOOGLE_CHROME_BUILD) if (!profile) profile = params->profile; if (profile && (params->transition & con...
0
97,106
Analyze the following 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 Editor::CanSmartReplaceWithPasteboard(Pasteboard* pasteboard) { return SmartInsertDeleteEnabled() && pasteboard->CanSmartReplace(); } Commit Message: Move SelectionTemplate::is_handle_visible_ to FrameSelection This patch moves |is_handle_visible_| to |FrameSelection| from |SelectionTemplate| since handl...
0
124,664