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: struct key_user *key_user_lookup(kuid_t uid) { struct key_user *candidate = NULL, *user; struct rb_node *parent = NULL; struct rb_node **p; try_again: p = &key_user_tree.rb_node; spin_lock(&key_user_lock); /* search the tree for a user record with a matching UID */ while (*p) { parent = *p; user = rb...
0
85,148
Analyze the following 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_recv_handshake_header (gnutls_session_t session, gnutls_handshake_description_t type, gnutls_handshake_description_t * recv_type) { int ret; uint32_t length32 = 0; uint8_t *dataptr = NULL; /* for realloc */ size_t handshake_header_size = HANDSHAKE_HEADER_SIZE; /* if we have ...
1
165,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: static int set_sec_attr(sc_file_t *file, unsigned int am, unsigned int ac, unsigned int meth) { const amode_entry_t *table; /* CHV with reference '0' is the transport PIN * and is presented as 'AUT' key with reference '0'*/ if (meth == SC_AC_CHV && ac == 0) meth = SC_AC_AUT; if (file->type == S...
0
78,174
Analyze the following 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 media_device_setup_link(struct media_device *mdev, struct media_link_desc __user *_ulink) { struct media_link *link = NULL; struct media_link_desc ulink; struct media_entity *source; struct media_entity *sink; int ret; if (copy_from_user(&ulink, _ulink, sizeof(ulink))) return -EFAULT;...
0
39,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: void LayerTreeCoordinator::renderNextFrame() { m_waitingForUIProcess = false; scheduleLayerFlush(); for (unsigned i = 0; i < m_updateAtlases.size(); ++i) m_updateAtlases[i]->didSwapBuffers(); } Commit Message: [WK2] LayerTreeCoordinator should release unused UpdatedAtlases https://bugs.webkit...
0
97,599
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: pch_says_nonexistent (bool which) { return p_says_nonexistent[which]; } Commit Message: CWE ID: CWE-78
0
2,707
Analyze the following 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 LookupMatchInTopDomains(base::StringPiece skeleton) { DCHECK_NE(skeleton.back(), '.'); auto labels = base::SplitStringPiece(skeleton, ".", base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL); if (labels.size() > kNumberOfLabelsToCheck) { labels.erase(labels.begin...
1
173,223
Analyze the following 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 queue_limits *dm_get_queue_limits(struct mapped_device *md) { BUG_ON(!atomic_read(&md->holders)); return &md->queue->limits; } Commit Message: dm: fix race between dm_get_from_kobject() and __dm_destroy() The following BUG_ON was hit when testing repeat creation and removal of DM devices: kernel B...
0
85,896
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void free_minor(int minor) { spin_lock(&_minor_lock); idr_remove(&_minor_idr, minor); spin_unlock(&_minor_lock); } Commit Message: dm: fix race between dm_get_from_kobject() and __dm_destroy() The following BUG_ON was hit when testing repeat creation and removal of DM devices: kernel BUG at drive...
0
85,953
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void Browser::RunFileChooser(TabContents* tab, const ViewHostMsg_RunFileChooser_Params& params) { RunFileChooserHelper(tab, params); } Commit Message: Implement a bubble that appears at the top of the screen when a tab enters fullscreen mode via webkitRequestFullScreen(), telling ...
0
97,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 ScriptController::clearForOutOfMemory() { clearForClose(true); } Commit Message: Call didAccessInitialDocument when javascript: URLs are used. BUG=265221 TEST=See bug for repro. Review URL: https://chromiumcodereview.appspot.com/22572004 git-svn-id: svn://svn.chromium.org/blink/trunk@155790 bbb929c8-...
0
111,210
Analyze the following 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 LayerTreeCoordinator::performScheduledLayerFlush() { if (m_isSuspended || m_waitingForUIProcess) return; syncDisplayState(); if (!m_isValid) return; if (flushPendingLayerChanges()) didPerformScheduledLayerFlush(); } Commit Message: [WK2] LayerTreeCoordinator should...
0
97,595
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: stack_trace_sysctl(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { int ret; mutex_lock(&stack_sysctl_mutex); ret = proc_dointvec(table, write, buffer, lenp, ppos); if (ret || !write || (last_stack_tracer_enabled == !!stack_tracer_enabled)) goto out; ...
0
30,304
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: zsetrgbcolor(i_ctx_t * i_ctx_p) { os_ptr op = osp; /* required by "push" macro */ int code, i; float values[3]; /* Gather numeric operand value(s) (also checks type) */ code = float_params(op, 3, (float *)&values); if (code < 0) return code; /* Clamp numeric operand range(s...
0
3,189
Analyze the following 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 MojoVideoEncodeAcceleratorService::BitstreamBufferReady( int32_t bitstream_buffer_id, size_t payload_size, bool key_frame, base::TimeDelta timestamp) { DVLOG(2) << __func__ << " bitstream_buffer_id=" << bitstream_buffer_id << ", payload_size=" << payload_size << "B, k...
0
149,555
Analyze the following 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 php_stream_memory_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC) /* {{{ */ { php_stream_memory_data *ms = (php_stream_memory_data*)stream->abstract; size_t newsize; switch(option) { case PHP_STREAM_OPTION_TRUNCATE_API: ...
1
165,476
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ikev2_vid_print(netdissect_options *ndo, u_char tpay, const struct isakmp_gen *ext, u_int item_len _U_, const u_char *ep _U_, uint32_t phase _U_, uint32_t doi _U_, uint32_t proto _U_, int depth _U_) { struct isakmp_gen e; const u_char *vid; int i, len; ND_TCHECK(*ext); UNALIGNED_MEMCPY(&e, ext, size...
0
62,032
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int php_snmp_has_property(zval *object, zval *member, int has_set_exists, const zend_literal *key TSRMLS_DC) { php_snmp_prop_handler *hnd; int ret = 0; if (zend_hash_find(&php_snmp_properties, Z_STRVAL_P(member), Z_STRLEN_P(member) + 1, (void **)&hnd) == SUCCESS) { switch (has_set_exists) { case 2...
0
9,553
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static struct page *__get_node_page(struct f2fs_sb_info *sbi, pgoff_t nid, struct page *parent, int start) { struct page *page; int err; if (!nid) return ERR_PTR(-ENOENT); f2fs_bug_on(sbi, check_nid_range(sbi, nid)); repeat: page = f2fs_grab_cache_page(NODE_MAPPING(sbi), nid, false); if (!page) re...
0
85,242
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void DevToolsAgent::clearBrowserCache() { Send(new DevToolsHostMsg_ClearBrowserCache(routing_id())); } Commit Message: DevTools: move DevToolsAgent/Client into content. BUG=84078 TEST= Review URL: http://codereview.chromium.org/7461019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93596 0039d316-1c4b-...
0
98,826
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void BrowserView::SetIntentPickerViewVisibility(bool visible) { LocationBarView* location_bar = GetLocationBarView(); if (!location_bar->intent_picker_view()) return; if (location_bar->intent_picker_view()->visible() != visible) { location_bar->intent_picker_view()->SetVisible(visible); locati...
0
155,261
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: const Cluster* Segment::GetLast() const { if ((m_clusters == NULL) || (m_clusterCount <= 0)) return &m_eos; const long idx = m_clusterCount - 1; Cluster* const pCluster = m_clusters[idx]; assert(pCluster); return pCluster; } Commit Message: libwebm: Pull from upstream Rolling mk...
1
174,340
Analyze the following 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 ACodec::submitOutputMetadataBuffer() { CHECK(storingMetadataInDecodedBuffers()); if (mMetadataBuffersToSubmit == 0) return OK; BufferInfo *info = dequeueBufferFromNativeWindow(); if (info == NULL) { return ERROR_IO; } ALOGV("[%s] submitting output meta buffer ID %u for graphic buffer %p",...
0
164,173
Analyze the following 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 remove_sits_in_journal(struct f2fs_sb_info *sbi) { struct curseg_info *curseg = CURSEG_I(sbi, CURSEG_COLD_DATA); struct f2fs_journal *journal = curseg->journal; int i; down_write(&curseg->journal_rwsem); for (i = 0; i < sits_in_cursum(journal); i++) { unsigned int segno; bool dirtied; seg...
0
85,420
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void fnhe_flush_routes(struct fib_nh_exception *fnhe) { struct rtable *rt; rt = rcu_dereference(fnhe->fnhe_rth_input); if (rt) { RCU_INIT_POINTER(fnhe->fnhe_rth_input, NULL); rt_free(rt); } rt = rcu_dereference(fnhe->fnhe_rth_output); if (rt) { RCU_INIT_POINTER(fnhe->fnhe_rth_output, NULL); ...
0
44,315
Analyze the following 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 LaunchURL( const GURL& url, const content::ResourceRequestInfo::WebContentsGetter& web_contents_getter, ui::PageTransition page_transition, bool has_user_gesture) { content::WebContents* web_contents = web_contents_getter.Run(); if (!web_contents) return; prerender::PrerenderConten...
0
152,382
Analyze the following 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 PDFiumEngine::SelectFindResult(bool forward) { if (find_results_.empty()) { NOTREACHED(); return false; } SelectionChangeInvalidator selection_invalidator(this); size_t new_index; const size_t last_index = find_results_.size() - 1; if (resume_find_index_.valid()) { new_index = resu...
0
146,208
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ice_io_error_handler (IceConn conn) { g_debug ("GsmXsmpServer: ice_io_error_handler (%p)", conn); /* We don't need to do anything here; the next call to * IceProcessMessages() for this connection will receive * IceProcessMessagesIOError and we can handle the error there. ...
0
63,602
Analyze the following 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::onSecureDecodersInstantiated(status_t err) { if (err != OK) { ALOGE("Failed to instantiate secure decoders!"); notifyPreparedAndCleanup(err); return; } finishPrepareAsync(); } Commit Message: MPEG4Extractor: ensure kKeyTrackID exists before creating an MPEG4So...
0
160,422
Analyze the following 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 WriteMPCImage(const ImageInfo *image_info,Image *image, ExceptionInfo *exception) { char buffer[MagickPathExtent], cache_filename[MagickPathExtent]; const char *property, *value; MagickBooleanType status; MagickOffsetType offset, scene; register...
0
64,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: static inline void __mmput(struct mm_struct *mm) { VM_BUG_ON(atomic_read(&mm->mm_users)); uprobe_clear_state(mm); exit_aio(mm); ksm_exit(mm); khugepaged_exit(mm); /* must run before exit_mmap */ exit_mmap(mm); mm_put_huge_zero_page(mm); set_mm_exe_file(mm, NULL); if (!list_empty(&mm->mmlist)) { spin_l...
0
59,258
Analyze the following 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 ZIPARCHIVE_METHOD(getFromName) { php_zip_get_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); } Commit Message: Fix bug #72434: ZipArchive class Use After Free Vulnerability in PHP's GC algorithm and unserialize CWE ID: CWE-416
0
51,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: ProcQueryTextExtents(ClientPtr client) { xQueryTextExtentsReply reply; FontPtr pFont; ExtentInfoRec info; unsigned long length; int rc; REQUEST(xQueryTextExtentsReq); REQUEST_AT_LEAST_SIZE(xQueryTextExtentsReq); rc = dixLookupFontable(&pFont, stuff->fid, client, DixGetAttrAccess)...
0
17,792
Analyze the following 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 rock_check_overflow(struct rock_state *rs, int sig) { int len; switch (sig) { case SIG('S', 'P'): len = sizeof(struct SU_SP_s); break; case SIG('C', 'E'): len = sizeof(struct SU_CE_s); break; case SIG('E', 'R'): len = sizeof(struct SU_ER_s); break; case SIG('R', 'R'): len = sizeof(...
0
35,383
Analyze the following 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 GetRegistrationsCallback(ScriptPromiseResolver* resolver) : m_resolver(resolver) { } Commit Message: Check CSP before registering ServiceWorkers Service Worker registrations should be subject to the same CSP checks as other workers. The spec doesn't say this explicitly (https://www.w3.org/T...
0
156,549
Analyze the following 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 show_tabletExecute(struct device *dev, struct device_attribute *attr, char *buf) { /* There is nothing useful to display, so a one-line manual * is in order... */ return snprintf(buf, PAGE_SIZE, "Write anything to this file to program your tablet.\n"); } Commit Message: Input: aiptek - fi...
0
57,633
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void stroke_route(private_stroke_socket_t *this, stroke_msg_t *msg, FILE *out) { pop_string(msg, &msg->route.name); DBG1(DBG_CFG, "received stroke: route '%s'", msg->route.name); this->control->route(this->control, msg, out); } Commit Message: CWE ID: CWE-787
0
12,222
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: DSA *d2i_DSAPrivateKey_bio(BIO *bp, DSA **dsa) { return ASN1_d2i_bio_of(DSA,DSA_new,d2i_DSAPrivateKey,bp,dsa ); } Commit Message: Fix various certificate fingerprint issues. By using non-DER or invalid encodings outside the signed portion of a certificate the fingerprint can be changed without breaking the s...
0
94,636
Analyze the following 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 SoftVPXEncoder::onQueueFilled(OMX_U32 /* portIndex */) { if (mCodecContext == NULL) { if (OK != initEncoder()) { ALOGE("Failed to initialize encoder"); notify(OMX_EventError, OMX_ErrorUndefined, 0, // Extra notification data NULL); // Notificat...
1
173,882
Analyze the following 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 path_cleanup(struct nameidata *nd) { if (nd->root.mnt && !(nd->flags & LOOKUP_ROOT)) { path_put(&nd->root); nd->root.mnt = NULL; } if (unlikely(nd->base)) fput(nd->base); } Commit Message: path_openat(): fix double fput() path_openat() jumps to the wrong place after do_tmpfile() - it has al...
0
42,338
Analyze the following 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<net::HostPortPair>::Read(const Message* m, PickleIterator* iter, param_type* r) { std::string host; uint16 port; if (!ReadParam(m, iter, &host) || !ReadParam(m, iter, &port)) return false; r->set_host...
0
117,458
Analyze the following 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 PepperMediaDeviceManager::OpenDevice(PP_DeviceType_Dev type, const std::string& device_id, const GURL& document_url, const OpenDeviceCallback& callback) { open_callbacks_[next_id_] = ca...
0
119,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: explicit DummyCryptoServerStreamHelper(quic::QuicRandom* random) : random_(random) {} Commit Message: P2PQuicStream write functionality. This adds the P2PQuicStream::WriteData function and adds tests. It also adds the concept of a write buffered amount, enforcing this at the P2PQuicStreamImpl. Bug: 874...
0
132,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 unsigned lodepng_deflatev(ucvector* out, const unsigned char* in, size_t insize, const LodePNGCompressSettings* settings) { unsigned error = 0; size_t i, blocksize, numdeflateblocks; size_t bp = 0; /*the bit pointer*/ Hash hash; if(settings->btype > 2) return 61;...
0
87,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: long long EBMLHeader::Parse( IMkvReader* pReader, long long& pos) { assert(pReader); long long total, available; long status = pReader->Length(&total, &available); if (status < 0) //error return status; pos = 0; long long end = (available >= 1024) ? 1024 : availab...
1
174,405
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MockConnectionVisitor::MockConnectionVisitor() { } Commit Message: Add QuicStream and friends to QUIC code. Fix bug in tests that caused failures. Revert 165859 First Landed as 165858 Review URL: https://chromiumcodereview.appspot.com/11367082 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165864 003...
0
117,484
Analyze the following 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 nfsd4_register_conn(struct nfsd4_conn *conn) { conn->cn_xpt_user.callback = nfsd4_conn_lost; return register_xpt_user(conn->cn_xprt, &conn->cn_xpt_user); } Commit Message: Merge tag 'nfsd-4.12' of git://linux-nfs.org/~bfields/linux Pull nfsd updates from Bruce Fields: "Another RDMA update from Chu...
0
65,624
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: zincludecolorspace(i_ctx_t * i_ctx_p) { os_ptr op = osp; ref nsref; int code; check_type(*op, t_name); name_string_ref(imemory, op, &nsref); code = gs_includecolorspace(igs, nsref.value.const_bytes, r_size(&nsref)); if (!code) pop(1); return code; } Commit Message: CWE...
0
3,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 bool arcmsr_hbaC_get_config(struct AdapterControlBlock *pACB) { uint32_t intmask_org, Index, firmware_state = 0; struct MessageUnit_C __iomem *reg = pACB->pmuC; char *acb_firm_model = pACB->firm_model; char *acb_firm_version = pACB->firm_version; char __iomem *iop_firm_model = (char __iomem *)(&reg->m...
0
49,785
Analyze the following 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 ext4_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, loff_t offset, unsigned long nr_segs) { struct file *file = iocb->ki_filp; struct inode *inode = file->f_mapping->host; if (EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL) return ext4_ext_direct_IO(rw, iocb, iov, ...
0
57,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 DefaultTabHandler::GetDragActions() const { return delegate_->AsBrowser()->GetDragActions(); } Commit Message: chromeos: fix bug where "aw snap" page replaces first tab if it was a NTP when closing window with > 1 tab. BUG=chromium-os:12088 TEST=verify bug per bug report. Review URL: http://codereview.chr...
0
98,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: parse_set_vlan_vid(char *arg, struct ofpbuf *ofpacts, bool push_vlan_if_needed) { struct ofpact_vlan_vid *vlan_vid; uint16_t vid; char *error; error = str_to_u16(arg, "VLAN VID", &vid); if (error) { return error; } if (vid & ~VLAN_VID_MASK) { return xasprintf("%s: not...
0
77,094
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GraphicsLayer* FrameView::layerForVerticalScrollbar() const { RenderView* renderView = this->renderView(); if (!renderView) return 0; return renderView->compositor()->layerForVerticalScrollbar(); } Commit Message: Defer call to updateWidgetPositions() outside of RenderLayerScrollableArea. up...
0
119,864
Analyze the following 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 LayoutBlockFlow::setLogicalLeftForChild(LayoutBox& child, LayoutUnit logicalLeft) { if (isHorizontalWritingMode()) { child.setX(logicalLeft); } else { child.setY(logicalLeft); } } Commit Message: Consistently check if a block can handle pagination strut propagation. https://code...
0
123,047
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static ssize_t ucma_bind_ip(struct ucma_file *file, const char __user *inbuf, int in_len, int out_len) { struct rdma_ucm_bind_ip cmd; struct ucma_context *ctx; int ret; if (copy_from_user(&cmd, inbuf, sizeof(cmd))) return -EFAULT; if (!rdma_addr_size_in6(&cmd.addr)) return -EINVAL; ctx = ucm...
0
79,127
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: getRequestableExtensionsCHROMIUM() { return WebKit::WebString::fromUTF8( gl_->GetRequestableExtensionsCHROMIUM()); } 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.chromium.or...
0
106,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 void __wait_on_freeing_inode(struct inode *inode) { wait_queue_head_t *wq; DEFINE_WAIT_BIT(wait, &inode->i_state, __I_NEW); wq = bit_waitqueue(&inode->i_state, __I_NEW); prepare_to_wait(wq, &wait.wq_entry, TASK_UNINTERRUPTIBLE); spin_unlock(&inode->i_lock); spin_unlock(&inode_hash_lock); schedule();...
0
79,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: bool Camera3Device::RequestThread::isStreamPending( sp<Camera3StreamInterface>& stream) { Mutex::Autolock l(mRequestLock); for (const auto& nextRequest : mNextRequests) { if (!nextRequest.submitted) { for (const auto& s : nextRequest.captureRequest->mOutputStreams) { if (stream == s) return true; }...
0
161,068
Analyze the following 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::OnMemoryPressure( base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level) { base::allocator::ReleaseFreeMemory(); if (memory_pressure_level == base::MemoryPressureListener::MEMORY_PRESSURE_CRITICAL) { v8::V8::LowMemoryNotification(); if (webkit_platf...
0
111,155
Analyze the following 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 verify_auth_trunc(struct nlattr **attrs) { struct nlattr *rt = attrs[XFRMA_ALG_AUTH_TRUNC]; struct xfrm_algo_auth *algp; if (!rt) return 0; algp = nla_data(rt); if (nla_len(rt) < xfrm_alg_auth_len(algp)) return -EINVAL; algp->alg_name[CRYPTO_MAX_ALG_NAME - 1] = '\0'; return 0; } Commit M...
0
33,119
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PHP_METHOD(SoapFault, __toString) { zval *faultcode, *faultstring, *file, *line, *trace; char *str; int len; zend_fcall_info fci; zval fname; if (zend_parse_parameters_none() == FAILURE) { return; } faultcode = zend_read_property(soap_fault_class_entry, this_ptr, "faultcode", sizeof("faultcode")-1, ...
0
14,859
Analyze the following 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 uevent_filter(struct kset *kset, struct kobject *kobj) { struct kobj_type *ktype = get_ktype(kobj); if (ktype == &slab_ktype) return 1; return 0; } Commit Message: remove div_long_long_rem x86 is the only arch right now, which provides an optimized for div_long_long_rem and it has the downside ...
0
24,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: scoped_refptr<const Extension> CreateTestExtension( const std::string& name, bool has_active_tab_permission, bool has_tab_capture_permission) { ExtensionBuilder builder(name); if (has_active_tab_permission) builder.AddPermission("activeTab"); if (has_tab_capture_permission) builder.AddPe...
0
151,449
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: virtual ~MockPluginProcessHostClient() { if (channel_) BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, channel_); } Commit Message: Follow-on fixes and naming changes for https://codereview.chromium.org/12086077/ BUG=172573 Review URL: https://codereview.chromium.org/12177018 git-svn-id: ...
0
116,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: static void put_prev_entity(struct cfs_rq *cfs_rq, struct sched_entity *prev) { /* * If still on the runqueue then deactivate_task() * was not called and update_curr() has to be done: */ if (prev->on_rq) update_curr(cfs_rq); /* throttle cfs_rqs exceeding runtime */ check_cfs_rq_runtime(cfs_rq); che...
0
92,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 int do_umount(struct mount *mnt, int flags) { struct super_block *sb = mnt->mnt.mnt_sb; int retval; retval = security_sb_umount(&mnt->mnt, flags); if (retval) return retval; /* * Allow userspace to request a mountpoint be expired rather than * unmounting unconditionally. Unmount only happens i...
0
50,942
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: opj_bool pi_next(opj_pi_iterator_t * pi) { switch (pi->poc.prg) { case LRCP: return pi_next_lrcp(pi); case RLCP: return pi_next_rlcp(pi); case RPCL: return pi_next_rpcl(pi); case PCRL: return pi_next_pcrl(pi); case CPRL: return pi_next_cprl(pi); ...
0
92,234
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void V8TestObject::TestDictionaryMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_testDictionaryMethod"); test_object_v8_internal::TestDictionaryMethodMethod(info); } Commit Message: bindings: Support "a...
0
135,214
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: RootInlineBox* RenderBlockFlow::createRootInlineBox() { return new RootInlineBox(*this); } Commit Message: Separate repaint and layout requirements of StyleDifference (Step 1) Previously StyleDifference was an enum that proximately bigger values imply smaller values (e.g. StyleDifferenceLayout implies Style...
0
116,360
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: tBTM_STATUS btm_sec_mx_access_request (BD_ADDR bd_addr, UINT16 psm, BOOLEAN is_originator, UINT32 mx_proto_id, UINT32 mx_chan_id, tBTM_SEC_CALLBACK *p_callback, void *p_ref_data) { tBTM_SEC_DEV_REC *p_dev_rec; tBTM_SEC_SERV_RE...
0
161,453
Analyze the following 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(rt_sigsuspend, sigset_t __user *, unewset, size_t, sigsetsize) { sigset_t newset; /* XXX: Don't preclude handling different sized sigset_t's. */ if (sigsetsize != sizeof(sigset_t)) return -EINVAL; if (copy_from_user(&newset, unewset, sizeof(newset))) return -EFAULT; sigdelsetmask(&news...
0
35,160
Analyze the following 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 http_process_tarpit(struct stream *s, struct channel *req, int an_bit) { struct http_txn *txn = s->txn; /* This connection is being tarpitted. The CLIENT side has * already set the connect expiration date to the right * timeout. We just have to check that the client is still * there and that the time...
0
6,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: int CMS_data(CMS_ContentInfo *cms, BIO *out, unsigned int flags) { BIO *cont; int r; if (OBJ_obj2nid(CMS_get0_type(cms)) != NID_pkcs7_data) { CMSerr(CMS_F_CMS_DATA, CMS_R_TYPE_NOT_DATA); return 0; } cont = CMS_dataInit(cms, NULL); if (!cont) return 0; r = cms_co...
0
11,933
Analyze the following 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 migrate_to_node(struct mm_struct *mm, int source, int dest, int flags) { nodemask_t nmask; LIST_HEAD(pagelist); int err = 0; struct vm_area_struct *vma; nodes_clear(nmask); node_set(source, nmask); vma = check_range(mm, mm->mmap->vm_start, mm->task_size, &nmask, flags | MPOL_MF_DISCON...
0
21,320
Analyze the following 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 __mnt_unmake_readonly(struct mount *mnt) { lock_mount_hash(); mnt->mnt.mnt_flags &= ~MNT_READONLY; unlock_mount_hash(); } Commit Message: mnt: Correct permission checks in do_remount While invesgiating the issue where in "mount --bind -oremount,ro ..." would result in later "mount --bind -oremoun...
0
36,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: status_t ACodec::selectAudioPortFormat( OMX_U32 portIndex, OMX_AUDIO_CODINGTYPE desiredFormat) { OMX_AUDIO_PARAM_PORTFORMATTYPE format; InitOMXParams(&format); format.nPortIndex = portIndex; for (OMX_U32 index = 0;; ++index) { format.nIndex = index; status_t err = mOMX->getParameter( ...
0
164,122
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: VREyeParameters* VRDisplay::getEyeParameters(const String& which_eye) { switch (StringToVREye(which_eye)) { case kVREyeLeft: return eye_parameters_left_; case kVREyeRight: return eye_parameters_right_; default: return nullptr; } } Commit Message: WebVR: fix initial vsync Appli...
0
128,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: static int fuse_write_begin(struct file *file, struct address_space *mapping, loff_t pos, unsigned len, unsigned flags, struct page **pagep, void **fsdata) { pgoff_t index = pos >> PAGE_CACHE_SHIFT; struct fuse_conn *fc = get_fuse_conn(file_inode(file)); struct page *page; loff_t fsize; int err = -ENOMEM...
0
56,975
Analyze the following 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 install_list_entry(const char *lib) { assert(lib); int len = strlen(lib); if (strcspn(lib, "\\&!?\"'<>%^(){}[];,") != (size_t)len || strstr(lib, "..")) { fprintf(stderr, "Error: \"%s\" is an invalid library\n", lib); exit(1); } if (*lib == '/') return load_library(lib); int i; for (i...
0
89,748
Analyze the following 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 crypto_pcomp_init(struct crypto_tfm *tfm, u32 type, u32 mask) { return 0; } Commit Message: crypto: user - fix info leaks in report API Three errors resulting in kernel memory disclosure: 1/ The structures used for the netlink based crypto algorithm report API are located on the stack. As snprintf(...
0
31,315
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void kvm_vcpu_kick(struct kvm_vcpu *vcpu) { int me; int cpu = vcpu->cpu; wait_queue_head_t *wqp; wqp = kvm_arch_vcpu_wq(vcpu); if (waitqueue_active(wqp)) { wake_up_interruptible(wqp); ++vcpu->stat.halt_wakeup; } me = get_cpu(); if (cpu != me && (unsigned)cpu < nr_cpu_ids && cpu_online(cpu)) if (kv...
0
29,101
Analyze the following 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 skcipher_walk_complete(struct skcipher_walk *walk, int err) { struct skcipher_walk_buffer *p, *tmp; list_for_each_entry_safe(p, tmp, &walk->buffers, entry) { u8 *data; if (err) goto done; data = p->data; if (!data) { data = PTR_ALIGN(&p->buffer[0], walk->alignmask + 1); data = skcipher_...
0
64,813
Analyze the following 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 comedi_error(const struct comedi_device *dev, const char *s) { printk(KERN_ERR "comedi%d: %s: %s\n", dev->minor, dev->driver->driver_name, s); } Commit Message: staging: comedi: fix infoleak to userspace driver_name and board_name are pointers to strings, not buffers of size COMEDI_NAMELEN. Copyi...
0
41,277
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ip_checkentry(const struct ipt_ip *ip) { if (ip->flags & ~IPT_F_MASK) { duprintf("Unknown flag bits set: %08X\n", ip->flags & ~IPT_F_MASK); return false; } if (ip->invflags & ~IPT_INV_MASK) { duprintf("Unknown invflag bits set: %08X\n", ip->invflags & ~IPT_INV_MASK); return false; } return tr...
0
52,304
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static noinline int udf_process_sequence(struct super_block *sb, long block, long lastblock, struct kernel_lb_addr *fileset) { struct buffer_head *bh = NULL; struct udf_vds_record vds[VDS_POS_LENGTH]; struct udf_vds_record *curr; struct generic_desc *gd; struct volDescPtr *vdp; int done = 0; uint32_t v...
0
19,539
Analyze the following 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 yr_arena_save_stream( YR_ARENA* arena, YR_STREAM* stream) { YR_ARENA_PAGE* page; YR_RELOC* reloc; ARENA_FILE_HEADER header; uint32_t end_marker = 0xFFFFFFFF; uint8_t** reloc_address; uint8_t* reloc_target; assert(arena->flags & ARENA_FLAGS_COALESCED); page = arena->page_list_head; rel...
0
66,034
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: double XMLRPC_GetValueDouble(XMLRPC_VALUE value) { return ((value && value->type == xmlrpc_double) ? value->d : 0); } Commit Message: CWE ID: CWE-119
0
12,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: void _cgsem_wait(cgsem_t *cgsem, const char *file, const char *func, const int line) { retry: if (unlikely(sem_wait(cgsem))) { if (interrupted()) goto retry; quitfrom(1, file, func, line, "Failed to sem_wait errno=%d cgsem=0x%p", errno, cgsem); } } Commit Message: stratum: parse_notify(): Don't die on m...
0
36,554
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int __get_device_id(struct ipmi_smi *intf, struct bmc_device *bmc) { int rv; bmc->dyn_id_set = 2; intf->null_user_handler = bmc_device_id_handler; rv = send_get_device_id_cmd(intf); if (rv) return rv; wait_event(intf->waitq, bmc->dyn_id_set != 2); if (!bmc->dyn_id_set) rv = -EIO; /* Somethi...
0
91,203
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xprt_rdma_bc_free(struct rpc_task *task) { struct rpc_rqst *rqst = task->tk_rqstp; kfree(rqst->rq_rbuffer); } Commit Message: Merge tag 'nfsd-4.12' of git://linux-nfs.org/~bfields/linux Pull nfsd updates from Bruce Fields: "Another RDMA update from Chuck Lever, and a bunch of miscellaneous bugfixes" * ta...
0
65,963
Analyze the following 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 on_l2cap_connect(tBTA_JV *p_data, uint32_t id) { l2cap_socket *sock; tBTA_JV_L2CAP_OPEN *psm_open = &p_data->l2c_open; tBTA_JV_L2CAP_LE_OPEN *le_open = &p_data->l2c_le_open; pthread_mutex_lock(&state_lock); sock = btsock_l2cap_find_by_id_l(id); if (!sock) { APPL_TRACE_ERR...
0
158,856
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: _nfs4_opendata_to_nfs4_state(struct nfs4_opendata *data) { struct inode *inode; struct nfs4_state *state = NULL; int ret; if (!data->rpc_done) { state = nfs4_try_open_cached(data); goto out; } ret = -EAGAIN; if (!(data->f_attr.valid & NFS_ATTR_FATTR)) goto err; inode = nfs_fhget(data->dir->d_sb, &...
0
29,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 RenderFrameImpl::OnSerializeAsMHTML( const FrameMsg_SerializeAsMHTML_Params& params) { TRACE_EVENT0("page-serialization", "RenderFrameImpl::OnSerializeAsMHTML"); base::TimeTicks start_time = base::TimeTicks::Now(); base::File file = IPC::PlatformFileForTransitToFile(params.destination_file); cons...
0
152,891
Analyze the following 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 vpx_image_t *vp8_get_frame(vpx_codec_alg_priv_t *ctx, vpx_codec_iter_t *iter) { vpx_image_t *img = NULL; /* iter acts as a flip flop, so an image is only returned on the first * call to get_frame. */ if (!(*iter) && ctx->yv12_frame_buffers.pbi[0]) { YV12_BUFFER_CONFIG sd; int64_t t...
0
157,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: void ImageLoader::UpdateImageState(ImageResourceContent* new_image_content) { image_content_ = new_image_content; if (!new_image_content) { image_resource_for_image_document_ = nullptr; image_complete_ = true; } else { image_complete_ = false; } delay_until_image_notify_finished_ = nullptr; ...
0
147,514
Analyze the following 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 Enabled(LocalFrame&, Event*, EditorCommandSource) { return true; } Commit Message: Move Editor::Transpose() out of Editor class This patch moves |Editor::Transpose()| out of |Editor| class as preparation of expanding it into |ExecutTranspose()| in "EditorCommand.cpp" to make |Editor| class simpler...
0
128,482
Analyze the following 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 stbl_dump(GF_Box *a, FILE * trace) { GF_SampleTableBox *p; p = (GF_SampleTableBox *)a; gf_isom_box_dump_start(a, "SampleTableBox", trace); fprintf(trace, ">\n"); if (p->size) gf_isom_box_dump_ex(p->SampleDescription, trace, GF_ISOM_BOX_TYPE_STSD); if (p->size) gf_isom_box_dump_ex(p->TimeToSample...
0
80,848
Analyze the following 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 DocumentLoader::ShouldContinueForResponse() const { if (substitute_data_.IsValid()) return true; int status_code = response_.HttpStatusCode(); if (status_code == 204 || status_code == 205) { return false; } if (IsContentDispositionAttachment( response_.HttpHeaderField(http_names...
0
152,548
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: read_Header(struct archive_read *a, struct _7z_header_info *h, int check_header_id) { struct _7zip *zip = (struct _7zip *)a->format->data; const unsigned char *p; struct _7z_folder *folders; struct _7z_stream_info *si = &(zip->si); struct _7zip_entry *entries; uint32_t folderIndex, indexInFolder; unsig...
0
87,251
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void BrowserWindowGtk::DrawCustomFrame(cairo_t* cr, GtkWidget* widget, GdkEventExpose* event) { GtkThemeService* theme_provider = GtkThemeService::GetFrom( browser()->profile()); int image_name = GetThemeFrameResource(); g...
0
117,911