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 PrintPreviewHandler::HandleManageCloudPrint(const ListValue* /*args*/) { ++manage_cloud_printers_dialog_request_count_; Profile* profile = Profile::FromBrowserContext( preview_web_contents()->GetBrowserContext()); preview_web_contents()->OpenURL( OpenURLParams( CloudPrintURL(profi...
0
105,805
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WORD32 ih264d_get_dpb_size(dec_seq_params_t *ps_seq) { WORD32 i4_size; UWORD8 u1_level_idc; u1_level_idc = ps_seq->u1_level_idc; switch(u1_level_idc) { case 10: i4_size = 152064; break; case 11: i4_size = 345600; break; case 12: i4_size = 912384; break; c...
0
162,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: static int sdp_parse_fmtp_config_h264(AVFormatContext *s, AVStream *stream, PayloadContext *h264_data, const char *attr, const char *value) { AVCodecParameters *par = stream->codecpar; if (!s...
1
167,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: ExtensionFunctionDispatcher::~ExtensionFunctionDispatcher() { } Commit Message: Extend TTS extension API to support richer events returned from the engine to the client. Previously we just had a completed event; this adds start, word boundary, sentence boundary, and marker boundary. In addition, interrupted and ...
0
99,660
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void WebContentsImpl::Delete() { RenderFrameHostImpl* focused_frame = GetFocusedFrame(); if (!focused_frame) return; focused_frame->GetFrameInputHandler()->Delete(); RecordAction(base::UserMetricsAction("DeleteSelection")); } Commit Message: Prevent renderer initiated back navigation to cancel a bro...
0
144,935
Analyze the following 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 qcow2_snapshot_load_tmp(BlockDriverState *bs, const char *snapshot_id, const char *name, Error **errp) { int i, snapshot_index; BDRVQcowState *s = bs->opaque; QCowSnapshot *sn; uint64_t *new_l1_table; int n...
1
165,406
Analyze the following 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 WebPagePrivate::requestLayoutIfNeeded() const { FrameView* view = m_mainFrame->view(); ASSERT(view); view->updateLayoutAndStyleIfNeededRecursive(); ASSERT(!view->needsLayout()); } Commit Message: [BlackBerry] Adapt to new BlackBerry::Platform::TouchPoint API https://bugs.webkit.org/show_bug....
0
104,356
Analyze the following 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 DownloadItemImpl::DetermineDownloadTarget() { DCHECK_CURRENTLY_ON(BrowserThread::UI); DVLOG(20) << __func__ << "() " << DebugString(true); RecordDownloadCount(DETERMINE_DOWNLOAD_TARGET_COUNT); delegate_->DetermineDownloadTarget( this, base::Bind(&DownloadItemImpl::OnDownloadTargetDetermined, ...
0
146,296
Analyze the following 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 punt_bios_to_rescuer(struct bio_set *bs) { struct bio_list punt, nopunt; struct bio *bio; if (WARN_ON_ONCE(!bs->rescue_workqueue)) return; /* * In order to guarantee forward progress we must punt only bios that * were allocated from this bio_set; otherwise, if there was a bio on * there f...
0
62,857
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: v8::MaybeLocal<v8::Function> firstArgAsFunction() { if (m_info.Length() < 1 || !m_info[0]->IsFunction()) return v8::MaybeLocal<v8::Function>(); return m_info[0].As<v8::Function>(); } Commit Message: [DevTools] Copy objects from debugger context to inspected context properl...
0
130,301
Analyze the following 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 GetOrientationAngle() { int angle; ExecuteScriptAndGetValue(shell()->web_contents()->GetMainFrame(), "screen.orientation.angle")->GetAsInteger(&angle); return angle; } Commit Message: Tests for CL 647933003. BUG=424453 Review URL: https://codereview.chromium.org...
0
119,431
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xsltInit (void) { if (initialized == 0) { initialized = 1; #ifdef XSLT_LOCALE_WINAPI xsltLocaleMutex = xmlNewRMutex(); #endif xsltRegisterAllExtras(); } } Commit Message: Roll libxslt to 891681e3e948f31732229f53cb6db7215f740fc7 BUG=583156,583171 Review URL: https://codereview.chromium.org/185...
0
156,904
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int brcmf_cfg80211_del_ap_iface(struct wiphy *wiphy, struct wireless_dev *wdev) { struct brcmf_cfg80211_info *cfg = wiphy_priv(wiphy); struct net_device *ndev = wdev->netdev; struct brcmf_if *ifp = netdev_priv(ndev); int ret; int err; brcmf_cfg80211_arm_vif_event(cfg, ifp->vif); err = b...
0
49,006
Analyze the following 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 kvm_write_tsc(struct kvm_vcpu *vcpu, u64 data) { struct kvm *kvm = vcpu->kvm; u64 offset, ns, elapsed; unsigned long flags; s64 sdiff; spin_lock_irqsave(&kvm->arch.tsc_write_lock, flags); offset = data - native_read_tsc(); ns = get_kernel_ns(); elapsed = ns - kvm->arch.last_tsc_nsec; sdiff = data -...
0
41,404
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int proc_free_streams(struct usb_dev_state *ps, void __user *arg) { unsigned num_eps; struct usb_host_endpoint **eps; struct usb_interface *intf; int r; r = parse_usbdevfs_streams(ps, arg, NULL, &num_eps, &eps, &intf); if (r) return r; destroy_async_on_interface(ps, intf->altsetting[0].de...
0
53,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: static int lua_request_hook(lua_State *L, request_rec *r) { ap_lua_push_request(L, r); return OK; } Commit Message: Merge r1642499 from trunk: *) SECURITY: CVE-2014-8109 (cve.mitre.org) mod_lua: Fix handling of the Require line when a LuaAuthzProvider is used in multiple Require directives w...
0
35,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: int xmlrpc_unregister_method(const char *method) { return_val_if_fail(method != NULL, XMLRPC_ERR_PARAMS); mowgli_patricia_delete(XMLRPCCMD, method); return XMLRPC_ERR_OK; } Commit Message: Do not copy more bytes than were allocated CWE ID: CWE-119
0
53,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 DesktopWindowTreeHostX11::FrameTypeChanged() { Widget::FrameType new_type = native_widget_delegate_->AsWidget()->frame_type(); if (new_type == Widget::FRAME_TYPE_DEFAULT) { return; } base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindOnce(&DesktopWindowTreeHostX...
0
140,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 bgp_attr_flush(struct attr *attr) { if (attr->aspath && !attr->aspath->refcnt) { aspath_free(attr->aspath); attr->aspath = NULL; } if (attr->community && !attr->community->refcnt) community_free(&attr->community); if (attr->ecommunity && !attr->ecommunity->refcnt) ecommunity_free(&attr->ecommunit...
0
91,634
Analyze the following 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 put_cmsg_compat(struct msghdr *kmsg, int level, int type, int len, void *data) { struct compat_cmsghdr __user *cm = (struct compat_cmsghdr __user *) kmsg->msg_control; struct compat_cmsghdr cmhdr; struct compat_timeval ctv; struct compat_timespec cts[3]; int cmlen; if (cm == NULL || kmsg->msg_controlle...
0
40,083
Analyze the following 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 TransportTexture::OnChannelConnected(int32 peer_pid) { } Commit Message: Fixing Coverity bugs (DEAD_CODE and PASS_BY_VALUE) CIDs 16230, 16439, 16610, 16635 BUG=NONE TEST=NONE Review URL: http://codereview.chromium.org/7215029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90134 0039d316-1c4b-4281-b...
0
98,475
Analyze the following 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 handle_ept_violation(struct kvm_vcpu *vcpu) { unsigned long exit_qualification; gpa_t gpa; u32 error_code; int gla_validity; exit_qualification = vmcs_readl(EXIT_QUALIFICATION); gla_validity = (exit_qualification >> 7) & 0x3; if (gla_validity != 0x3 && gla_validity != 0x1 && gla_validity != 0)...
0
42,659
Analyze the following 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 gen_movl_seg_T0(DisasContext *s, int seg_reg) { if (s->pe && !s->vm86) { tcg_gen_trunc_tl_i32(cpu_tmp2_i32, cpu_T0); gen_helper_load_seg(cpu_env, tcg_const_i32(seg_reg), cpu_tmp2_i32); /* abort translation because the addseg value may change or because ss32 may c...
0
66,361
Analyze the following 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 PermissionsData::CanCaptureVisiblePage(int tab_id, std::string* error) const { const URLPattern all_urls(URLPattern::SCHEME_ALL, URLPattern::kAllUrlsPattern); base::AutoLock auto_lock(runtime_lock_); if (active_permissions_u...
1
173,234
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ShellContentUtilityClient::ShellContentUtilityClient() { if (base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( switches::kProcessType) == switches::kUtilityProcess) network_service_test_helper_ = std::make_unique<NetworkServiceTestHelper>(); } Commit Message: Fix content_shell with n...
1
172,122
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBegin( ScrollState* scroll_state, InputHandler::ScrollInputType type) { ScrollStatus scroll_status; scroll_status.main_thread_scrolling_reasons = MainThreadScrollingReason::kNotScrollingOnMain; TRACE_EVENT0("cc", "LayerTreeHostImpl::ScrollBeg...
0
137,341
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Condor_Auth_SSL::unwrap(char * input, int input_len, char*& output, int& output_len) { bool result; unsigned char* in = (unsigned char*)input; unsigned char* out = (unsigned char*)output; dprintf(D_SECURITY, "In unwrap.\n"); result = decrypt(in,input_len,out,outpu...
0
16,264
Analyze the following 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 handle_opendir(FsContext *ctx, V9fsPath *fs_path, V9fsFidOpenState *fs) { int ret; ret = handle_open(ctx, fs_path, O_DIRECTORY, fs); if (ret < 0) { return -1; } fs->dir.stream = fdopendir(ret); if (!fs->dir.stream) { return -1; } ...
0
7,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: nvmet_fc_ls_disconnect(struct nvmet_fc_tgtport *tgtport, struct nvmet_fc_ls_iod *iod) { struct fcnvme_ls_disconnect_rqst *rqst = (struct fcnvme_ls_disconnect_rqst *)iod->rqstbuf; struct fcnvme_ls_disconnect_acc *acc = (struct fcnvme_ls_disconnect_acc *)iod->rspbuf; struct nvmet_fc_tgt_queue *queue = N...
0
93,623
Analyze the following 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 __crc32_pclmul_finup(u32 *crcp, const u8 *data, unsigned int len, u8 *out) { *(__le32 *)out = cpu_to_le32(crc32_pclmul_le(*crcp, data, len)); return 0; } Commit Message: crypto: prefix module autoloading with "crypto-" This prefixes all crypto module loading with "crypto-" so we never run the r...
0
46,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: error::Error GLES2DecoderPassthroughImpl::DoMapBufferRange( GLenum target, GLintptr offset, GLsizeiptr size, GLbitfield access, void* ptr, int32_t data_shm_id, uint32_t data_shm_offset, uint32_t* result) { CheckErrorCallbackState(); GLbitfield filtered_access = access; filt...
0
142,056
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void ipmi_free_recv_msg(struct ipmi_recv_msg *msg) { if (msg->user) kref_put(&msg->user->refcount, free_user); msg->done(msg); } Commit Message: ipmi: fix use-after-free of user->release_barrier.rda When we do the following test, we got oops in ipmi_msghandler driver while((1)) do service ipmievd restart &...
0
91,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: static int mcryptd_hash_init_enqueue(struct ahash_request *req) { return mcryptd_hash_enqueue(req, mcryptd_hash_init); } Commit Message: crypto: include crypto- module prefix in template This adds the module loading prefix "crypto-" to the template lookup as well. For example, attempting to load 'vfat(blowfis...
0
45,839
Analyze the following 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 wdm_manage_power(struct usb_interface *intf, int on) { /* need autopm_get/put here to ensure the usbcore sees the new value */ int rv = usb_autopm_get_interface(intf); if (rv < 0) goto err; intf->needs_remote_wakeup = on; usb_autopm_put_interface(intf); err: return rv; } Commit Message: USB: ...
0
32,842
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: StateBase* serializeProperties(bool ignoreIndexed, Serializer& serializer) { while (m_index < m_propertyNames->Length()) { if (!m_nameDone) { v8::Local<v8::Value> propertyName = m_propertyNames->Get(m_index); if (StateBase* newSta...
0
120,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: const void *qemu_fdt_getprop(void *fdt, const char *node_path, const char *property, int *lenp, Error **errp) { int len; const void *r; if (!lenp) { lenp = &len; } r = fdt_getprop(fdt, findnode_nofail(fdt, node_path), property, lenp); if (!r) { ...
0
13,102
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: TIFFVStripSize64(TIFF* tif, uint32 nrows) { static const char module[] = "TIFFVStripSize64"; TIFFDirectory *td = &tif->tif_dir; if (nrows==(uint32)(-1)) nrows=td->td_imagelength; if ((td->td_planarconfig==PLANARCONFIG_CONTIG)&& (td->td_photometric == PHOTOMETRIC_YCBCR)&& (!isUpSampled(tif))) { ...
0
70,221
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: tt_cmap6_get_info( TT_CMap cmap, TT_CMapInfo *cmap_info ) { FT_Byte* p = cmap->data + 4; cmap_info->format = 6; cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p ); return SFNT_Err_Ok; } Commit Message: CWE ID: CWE-189
0
4,195
Analyze the following 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 unmap_mapping_range(struct address_space *mapping, loff_t const holebegin, loff_t const holelen, int even_cows) { struct zap_details details; pgoff_t hba = holebegin >> PAGE_SHIFT; pgoff_t hlen = (holelen + PAGE_SIZE - 1) >> PAGE_SHIFT; /* Check for overflow. */ if (sizeof(holelen) > sizeof(hlen)) { ...
0
21,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: void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size) { uint8_t **p = ptr; if (min_size > SIZE_MAX - AV_INPUT_BUFFER_PADDING_SIZE) { av_freep(p); *size = 0; return; } if (!ff_fast_malloc(p, size, min_size + AV_INPUT_BUFFER_PADDING_SIZE, 1)) mems...
0
66,950
Analyze the following 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 exec_binprm(struct linux_binprm *bprm) { pid_t old_pid, old_vpid; int ret; /* Need to fetch pid before load_binary changes it */ old_pid = current->pid; rcu_read_lock(); old_vpid = task_pid_nr_ns(current, task_active_pid_ns(current->parent)); rcu_read_unlock(); ret = search_binary_handler(bpr...
0
30,897
Analyze the following 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 _make_prolog_mem_container(slurm_msg_t *msg) { prolog_launch_msg_t *req = (prolog_launch_msg_t *)msg->data; job_mem_limits_t *job_limits_ptr; step_loc_t step_info; _convert_job_mem(msg); /* Convert per-CPU mem limit */ if (req->job_mem_limit) { slurm_mutex_lock(&job_limits_mutex); if (!job_l...
0
72,096
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: struct sock *tcp_v4_syn_recv_sock(const struct sock *sk, struct sk_buff *skb, struct request_sock *req, struct dst_entry *dst, struct request_sock *req_unhash, bool *own_req) { struct inet_request_sock *ireq; struct inet_sock *newinet; struct tcp_sock *newtp; struct sock *newsk; #ifdef...
0
49,278
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: callout_name_table_clear(CalloutNameTable* t) { if (IS_NOT_NULL(t)) { onig_st_foreach(t, i_free_callout_name_entry, 0); } return 0; } Commit Message: fix #147: Stack Exhaustion Problem caused by some parsing functions in regcomp.c making recursive calls to themselves. CWE ID: CWE-400
0
87,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: void RenderFrameHostImpl::ExecuteJavaScriptForTests( const base::string16& javascript) { Send(new FrameMsg_JavaScriptExecuteRequestForTests(routing_id_, javascript, 0, false, false)); } Commit Message:...
0
127,770
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: mm_session_close(Session *s) { debug3("%s: session %d pid %ld", __func__, s->self, (long)s->pid); if (s->ttyfd != -1) { debug3("%s: tty %s ptyfd %d", __func__, s->tty, s->ptyfd); session_pty_cleanup2(s); } session_unused(s->self); } Commit Message: set sshpam_ctxt to NULL after free Avoids use-after-fre...
0
42,114
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PHP_FUNCTION(highlight_file) { char *filename; int filename_len, ret; zend_syntax_highlighter_ini syntax_highlighter_ini; zend_bool i = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|b", &filename, &filename_len, &i) == FAILURE) { RETURN_FALSE; } if (php_check_open_basedir(filename TSRMLS_C...
0
4,276
Analyze the following 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 qcow2_create(const char *filename, QEMUOptionParameter *options, Error **errp) { const char *backing_file = NULL; const char *backing_fmt = NULL; uint64_t sectors = 0; int flags = 0; size_t cluster_size = DEFAULT_CLUSTER_SIZE; int prealloc = 0; int ve...
0
16,768
Analyze the following 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 hiddev_fasync(int fd, struct file *file, int on) { struct hiddev_list *list = file->private_data; return fasync_helper(fd, file, on, &list->fasync); } Commit Message: HID: hiddev: validate num_values for HIDIOCGUSAGES, HIDIOCSUSAGES commands This patch validates the num_values parameter from userl...
0
51,232
Analyze the following 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 vfat_rmdir(struct inode *dir, struct dentry *dentry) { struct inode *inode = dentry->d_inode; struct super_block *sb = dir->i_sb; struct fat_slot_info sinfo; int err; lock_super(sb); err = fat_dir_empty(inode); if (err) goto out; err = vfat_find(dir, &dentry->d_name, &sinfo); if (err) go...
0
33,408
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GBool LZWStream::processNextCode() { int code; int nextLength; int i, j; if (eof) { return gFalse; } start: code = getCode(); if (code == EOF || code == 257) { eof = gTrue; return gFalse; } if (code == 256) { clearTable(); goto start; } if (nextCode >= 4097) { erro...
0
4,007
Analyze the following 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 SetPageSizeAndContentRect(bool rotated, bool is_src_page_landscape, pp::Size* page_size, pp::Rect* content_rect) { bool is_dst_page_landscape = page_size->width() > page_size->height(); bool page_orientation_mism...
0
140,428
Analyze the following 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 FrameSelection::MoveCaretSelection(const IntPoint& point) { DCHECK(!GetDocument().NeedsLayoutTreeUpdate()); Element* const editable = ComputeVisibleSelectionInDOMTree().RootEditableElement(); if (!editable) return; const VisiblePosition position = VisiblePositionForContentsPoint(po...
1
171,756
Analyze the following 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 Pack<WebGLImageConversion::kDataFormatRG8, WebGLImageConversion::kAlphaDoPremultiply, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixels_per_row) { for (unsigned i = 0; i < pixels_per_row; ++i) { float scale...
0
146,714
Analyze the following 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 sctp_v6_get_dst(struct sctp_transport *t, union sctp_addr *saddr, struct flowi *fl, struct sock *sk) { struct sctp_association *asoc = t->asoc; struct dst_entry *dst = NULL; struct flowi6 *fl6 = &fl->u.ip6; struct sctp_bind_addr *bp; struct ipv6_pinfo *np = inet6_sk(sk); struct sctp_socka...
0
65,167
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: proxy_info_matches(const struct proxy_info* data, const struct proxy_info* needle) { if((data->proxytype == needle->proxytype) && (data->port == needle->port) && Curl_safe_strcasecompare(data->host.name, needle->host.name)) return TRUE; return FALSE; } Commit Message: Curl_c...
0
77,809
Analyze the following 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 gdImageHLine(gdImagePtr im, int y, int x1, int x2, int col) { if (im->thick > 1) { int thickhalf = im->thick >> 1; _gdImageFilledHRectangle(im, x1, y - thickhalf, x2, y + im->thick - thickhalf - 1, col); } else { if (x2 < x1) { int t = x2; x2 = x1; x1 = t; } for (;x1 <= x2; x1++)...
0
72,475
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: png_push_process_row(png_structp png_ptr) { png_ptr->row_info.color_type = png_ptr->color_type; png_ptr->row_info.width = png_ptr->iwidth; png_ptr->row_info.channels = png_ptr->channels; png_ptr->row_info.bit_depth = png_ptr->bit_depth; png_ptr->row_info.pixel_depth = png_ptr->pixel_depth; png_...
0
131,332
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: String8 String8::getPathLeaf(void) const { const char* cp; const char*const buf = mString; cp = strrchr(buf, OS_PATH_SEPARATOR); if (cp == NULL) return String8(*this); else return String8(cp+1); } Commit Message: libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8 Inconsis...
0
158,399
Analyze the following 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 WebRTCTransportImpl::SendRTCPPacket(int channel, const void* data, int len) { return network_->ReceivedRTCPPacket(channel, data, len); } Commit Message: Allow browser to handle all WebUI navigations. BUG=113496 TEST="Google Dashboard" link in Sync settings loads in ...
0
108,547
Analyze the following 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 vfio_pci_disable(struct vfio_pci_device *vdev) { struct pci_dev *pdev = vdev->pdev; struct vfio_pci_dummy_resource *dummy_res, *tmp; int i, bar; /* Stop the device from further DMA */ pci_clear_master(pdev); vfio_pci_set_irqs_ioctl(vdev, VFIO_IRQ_SET_DATA_NONE | VFIO_IRQ_SET_ACTION_TRIGGER...
0
48,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: mrb_obj_is_kind_of_m(mrb_state *mrb, mrb_value self) { mrb_value arg; mrb_get_args(mrb, "C", &arg); return mrb_bool_value(mrb_obj_is_kind_of(mrb, self, mrb_class_ptr(arg))); } Commit Message: Allow `Object#clone` to copy frozen status only; fix #4036 Copying all flags from the original object may overwr...
0
82,197
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int smaps_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end, struct mm_walk *walk) { struct vm_area_struct *vma = walk->vma; pte_t *pte; spinlock_t *ptl; ptl = pmd_trans_huge_lock(pmd, vma); if (ptl) { if (pmd_present(*pmd)) smaps_pmd_entry(pmd, addr, walk); spin_unlock(ptl); ...
0
90,511
Analyze the following 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_DEFINE3(open, const char __user *, filename, int, flags, umode_t, mode) { if (force_o_largefile()) flags |= O_LARGEFILE; return do_sys_open(AT_FDCWD, filename, flags, mode); } Commit Message: get rid of s_files and files_lock The only thing we need it for is alt-sysrq-r (emergency remount r/o) and ...
0
46,150
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: flatpak_proxy_new (const char *dbus_address, const char *socket_path) { FlatpakProxy *proxy; proxy = g_object_new (FLATPAK_TYPE_PROXY, "dbus-address", dbus_address, "socket-path", socket_path, NULL); return proxy; } Commit Message: Fix vulnerability in dbus proxy During the authenticat...
0
84,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: XkbFileFromComponents(struct xkb_context *ctx, const struct xkb_component_names *kkctgs) { char *const components[] = { kkctgs->keycodes, kkctgs->types, kkctgs->compat, kkctgs->symbols, }; enum xkb_file_type type; IncludeStmt *include = NULL; XkbFile *file...
0
79,009
Analyze the following 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 DevToolsHttpHandler::Send500(int connection_id, const std::string& message) { if (!thread_) return; thread_->task_runner()->PostTask( FROM_HERE, base::BindOnce(&ServerWrapper::Send500, base::Unretained(server_wrapper_.get()), ...
0
148,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: static inline void yam_rx_byte(struct net_device *dev, struct yam_port *yp, unsigned char rxb) { if (yp->rx_len < YAM_MAX_FRAME) { unsigned char c = yp->rx_crcl; yp->rx_crcl = (chktabl[c] ^ yp->rx_crch); yp->rx_crch = (chktabh[c] ^ rxb); yp->rx_buf[yp->rx_len++] = rxb; } } Commit Message: hamradio/yam:...
0
39,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: prune_bounding_set(void) { int i, rc = 0; static int bounding_set_cleared; if (bounding_set_cleared) return 0; for (i = 0; i <= CAP_LAST_CAP && rc == 0; ++i) rc = prctl(PR_CAPBSET_DROP, i); if (rc != 0) { fprintf(stderr, "Unable to clear capability bounding set: %d\n", rc); return EX_SYSERR; } ...
0
2,049
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: dissect_u3v_read_mem_cmd(proto_tree *u3v_telegram_tree, tvbuff_t *tvb, packet_info *pinfo, gint startoffset, gint length, u3v_conv_info_t *u3v_conv_info, gencp_transaction_t * gencp_trans) { guint64 addr = 0; const gchar* address_string = NULL; gboolean is_custom_register = FALSE; guint16 count = ...
0
51,788
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: OmniboxViewWin::~OmniboxViewWin() { text_object_model_->Release(); g_paint_patcher.Pointer()->DerefPatch(); } Commit Message: Change omnibox behavior when stripping javascript schema to navigate after stripping the schema on drag drop. BUG=109245 TEST=N/A Review URL: http://codereview.chromium.org/9116016 ...
0
107,543
Analyze the following 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 robots_fsio_faccess(pr_fh_t *fh, int mode, uid_t uid, gid_t gid, array_header *suppl_gids) { if (fh->fh_fd != AUTH_ROBOTS_TXT_FD) { errno = EINVAL; return -1; } if (mode != R_OK) { errno = EACCES; return -1; } return 0; } Commit Message: Walk the entire DefaultRoot pat...
0
67,594
Analyze the following 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_sk(struct sk_buff *skb) { struct sock *sk = skb->sk; struct sk_buff *clone; if (!sk || !atomic_inc_not_zero(&sk->sk_refcnt)) return NULL; clone = skb_clone(skb, GFP_ATOMIC); if (!clone) { sock_put(sk); return NULL; } clone->sk = sk; clone->destructor = sock_efree; retu...
0
67,694
Analyze the following 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 tcp_md5sig_key *tcp_v4_md5_lookup(const struct sock *sk, const struct sock *addr_sk) { const union tcp_md5_addr *addr; addr = (const union tcp_md5_addr *)&addr_sk->sk_daddr; return tcp_md5_do_lookup(sk, addr, AF_INET); } Commit Message: tcp: take care of truncations done by sk_filter() With syz...
0
49,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: virtual ssize_t readAt(off64_t offset, void *buffer, size_t size) { Parcel data, reply; data.writeInterfaceToken( IMediaHTTPConnection::getInterfaceDescriptor()); data.writeInt64(offset); data.writeInt32(size); status_t err = remote()->transact(READ_AT, data, &reply); if (err != OK)...
1
173,365
Analyze the following 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 OxideQQuickWebViewPrivate::locationBarAnimated() const { if (!proxy_) { return construct_props_->location_bar_animated; } return proxy_->locationBarAnimated(); } Commit Message: CWE ID: CWE-20
0
17,124
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void ImageLoader::DecodeRequest::ProcessForTask() { if (!loader_) return; DCHECK_EQ(state_, kPendingMicrotask); state_ = kPendingLoad; loader_->DispatchDecodeRequestsIfComplete(); } Commit Message: service worker: Disable interception when OBJECT/EMBED uses ImageLoader. Per the specification, servi...
0
147,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 bool fanout_flow_is_huge(struct packet_sock *po, struct sk_buff *skb) { u32 rxhash; int i, count = 0; rxhash = skb_get_hash(skb); for (i = 0; i < ROLLOVER_HLEN; i++) if (po->rollover->history[i] == rxhash) count++; po->rollover->history[prandom_u32() % ROLLOVER_HLEN] = rxhash; return count > (...
0
49,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: PassRefPtr<DocumentFragment> Range::extractContents(ExceptionCode& ec) { checkDeleteExtract(ec); if (ec) return 0; return processContents(EXTRACT_CONTENTS, ec); } Commit Message: There are too many poorly named functions to create a fragment from markup https://bugs.webkit.org/show_bug.cgi?i...
0
100,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 void encode_lock(struct xdr_stream *xdr, const struct nfs_lock_args *args, struct compound_hdr *hdr) { __be32 *p; p = reserve_space(xdr, 32); *p++ = cpu_to_be32(OP_LOCK); *p++ = cpu_to_be32(nfs4_lock_type(args->fl, args->block)); *p++ = cpu_to_be32(args->reclaim); p = xdr_encode_hyper(p, args->fl->f...
0
23,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: vmxnet3_on_tx_done_update_stats(VMXNET3State *s, int qidx, Vmxnet3PktStatus status) { size_t tot_len = net_tx_pkt_get_total_len(s->tx_pkt); struct UPT1_TxStats *stats = &s->txq_descr[qidx].txq_stats; switch (status) { case VMXNET3_PKT_STATUS_OK: switch (net_tx_pkt_get_packet_type(s->t...
0
9,026
Analyze the following 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 RendererSchedulerImpl::AddWebViewScheduler( WebViewSchedulerImpl* web_view_scheduler) { main_thread_only().web_view_schedulers.insert(web_view_scheduler); } Commit Message: [scheduler] Remove implicit fallthrough in switch Bail out early when a condition in the switch is fulfilled. This does not chan...
0
143,367
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: pkinit_get_certs_fs(krb5_context context, pkinit_plg_crypto_context plg_cryptoctx, pkinit_req_crypto_context req_cryptoctx, pkinit_identity_opts *idopts, pkinit_identity_crypto_context id_cryptoctx, krb5_principal ...
0
33,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: void LayoutSVGResourceMarker::removeAllClientsFromCache(bool markForInvalidation) { markAllClientsForInvalidation(markForInvalidation ? LayoutAndBoundariesInvalidation : ParentOnlyInvalidation); } Commit Message: Avoid using forced layout to trigger paint invalidation for SVG containers Currently, SVG conta...
0
121,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 void mem_cgroup_destroy(struct cgroup_subsys *ss, struct cgroup *cont) { struct mem_cgroup *memcg = mem_cgroup_from_cont(cont); kmem_cgroup_destroy(ss, cont); mem_cgroup_put(memcg); } Commit Message: mm: thp: fix pmd_bad() triggering in code paths holding mmap_sem read mode commit 1a5a9906d4e8d1...
0
21,050
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int check_target(struct ip6t_entry *e, struct net *net, const char *name) { struct xt_entry_target *t = ip6t_get_target(e); struct xt_tgchk_param par = { .net = net, .table = name, .entryinfo = e, .target = t->u.kernel.target, .targinfo = t->data, .hook_mask = e->comefrom, .fa...
0
52,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: camera_metadata_t *clone_camera_metadata(const camera_metadata_t *src) { int res; if (src == NULL) return NULL; camera_metadata_t *clone = allocate_camera_metadata( get_camera_metadata_entry_count(src), get_camera_metadata_data_count(src)); if (clone != NULL) { res = append_camera_meta...
0
157,951
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: cib_common_callback_worker(uint32_t id, uint32_t flags, xmlNode * op_request, cib_client_t * cib_client, gboolean privileged) { const char *op = crm_element_value(op_request, F_CIB_OPERATION); if (crm_str_eq(op, CRM_OP_REGISTER, TRUE)) { if(flags & crm_ipc_client_response) { xmlNode *...
0
33,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 ExtensionsUpdatedObserver::Observe( int type, const content::NotificationSource& source, const content::NotificationDetails& details) { if (!automation_) { delete this; return; } switch (type) { case chrome::NOTIFICATION_EXTENSION_UPDATE_FOUND: in_progress_updates_.insert( ...
0
117,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: node_get_verbose_nickname_by_id(const char *id_digest, char *verbose_name_out) { const node_t *node = node_get_by_id(id_digest); if (!node) { verbose_name_out[0] = '$'; base16_encode(verbose_name_out+1, HEX_DIGEST_LEN+1, id_digest, DIGEST_LEN); } else { node_get_v...
0
69,797
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void raisesExceptionStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { ExceptionState exceptionState(ExceptionState::ExecutionContext, "raisesExceptionStringMethod", "TestObjectPython", info.Holder(), info.GetIsolate()); TestObjectPython* imp = V8TestObjectPython::toNative(info.H...
0
122,541
Analyze the following 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 ip_rt_bug(struct sk_buff *skb) { printk(KERN_DEBUG "ip_rt_bug: %pI4 -> %pI4, %s\n", &ip_hdr(skb)->saddr, &ip_hdr(skb)->daddr, skb->dev ? skb->dev->name : "?"); kfree_skb(skb); WARN_ON(1); return 0; } Commit Message: net: Compute protocol sequence numbers and fragment IDs using MD5. Computers ...
0
25,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: int HttpProxyClientSocket::Read(IOBuffer* buf, int buf_len, const CompletionCallback& callback) { DCHECK(user_callback_.is_null()); if (next_state_ != STATE_DONE) { DCHECK_EQ(407, response_.headers->response_code()); LogBlockedTunnelResponse(); return ERR_TUNNEL_CO...
0
129,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: jpeg_create_decompress_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo) { if( SETJMP(sp->exit_jmpbuf) ) return 0; else { jpeg_create_decompress(cinfo); return 1; } } Commit Message: * libtiff/tif_ojpeg.c: make OJPEGDecode() early exit in case of failure in OJPEGPreDecode(). This will avoid a divide ...
0
70,324
Analyze the following 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 TAUException(struct pt_regs *regs) { printk("TAU trap at PC: %lx, MSR: %lx, vector=%lx %s\n", regs->nip, regs->msr, regs->trap, print_tainted()); } Commit Message: [POWERPC] Never panic when taking altivec exceptions from userspace At the moment we rely on a cpu feature bit or a firmware proper...
0
74,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: polkit_backend_session_monitor_get_sessions (PolkitBackendSessionMonitor *monitor) { /* TODO */ return NULL; } Commit Message: CWE ID: CWE-200
0
14,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: static int co64_required(const MOVTrack *track) { if (track->entry > 0 && track->cluster[track->entry - 1].pos + track->data_offset > UINT32_MAX) return 1; return 0; } Commit Message: avformat/movenc: Write version 2 of audio atom if channels is not known The version 1 needs the channel count an...
0
79,281
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int gpr_get(struct task_struct *target, const struct user_regset *regset, unsigned int pos, unsigned int count, void *kbuf, void __user *ubuf) { int i, ret; if (target->thread.regs == NULL) return -EIO; if (!FULL_REGS(target->thread.regs)) { /* We have a partial register set. Fill 14-31...
0
25,483
Analyze the following 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 long fuse_file_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { return fuse_ioctl_common(file, cmd, arg, FUSE_IOCTL_COMPAT); } Commit Message: fuse: break infinite loop in fuse_fill_write_pages() I got a report about unkillable task eating CPU. Further investigation shows, t...
0
56,928
Analyze the following 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 __tty_fasync(int fd, struct file *filp, int on) { struct tty_struct *tty = file_tty(filp); struct tty_ldisc *ldisc; unsigned long flags; int retval = 0; if (tty_paranoia_check(tty, file_inode(filp), "tty_fasync")) goto out; retval = fasync_helper(fd, filp, on, &tty->fasync); if (retval <= 0)...
0
55,852