instruction
stringclasses
1 value
input
stringlengths
64
129k
output
int64
0
1
__index_level_0__
int64
0
30k
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void GLES2DecoderImpl::WaitForReadPixels(base::OnceClosure callback) { if (features().use_async_readpixels && !pending_readpixel_fences_.empty()) { pending_readpixel_fences_.back().callbacks.push_back(std::move(callback)); } else { std::move(callback).Run(); } } Commit Message: Add GL_PROGRAM_COMPL...
0
21,146
Analyze the following 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 boundaryTextRemoved(RangeBoundaryPoint& boundary, Node* text, unsigned offset, unsigned length) { if (boundary.container() != text) return; unsigned boundaryOffset = boundary.offset(); if (offset >= boundaryOffset) return; if (offset + length >= boundaryOffset) ...
0
13,743
Analyze the following 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 NormalPageArena::takeFreelistSnapshot(const String& dumpName) { if (m_freeList.takeSnapshot(dumpName)) { base::trace_event::MemoryAllocatorDump* bucketsDump = BlinkGCMemoryDumpProvider::instance() ->createMemoryAllocatorDumpForCurrentGC(dumpName + "/buckets"); base::trace_event:...
0
3,730
Analyze the following 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 __send_write_same(struct clone_info *ci) { return __send_changing_extent_only(ci, get_num_write_same_bios, NULL); } Commit Message: dm: fix race between dm_get_from_kobject() and __dm_destroy() The following BUG_ON was hit when testing repeat creation and removal of DM devices: kernel BUG at dr...
0
10,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: BitStack::~BitStack() { } Commit Message: Upgrade a TextIterator ASSERT to a RELEASE_ASSERT as a defensive measure. BUG=156930,177197 R=inferno@chromium.org Review URL: https://codereview.chromium.org/15057010 git-svn-id: svn://svn.chromium.org/blink/trunk@150123 bbb929c8-8fbe-4397-9dbb-9b2b20218538 CWE ID: C...
0
7,918
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xmlStringDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int what, xmlChar end, xmlChar end2, xmlChar end3) { if ((ctxt == NULL) || (str == NULL)) return(NULL); return(xmlStringLenDecodeEntities(ctxt, str, xmlStrlen(str), what, end, end2, end3)); } Commit Message: DO NOT MERGE: ...
0
5,036
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void RenderBlock::willBeDestroyed() { m_beingDestroyed = true; children()->destroyLeftoverChildren(); RenderBoxModelObject* continuation = this->continuation(); if (continuation) { continuation->destroy(); setContinuation(0); } if (!documentBeingDestroyed()) { if...
0
2,844
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: status_t Parcel::writeFileDescriptor(int fd, bool takeOwnership) { flat_binder_object obj; obj.type = BINDER_TYPE_FD; obj.flags = 0x7f | FLAT_BINDER_FLAG_ACCEPTS_FDS; obj.binder = 0; /* Don't pass uninitialized stack data to a remote process */ obj.handle = fd; obj.cookie = takeOwnership ?...
0
27,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: std_conv_pixmap(fz_context *ctx, fz_pixmap *dst, fz_pixmap *src, fz_colorspace *prf, const fz_default_colorspaces *default_cs, const fz_color_params *color_params, int copy_spots) { float srcv[FZ_MAX_COLORS]; float dstv[FZ_MAX_COLORS]; int srcn, dstn; int k, i; size_t w = src->w; int h = src->h; ptrdiff_t ...
0
7,871
Analyze the following 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_getassociationid(u64 connectionid) { return connectionid & ~NVMET_FC_QUEUEID_MASK; } Commit Message: nvmet-fc: ensure target queue id within range. When searching for queue id's ensure they are within the expected range. Signed-off-by: James Smart <james.smart@broadcom.com> Signed-off-by: Christoph H...
0
12,303
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: find_check_match(struct xt_entry_match *m, struct xt_mtchk_param *par) { struct xt_match *match; int ret; match = xt_request_find_match(NFPROTO_IPV6, m->u.user.name, m->u.user.revision); if (IS_ERR(match)) { duprintf("find_check_match: `%s' not found\n", m->u.user.name); return PTR_ERR(match); ...
0
20,821
Analyze the following 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 FindAndTestFilePath(const FilePath& file_path) { GDataEntry* entry = FindEntry(file_path); ASSERT_TRUE(entry) << "Entry can't be found " << file_path.value(); EXPECT_EQ(entry->GetFilePath(), file_path); } Commit Message: gdata: Define the resource ID for the root directory Per the spec, the...
0
28,581
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void virtio_config_writeb(VirtIODevice *vdev, uint32_t addr, uint32_t data) { VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev); uint8_t val = data; if (addr + sizeof(val) > vdev->config_len) { return; } stb_p(vdev->config + addr, val); if (k->set_config) { k->set_con...
0
25,828
Analyze the following 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 AutofillDialogViews::SuggestionView::UpdateLabelText() { int unused; SetLabelText(CanUseVerticallyCompactText(width(), &unused) ? state_.vertically_compact_text : state_.horizontally_compact_text); } Commit Message: Clear out some minor TODOs. BUG=none Review URL: https://codereview.chromi...
0
15,020
Analyze the following 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 cuse_class_waiting_show(struct device *dev, struct device_attribute *attr, char *buf) { struct cuse_conn *cc = dev_get_drvdata(dev); return sprintf(buf, "%d\n", atomic_read(&cc->fc.num_waiting)); } Commit Message: cuse: fix memory leak The problem is that fuse_dev_alloc() acquires a...
0
8,930
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: person_get_frame_delay(const person_t* person) { return person->anim_frames; } Commit Message: Fix integer overflow in layer_resize in map_engine.c (#268) * Fix integer overflow in layer_resize in map_engine.c There's a buffer overflow bug in the function layer_resize. It allocates a buffer `tilemap` with ...
0
11,987
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void UniqueElementData::addAttribute(const QualifiedName& attributeName, const AtomicString& value) { m_attributeVector.append(Attribute(attributeName, value)); } Commit Message: Set Attr.ownerDocument in Element#setAttributeNode() Attr objects can move across documents by setAttributeNode(). So It needs to...
0
19,189
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: try_resource_fork (SF_PRIVATE * psf) { int old_error = psf->error ; /* Set READ mode now, to see if resource fork exists. */ psf->rsrc.mode = SFM_READ ; if (psf_open_rsrc (psf) != 0) { psf->error = old_error ; return 0 ; } ; /* More checking here. */ psf_log_printf (psf, "Resource fork : %s\n", psf->r...
0
17,187
Analyze the following 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 WebContentsImpl::OnMessageReceived(RenderViewHost* render_view_host, const IPC::Message& message) { if (GetWebUI() && static_cast<WebUIImpl*>(GetWebUI())->OnMessageReceived(message)) { return true; } ObserverListBase<WebContentsObserver>::Iterator it(o...
0
11,154
Analyze the following 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 preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, int is_callable_replace, int is_filter) { zval **regex, **replace, **subject, **subject_entry, **zcount = NULL; char *result; int result_len; int limit_val = -1; long limit = -1; char *string_key; ulon...
0
20,600
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: COMPAT_SYSCALL_DEFINE5(get_mempolicy, int __user *, policy, compat_ulong_t __user *, nmask, compat_ulong_t, maxnode, compat_ulong_t, addr, compat_ulong_t, flags) { long err; unsigned long __user *nm = NULL; unsigned long nr_bits, alloc_size; DECLARE_BITMAP(bm, MAX_NUMNODES); nr_bi...
0
11,037
Analyze the following 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 QuicClientPromisedInfo::OnPromiseHeaders(const SpdyHeaderBlock& headers) { SpdyHeaderBlock::const_iterator it = headers.find(kHttp2MethodHeader); DCHECK(it != headers.end()); if (!(it->second == "GET" || it->second == "HEAD")) { QUIC_DVLOG(1) << "Promise for stream " << id_ << " has invalid meth...
1
10,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: static void usb_xhci_realize(struct PCIDevice *dev, Error **errp) { int i, ret; Error *err = NULL; XHCIState *xhci = XHCI(dev); dev->config[PCI_CLASS_PROG] = 0x30; /* xHCI */ dev->config[PCI_INTERRUPT_PIN] = 0x01; /* interrupt pin 1 */ dev->config[PCI_CACHE_LINE_SIZE] = 0x10; dev-...
0
4,342
Analyze the following 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 addrconf_sysctl_proxy_ndp(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { int *valp = ctl->data; int ret; int old, new; old = *valp; ret = proc_dointvec(ctl, write, buffer, lenp, ppos); new = *valp; if (write && old != new) { struct net *net = ctl->extr...
0
1,955
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: mon_winresize(int nsig) { static int not_done; int lines = 0, cols = 0; if (!not_done++) { if (ncurses_winch_handler) /* the original ncurses WINCH signal handler does the * magic of retrieving the new window size; * otherwise, we'd have to use ioctl or t...
0
28,790
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: set_file_identifier(unsigned char *bp, int from, int to, enum vdc vdc, struct archive_write *a, struct vdd *vdd, struct archive_string *id, const char *label, int leading_under, enum char_type char_type) { char identifier[256]; struct isoent *isoent; const char *ids; size_t len; int r; if (id->leng...
0
14,605
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int chmd_sys_write(struct mspack_file *file, void *buffer, int bytes) { struct mschm_decompressor_p *self = (struct mschm_decompressor_p *) file; self->d->offset += bytes; if (self->d->outfh) { return self->system->write(self->d->outfh, buffer, bytes); } return bytes; } Commit Message: Avoid...
0
20,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: static PHP_GINIT_FUNCTION(xml) { xml_globals->default_encoding = "UTF-8"; } Commit Message: CWE ID: CWE-119
0
14,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 void auth_exit_ev(const void *event_data, void *user_data) { /* Close the scoreboard descriptor that we opened. */ (void) pr_close_scoreboard(FALSE); } Commit Message: Backporting recursive handling of DefaultRoot path, when AllowChrootSymlinks is off, to 1.3.5 branch. CWE ID: CWE-59
0
20,577
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: rend_service_validate_intro_late(const rend_intro_cell_t *intro, char **err_msg_out) { int status = 0; if (!intro) { if (err_msg_out) *err_msg_out = tor_strdup("NULL intro cell passed to " "rend_service_validate_intro_late()"); status...
0
19,721
Analyze the following 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 TabStripGtk::Init() { model_->AddObserver(this); tabstrip_.Own(gtk_fixed_new()); ViewIDUtil::SetID(tabstrip_.get(), VIEW_ID_TAB_STRIP); gtk_widget_set_size_request(tabstrip_.get(), 0, TabGtk::GetMinimumUnselectedSize().height()); gtk_widget_set_app_paintable(tabstrip_...
0
17,911
Analyze the following 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 SVGStyleElement::ChildrenChanged(const ChildrenChange& change) { SVGElement::ChildrenChanged(change); if (StyleElement::ChildrenChanged(*this) == StyleElement::kProcessingFatalError) NotifyLoadedSheetAndAllCriticalSubresources( kErrorOccurredLoadingSubresource); } Commit Message: Do no...
0
24,280
Analyze the following 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 _yr_re_fiber_kill_tail( RE_FIBER_LIST* fiber_list, RE_FIBER_POOL* fiber_pool, RE_FIBER* fiber) { RE_FIBER* prev_fiber = fiber->prev; if (prev_fiber != NULL) prev_fiber->next = NULL; fiber->prev = fiber_pool->fibers.tail; if (fiber_pool->fibers.tail != NULL) fiber_pool->fibers.tail->n...
0
8,168
Analyze the following 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 nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred) { nfs4_verifier verifier; struct nfs41_exchange_id_args args = { .verifier = &verifier, .client = clp, .flags = EXCHGID4_FLAG_SUPP_MOVED_REFER, }; struct nfs41_exchange_id_res res = { 0 }; int status; struct rpc_message msg = ...
0
26,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: void PaintLayerScrollableArea::ScrollbarManager::Dispose() { h_bar_is_attached_ = v_bar_is_attached_ = 0; DestroyScrollbar(kHorizontalScrollbar); DestroyScrollbar(kVerticalScrollbar); } Commit Message: Always call UpdateCompositedScrollOffset, not just for the root layer Bug: 927560 Change-Id: I1d5522aae4...
0
17,386
Analyze the following 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 ShutDown() { BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)->PostTask( FROM_HERE, base::Bind(&InProcessServiceManagerContext::ShutDownOnIOThread, this)); } Commit Message: media: Support hosting mojo CDM in a standalone service Currently when mojo CDM is enabled it is host...
0
18,129
Analyze the following 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 pmcraid_eh_bus_reset_handler(struct scsi_cmnd *scmd) { scmd_printk(KERN_INFO, scmd, "Doing bus reset due to an I/O command timeout.\n"); return pmcraid_reset_device(scmd, PMCRAID_RESET_BUS_TIMEOUT, RESET_DEVICE_BUS); } Commit Message: [SCSI] pmcraid: reject negative request siz...
0
9,342
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: RenderThreadImpl::GetCompositorImplThreadTaskRunner() { return compositor_task_runner_; } Commit Message: Roll src/third_party/boringssl/src 664e99a64..696c13bd6 https://boringssl.googlesource.com/boringssl/+log/664e99a6486c293728097c661332f92bf2d847c6..696c13bd6ab78011adfe7b775519c8b7cc82b604 BUG=778101 Ch...
0
23,280
Analyze the following 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 FileSystemManagerImpl::ReadMetadata(const GURL& path, ReadMetadataCallback callback) { DCHECK_CURRENTLY_ON(BrowserThread::IO); FileSystemURL url(context_->CrackURL(path)); base::Optional<base::File::Error> opt_error = ValidateFileSystemURL(url); if (opt_error)...
0
28,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: void BluetoothDeviceChromeOS::OnUnregisterAgentError( const std::string& error_name, const std::string& error_message) { LOG(WARNING) << object_path_.value() << ": Failed to unregister agent: " << error_name << ": " << error_message; } Commit Message: Refactor to support default Bluetoot...
1
21,968
Analyze the following 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 PasswordAutofillAgent::FrameCanAccessPasswordManager() { WebLocalFrame* frame = render_frame()->GetWebFrame(); blink::WebURL url = frame->GetDocument().Url(); if (!url.ProtocolIs(url::kHttpScheme) && !url.ProtocolIs(url::kHttpsScheme)) return false; return frame->GetSecurityOrigin().CanAccessPass...
0
21,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: Editor::Command::Command(const EditorInternalCommand* command, EditorCommandSource source, LocalFrame* frame) : command_(command), source_(source), frame_(command ? frame : nullptr) { if (!command) DCHECK(!frame_); else DCHECK(frame_); } Commit Me...
0
5,970
Analyze the following 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 nohz_balance_exit_idle(struct rq *rq) { SCHED_WARN_ON(rq != this_rq()); if (likely(!rq->nohz_tick_stopped)) return; rq->nohz_tick_stopped = 0; cpumask_clear_cpu(rq->cpu, nohz.idle_cpus_mask); atomic_dec(&nohz.nr_cpus); set_cpu_sd_state_busy(rq->cpu); } Commit Message: sched/fair: Fix infinite loo...
0
7,166
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: struct sk_buff *skb_clone(struct sk_buff *skb, gfp_t gfp_mask) { struct sk_buff *n; if (skb_orphan_frags(skb, gfp_mask)) return NULL; n = skb + 1; if (skb->fclone == SKB_FCLONE_ORIG && n->fclone == SKB_FCLONE_UNAVAILABLE) { atomic_t *fclone_ref = (atomic_t *) (n + 1); n->fclone = SKB_FCLONE_CLONE...
0
18,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 int entersafe_pin_cmd(sc_card_t *card, struct sc_pin_cmd_data *data, int *tries_left) { int r; SC_FUNC_CALLED(card->ctx, SC_LOG_DEBUG_VERBOSE); entersafe_init_pin_info(&data->pin1,0); entersafe_init_pin_info(&data->pin2,1); data->flags |= SC_PIN_CMD_NEED_PADDING; if(data->cmd!=SC_PIN_CMD...
0
682
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: XML_SetElementHandler(XML_Parser parser, XML_StartElementHandler start, XML_EndElementHandler end) { if (parser == NULL) return; parser->m_startElementHandler = start; parser->m_endElementHandler = end; } Commit Message: xmlparse.c: Deny internal entities closing the doctype CWE I...
0
16,294
Analyze the following 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 * CLASS foveon_camf_matrix (unsigned dim[3], const char *name) { unsigned i, idx, type, ndim, size, *mat; char *pos, *cp, *dp; double dsize; for (idx=0; idx < meta_length; idx += sget4(pos+8)) { pos = meta_data + idx; if (strncmp (pos, "CMb", 3)) break; if (pos[3] != 'M') continue; i...
0
12,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: struct thread_q *tq_new(void) { struct thread_q *tq; tq = (struct thread_q *)calloc(1, sizeof(*tq)); if (!tq) return NULL; INIT_LIST_HEAD(&tq->q); pthread_mutex_init(&tq->mutex, NULL); pthread_cond_init(&tq->cond, NULL); return tq; } Commit Message: stratum: parse_notify(): Don't die on malformed bbv...
0
26,820
Analyze the following 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 CredentialManagerImpl::DoneRequiringUserMediation() { DCHECK(pending_require_user_mediation_); pending_require_user_mediation_.reset(); } Commit Message: Fix Credential Management API Store() for existing Credentials This changes fixes the Credential Management API to correctly handle storing of alread...
0
11,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: static int decode_remove(struct xdr_stream *xdr, struct nfs4_change_info *cinfo) { int status; status = decode_op_hdr(xdr, OP_REMOVE); if (status) goto out; status = decode_change_info(xdr, cinfo); out: return status; } Commit Message: NFSv4: Convert the open and close ops to use fmode Signed-off-by: Tr...
0
2,187
Analyze the following 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_invalidate_range_start(struct mmu_notifier *mn, struct mm_struct *mm, unsigned long start, unsigned long end) { struct kvm *kvm = mmu_notifier_to_kvm(mn); int need_tlb_flush = 0, idx; idx = srcu_read_lock(&kvm->srcu); spin_lock(&kvm->mmu_lock); /* ...
0
23,142
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: image_transform_ini_end(PNG_CONST image_transform *this, transform_display *that) { UNUSED(this) UNUSED(that) } Commit Message: DO NOT MERGE Update libpng to 1.6.20 BUG:23265085 Change-Id: I85199805636d771f3597b691b63bc0bf46084833 (cherry picked from commit bbe98b40cda082024b669fa508931042eed18f82...
1
19,765
Analyze the following 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 bpf_map_is_cgroup_storage(struct bpf_map *map) { return (map->map_type == BPF_MAP_TYPE_CGROUP_STORAGE || map->map_type == BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE); } Commit Message: bpf: fix sanitation of alu op with pointer / scalar type from different paths While 979d63d50c0c ("bpf: prevent out of b...
0
24,357
Analyze the following 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 ApplyPSDOpacityMask(Image *image,const Image *mask, Quantum background,MagickBooleanType revert,ExceptionInfo *exception) { Image *complete_mask; MagickBooleanType status; MagickPixelPacket color; ssize_t y; if (image->debug != MagickFalse) (void) LogMa...
0
15,632
Analyze the following 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 ASessionDescription::setTo(const void *data, size_t size) { mIsValid = parse(data, size); if (!mIsValid) { mTracks.clear(); mFormats.clear(); } return mIsValid; } Commit Message: Fix corruption via buffer overflow in mediaserver change unbound sprintf() to snprintf() so network-pro...
0
5,552
Analyze the following 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::LoseContextImpl( WebGLRenderingContextBase::LostContextMode mode, AutoRecoveryMethod auto_recovery_method) { if (isContextLost()) return; context_lost_mode_ = mode; DCHECK_NE(context_lost_mode_, kNotLostContext); auto_recovery_method_ = auto_recovery_method; ...
0
2,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: void BlockPainter::PaintAllChildPhasesAtomically( const LayoutBox& child, const PaintInfo& paint_info, const LayoutPoint& paint_offset) { LayoutPoint child_point = layout_block_.FlipForWritingModeForChildForPaint(&child, paint_offset); if (!child.HasSelfPaintingLayer() && !child.IsFloating()...
0
5,983
Analyze the following 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 StyleSheetContents* parseUASheet(const String& str) { StyleSheetContents* sheet = StyleSheetContents::create(CSSParserContext(UASheetMode)).leakRef(); // leak the sheet on purpose sheet->parseString(str); return sheet; } Commit Message: Remove the Simple Default Stylesheet, it's just a foot-gu...
0
5,987
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void NavigationControllerImpl::InsertEntriesFrom( const NavigationControllerImpl& source, int max_index) { DCHECK_LE(max_index, source.GetEntryCount()); size_t insert_index = 0; for (int i = 0; i < max_index; i++) { if (source.entries_[i]->GetPageType() != PAGE_TYPE_INTERSTITIAL) { entries...
0
6,707
Analyze the following 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 PasswordAutofillAgent::DidFinishLoad() { SendPasswordForms(true); } Commit Message: [Android][TouchToFill] Use FindPasswordInfoForElement for triggering Use for TouchToFill the same triggering logic that is used for regular suggestions. Bug: 1010233 Change-Id: I111d4eac4ce94dd94b86097b6b6c98e08875e11a R...
0
7,528
Analyze the following 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 ExtensionRegistry::SetDisabledModificationCallback( const ExtensionSet::ModificationCallback& callback) { disabled_extensions_.set_modification_callback(callback); } Commit Message: [Extensions] Add GetInstalledExtension() method to ExtensionRegistry This CL adds GetInstalledExtension() method to Ext...
0
6,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: void VideoCaptureManager::ConnectClient( media::VideoCaptureSessionId session_id, const media::VideoCaptureParams& params, VideoCaptureControllerID client_id, VideoCaptureControllerEventHandler* client_handler, const DoneCB& done_cb) { DCHECK_CURRENTLY_ON(BrowserThread::IO); { std::ost...
0
26,816
Analyze the following 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 RenderFrameHostImpl::SwapOut( RenderFrameProxyHost* proxy, bool is_loading) { TRACE_EVENT_ASYNC_BEGIN0("navigation", "RenderFrameHostImpl::SwapOut", this); if (!is_active()) { NOTREACHED() << "RFH should be in default state when calling SwapOut."; return; } if (swapout_event_monitor...
0
15,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 void bta_av_accept_signalling_timer_cback(void* data) { uint32_t inx = PTR_TO_UINT(data); tBTA_AV_CB* p_cb = &bta_av_cb; tBTA_AV_SCB* p_scb = NULL; if (inx < BTA_AV_NUM_STRS) { p_scb = p_cb->p_scb[inx]; } if (p_scb) { APPL_TRACE_DEBUG("%s: coll_mask = 0x%02X", __func__, p_scb->coll_mask); ...
0
9,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: bool WebContentsImpl::IsHidden() { return capturer_count_ == 0 && !should_normally_be_visible_; } 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/ch...
0
26,471
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void StyledMarkupAccumulator::wrapWithNode(Node* node, bool convertBlocksToInlines, RangeFullySelectsNode rangeFullySelectsNode) { StringBuilder markup; if (node->isElementNode()) appendElement(markup, static_cast<Element*>(node), convertBlocksToInlines && isBlock(const_cast<Node*>(node)), rangeFu...
0
20,176
Analyze the following 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 PermissionsData::SetPermissions( std::unique_ptr<const PermissionSet> active, std::unique_ptr<const PermissionSet> withheld) const { AutoLockOnValidThread lock(runtime_lock_, thread_checker_.get()); active_permissions_unsafe_ = std::move(active); withheld_permissions_unsafe_ = std::move(withhel...
0
5,760
Analyze the following 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 __printf(2,3) void svc_printk(struct svc_rqst *rqstp, const char *fmt, ...) {} 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 bunch of miscellaneous bugfixes" * tag 'nfsd-4.12' of git://linu...
0
23,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: Browser* BrowserInit::LaunchWithProfile::ProcessSpecifiedURLs( const std::vector<GURL>& urls_to_open) { SessionStartupPref pref = GetSessionStartupPref(command_line_, profile_); std::vector<Tab> tabs; if (!IncognitoModePrefs::ShouldLaunchIncognito(command_line_, ...
0
2,054
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: qboolean FS_ConditionalRestart(int checksumFeed, qboolean disconnect) { if(fs_gamedirvar->modified) { if(FS_FilenameCompare(lastValidGame, fs_gamedirvar->string) && (*lastValidGame || FS_FilenameCompare(fs_gamedirvar->string, com_basegame->string)) && (*fs_gamedirvar->string || FS_FilenameCompare(last...
0
1,454
Analyze the following 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::SetTabContentBlocked(TabContents* contents, bool blocked) { int index = tabstrip_model()->GetWrapperIndex(contents); if (index == TabStripModel::kNoTab) { NOTREACHED(); return; } tabstrip_model()->SetTabBlocked(index, blocked); } Commit Message: Implement a bubble that appears at th...
0
12,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: static int dw2102_rc_query(struct dvb_usb_device *d) { u8 key[2]; struct i2c_msg msg = { .addr = DW2102_RC_QUERY, .flags = I2C_M_RD, .buf = key, .len = 2 }; if (d->props.i2c_algo->master_xfer(&d->i2c_adap, &msg, 1) == 1) { if (msg.buf[0] != 0xff) { deb_rc("%s: rc code: %x, %x\n", __func__, ...
0
2,975
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void RenderProcessHostImpl::DecrementSharedWorkerRefCount() { DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK(!is_worker_ref_count_disabled_); DCHECK_GT(GetWorkerRefCount(), 0U); --shared_worker_ref_count_; if (GetWorkerRefCount() == 0) Cleanup(); } Commit Message: Switching AudioOutputAuthorization...
0
7,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: ExtensionFunction::ResponseAction UsbRequestAccessFunction::Run() { scoped_ptr<extensions::core_api::usb::RequestAccess::Params> parameters = RequestAccess::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(parameters.get()); return RespondNow(OneArgument(new base::FundamentalValue(true))); } Commi...
0
17,856
Analyze the following 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 SSL_CTX_set_next_protos_advertised_cb(SSL_CTX *ctx, int (*cb) (SSL *ssl, const unsigned char **out, unsigned int *outlen, void *arg), void *arg) { ctx->next_protos_advertised_cb = cb; ctx->next_protos_advertised_cb_arg = arg; } Commit Message: CWE ID:
0
12,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: void destroy_tap_read_thread(void) { if (pan_pth >= 0) { btsock_thread_exit(pan_pth); pan_pth = -1; } } Commit Message: DO NOT MERGE Fix potential DoS caused by delivering signal to BT process Bug: 28885210 Change-Id: I63866d894bfca47464d6e42e3fb0357c4f94d360 Conflicts: btif/co/bta_hh_co.c...
0
22,270
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Document& FrameSelection::GetDocument() const { DCHECK(LifecycleContext()); return *LifecycleContext(); } Commit Message: MacViews: Enable secure text input for password Textfields. In Cocoa the NSTextInputContext automatically enables secure text input when activated and it's in the secure text entry mode....
0
24,325
Analyze the following 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 sc_asn1_write_element(sc_context_t *ctx, unsigned int tag, const u8 * data, size_t datalen, u8 ** out, size_t * outlen) { return asn1_write_element(ctx, tag, data, datalen, out, outlen); } Commit Message: fixed out of bounds reads Thanks to Eric Sesterhenn from X41 D-SEC GmbH for reporting and suggesting ...
0
27,270
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gx_dc_pattern_write( const gx_device_color * pdevc, const gx_device_color_saved * psdc, const gx_device * dev, int64_t offset, byte * data, uint * psize ) { gx_color_tile *ptile = pdevc->c...
0
21,740
Analyze the following 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 LaunchTestingApp(const std::string& extension_dirname) { base::FilePath data_dir; ASSERT_TRUE(PathService::Get(chrome::DIR_GEN_TEST_DATA, &data_dir)); base::FilePath app_dir = data_dir.AppendASCII("ppapi") .AppendASCII("tests") ...
0
22,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: PHP_FUNCTION(openssl_seal) { zval *pubkeys, *pubkey, *sealdata, *ekeys, *iv = NULL; HashTable *pubkeysht; EVP_PKEY **pkeys; zend_resource ** key_resources; /* so we know what to cleanup */ int i, len1, len2, *eksl, nkeys, iv_len; unsigned char iv_buf[EVP_MAX_IV_LENGTH + 1], *buf = NULL, **eks; char * data;...
1
7,668
Analyze the following 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 char *CompositeOperatorToPSDBlendMode(CompositeOperator op) { const char *blend_mode; switch (op) { case ColorBurnCompositeOp: blend_mode = "idiv"; break; case ColorDodgeCompositeOp: blend_mode = "div "; break; case ColorizeCompositeOp: blend_mode = "colr"; break; cas...
0
12,967
Analyze the following 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 SyncWithAudioThread() { base::RunLoop().RunUntilIdle(); base::RunLoop run_loop; audio_manager_->GetTaskRunner()->PostTask( FROM_HERE, media::BindToCurrentLoop(run_loop.QuitClosure())); run_loop.Run(); } Commit Message: Switching AudioOutputAuthorizationHandler from using AudioMa...
0
199
Analyze the following 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 proto_unregister(struct proto *prot) { mutex_lock(&proto_list_mutex); release_proto_idx(prot); list_del(&prot->node); mutex_unlock(&proto_list_mutex); kmem_cache_destroy(prot->slab); prot->slab = NULL; req_prot_cleanup(prot->rsk_prot); if (prot->twsk_prot != NULL && prot->twsk_prot->twsk_slab != N...
0
4,683
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static struct o2nm_cluster *to_o2nm_cluster(struct config_item *item) { return item ? container_of(to_config_group(item), struct o2nm_cluster, cl_group) : NULL; } Commit Message: ocfs2: subsystem.su_mutex is required while accessing the item->ci_parent The subsystem.su_mutex is required while acces...
0
16,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 bool ExecuteMovePageDown(LocalFrame& frame, Event*, EditorCommandSource, const String&) { unsigned distance = VerticalScrollDistance(frame); if (!distance) return false; return ModifySelectionyWithPage...
0
12,782
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Response IOHandler::Close(const std::string& handle) { return io_context_->Close(handle) ? Response::OK() : Response::InvalidParams("Invalid stream handle"); } Commit Message: DevTools: speculative fix for crash in NetworkHandler::Disable This keeps BrowserContext* and StoragePartition* instead of Rende...
0
28,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: gpu::gles2::GLES2Util* GLES2DecoderPassthroughImpl::GetGLES2Util() { return nullptr; } Commit Message: Add GL_PROGRAM_COMPLETION_QUERY_CHROMIUM This makes the query of GL_COMPLETION_STATUS_KHR to programs much cheaper by minimizing the round-trip to the GPU thread. Bug: 881152, 957001 Change-Id: Iadfa798af29...
0
29,787
Analyze the following 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_help(void) { printf(_("Usage: %s [OPTION]...\n"), program_name); puts(_("psensor-server is an HTTP server for monitoring hardware " "sensors remotely.")); puts(""); puts("Options:"); puts(_(" -h, --help display this help and exit\n" " -v, --version display version info...
0
22,458
Analyze the following 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::readStrongBinder(sp<IBinder>* val) const { return unflatten_binder(ProcessState::self(), *this, val); } Commit Message: Add bound checks to utf16_to_utf8 Bug: 29250543 Change-Id: I518e7b2fe10aaa3f1c1987586a09b1110aff7e1a (cherry picked from commit 7e93b2ddcb49b5365fbe1dab134ffb38e6f1c719) CWE...
0
14,949
Analyze the following 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 PDFiumEngine::Form_GotoPage(IPDF_JSPLATFORM* param, int page_number) { PDFiumEngine* engine = static_cast<PDFiumEngine*>(param); engine->ScrollToPage(page_number); } Commit Message: [pdf] Defer page unloading in JS callback. One of the callbacks from PDFium JavaScript i...
0
13,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: int ff_h264_alloc_tables(H264Context *h) { const int big_mb_num = h->mb_stride * (h->mb_height + 1); const int row_mb_num = 2*h->mb_stride*FFMAX(h->avctx->thread_count, 1); int x, y, i; FF_ALLOCZ_OR_GOTO(h->avctx, h->intra4x4_pred_mode, row_mb_num * 8 * sizeof(uint8_t), fail...
0
28,500
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int mxf_read_close(AVFormatContext *s) { MXFContext *mxf = s->priv_data; int i; av_freep(&mxf->packages_refs); av_freep(&mxf->essence_container_data_refs); for (i = 0; i < s->nb_streams; i++) s->streams[i]->priv_data = NULL; for (i = 0; i < mxf->metadata_sets_count; i++) ...
0
3,815
Analyze the following 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 P2PSocketDispatcherHost::DoGetNetworkList(int routing_id) { net::NetworkInterfaceList list; net::GetNetworkList(&list); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, NewRunnableMethod( this, &P2PSocketDispatcherHost::SendNetworkList, routing_id, list)); } Commit Message: Fixin...
0
3,062
Analyze the following 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 H264SwDecTrace(char *string) { FILE *fp; fp = fopen("dec_api.trc", "at"); if (!fp) return; fwrite(string, 1, strlen(string), fp); fwrite("\n", 1,1, fp); fclose(fp); } Commit Message: h264dec: check for overflows when calculating allocation size. Bug: 27855419 Change-Id: Idabedca52913...
0
17,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: static int megasas_task_abort(struct scsi_cmnd *scmd) { int ret; struct megasas_instance *instance; instance = (struct megasas_instance *)scmd->device->host->hostdata; if (instance->adapter_type != MFI_SERIES) ret = megasas_task_abort_fusion(scmd); else { sdev_printk(KERN_NOTICE, scmd->device, "TASK AB...
0
865
Analyze the following 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 ChromeContentBrowserClient::RenderProcessWillLaunch( content::RenderProcessHost* host, service_manager::mojom::ServiceRequest* service_request) { int id = host->GetID(); Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext()); host->AddFilter(new ChromeRenderMessageFilter(id, ...
0
5,454
Analyze the following 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 Vector<AtomicString>* createRoleNameVector() { Vector<AtomicString>* roleNameVector = new Vector<AtomicString>(NumRoles); for (int i = 0; i < NumRoles; i++) (*roleNameVector)[i] = nullAtom; for (size_t i = 0; i < WTF_ARRAY_LENGTH(roles); ++i) (*roleNameVector)[roles[i].webcoreRole] = AtomicS...
0
18,702
Analyze the following 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 ShellSurface::OnMouseEvent(ui::MouseEvent* event) { if (!resizer_) { views::View::OnMouseEvent(event); return; } if (event->handled()) return; if ((event->flags() & (ui::EF_MIDDLE_MOUSE_BUTTON | ui::EF_RIGHT_MOUSE_BUTTON)) != 0) return; if (event->type() == ui::ET_MOUSE_CA...
0
21,880
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u, int closing, int tx_ring) { struct pgv *pg_vec = NULL; struct packet_sock *po = pkt_sk(sk); int was_running, order = 0; struct packet_ring_buffer *rb; struct sk_buff_head *rb_queue; __be16 num; int err = -EINVAL; /* Added to avoid ...
1
18,624