instruction
stringclasses
1 value
input
stringlengths
64
129k
output
int64
0
1
__index_level_0__
int64
0
30k
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void FakeCentral::RemoveFakeDescriptor(const std::string& descriptor_id, const std::string& characteristic_id, const std::string& service_id, const std::string& peripheral_address, ...
0
13,367
Analyze the following 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 CWebServer::Cmd_RenameScene(WebEmSession & session, const request& req, Json::Value &root) { if (session.rights != 2) { session.reply_status = reply::forbidden; return; //Only admin user allowed } std::string sidx = request::findValue(&req, "idx"); std::string sname = request::fin...
0
1,573
Analyze the following 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 umount_tree(struct mount *mnt, enum umount_tree_flags how) { LIST_HEAD(tmp_list); struct mount *p; if (how & UMOUNT_PROPAGATE) propagate_mount_unlock(mnt); /* Gather the mounts to umount */ for (p = mnt; p; p = next_mnt(p, mnt)) { p->mnt.mnt_flags |= MNT_UMOUNT; list_move(&p->mnt_list, &t...
1
21,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: Ins_JROT( TT_ExecContext exc, FT_Long* args ) { if ( args[1] != 0 ) Ins_JMPR( exc, args ); } Commit Message: CWE ID: CWE-476
0
28,982
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: event_sched_out(struct perf_event *event, struct perf_cpu_context *cpuctx, struct perf_event_context *ctx) { u64 tstamp = perf_event_time(event); u64 delta; /* * An event which could not be activated because of * filter mismatch still needs to have its timings * maintained, otherwise bogus inform...
0
12,922
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: notationDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId) { callbacks++; if (quiet) return; fprintf(SAXdebug, "SAX.notationDecl(%s, %s, %s)\n", (char *) name, (char *) publicId, (char *) systemId); } Commit Message: Fix han...
0
15,662
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void InitStartState() { for (int i = 0; i < tabstrip_->GetTabCount(); ++i) { TabGtk* current_tab = tabstrip_->GetTabAt(i); if (!current_tab->mini()) { if (current_tab->IsActive()) { start_selected_width_ = current_tab->width(); } else { start_unselected_width_...
0
22,884
Analyze the following 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 sctp_chunk *sctp_chunkify(struct sk_buff *skb, const struct sctp_association *asoc, struct sock *sk) { struct sctp_chunk *retval; retval = kmem_cache_zalloc(sctp_chunk_cachep, GFP_ATOMIC); if (!retval) goto nodata; if (!sk) pr_debug("%s: chunkifying skb:%p w/o an sk\n", __func__, sk...
0
25,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: void ib_destroy_cm_id(struct ib_cm_id *cm_id) { cm_destroy_id(cm_id, 0); } Commit Message: IB/core: Don't resolve passive side RoCE L2 address in CMA REQ handler The code that resolves the passive side source MAC within the rdma_cm connection request handler was both redundant and buggy, so remove it. It was ...
0
28,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: static void cirrus_mmio_blt_write(CirrusVGAState * s, unsigned address, uint8_t value) { switch (address) { case (CIRRUS_MMIO_BLTBGCOLOR + 0): cirrus_vga_write_gr(s, 0x00, value); break; case (CIRRUS_MMIO_BLTBGCOLOR + 1): cirrus_vga_write_gr(s, 0x10, value); break; case (CIRRUS_MMIO_BLTB...
0
16,574
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ssh_packet_read_poll_seqnr(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p) { struct session_state *state = ssh->state; u_int reason, seqnr; int r; u_char *msg; for (;;) { msg = NULL; if (compat20) { r = ssh_packet_read_poll2(ssh, typep, seqnr_p); if (r != 0) return r; if (*typep) { ...
0
29,169
Analyze the following 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 webkit_web_view_update_settings(WebKitWebView* webView) { WebKitWebViewPrivate* priv = webView->priv; WebKitWebSettings* webSettings = priv->webSettings.get(); Settings* settings = core(webView)->settings(); gchar* defaultEncoding, *cursiveFontFamily, *defaultFontFamily, *fantasyFontF...
1
19,753
Analyze the following 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 cwd_globals_dtor(virtual_cwd_globals *cwd_g TSRMLS_DC) /* {{{ */ { CWD_STATE_FREE(&cwd_g->cwd); realpath_cache_clean(TSRMLS_C); } /* }}} */ Commit Message: CWE ID: CWE-190
0
4,017
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: isis_print_is_reach_subtlv(netdissect_options *ndo, const uint8_t *tptr, u_int subt, u_int subl, const char *ident) { u_int te_class,priority_level,gmpls_switch_cap; union { /* int to float conversion buffer for several subTLVs */ f...
1
27,348
Analyze the following 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 FakeMidiManagerClient(Logger* logger) : complete_start_session_(false), result_(MIDI_NOT_SUPPORTED), logger_(logger) {} Commit Message: MidiManagerUsb should not trust indices provided by renderer. MidiManagerUsb::DispatchSendMidiData takes |port_index| parameter. As it is provi...
0
17,353
Analyze the following 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 Textfield::Paste() { if (!read_only() && model_->Paste()) { if (controller_) controller_->OnAfterPaste(); return true; } return false; } Commit Message: MacViews: Enable secure text input for password Textfields. In Cocoa the NSTextInputContext automatically enables secure text input wh...
0
5,298
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: timed_read(int fd, void *buf, size_t bytes, int timeout) { struct pollfd fds[1]; int ret; if (timeout > 0) { fds[0].fd = fd; fds[0].events = POLLIN; ret = poll(fds, 1, timeout); if (ret == -1) return -1; if (ret != 1) { errno = ETIMEDOUT; return -1; } } return read(fd, buf, bytes...
0
16,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 cmd_id(char *tag) { int c = EOF, npair = 0; static struct buf arg, field; /* check if we've already had an ID in non-authenticated state */ if (!imapd_userid && imapd_id.did_id) { prot_printf(imapd_out, "%s OK NIL\r\n", tag); eatline(imapd_in, c); return; }...
0
22,056
Analyze the following 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 ttusbdecfe_dvbs_read_status(struct dvb_frontend *fe, fe_status_t *status) { *status = FE_HAS_SIGNAL | FE_HAS_VITERBI | FE_HAS_SYNC | FE_HAS_CARRIER | FE_HAS_LOCK; return 0; } Commit Message: [media] ttusb-dec: buffer overflow in ioctl We need to add a limit check here so we don't overflow the bu...
0
29,603
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: XineramaXvPutVideo(ClientPtr client) { REQUEST(xvPutImageReq); PanoramiXRes *draw, *gc, *port; Bool isRoot; int result, i, x, y; REQUEST_AT_LEAST_SIZE(xvPutVideoReq); result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, c...
0
19,731
Analyze the following 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 ext4_journal_abort_handle(const char *caller, unsigned int line, const char *err_fn, struct buffer_head *bh, handle_t *handle, int err) { char nbuf[16]; const char *errstr = ext4_decode_error(NULL, err, nbuf); BUG_ON(!ext4_handle_valid(handle)); if (bh) BUFFER_TRACE(bh, "abort"); ...
0
24,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: static ssize_t sanity_checks_show(struct kmem_cache *s, char *buf) { return sprintf(buf, "%d\n", !!(s->flags & SLAB_DEBUG_FREE)); } 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 that one has to be very careful ...
0
2,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: struct action_kw *action_http_req_custom(const char *kw) { return action_lookup(&http_req_keywords.list, kw); } Commit Message: CWE ID: CWE-200
0
16,879
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: InputMethodBase::~InputMethodBase() { } Commit Message: cleanup: Use IsTextInputTypeNone() in OnInputMethodChanged(). BUG=None TEST=None Review URL: http://codereview.chromium.org/8986010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116461 0039d316-1c4b-4281-b951-d872f2087c98 CWE ID: CWE-399
0
14,951
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: LayoutUnit RenderBlockFlow::clearFloatsIfNeeded(RenderBox* child, MarginInfo& marginInfo, LayoutUnit oldTopPosMargin, LayoutUnit oldTopNegMargin, LayoutUnit yPos, bool childIsSelfCollapsing) { LayoutUnit heightIncrease = getClearDelta(child, yPos); if (!heightIncrease) return yPos; if (childI...
0
2,783
Analyze the following 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 RunCacheOperationCallback(const CacheOperationCallback& callback, base::PlatformFileError* error, const std::string& resource_id, const std::string& md5) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); D...
0
6,432
Analyze the following 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 gluster_free_host(gluster_hostdef *host) { if(!host) return; switch (host->type) { case GLUSTER_TRANSPORT_UNIX: free(host->u.uds.socket); break; case GLUSTER_TRANSPORT_TCP: case GLUSTER_TRANSPORT_RDMA: free(host->u.inet.addr); free(host->u.inet.port); break; case GLUSTER_TRANSPORT__...
0
20,802
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: u16 skb_tx_hash(const struct net_device *dev, const struct sk_buff *skb) { u32 hash; if (skb_rx_queue_recorded(skb)) { hash = skb_get_rx_queue(skb); while (unlikely(hash >= dev->real_num_tx_queues)) hash -= dev->real_num_tx_queues; return hash; } if (skb->sk && skb->sk->sk_hash) hash = skb->sk->s...
0
20,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: ScreenLayoutObserver::~ScreenLayoutObserver() { ShellPort::Get()->RemoveDisplayObserver(this); } Commit Message: Avoid Showing rotation change notification when source is accelerometer BUG=717252 TEST=Manually rotate device with accelerometer and observe there's no notification Review-Url: https://codereview...
0
2,057
Analyze the following 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 btif_config_write(void) { assert(config != NULL); assert(alarm_timer != NULL); pthread_mutex_lock(&lock); config_t *config_paired = config_new_clone(config); btif_config_remove_unpaired(config_paired); config_save(config_paired, CONFIG_FILE_PATH); config_free(config_paired); pthread_mu...
0
10,697
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool FindInspectedBrowserAndTabIndex( WebContents* inspected_web_contents, Browser** browser, int* tab) { if (!inspected_web_contents) return false; for (auto* b : *BrowserList::GetInstance()) { int tab_index = b->tab_strip_model()->GetIndexOfWebContents(inspected_web_contents); if (t...
0
21,812
Analyze the following 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 jsvIsNewChild(const JsVar *v) { return jsvIsName(v) && jsvGetNextSibling(v) && jsvGetNextSibling(v)==jsvGetPrevSibling(v); } Commit Message: fix jsvGetString regression CWE ID: CWE-119
0
23,750
Analyze the following 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 RegisterPropertiesHandler( void* object, const ImePropertyList& prop_list) { if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { LOG(ERROR) << "Not on UI thread"; return; } InputMethodLibraryImpl* input_method_library = static_cast<InputMethodLibraryImpl...
1
12,404
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void FailStoreGroup() { PushNextTask(base::BindOnce(&AppCacheStorageImplTest::Verify_FailStoreGroup, base::Unretained(this))); const int64_t kTooBig = 10 * 1024 * 1024; // 10M group_ = new AppCacheGroup(storage(), kManifestUrl, storage()->NewGroupId())...
1
6,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: bool GetHeaders(base::DictionaryValue* params, std::string* headers) { if (!params) return false; base::ListValue* header_list; if (!params->GetList("headers", &header_list)) return false; std::string double_quote_headers; base::JSONWriter::Write(*header_list, &double_quote_headers); base::Rep...
0
16,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: ProcXResQueryClientPixmapBytes(ClientPtr client) { REQUEST(xXResQueryClientPixmapBytesReq); xXResQueryClientPixmapBytesReply rep; int clientID; unsigned long bytes; REQUEST_SIZE_MATCH(xXResQueryClientPixmapBytesReq); clientID = CLIENT_ID(stuff->xid); if ((clientID >= currentMaxClien...
0
5
Analyze the following 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 DelegatedFrameHost::SubmitCompositorFrame( const viz::LocalSurfaceId& local_surface_id, cc::CompositorFrame frame) { #if defined(OS_CHROMEOS) DCHECK(!resize_lock_ || !client_->IsAutoResizeEnabled()); #endif float frame_device_scale_factor = frame.metadata.device_scale_factor; viz::BeginFrameAck...
0
29,767
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void RenderBox::clearOverrideLogicalContentHeight() { if (m_rareData) m_rareData->m_overrideLogicalContentHeight = -1; } Commit Message: Separate repaint and layout requirements of StyleDifference (Step 1) Previously StyleDifference was an enum that proximately bigger values imply smaller values (e....
0
5,850
Analyze the following 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_owner(struct xdr_stream *xdr, uint32_t *bitmap, const struct nfs_server *server, uint32_t *uid, int may_sleep) { uint32_t len; __be32 *p; int ret = 0; *uid = -2; if (unlikely(bitmap[1] & (FATTR4_WORD1_OWNER - 1U))) return -EIO; if (likely(bitmap[1] & FATTR4_WORD1_OWNER)) { p = ...
0
20,700
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: vcard7816_file_system_process_apdu(VCard *card, VCardAPDU *apdu, VCardResponse **response) { /* TODO: if we want to support a virtual file system card, we do it here. * It would probably be a pkcs #15 card type */ *response = vcard_make_response( ...
0
11,523
Analyze the following 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 f2fs_fill_super(struct super_block *sb, void *data, int silent) { struct f2fs_sb_info *sbi; struct f2fs_super_block *raw_super; struct inode *root; int err; bool retry = true, need_fsck = false; char *options = NULL; int recovery, i, valid_super_block; struct curseg_info *seg_i; try_onemore: ...
0
11,545
Analyze the following 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 avcodec_flush_buffers(AVCodecContext *avctx) { avctx->internal->draining = 0; avctx->internal->draining_done = 0; av_frame_unref(avctx->internal->buffer_frame); av_packet_unref(avctx->internal->buffer_pkt); avctx->internal->buffer_pkt_valid = 0; if (HAVE_THREADS && avctx->active...
0
2,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: char *bin2hex(const unsigned char *p, size_t len) { ssize_t slen; char *s; slen = len * 2 + 1; if (slen % 4) slen += 4 - (slen % 4); s = (char *)calloc(slen, 1); if (unlikely(!s)) quithere(1, "Failed to calloc"); __bin2hex(s, p, len); return s; } Commit Message: stratum: parse_notify(): Don't die ...
0
7,776
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: zipx_bzip2_init(struct archive_read *a, struct zip *zip) { int r; /* Deallocate already existing BZ2 decompression context if it * exists. */ if(zip->bzstream_valid) { BZ2_bzDecompressEnd(&zip->bzstream); zip->bzstream_valid = 0; } /* Allocate a new BZ2 decompression context. */ memset(&zip->bzstrea...
0
13,930
Analyze the following 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 ThreadSafeMatch(const Vector<UChar, inlineCapacity>& vector, const QualifiedName& qname) { return EqualIgnoringNullity(vector, qname.LocalName().Impl()); } Commit Message: Restrict the xss audit report URL to same origin BUG=441275 R=tsepez@chromium.org,mkwst@chromium.org Change-Id:...
0
18,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 Document::implicitClose() { if (m_inStyleRecalc) { m_closeAfterStyleRecalc = true; return; } bool wasLocationChangePending = frame() && frame()->navigationScheduler()->locationChangePending(); bool doload = !parsing() && m_parser && !m_processingLoadEvent && !wasLocationChang...
0
290
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: http_ForceGet(const struct http *to) { if (strcmp(http_GetReq(to), "GET")) http_SetH(to, HTTP_HDR_REQ, "GET"); } Commit Message: Check for duplicate Content-Length headers in requests If a duplicate CL header is in the request, we fail the request with a 400 (Bad Request) Fix a test case that was sending du...
0
15,926
Analyze the following 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 arm_dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nents, enum dma_data_direction dir) { struct dma_map_ops *ops = get_dma_ops(dev); struct scatterlist *s; int i; for_each_sg(sg, s, nents, i) ops->sync_single_for_device(dev, sg_dma_address(s), s->length, dir); } Co...
0
6,961
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MagickExport Image *ExtentImage(const Image *image, const RectangleInfo *geometry,ExceptionInfo *exception) { Image *extent_image; /* Allocate extent image. */ assert(image != (const Image *) NULL); assert(image->signature == MagickCoreSignature); if (image->debug != MagickFalse) (void)...
0
679
Analyze the following 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 tcp_new_space(struct sock *sk) { struct tcp_sock *tp = tcp_sk(sk); if (tcp_should_expand_sndbuf(sk)) { tcp_sndbuf_expand(sk); tp->snd_cwnd_stamp = tcp_time_stamp; } sk->sk_write_space(sk); } Commit Message: tcp: make challenge acks less predictable Yue Cao claims that current host rate lim...
0
25,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: IntPoint RenderBox::flipForWritingMode(const IntPoint& position) const { if (!style()->isFlippedBlocksWritingMode()) return position; return isHorizontalWritingMode() ? IntPoint(position.x(), height() - position.y()) : IntPoint(width() - position.x(), position.y()); } Commit Message: Source/WebCo...
0
29,981
Analyze the following 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 fetch_tempfile(char *line, void *data) { FILE *fp = data; if (!line) rewind(fp); else if (fputs(line, fp) == EOF || fputc('\n', fp) == EOF) return -1; return 0; } Commit Message: Add alloc fail check in nntp_fetch_headers CWE ID: CWE-20
0
367
Analyze the following 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 airspy_free_urbs(struct airspy *s) { int i; airspy_kill_urbs(s); for (i = s->urbs_initialized - 1; i >= 0; i--) { if (s->urb_list[i]) { dev_dbg(s->dev, "free urb=%d\n", i); /* free the URBs */ usb_free_urb(s->urb_list[i]); } } s->urbs_initialized = 0; return 0; } Commit Message: ...
0
20,327
Analyze the following 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 struct arm_pmu *__init xscale2pmu_init(void) { return NULL; } Commit Message: perf: Remove the nmi parameter from the swevent and overflow interface The nmi parameter indicated if we could do wakeups from the current context, if not, we would set some state and self-IPI and let the resulting inter...
0
21,060
Analyze the following 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 StreamTcp3whsSynAckUpdate(TcpSession *ssn, Packet *p, TcpStateQueue *q) { TcpStateQueue update; if (likely(q == NULL)) { StreamTcp3whsSynAckToStateQueue(p, &update); q = &update; } if (ssn->state != TCP_SYN_RECV) { /* update state */ StreamTcpPacketSetS...
0
14,002
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: HeadlessDevToolsManagerDelegate::DisposeBrowserContext( content::DevToolsAgentHost* agent_host, int session_id, int command_id, const base::DictionaryValue* params) { const base::Value* browser_context_id_value = params->FindKey("browserContextId"); if (!browser_context_id_value) ret...
0
14,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: int dtls1_write_bytes(SSL *s, int type, const void *buf, int len) { int i; OPENSSL_assert(len <= SSL3_RT_MAX_PLAIN_LENGTH); s->rwstate=SSL_NOTHING; i=do_dtls1_write(s, type, buf, len, 0); return i; } Commit Message: A memory leak can occur in dtls1_buffer_record if either of the calls to ssl3_setup_buffe...
0
25,088
Analyze the following 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 flashrestart(struct airo_info *ai,struct net_device *dev){ int i,status; ssleep(1); /* Added 12/7/00 */ clear_bit (FLAG_FLASHING, &ai->flags); if (test_bit(FLAG_MPI, &ai->flags)) { status = mpi_init_descriptors(ai); if (status != SUCCESS) return status; } status = setup_card(ai, dev-...
0
13,343
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: system_call_script(thread_master_t *m, int (*func) (thread_t *), void * arg, unsigned long timer, notify_script_t* script) { pid_t pid; /* Daemonization to not degrade our scheduling timer */ if (log_file_name) flush_log_file(); pid = local_fork(); if (pid < 0) { /* fork error */ log_message(LOG_INF...
0
29,938
Analyze the following 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 InspectorNetworkAgent::WillSendEventSourceRequest( ThreadableLoaderClient* event_source) { DCHECK(!pending_request_); pending_request_ = event_source; pending_request_type_ = InspectorPageAgent::kEventSourceResource; } Commit Message: DevTools: send proper resource type in Network.RequestWillBeSen...
0
7,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: int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu) { struct page *page; struct kvm *kvm; int r; BUG_ON(vcpu->kvm == NULL); kvm = vcpu->kvm; vcpu->arch.emulate_ctxt.ops = &emulate_ops; if (!irqchip_in_kernel(kvm) || kvm_vcpu_is_bsp(vcpu)) vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE; else vcpu->arch.mp_sta...
0
25,314
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: find_same_op(const gs_composite_t *composite_action, int my_op, gs_composite_t **ppcte) { const gs_pdf14trans_t *pct0 = (gs_pdf14trans_t *)composite_action; gs_composite_t *pct = *ppcte; for (;;) { if (pct->type->comp_id == GX_COMPOSITOR_PDF14_TRANS) { gs_pdf14trans_t *pct_pdf14 =...
0
2,170
Analyze the following 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 n_frames() const { return n_frames_; } Commit Message: Merge Conflict Fix CL to lmp-mr1-release for ag/849478 DO NOT MERGE - libvpx: Pull from upstream Current HEAD: 7105df53d7dc13d5e575bc8df714ec8d1da36b06 BUG=23452792 Change-Id: Ic78176fc369e0bacc71d423e0e2e6075d004aaec CWE ID: CWE-119
0
28,378
Analyze the following 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 readFile(v8::Handle<v8::Value>* value, bool isIndexed) { RefPtrWillBeRawPtr<File> file; if (isIndexed) { if (m_version < 6) return false; file = readFileIndexHelper(); } else { file = readFileHelper(); } if (!...
0
27,900
Analyze the following 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 BlobURLRequestJob::ReadLoop(int* bytes_read) { while (remaining_bytes_ > 0 && read_buf_->BytesRemaining() > 0) { if (!ReadItem()) return false; } *bytes_read = BytesReadCompleted(); return true; } Commit Message: Avoid integer overflows in BlobURLRequestJob. BUG=169685 Review URL: htt...
0
8,603
Analyze the following 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 unregister_ftrace_command(struct ftrace_func_command *cmd) { struct ftrace_func_command *p, *n; int ret = -ENODEV; mutex_lock(&ftrace_cmd_mutex); list_for_each_entry_safe(p, n, &ftrace_commands, list) { if (strcmp(cmd->name, p->name) == 0) { ret = 0; list_del_init(&p->list); goto out_unlock; ...
0
12,628
Analyze the following 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 size_t all_data_cb(const void *ptr, size_t size, size_t nmemb, void *user_data) { struct data_buffer *db = (struct data_buffer *)user_data; size_t len = size * nmemb; size_t oldlen, newlen; void *newmem; static const unsigned char zero = 0; oldlen = db->len; newlen = oldlen + len; newmem = r...
0
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: file_magerror(struct magic_set *ms, const char *f, ...) { va_list va; va_start(va, f); file_error_core(ms, 0, f, va, ms->line); va_end(va); } Commit Message: - reduce recursion level from 20 to 10 and make a symbolic constant for it. - pull out the guts of saving and restoring the output buffer into function...
0
13,145
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void __ref acpi_os_unmap_memory(void *virt, acpi_size size) { return acpi_os_unmap_iomem((void __iomem *)virt, size); } Commit Message: acpi: Disable ACPI table override if securelevel is set From the kernel documentation (initrd_table_override.txt): If the ACPI_INITRD_TABLE_OVERRIDE compile option is true,...
0
14,862
Analyze the following 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 pn_sock_close(struct sock *sk, long timeout) { sk_common_release(sk); } Commit Message: inet: prevent leakage of uninitialized memory to user in recv syscalls Only update *addr_len when we actually fill in sockaddr, otherwise we can return uninitialized memory from the stack to the caller in the re...
0
29,442
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: e1000e_intrmgr_delay_rx_causes(E1000ECore *core, uint32_t *causes) { uint32_t delayable_causes; uint32_t rdtr = core->mac[RDTR]; uint32_t radv = core->mac[RADV]; uint32_t raid = core->mac[RAID]; if (msix_enabled(core->owner)) { return false; } delayable_causes = E1000_ICR_RXQ...
0
11,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 STACK_OF(X509) * php_array_to_X509_sk(zval * zcerts) /* {{{ */ { zval * zcertval; STACK_OF(X509) * sk = NULL; X509 * cert; zend_resource *certresource; sk = sk_X509_new_null(); /* get certs */ if (Z_TYPE_P(zcerts) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(zcerts), zcertval) { cert = php...
0
11,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: bool ZeroSuggestProvider::ShouldAppendExtraParams( const SearchSuggestionParser::SuggestResult& result) const { return true; } Commit Message: Provide experimental contextual suggestions when current URL comes from a google domain. The counts for the Omnibox.ZeroSuggestRequests historgram are 35% smalle...
0
28,172
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static unsigned int __get_next_segno(struct f2fs_sb_info *sbi, int type) { /* if segs_per_sec is large than 1, we need to keep original policy. */ if (sbi->segs_per_sec != 1) return CURSEG_I(sbi, type)->segno; if (type == CURSEG_HOT_DATA || IS_NODESEG(type)) return 0; if (SIT_I(sbi)->last_victim[ALLOC_N...
0
6,838
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static __init void ftrace_profile_debugfs(struct dentry *d_tracer) { } Commit Message: tracing: Fix possible NULL pointer dereferences Currently set_ftrace_pid and set_graph_function files use seq_lseek for their fops. However seq_open() is called only for FMODE_READ in the fops->open() so that if an user trie...
0
21,036
Analyze the following 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<KeyedService> BuildMockDataStoreForContext( content::BrowserContext* browser_context) { return std::make_unique<MockDataStore>(); } Commit Message: Connect the LocalDB to TabManager. Bug: 773382 Change-Id: Iec8fe5226ee175105d51f300f30b4865478ac099 Reviewed-on: https://chromium-review.goog...
0
14,367
Analyze the following 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 read_node_page(struct page *page, int op_flags) { struct f2fs_sb_info *sbi = F2FS_P_SB(page); struct node_info ni; struct f2fs_io_info fio = { .sbi = sbi, .type = NODE, .op = REQ_OP_READ, .op_flags = op_flags, .page = page, .encrypted_page = NULL, }; if (PageUptodate(page)) return L...
0
16,727
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: QPointF QQuickWebViewPrivate::contentPos() const { Q_Q(const QQuickWebView); return QPointF(q->contentX(), q->contentY()); } Commit Message: [Qt][WK2] There's no way to test the gesture tap on WTR https://bugs.webkit.org/show_bug.cgi?id=92895 Reviewed by Kenneth Rohde Christiansen. Source/WebKit2: Add...
0
18,219
Analyze the following 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 WebMediaPlayerImpl::OnFirstFrame(base::TimeTicks frame_time) { DCHECK(!load_start_time_.is_null()); DCHECK(!skip_metrics_due_to_startup_suspend_); has_first_frame_ = true; needs_first_frame_ = false; const base::TimeDelta elapsed = frame_time - load_start_time_; media_metrics_provider_->SetTimeTo...
0
7,901
Analyze the following 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 kblockd_schedule_work(struct work_struct *work) { return queue_work(kblockd_workqueue, work); } Commit Message: block: blk_init_allocated_queue() set q->fq as NULL in the fail case We find the memory use-after-free issue in __blk_drain_queue() on the kernel 4.14. After read the latest kernel 4.18-rc6 we th...
0
9,239
Analyze the following 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 perf_event_comm_event(struct perf_comm_event *comm_event) { char comm[TASK_COMM_LEN]; unsigned int size; memset(comm, 0, sizeof(comm)); strlcpy(comm, comm_event->task->comm, sizeof(comm)); size = ALIGN(strlen(comm)+1, sizeof(u64)); comm_event->comm = comm; comm_event->comm_size = size; comm...
0
19,439
Analyze the following 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 do_fpu_inst(unsigned short inst, struct pt_regs *regs) { struct task_struct *tsk = current; struct sh_fpu_soft_struct *fpu = &(tsk->thread.xstate->softfpu); perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, 0, regs, 0); if (!(task_thread_info(tsk)->status & TS_USEDFPU)) { /* initialize once. */ ...
1
24,087
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xdr_buf_subsegment(struct xdr_buf *buf, struct xdr_buf *subbuf, unsigned int base, unsigned int len) { subbuf->buflen = subbuf->len = len; if (base < buf->head[0].iov_len) { subbuf->head[0].iov_base = buf->head[0].iov_base + base; subbuf->head[0].iov_len = min_t(unsigned int, len, buf->head[0].iov_...
0
25,590
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: processInternalEntity(XML_Parser parser, ENTITY *entity, XML_Bool betweenDecl) { const char *textStart, *textEnd; const char *next; enum XML_Error result; OPEN_INTERNAL_ENTITY *openEntity; if (parser->m_freeInternalEntities) { openEntity = parser->m_freeInternalEntities; parser->m_freeInternalE...
1
19,044
Analyze the following 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 ~MockCanceledAfterSentPluginProcessHostClient() {} 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: svn://svn.chromium.org/chrome/trunk/src@180600 0039d316-1c4b-4281-b951-d872f2...
0
23,498
Analyze the following 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_tabletYtilt(struct device *dev, struct device_attribute *attr, char *buf) { struct aiptek *aiptek = dev_get_drvdata(dev); if (aiptek->curSetting.yTilt == AIPTEK_TILT_DISABLE) { return snprintf(buf, PAGE_SIZE, "disable\n"); } else { return snprintf(buf, PAGE_SIZE, "%d\n", aiptek->cu...
0
26,135
Analyze the following 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 ChromeClientImpl::setScrollbarsVisible(bool value) { m_scrollbarsVisible = value; WebFrameImpl* webFrame = toWebFrameImpl(m_webView->mainFrame()); if (webFrame) webFrame->setCanHaveScrollbars(value); } Commit Message: Delete apparently unused geolocation declarations and include. BUG=33...
0
29,022
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void put_descr(AVIOContext *pb, int tag, unsigned int size) { int i = 3; avio_w8(pb, tag); for (; i > 0; i--) avio_w8(pb, (size >> (7 * i)) | 0x80); avio_w8(pb, size & 0x7F); } Commit Message: avformat/movenc: Write version 2 of audio atom if channels is not known The version 1 ne...
0
1,568
Analyze the following 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 __rtnl_link_register(struct rtnl_link_ops *ops) { if (rtnl_link_ops_get(ops->kind)) return -EEXIST; /* The check for setup is here because if ops * does not have that filled up, it is not possible * to use the ops for creating device. So do not * fill up dellink as well. That disables rtnl_dellink....
0
15,112
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: uripClose(void * context) { if (context == NULL) return(-1); urip_cur = NULL; urip_rlen = 0; return(0); } Commit Message: Fix handling of parameter-entity references There were two bugs where parameter-entity references could lead to an unexpected change of the input buffer in xmlParseNameComple...
0
22,659
Analyze the following 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 main(int argc, char **argv) { blkid_cache cache = NULL; int ret; blkid_init_debug(BLKID_DEBUG_ALL); if (argc > 2) { fprintf(stderr, "Usage: %s [filename]\n" "Test loading/saving a cache (filename)\n", argv[0]); exit(1); } if ((ret = blkid_get_cache(&cache, "/dev/null")) != 0) { fprintf(stderr...
0
27,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: void ChromeBrowserMainPartsChromeos::PreBrowserStart() { external_metrics_ = new chromeos::ExternalMetrics; external_metrics_->Start(); if (ui::ShouldDefaultToNaturalScroll()) { base::CommandLine::ForCurrentProcess()->AppendSwitch( chromeos::switches::kNaturalScrollDefault); system::Input...
0
7,611
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int sco_sock_release(struct socket *sock) { struct sock *sk = sock->sk; int err = 0; BT_DBG("sock %p, sk %p", sock, sk); if (!sk) return 0; sco_sock_close(sk); if (sock_flag(sk, SOCK_LINGER) && sk->sk_lingertime && !(current->flags & PF_EXITING)) { lock_sock(sk); err = bt_sock_wait_sta...
0
27,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 recalibrate_floppy(void) { debugt(__func__, ""); do_floppy = recal_interrupt; output_byte(FD_RECALIBRATE); if (output_byte(UNIT(current_drive)) < 0) reset_fdc(); } Commit Message: floppy: don't write kernel-only members to FDRAWCMD ioctl output Do not leak kernel-only floppy_raw_cmd structure ...
0
15,619
Analyze the following 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 vp8_mc_chroma(VP8Context *s, VP8ThreadData *td, uint8_t *dst1, uint8_t *dst2, ThreadFrame *ref, const VP56mv *mv, int x_off, int y_off, int block_w, int block_h, int width, int height, ptrdiff_t linesize, vp8_mc_func mc_func[3][3]) {...
0
770
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static bool get_rsds(ut8* dbg_data, int dbg_data_len, SCV_RSDS_HEADER* res) { const int rsds_sz = 4 + sizeof (SGUID) + 4; if (dbg_data_len < rsds_sz) { return false; } memcpy (res, dbg_data, rsds_sz); res->file_name = (ut8*) strdup ((const char*) dbg_data + rsds_sz); return true; } Commit Message: Fix cr...
0
1,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: unsigned int git_index__create_mode(unsigned int mode) { if (S_ISLNK(mode)) return S_IFLNK; if (S_ISDIR(mode) || (mode & S_IFMT) == (S_IFLNK | S_IFDIR)) return (S_IFLNK | S_IFDIR); return S_IFREG | GIT_PERMS_CANONICAL(mode); } Commit Message: index: convert `read_entry` to return entry size via an out-p...
0
8,345
Analyze the following 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 openpic_gbl_write(void *opaque, hwaddr addr, uint64_t val, unsigned len) { OpenPICState *opp = opaque; IRQDest *dst; int idx; DPRINTF("%s: addr %#" HWADDR_PRIx " <= %08" PRIx64 "\n", __func__, addr, val); if (addr & 0xF) { return; ...
0
24,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: WebGLRenderingContextBase::getAttachedShaders(WebGLProgram* program) { if (!ValidateWebGLProgramOrShader("getAttachedShaders", program)) return base::nullopt; HeapVector<Member<WebGLShader>> shader_objects; const GLenum kShaderType[] = {GL_VERTEX_SHADER, GL_FRAGMENT_SHADER, ...
0
6,799
Analyze the following 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 task_struct *detach_one_task(struct lb_env *env) { struct task_struct *p; lockdep_assert_held(&env->src_rq->lock); list_for_each_entry_reverse(p, &env->src_rq->cfs_tasks, se.group_node) { if (!can_migrate_task(p, env)) continue; detach_task(p, env); /* * Right now, this is only...
0
10,512