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: process_share(sa_handle_impl_t impl_handle, sa_share_impl_t impl_share, char *pathname, char *resource, char *proto, char *options, char *description, char *dataset, boolean_t from_sharetab) { struct stat statbuf; int rc; char *resource_dup = NULL, *dataset_dup = NULL; boolean_t new_share; sa_fst...
0
96,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: void GLES2DecoderImpl::DoClearBufferiv(GLenum buffer, GLint drawbuffer, const volatile GLint* value) { const char* func_name = "glClearBufferiv"; if (!CheckBoundDrawFramebufferValid(func_name)) return; ApplyDirtyState(); if...
0
141,277
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: config_tinker( config_tree *ptree ) { attr_val * tinker; int item; item = -1; /* quiet warning */ tinker = HEAD_PFIFO(ptree->tinker); for (; tinker != NULL; tinker = tinker->link) { switch (tinker->attr) { default: NTP_INSIST(0); break; case T_Allan: item = LOOP_ALLAN; break; case ...
0
74,145
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void watchdog_disable(int cpu) { struct task_struct *p = per_cpu(softlockup_watchdog, cpu); struct hrtimer *hrtimer = &per_cpu(watchdog_hrtimer, cpu); /* * cancel the timer first to stop incrementing the stats * and waking up the kthread */ hrtimer_cancel(hrtimer); /* disable the perf event */...
0
26,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: parse_SET_FIELD(const char *arg, struct ofpbuf *ofpacts, enum ofputil_protocol *usable_protocols) { char *copy = xstrdup(arg); char *error = set_field_parse__(copy, ofpacts, usable_protocols); free(copy); return error; } Commit Message: ofp-actions: Avoid buffer overread in BUNDLE...
0
77,067
Analyze the following 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 hsb2rgb(const float hue, const float saturation, const float vlue, int &outR, int &outG, int &outB, const double maxValue/* = 100.0 */) { double hh, p, q, t, ff; long i; if(saturation <= 0.0) { outR = int(vlue*maxValue); outG = int(vlue*maxValue); outB = int(vlue*maxValue); } hh = hue...
0
90,940
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: free_options(struct mtree_option *head) { struct mtree_option *next; for (; head != NULL; head = next) { next = head->next; free(head->value); free(head); } } Commit Message: Fix libarchive/archive_read_support_format_mtree.c:1388:11: error: array subscript is above array bounds CWE ID: CWE-119
0
53,508
Analyze the following 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 hns_rcb_get_queue_mode(enum dsaf_mode dsaf_mode, u16 *max_vfn, u16 *max_q_per_vf) { switch (dsaf_mode) { case DSAF_MODE_DISABLE_6PORT_0VM: *max_vfn = 1; *max_q_per_vf = 16; break; case DSAF_MODE_DISABLE_FIX: case DSAF_MODE_DISABLE_SP: *max_vfn = 1; *max_q_per_vf = 1; break; case DSAF_...
0
85,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: static int update_time(struct inode *inode, struct timespec64 *time, int flags) { int (*update_time)(struct inode *, struct timespec64 *, int); update_time = inode->i_op->update_time ? inode->i_op->update_time : generic_update_time; return update_time(inode, time, flags); } Commit Message: Fix up non-dire...
0
79,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: psf_ftell (SF_PRIVATE *psf) { sf_count_t pos ; if (psf->virtual_io) return psf->vio.tell (psf->vio_user_data) ; pos = _telli64 (psf->file.filedes) ; if (pos == ((sf_count_t) -1)) { psf_log_syserr (psf, errno) ; return -1 ; } ; return pos - psf->fileoffset ; } /* psf_ftell */ Commit Message: src/fi...
0
45,228
Analyze the following 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 xfrm_send_policy_notify(struct xfrm_policy *xp, int dir, const struct km_event *c) { switch (c->event) { case XFRM_MSG_NEWPOLICY: case XFRM_MSG_UPDPOLICY: case XFRM_MSG_DELPOLICY: return xfrm_notify_policy(xp, dir, c); case XFRM_MSG_FLUSHPOLICY: return xfrm_notify_policy_flush(c); case XFRM_...
0
33,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 LocalFileSystem::fileSystemAllowedInternal( PassRefPtrWillBeRawPtr<ExecutionContext> context, FileSystemType type, PassRefPtr<CallbackWrapper> callbacks) { if (!fileSystem()) { fileSystemNotAvailable(context, callbacks); return; } KURL storagePartition = KURL(KU...
1
171,426
Analyze the following 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 RenderBox::setMarginAfter(LayoutUnit margin) { switch (style()->writingMode()) { case TopToBottomWritingMode: m_marginBottom = margin; break; case BottomToTopWritingMode: m_marginTop = margin; break; case LeftToRightWritingMode: m_marginRight = margin; ...
0
101,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: LIBOPENMPT_MODPLUG_API int ModPlug_GetCurrentOrder(ModPlugFile* file) { if(!file) return 0; return openmpt_module_get_current_order(file->mod); } Commit Message: [Fix] libmodplug: C API: Limit the length of strings copied to the output buffer of ModPlug_InstrumentName() and ModPlug_SampleName() to 32 bytes (in...
0
87,627
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static GF_Err gf_isom_dump_svg_track(GF_ISOFile *the_file, u32 track, FILE *dump) { char nhmlFileName[1024]; FILE *nhmlFile; u32 i, count, di, ts, cur_frame; u64 start, end; GF_BitStream *bs; GF_TrackBox *trak = gf_isom_get_track_from_file(the_file, track); if (!trak) return GF_BAD_PARAM; switch (trak->M...
0
80,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: struct rpc_task * rpc_wake_up_next(struct rpc_wait_queue *queue) { struct rpc_task *task = NULL; dprintk("RPC: wake_up_next(%p \"%s\")\n", queue, rpc_qname(queue)); spin_lock_bh(&queue->lock); if (RPC_IS_PRIORITY(queue)) task = __rpc_wake_up_next_priority(queue); else { task_for_first(task, &qu...
0
34,981
Analyze the following 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 omx_vdec::release_output_done(void) { bool bRet = false; unsigned i=0,j=0; DEBUG_PRINT_LOW("Value of m_out_mem_ptr %p",m_out_mem_ptr); if (m_out_mem_ptr) { for (; j < drv_ctx.op_buf.actualcount ; j++) { if (BITMASK_PRESENT(&m_out_bm_count,j)) { break; } } if (j == drv_ctx.op_buf.actualcount) { ...
0
160,318
Analyze the following 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 __video_do_ioctl(struct file *file, unsigned int cmd, void *arg) { struct video_device *vfd = video_devdata(file); const struct v4l2_ioctl_ops *ops = vfd->ioctl_ops; void *fh = file->private_data; struct v4l2_format f_copy; long ret = -EINVAL; if (ops == NULL) { printk(KERN_WARNING "videode...
0
74,688
Analyze the following 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 ClassType GetPixelCacheStorageClass(const Cache cache) { CacheInfo *restrict cache_info; assert(cache != (Cache) NULL); cache_info=(CacheInfo *) cache; assert(cache_info->signature == MagickSignature); if (cache_info->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagick...
0
73,631
Analyze the following 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::DoOverlayPromotionHintCHROMIUM(GLuint client_id, GLboolean promotion_hint, GLint display_x, GLint display_y, ...
0
141,352
Analyze the following 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 GLES2DecoderImpl::HasMoreIdleWork() const { return !pending_readpixel_fences_.empty() || gpu_tracer_->HasTracesToProcess() || !texture_refs_pending_destruction_.empty(); } Commit Message: Add GL_PROGRAM_COMPLETION_QUERY_CHROMIUM This makes the query of GL_COMPLETION_STATUS_KHR to progra...
0
141,607
Analyze the following 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 ~DummyScreenshotDelegate() {} Commit Message: accelerators: Remove deprecated Accelerator ctor that takes booleans. BUG=128242 R=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/10399085 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137957 0039d316-1c4b-4281-b951-d872f2087c9...
0
106,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: command_send_text (Fep *fep, FepControlMessage *request) { _fep_output_send_text (fep, request->args[0].str); } Commit Message: Don't use abstract Unix domain sockets CWE ID: CWE-264
0
36,953
Analyze the following 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 impeg2d_bit_stream_init(stream_t *ps_stream, UWORD8 *pu1_byte_buf, UWORD32 u4_max_offset) { UWORD8 *pu1_byte_buff; UWORD32 *pu4_word_buf; size_t u4_byte_addr; UWORD32 u4_temp1,u4_temp2; /* Set parameters of the stream s...
0
159,610
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void git_indexwriter_cleanup(git_indexwriter *writer) { git_filebuf_cleanup(&writer->file); git_index_free(writer->index); writer->index = NULL; } Commit Message: index: convert `read_entry` to return entry size via an out-param The function `read_entry` does not conform to our usual coding style of returni...
0
83,713
Analyze the following 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 __init rfcomm_init_ttys(void) { int error; rfcomm_tty_driver = alloc_tty_driver(RFCOMM_TTY_PORTS); if (!rfcomm_tty_driver) return -ENOMEM; rfcomm_tty_driver->driver_name = "rfcomm"; rfcomm_tty_driver->name = "rfcomm"; rfcomm_tty_driver->major = RFCOMM_TTY_MAJOR; rfcomm_tty_driver->minor_start = RF...
0
94,488
Analyze the following 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 push_insn(int t, int w, int e, struct bpf_verifier_env *env) { if (e == FALLTHROUGH && insn_state[t] >= (DISCOVERED | FALLTHROUGH)) return 0; if (e == BRANCH && insn_state[t] >= (DISCOVERED | BRANCH)) return 0; if (w < 0 || w >= env->prog->len) { verbose("jump out of range from insn %d to %d...
0
65,074
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: coolkey_find_object_by_template(sc_card_t *card, sc_cardctl_coolkey_attribute_t *template, int count) { list_t *list; sc_cardctl_coolkey_object_t *current, *rv = NULL; coolkey_private_data_t * priv = COOLKEY_DATA(card); int i, r; unsigned int tmp_pos = (unsigned int) -1; list = &priv->objects_list; if (li...
0
78,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: static long ec_device_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) { struct cros_ec_dev *ec = filp->private_data; if (_IOC_TYPE(cmd) != CROS_EC_DEV_IOC) return -ENOTTY; switch (cmd) { case CROS_EC_DEV_IOCXCMD: return ec_device_ioctl_xcmd(ec, (void __user *)arg); case CROS_EC_DEV...
0
51,111
Analyze the following 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_set_version_bound(int method_version, int version, int *bound) { if (version == 0) { *bound = version; return 1; } /*- * Restrict TLS methods to TLS protocol versions. * Restrict DTLS methods to DTLS protocol versions. * Note, DTLS version numbers are decreasing...
0
12,724
Analyze the following 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 blk_mq_rq_ctx_init(struct request_queue *q, struct blk_mq_ctx *ctx, struct request *rq, unsigned int rw_flags) { if (blk_queue_io_stat(q)) rw_flags |= REQ_IO_STAT; INIT_LIST_HEAD(&rq->queuelist); /* csd/requeue_work/fifo_time is initialized before use */ rq->q = q; rq->mq_ctx = ctx; ...
0
86,734
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: BrowserView::GetActiveTabPermissionGranter() { content::WebContents* web_contents = GetActiveWebContents(); if (!web_contents) return nullptr; return extensions::TabHelper::FromWebContents(web_contents) ->active_tab_permission_granter(); } Commit Message: Mac: turn popups into new tabs while in f...
0
155,170
Analyze the following 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 read_frame_by_row(FILE *f, vpx_image_t *img) { size_t nbytes, to_read; int res = 1; int plane; for (plane = 0; plane < 3; plane++) { unsigned char *ptr; int w = (plane ? (1 + img->d_w) / 2 : img->d_w); int h = (plane ? (1 + img->d_h) / 2 : img->d_h); int r; /* Determine the correct plane...
0
164,347
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int nfs4_xdr_dec_close(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs_closeres *res) { struct compound_hdr hdr; int status; status = decode_compound_hdr(xdr, &hdr); if (status) goto out; status = decode_sequence(xdr, &res->seq_res, rqstp); if (status) goto out; status = dec...
0
23,405
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void GLES2DecoderImpl::DeleteFramebuffersHelper( GLsizei n, const volatile GLuint* client_ids) { for (GLsizei ii = 0; ii < n; ++ii) { GLuint client_id = client_ids[ii]; Framebuffer* framebuffer = GetFramebuffer(client_id); if (framebuffer && !framebuffer->IsDeleted()) { if (framebuffer...
0
141,236
Analyze the following 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 size_t WriteChannelSize(const PSDInfo *psd_info,Image *image, const signed short channel) { size_t count; count=WriteBlobMSBSignedShort(image,channel); count+=SetPSDSize(psd_info,image,0); return(count); } Commit Message: https://github.com/ImageMagick/ImageMagick/issues/714 CWE ID: ...
0
61,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 PrintWebViewHelper::RequestPrintPreview(PrintPreviewRequestType type) { const bool is_modifiable = print_preview_context_.IsModifiable(); const bool has_selection = print_preview_context_.HasSelection(); PrintHostMsg_RequestPrintPreview_Params params; params.is_modifiable = is_modifiable; params.ha...
0
126,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: LayerTreeHostTestOneActivatePerPrepareTiles() : notify_ready_to_activate_count_(0u), scheduled_prepare_tiles_count_(0) {} Commit Message: (Reland) Discard compositor frames from unloaded web content This is a reland of https://codereview.chromium.org/2707243005/ with a small change to fix an uni...
0
137,442
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: R_API ut64 r_bin_java_annotation_calc_size(RBinJavaAnnotation *annotation) { ut64 sz = 0; RListIter *iter, *iter_tmp; RBinJavaElementValuePair *ev_pairs = NULL; if (!annotation) { return sz; } sz += 2; sz += 2; r_list_foreach_safe (annotation->element_value_pairs, iter, iter_tmp, ev_pairs) { if (ev_pa...
0
79,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: format_SET_L4_DST_PORT(const struct ofpact_l4_port *a, struct ds *s) { ds_put_format(s, "%smod_tp_dst:%s%d", colors.param, colors.end, a->port); } Commit Message: ofp-actions: Avoid buffer overread in BUNDLE action decoding. Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9052 Signed-off-...
0
76,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: void CloudPolicySubsystem::CompleteInitialization( const char* refresh_pref_name, int64 delay_milliseconds) { if (!device_management_url_.empty()) { DCHECK(device_management_service_.get()); DCHECK(cloud_policy_cache_.get()); DCHECK(device_token_fetcher_.get()); refresh_pref_name_ = ref...
0
97,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: static void smb2cli_req_writev_done(struct tevent_req *subreq) { struct tevent_req *req = tevent_req_callback_data(subreq, struct tevent_req); struct smbXcli_req_state *state = tevent_req_data(req, struct smbXcli_req_state); ssize_t nwritten; int err; state->write_req = NULL; nwritten = writev_rec...
0
2,452
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void disk_flush_events(struct gendisk *disk, unsigned int mask) { struct disk_events *ev = disk->ev; if (!ev) return; spin_lock_irq(&ev->lock); ev->clearing |= mask; if (!ev->block) mod_delayed_work(system_freezable_power_efficient_wq, &ev->dwork, 0); spin_unlock_irq(&ev->lock); } Commit Message:...
0
49,686
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Chapters::Display::~Display() { } Commit Message: libwebm: Pull from upstream Rolling mkvparser from upstream. Primarily for fixing a bug on parsing failures with certain Opus WebM files. Upstream commit hash of this pull: 574045edd4ecbeb802ee3f1d214b5510269852ae The diff is so huge because there were some st...
1
174,464
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xmlXPtrGetStartPoint(xmlXPathObjectPtr obj, xmlNodePtr *node, int *indx) { if ((obj == NULL) || (node == NULL) || (indx == NULL)) return(-1); switch (obj->type) { case XPATH_POINT: *node = obj->user; if (obj->index <= 0) *indx = 0; else *indx = obj->index; return(0); ...
0
109,058
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: std::vector<Sample> CustomHistogram::ArrayToCustomRanges( const Sample* values, uint32_t num_values) { std::vector<Sample> all_values; for (uint32_t i = 0; i < num_values; ++i) { Sample value = values[i]; all_values.push_back(value); all_values.push_back(value + 1); } return all_values; }...
0
140,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 __init skcipher_module_init(void) { skcipher_default_geniv = num_possible_cpus() > 1 ? "eseqiv" : "chainiv"; return 0; } Commit Message: crypto: user - fix info leaks in report API Three errors resulting in kernel memory disclosure: 1/ The structures used for the netlink based crypto algorith...
0
31,206
Analyze the following 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 enforcedRangeShortAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); TestObjectV8Internal::enforcedRangeShortAttrAttributeGetter(info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution...
0
121,685
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Ins_EVEN( INS_ARG ) { DO_EVEN } Commit Message: CWE ID: CWE-119
0
10,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: static void i6300esb_mem_writeb(void *vp, hwaddr addr, uint32_t val) { I6300State *d = vp; i6300esb_debug("addr = %x, val = %x\n", (int) addr, val); if (addr == 0xc && val == 0x80) d->unlock_state = 1; else if (addr == 0xc && val == 0x86 && d->unlock_state == 1) d->unlock_state =...
0
13,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: string_is_word_char (const char *string) { wint_t c = utf8_wide_char (string); if (c == WEOF) return 0; if (iswalnum (c)) return 1; switch (c) { case '-': case '_': case '|': return 1; } /* not a 'word char' */ return 0; } Co...
0
7,321
Analyze the following 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 BrowserWindowGtk::ShowPageInfo(content::WebContents* web_contents, const GURL& url, const SSLStatus& ssl, bool show_history) { chrome::ShowPageInfoBubble(window_, web_contents, url, ssl, show_history...
0
118,022
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: TabLifecycleUnitExternal* TestLifecycleUnit::AsTabLifecycleUnitExternal() { return nullptr; } Commit Message: Connect the LocalDB to TabManager. Bug: 773382 Change-Id: Iec8fe5226ee175105d51f300f30b4865478ac099 Reviewed-on: https://chromium-review.googlesource.com/1118611 Commit-Queue: Sébastien Marchand <sebm...
0
132,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: void DesktopWindowTreeHostX11::OnFocusEvent(bool focus_in, int mode, int detail) { if (detail == NotifyInferior) return; bool notify_grab = mode == NotifyGrab || mode == NotifyUngrab; BeforeActivationStateChanged()...
0
140,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: SMB2_open_init(struct cifs_tcon *tcon, struct smb_rqst *rqst, __u8 *oplock, struct cifs_open_parms *oparms, __le16 *path) { struct TCP_Server_Info *server = tcon->ses->server; struct smb2_create_req *req; unsigned int n_iov = 2; __u32 file_attributes = 0; int copy_size; int uni_path_len; unsigned i...
0
88,081
Analyze the following 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::processArguments(const String& features, void* data, ArgumentsCallback callback) { int keyBegin, keyEnd; int valueBegin, valueEnd; int i = 0; int length = features.length(); String buffer = features.lower(); while (i < length) { while (isSeparator(buffer[i])) { ...
0
105,569
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: extract_pack_stream(struct archive_read *a, size_t minimum) { struct _7zip *zip = (struct _7zip *)a->format->data; ssize_t bytes_avail; int r; if (zip->codec == _7Z_COPY && zip->codec2 == (unsigned long)-1) { if (minimum == 0) minimum = 1; if (__archive_read_ahead(a, minimum, &bytes_avail) == NULL ...
0
53,545
Analyze the following 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 LoginDisplayHostWebUI::Observe( int type, const content::NotificationSource& source, const content::NotificationDetails& details) { LoginDisplayHostCommon::Observe(type, source, details); if (chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE == type || chrome::NOTIFICATION_LOGIN_NETWORK...
0
131,633
Analyze the following 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 iwjpg_set_density(struct iw_context *ctx,struct jpeg_compress_struct *cinfo, const struct iw_image *img) { int pref_units; if(img->density_code==IW_DENSITY_UNITS_UNKNOWN) { cinfo->density_unit=0; // unknown units cinfo->X_density = (UINT16)(0.5+img->density_x); cinfo->Y_density = (UINT16)(0....
0
64,827
Analyze the following 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 PixelChannels **AcquirePixelThreadSet(const Image *images) { const Image *next; PixelChannels **pixels; register ssize_t i; size_t columns, number_threads; number_threads=(size_t) GetMagickResourceLimit(ThreadResource); pixels=(PixelChannels **) AcquireQuantumMemory(...
1
170,201
Analyze the following 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 sctp_unhash_endpoint(struct sctp_endpoint *ep) { sctp_local_bh_disable(); __sctp_unhash_endpoint(ep); sctp_local_bh_enable(); } Commit Message: sctp: Fix another socket race during accept/peeloff There is a race between sctp_rcv() and sctp_accept() where we have moved the association from the listening ...
0
34,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: void WaitForCompletion() { run_loop_.Run(); } Commit Message: Hide DevTools frontend from webRequest API Prevent extensions from observing requests for remote DevTools frontends and add regression tests. And update ExtensionTestApi to support initializing the embedded test server and port from SetUpCommandLi...
0
146,558
Analyze the following 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 check_same_owner(struct task_struct *p) { const struct cred *cred = current_cred(), *pcred; bool match; rcu_read_lock(); pcred = __task_cred(p); match = (uid_eq(cred->euid, pcred->euid) || uid_eq(cred->euid, pcred->uid)); rcu_read_unlock(); return match; } Commit Message: Merge branch 'sta...
0
55,496
Analyze the following 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 ssl_parse_client_key_exchange( mbedtls_ssl_context *ssl ) { int ret; const mbedtls_ssl_ciphersuite_t *ciphersuite_info; unsigned char *p, *end; ciphersuite_info = ssl->transform_negotiate->ciphersuite_info; MBEDTLS_SSL_DEBUG_MSG( 2, ( "=> parse client key exchange" ) ); if( (...
0
86,125
Analyze the following 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 LineContribType *_gdContributionsCalc(unsigned int line_size, unsigned int src_size, double scale_d, const interpolation_method pFilter) { double width_d; double scale_f_d = 1.0; const double filter_width_d = DEFAULT_BOX_RADIUS; int windows_size; unsigned int u; LineContribType *res;...
1
170,004
Analyze the following 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 BrowserView::UpdateDevToolsForContents(TabContents* tab_contents) { DevToolsWindow* new_devtools_window = tab_contents ? DevToolsWindow::GetDockedInstanceForInspectedTab( tab_contents->web_contents()) : NULL; if (devtools_window_ == new_devtools_window) { if (!new_devtools_window || ...
0
118,466
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx, const xmlChar *URL, const xmlChar *ID, xmlNodePtr *lst) { xmlParserCtxtPtr ctxt; xmlDocPtr newDoc; xmlNodePtr newRoot; xmlSAXHandlerPtr oldsax = NULL; int ret = 0; xmlChar start[4]; xmlCharEncoding enc; if (ctx == NU...
0
59,468
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: BaseShadow::terminateJob( update_style_t kind ) // has a default argument of US_NORMAL { int reason; bool signaled; MyString str; if( ! jobAd ) { dprintf( D_ALWAYS, "In terminateJob() w/ NULL JobAd!" ); } /* The first thing we do is record that we are in a termination pending state. */ if (kind == US...
0
16,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: void TextTrack::addCue(TextTrackCue* cue) { DCHECK(cue); if (std::isnan(cue->startTime()) || std::isnan(cue->endTime()) || cue->startTime() < 0 || cue->endTime() < 0) return; if (TextTrack* cue_track = cue->track()) cue_track->removeCue(cue, ASSERT_NO_EXCEPTION); cue->SetTrack(thi...
1
171,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 btif_hh_device_t *btif_hh_find_connected_dev_by_bda(bt_bdaddr_t *bd_addr) { UINT32 i; for (i = 0; i < BTIF_HH_MAX_HID; i++) { if (btif_hh_cb.devices[i].dev_status == BTHH_CONN_STATE_CONNECTED && memcmp(&(btif_hh_cb.devices[i].bd_addr), bd_addr, BD_ADDR_LEN) == 0) { return &btif_hh_cb.de...
0
158,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: static struct page *get_current_nat_page(struct f2fs_sb_info *sbi, nid_t nid) { pgoff_t index = current_nat_addr(sbi, nid); return get_meta_page(sbi, index); } Commit Message: f2fs: fix race condition in between free nid allocator/initializer In below concurrent case, allocated nid can be loaded into free nid...
0
85,266
Analyze the following 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 ResourceDispatcherHostImpl::CompleteResponseStarted( net::URLRequest* request) { ResourceRequestInfoImpl* info = ResourceRequestInfoImpl::ForRequest(request); scoped_refptr<ResourceResponse> response(new ResourceResponse); PopulateResourceResponse(request, response); if (request->ssl_info().cer...
0
107,873
Analyze the following 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 sg_proc_open_dev(struct inode *inode, struct file *file) { return seq_open(file, &dev_seq_ops); } Commit Message: sg_start_req(): make sure that there's not too many elements in iovec unfortunately, allowing an arbitrary 16bit value means a possibility of overflow in the calculation of total ...
0
42,283
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: do_uncompress( compress_filter_context_t *zfx, z_stream *zs, IOBUF a, size_t *ret_len ) { int zrc; int rc=0; size_t n; int nread, count; int refill = !zs->avail_in; if( DBG_FILTER ) log_debug("begin inflate: avail_in=%u, avail_out=%u, inbuf=%u\n", (unsigned)zs->avail...
1
165,053
Analyze the following 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::OnEnforceInsecureRequestPolicy( blink::WebInsecureRequestPolicy policy) { frame_tree_node()->SetInsecureRequestPolicy(policy); } Commit Message: Correctly reset FP in RFHI whenever origin changes Bug: 713364 Change-Id: Id8bb923750e20f3db6fc9358b1d44120513ac95f CQ_INCLUDE_TRYBOTS...
0
127,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 AppCacheHost::AssociateCompleteCache(AppCache* cache) { DCHECK(cache && cache->is_complete()); AssociateCacheHelper(cache, cache->owning_group()->manifest_url()); } Commit Message: Fix possible map::end() dereference in AppCacheUpdateJob triggered by a compromised renderer. BUG=551044 Review URL: http...
0
124,191
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: zip_read_local_file_header(struct archive_read *a, struct archive_entry *entry, struct zip *zip) { const char *p; const void *h; const wchar_t *wp; const char *cp; size_t len, filename_length, extra_length; struct archive_string_conv *sconv; struct zip_entry *zip_entry = zip->entry; struct zip_entry z...
0
90,641
Analyze the following 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 overloadedMethodGMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { if (((info.Length() == 0))) { overloadedMethodG1Method(info); return; } if (((info.Length() == 1) && (isUndefinedOrNull(info[0]) || info[0]->IsString() || info[0]->IsObject()))) { overloadedM...
0
122,472
Analyze the following 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 CheckDeviceWallpaperMatchHash(const base::FilePath& device_wallpaper_file, const std::string& hash) { std::string image_data; if (base::ReadFileToString(device_wallpaper_file, &image_data)) { std::string sha_hash = crypto::SHA256HashString(image_data); if (base:...
0
127,972
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: nfsd4_decode_access(struct nfsd4_compoundargs *argp, struct nfsd4_access *access) { DECODE_HEAD; READ_BUF(4); access->ac_req_access = be32_to_cpup(p++); DECODE_TAIL; } Commit Message: Merge tag 'nfsd-4.12' of git://linux-nfs.org/~bfields/linux Pull nfsd updates from Bruce Fields: "Another RDMA update fro...
0
65,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: void RenderMessageFilter::OnDeleteCookie(const GURL& url, const std::string& cookie_name) { ChildProcessSecurityPolicyImpl* policy = ChildProcessSecurityPolicyImpl::GetInstance(); if (!policy->CanAccessCookiesForOrigin(render_process_id_, url)) return; net...
0
116,850
Analyze the following 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 asf_read_header(AVFormatContext *s) { ASFContext *asf = s->priv_data; AVIOContext *pb = s->pb; const GUIDParseTable *g = NULL; ff_asf_guid guid; int i, ret; uint64_t size; asf->preroll = 0; asf->is_simple_index = 0; ff_get_guid(pb, &guid); ...
0
74,870
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ssh_packet_set_state(struct ssh *ssh, struct sshbuf *m) { struct session_state *state = ssh->state; const u_char *ssh1key, *ivin, *ivout, *keyin, *keyout, *input, *output; size_t ssh1keylen, rlen, slen, ilen, olen; int r; u_int ssh1cipher = 0; if (!compat20) { if ((r = sshbuf_get_u32(m, &state->remote_pr...
1
168,656
Analyze the following 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 ProfileDependencyManager::AssertFactoriesBuilt() { if (built_factories_) return; #if defined(ENABLE_BACKGROUND) BackgroundContentsServiceFactory::GetInstance(); #endif BookmarkModelFactory::GetInstance(); #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) captive_portal::CaptivePortalServiceFactory::G...
1
171,339
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: CloseHandleEx(LPHANDLE handle) { if (handle && *handle && *handle != INVALID_HANDLE_VALUE) { CloseHandle(*handle); *handle = INVALID_HANDLE_VALUE; } return INVALID_HANDLE_VALUE; } Commit Message: Fix potential double-free() in Interactive Service (CVE-2018-9336) Malformed input d...
0
83,388
Analyze the following 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 gfx::Transform& LayerTreeHostImpl::DrawTransform() const { return external_transform_; } Commit Message: (Reland) Discard compositor frames from unloaded web content This is a reland of https://codereview.chromium.org/2707243005/ with a small change to fix an uninitialized memory error that fails on MSA...
0
137,262
Analyze the following 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 ewk_frame_load_started(Evas_Object* ewkFrame) { Evas_Object* mainFrame; DBG("ewkFrame=%p", ewkFrame); evas_object_smart_callback_call(ewkFrame, "load,started", 0); EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, smartData); ewk_view_load_started(smartData->view, ewkFrame); mainFrame = ewk_view_...
0
107,674
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: FT_Add_Module( FT_Library library, const FT_Module_Class* clazz ) { FT_Error error; FT_Memory memory; FT_Module module; FT_UInt nn; #define FREETYPE_VER_FIXED ( ( (FT_Long)FREETYPE_MAJOR << 16 ) | \ FREETYPE_MINOR ...
0
10,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: void AppCacheDatabase::OnDatabaseError(int err, sql::Statement* stmt) { was_corruption_detected_ |= sql::IsErrorCatastrophic(err); if (!db_->IsExpectedSqliteError(err)) DLOG(ERROR) << db_->GetErrorMessage(); } Commit Message: Reland "AppCache: Add padding to cross-origin responses." This is a reland of ...
0
151,298
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void vnc_listen_websocket_read(void *opaque) { vnc_listen_read(opaque, true); } Commit Message: CWE ID: CWE-264
0
8,032
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: CStarter::exitAfterGlexec( int code ) { daemonCore->Proc_Family_Cleanup(); chdir( "/" ); char* glexec_dir_path = condor_dirname( Execute ); ASSERT( glexec_dir_path ); Directory glexec_dir( glexec_dir_path ); glexec_dir.Remove_Entire_Directory(); rmdir( glexec_dir_path ); free( glexec_dir_path ); exit( ...
0
16,420
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GF_Err stri_dump(GF_Box *a, FILE * trace) { u32 i; GF_SubTrackInformationBox *p = (GF_SubTrackInformationBox *)a; gf_isom_box_dump_start(a, "SubTrackInformationBox", trace); fprintf(trace, "switch_group=\"%d\" alternate_group=\"%d\" sub_track_id=\"%d\">\n", p->switch_group, p->alternate_group, p->sub_track_i...
0
80,851
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bson_iter_recurse (const bson_iter_t *iter, /* IN */ bson_iter_t *child) /* OUT */ { const uint8_t *data = NULL; uint32_t len = 0; BSON_ASSERT (iter); BSON_ASSERT (child); if (ITER_TYPE (iter) == BSON_TYPE_DOCUMENT) { bson_iter_document (iter, &len, &data); } else...
0
77,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: static redisReply *reconnectingRedisCommand(redisContext *c, const char *fmt, ...) { redisReply *reply = NULL; int tries = 0; va_list ap; assert(!c->err); while(reply == NULL) { while (c->err & (REDIS_ERR_IO | REDIS_ERR_EOF)) { printf("\r\x1b[0K"); /* Cursor to left edge +...
0
81,982
Analyze the following 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 ipmi_init_msghandler(void) { int rv; if (initialized) return 0; rv = driver_register(&ipmidriver.driver); if (rv) { pr_err("Could not register IPMI driver\n"); return rv; } pr_info("version " IPMI_DRIVER_VERSION "\n"); timer_setup(&ipmi_timer, ipmi_timeout, 0); mod_timer(&ipmi_timer, ...
0
91,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: void conn_close_idle(conn *c) { if (settings.idle_timeout > 0 && (current_time - c->last_cmd_time) > settings.idle_timeout) { if (c->state != conn_new_cmd && c->state != conn_read) { if (settings.verbose > 1) fprintf(stderr, "fd %d wants to timeo...
0
75,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: int bmp_validate(jas_stream_t *in) { int n; int i; uchar buf[2]; assert(JAS_STREAM_MAXPUTBACK >= 2); /* Read the first two characters that constitute the signature. */ if ((n = jas_stream_read(in, (char *) buf, 2)) < 0) { return -1; } /* Put the characters read back onto the stream. */ for (i = n - 1...
0
73,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: bool Document::NeedsLayoutTreeUpdateForNode(const Node& node) const { if (!node.CanParticipateInFlatTree()) return false; if (!NeedsLayoutTreeUpdate()) return false; if (!node.isConnected()) return false; if (NeedsFullLayoutTreeUpdate() || node.NeedsStyleRecalc() || node.NeedsStyleInval...
0
134,118
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void __net_exit raw6_exit_net(struct net *net) { remove_proc_entry("raw6", net->proc_net); } Commit Message: inet: prevent leakage of uninitialized memory to user in recv syscalls Only update *addr_len when we actually fill in sockaddr, otherwise we can return uninitialized memory from the stack to the ...
0
40,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: nm_ip4_config_get_ifindex (const NMIP4Config *config) { return NM_IP4_CONFIG_GET_PRIVATE (config)->ifindex; } Commit Message: CWE ID: CWE-20
0
6,352