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 RootWindowHostLinux::Show() { XSizeHints size_hints; size_hints.flags = PPosition; size_hints.x = bounds_.x(); size_hints.y = bounds_.y(); XSetWMNormalHints(xdisplay_, xwindow_, &size_hints); XMapWindow(xdisplay_, xwindow_); } Commit Message: Introduce XGetImage() for GrabWindowSnapshot() in Ch...
0
104,011
Analyze the following 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 ext2_statfs (struct dentry * dentry, struct kstatfs * buf) { struct super_block *sb = dentry->d_sb; struct ext2_sb_info *sbi = EXT2_SB(sb); struct ext2_super_block *es = sbi->s_es; u64 fsid; spin_lock(&sbi->s_lock); if (test_opt (sb, MINIX_DF)) sbi->s_overhead_last = 0; else if (sbi->s_block...
0
94,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: void WebContentsImpl::CreateNewWidget(int32_t render_process_id, int32_t route_id, bool is_fullscreen, mojom::WidgetPtr widget, blink::WebPopupType popup_type) { ...
0
147,689
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static char *get_username(void) { struct passwd *pwd = getpwuid(getuid()); if (pwd == NULL) { perror("getpwuid"); return NULL; } return pwd->pw_name; } Commit Message: CVE-2017-5985: Ensure target netns is caller-owned Before this commit, lxc-user-nic could potentially have been tricked into operating...
0
68,457
Analyze the following 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 Browser::SavePage() { UserMetrics::RecordAction(UserMetricsAction("SavePage"), profile_); TabContents* current_tab = GetSelectedTabContents(); if (current_tab && current_tab->contents_mime_type() == "application/pdf") UserMetrics::RecordAction(UserMetricsAction("PDF.SavePage"), profile_); GetSele...
0
98,304
Analyze the following 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 resolve_dev_console(char **ret) { _cleanup_free_ char *active = NULL; char *tty; int r; assert(ret); /* Resolve where /dev/console is pointing to, if /sys is actually ours (i.e. not read-only-mounted which is a * sign for container setups) */ if (pa...
0
92,409
Analyze the following 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 create_vcpu_fd(struct kvm_vcpu *vcpu) { return anon_inode_getfd("kvm-vcpu", &kvm_vcpu_fops, vcpu, O_RDWR | O_CLOEXEC); } Commit Message: KVM: Improve create VCPU parameter (CVE-2013-4587) In multiple functions the vcpu_id is used as an offset into a bitfield. Ag malicious user could specify a vcpu_...
0
29,305
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int eseqiv_givencrypt(struct skcipher_givcrypt_request *req) { struct crypto_ablkcipher *geniv = skcipher_givcrypt_reqtfm(req); struct eseqiv_ctx *ctx = crypto_ablkcipher_ctx(geniv); struct eseqiv_request_ctx *reqctx = skcipher_givcrypt_reqctx(req); struct ablkcipher_request *subreq; crypto_completion...
0
45,720
Analyze the following 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 menu *pxe_menu_to_menu(struct pxe_menu *cfg) { struct pxe_label *label; struct list_head *pos; struct menu *m; int err; int i = 1; char *default_num = NULL; /* * Create a menu and add items for all the labels. */ m = menu_create(cfg->title, DIV_ROUND_UP(cfg->timeout, 10), cfg->prompt...
0
89,353
Analyze the following 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 StreamTcpSessionPoolCleanup(void *s) { if (s != NULL) { StreamTcpSessionCleanup(s); /** \todo not very clean, as the memory is not freed here */ StreamTcpDecrMemuse((uint64_t)sizeof(TcpSession)); } } Commit Message: stream: support RST getting lost/ignored In case of ...
0
79,223
Analyze the following 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 InsertStdSamplerOffset( FlowSource_t *fs, uint16_t id, uint16_t offset_std_sampler_interval, uint16_t offset_std_sampler_algorithm) { option_offset_t **t; t = &(fs->option_offset_table); while ( *t ) { if ( (*t)->id == id ) { // table already known to us - update data dbg_printf("Found existin...
0
88,772
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static MagickBooleanType WriteHRZImage(const ImageInfo *image_info,Image *image) { Image *hrz_image; MagickBooleanType status; register const PixelPacket *p; register ssize_t x, y; register unsigned char *q; ssize_t count; unsigned char *pixels; /* Open o...
0
71,572
Analyze the following 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 tiocsetd(struct tty_struct *tty, int __user *p) { int ldisc; int ret; if (get_user(ldisc, p)) return -EFAULT; ret = tty_set_ldisc(tty, ldisc); return ret; } Commit Message: TTY: drop driver reference in tty_open fail path When tty_driver_lookup_tty fails in tty_open, we forget to drop a ref...
0
58,744
Analyze the following 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 memcg_oom_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *arg) { struct mem_cgroup *wake_memcg = (struct mem_cgroup *)arg, *oom_wait_memcg; struct oom_wait_info *oom_wait_info; oom_wait_info = container_of(wait, struct oom_wait_info, wait); oom_wait_memcg = oom_wait_info->me...
0
21,163
Analyze the following 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 Gfx::opSetStrokeRGBColor(Object args[], int numArgs) { GfxColor color; int i; state->setStrokePattern(NULL); state->setStrokeColorSpace(new GfxDeviceRGBColorSpace()); out->updateStrokeColorSpace(state); for (i = 0; i < 3; ++i) { color.c[i] = dblToCol(args[i].getNum()); } state->setStroke...
0
8,161
Analyze the following 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 DownloadManagerImpl::DownloadUrl( std::unique_ptr<download::DownloadUrlParameters> params) { DownloadUrl(std::move(params), nullptr /* blob_data_handle */, nullptr /* blob_url_loader_factory */); return true; } Commit Message: Early return if a download Id is already used when creating...
0
151,200
Analyze the following 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 ssl_check_clienthello_tlsext_late(SSL *s, int *al) { s->tlsext_status_expected = 0; /* * If status request then ask callback what to do. Note: this must be * called after servername callbacks in case the certificate has changed, * and must be called after the cipher has been chosen bec...
0
9,422
Analyze the following 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 __ip_vs_addr_is_local_v6(struct net *net, const struct in6_addr *addr) { struct flowi6 fl6 = { .daddr = *addr, }; struct dst_entry *dst = ip6_route_output(net, NULL, &fl6); bool is_local; is_local = !dst->error && dst->dev && (dst->dev->flags & IFF_LOOPBACK); dst_release(dst); retu...
0
34,171
Analyze the following 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 allmbox_p(void *rock, const char *key, size_t keylen, const char *data, size_t datalen) { struct allmb_rock *mbrock = (struct allmb_rock *)rock; int r; /* skip any dollar keys */ if (keylen && key[0] ==...
0
61,238
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ofputil_decode_ofpst11_flow_request(struct ofputil_flow_stats_request *fsr, struct ofpbuf *b, bool aggregate, const struct tun_table *tun_table, const struct vl_mff_map *vl_mff_map) { const struct ofp11...
0
77,525
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ofproto_port_query_by_name(const struct ofproto *ofproto, const char *devname, struct ofproto_port *port) { int error; error = ofproto->ofproto_class->port_query_by_name(ofproto, devname, port); if (error) { memset(port, 0, sizeof *port); } return error; } ...
0
77,360
Analyze the following 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 load_vmcs12_host_state(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12) { struct kvm_segment seg; if (vmcs12->vm_exit_controls & VM_EXIT_LOAD_IA32_EFER) vcpu->arch.efer = vmcs12->host_ia32_efer; else if (vmcs12->vm_exit_controls & VM_EXIT_HOST_ADDR_SPACE_SIZE) vcpu->arch.efer |= (EFER_LMA ...
0
80,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: bool IsExperimentalInputViewEnabled() { return base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableExperimentalInputViewFeatures); } Commit Message: Move smart deploy to tristate. BUG= Review URL: https://codereview.chromium.org/1149383006 Cr-Commit-Position: refs/heads/master@{#33...
0
123,328
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static inline void ion_buffer_page_clean(struct page **page) { *page = (struct page *)((unsigned long)(*page) & ~(1UL)); } Commit Message: staging/android/ion : fix a race condition in the ion driver There is a use-after-free problem in the ion driver. This is caused by a race condition in the ion_ioctl() func...
0
48,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 Document::moveNodeIteratorsToNewDocument(Node* node, Document* newDocument) { HashSet<NodeIterator*> nodeIteratorsList = m_nodeIterators; HashSet<NodeIterator*>::const_iterator nodeIteratorsEnd = nodeIteratorsList.end(); for (HashSet<NodeIterator*>::const_iterator it = nodeIteratorsList.begin(); ...
0
102,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: static int netlink_dump(struct sock *sk) { struct netlink_sock *nlk = nlk_sk(sk); struct netlink_callback *cb; struct sk_buff *skb = NULL; struct nlmsghdr *nlh; int len, err = -ENOBUFS; int alloc_size; mutex_lock(nlk->cb_mutex); cb = nlk->cb; if (cb == NULL) { err = -EINVAL; goto errout_skb; } a...
0
19,229
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: attr_reader(mrb_state *mrb, mrb_value obj) { mrb_value name = mrb_proc_cfunc_env_get(mrb, 0); return mrb_iv_get(mrb, obj, to_sym(mrb, name)); } Commit Message: `mrb_class_real()` did not work for `BasicObject`; fix #4037 CWE ID: CWE-476
0
82,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: BOOL CSoundFile::RemoveSelectedSamples(BOOL *pbIns) { if (!pbIns) return FALSE; for (UINT j=1; j<MAX_SAMPLES; j++) { if ((!pbIns[j]) && (Ins[j].pSample)) { DestroySample(j); if ((j == m_nSamples) && (j > 1)) m_nSamples--; } } return TRUE; } Commit Message: CWE ID:
0
8,490
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int vmw_gb_surface_unbind(struct vmw_resource *res, bool readback, struct ttm_validate_buffer *val_buf) { struct vmw_private *dev_priv = res->dev_priv; struct ttm_buffer_object *bo = val_buf->bo; struct vmw_fence_obj *fence; struct { SVGA3dCmdHeader header; SVGA3dCmdReadbackGBSurface bod...
0
64,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 bond_release(struct net_device *bond_dev, struct net_device *slave_dev) { struct bonding *bond = netdev_priv(bond_dev); struct slave *slave, *oldcurrent; struct sockaddr addr; u32 old_features = bond_dev->features; /* slave is not a slave or master is not master of this slave */ if (!(slave_dev->flags ...
0
23,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: OVS_EXCLUDED(ofproto_mutex) { const struct rule *rule; bool must_add; /* First do a cheap check whether the rule we're looking for already exists * with the actions that we want. If it does, then we're done. */ rule = rule_from_cls_rule(classifier_find_match_exactly( ...
0
77,115
Analyze the following 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 MSG_WriteAngle( msg_t *sb, float f ) { MSG_WriteByte (sb, (int)(f*256/360) & 255); } Commit Message: Fix/improve buffer overflow in MSG_ReadBits/MSG_WriteBits Prevent reading past end of message in MSG_ReadBits. If read past end of msg->data buffer (16348 bytes) the engine could SEGFAULT. Make MSG_WriteBi...
0
63,161
Analyze the following 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 php_csr_free(zend_resource *rsrc) { X509_REQ * csr = (X509_REQ*)rsrc->ptr; X509_REQ_free(csr); } Commit Message: CWE ID: CWE-754
0
4,551
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: user_change_email_authorized_cb (Daemon *daemon, User *user, GDBusMethodInvocation *context, gpointer data) { gchar *email = data; if (g_strcmp0 (accou...
0
4,719
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int generic_delete_inode(struct inode *inode) { return 1; } Commit Message: fs,userns: Change inode_capable to capable_wrt_inode_uidgid The kernel has no concept of capabilities with respect to inodes; inodes exist independently of namespaces. For example, inode_capable(inode, CAP_LINUX_IMMUTABLE) would be no...
0
36,846
Analyze the following 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 GLES2DecoderPassthroughImpl::DoVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y) { api()->glVertexAttrib2fFn(indx, x, y); return error::kNoError; } Commit Message: Add GL_PROGRAM...
0
142,180
Analyze the following 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 DocumentVisibilityObserver::setObservedDocument(Document& document) { unregisterObserver(); registerObserver(document); } Commit Message: Correctly keep track of isolates for microtask execution BUG=487155 R=haraken@chromium.org Review URL: https://codereview.chromium.org/1161823002 git-svn-id: s...
0
127,548
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: FrameSelection& SelectionController::Selection() const { return frame_->Selection(); } Commit Message: Move SelectionTemplate::is_handle_visible_ to FrameSelection This patch moves |is_handle_visible_| to |FrameSelection| from |SelectionTemplate| since handle visibility is used only for setting |FrameSelectio...
0
124,936
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: fh_dup2(struct svc_fh *dst, struct svc_fh *src) { fh_put(dst); dget(src->fh_dentry); if (src->fh_export) exp_get(src->fh_export); *dst = *src; } Commit Message: Merge tag 'nfsd-4.12' of git://linux-nfs.org/~bfields/linux Pull nfsd updates from Bruce Fields: "Another RDMA update from Chuck Lever, and a bu...
0
65,306
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: checkbuffer(Image *image, const char *arg) { if (check16(image->buffer, 95)) { fflush(stdout); fprintf(stderr, "%s: overwrite at start of image buffer\n", arg); exit(1); } if (check16(image->buffer+16+image->allocsize, 95)) { fflush(stdout); fprintf(stderr, "%s: overwrite at en...
0
159,863
Analyze the following 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 de_thread(struct task_struct *tsk) { struct signal_struct *sig = tsk->signal; struct sighand_struct *oldsighand = tsk->sighand; spinlock_t *lock = &oldsighand->siglock; if (thread_group_empty(tsk)) goto no_thread_group; /* * Kill all other threads in the thread group. */ spin_lock_irq(loc...
0
43,435
Analyze the following 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 ExtensionApiTest::RunPlatformAppTestWithFlags( const std::string& extension_name, const char* custom_arg, int flags) { return RunExtensionTestImpl(extension_name, std::string(), custom_arg, flags | kFlagLaunchPlatformApp); } Commit Message: Hide DevTools frontend ...
0
146,583
Analyze the following 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 OfflineLoadPage::GetAppOfflineStrings( const Extension* app, const string16& failed_url, DictionaryValue* strings) const { strings->SetString("title", app->name()); GURL icon_url = app->GetIconURL(Extension::EXTENSION_ICON_LARGE, ExtensionIconSet::MATCH_EXAC...
0
101,507
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: FileReaderLoader::FileReaderLoader(ReadType read_type, FileReaderLoaderClient* client) : read_type_(read_type), client_(client), handle_watcher_(FROM_HERE, mojo::SimpleWatcher::ArmingPolicy::AUTOMATIC), binding_(this) {} Commit Message: Fix use-after-free...
1
173,217
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void mem_cgroup_print_bad_page(struct page *page) { struct page_cgroup *pc; pc = lookup_page_cgroup_used(page); if (pc) { printk(KERN_ALERT "pc:%p pc->flags:%lx pc->mem_cgroup:%p\n", pc, pc->flags, pc->mem_cgroup); } } Commit Message: mm: thp: fix pmd_bad() triggering in code paths holding mmap_s...
0
21,108
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MagickExport ssize_t WriteBlob(Image *image,const size_t length, const void *data) { BlobInfo *magick_restrict blob_info; int c; register const unsigned char *p; register unsigned char *q; ssize_t count; assert(image != (Image *) NULL); assert(image->signature == MagickCor...
0
96,662
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WebWindowFeatures GetWindowFeaturesFromString(const String& feature_string) { WebWindowFeatures window_features; if (feature_string.IsEmpty()) return window_features; window_features.menu_bar_visible = false; window_features.status_bar_visible = false; window_features.tool_bar_visible = false; w...
0
148,218
Analyze the following 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 evm_inode_setxattr(struct dentry *dentry, const char *xattr_name, const void *xattr_value, size_t xattr_value_len) { const struct evm_ima_xattr_data *xattr_data = xattr_value; if (strcmp(xattr_name, XATTR_NAME_EVM) == 0) { if (!xattr_value_len) return -EINVAL; if (xattr_data->type != EVM_IM...
0
55,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 bool detect_write_flooding(struct kvm_mmu_page *sp) { /* * Skip write-flooding detected for the sp whose level is 1, because * it can become unsync, then the guest page is not write-protected. */ if (sp->role.level == PT_PAGE_TABLE_LEVEL) return false; return ++sp->write_flooding_count >= 3; } ...
0
37,407
Analyze the following 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 GLES2DecoderPassthroughImpl::DoGetIntegeri_v(GLenum pname, GLuint index, GLsizei bufsize, GLsizei* length, ...
0
141,997
Analyze the following 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 halt_interception(struct vcpu_svm *svm) { svm->next_rip = kvm_rip_read(&svm->vcpu) + 1; return kvm_emulate_halt(&svm->vcpu); } Commit Message: KVM: svm: unconditionally intercept #DB This is needed to avoid the possibility that the guest triggers an infinite stream of #DB exceptions (CVE-2015-8104)...
0
41,894
Analyze the following 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_over_current_notify(struct usb_port *port_dev) { char *envp[3]; struct device *hub_dev; char *port_dev_path; sysfs_notify(&port_dev->dev.kobj, NULL, "over_current_count"); hub_dev = port_dev->dev.parent; if (!hub_dev) return; port_dev_path = kobject_get_path(&port_dev->dev.kobj, GFP_...
0
75,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: JPEGImageDecoder::JPEGImageDecoder(ImageSource::AlphaOption alphaOption, ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption) : ImageDecoder(alphaOption, gammaAndColorProfileOption) { } Commit Message: Progressive JPEG outputScanlines() calls should handle fa...
0
119,055
Analyze the following 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 ahci_irq_raise(AHCIState *s, AHCIDevice *dev) { AHCIPCIState *d = container_of(s, AHCIPCIState, ahci); PCIDevice *pci_dev = (PCIDevice *)object_dynamic_cast(OBJECT(d), TYPE_PCI_DEVICE); DPRINTF(0, "raise irq\n"); if (pci_dev && msi_enabled(pci_dev)) { msi_notify(pci_d...
0
6,671
Analyze the following 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 ResourceLoaderOptions& ResourceFetcher::defaultResourceOptions() { DEFINE_STATIC_LOCAL(ResourceLoaderOptions, options, (SniffContent, BufferData, AllowStoredCredentials, ClientRequestedCredentials, CheckContentSecurityPolicy, DocumentContext)); return options; } Commit Message: Enforce SVG image se...
0
121,223
Analyze the following 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 set_next_request(void) { struct request_queue *q; int old_pos = fdc_queue; do { q = disks[fdc_queue]->queue; if (++fdc_queue == N_DRIVE) fdc_queue = 0; if (q) { current_req = blk_fetch_request(q); if (current_req) break; } } while (fdc_queue != old_pos); return current_req !...
0
39,436
Analyze the following 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 seqiv_aead_complete(struct crypto_async_request *base, int err) { struct aead_givcrypt_request *req = base->data; seqiv_aead_complete2(req, err); aead_givcrypt_complete(req, err); } Commit Message: crypto: include crypto- module prefix in template This adds the module loading prefix "crypto-" to...
0
45,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: void _addReplyStringToList(client *c, const char *s, size_t len) { robj *tail; if (c->flags & CLIENT_CLOSE_AFTER_REPLY) return; if (listLength(c->reply) == 0) { robj *o = createStringObject(s,len); listAddNodeTail(c->reply,o); c->reply_bytes += getStringObjectSdsUsedMemory(o...
0
69,924
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void fscrypt_destroy(void) { struct fscrypt_ctx *pos, *n; list_for_each_entry_safe(pos, n, &fscrypt_free_ctxs, free_list) kmem_cache_free(fscrypt_ctx_cachep, pos); INIT_LIST_HEAD(&fscrypt_free_ctxs); mempool_destroy(fscrypt_bounce_page_pool); fscrypt_bounce_page_pool = NULL; } Commit Message: fscr...
0
67,635
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: iperf_get_test_role(struct iperf_test *ipt) { return ipt->role; } Commit Message: Fix a buffer overflow / heap corruption issue that could occur if a malformed JSON string was passed on the control channel. This issue, present in the cJSON library, was already fixed upstream, so was addressed here in iperf3...
0
53,390
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PassRefPtr<Attr> Document::createAttributeNS(const String& namespaceURI, const String& qualifiedName, ExceptionState& es, bool shouldIgnoreNamespaceChecks) { String prefix, localName; if (!parseQualifiedName(qualifiedName, prefix, localName, es)) return 0; QualifiedName qName(prefix, localNam...
0
102,651
Analyze the following 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 AutofillPopupViewViews::AddExtraInitParams( views::Widget::InitParams* params) {} Commit Message: [Autofill] Remove AutofillPopupViewViews and associated feature. Bug: 906135,831603 Change-Id: I3c982f8b3ffb4928c7c878e74e10113999106499 Reviewed-on: https://chromium-review.googlesource.com/c/1387124 Revi...
0
130,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: size_t Parcel::ipcObjectsCount() const { return mObjectsSize; } Commit Message: Disregard alleged binder entities beyond parcel bounds When appending one parcel's contents to another, ignore binder objects within the source Parcel that appear to lie beyond the formal bounds of that Parcel's data buffer. Bug 1...
0
157,279
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void OfflinePageModelImpl::GetAllPages( const MultipleOfflinePageItemCallback& callback) { OfflinePageModelQueryBuilder builder; RunWhenLoaded( base::Bind(&OfflinePageModelImpl::GetPagesMatchingQueryWhenLoadDone, weak_ptr_factory_.GetWeakPtr(), base::Passed(builder....
0
155,878
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void ExtensionService::SetIsIncognitoEnabled( const std::string& extension_id, bool enabled) { const Extension* extension = GetInstalledExtension(extension_id); if (extension && extension->location() == Extension::COMPONENT) { NOTREACHED(); return; } bool old_enabled = extension_prefs_->IsInc...
0
98,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: SPL_METHOD(SplFileObject, eof) { spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); if (zend_parse_parameters_none() == FAILURE) { return; } RETURN_BOOL(php_stream_eof(intern->u.file.stream)); } /* }}} */ /* {{{ proto void SplFileObject::valid(...
1
167,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: static void print_version() { fprintf(stderr, PROGRAM_NAME " " PROGRAM_VERSION "\n"); } Commit Message: Merge pull request #20 from eyalitki/master 2nd round security fixes from eyalitki CWE ID: CWE-119
0
50,286
Analyze the following 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 send_error_to_client_(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status) { if(!decoder->private_->is_seeking) decoder->private_->error_callback(decoder, status, decoder->private_->client_data); else if(status == FLAC__STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM) decoder->priv...
0
161,246
Analyze the following 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 struct task_group *css_tg(struct cgroup_subsys_state *css) { return css ? container_of(css, struct task_group, css) : NULL; } Commit Message: Merge branch 'stacking-fixes' (vfs stacking fixes from Jann) Merge filesystem stacking fixes from Jann Horn. * emailed patches from Jann Horn <jannh@googl...
0
55,519
Analyze the following 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 BluetoothAdapterChromeOS::OnStopDiscoveryError( const ErrorCallback& error_callback, const std::string& error_name, const std::string& error_message) { LOG(WARNING) << object_path_.value() << ": Failed to stop discovery: " << error_name << ": " << error_message; error_callback....
0
112,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: static inline void adjust_tsc_offset_host(struct kvm_vcpu *vcpu, s64 adjustment) { if (vcpu->arch.tsc_scaling_ratio != kvm_default_tsc_scaling_ratio) WARN_ON(adjustment < 0); adjustment = kvm_scale_tsc(vcpu, (u64) adjustment); kvm_x86_ops->adjust_tsc_offset_guest(vcpu, adjustment); } Commit Message: KVM: x8...
0
57,667
Analyze the following 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 AttachService() { const void* kKey = TestingDomainReliabilityServiceFactoryUserData::kKey; TestingDomainReliabilityServiceFactoryUserData* data = new TestingDomainReliabilityServiceFactoryUserData(profile_, mock_service_); EXPE...
0
154,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: status_t Parcel::readByteVector(std::vector<uint8_t>* val) const { return readByteVectorInternal(this, val); } Commit Message: Add bound checks to utf16_to_utf8 Bug: 29250543 Change-Id: I518e7b2fe10aaa3f1c1987586a09b1110aff7e1a (cherry picked from commit 7e93b2ddcb49b5365fbe1dab134ffb38e6f1c719) CWE ID: CWE-1...
0
163,566
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ChromeContentBrowserClient::GetInitiatorSchemeBypassingDocumentBlocking() { #if BUILDFLAG(ENABLE_EXTENSIONS) return extensions::kExtensionScheme; #else return nullptr; #endif } Commit Message: Move IsDataSaverEnabledByUser to be a static method and use it This method now officially becomes the source of tru...
0
142,657
Analyze the following 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 oz_complete_urb(struct usb_hcd *hcd, struct urb *urb, int status) { struct oz_hcd *ozhcd = oz_hcd_private(hcd); unsigned long irq_state; struct oz_urb_link *cancel_urbl; spin_lock_irqsave(&g_tasklet_lock, irq_state); usb_hcd_unlink_urb_from_ep(hcd, urb); /* Clear hcpriv which will prevent it ...
0
43,163
Analyze the following 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 GLES2DecoderImpl::DoUniform3fv(GLint fake_location, GLsizei count, const volatile GLfloat* value) { GLenum type = 0; GLint real_location = -1; if (!PrepForSetUniformByLocation(fake_location, "glUn...
0
141,393
Analyze the following 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<gfx::GpuMemoryBuffer> GLManager::CreateGpuMemoryBuffer( const gfx::Size& size, gfx::BufferFormat format) { #if defined(OS_MACOSX) if (use_iosurface_memory_buffers_) { return base::WrapUnique<gfx::GpuMemoryBuffer>( new IOSurfaceGpuMemoryBuffer(size, format)); } #endif // de...
0
150,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: static void handle_new_lsr(struct edgeport_port *edge_port, int lsr_data, __u8 lsr, __u8 data) { struct async_icount *icount; __u8 new_lsr = (__u8)(lsr & (__u8)(LSR_OVER_ERR | LSR_PAR_ERR | LSR_FRM_ERR | LSR_BREAK)); dev_dbg(&edge_port->port->dev, "%s - %02x\n", __func__, new_lsr); edge_port->s...
0
66,098
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GLenum GLES2DecoderImpl::GetBoundDrawFrameBufferInternalFormat() { FramebufferManager::FramebufferInfo* framebuffer = GetFramebufferInfoForTarget(GL_DRAW_FRAMEBUFFER); if (framebuffer != NULL) { return framebuffer->GetColorAttachmentFormat(); } else if (offscreen_target_frame_buffer_.get()) { ...
0
108,997
Analyze the following 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 SyncBackendHost::InitCore(const DoInitializeOptions& options) { sync_thread_.message_loop()->PostTask(FROM_HERE, base::Bind(&SyncBackendHost::Core::DoInitialize, core_.get(), options)); } Commit Message: [Sync] Cleanup all tab sync enabling logic now that its on by default. BUG=none TEST= Review ...
0
104,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 broadcast_packet(const node_t *from, vpn_packet_t *packet) { avl_node_t *node; connection_t *c; node_t *n; if(from != myself) send_packet(myself, packet); if(tunnelserver || broadcast_mode == BMODE_NONE) return; ifdebug(TRAFFIC) logger(LOG_INFO, "Broadcasting packet of %d bytes from %s (%s)", ...
0
33,580
Analyze the following 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 btif_dm_ble_auth_cmpl_evt (tBTA_DM_AUTH_CMPL *p_auth_cmpl) { /* Save link key, if not temporary */ bt_bdaddr_t bd_addr; bt_status_t status = BT_STATUS_FAIL; bt_bond_state_t state = BT_BOND_STATE_NONE; bdcpy(bd_addr.address, p_auth_cmpl->bd_addr); if ( (p_auth_cmpl->success == TRUE) && (p_aut...
0
158,571
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PHP_FUNCTION(stream_filter_remove) { zval *zfilter; php_stream_filter *filter; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zfilter) == FAILURE) { RETURN_FALSE; } filter = zend_fetch_resource(&zfilter TSRMLS_CC, -1, NULL, NULL, 1, php_file_le_stream_filter()); if (!filter) { php_error_do...
0
15,272
Analyze the following 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 UninstallExtension(ExtensionService* service, const std::string& id) { if (service && service->GetInstalledExtension(id)) { service->UninstallExtension(id, extensions::UNINSTALL_REASON_SYNC, base::Bind(&base::DoNothing), ...
1
171,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 inline void ext4_show_quota_options(struct seq_file *seq, struct super_block *sb) { #if defined(CONFIG_QUOTA) struct ext4_sb_info *sbi = EXT4_SB(sb); if (sbi->s_jquota_fmt) { char *fmtname = ""; switch (sbi->s_jquota_fmt) { case QFMT_VFS_OLD: fmtname = "vfsold"; break; case QFMT_V...
0
56,697
Analyze the following 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 RenderFrameDevToolsAgentHost::Close() { if (web_contents()) { web_contents()->ClosePage(); return true; } return false; } Commit Message: [DevTools] Do not allow Page.setDownloadBehavior for extensions Bug: 866426 Change-Id: I71b672978e1a8ec779ede49da16b21198567d3a4 Reviewed-on: https://chrom...
0
143,640
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PaintController::SubsequenceMarkers* PaintController::GetSubsequenceMarkers( const DisplayItemClient& client) { auto result = current_cached_subsequences_.find(&client); if (result == current_cached_subsequences_.end()) return nullptr; return &result->value; } Commit Message: Reland "[CI] Make pain...
0
125,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: select_dh_group(krb5_context context, DH *dh, unsigned long bits, struct krb5_dh_moduli **moduli) { const struct krb5_dh_moduli *m; if (bits == 0) { m = moduli[1]; /* XXX */ if (m == NULL) m = moduli[0]; /* XXX */ } else { int i; for (i = 0; moduli[i] != NULL; i++) { if (bits < moduli...
0
89,979
Analyze the following 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::inheritHtmlAndBodyElementStyles(StyleRecalcChange change) { ASSERT(inStyleRecalc()); ASSERT(documentElement()); bool didRecalcDocumentElement = false; RefPtr<ComputedStyle> documentElementStyle = documentElement()->mutableComputedStyle(); if (change == Force) documentEl...
0
124,409
Analyze the following 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 MSLIsStandalone(void *context) { MSLInfo *msl_info; /* Is this document tagged standalone? */ (void) LogMagickEvent(CoderEvent,GetMagickModule()," SAX.MSLIsStandalone()"); msl_info=(MSLInfo *) context; return(msl_info->document->standalone == 1); } Commit Message: https://github....
0
62,784
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PepperRendererConnection::~PepperRendererConnection() {} Commit Message: Validate in-process plugin instance messages. Bug: 733548, 733549 Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation Change-Id: Ie5572c7bcafa05399b09c44425ddd5ce9b9e4cba Reviewed-on: https://chromium-review.googlesour...
0
135,580
Analyze the following 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 __follow_mount(struct path *path) { int res = 0; while (d_mountpoint(path->dentry)) { struct vfsmount *mounted = lookup_mnt(path); if (!mounted) break; dput(path->dentry); if (res) mntput(path->mnt); path->mnt = mounted; path->dentry = dget(mounted->mnt_root); res = 1; } return ...
0
39,662
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: append_text_move(pdf_text_state_t *pts, double dw) { int count = pts->buffer.count_moves; int pos = pts->buffer.count_chars; double rounded; if (count > 0 && pts->buffer.moves[count - 1].index == pos) { /* Merge adjacent moves. */ dw += pts->buffer.moves[--count].amount; } ...
0
7,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: void power_pmu_start_txn(struct pmu *pmu) { struct cpu_hw_events *cpuhw = &__get_cpu_var(cpu_hw_events); perf_pmu_disable(pmu); cpuhw->group_flag |= PERF_EVENT_TXN; cpuhw->n_txn_start = cpuhw->n_events; } Commit Message: perf, powerpc: Handle events that raise an exception without overflowing Events on POW...
0
22,704
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xfs_ioc_getxflags( xfs_inode_t *ip, void __user *arg) { unsigned int flags; flags = xfs_di2lxflags(ip->i_d.di_flags); if (copy_to_user(arg, &flags, sizeof(flags))) return -EFAULT; return 0; } Commit Message: fs,userns: Change inode_capable to capable_wrt_inode_uidgid The kernel has no concept of ca...
0
36,922
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: long long Chapters::Atom::GetStopTime(const Chapters* pChapters) const { return GetTime(pChapters, m_stop_timecode); } Commit Message: external/libvpx/libwebm: Update snapshot Update libwebm snapshot. This update contains security fixes from upstream. Upstream git hash: 229f49347d19b0ca0941e072b199a242ef6c5f2...
0
160,799
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gs_dc_get_pattern_id(const gx_device_color *pdevc) { if (!(gx_dc_is_pattern1_color(pdevc))) return gs_no_id; if (pdevc->colors.pattern.p_tile == NULL) return gs_no_id; return pdevc->colors.pattern.p_tile->id; } Commit Message: CWE ID: CWE-704
0
1,655
Analyze the following 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 SyncBackendHost::HandleConnectionStatusChangeOnFrontendLoop( sync_api::ConnectionStatus status) { if (!frontend_) return; DCHECK_EQ(MessageLoop::current(), frontend_loop_); frontend_->OnConnectionStatusChange(status); } Commit Message: [Sync] Cleanup all tab sync enabling logic now that its ...
0
104,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: ExtensionFunction::ResponseAction TabsHighlightFunction::Run() { std::unique_ptr<tabs::Highlight::Params> params( tabs::Highlight::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); int window_id = extension_misc::kCurrentWindowId; if (params->highlight_info.window_id.get()) wi...
0
151,523
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int sctp_connect(struct sock *sk, struct sockaddr *addr, int addr_len) { int err = 0; struct sctp_af *af; lock_sock(sk); pr_debug("%s: sk:%p, sockaddr:%p, addr_len:%d\n", __func__, sk, addr, addr_len); /* Validate addr_len before calling common connect/connectx routine. */ af = sctp_get_af_s...
0
43,522