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 struct inode *alloc_inode(struct super_block *sb) { struct inode *inode; if (sb->s_op->alloc_inode) inode = sb->s_op->alloc_inode(sb); else inode = kmem_cache_alloc(inode_cachep, GFP_KERNEL); if (!inode) return NULL; if (unlikely(inode_init_always(sb, inode))) { if (inode->i_sb->s_op->destr...
0
36,832
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: TestPaintArtifact& TestPaintArtifact::Chunk(DisplayItemClient& client, const PropertyTreeState& state) { auto& chunks = paint_chunks_data_.chunks; if (!chunks.IsEmpty()) chunks.back().end_index = display_item_list_.size(); chunks.push_back( PaintChunk(di...
0
125,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 EditorClient& emptyEditorClient() { DEFINE_STATIC_LOCAL(EmptyEditorClient, client, ()); return client; } Commit Message: Make TypingCommand::insertText() to take SelectionInDOMTree instead of VisibleSelection This patch makes |TypingCommand::insertText()| to take |SelectionInDOMTree| instead of |Visi...
0
129,138
Analyze the following 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::ShowCertificateViewer(const std::string& cert_chain) { std::unique_ptr<base::Value> value = base::JSONReader::Read(cert_chain); if (!value || value->GetType() != base::Value::Type::LIST) { NOTREACHED(); return; } std::unique_ptr<base::ListValue> list = base::ListValue::...
0
151,076
Analyze the following 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 t1_start_eexec(void) { int i; if (is_included(fm_cur)) { get_length1(); save_offset(); } if (!t1_pfa) t1_check_block_len(false); for (t1_line_ptr = t1_line_array, i = 0; i < 4; i++) { edecrypt((byte)t1_getbyte()); *t1_line_ptr++ = 0; } ...
0
76,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: int snd_seq_kernel_client_enqueue(int client, struct snd_seq_event * ev, int atomic, int hop) { return kernel_client_enqueue(client, ev, NULL, 0, atomic, hop); } Commit Message: ALSA: seq: Fix missing NULL check at remove_events ioctl snd_seq_ioctl_remove_events() calls snd_seq_fifo_clear() unconditional...
0
54,726
Analyze the following 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 Layer::SetIsDrawable(bool is_drawable) { DCHECK(IsPropertyChangeAllowed()); if (is_drawable_ == is_drawable) return; is_drawable_ = is_drawable; SetNeedsCommit(); } Commit Message: Removed pinch viewport scroll offset distribution The associated change in Blink makes the pinch viewport a prope...
0
111,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: DisplaySourceCustomBindings::DisplaySourceCustomBindings(ScriptContext* context) : ObjectBackedNativeHandler(context), weak_factory_(this) { RouteFunction("StartSession", base::Bind(&DisplaySourceCustomBindings::StartSession, weak_factory_.GetWeakPtr()))...
1
172,248
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int nfs4_xdr_dec_pathconf(struct rpc_rqst *req, __be32 *p, struct nfs_pathconf *pathconf) { struct xdr_stream xdr; struct compound_hdr hdr; int status; xdr_init_decode(&xdr, &req->rq_rcv_buf, p); status = decode_compound_hdr(&xdr, &hdr); if (!status) status = decode_putfh(&xdr); if (!status) st...
0
23,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: bool Polkit1Backend::isCallerAuthorized(const QString &action, QByteArray callerID) { PolkitQt1::SystemBusNameSubject subject(QString::fromUtf8(callerID)); authority->checkAuthorization(action, subject, PolkitQt1::Authority::AllowUserInteraction); e.exec(); switch (e.result()) { case Polki...
0
7,207
Analyze the following 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 cm_migrate(struct ib_cm_id *cm_id) { struct cm_id_private *cm_id_priv; unsigned long flags; int ret = 0; cm_id_priv = container_of(cm_id, struct cm_id_private, id); spin_lock_irqsave(&cm_id_priv->lock, flags); if (cm_id->state == IB_CM_ESTABLISHED && (cm_id->lap_state == IB_CM_LAP_UNINIT ||...
0
38,406
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: EXPORTED char *mbentry_datapath(const struct mboxlist_entry *mbentry, uint32_t uid) { return mboxname_datapath(mbentry->partition, mbentry->name, mbentry->uniqueid, uid); } Commit Message: mboxlist: fix uninitialised memor...
0
61,243
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SerializedScriptValue::SerializedScriptValue(const String& wireData) : m_externallyAllocatedMemory(0) { m_data = wireData.isolatedCopy(); } Commit Message: Replace further questionable HashMap::add usages in bindings BUG=390928 R=dcarney@chromium.org Review URL: https://codereview.chromium.org/41127300...
0
120,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: void DevToolsWindow::ActivateContents(content::WebContents* contents) { if (IsDocked()) { content::WebContents* inspected_tab = this->GetInspectedWebContents(); inspected_tab->GetDelegate()->ActivateContents(inspected_tab); } else { browser_->window()->Activate(); } } Commit Message: DevTools: ...
0
113,123
Analyze the following 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 AddAllUsers() { for (size_t i = 0; i < base::size(kTestAccounts); ++i) { if (i == PRIMARY_ACCOUNT_INDEX) continue; AddUser(kTestAccounts[i], i >= SECONDARY_ACCOUNT_INDEX_START); } } Commit Message: [Files app] Fix open new window command Change background page |launcher| nam...
0
130,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: psf_asciiheader_printf (SF_PRIVATE *psf, const char *format, ...) { va_list argptr ; int maxlen ; char *start ; maxlen = strlen ((char*) psf->header) ; start = ((char*) psf->header) + maxlen ; maxlen = sizeof (psf->header) - maxlen ; va_start (argptr, format) ; vsnprintf (start, maxlen, format, ar...
1
170,063
Analyze the following 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::HandleShaderSourceBucket( uint32 immediate_data_size, const cmds::ShaderSourceBucket& c) { Bucket* bucket = GetBucket(c.data_bucket_id); if (!bucket || bucket->size() == 0) { return error::kInvalidArguments; } return ShaderSourceHelper( c.shader, bucket->GetDataA...
0
120,972
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned int flags, int *peeked, int *off, int *err) { struct sk_buff *skb; long timeo; /* * Caller is allowed not to check sk->sk_err before skb_recv_datagram() */ int error = sock_error(sk); if (error) goto no_packet; timeo = sock_rcvtim...
1
166,144
Analyze the following 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 FrameFetchContext::PopulateResourceRequest( Resource::Type type, const ClientHintsPreferences& hints_preferences, const FetchParameters::ResourceWidth& resource_width, ResourceRequest& request) { ModifyRequestForCSP(request); AddClientHintsIfNecessary(hints_preferences, resource_width, re...
0
138,766
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: _asn1_cpy_name (asn1_node dst, asn1_node src) { if (dst == NULL) return dst; if (src == NULL) { dst->name[0] = 0; dst->name_hash = hash_pjw_bare (dst->name, 0); return dst; } _asn1_str_cpy (dst->name, sizeof (dst->name), src->name); dst->name_hash = src->name_hash; retur...
0
3,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: bool GLES2DecoderPassthroughImpl::CheckResetStatus() { DCHECK(!WasContextLost()); DCHECK(context_->IsCurrent(nullptr)); if (IsRobustnessSupported()) { GLenum driver_status = api()->glGetGraphicsResetStatusARBFn(); if (driver_status == GL_NO_ERROR) { return false; } switch (driver_sta...
0
141,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 sc_format_path(const char *str, sc_path_t *path) { int type = SC_PATH_TYPE_PATH; if (path) { memset(path, 0, sizeof(*path)); if (*str == 'i' || *str == 'I') { type = SC_PATH_TYPE_FILE_ID; str++; } path->len = sizeof(path->value); if (sc_hex_to_bin(str, path->value, &path->len) >= 0) { p...
0
78,843
Analyze the following 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 HTMLMediaElement::SetMediaStreamRegistry(URLRegistry* registry) { DCHECK(!media_stream_registry_); media_stream_registry_ = registry; } Commit Message: Simplify "WouldTaintOrigin" concept in media/blink Currently WebMediaPlayer has three predicates: - DidGetOpaqueResponseFromServiceWorker - HasSingle...
0
144,584
Analyze the following 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 XSSAuditor::SetEncoding(const WTF::TextEncoding& encoding) { const size_t kMiniumLengthForSuffixTree = 512; // FIXME: Tune this parameter. const int kSuffixTreeDepth = 5; if (!encoding.IsValid()) return; encoding_ = encoding; decoded_url_ = Canonicalize(document_url_.GetString(), kNoTruncat...
0
147,016
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: tree_mod_log_set_root_pointer(struct btrfs_root *root, struct extent_buffer *new_root_node, int log_removal) { int ret; ret = tree_mod_log_insert_root(root->fs_info, root->node, new_root_node, GFP_NOFS, log_removal); BUG_ON(ret < 0); } Commit Message: Btrfs: make xattr replace ope...
0
45,373
Analyze the following 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 sctp_register_pf(struct sctp_pf *pf, sa_family_t family) { switch (family) { case PF_INET: if (sctp_pf_inet_specific) return 0; sctp_pf_inet_specific = pf; break; case PF_INET6: if (sctp_pf_inet6_specific) return 0; sctp_pf_inet6_specific = pf; break; default: return 0; } return 1; }...
0
42,925
Analyze the following 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 Extension::RuntimeData::UpdateTabSpecificPermissions( int tab_id, scoped_refptr<const PermissionSet> permissions) { CHECK_GE(tab_id, 0); if (tab_specific_permissions_.count(tab_id)) { tab_specific_permissions_[tab_id] = PermissionSet::CreateUnion( tab_specific_permissions_[tab_id], ...
0
114,380
Analyze the following 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::unique_ptr<service_manager::Service> CreateTestService() { return std::unique_ptr<service_manager::Service>(new TestService); } Commit Message: Fix content_shell with network service enabled not loading pages. This regressed in my earlier cl r528763. This is a reland of r547221. Bug: 833612 Change-Id:...
0
131,061
Analyze the following 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 OneClickSigninSyncStarter::CompleteInitForNewProfile( chrome::HostDesktopType desktop_type, Profile* new_profile, Profile::CreateStatus status) { DCHECK_NE(profile_, new_profile); switch (status) { case Profile::CREATE_STATUS_LOCAL_FAIL: { NOTREACHED() << "Error creating new profil...
0
112,605
Analyze the following 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 GraphicsContext3DPrivate::makeCurrentIfNeeded() const { const QOpenGLContext* currentContext = QOpenGLContext::currentContext(); if (currentContext == m_platformContext) return true; return m_platformContext->makeCurrent(m_surface); } Commit Message: [Qt] Remove an unnecessary masking fr...
0
107,389
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: image_transform_png_set_tRNS_to_alpha_add(image_transform *this, PNG_CONST image_transform **that, png_byte colour_type, png_byte bit_depth) { UNUSED(bit_depth) this->next = *that; *that = this; /* We don't know yet whether there will be a tRNS chunk, but we know that * this transformati...
1
173,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: ftp_site(ftpbuf_t *ftp, const char *cmd) { if (ftp == NULL) { return 0; } if (!ftp_putcmd(ftp, "SITE", cmd)) { return 0; } if (!ftp_getresp(ftp) || ftp->resp < 200 || ftp->resp >= 300) { return 0; } return 1; } Commit Message: CWE ID: CWE-119
0
14,810
Analyze the following 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 nl80211_tx_mgmt_cancel_wait(struct sk_buff *skb, struct genl_info *info) { struct cfg80211_registered_device *rdev = info->user_ptr[0]; struct net_device *dev = info->user_ptr[1]; u64 cookie; if (!info->attrs[NL80211_ATTR_COOKIE]) return -EINVAL; if (!rdev->ops->mgmt_tx_cancel_wait) return -...
0
26,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: generic_file_splice_write(struct pipe_inode_info *pipe, struct file *out, loff_t *ppos, size_t len, unsigned int flags) { struct address_space *mapping = out->f_mapping; struct inode *inode = mapping->host; struct splice_desc sd = { .total_len = len, .flags = flags, .pos = *ppos, .u.file = out, }...
0
46,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: client_connected_to_dbus (GObject *source_object, GAsyncResult *res, gpointer user_data) { FlatpakProxyClient *client = user_data; GSocketConnection *connection; GError *error = NULL; GIOStream *stream; stream = g_dbus_address_get_stream_fin...
0
84,365
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: mrb_instance_alloc(mrb_state *mrb, mrb_value cv) { struct RClass *c = mrb_class_ptr(cv); struct RObject *o; enum mrb_vtype ttype = MRB_INSTANCE_TT(c); if (c->tt == MRB_TT_SCLASS) mrb_raise(mrb, E_TYPE_ERROR, "can't create instance of singleton class"); if (ttype == 0) ttype = MRB_TT_OBJECT; if (...
0
82,097
Analyze the following 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 kern_path(const char *name, unsigned int flags, struct path *path) { struct nameidata nd; struct filename *filename = getname_kernel(name); int res = PTR_ERR(filename); if (!IS_ERR(filename)) { res = filename_lookup(AT_FDCWD, filename, flags, &nd); putname(filename); if (!res) *path = nd.path; ...
0
42,328
Analyze the following 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 hostap_set_antsel(local_info_t *local) { u16 val; int ret = 0; if (local->antsel_tx != HOSTAP_ANTSEL_DO_NOT_TOUCH && local->func->cmd(local->dev, HFA384X_CMDCODE_READMIF, HFA386X_CR_TX_CONFIGURE, NULL, &val) == 0) { val &= ~(BIT(2) | BIT(1)); switch (local->antsel_tx) { case HOS...
0
24,108
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: stringprep_apply_table_to_string (uint32_t * ucs4, size_t * ucs4len, size_t maxucs4len, const Stringprep_table_element * table) { ssize_t pos; size_t i, maplen; while ((pos = stringprep_find_string_in_table (ucs4, *ucs4len, &i, table)) != -1) { for (maplen = STRINGPREP_MA...
0
4,781
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: incremental_gc_step(mrb_state *mrb, mrb_gc *gc) { size_t limit = 0, result = 0; limit = (GC_STEP_SIZE/100) * gc->step_ratio; while (result < limit) { result += incremental_gc(mrb, gc, limit); if (gc->state == MRB_GC_STATE_ROOT) break; } gc->threshold = gc->live + GC_STEP_SIZE; } Commit M...
0
64,424
Analyze the following 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_metadata(HTTPContext *s, char *data) { char *key; char *val; char *end; char *next = data; while (*next) { key = next; val = strstr(key, "='"); if (!val) break; end = strstr(val, "';"); if (!end) break; ...
0
70,874
Analyze the following 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 decode_attr_layout_blksize(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res) { __be32 *p; dprintk("%s: bitmap is %x\n", __func__, bitmap[2]); *res = 0; if (bitmap[2] & FATTR4_WORD2_LAYOUT_BLKSIZE) { p = xdr_inline_decode(xdr, 4); if (unlikely(!p)) { print_overflow_msg(__fun...
0
23,266
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void JBIG2Stream::readPageInfoSeg(Guint length) { Guint xRes, yRes, flags, striping; if (!readULong(&pageW) || !readULong(&pageH) || !readULong(&xRes) || !readULong(&yRes) || !readUByte(&flags) || !readUWord(&striping)) { goto eofError; } pageDefPixel = (flags >> 2) & 1; defCombOp = (fl...
0
14,711
Analyze the following 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 PageHandler::NotifyScreencastVisibility(bool visible) { if (visible) capture_retry_count_ = kCaptureRetryLimit; frontend_->ScreencastVisibilityChanged(visible); } Commit Message: [DevTools] Do not allow Page.setDownloadBehavior for extensions Bug: 866426 Change-Id: I71b672978e1a8ec779ede49da16b2119...
0
143,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: bool Document::HasValidNamespaceForElements(const QualifiedName& q_name) { if (!q_name.Prefix().IsEmpty() && q_name.NamespaceURI().IsNull()) return false; if (q_name.Prefix() == g_xml_atom && q_name.NamespaceURI() != xml_names::kNamespaceURI) return false; if (q_name.Prefix() == g_xmlns_atom ...
0
129,743
Analyze the following 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 free_pipe_info(struct pipe_inode_info *pipe) { int i; for (i = 0; i < pipe->buffers; i++) { struct pipe_buffer *buf = pipe->bufs + i; if (buf->ops) buf->ops->release(pipe, buf); } if (pipe->tmp_page) __free_page(pipe->tmp_page); kfree(pipe->bufs); kfree(pipe); } Commit Message: new helper: c...
0
44,134
Analyze the following 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 unsigned char* ensure(printbuffer * const p, size_t needed) { unsigned char *newbuffer = NULL; size_t newsize = 0; if ((p == NULL) || (p->buffer == NULL)) { return NULL; } if ((p->length > 0) && (p->offset >= p->length)) { /* make sure that offset is valid */ ...
0
87,151
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SigPipe(SIGNAL_ARG) { #ifdef USE_MIGEMO init_migemo(); #endif mySignal(SIGPIPE, SigPipe); SIGNAL_RETURN; } Commit Message: Make temporary directory safely when ~/.w3m is unwritable CWE ID: CWE-59
0
84,451
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: RequestConnection(struct upnphttp * h, const char * action, const char * ns) { UNUSED(action); UNUSED(ns); SoapError(h, 606, "Action not authorized"); } Commit Message: GetOutboundPinholeTimeout: check args CWE ID: CWE-476
0
89,874
Analyze the following 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 drep_Size(GF_Box *s) { s->size += 8; return GF_OK; } Commit Message: fixed 2 possible heap overflows (inc. #1088) CWE ID: CWE-125
0
80,073
Analyze the following 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::Rect BrowserNonClientFrameViewAura::GetWindowBoundsForClientBounds( const gfx::Rect& client_bounds) const { int top_height = NonClientTopBorderHeight(false); return frame_painter_->GetWindowBoundsForClientBounds(top_height, client_bounds); } Co...
0
108,188
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GLenum Framebuffer::GetStatus( TextureManager* texture_manager, GLenum target) const { std::string signature; if (allow_framebuffer_combo_complete_map_) { signature = base::StringPrintf("|FBO|target=%04x", target); for (AttachmentMap::const_iterator it = attachments_.begin(); it != attach...
0
120,694
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void BrowserCommandController::UpdateReloadStopState(bool is_loading, bool force) { window()->UpdateReloadStopState(is_loading, force); command_updater_.UpdateCommandEnabled(IDC_STOP, is_loading); } Commit Message: Remove TabContents from TabStripModelObse...
0
117,886
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void GLES2DecoderImpl::DoCopyTexImage(Texture* texture, GLenum textarget, gl::GLImage* image) { texture->SetLevelImageState(textarget, 0, Texture::COPIED); bool rv = image->CopyTexImage(textarget); DCHECK(rv) << "CopyTexImage() fail...
0
141,287
Analyze the following 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 HTMLFormElement::layoutObjectIsNeeded(const ComputedStyle& style) { if (!m_wasDemoted) return HTMLElement::layoutObjectIsNeeded(style); ContainerNode* node = parentNode(); if (!node || !node->layoutObject()) return HTMLElement::layoutObjectIsNeeded(style); LayoutObject* parentLayoutObject = ...
0
142,538
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: is_ubik(uint32_t opcode) { if ((opcode >= VOTE_LOW && opcode <= VOTE_HIGH) || (opcode >= DISK_LOW && opcode <= DISK_HIGH)) return(1); else return(0); } Commit Message: CVE-2017-13049/Rx: add a missing bounds check for Ubik One of the case blocks in ubik_print() didn't check bounds before fetching 32 ...
0
62,274
Analyze the following 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 snd_timer_stop1(struct snd_timer_instance *timeri, bool stop) { struct snd_timer *timer; int result = 0; unsigned long flags; timer = timeri->timer; if (!timer) return -EINVAL; spin_lock_irqsave(&timer->lock, flags); if (!(timeri->flags & (SNDRV_TIMER_IFLG_RUNNING | SNDRV_TIMER_IFLG...
0
52,718
Analyze the following 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 add_session_id(struct cryp_ctx *ctx) { /* * We never want 0 to be a valid value, since this is the default value * for the software context. */ if (unlikely(atomic_inc_and_test(&session_id))) atomic_inc(&session_id); ctx->session_id = atomic_read(&session_id); } Commit Message: crypto: pr...
0
47,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: RendererURLRequestContextSelector(BrowserContext* browser_context, int render_child_id) : request_context_(browser_context->GetRequestContextForRenderProcess( render_child_id)), media_request_context_( browser_context->Ge...
0
114,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 void gnutls_lxc_init(void) { gnutls_global_init(); } Commit Message: CVE-2015-1335: Protect container mounts against symlinks When a container starts up, lxc sets up the container's inital fstree by doing a bunch of mounting, guided by the container configuration file. The container config is owned by ...
0
44,677
Analyze the following 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 BluetoothDeviceChooserController::SetTestScanDurationForTesting( TestScanDurationSetting setting) { switch (setting) { case TestScanDurationSetting::IMMEDIATE_TIMEOUT: scan_duration_ = 0; break; case TestScanDurationSetting::NEVER_TIMEOUT: scan_duration_ = base::TimeDelta::Max...
0
138,084
Analyze the following 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 stsh_Write(GF_Box *s, GF_BitStream *bs) { GF_Err e; u32 i; GF_StshEntry *ent; GF_ShadowSyncBox *ptr = (GF_ShadowSyncBox *)s; e = gf_isom_full_box_write(s, bs); if (e) return e; gf_bs_write_u32(bs, gf_list_count(ptr->entries)); i=0; while ((ent = (GF_StshEntry *)gf_list_enum(ptr->entries, &i))) { ...
0
80,485
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: AppModalDialog::~AppModalDialog() { } Commit Message: Fix a Windows crash bug with javascript alerts from extension popups. BUG=137707 Review URL: https://chromiumcodereview.appspot.com/10828423 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152716 0039d316-1c4b-4281-b951-d872f2087c98 CWE ID: CWE-20
1
170,755
Analyze the following 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 String8::clear() { SharedBuffer::bufferFromData(mString)->release(); mString = getEmptyString(); } Commit Message: libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8 Inconsistent behaviour between utf16_to_utf8 and utf16_to_utf8_length is causing a heap overflow. Correcti...
0
158,389
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: sshkey_load_cert(const char *filename, struct sshkey **keyp) { struct sshkey *pub = NULL; char *file = NULL; int r = SSH_ERR_INTERNAL_ERROR; if (keyp != NULL) *keyp = NULL; if (asprintf(&file, "%s-cert.pub", filename) == -1) return SSH_ERR_ALLOC_FAIL; if ((pub = sshkey_new(KEY_UNSPEC)) == NULL) { g...
0
72,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: GF_Err gf_isom_box_dump(void *ptr, FILE * trace) { return gf_isom_box_dump_ex(ptr, trace, 0); } Commit Message: fixed 2 possible heap overflows (inc. #1088) CWE ID: CWE-125
0
80,738
Analyze the following 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 reflectedCustomBooleanAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) { TestObject* imp = V8TestObject::toNative(info.Holder()); v8SetReturnValueBool(info, imp->fastHasAttribute(HTMLNames::customContentBooleanAttrAttr)); } Commit Message: document.location bindings fix B...
0
121,906
Analyze the following 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 CommandBufferProxyImpl::TryUpdateState() { if (last_state_.error == gpu::error::kNoError) shared_state_->Read(&last_state_); } Commit Message: Convert plugin and GPU process to brokered handle duplication. BUG=119250 Review URL: https://chromiumcodereview.appspot.com/9958034 git-svn-id: svn://svn.ch...
0
106,747
Analyze the following 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 shared_policy_replace(struct shared_policy *sp, unsigned long start, unsigned long end, struct sp_node *new) { struct sp_node *n, *new2 = NULL; restart: spin_lock(&sp->lock); n = sp_lookup(sp, start, end); /* Take care of old policies in the same range. */ while (n && n->start < end) { str...
0
21,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: void __kfree_skb_defer(struct sk_buff *skb) { _kfree_skb_defer(skb); } Commit Message: tcp: fix SCM_TIMESTAMPING_OPT_STATS for normal skbs __sock_recv_timestamp can be called for both normal skbs (for receive timestamps) and for skbs on the error queue (for transmit timestamps). Commit 1c885808e456 (tcp: SOF_...
0
67,663
Analyze the following 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 HTMLMediaElement::loadInternal() { m_textTracksWhenResourceSelectionBegan.clear(); if (m_textTracks) { for (unsigned i = 0; i < m_textTracks->length(); ++i) { TextTrack* track = m_textTracks->anonymousIndexedGetter(i); if (track->mode() != TextTrack::disabledKeyword()) m_textTrack...
0
128,834
Analyze the following 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 reflectUrlStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TestInterfaceNodeV8Internal::reflectUrlStringAttributeAttributeGetter(info); } Commit Message: binding: Removes unused code in templates/attributes.cpp. Faking {{cpp_class}} and {{c8_class}} doesn...
0
119,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: void WallpaperManagerBase::SetCommandLineForTesting( base::CommandLine* command_line) { command_line_for_testing_ = command_line; SetDefaultWallpaperPathsFromCommandLine(command_line); } Commit Message: [reland] Do not set default wallpaper unless it should do so. TBR=bshe@chromium.org, alemate@chromium...
0
128,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: Ins_SSWCI( TT_ExecContext exc, FT_Long* args ) { exc->GS.single_width_cutin = (FT_F26Dot6)args[0]; } Commit Message: CWE ID: CWE-476
0
10,681
Analyze the following 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 HTMLFormElement::validateInteractively() { UseCounter::count(document(), UseCounter::FormValidationStarted); const FormAssociatedElement::List& elements = associatedElements(); for (unsigned i = 0; i < elements.size(); ++i) { if (elements[i]->isFormControlElement()) toHTMLFormControlElement(e...
0
142,558
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static unsigned long count_partial(struct kmem_cache_node *n, int (*get_count)(struct page *)) { unsigned long flags; unsigned long x = 0; struct page *page; spin_lock_irqsave(&n->list_lock, flags); list_for_each_entry(page, &n->partial, lru) x += get_count(page); spin_unlock_irqrestore(&n->list_loc...
0
24,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: static void check_stack_usage(void) { static DEFINE_SPINLOCK(low_water_lock); static int lowest_to_date = THREAD_SIZE; unsigned long *n = end_of_stack(current); unsigned long free; while (*n == 0) n++; free = (unsigned long)n - (unsigned long)end_of_stack(current); if (free >= lowest_to_date) return;...
0
22,098
Analyze the following 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 mock_saving() const { return mock_saving_; } Commit Message: Remove unused histograms from the background loader offliner. Bug: 975512 Change-Id: I87b0a91bed60e3a9e8a1fd9ae9b18cac27a0859f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1683361 Reviewed-by: Cathy Li <chili@chromium....
0
139,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: WebKitWebView* kit(WebCore::Page* corePage) { if (!corePage) return 0; ASSERT(corePage->chrome()); WebKit::ChromeClient* client = static_cast<WebKit::ChromeClient*>(corePage->chrome()->client()); return client ? static_cast<WebKitWebView*>(client->webView()) : 0; } Commit Message: 2011-0...
0
100,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: MODRET set_maxhostclients(cmd_rec *cmd) { int max; config_rec *c = NULL; if (cmd->argc < 2 || cmd->argc > 3) CONF_ERROR(cmd, "wrong number of parameters"); CHECK_CONF(cmd, CONF_ROOT|CONF_VIRTUAL|CONF_GLOBAL|CONF_ANON); if (!strcasecmp(cmd->argv[1], "none")) max = 0; else { char *endp =...
0
67,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: static int ext4_split_extent_at(handle_t *handle, struct inode *inode, struct ext4_ext_path *path, ext4_lblk_t split, int split_flag, int flags) { ext4_fsblk_t newblock; ext4_lblk_t ee_block; struct ext4_extent *ex, newex, orig_ex; struct ext4_extent *ex2 = NULL; unsig...
0
34,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: static MagickBooleanType WritePixelCacheIndexes(CacheInfo *cache_info, NexusInfo *restrict nexus_info,ExceptionInfo *exception) { MagickOffsetType count, offset; MagickSizeType extent, length; register const IndexPacket *restrict p; register ssize_t y; size_t rows; i...
0
73,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: BluetoothSocketAsyncApiFunction::~BluetoothSocketAsyncApiFunction() {} Commit Message: chrome.bluetoothSocket: Fix regression in send() In https://crrev.com/c/997098, params_ was changed to a local variable, but it needs to last longer than that since net::WrappedIOBuffer may use the data after the local variab...
0
154,097
Analyze the following 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 em_call(struct x86_emulate_ctxt *ctxt) { long rel = ctxt->src.val; ctxt->src.val = (unsigned long)ctxt->_eip; jmp_rel(ctxt, rel); return em_push(ctxt); } Commit Message: KVM: x86: Emulator fixes for eip canonical checks on near branches Before changing rip (during jmp, call, ret, etc.) th...
1
169,909
Analyze the following 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 aio_read_events_ring(struct kioctx *ctx, struct io_event __user *event, long nr) { struct aio_ring *ring; unsigned head, tail, pos; long ret = 0; int copy_ret; mutex_lock(&ctx->ring_lock); ring = kmap_atomic(ctx->ring_pages[0]); head = ring->head; tail = ring->tail; kunmap_atomic(ring)...
0
40,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: void netdev_lower_state_changed(struct net_device *lower_dev, void *lower_state_info) { struct netdev_notifier_changelowerstate_info changelowerstate_info; ASSERT_RTNL(); changelowerstate_info.lower_state_info = lower_state_info; call_netdevice_notifiers_info(NETDEV_CHANGELOWERSTATE, lower_dev, ...
0
48,883
Analyze the following 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 bool rb_reader_lock(struct ring_buffer_per_cpu *cpu_buffer) { if (likely(!in_nmi())) { raw_spin_lock(&cpu_buffer->reader_lock); return true; } /* * If an NMI die dumps out the content of the ring buffer * trylock must be used to prevent a deadlock if the NMI * preempted a task that hol...
0
72,570
Analyze the following 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::HandleTexSubImage3D( uint32_t immediate_data_size, const volatile void* cmd_data) { if (!feature_info_->IsWebGL2OrES3Context()) return error::kUnknownCommand; const char* func_name = "glTexSubImage3D"; const volatile gles2::cmds::TexSubImage3D& c = *static_c...
0
141,597
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: tracing_free_buffer_write(struct file *filp, const char __user *ubuf, size_t cnt, loff_t *ppos) { /* * There is no need to read what the user has written, this function * is just to make sure that there is no error when "echo" is used */ *ppos += cnt; return cnt; } Commit Message: Merge tag 'trac...
0
81,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: Ins_JROF( TT_ExecContext exc, FT_Long* args ) { if ( args[1] == 0 ) Ins_JMPR( exc, args ); } Commit Message: CWE ID: CWE-476
0
10,618
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: __wsum __skb_checksum(const struct sk_buff *skb, int offset, int len, __wsum csum, const struct skb_checksum_ops *ops) { int start = skb_headlen(skb); int i, copy = start - offset; struct sk_buff *frag_iter; int pos = 0; /* Checksum header. */ if (copy > 0) { if (copy > len) copy = len; csum...
0
39,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: static int mov_auto_flush_fragment(AVFormatContext *s, int force) { MOVMuxContext *mov = s->priv_data; int had_moov = mov->moov_written; int ret = mov_flush_fragment(s, force); if (ret < 0) return ret; if (!had_moov && mov->flags & FF_MOV_FLAG_DELAY_MOOV) ret = mov_flush_fragme...
0
79,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 HTMLElement::applyAlignmentAttributeToStyle(const Attribute& attribute, StylePropertySet* style) { int floatValue = CSSValueInvalid; int verticalAlignValue = CSSValueInvalid; const AtomicString& alignment = attribute.value(); if (equalIgnoringCase(alignment, "absmiddle")) verticalAli...
0
100,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 CardUnmaskPromptViews::FadeOutView::OnPaint(gfx::Canvas* canvas) { if (!fade_everything_ || opacity_ > 0.99) return views::View::OnPaint(canvas); canvas->SaveLayerAlpha(0xff * opacity_); views::View::OnPaint(canvas); canvas->Restore(); } Commit Message: Clear out some minor TODOs. BUG=none Re...
0
110,113
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: String LocalFrameClientImpl::UserAgent() { WebString override = web_frame_->Client() ? web_frame_->Client()->UserAgentOverride() : ""; if (!override.IsEmpty()) return override; if (user_agent_.IsEmpty()) user_agent_ = Platform::Current()->UserAgent(); return user_agent_; } Commit Message: ...
0
145,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 void DeprecateAsOverloadedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) { ExceptionState exception_state(info.GetIsolate(), ExceptionState::kExecutionContext, "TestObject", "DeprecateAsOverloadedMethod"); TestObject* impl = V8TestObject::ToImpl(info.Holder()); int32_t arg; arg = ...
0
134,647
Analyze the following 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_NROUND( INS_ARG ) { DO_NROUND } Commit Message: CWE ID: CWE-119
0
10,143
Analyze the following 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 sysvipc_proc_open(struct inode *inode, struct file *file) { int ret; struct seq_file *seq; struct ipc_proc_iter *iter; ret = -ENOMEM; iter = kmalloc(sizeof(*iter), GFP_KERNEL); if (!iter) goto out; ret = seq_open(file, &sysvipc_proc_seqops); if (ret) goto out_kfree; seq = file->private_...
0
29,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: xsltInitCtxtKeys(xsltTransformContextPtr ctxt, xsltDocumentPtr idoc) { xsltStylesheetPtr style; xsltKeyDefPtr keyDef; if ((ctxt == NULL) || (idoc == NULL)) return; #ifdef KEY_INIT_DEBUG fprintf(stderr, "xsltInitCtxtKeys on document\n"); #endif #ifdef WITH_XSLT_DEBUG_KEYS if ((idoc->doc != NULL...
0
156,745
Analyze the following 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 async_chainiv_init(struct crypto_tfm *tfm) { struct async_chainiv_ctx *ctx = crypto_tfm_ctx(tfm); spin_lock_init(&ctx->lock); crypto_init_queue(&ctx->queue, 100); INIT_WORK(&ctx->postponed, async_chainiv_do_postponed); return chainiv_init_common(tfm); } Commit Message: crypto: include crypto- ...
0
45,605