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: gx_device_copy_color_procs(gx_device *dev, const gx_device *target) { dev_proc_map_cmyk_color((*from_cmyk)) = dev_proc(dev, map_cmyk_color); dev_proc_map_rgb_color((*from_rgb)) = dev_proc(dev, map_rgb_color); dev_proc_map_color_rgb((*to_rgb)) = dev_proc(dev, map_color_rgb); ...
0
2,801
Analyze the following 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 js_eval(js_State *J) { if (!js_isstring(J, -1)) return; js_loadeval(J, "(eval)", js_tostring(J, -1)); js_rot2pop1(J); js_copy(J, 0); /* copy 'this' */ js_call(J, 0); } Commit Message: CWE ID: CWE-119
0
13,429
Analyze the following 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 IsSiteMuted(const TabStripModel& tab_strip, const int index) { content::WebContents* web_contents = tab_strip.GetWebContentsAt(index); GURL url = web_contents->GetLastCommittedURL(); if (url.SchemeIs(content::kChromeUIScheme)) { return web_contents->IsAudioMuted() && GetTabAudioMute...
1
171,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: void GraphicsContext3DPrivate::initializeANGLE() { ShBuiltInResources ANGLEResources; ShInitBuiltInResources(&ANGLEResources); m_context->getIntegerv(GraphicsContext3D::MAX_VERTEX_ATTRIBS, &ANGLEResources.MaxVertexAttribs); m_context->getIntegerv(GraphicsContext3D::MAX_VERTEX_UNIFORM_VECTORS, &AN...
0
107,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: sf_read_float (SNDFILE *sndfile, float *ptr, sf_count_t len) { SF_PRIVATE *psf ; sf_count_t count, extra ; VALIDATE_SNDFILE_AND_ASSIGN_PSF (sndfile, psf, 1) ; if (psf->file.mode == SFM_WRITE) { psf->error = SFE_NOT_READMODE ; return 0 ; } ; if (len % psf->sf.channels) { psf->error = SFE_BAD_READ_ALI...
0
95,370
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int md_notify_reboot(struct notifier_block *this, unsigned long code, void *x) { struct list_head *tmp; struct mddev *mddev; int need_delay = 0; for_each_mddev(mddev, tmp) { if (mddev_trylock(mddev)) { if (mddev->pers) __md_stop_writes(mddev); if (mddev->persistent) mddev->safem...
0
42,450
Analyze the following 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(const char *fmt, ...) { va_list ap; (void)fprintf(stderr, "%s: ", program_name); va_start(ap, fmt); (void)vfprintf(stderr, fmt, ap); va_end(ap); if (*fmt) { fmt += strlen(fmt); if (fmt[-1] != '\n') (void)fputc('\n', stderr); } exit_tcpdump(1); /* NOTREACHED */ } Commit Message: (for 4.9.3)...
0
93,185
Analyze the following 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::DoSampleCoverage(GLclampf value, GLboolean invert) { api()->glSampleCoverageFn(value, invert); return error::kNoError; } Commit Message: Add GL_PROGRAM_COMPLETION_QUERY_CHROMIUM This makes the query of GL_CO...
0
142,089
Analyze the following 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 path_combine(char *dest, int dest_size, const char *base_path, const char *filename) { const char *p, *p1; int len; if (dest_size <= 0) return; if (path_is_absolute(filename)) { pstrcpy(dest, dest_size, filename); } else { p = s...
0
16,910
Analyze the following 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 atl2_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) { struct atl2_adapter *adapter = netdev_priv(netdev); wol->supported = WAKE_MAGIC; wol->wolopts = 0; if (adapter->wol & ATLX_WUFC_EX) wol->wolopts |= WAKE_UCAST; if (adapter->wol & ATLX_WUFC_MC) wol->wolopts |= WAKE_MCAST...
0
55,304
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int WavpackPackSamples (WavpackContext *wpc, int32_t *sample_buffer, uint32_t sample_count) { int nch = wpc->config.num_channels; while (sample_count) { int32_t *source_pointer = sample_buffer; unsigned int samples_to_copy; if (!wpc->riff_header_added && !wpc->riff_header_created...
0
75,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: rotate_backups(const char *fname) { #ifdef __VMS # define SEP "_" # define AVS ";*" /* All-version suffix. */ # define AVSL (sizeof (AVS) - 1) #else # define SEP "." # define AVSL 0 #endif int maxlen = strlen (fname) + sizeof (SEP) + numdigit (opt.backups) + AVSL; char *from = (char *)a...
0
10,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: static long php_jpeg_emit_message(j_common_ptr jpeg_info, int level) { char message[JMSG_LENGTH_MAX]; jmpbuf_wrapper *jmpbufw; int ignore_warning = 0; jmpbufw = (jmpbuf_wrapper *) jpeg_info->client_data; if (jmpbufw != 0) { ignore_warning = jmpbufw->ignore_warning; } (jpeg_info->err->format_message)(j...
0
91,519
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void tsc210x_write(TSC210xState *s, uint16_t value) { /* * This is a two-state state machine for reading * command and data every second time. */ if (!s->state) { s->command = value >> 15; s->page = (value >> 11) & 0x0f; s->offset = (value >> 5) & 0x3f; ...
0
15,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: bool AddFilter(const std::string& event_name, const std::string& extension_id, const base::DictionaryValue& filter) { FilteredEventListenerKey key(extension_id, event_name); FilteredEventListenerCounts& all_counts = g_filtered_listener_counts.Get(); FilteredEventListenerCounts:...
0
130,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: void ContextState::RestoreIndexedUniformBufferBindings( const ContextState* prev_state) { if (!feature_info_->IsES3Capable()) return; indexed_uniform_buffer_bindings->RestoreBindings( prev_state ? prev_state->indexed_uniform_buffer_bindings.get() : nullptr); } Commit Message: Fix tabs sharing T...
0
150,002
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: const gfx::Rect& DamageRectForView(RenderWidgetHostViewAura* view) { return ImageTransportFactory::GetInstance() ->GetContextFactoryPrivate() ->GetFrameSinkManager() ->surface_manager() ->GetSurfaceForId(view->GetCurrentSurfaceId()) ->GetActiveFrame() .render_pass_list.back()...
0
145,587
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: listOwned(struct rx_call *call, afs_int32 aid, prlist *alist, afs_int32 *lastP, afs_int32 *cid) { afs_int32 code; struct ubik_trans *tt; struct prentry tentry; afs_int32 head = 0; afs_int32 start; alist->prlist_len = 0; alist->prlist_val = NULL; if (!lastP) return PRBADARG; ...
0
12,546
Analyze the following 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_xml_children(xmlNode ** children, xmlNode * root, const char *tag, const char *field, const char *value, gboolean search_matches) { int match_found = 0; CRM_CHECK(root != NULL, return FALSE); CRM_CHECK(children != NULL, return FALSE); if (tag != NULL && safe_str_neq(tag, c...
0
44,048
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: FontFileInitTable (FontTablePtr table, int size) { if (size < 0 || (size > INT32_MAX/sizeof(FontEntryRec))) return FALSE; if (size) { table->entries = malloc(sizeof(FontEntryRec) * size); if (!table->entries) return FALSE; } else table->entries = 0; table->used = 0; table->siz...
0
2,867
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: vips_foreign_is_a( const char *loader, const char *filename ) { const VipsObjectClass *class; VipsForeignLoadClass *load_class; if( !(class = vips_class_find( "VipsForeignLoad", loader )) ) return( FALSE ); load_class = VIPS_FOREIGN_LOAD_CLASS( class ); if( load_class->is_a && load_class->is_a( filenam...
0
83,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: inline Editor& InputMethodController::GetEditor() const { return GetFrame().GetEditor(); } Commit Message: Move SelectionTemplate::is_handle_visible_ to FrameSelection This patch moves |is_handle_visible_| to |FrameSelection| from |SelectionTemplate| since handle visibility is used only for setting |FrameSele...
0
124,876
Analyze the following 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(gd_info) { if (zend_parse_parameters_none() == FAILURE) { RETURN_FALSE; } array_init(return_value); add_assoc_string(return_value, "GD Version", PHP_GD_VERSION_STRING, 1); #ifdef ENABLE_GD_TTF add_assoc_bool(return_value, "FreeType Support", 1); #if HAVE_LIBFREETYPE add_assoc_string(return...
0
50,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: HTMLImportChild* HTMLImportsController::CreateChild( const KURL& url, HTMLImportLoader* loader, HTMLImport* parent, HTMLImportChildClient* client) { HTMLImport::SyncMode mode = client->IsSync() && !MakesCycle(parent, url) ? HTMLImport::kSync ...
0
145,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: error::Error GLES2DecoderImpl::HandleBeginQueryEXT( uint32_t immediate_data_size, const volatile void* cmd_data) { const volatile gles2::cmds::BeginQueryEXT& c = *static_cast<const volatile gles2::cmds::BeginQueryEXT*>(cmd_data); GLenum target = static_cast<GLenum>(c.target); GLuint client_id ...
0
145,896
Analyze the following 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 Part::setFileNameFromArchive() { const QString prettyName = url().fileName(); m_infoPanel->setPrettyFileName(prettyName); m_infoPanel->updateWithDefaults(); emit setWindowCaption(prettyName); } Commit Message: CWE ID: CWE-78
0
9,912
Analyze the following 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 int apic_lvtt_oneshot(struct kvm_lapic *apic) { return ((kvm_apic_get_reg(apic, APIC_LVTT) & apic->lapic_timer.timer_mode_mask) == APIC_LVT_TIMER_ONESHOT); } Commit Message: KVM: x86: fix guest-initiated crash with x2apic (CVE-2013-6376) A guest can cause a BUG_ON() leading to a host kernel cra...
0
28,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 inline struct hugepage_subpool *subpool_vma(struct vm_area_struct *vma) { return subpool_inode(vma->vm_file->f_dentry->d_inode); } Commit Message: hugetlb: fix resv_map leak in error path When called for anonymous (non-shared) mappings, hugetlb_reserve_pages() does a resv_map_alloc(). It depends on cod...
0
19,762
Analyze the following 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 hstate_next_node_to_alloc(struct hstate *h, nodemask_t *nodes_allowed) { int nid; VM_BUG_ON(!nodes_allowed); nid = get_valid_node_allowed(h->next_nid_to_alloc, nodes_allowed); h->next_nid_to_alloc = next_node_allowed(nid, nodes_allowed); return nid; } Commit Message: hugetlb: fix resv_map...
0
19,687
Analyze the following 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 get_futex_value_locked(u32 *dest, u32 __user *from) { int ret; pagefault_disable(); ret = __copy_from_user_inatomic(dest, from, sizeof(u32)); pagefault_enable(); return ret ? -EFAULT : 0; } Commit Message: futex-prevent-requeue-pi-on-same-futex.patch futex: Forbid uaddr == uaddr2 in futex_reque...
0
38,216
Analyze the following 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 RenderViewImpl::OnUpdateTimezone() { if (webview()) NotifyTimezoneChange(webview()->mainFrame()); } Commit Message: Let the browser handle external navigations from DevTools. BUG=180555 Review URL: https://chromiumcodereview.appspot.com/12531004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@...
0
115,571
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: const Cluster* BlockEntry::GetCluster() const { return m_pCluster; } 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 dif...
1
174,291
Analyze the following 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_emulation_failure(struct kvm_vcpu *vcpu) { ++vcpu->stat.insn_emulation_fail; trace_kvm_emulate_insn_failed(vcpu); vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR; vcpu->run->internal.suberror = KVM_INTERNAL_ERROR_EMULATION; vcpu->run->internal.ndata = 0; kvm_queue_exception(vcpu, UD_...
1
166,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: status_t Camera3Device::RequestThread::waitUntilRequestProcessed( int32_t requestId, nsecs_t timeout) { Mutex::Autolock l(mLatestRequestMutex); status_t res; while (mLatestRequestId != requestId) { nsecs_t startTime = systemTime(); res = mLatestRequestSignal.waitRelative(mLatestRequestMutex, timeout...
0
161,121
Analyze the following 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 _WM_do_note_off_extra(struct _note *nte) { MIDI_EVENT_DEBUG(__FUNCTION__,0, 0); nte->is_off = 0; { if (!(nte->modes & SAMPLE_ENVELOPE)) { if (nte->modes & SAMPLE_LOOP) { nte->modes ^= SAMPLE_LOOP; } nte->env_inc = 0; } else...
0
63,257
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PageSerializer::PageSerializer(Vector<SerializedResource>* resources, PassOwnPtr<Delegate> delegate) : m_resources(resources) , m_blankFrameCounter(0) , m_delegate(delegate) { } Commit Message: Escape "--" in the page URL at page serialization This patch makes page serializer to escape the page URL ...
0
125,329
Analyze the following 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(imagepstext) { zval *img, *fnt; int i, j; long _fg, _bg, x, y, size, space = 0, aa_steps = 4, width = 0; int *f_ind; int h_lines, v_lines, c_ind; int rd, gr, bl, fg_rd, fg_gr, fg_bl, bg_rd, bg_gr, bg_bl; int fg_al, bg_al, al; int aa[16]; int amount_kern, add_width; double angle = 0.0, exten...
0
15,172
Analyze the following 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 padlock_sha256_final_nano(struct shash_desc *desc, u8 *out) { struct sha256_state *state = (struct sha256_state *)shash_desc_ctx(desc); unsigned int partial, padlen; __be64 bits; static const u8 padding[64] = { 0x80, }; bits = cpu_to_be64(state->count << 3); /* Pad out to 56 mod 64 */ partia...
0
47,456
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void perf_output_end(struct perf_output_handle *handle) { struct perf_event *event = handle->event; struct ring_buffer *rb = handle->rb; if (handle->sample && !event->attr.watermark) { int wakeup_events = event->attr.wakeup_events; if (wakeup_events) { int events = local_inc_return(&rb->events); if...
0
26,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: void RenderFrameHostImpl::SetNetworkFactoryForTesting( const CreateNetworkFactoryCallback& create_network_factory_callback) { DCHECK(!BrowserThread::IsThreadInitialized(BrowserThread::UI) || BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(create_network_factory_callback.is_null() || ...
0
139,412
Analyze the following 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 __exit exit_hugetlbfs_fs(void) { kmem_cache_destroy(hugetlbfs_inode_cachep); kern_unmount(hugetlbfs_vfsmount); unregister_filesystem(&hugetlbfs_fs_type); bdi_destroy(&hugetlbfs_backing_dev_info); } Commit Message: hugepages: fix use after free bug in "quota" handling hugetlbfs_{get,put}_quota() ...
0
20,211
Analyze the following 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 S_AL_StopAllSounds( void ) { int i; S_AL_SrcShutup(); S_AL_StopBackgroundTrack(); for (i = 0; i < MAX_RAW_STREAMS; i++) S_AL_StreamDie(i); } Commit Message: Don't open .pk3 files as OpenAL drivers. CWE ID: CWE-269
0
95,559
Analyze the following 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 ucma_bind(struct ucma_file *file, const char __user *inbuf, int in_len, int out_len) { struct rdma_ucm_bind cmd; struct sockaddr *addr; struct ucma_context *ctx; int ret; if (copy_from_user(&cmd, inbuf, sizeof(cmd))) return -EFAULT; addr = (struct sockaddr *) &cmd.addr; if (cmd.reser...
0
52,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 void read_pathspec_from_stdin(struct rev_info *revs, struct strbuf *sb, struct cmdline_pathspec *prune) { while (strbuf_getline(sb, stdin) != EOF) { ALLOC_GROW(prune->path, prune->nr + 1, prune->alloc); prune->path[prune->nr++] = xstrdup(sb->buf); } } Commit Message: list-objects: pass full...
0
55,029
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: init_protoidarray(netdissect_options *ndo) { register int i; register struct protoidmem *tp; const struct protoidlist *pl; u_char protoid[5]; protoid[0] = 0; protoid[1] = 0; protoid[2] = 0; for (i = 0; eproto_db[i].s; i++) { u_short etype = htons(eproto_db[i].p); memcpy((char *)&protoid[3], (char *)...
0
62,596
Analyze the following 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 DevToolsWindow::OpenDevToolsWindow( scoped_refptr<content::DevToolsAgentHost> agent_host, Profile* profile) { if (!profile) profile = Profile::FromBrowserContext(agent_host->GetBrowserContext()); if (!profile) return; std::string type = agent_host->GetType(); bool is_worker = type =...
0
138,413
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void PDFiumEngine::DeviceToPage(int page_index, float device_x, float device_y, double* page_x, double* page_y) { *page_x = *page_y = 0; int temp_x = static_cast<int>((device_x + pos...
0
146,100
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: cifs_umount(struct cifs_sb_info *cifs_sb) { struct rb_root *root = &cifs_sb->tlink_tree; struct rb_node *node; struct tcon_link *tlink; cancel_delayed_work_sync(&cifs_sb->prune_tlinks); spin_lock(&cifs_sb->tlink_tree_lock); while ((node = rb_first(root))) { tlink = rb_entry(node, struct tcon_link, tl_rb...
0
29,841
Analyze the following 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 isolate_movable_page(struct page *page, isolate_mode_t mode) { struct address_space *mapping; /* * Avoid burning cycles with pages that are yet under __free_pages(), * or just got freed under us. * * In case we 'win' a race for a movable page being freed under us and * raise its refcount preventi...
0
61,697
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: unsigned paravirt_patch_jmp(void *insnbuf, const void *target, unsigned long addr, unsigned len) { struct branch *b = insnbuf; unsigned long delta = (unsigned long)target - (addr+5); if (len < 5) return len; /* call too long for patch site */ b->opcode = 0xe9; /* jmp */ b->delta = delta; ...
1
169,100
Analyze the following 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 unsigned short ReadPropertyUnsignedShort(const EndianType endian, const unsigned char *buffer) { unsigned short value; if (endian == LSBEndian) { value=(unsigned short) buffer[1] << 8; value|=(unsigned short) buffer[0]; return(value & 0xffff); } value=(unsigned...
0
50,611
Analyze the following 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 tracer_tracing_off(struct trace_array *tr) { if (tr->trace_buffer.buffer) ring_buffer_record_off(tr->trace_buffer.buffer); /* * This flag is looked at when buffers haven't been allocated * yet, or by some tracers (like irqsoff), that just want to * know if the ring buffer has been disabled, but it ...
0
81,449
Analyze the following 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 __sk_free(struct sock *sk) { if (unlikely(sock_diag_has_destroy_listeners(sk) && sk->sk_net_refcnt)) sock_diag_broadcast_destroy(sk); else sk_destruct(sk); } Commit Message: net: avoid signed overflows for SO_{SND|RCV}BUFFORCE CAP_NET_ADMIN users should not be allowed to set negative sk_sndbuf...
0
47,854
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: next_matching_table(const struct ofproto *ofproto, const struct oftable *table, uint8_t table_id) { return (table_id == 0xff ? next_visible_table(ofproto, (table - ofproto->tables) + 1) : NULL); } Commit Message: ofproto: Fix OVS crash when reverting old flows in b...
0
77,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: static void collapse_huge_page(struct mm_struct *mm, unsigned long address, struct page **hpage, struct vm_area_struct *vma, int node) { pgd_t *pgd; pud_t *pud; pmd_t *pmd, _pmd; pte_t *pte; pgtable_t pgtable; struct page *new_page; spinlock_t *ptl; int isolated; u...
1
166,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 ProfilingProcessHost::MakeConnector( content::ServiceManagerConnection* connection) { connector_ = connection->GetConnector()->Clone(); } Commit Message: [Reland #1] Add Android OOP HP end-to-end tests. The original CL added a javatest and its dependencies to the apk_under_test. This causes the depen...
0
150,211
Analyze the following 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_SDS( TT_ExecContext exc, FT_Long* args ) { if ( (FT_ULong)args[0] > 6UL ) exc->error = FT_THROW( Bad_Argument ); else exc->GS.delta_shift = (FT_UShort)args[0]; } Commit Message: CWE ID: CWE-476
0
10,664
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: EXPORTED int mboxlist_usersubs(const char *userid, mboxlist_cb *proc, void *rock, int flags) { struct db *subs = NULL; struct submb_rock mbrock = { NULL, userid, flags, proc, rock }; int r = 0; /* open subs DB */ r = mboxlist_opensubs(userid, &subs); if (r) ...
0
61,305
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: http_DissectRequest(struct sess *sp) { struct http_conn *htc; struct http *hp; uint16_t retval; CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); htc = sp->htc; CHECK_OBJ_NOTNULL(htc, HTTP_CONN_MAGIC); hp = sp->http; CHECK_OBJ_NOTNULL(hp, HTTP_MAGIC); hp->logtag = HTTP_Rx; retval = http_splitline(sp->wrk, sp->fd, h...
0
95,015
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gfx::Size SettingLevelBubbleView::GetPreferredSize() { return gfx::Size(kWidth, kHeight); } Commit Message: chromeos: Move audio, power, and UI files into subdirs. This moves more files from chrome/browser/chromeos/ into subdirectories. BUG=chromium-os:22896 TEST=did chrome os builds both with and without au...
0
109,335
Analyze the following 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_METHOD(Phar, canWrite) { if (zend_parse_parameters_none() == FAILURE) { return; } RETURN_BOOL(!PHAR_G(readonly)); } Commit Message: CWE ID:
0
4,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: PHP_METHOD(Phar, getSignature) { PHAR_ARCHIVE_OBJECT(); if (zend_parse_parameters_none() == FAILURE) { return; } if (phar_obj->arc.archive->signature) { char *unknown; int unknown_len; array_init(return_value); add_assoc_stringl(return_value, "hash", phar_obj->arc.archive->signature, phar_obj->a...
0
4,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: static void _sx_sasl_features(sx_t s, sx_plugin_t p, nad_t nad) { _sx_sasl_t ctx = (_sx_sasl_t) p->private; Gsasl_session *sd = (Gsasl_session *) s->plugin_data[p->index]; int nmechs, ret; char *mechs, *mech, *c; if(s->type != type_SERVER) return; if(sd != NULL) { _sx_deb...
0
63,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 vmci_transport_release_pending(struct sock *pending) { sock_put(pending); } Commit Message: VSOCK: vmci - fix possible info leak in vmci_transport_dgram_dequeue() In case we received no data on the call to skb_recv_datagram(), i.e. skb->data is NULL, vmci_transport_dgram_dequeue() will return with ...
0
30,413
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static char *get_sessionid(json_t *val) { char *ret = NULL; json_t *arr_val; int arrsize, i; arr_val = json_array_get(val, 0); if (!arr_val || !json_is_array(arr_val)) goto out; arrsize = json_array_size(arr_val); for (i = 0; i < arrsize; i++) { json_t *arr = json_array_get(arr_val, i); char *notify...
0
36,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: static int setup_network(struct lxc_list *network) { struct lxc_list *iterator; struct lxc_netdev *netdev; lxc_list_for_each(iterator, network) { netdev = iterator->elem; if (setup_netdev(netdev)) { ERROR("failed to setup netdev"); return -1; } } if (!lxc_list_empty(network)) INFO("network ...
0
44,642
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: child_wait_handler(vector_t *strvec) { unsigned secs; if (!strvec) return; if (!read_unsigned_strvec(strvec, 1, &secs, 0, UINT_MAX, false)) { report_config_error(CONFIG_GENERAL_ERROR, "Invalid child_wait_time %s", FMT_STR_VSLOT(strvec, 1)); return; } child_wait_time = secs; } Commit Message: Add co...
0
75,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: void Document::UpdateStyleInvalidationIfNeeded() { DCHECK(IsActive()); ScriptForbiddenScope forbid_script; if (!ChildNeedsStyleInvalidation() && !NeedsStyleInvalidation()) return; TRACE_EVENT0("blink", "Document::updateStyleInvalidationIfNeeded"); GetStyleEngine().InvalidateStyle(); } Commit Messa...
0
154,804
Analyze the following 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 RenderBox::autoWidthShouldFitContent() const { return node() && (isHTMLInputElement(*node()) || isHTMLSelectElement(*node()) || isHTMLButtonElement(*node()) || isHTMLTextAreaElement(*node()) || (isHTMLLegendElement(*node()) && !style()->hasOutOfFlowPosition())); } Commit Message: Separate repain...
0
116,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 void index_free(git_index *index) { /* index iterators increment the refcount of the index, so if we * get here then there should be no outstanding iterators. */ assert(!git_atomic_get(&index->readers)); git_index_clear(index); git_idxmap_free(index->entries_map); git_vector_free(&index->entries)...
0
83,741
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: HTMLMediaElement* MediaElementAudioSourceNode::mediaElement() const { return GetMediaElementAudioSourceHandler().MediaElement(); } Commit Message: Simplify "WouldTaintOrigin" concept in media/blink Currently WebMediaPlayer has three predicates: - DidGetOpaqueResponseFromServiceWorker - HasSingleSecurityOrig...
0
144,639
Analyze the following 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 __init int intel_pmu_init(void) { union cpuid10_edx edx; union cpuid10_eax eax; unsigned int unused; unsigned int ebx; int version; if (!cpu_has(&boot_cpu_data, X86_FEATURE_ARCH_PERFMON)) { switch (boot_cpu_data.x86) { case 0x6: return p6_pmu_init(); case 0xf: return p4_pmu_init(); } ...
0
25,819
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int create_intf_ep_devs(struct usb_interface *intf) { struct usb_device *udev = interface_to_usbdev(intf); struct usb_host_interface *alt = intf->cur_altsetting; int i; if (intf->ep_devs_created || intf->unregistering) return 0; for (i = 0; i < alt->desc.bNumEndpoints; ++i) (void) usb_create_ep_...
0
59,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: e1000e_intrmgr_on_timer(void *opaque) { E1000IntrDelayTimer *timer = opaque; trace_e1000e_irq_throttling_timer(timer->delay_reg << 2); timer->running = false; e1000e_intrmgr_fire_delayed_interrupts(timer->core); } Commit Message: CWE ID: CWE-835
0
5,988
Analyze the following 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 DevToolsUIBindings::DidNavigateMainFrame() { frontend_loaded_ = false; } Commit Message: DevTools: move front-end URL handling to DevToolsUIBindingds BUG=662859 Review-Url: https://codereview.chromium.org/2607833002 Cr-Commit-Position: refs/heads/master@{#440926} CWE ID: CWE-200
0
138,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: void Document::setAnimatingFullScreen(bool flag) { if (m_isAnimatingFullScreen == flag) return; m_isAnimatingFullScreen = flag; if (m_fullScreenElement && m_fullScreenElement->isDescendantOf(this)) { m_fullScreenElement->setNeedsStyleRecalc(); scheduleForcedStyleRecalc(); ...
0
105,601
Analyze the following 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 is_imm8(int value) { return value <= 127 && value >= -128; } Commit Message: x86: bpf_jit: fix compilation of large bpf programs x86 has variable length encoding. x86 JIT compiler is trying to pick the shortest encoding for given bpf instruction. While doing so the jump targets are changing, so JIT...
0
43,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: bool WebGLImageConversion::PackImageData( Image* image, const void* pixels, GLenum format, GLenum type, bool flip_y, AlphaOp alpha_op, DataFormat source_format, unsigned source_image_width, unsigned source_image_height, const IntRect& source_image_sub_rectangle, int dep...
0
146,722
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void kvm_put_guest_fpu(struct kvm_vcpu *vcpu) { kvm_put_guest_xcr0(vcpu); if (!vcpu->guest_fpu_loaded) return; vcpu->guest_fpu_loaded = 0; fpu_save_init(&vcpu->arch.guest_fpu); __kernel_fpu_end(); ++vcpu->stat.fpu_reload; kvm_make_request(KVM_REQ_DEACTIVATE_FPU, vcpu); trace_kvm_fpu(0); } Commit Mess...
0
28,872
Analyze the following 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 tree_content_set( struct tree_entry *root, const char *p, const unsigned char *sha1, const uint16_t mode, struct tree_content *subtree) { struct tree_content *t; const char *slash1; unsigned int i, n; struct tree_entry *e; slash1 = strchrnul(p, '/'); n = slash1 - p; if (!n) die("Empty pa...
0
55,147
Analyze the following 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 WebGLRenderingContextBase::CopyRenderingResultsFromDrawingBuffer( AcceleratedImageBufferSurface* webgl_buffer, SourceDrawingBuffer source_buffer) const { if (!drawing_buffer_) return false; std::unique_ptr<WebGraphicsContext3DProvider> provider = Platform::Current()->CreateSharedOffscre...
0
146,910
Analyze the following 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::string PrintPreviewUI::GetPrintPreviewUIAddress() const { char preview_ui_addr[2 + (2 * sizeof(this)) + 1]; base::snprintf(preview_ui_addr, sizeof(preview_ui_addr), "%p", this); return preview_ui_addr; } Commit Message: Print preview: Use an ID instead of memory pointer string in WebUI. BUG=144051 ...
1
170,835
Analyze the following 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::SetMetroSnapMode(bool enable) { HISTOGRAM_COUNTS("Metro.SnapModeToggle", enable); ProcessFullscreen(enable, FOR_METRO, GURL(), FEB_TYPE_NONE); } Commit Message: Remove TabContents from TabStripModelObserver::TabDetachedAt. BUG=107201 TEST=no visible change Review URL: https://chromiumcod...
0
118,434
Analyze the following 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 fault_in_kernel_space(unsigned long address) { return address >= TASK_SIZE_MAX; } Commit Message: perf: Remove the nmi parameter from the swevent and overflow interface The nmi parameter indicated if we could do wakeups from the current context, if not, we would set some state and self-IPI and let t...
0
25,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: static int iscsi_check_for_auth_key(char *key) { /* * RFC 1994 */ if (!strcmp(key, "CHAP_A") || !strcmp(key, "CHAP_I") || !strcmp(key, "CHAP_C") || !strcmp(key, "CHAP_N") || !strcmp(key, "CHAP_R")) return 1; /* * RFC 2945 */ if (!strcmp(key, "SRP_U") || !strcmp(key, "SRP_N") || !strc...
0
30,964
Analyze the following 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 AppListSyncableService::TrackUninstalledDriveApp( const std::string& drive_app_id) { const std::string sync_id = GetDriveAppSyncId(drive_app_id); SyncItem* sync_item = FindSyncItem(sync_id); if (sync_item) { DCHECK_EQ(sync_item->item_type, sync_pb::AppListSpecifics::TYPE_REMOVE_DE...
0
123,932
Analyze the following 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 RenderThreadImpl::WidgetHidden() { DCHECK_LT(hidden_widget_count_, widget_count_); hidden_widget_count_++; if (RendererIsHidden()) OnRendererHidden(); } Commit Message: Roll src/third_party/boringssl/src 664e99a64..696c13bd6 https://boringssl.googlesource.com/boringssl/+log/664e99a6486c293728097c...
0
150,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: const char* CMSEXPORT cmsIT8GetProperty(cmsHANDLE hIT8, const char* Key) { cmsIT8* it8 = (cmsIT8*) hIT8; KEYVALUE* p; if (IsAvailableOnList(GetTable(it8) -> HeaderList, Key, NULL, &p)) { return p -> Value; } return NULL; } Commit Message: Upgrade Visual studio 2017 15.8 - Upgrad...
0
78,069
Analyze the following 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 l_userauth_publickey (lua_State *L) { return userauth_publickey(L, 0, 0); } Commit Message: Avoid a crash (double-free) when SSH connection fails CWE ID: CWE-415
0
93,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: IW_IMPL(void*) iw_realloc(struct iw_context *ctx, void *oldmem, size_t oldmem_size, size_t newmem_size) { return iw_realloc_ex(ctx,0,oldmem,oldmem_size,newmem_size); } Commit Message: Trying to fix some invalid left shift operations Fixes issue #16 CWE ID: CWE-682
0
66,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 void truncate_hugepages(struct inode *inode, loff_t lstart) { struct hstate *h = hstate_inode(inode); struct address_space *mapping = &inode->i_data; const pgoff_t start = lstart >> huge_page_shift(h); struct pagevec pvec; pgoff_t next; int i, freed = 0; pagevec_init(&pvec, 0); next = start; whil...
0
20,242
Analyze the following 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 WebPage::paste() { if (d->m_page->defersLoading()) return; d->m_inputHandler->paste(); } Commit Message: [BlackBerry] Adapt to new BlackBerry::Platform::TouchPoint API https://bugs.webkit.org/show_bug.cgi?id=105143 RIM PR 171941 Reviewed by Rob Buis. Internally reviewed by George Staikos. ...
0
104,322
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int get_asf_string(AVIOContext *pb, int maxlen, char *buf, int buflen) { char *q = buf; int ret = 0; if (buflen <= 0) return AVERROR(EINVAL); while (ret + 1 < maxlen) { uint8_t tmp; uint32_t ch; GET_UTF16(ch, (ret += 2) <= maxlen ? avio_rl16(pb) : 0, break;);...
0
74,895
Analyze the following 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 RenderThreadImpl::InitializeCompositorThread() { base::Thread::Options options; #if defined(OS_ANDROID) options.priority = base::ThreadPriority::DISPLAY; #endif compositor_thread_ = blink::scheduler::WebThreadBase::CreateCompositorThread(options); blink_platform_impl_->SetCompositorThread(compo...
0
150,536
Analyze the following 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 sched_init_granularity(void) { update_sysctl(); } Commit Message: sched/fair: Fix infinite loop in update_blocked_averages() by reverting a9e7f6544b9c Zhipeng Xie, Xie XiuQi and Sargun Dhillon reported lockups in the scheduler under high loads, starting at around the v4.18 time frame, and Zhipeng Xie trac...
0
92,662
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int hashtable_init(hashtable_t *hashtable) { size_t i; hashtable->size = 0; hashtable->num_buckets = 0; /* index to primes[] */ hashtable->buckets = jsonp_malloc(num_buckets(hashtable) * sizeof(bucket_t)); if(!hashtable->buckets) return -1; list_init(&hashtable->list); ...
1
166,531
Analyze the following 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 __ref register_cu2_notifier(struct notifier_block *nb) { return raw_notifier_chain_register(&cu2_chain, nb); } Commit Message: perf: Remove the nmi parameter from the swevent and overflow interface The nmi parameter indicated if we could do wakeups from the current context, if not, we would set some state ...
0
25,414
Analyze the following 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 ovl_want_write(struct dentry *dentry) { struct ovl_fs *ofs = dentry->d_sb->s_fs_info; return mnt_want_write(ofs->upper_mnt); } Commit Message: fs: limit filesystem stacking depth Add a simple read-only counter to super_block that indicates how deep this is in the stack of filesystems. Previously ecryptfs...
0
74,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: static void set_empty_dir(struct ctl_dir *dir) { dir->header.ctl_table[0].child = sysctl_mount_point; } Commit Message: sysctl: Drop reference added by grab_header in proc_sys_readdir Fixes CVE-2016-9191, proc_sys_readdir doesn't drop reference added by grab_header when return from !dir_emit_dots path. It can ...
0
48,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: void CloudPolicyController::DoWork() { switch (state_) { case STATE_TOKEN_UNAVAILABLE: case STATE_TOKEN_ERROR: FetchToken(); return; case STATE_TOKEN_VALID: case STATE_POLICY_VALID: case STATE_POLICY_ERROR: case STATE_POLICY_UNAVAILABLE: SendPolicyRequest(); retur...
0
97,756