instruction
stringclasses
1 value
input
stringlengths
64
129k
output
int64
0
1
__index_level_0__
int64
0
30k
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: nfs4_file_get_access(struct nfs4_file *fp, u32 access) { lockdep_assert_held(&fp->fi_lock); /* Does this access mode make sense? */ if (access & ~NFS4_SHARE_ACCESS_BOTH) return nfserr_inval; /* Does it conflict with a deny mode already set? */ if ((access & fp->fi_share_deny) != 0) return nfserr_share_...
0
11,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: nautilus_file_operations_unmount_mount (GtkWindow *parent_window, GMount *mount, gboolean eject, gboolean check_trash) { nautilus_file_operations_unmount_mount_full (parent_window, mo...
0
23,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: void AudioHandler::AddOutput(unsigned number_of_channels) { DCHECK(IsMainThread()); outputs_.push_back(AudioNodeOutput::Create(this, number_of_channels)); GetNode()->DidAddOutput(NumberOfOutputs()); } Commit Message: Revert "Keep AudioHandlers alive until they can be safely deleted." This reverts commit 0...
0
11,139
Analyze the following 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 TriggerShowLoginWizardFinish( std::string switch_locale, std::unique_ptr<ShowLoginWizardSwitchLanguageCallbackData> data) { if (switch_locale.empty()) { ShowLoginWizardFinish(data->first_screen, data->startup_manifest); } else { chromeos::locale_util::SwitchLanguageCallback callback( ...
0
27,699
Analyze the following 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 RootWindow::SetGestureRecognizerForTesting(ui::GestureRecognizer* gr) { gesture_recognizer_.reset(gr); } Commit Message: Introduce XGetImage() for GrabWindowSnapshot() in ChromeOS. BUG=119492 TEST=manually done Review URL: https://chromiumcodereview.appspot.com/10386124 git-svn-id: svn://svn.chromium.o...
0
13,152
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: AudioSystemImplTest() : use_audio_thread_(GetParam()), audio_thread_("AudioSystemThread") { if (use_audio_thread_) { audio_thread_.StartAndWaitForTesting(); audio_manager_.reset( new media::MockAudioManager(audio_thread_.task_runner())); } else { audio_manager_.res...
1
19,927
Analyze the following 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 tracing_snapshot_cond_enable(struct trace_array *tr, void *cond_data, cond_update_fn_t update) { return -ENODEV; } Commit Message: Merge branch 'page-refs' (page ref overflow) Merge page ref overflow branch. Jann Horn reported that he can overflow the page ref count with sufficient memory (and a filesyste...
0
10,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: explicit MockScriptLoader(Element* element) : ScriptLoader(element, false, false) { } Commit Message: Add assertions that the empty Platform::cryptographicallyRandomValues() overrides are not being used. These implementations are not safe and look scary if not accompanied by an assertion. Also one o...
0
7,996
Analyze the following 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 MetricsLog::RecordCurrentSessionData( DelegatingProvider* delegating_provider, base::TimeDelta incremental_uptime, base::TimeDelta uptime) { DCHECK(!closed_); DCHECK(has_environment_); WriteRealtimeStabilityAttributes(incremental_uptime, uptime); delegating_provider->ProvideCurrentSessi...
0
14,364
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: OMX_ERRORTYPE omx_vdec::push_input_h264 (OMX_HANDLETYPE hComp) { OMX_U32 partial_frame = 1; unsigned long address = 0, p2 = 0, id = 0; OMX_BOOL isNewFrame = OMX_FALSE; OMX_BOOL generate_ebd = OMX_TRUE; if (h264_scratch.pBuffer == NULL) { DEBUG_PRINT_ERROR("ERROR:H.264 Scratch Buffer not all...
0
4,317
Analyze the following 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 ContextCreationAttribParser::Parse(const std::vector<int32>& attribs) { const int32 EGL_ALPHA_SIZE = 0x3021; const int32 EGL_BLUE_SIZE = 0x3022; const int32 EGL_GREEN_SIZE = 0x3023; const int32 EGL_RED_SIZE = 0x3024; const int32 EGL_DEPTH_SIZE = 0x3025; const int32 EGL_STENCIL_SIZE = 0x3026; co...
0
6,336
Analyze the following 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 HTMLInputElement::IsValidValue(const String& value) const { if (!input_type_->CanSetStringValue()) { NOTREACHED(); return false; } return !input_type_->TypeMismatchFor(value) && !input_type_->StepMismatch(value) && !input_type_->RangeUnderflow(value) && !input_type_->...
0
28,292
Analyze the following 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 sched_domains_numa_masks_clear(unsigned int cpu) { int i, j; for (i = 0; i < sched_domains_numa_levels; i++) { for (j = 0; j < nr_node_ids; j++) cpumask_clear_cpu(cpu, sched_domains_numa_masks[i][j]); } } Commit Message: Merge branch 'stacking-fixes' (vfs stacking fixes from Jann) Merge fil...
0
18,171
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void RenderThreadImpl::OnAssociatedInterfaceRequest( const std::string& name, mojo::ScopedInterfaceEndpointHandle handle) { if (associated_interfaces_.CanBindRequest(name)) associated_interfaces_.BindRequest(name, std::move(handle)); else ChildThreadImpl::OnAssociatedInterfaceRequest(name, std...
0
1,028
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: size_t nw_buf_list_append(nw_buf_list *list, const void *data, size_t len) { if (list->limit && list->count >= list->limit) return 0; nw_buf *buf = nw_buf_alloc(list->pool); if (buf == NULL) return 0; if (len > buf->size) { nw_buf_free(list->pool, buf); return 0; ...
0
16,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: GF_Err stsz_dump(GF_Box *a, FILE * trace) { GF_SampleSizeBox *p; u32 i; p = (GF_SampleSizeBox *)a; if (a->type == GF_ISOM_BOX_TYPE_STSZ) { gf_isom_box_dump_start(a, "SampleSizeBox", trace); } else { gf_isom_box_dump_start(a, "CompactSampleSizeBox", trace); } fprintf(trace, "SampleCount=\"%d\"", p->...
0
1,079
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: write_basic_field (DBusTypeWriter *writer, int field, int type, const void *value) { DBusTypeWriter sub; DBusTypeWriter variant; int start; int padding; unsigned char field_byte; DBusString contained_type; char buf[...
0
21,550
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: __archive_write_nulls(struct archive_write *a, size_t length) { if (length == 0) return (ARCHIVE_OK); while (length > 0) { size_t to_write = length < a->null_length ? length : a->null_length; int r = __archive_write_output(a, a->nulls, to_write); if (r < ARCHIVE_OK) return (r); length -= to_write;...
0
6,372
Analyze the following 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 V8Debugger::getCompiledScripts(int contextGroupId, std::vector<std::unique_ptr<V8DebuggerScript>>& result) { v8::HandleScope scope(m_isolate); v8::MicrotasksScope microtasks(m_isolate, v8::MicrotasksScope::kDoNotRunMicrotasks); v8::Local<v8::Object> debuggerScript = m_debuggerScript.Get(m_isolate...
0
29,457
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void __exit hidp_cleanup_sockets(void) { bt_procfs_cleanup(&init_net, "hidp"); bt_sock_unregister(BTPROTO_HIDP); proto_unregister(&hidp_proto); } Commit Message: Bluetooth: hidp: fix buffer overflow Struct ca is copied from userspace. It is not checked whether the "name" field is NULL terminated, which allow...
0
5,241
Analyze the following 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 SiteInstanceImpl::SetSite(const GURL& url) { TRACE_EVENT2("navigation", "SiteInstanceImpl::SetSite", "site id", id_, "url", url.possibly_invalid_spec()); DCHECK(!has_site_); has_site_ = true; BrowserContext* browser_context = browsing_instance_->browser_context(); site_ = GetSiteFor...
0
17,733
Analyze the following 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::updateFromStyle() { RenderBoxModelObject::updateFromStyle(); RenderStyle* styleToUse = style(); bool isRootObject = isDocumentElement(); bool isViewObject = isRenderView(); if (isRootObject || isViewObject) setHasBoxDecorations(true); setFloating(!isOutOfFlowPosi...
0
13,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 open_logs(void) { int access_log; /* if error_log_name is set, dup2 stderr to it */ /* otherwise, leave stderr alone */ /* we don't want to tie stderr to /dev/null */ if (error_log_name) { int error_log; /* open the log file */ error_log = open_gen_fd(error_log_n...
0
2,085
Analyze the following 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 CL_CDDialog( void ) { cls.cddialog = qtrue; // start it next frame } Commit Message: All: Don't load .pk3s as .dlls, and don't load user config files from .pk3s CWE ID: CWE-269
0
20,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: GetClientToServerResponseErrorType( browser_sync::SyncProtocolErrorType error) { switch (error) { case browser_sync::SYNC_SUCCESS: return sync_pb::SyncEnums::SUCCESS; case browser_sync::NOT_MY_BIRTHDAY: return sync_pb::SyncEnums::NOT_MY_BIRTHDAY; case browser_sync::THROTTLED:...
0
21,822
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: RGB_to_HWB (RGBType RGB, HWBType * HWB) { /* * RGB are each on [0, 1]. W and B are returned on [0, 1] and H is * returned on [0, 6]. Exception: H is returned UNDEFINED if W == 1 - B. */ float R = RGB.R, G = RGB.G, B = RGB.B, w, v, b, f; int i; w = MIN3 (R, G, B); v = MAX3 (R, G, B); b = 1 - v; if ...
0
505
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gettime1900d(void) { struct timeval tv; gettimeofday(&tv, NULL); /* never fails */ G.cur_time = tv.tv_sec + (1.0e-6 * tv.tv_usec) + OFFSET_1900_1970; return G.cur_time; } Commit Message: CWE ID: CWE-399
0
11,807
Analyze the following 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 WriteWave64Header (FILE *outfile, WavpackContext *wpc, int64_t total_samples, int qmode) { Wave64ChunkHeader datahdr, fmthdr; Wave64FileHeader filehdr; WaveHeader wavhdr; uint32_t bcount; int64_t total_data_bytes, total_file_bytes; int num_channels = WavpackGetNumChannels (wpc); i...
0
14,818
Analyze the following 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 f_midi_in_open(struct snd_rawmidi_substream *substream) { struct f_midi *midi = substream->rmidi->private_data; struct gmidi_in_port *port; if (substream->number >= midi->in_ports) return -EINVAL; VDBG(midi, "%s()\n", __func__); port = midi->in_ports_array + substream->number; port->substream...
0
16,861
Analyze the following 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 __init check_numabalancing_enable(void) { bool numabalancing_default = false; if (IS_ENABLED(CONFIG_NUMA_BALANCING_DEFAULT_ENABLED)) numabalancing_default = true; /* Parsed by setup_numabalancing. override == 1 enables, -1 disables */ if (numabalancing_override) set_numabalancing_state(numab...
0
27,914
Analyze the following 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 size_t SearchBuffer::search(size_t& start) { if (!m_isBufferFull) return 0; if (!m_isCharacterStartBuffer[m_cursor]) return 0; size_t tailSpace = m_target.length() - m_cursor; if (memcmp(&m_buffer[m_cursor], m_target.characters(), tailSpace * sizeof(UChar)) != 0) re...
0
25,292
Analyze the following 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 SocketStream::Delegate::CanGetCookies(SocketStream* socket, const GURL& url) { return true; } Commit Message: Revert a workaround commit for a Use-After-Free crash. Revert a workaround commit r20158 for a Use-After-Free issue (http://crbug.com/244746) because a ...
0
10,344
Analyze the following 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 show_objects_for_type( struct bitmap *objects, struct ewah_bitmap *type_filter, enum object_type object_type, show_reachable_fn show_reach) { size_t pos = 0, i = 0; uint32_t offset; struct ewah_iterator it; eword_t filter; if (bitmap_git.reuse_objects == bitmap_git.pack->num_objects) retu...
0
12,939
Analyze the following 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 mmu_set_spte(struct kvm_vcpu *vcpu, u64 *sptep, unsigned pte_access, int write_fault, int *emulate, int level, gfn_t gfn, pfn_t pfn, bool speculative, bool host_writable) { int was_rmapped = 0; int rmap_count; pgprintk("%s: spte %llx write_fault %d gfn %llx\n", __func__, *sptep, wri...
0
25,946
Analyze the following 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 HostCache::Entry::CountHit(bool hit_is_stale) { ++total_hits_; if (hit_is_stale) ++stale_hits_; } Commit Message: Add PersistenceDelegate to HostCache PersistenceDelegate is a new interface for persisting the contents of the HostCache. This commit includes the interface itself, the logic in HostCac...
0
18,825
Analyze the following 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 req_table_t* req_headers_in(request_rec *r) { req_table_t* t = apr_palloc(r->pool, sizeof(req_table_t)); t->r = r; t->t = r->headers_in; t->n = "headers_in"; return t; } Commit Message: *) SECURITY: CVE-2015-0228 (cve.mitre.org) mod_lua: A maliciously crafted websockets PING after a scrip...
0
16,149
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PanoramiXRenderSetPictureFilter (ClientPtr client) { REQUEST(xRenderSetPictureFilterReq); int result = Success, j; PanoramiXRes *pict; REQUEST_AT_LEAST_SIZE(xRenderSetPictureFilterReq); VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixWriteAccess); FOR_NSCREENS_BACKWA...
0
423
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: horAcc8(TIFF* tif, uint8* cp0, tmsize_t cc) { tmsize_t stride = PredictorState(tif)->stride; unsigned char* cp = (unsigned char*) cp0; assert((cc%stride)==0); if (cc > stride) { /* * Pipeline the most common cases. */ if (stride == 3) { unsigned int cr = cp[0]; unsigned int cg = cp[1...
1
29,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: int UDPSocketWin::CreateSocket(int addr_family) { addr_family_ = addr_family; socket_ = CreatePlatformSocket(addr_family_, SOCK_DGRAM, IPPROTO_UDP); if (socket_ == INVALID_SOCKET) return MapSystemError(WSAGetLastError()); core_ = new Core(this); return OK; } Commit Message: Map posix error codes in...
0
10,227
Analyze the following 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 WebLocalFrameImpl::ReloadImage(const WebNode& web_node) { const Node* node = web_node.ConstUnwrap<Node>(); if (auto* image_element = ToHTMLImageElementOrNull(*node)) image_element->ForceReload(); } Commit Message: Do not forward resource timing to parent frame after back-forward navigation LocalFra...
0
5,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 UINT GetWinCP ( XMP_Uns16 macLang ) { UINT winCP = 0; if ( macLang <= 94 ) winCP = kMacToWinCP_0_94[macLang]; if ( winCP == 0 ) { XMP_Uns16 macScript = GetMacScript ( macLang ); if ( macScript != kNoMacScript ) winCP = kMacScriptToWinCP[macScript]; } return winCP; } // GetWinCP Commit Mes...
0
28,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 netif_nit_deliver(struct sk_buff *skb) { struct packet_type *ptype; if (list_empty(&ptype_all)) return; skb_reset_network_header(skb); skb_reset_transport_header(skb); skb->mac_len = skb->network_header - skb->mac_header; rcu_read_lock(); list_for_each_entry_rcu(ptype, &ptype_all, list) { if (!...
0
10,893
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: midi_synth_load_patch(int dev, int format, const char __user *addr, int offs, int count, int pmgr_flag) { int orig_dev = synth_devs[dev]->midi_dev; struct sysex_info sysex; int i; unsigned long left, src_offs, eox_seen = 0; int first_byte = 1; int ...
1
4,574
Analyze the following 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 __ref free_initmem(void) { e820_reallocate_tables(); free_init_pages("unused kernel", (unsigned long)(&__init_begin), (unsigned long)(&__init_end)); } Commit Message: mm: Tighten x86 /dev/mem with zeroing reads Under CONFIG_STRICT_DEVMEM, reading System RAM through /dev/mem is disallowed. However,...
0
28,295
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: nautilus_mime_file_extracts (NautilusFile *file) { return get_activation_action (file) == ACTIVATION_ACTION_EXTRACT; } Commit Message: mime-actions: use file metadata for trusting desktop files Currently we only trust desktop files that have the executable bit set, and don't replace the displayed icon or th...
0
22,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: InfoBarService* infobar_service() { return InfoBarService::FromWebContents(web_contents()); } Commit Message: Fix UAF in Origin Info Bubble and permission settings UI. In addition to fixing the UAF, will this also fix the problem of the bubble showing over the previous tab (if the bubble is open when th...
0
1,244
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: HandleLedNameDef(KeyNamesInfo *info, LedNameDef *def, enum merge_mode merge) { LedNameInfo ledi; xkb_atom_t name; if (def->ndx < 1 || def->ndx > XKB_MAX_LEDS) { info->errorCount++; log_err(info->ctx, "Illegal indicator index (%d) specified; must be bet...
0
19,403
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: DevToolsWindow::FrontendWebContentsObserver::FrontendWebContentsObserver( DevToolsWindow* devtools_window) : WebContentsObserver(devtools_window->web_contents()), devtools_window_(devtools_window) { } Commit Message: DevTools: handle devtools renderer unresponsiveness during beforeunload event inte...
0
1,577
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void comps_objrtree_data_destroy(COMPS_ObjRTreeData * rtd) { free(rtd->key); comps_object_destroy(rtd->data); comps_hslist_destroy(&rtd->subnodes); free(rtd); } Commit Message: Fix UAF in comps_objmrtree_unite function The added field is not used at all in many places and it is probably the left...
0
1,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: void ExtensionGlobalError::BubbleViewAcceptButtonPressed() { if (!accept_callback_.is_null()) { accept_callback_.Run(*this, current_browser_); } } Commit Message: [i18n-fixlet] Make strings branding specific in extension code. IDS_EXTENSIONS_UNINSTALL IDS_EXTENSIONS_INCOGNITO_WARNING IDS_EXTENSION_INSTA...
0
10,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: packet_setsockopt(struct socket *sock, int level, int optname, char __user *optval, unsigned int optlen) { struct sock *sk = sock->sk; struct packet_sock *po = pkt_sk(sk); int ret; if (level != SOL_PACKET) return -ENOPROTOOPT; switch (optname) { case PACKET_ADD_MEMBERSHIP: case PACKET_DROP_MEMBERSHIP: ...
0
4,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: parsefattr(netdissect_options *ndo, const uint32_t *dp, int verbose, int v3) { const struct nfs_fattr *fap; fap = (const struct nfs_fattr *)dp; ND_TCHECK(fap->fa_gid); if (verbose) { ND_PRINT((ndo, " %s %o ids %d/%d", tok2str(type2str, "unk-ft %d ", EXTRACT_32BITS(&fap->fa_type)), ...
0
23,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: static int illegal_highdma(struct net_device *dev, struct sk_buff *skb) { #ifdef CONFIG_HIGHMEM int i; if (!(dev->features & NETIF_F_HIGHDMA)) { for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; if (PageHighMem(skb_frag_page(frag))) return 1; } } ...
0
12,284
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: u32 ip_idents_reserve(u32 hash, int segs) { u32 *p_tstamp = ip_tstamps + hash % IP_IDENTS_SZ; atomic_t *p_id = ip_idents + hash % IP_IDENTS_SZ; u32 old = READ_ONCE(*p_tstamp); u32 now = (u32)jiffies; u32 new, delta = 0; if (old != now && cmpxchg(p_tstamp, old, now) == old) delta = prandom_u32_max(now - o...
0
12,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: void metx_del(GF_Box *s) { GF_MetaDataSampleEntryBox *ptr = (GF_MetaDataSampleEntryBox*)s; if (ptr == NULL) return; gf_isom_sample_entry_predestroy((GF_SampleEntryBox *)s); if (ptr->content_encoding) gf_free(ptr->content_encoding); if (ptr->xml_namespace) gf_free(ptr->xml_namespace); if (ptr->xml_schema_lo...
0
14,491
Analyze the following 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 RenderFrameImpl::didFailLoad(blink::WebLocalFrame* frame, const blink::WebURLError& error) { DCHECK(!frame_ || frame_ == frame); WebDataSource* ds = frame->dataSource(); DCHECK(ds); FOR_EACH_OBSERVER(RenderViewObserver, render_view_->observers(), ...
0
23,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: copy_attr (char const *src_path, char const *dst_path) { return 0; } Commit Message: CWE ID: CWE-59
0
18,817
Analyze the following 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 qeth_idx_read_cb(struct qeth_channel *channel, struct qeth_cmd_buffer *iob) { struct qeth_card *card; __u16 temp; QETH_DBF_TEXT(SETUP , 2, "idxrdcb"); if (channel->state == CH_STATE_DOWN) { channel->state = CH_STATE_ACTIVATING; goto out; } card = CARD_FROM_CDEV(channel->ccwdev); if (qet...
0
3,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: int posix_cpu_nsleep(const clockid_t which_clock, int flags, struct timespec *rqtp, struct timespec __user *rmtp) { struct restart_block *restart_block = &current_thread_info()->restart_block; struct itimerspec it; int error; /* * Diagnose required errors first. */ if (CPUCLOCK_PERTHREAD(whi...
0
27,149
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MediaStreamDispatcher* RenderFrameImpl::GetMediaStreamDispatcher() { if (!web_user_media_client_) InitializeUserMediaClient(); return web_user_media_client_ ? web_user_media_client_->media_stream_dispatcher() : NULL; } Commit Message: Connect WebUSB client interface to the devices app This provide...
0
24,152
Analyze the following 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 nf_ingress(struct sk_buff *skb, struct packet_type **pt_prev, int *ret, struct net_device *orig_dev) { #ifdef CONFIG_NETFILTER_INGRESS if (nf_hook_ingress_active(skb)) { int ingress_retval; if (*pt_prev) { *ret = deliver_skb(skb, *pt_prev, orig_dev); *pt_prev = NULL; } r...
0
4,564
Analyze the following 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_attr_dir_readdir(struct file * filp, void * dirent, filldir_t filldir) { return proc_pident_readdir(filp,dirent,filldir, attr_dir_stuff,ARRAY_SIZE(attr_dir_stuff)); } Commit Message: proc: restrict access to /proc/PID/io /proc/PID/io may be used for gathering private information....
0
27,363
Analyze the following 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 BackendIO::DoomEntriesSince(const base::Time initial_time) { operation_ = OP_DOOM_SINCE; initial_time_ = initial_time; } Commit Message: Blockfile cache: fix long-standing sparse + evict reentrancy problem Thanks to nedwilliamson@ (on gmail) for an alternative perspective plus a reduction to make fixin...
0
19,112
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: _gnutls_set_client_random (gnutls_session_t session, uint8_t * rnd) { memcpy (session->security_parameters.client_random, rnd, TLS_RANDOM_SIZE); } Commit Message: CWE ID: CWE-189
0
6,779
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: json_t *json_string(const char *value) { if(!value || !utf8_check_string(value, -1)) return NULL; return json_string_nocheck(value); } Commit Message: CVE-2013-6401: Change hash function, randomize hashes Thanks to Florian Weimer and Eric Sesterhenn for reporting, reviewing and testing. CWE ID:...
0
3,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: ImageData* WebGLRenderingContextBase::ToImageData(SnapshotReason reason) { ImageData* image_data = nullptr; if (GetDrawingBuffer()) { image_data = PaintRenderingResultsToImageData(kBackBuffer); if (image_data) { return image_data; } int width = GetDrawingBuffer()->Size().Width(); in...
0
10,354
Analyze the following 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 GLES2Implementation::CompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei heigh...
0
2,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: void PageInfo::OnChangePasswordButtonPressed( content::WebContents* web_contents) { #if defined(FULL_SAFE_BROWSING) DCHECK(password_protection_service_); DCHECK(safe_browsing_status_ == SAFE_BROWSING_STATUS_SIGN_IN_PASSWORD_REUSE || safe_browsing_status_ == SAFE_BROWSING_STATUS_EN...
1
8,540
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool CanonicalizeUserInfo(const base::char16* username_source, const Component& username, const base::char16* password_source, const Component& password, CanonOutput* output, Component...
0
15,392
Analyze the following 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 sas_ex_revalidate_domain(struct domain_device *port_dev) { int res; struct domain_device *dev = NULL; res = sas_find_bcast_dev(port_dev, &dev); if (res == 0 && dev) { struct expander_device *ex = &dev->ex_dev; int i = 0, phy_id; do { phy_id = -1; res = sas_find_bcast_phy(dev, &phy_id, i, tru...
0
13,578
Analyze the following 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 tracing_spd_release_pipe(struct splice_pipe_desc *spd, unsigned int idx) { __free_page(spd->pages[idx]); } Commit Message: Merge tag 'trace-v4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing fixes from Steven Rostedt: "This contains a few fixes an...
0
25,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: void RunUntilIdle() { loop_.RunUntilIdle(); BrowserThread::GetBlockingPool()->FlushForTesting(); loop_.RunUntilIdle(); } Commit Message: Make the policy fetch for first time login blocking The CL makes policy fetching for first time login blocking for all users, except the ones that are known to...
0
13,398
Analyze the following 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 sync_lapic_to_cr8(struct kvm_vcpu *vcpu) { struct vcpu_svm *svm = to_svm(vcpu); u64 cr8; if (is_guest_mode(vcpu) && (vcpu->arch.hflags & HF_VINTR_MASK)) return; cr8 = kvm_get_cr8(vcpu); svm->vmcb->control.int_ctl &= ~V_TPR_MASK; svm->vmcb->control.int_ctl |= cr8 & V_TPR_MASK; } Commi...
0
25,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: FileTransfer::CommitFiles() { MyString buf; MyString newbuf; MyString swapbuf; const char *file; if ( IsClient() ) { return; } int cluster = -1; int proc = -1; jobAd.LookupInteger(ATTR_CLUSTER_ID, cluster); jobAd.LookupInteger(ATTR_PROC_ID, proc); priv_state saved_priv = PRIV_UNKNOWN; if( want_pr...
0
823
Analyze the following 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 ubifs_write_begin(struct file *file, struct address_space *mapping, loff_t pos, unsigned len, unsigned flags, struct page **pagep, void **fsdata) { struct inode *inode = mapping->host; struct ubifs_info *c = inode->i_sb->s_fs_info; struct ubifs_inode *ui = ubifs_inode(inode); pgoff_...
0
3,272
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void GLES2Implementation::GetProgramResourceName(GLuint program, GLenum program_interface, GLuint index, GLsizei bufsize, ...
0
5,892
Analyze the following 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 VerifyRemoveFromCache(base::PlatformFileError error, const std::string& resource_id, const std::string& md5) { ++num_callback_invocations_; EXPECT_EQ(expected_error_, error); GDataRootDirectory::CacheEntry* entry = file_system_...
0
25,675
Analyze the following 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 HTMLFormControlElement::requiredAttributeChanged() { setNeedsValidityCheck(); pseudoStateChanged(CSSSelector::PseudoRequired); pseudoStateChanged(CSSSelector::PseudoOptional); } Commit Message: Form validation: Do not show validation bubble if the page is invisible. BUG=673163 Review-Url: https://co...
0
22,492
Analyze the following 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 RenderFrameImpl::MarkWebAXObjectDirty(const blink::WebAXObject& obj, bool subtree) { if (render_accessibility_) render_accessibility_->MarkWebAXObjectDirty(obj, subtree); } Commit Message: Convert FrameHostMsg_DidAddMessageToConsole to Mojo. Note: Since this...
0
20,806
Analyze the following 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 NuPlayer::GenericSource::sendTextData( uint32_t what, media_track_type type, int32_t curGen, sp<AnotherPacketSource> packets, sp<AMessage> msg) { int32_t msgGeneration; CHECK(msg->findInt32("generation", &msgGeneration)); if (msgGeneration != curGen) { return; } int64_t su...
0
3,095
Analyze the following 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 license_read_upgrade_license_packet(rdpLicense* license, wStream* s) { DEBUG_LICENSE("Receiving Upgrade License Packet"); license->state = LICENSE_STATE_COMPLETED; } Commit Message: Fix possible integer overflow in license_read_scope_list() CWE ID: CWE-189
0
4,699
Analyze the following 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 HTMLSelectElement::platformHandleKeydownEvent(KeyboardEvent* event) { if (!RenderTheme::theme().popsMenuByArrowKeys()) return false; if (!isSpatialNavigationEnabled(document().frame())) { if (event->keyIdentifier() == "Down" || event->keyIdentifier() == "Up") { focus(); ...
0
6,855
Analyze the following 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 DevToolsDataSource::StartBundledDataRequest( const std::string& path, const content::URLDataSource::GotDataCallback& callback) { std::string filename = PathWithoutParams(path); base::StringPiece resource = content::DevToolsFrontendHost::GetFrontendResource(filename); DLOG_IF(WARNING, res...
0
7,307
Analyze the following 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 DateTimeFieldElement::isDateTimeFieldElement() const { return true; } Commit Message: INPUT_MULTIPLE_FIELDS_UI: Inconsistent value of aria-valuetext attribute https://bugs.webkit.org/show_bug.cgi?id=107897 Reviewed by Kentaro Hara. Source/WebCore: aria-valuetext and aria-valuenow attributes had incon...
0
26,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: string16 GetFindBarMatchCountTextForBrowser(Browser* browser) { FindBarTesting* find_bar = browser->GetFindBarController()->find_bar()->GetFindBarTesting(); return find_bar->GetMatchCountText(); } Commit Message: Rename the TabContentWrapper pieces to be "TabHelper"s. (Except for the PasswordMa...
0
19,552
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int snd_interval_ratnum(struct snd_interval *i, unsigned int rats_count, const struct snd_ratnum *rats, unsigned int *nump, unsigned int *denp) { unsigned int best_num, best_den; int best_diff; unsigned int k; struct snd_interval t; int err; unsigned int result_num, result_den; int result_diff; bes...
0
29,957
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: RenderViewImpl::RenderViewImpl(RenderViewImplParams* params) : RenderWidget(WebKit::WebPopupTypeNone, params->screen_info, params->swapped_out), webkit_preferences_(params->webkit_prefs), send_content_state_immediately_(false), enabled_bindings_(0), ...
0
6,237
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xmlParseEntityDecl(xmlParserCtxtPtr ctxt) { const xmlChar *name = NULL; xmlChar *value = NULL; xmlChar *URI = NULL, *literal = NULL; const xmlChar *ndata = NULL; int isParameter = 0; xmlChar *orig = NULL; /* GROW; done in the caller */ if (CMP8(CUR_PTR, '<', '!', 'E', 'N', 'T', 'I...
0
14,078
Analyze the following 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::OnRunJavaScriptDialog( const base::string16& message, const base::string16& default_prompt, JavaScriptDialogType dialog_type, IPC::Message* reply_msg) { if (dialog_type == JavaScriptDialogType::JAVASCRIPT_DIALOG_TYPE_ALERT) GetFrameResourceCoordinator()->OnAlertFire...
0
4,821
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: get_random_number () { int rv, pid; /* Reset for command and process substitution. */ pid = getpid (); if (subshell_environment && seeded_subshell != pid) { seedrand (); seeded_subshell = pid; } do rv = brand (); while (rv == last_random_value); return rv; } Commit Message...
0
16,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 void gdImageHLine(gdImagePtr im, int y, int x1, int x2, int col) { if (im->thick > 1) { int thickhalf = im->thick >> 1; gdImageFilledRectangle(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
22,529
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: long TestWebKitPlatformSupport::databaseGetFileAttributes( const WebKit::WebString& vfs_file_name) { return SimpleDatabaseSystem::GetInstance()->GetFileAttributes( vfs_file_name); } Commit Message: Use a new scheme for swapping out RenderViews. BUG=118664 TEST=none Review URL: http://codereview.ch...
0
28,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 ssize_t nr_overcommit_hugepages_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count) { int err; unsigned long input; struct hstate *h = kobj_to_hstate(kobj, NULL); if (h->order >= MAX_ORDER) return -EINVAL; err = strict_strtoul(buf, 10, &input); if (err) ret...
0
14,115
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void GetDownloads(Browser* browser, std::vector<DownloadItem*>* downloads) const { DCHECK(downloads); DownloadManager* manager = DownloadManagerForBrowser(browser); manager->GetAllDownloads(downloads); } Commit Message: When turning a download into a navigation, navigate the r...
0
20,269
Analyze the following 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 bcm_char_read(struct file *filp, char __user *buf, size_t size, loff_t *f_pos) { struct bcm_tarang_data *pTarang = filp->private_data; struct bcm_mini_adapter *Adapter = pTarang->Adapter; struct sk_buff *Packet = NULL; ssize_t PktLen = 0; int wait_ret_val = 0; unsigned long ret = 0; ...
0
29,128
Analyze the following 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::Config() { if( Execute ) { free( Execute ); } if( (Execute = param("EXECUTE")) == NULL ) { if( is_gridshell ) { Execute = strdup( orig_cwd ); } else { EXCEPT("Execute directory not specified in config file."); } } if (!m_configured) { bool ps = privsep_enabled(); bool gl = param_b...
0
14,504
Analyze the following 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 ASF_Support::ReadHeaderExtensionObject ( XMP_IO* fileRef, ObjectState& inOutObjectState, const XMP_Uns64& _pos, const ASF_ObjectBase& _objectBase ) { if ( ! IsEqualGUID ( ASF_Header_Extension_Object, _objectBase.guid) || (! legacyManager ) ) return false; try { const XMP_Uns64 offset = 46; XMP_Uns64 ...
0
10,387
Analyze the following 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 tty_driver *alloc_tty_driver(int lines) { struct tty_driver *driver; driver = kzalloc(sizeof(struct tty_driver), GFP_KERNEL); if (driver) { kref_init(&driver->kref); driver->magic = TTY_DRIVER_MAGIC; driver->num = lines; /* later we'll move allocation of tables here */ } return driver; } Com...
0
3,019
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: proc_do_sync_threshold(ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { int *valp = table->data; int val[2]; int rc; /* backup the value first */ memcpy(val, valp, sizeof(val)); rc = proc_dointvec(table, write, buffer, lenp, ppos); if (write && (valp[0] < 0 || valp...
0
21,693
Analyze the following 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 shmem_unuse(swp_entry_t swap, struct page *page) { return 0; } Commit Message: tmpfs: fix use-after-free of mempolicy object The tmpfs remount logic preserves filesystem mempolicy if the mpol=M option is not specified in the remount request. A new policy can be specified if mpol=M is given. Before this p...
0
14,941