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: static inline uint32_t vmw_surface_destroy_size(void) { return sizeof(struct vmw_surface_destroy); } Commit Message: drm/vmwgfx: Make sure backup_handle is always valid When vmw_gb_surface_define_ioctl() is called with an existing buffer, we end up returning an uninitialized variable in the backup_handle. The...
0
64,391
Analyze the following 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 antiidle(void) { if (noopidle == (time_t) -1) { noopidle = time(NULL); } else { if ((time(NULL) - noopidle) > (time_t) idletime_noop) { die(421, LOG_INFO, MSG_TIMEOUT_NOOP, (unsigned long) idletime_noop); } } } Commit Message: Flush the command buff...
0
18,418
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: AXObject* AXLayoutObject::remoteSVGElementHitTest(const IntPoint& point) const { AXObject* remote = remoteSVGRootElement(); if (!remote) return 0; IntSize offset = point - roundedIntPoint(getBoundsInFrameCoordinates().location()); return remote->accessibilityHitTest(IntPoint(offset)); } Commit...
0
127,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: static void update_cr8_intercept(struct kvm_vcpu *vcpu) { int max_irr, tpr; if (!kvm_x86_ops->update_cr8_intercept) return; if (!vcpu->arch.apic) return; if (!vcpu->arch.apic->vapic_addr) max_irr = kvm_lapic_find_highest_irr(vcpu); else max_irr = -1; if (max_irr != -1) max_irr >>= 4; tpr = k...
0
20,887
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static const char *set_enable_mmap(cmd_parms *cmd, void *d_, const char *arg) { core_dir_config *d = d_; if (ap_cstr_casecmp(arg, "on") == 0) { d->enable_mmap = ENABLE_MMAP_ON; } else if (ap_cstr_casecmp(arg, "off") == 0) { d->enable_mmap = ENABL...
0
64,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: bool PermissionsData::CanRunContentScriptOnPage(const Extension* extension, const GURL& document_url, const GURL& top_frame_url, int tab_id, ...
0
120,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 nfc_llcp_socket_release(struct nfc_llcp_local *local, bool device, int err) { struct sock *sk; struct hlist_node *tmp; struct nfc_llcp_sock *llcp_sock; skb_queue_purge(&local->tx_queue); write_lock(&local->sockets.lock); sk_for_each_safe(sk, tmp, &local->sockets.head) { llcp_sock = ...
0
89,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 AutofillManager::UploadFormData(const FormStructure& submitted_form, bool observed_submission) { if (!download_manager_) return; bool was_autofilled = false; std::string form_signature = submitted_form.FormSignatureAsStr(); for (const std::string& cur_sig : a...
0
155,010
Analyze the following 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 isValidNameNonASCII(const UChar* characters, unsigned length) { unsigned i = 0; UChar32 c; U16_NEXT(characters, i, length, c) if (!isValidNameStart(c)) return false; while (i < length) { U16_NEXT(characters, i, length, c) if (!isValidNamePart(c)) ...
0
102,773
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: png_start_read_image(png_structp png_ptr) { png_debug(1, "in png_start_read_image"); if (png_ptr == NULL) return; if (!(png_ptr->flags & PNG_FLAG_ROW_INIT)) png_read_start_row(png_ptr); } Commit Message: third_party/libpng: update to 1.2.54 TBR=darin@chromium.org BUG=560291 Review URL: h...
0
131,351
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: vhost_scsi_set_endpoint(struct vhost_scsi *vs, struct vhost_scsi_target *t) { struct se_portal_group *se_tpg; struct vhost_scsi_tport *tv_tport; struct vhost_scsi_tpg *tpg; struct vhost_scsi_tpg **vs_tpg; struct vhost_virtqueue *vq; int index, ret, i, len; bool match = false; mutex_lock(&vhost_scsi_mu...
0
43,133
Analyze the following 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 ldsem_up_read(struct ld_semaphore *sem) { long count; lockdep_release(sem, 1, _RET_IP_); count = ldsem_atomic_update(-LDSEM_READ_BIAS, sem); if (count < 0 && (count & LDSEM_ACTIVE_MASK) == 0) ldsem_wake(sem); } Commit Message: tty: Fix hang at ldsem_down_read() When a controlling tty is being hung ...
0
57,845
Analyze the following 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 skip_input_data (j_decompress_ptr cinfo, long num_bytes) { my_src_ptr src = (my_src_ptr) cinfo->src; /* Just a dumb implementation for now. Not clear that being smart is worth * any trouble anyway --- large skips are infrequent. */ if (num_bytes > 0) { while (num_bytes > (long) src->pub.bytes_in_bu...
0
91,520
Analyze the following 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 InputDispatcher::dispatchConfigurationChangedLocked( nsecs_t currentTime, ConfigurationChangedEntry* entry) { #if DEBUG_OUTBOUND_EVENT_DETAILS ALOGD("dispatchConfigurationChanged - eventTime=%lld", entry->eventTime); #endif resetKeyRepeatLocked(); CommandEntry* commandEntry = postCommandLocked( ...
0
163,740
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PassRefPtrWillBeRawPtr<HTMLCollection> Document::windowNamedItems(const AtomicString& name) { return ensureCachedCollection<WindowNameCollection>(WindowNamedItems, name); } Commit Message: Change Document::detach() to RELEASE_ASSERT all subframes are gone. BUG=556724,577105 Review URL: https://codereview.c...
0
124,575
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ofproto_type_wait(const char *datapath_type) { const struct ofproto_class *class; datapath_type = ofproto_normalize_type(datapath_type); class = ofproto_class_find__(datapath_type); if (class->type_wait) { class->type_wait(datapath_type); } } Commit Message: ofproto: Fix OVS crash w...
0
77,400
Analyze the following 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 sk_reset_timer(struct sock *sk, struct timer_list* timer, unsigned long expires) { if (!mod_timer(timer, expires)) sock_hold(sk); } Commit Message: net: sock: validate data_len before allocating skb in sock_alloc_send_pskb() We need to validate the number of pages consumed by data_len, otherwise f...
0
20,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: OVS_REQUIRES(ofproto_mutex) { const struct rule_actions *actions; struct ofputil_flow_update fu; fu.event = (flags & (NXFMF_INITIAL | NXFMF_ADD) ? NXFME_ADDED : NXFME_MODIFIED); fu.reason = 0; ovs_mutex_lock(&rule->mutex); fu.idle_timeout = rule->idle_timeout; fu.h...
0
77,181
Analyze the following 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 voidMethodFloat32ArrayArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { if (UNLIKELY(info.Length() < 1)) { throwTypeError(ExceptionMessages::failedToExecute("voidMethodFloat32ArrayArg", "TestObjectPython", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate...
0
122,829
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ExtensionFunction::ResponseAction TabsSetZoomSettingsFunction::Run() { using api::tabs::ZoomSettings; std::unique_ptr<tabs::SetZoomSettings::Params> params( tabs::SetZoomSettings::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); int tab_id = params->tab_id ? *params->tab_id : -1; st...
0
151,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: static void writeback_registers(struct x86_emulate_ctxt *ctxt) { unsigned reg; for_each_set_bit(reg, (ulong *)&ctxt->regs_dirty, 16) ctxt->ops->write_gpr(ctxt, reg, ctxt->_regs[reg]); } Commit Message: KVM: emulate: avoid accessing NULL ctxt->memopp A failure to decode the instruction can cause a NULL poin...
0
35,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: virtual void didReadMetadata(const WebKit::WebFileInfo& info) { ASSERT(m_callbacks); if (info.type != WebKit::WebFileInfo::TypeFile || info.length < 0) m_callbacks->didFail(WebKit::WebFileErrorInvalidState); else { OwnPtr<AsyncFileWriterChromium> asyncFileWr...
0
102,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: bool PrintWebViewHelper::CopyMetafileDataToSharedMem( printing::Metafile* metafile, base::SharedMemoryHandle* shared_mem_handle) { uint32 buf_size = metafile->GetDataSize(); base::SharedMemoryHandle mem_handle = render_view()->HostAllocateSharedMemoryBuffer(buf_size); if (base::SharedMemory::I...
0
97,513
Analyze the following 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 HTMLMediaElement::IsInCrossOriginFrame() const { return IsDocumentCrossOrigin(GetDocument()); } Commit Message: Simplify "WouldTaintOrigin" concept in media/blink Currently WebMediaPlayer has three predicates: - DidGetOpaqueResponseFromServiceWorker - HasSingleSecurityOrigin - DidPassCORSAccessCheck ...
0
144,561
Analyze the following 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 irc_servers_reconnect_init(void) { signal_add("server connect copy", (SIGNAL_FUNC) sig_server_connect_copy); signal_add("server reconnect save status", (SIGNAL_FUNC) sig_server_reconnect_save_status); signal_add("event connected", (SIGNAL_FUNC) sig_connected); signal_add("event 436", (SIGNAL_FUNC) event_...
0
89,415
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: BpMemory::BpMemory(const sp<IBinder>& impl) : BpInterface<IMemory>(impl), mOffset(0), mSize(0) { } Commit Message: Sanity check IMemory access versus underlying mmap Bug 26877992 Change-Id: Ibbf4b1061e4675e4e96bc944a865b53eaf6984fe CWE ID: CWE-264
0
161,471
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: struct wireless_dev *brcmf_ap_add_vif(struct wiphy *wiphy, const char *name, struct vif_params *params) { struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); struct brcmf_if *ifp = netdev_priv(cfg_to_ndev(cfg)); struct brcmf_cfg80211_vif *vif; int err; if (brcmf_cfg80211_vif_event_armed(cfg)) ...
0
67,215
Analyze the following 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 RenderViewHostManager::SetWebUIPostCommit(WebUIImpl* web_ui) { DCHECK(!web_ui_.get()); web_ui_.reset(web_ui); } Commit Message: Ensure extensions and the Chrome Web Store are loaded in new BrowsingInstances. BUG=174943 TEST=Can't post message to CWS. See bug for repro steps. Review URL: https://chro...
0
115,816
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void lsi_request_cancelled(SCSIRequest *req) { LSIState *s = LSI53C895A(req->bus->qbus.parent); lsi_request *p = req->hba_private; req->hba_private = NULL; lsi_request_free(s, p); scsi_req_unref(req); } Commit Message: CWE ID: CWE-835
0
3,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: static void kick_hub_wq(struct usb_hub *hub) { struct usb_interface *intf; if (hub->disconnected || work_pending(&hub->events)) return; /* * Suppress autosuspend until the event is proceed. * * Be careful and make sure that the symmetric operation is * always called. We are here only when there is ...
0
56,777
Analyze the following 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 trun_Read(GF_Box *s, GF_BitStream *bs) { u32 i; GF_TrunEntry *p; GF_TrackFragmentRunBox *ptr = (GF_TrackFragmentRunBox *)s; if ((ptr->flags & GF_ISOM_TRUN_FIRST_FLAG) && (ptr->flags & GF_ISOM_TRUN_FLAGS)) return GF_ISOM_INVALID_FILE; ptr->sample_count = gf_bs_read_u32(bs); if (ptr->flags & GF_IS...
0
80,615
Analyze the following 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 git_index_conflict_iterator_new( git_index_conflict_iterator **iterator_out, git_index *index) { git_index_conflict_iterator *it = NULL; assert(iterator_out && index); it = git__calloc(1, sizeof(git_index_conflict_iterator)); GITERR_CHECK_ALLOC(it); it->index = index; *iterator_out = it; return 0...
0
83,666
Analyze the following 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 BrowserPluginGuest::SetCursor(const WebCursor& cursor) { SendMessageToEmbedder(new BrowserPluginMsg_SetCursor(embedder_routing_id(), instance_id(), cursor)); } Commit Message: Implement TextureIma...
0
114,418
Analyze the following 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 avi_extract_stream_metadata(AVFormatContext *s, AVStream *st) { GetByteContext gb; uint8_t *data = st->codecpar->extradata; int data_size = st->codecpar->extradata_size; int tag, offset; if (!data || data_size < 8) { return AVERROR_INVALIDDATA; } bytestream2_init(&...
0
64,064
Analyze the following 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 ParamTraits<HANDLE>::Read(const Message* m, PickleIterator* iter, param_type* r) { uint32 temp; if (!m->ReadUInt32(iter, &temp)) return false; *r = reinterpret_cast<HANDLE>(temp); return true; } Commit Message: Validate that paths don't contain embedded NULLs at de...
0
117,401
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: entry_guard_encode_for_state(entry_guard_t *guard) { /* * The meta-format we use is K=V K=V K=V... where K can be any * characters excepts space and =, and V can be any characters except * space. The order of entries is not allowed to matter. * Unrecognized K=V entries are persisted; recognized but...
0
69,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: void LocalSiteCharacteristicsWebContentsObserver::TitleWasSet( content::NavigationEntry* entry) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (!first_time_title_set_) { first_time_title_set_ = true; return; } MaybeNotifyBackgroundFeatureUsage( &SiteCharacteristicsDataWriter:...
0
132,086
Analyze the following 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 cipso_v4_sock_delattr(struct sock *sk) { int hdr_delta; struct ip_options_rcu *opt; struct inet_sock *sk_inet; sk_inet = inet_sk(sk); opt = rcu_dereference_protected(sk_inet->inet_opt, 1); if (opt == NULL || opt->opt.cipso == 0) return; hdr_delta = cipso_v4_delopt(&sk_inet->inet_opt); if (sk_inet...
0
33,829
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: decode_OFPAT_RAW_SET_DL_SRC(const struct ofp_action_dl_addr *a, enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *out) { ofpact_put_SET_ETH_SRC(out)->mac = a->dl_addr; return 0; } Commit Message: ofp-actions: Avoid buffer overread in BUNDLE ac...
0
76,837
Analyze the following 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 LocalDOMWindow::outerWidth() const { if (!GetFrame()) return 0; Page* page = GetFrame()->GetPage(); if (!page) return 0; ChromeClient& chrome_client = page->GetChromeClient(); if (page->GetSettings().GetReportScreenSizeInPhysicalPixelsQuirk()) return lroundf(chrome_client.RootWindowRec...
0
125,958
Analyze the following 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_toprimitive(js_State *J, int idx, int hint) { jsV_toprimitive(J, stackidx(J, idx), hint); } Commit Message: CWE ID: CWE-119
0
13,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 DocumentThreadableLoader::redirectBlocked() { ThreadableLoaderClient* client = m_client; clear(); client->didFailRedirectCheck(); } Commit Message: DocumentThreadableLoader: Add guards for sync notifyFinished() in setResource() In loadRequest(), setResource() can call clear() synchronously: D...
0
119,499
Analyze the following 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_file_flags (const char *filename, int *dt) { logprintf (LOG_VERBOSE, _("\ File %s already there; not retrieving.\n\n"), quote (filename)); /* If the file is there, we suppose it's retrieved OK. */ *dt |= RETROKF; /* #### Bogusness alert. */ /* If its suffix is "html" or "htm" or similar, assume t...
0
15,480
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PopupContainer::~PopupContainer() { if (m_listBox && m_listBox->parent()) removeChild(m_listBox.get()); } Commit Message: [REGRESSION] Refreshed autofill popup renders garbage https://bugs.webkit.org/show_bug.cgi?id=83255 http://code.google.com/p/chromium/issues/detail?id=118374 The code used to upd...
0
108,585
Analyze the following 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_one_channel_security(int id, uint32_t security) { ChannelSecurityOptions *security_options; if ((security_options = find_channel_security(id))) { security_options->options = security; return; } security_options = spice_new(ChannelSecurityOptions, 1); security_o...
0
1,947
Analyze the following 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(xml_parser_set_option) { xml_parser *parser; zval *pind, **val; long opt; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlZ", &pind, &opt, &val) == FAILURE) { return; } ZEND_FETCH_RESOURCE(parser,xml_parser *, &pind, -1, "XML Parser", le_xml_parser); switch (opt) { case PHP_XML...
0
10,984
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SYSCALL_DEFINE2(munlock, unsigned long, start, size_t, len) { int ret; len = PAGE_ALIGN(len + (offset_in_page(start))); start &= PAGE_MASK; if (down_write_killable(&current->mm->mmap_sem)) return -EINTR; ret = apply_vma_lock_flags(start, len, 0); up_write(&current->mm->mmap_sem); return ret; } Commit...
0
85,654
Analyze the following 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 activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterForMainWorld(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) { ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttribu...
0
122,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 ssize_t srpt_tpg_attrib_srp_sq_size_store(struct config_item *item, const char *page, size_t count) { struct se_portal_group *se_tpg = attrib_to_tpg(item); struct srpt_port *sport = container_of(se_tpg, struct srpt_port, port_tpg_1); unsigned long val; int ret; ret = kstrtoul(page, 0, &val); if (r...
0
50,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: static int nfs4_lookup_root(struct nfs_server *server, struct nfs_fh *fhandle, struct nfs_fsinfo *info) { struct nfs4_exception exception = { }; int err; do { err = _nfs4_lookup_root(server, fhandle, info); trace_nfs4_lookup_root(server, fhandle, info->fattr, err); switch (err) { case 0: case -NFS4...
0
57,162
Analyze the following 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::updateHoverActiveState(const HitTestRequest& request, Element* innerElement, const PlatformMouseEvent* event) { ASSERT(!request.readOnly()); Element* innerElementInDocument = innerElement; while (innerElementInDocument && innerElementInDocument->document() != this) { innerEleme...
0
102,911
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: STREAM* rdp_send_stream_init(rdpRdp* rdp) { STREAM* s; s = transport_send_stream_init(rdp->transport, 2048); stream_seek(s, RDP_PACKET_HEADER_MAX_LENGTH); rdp_security_stream_init(rdp, s); return s; } Commit Message: security: add a NULL pointer check to fix a server crash. CWE ID: CWE-476
0
58,646
Analyze the following 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 IRQ_get_next(OpenPICState *opp, IRQQueue *q) { /* XXX: optimize */ IRQ_check(opp, q); return q->next; } Commit Message: CWE ID: CWE-119
0
15,670
Analyze the following 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_client_process(sx_t s, sx_plugin_t p, Gsasl_session *sd, const char *mech, const char *in, int inlen) { _sx_sasl_t ctx = (_sx_sasl_t) p->private; _sx_sasl_sess_t sctx = NULL; char *buf = NULL, *out = NULL, *realm = NULL, **ext_id; char hostname[256]; int ret; #ifdef HAVE_S...
1
168,062
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void Document::addIconURL(const String& url, const String&, const String&, IconType iconType) { if (url.isEmpty()) return; Frame* f = frame(); if (!f) return; f->loader()->didChangeIcons(iconType); } Commit Message: Unreviewed, rolling out r147402. http://trac.webkit.org/changes...
0
105,436
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: e1000e_mac_setmacaddr(E1000ECore *core, int index, uint32_t val) { uint32_t macaddr[2]; core->mac[index] = val; macaddr[0] = cpu_to_le32(core->mac[RA]); macaddr[1] = cpu_to_le32(core->mac[RA + 1]); qemu_format_nic_info_str(qemu_get_queue(core->owner_nic), (uint8_t *) macaddr); t...
0
6,008
Analyze the following 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 NavigationControllerImpl::NavigateToPendingEntryInternal( ReloadType reload_type) { DCHECK(pending_entry_); FrameTreeNode* root = delegate_->GetFrameTree()->root(); FrameLoadVector same_document_loads; FrameLoadVector different_document_loads; if (GetLastCommittedEntry()) { FindFramesToNav...
0
137,797
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void red_channel_client_reset_send_data(RedChannelClient *rcc) { spice_marshaller_reset(rcc->send_data.marshaller); rcc->send_data.header.data = spice_marshaller_reserve_space(rcc->send_data.marshaller, rcc->send_data.header.header_siz...
0
2,130
Analyze the following 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 vmstate_save_state(QEMUFile *f, const VMStateDescription *vmsd, void *opaque) { VMStateField *field = vmsd->fields; if (vmsd->pre_save) { vmsd->pre_save(opaque); } while (field->name) { if (!field->field_exists || field->field_exists(opaque...
0
15,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 xacct_add_tsk(struct taskstats *stats, struct task_struct *p) { /* convert pages-jiffies to Mbyte-usec */ stats->coremem = jiffies_to_usecs(p->acct_rss_mem1) * PAGE_SIZE / MB; stats->virtmem = jiffies_to_usecs(p->acct_vm_mem1) * PAGE_SIZE / MB; if (p->mm) { /* adjust to KB unit */ stats->hiwate...
1
165,582
Analyze the following 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 WebstoreBindings::OnInlineInstallDownloadProgress(int percent_downloaded) { v8::Isolate* isolate = context()->isolate(); v8::HandleScope handle_scope(isolate); v8::Context::Scope context_scope(context()->v8_context()); v8::Local<v8::Value> argv[] = { v8::Number::New(isolate, percent_downloaded ...
0
132,522
Analyze the following 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 CHANNEL_MODE getChannelMode(OMX_U32 nChannels) { CHANNEL_MODE chMode = MODE_INVALID; switch (nChannels) { case 1: chMode = MODE_1; break; case 2: chMode = MODE_2; break; case 3: chMode = MODE_1_2; break; case 4: chMode = MODE_1_2_1; break; case 5: chMode = MODE_1_2_2; break; case 6: chMode = MOD...
0
162,470
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SYSCALL_DEFINE2(fchmod, unsigned int, fd, umode_t, mode) { struct fd f = fdget(fd); int err = -EBADF; if (f.file) { audit_file(f.file); err = chmod_common(&f.file->f_path, mode); fdput(f); } return err; } Commit Message: vfs: add vfs_select_inode() helper Signed-off-by: Miklos Szeredi <mszeredi@redh...
0
94,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 color_tree_cleanup(ColorTree* tree) { int i; for(i = 0; i < 16; i++) { if(tree->children[i]) { color_tree_cleanup(tree->children[i]); free(tree->children[i]); } } } Commit Message: Fixed #5645: realloc return handling CWE ID: CWE-772
0
87,467
Analyze the following 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 object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce) { zend_long datalen; datalen = parse_iv2((*p) + 2, p); (*p) += 2; if (datalen < 0 || (max - (*p)) <= datalen) { zend_error(E_WARNING, "Insufficient data for unserializing - %pd required, %pd present", datalen, (zend_long)(max - ...
0
50,226
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ChromeServiceWorkerFetchPPAPIPrivateTest() {} Commit Message: Skip Service workers in requests for mime handler plugins BUG=808838 TEST=./browser_tests --gtest_filter=*/ServiceWorkerTest.MimeHandlerView* Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo Change-Id: I82e75c200091babbab648a04232db4...
0
147,415
Analyze the following 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 ChromeNetworkDelegate::OnCanEnablePrivacyMode( const GURL& url, const GURL& first_party_for_cookies) const { if (!cookie_settings_.get()) return false; bool reading_cookie_allowed = cookie_settings_->IsReadingCookieAllowed( url, first_party_for_cookies); bool setting_cookie_allowed =...
0
113,566
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void skip_FDEF( EXEC_OP ) { /* We don't allow nested IDEFS & FDEFs. */ while ( SKIP_Code() == SUCCESS ) { switch ( CUR.opcode ) { case 0x89: /* IDEF */ case 0x2c: /* FDEF */ CUR.error = TT_Err_Nested_DEFS; return; case 0x2d: /* ENDF...
0
5,501
Analyze the following 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 start_decoder(vorb *f) { uint8 header[6], x,y; int len,i,j,k, max_submaps = 0; int longest_floorlist=0; if (!start_page(f)) return FALSE; if (!(f->page_flag & PAGEFLAG_first_page)) return error(f, VORBIS_invalid_first_page); if (f->page_flag & PAGE...
1
169,617
Analyze the following 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 CalculatePageLayoutFromPrintParams( const PrintMsg_Print_Params& params, printing::PageSizeMargins* page_layout_in_points) { int dpi = GetDPI(&params); int content_width = params.content_size.width(); int content_height = params.content_size.height(); int margin_bottom = params.page_size.hei...
0
102,544
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: BrotliResult BrotliDecompressStream(size_t* available_in, const uint8_t** next_in, size_t* available_out, uint8_t** next_out, size_t* total_out, BrotliState* s) { BrotliResult result = BROTLI_RESULT_SUCCESS; BrotliBitReader* br = &s->br; if (s->buffer_length == 0) { /* Just connect bit reader to inp...
0
133,092
Analyze the following 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 bin_info(RCore *r, int mode) { int i, j, v; char str[R_FLAG_NAME_SIZE]; RBinInfo *info = r_bin_get_info (r->bin); RBinFile *binfile = r_core_bin_cur (r); RBinObject *obj = r_bin_cur_object (r->bin); const char *compiled = NULL; bool havecode; if (!binfile || !info || !obj) { if (mode & R_COR...
0
82,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: status_t SoftAMRNBEncoder::initEncoder() { if (AMREncodeInit(&mEncState, &mSidState, false /* dtx_enable */) != 0) { return UNKNOWN_ERROR; } return OK; } Commit Message: DO NOT MERGE Verify OMX buffer sizes prior to access Bug: 27207275 Change-Id: I4412825d1ee233d993af0a67708bea54304ff62d CWE ID: CWE-119
0
163,923
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: show_tstamp_types_and_exit(pcap_t *pc, const char *device) { int n_tstamp_types; int *tstamp_types = 0; const char *tstamp_type_name; int i; n_tstamp_types = pcap_list_tstamp_types(pc, &tstamp_types); if (n_tstamp_types < 0) error("%s", pcap_geterr(pc)); if (n_tstamp_types == 0) { fprintf(stderr, "Ti...
0
93,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 InputType::DispatchSearchEvent() {} Commit Message: MacViews: Enable secure text input for password Textfields. In Cocoa the NSTextInputContext automatically enables secure text input when activated and it's in the secure text entry mode. RenderWidgetHostViewMac did the similar thing for ages following th...
0
126,190
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PageGroupLoadDeferrer::~PageGroupLoadDeferrer() { for (size_t i = 0; i < m_deferredFrames.size(); ++i) { if (Page* page = m_deferredFrames[i]->page()) { page->setDefersLoading(false); for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext()) ...
0
111,691
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SWFShape_drawScaledGlyph(SWFShape shape, SWFFont font, unsigned short c, int size) { SWFShape glyph; int i, vx, vy; if(font == NULL) return; glyph = SWFFont_getGlyph(font, c); if(glyph == NULL) { SWF_warn("SWFShape_drawScaledGlyph: no glyph for code %i found \n", c); return;...
0
89,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: static int do_seccomp(struct pt_regs *regs) { if (!test_thread_flag(TIF_SECCOMP)) return 0; /* * The ABI we present to seccomp tracers is that r3 contains * the syscall return value and orig_gpr3 contains the first * syscall parameter. This is different to the ptrace ABI where * both r3 and orig_gpr3...
0
84,773
Analyze the following 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 OnSyntheticGestureCompleted(SyntheticGesture::Result result) { EXPECT_EQ(SyntheticGesture::GESTURE_FINISHED, result); runner_->Quit(); } Commit Message: Drive out additional flakiness of TouchAction browser test. It is relatively stable but it has flaked a couple of times specifically with this...
0
119,297
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: clamp_default(const fz_colorspace *cs, const float *src, float *dst) { int i; for (i = 0; i < cs->n; i++) dst[i] = fz_clamp(src[i], 0, 1); } Commit Message: CWE ID: CWE-20
0
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: static int ap_query_queue(ap_qid_t qid, int *queue_depth, int *device_type) { struct ap_queue_status status; int t_depth, t_device_type, rc, i; rc = -EBUSY; for (i = 0; i < AP_MAX_RESET; i++) { status = ap_test_queue(qid, &t_depth, &t_device_type); switch (status.response_code) { case AP_RESPONSE_NORMA...
0
47,620
Analyze the following 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 __inet_inherit_port(struct sock *sk, struct sock *child) { struct inet_hashinfo *table = sk->sk_prot->h.hashinfo; unsigned short port = inet_sk(child)->inet_num; const int bhash = inet_bhashfn(sock_net(sk), port, table->bhash_size); struct inet_bind_hashbucket *head = &table->bhash[bhash]; struct inet...
0
25,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: irc_server_get_isupport_value (struct t_irc_server *server, const char *feature) { char feature2[64], *pos_feature, *pos_equal, *pos_space; int length; static char value[256]; if (!server || !server->isupport || !feature) return NULL; /* search feature with value */ snprintf ...
0
3,481
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: InputHandlerProxy::EventDisposition InputHandlerProxy::HandleTouchEnd( const blink::WebTouchEvent& touch_event) { if (touch_event.touches_length == 1) touch_result_ = kEventDispositionUndefined; return DID_NOT_HANDLE; } Commit Message: Revert "Add explicit flag for compositor scrollbar injected gestu...
0
137,974
Analyze the following 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 mutt_rfc2047_encode(char **pd, const char *specials, int col, const char *charsets) { char *e = NULL; size_t elen; if (!Charset || !*pd) return; if (!charsets || !*charsets) charsets = "utf-8"; rfc2047_encode(*pd, strlen(*pd), col, Charset, charsets, &e, &elen, specials); FREE(pd); ...
0
79,522
Analyze the following 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 is_mem_section_removable(unsigned long start_pfn, unsigned long nr_pages) { struct page *page = pfn_to_page(start_pfn); struct page *end_page = page + nr_pages; /* Check the starting page of each pageblock within the range */ for (; page < end_page; page = next_active_pageblock(page)) { if (!is_pageblo...
0
18,503
Analyze the following 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 kvm_io_bus_get_first_dev(struct kvm_io_bus *bus, gpa_t addr, int len) { struct kvm_io_range *range, key; int off; key = (struct kvm_io_range) { .addr = addr, .len = len, }; range = bsearch(&key, bus->range, bus->dev_count, sizeof(struct kvm_io_range), kvm_io_bus_sort_cmp); if (range == ...
0
20,358
Analyze the following 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::BindTextureHelper(GLenum target, GLuint texture) { bool changed = false; TextureUnit& unit = texture_units_[active_texture_unit_]; switch (target) { case GL_TEXTURE_2D: if (unit.bound_texture_2d != texture) { unit.bound_texture_2d = texture; changed = true...
0
140,880
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void WritesCorrectly(size_t num_chars) { std::string buffer; char kOriginal[] = "supercali"; strncpy(WriteInto(&buffer, num_chars + 1), kOriginal, num_chars); EXPECT_EQ(std::string(kOriginal, std::min(num_chars, arraysize(kOriginal) - 1)), std::stri...
0
110,875
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: vcard_response_new(VCard *card, unsigned char *buf, int len, int Le, vcard_7816_status_t status) { VCardResponse *new_response; if (len > Le) { return vcard_init_buffer_response(card, buf, len); } new_response = vcard_response_new_data(buf, len); if (new_response ==...
0
8,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: BaseAudioContext* AudioHandler::Context() const { return context_; } Commit Message: Revert "Keep AudioHandlers alive until they can be safely deleted." This reverts commit 071df33edf2c8b4375fa432a83953359f93ea9e4. Reason for revert: This CL seems to cause an AudioNode leak on the Linux leak bot. The log is:...
0
148,797
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void DiskCacheBackendTest::BackendDisabledAPI() { cache_impl_->SetUnitTestMode(); // Simulate failure restarting the cache. disk_cache::Entry *entry1, *entry2; std::unique_ptr<TestIterator> iter = CreateIterator(); EXPECT_EQ(2, cache_->GetEntryCount()); ASSERT_THAT(iter->OpenNextEntry(&entry1), IsOk()...
0
147,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: PHP_NAMED_FUNCTION(php_if_tmpfile) { php_stream *stream; if (zend_parse_parameters_none() == FAILURE) { return; } stream = php_stream_fopen_tmpfile(); if (stream) { php_stream_to_zval(stream, return_value); } else { RETURN_FALSE; } } Commit Message: Fix bug #72114 - int/size_t confusion in fread ...
0
52,179
Analyze the following 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 rectangles_intersects(const RECTANGLE_16* r1, const RECTANGLE_16* r2) { RECTANGLE_16 tmp; return rectangles_intersection(r1, r2, &tmp); } Commit Message: Fixed #5645: realloc return handling CWE ID: CWE-772
0
87,407
Analyze the following 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 mac80211_hwsim_del_radio(struct mac80211_hwsim_data *data, const char *hwname, struct genl_info *info) { hwsim_mcast_del_radio(data->idx, hwname, info); debugfs_remove_recursive(data->debugfs); ieee80211_unregister_hw(data->hw); device_release_driver(data->dev); device_unregiste...
0
83,839
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: HistogramType CustomHistogram::GetHistogramType() const { return CUSTOM_HISTOGRAM; } Commit Message: Convert DCHECKs to CHECKs for histogram types When a histogram is looked up by name, there is currently a DCHECK that verifies the type of the stored histogram matches the expected type. A mismatch represents...
0
140,050
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int nfs_commit_inode(struct inode *inode, int how) { LIST_HEAD(head); struct nfs_commit_info cinfo; int may_wait = how & FLUSH_SYNC; int res; res = nfs_commit_set_lock(NFS_I(inode), may_wait); if (res <= 0) goto out_mark_dirty; nfs_init_cinfo_from_inode(&cinfo, inode); res = nfs_scan_commit(inode, &hea...
0
39,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: error::Error GLES2DecoderImpl::DoDrawElements(bool instanced, GLenum mode, GLsizei count, GLenum type, int32 offset, ...
0
108,967
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int Reverb_setParameter (ReverbContext *pContext, void *pParam, void *pValue){ int status = 0; int16_t level; int16_t ratio; uint32_t time; t_reverb_settings *pProperties; int32_t *pParamTemp = (int32_t *)pParam; int32_t param = *pParamTemp++; if (pContext->preset) { if (param != REVERB_PARAM_PRESET)...
0
157,454
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void RenderWidgetHostImpl::OnImeCancelComposition() { if (view_) view_->ImeCancelComposition(); } Commit Message: Check that RWHI isn't deleted manually while owned by a scoped_ptr in RVHI BUG=590284 Review URL: https://codereview.chromium.org/1747183002 Cr-Commit-Position: refs/heads/master@{#378844} C...
0
130,986