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: static int lua_apr_md5(lua_State *L) { const char *buffer; char *result; size_t len; request_rec *r; r = ap_lua_check_request_rec(L, 1); luaL_checktype(L, 2, LUA_TSTRING); buffer = lua_tolstring(L, 2, &len); result = ap_md5_binary(r->pool, (const unsigned char *)b...
0
24,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: nfsd4_decode_delegreturn(struct nfsd4_compoundargs *argp, struct nfsd4_delegreturn *dr) { return nfsd4_decode_stateid(argp, &dr->dr_stateid); } 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...
0
7,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: static int gup_huge_pgd(pgd_t orig, pgd_t *pgdp, unsigned long addr, unsigned long end, int write, struct page **pages, int *nr) { int refs; struct page *head, *page; if (!pgd_access_permitted(orig, write)) return 0; BUILD_BUG_ON(pgd_devmap(orig)); refs = 0; page = pgd_page(orig) + ((addr & ~PGDIR...
1
27,450
Analyze the following 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 PeopleHandler::HandleRequestPinLoginState(const base::ListValue* args) { AllowJavascript(); chromeos::quick_unlock::PinBackend::GetInstance()->HasLoginSupport( base::BindOnce(&PeopleHandler::OnPinLoginAvailable, weak_factory_.GetWeakPtr())); } Commit Message: [signin] Add metr...
0
7,601
Analyze the following 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 ~NavigationControllerHistoryTest() { STLDeleteElements(&windows_); } Commit Message: Ensure URL is updated after a cross-site navigation is pre-empted by an "ignored" navigation. BUG=77507 TEST=NavigationControllerTest.LoadURL_IgnorePreemptsPending Review URL: http://codereview.chromium.org/682...
0
21,007
Analyze the following 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 fd_columns(int fd) { struct winsize ws = {}; if (ioctl(fd, TIOCGWINSZ, &ws) < 0) return -errno; if (ws.ws_col <= 0) return -EIO; return ws.ws_col; } Commit Message: Merge pull request #12378 from rbalint/vt-kbd-reset-check VT kbd reset check...
0
27,656
Analyze the following 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 bmpr_convert_row_2(struct iwbmprcontext *rctx,const iw_byte *src, size_t row) { int i; int pal_index; for(i=0;i<rctx->width;i++) { pal_index = (src[i/4]>>(2*(3-i%4)))&0x03; rctx->img->pixels[row*rctx->img->bpr + i*3 + 0] = rctx->palette.entry[pal_index].r; rctx->img->pixels[row*rctx->img->bp...
0
1,830
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: parseattrstat(netdissect_options *ndo, const uint32_t *dp, int verbose, int v3) { int er; dp = parsestatus(ndo, dp, &er); if (dp == NULL) return (0); if (er) return (1); return (parsefattr(ndo, dp, verbose, v3) != NULL); } Commit Message: CVE-2017-13005/NFS: Add two bounds checks before ...
0
27,385
Analyze the following 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 serve_err(SERVER* serve, const char* msg) { g_message("Export of %s on port %d failed:", serve->exportname, serve->port); err(msg); } Commit Message: Fix buffer size checking Yes, this means we've re-introduced CVE-2005-3534. Sigh. CWE ID: CWE-119
0
7,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: static struct fuse_file *fuse_write_file_get(struct fuse_conn *fc, struct fuse_inode *fi) { struct fuse_file *ff = __fuse_write_file_get(fc, fi); WARN_ON(!ff); return ff; } Commit Message: fuse: break infinite loop in fuse_fill_write_pages() I got a report about unkillable task eating CPU. Further ...
0
5,303
Analyze the following 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 ChromeExtensionsAPIClient::AddAdditionalValueStoreCaches( content::BrowserContext* context, const scoped_refptr<ValueStoreFactory>& factory, const scoped_refptr<base::ObserverListThreadSafe<SettingsObserver>>& observers, std::map<settings_namespace::Namespace, ValueStoreCache*>* cache...
0
9,881
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ensure_database (PolkitBackendSessionMonitor *monitor, GError **error) { gboolean ret = FALSE; if (monitor->database != NULL) { struct stat statbuf; if (stat (CKDB_PATH, &statbuf) != 0) { g_set_error (error, G_IO...
0
14,213
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ZSTD_compressSequences_internal(seqStore_t* seqStorePtr, ZSTD_entropyCTables_t const* prevEntropy, ZSTD_entropyCTables_t* nextEntropy, ZSTD_CCtx_params const* cctxParams, void* dst, size_t dstCa...
1
3,737
Analyze the following 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 nf_tables_fill_rule_info(struct sk_buff *skb, struct net *net, u32 portid, u32 seq, int event, u32 flags, int family, const struct nft_table *table, const struct nft_chain *chain, const struct nft_rule *rule) { struct nlmsghdr *nlh; struct nfgenmsg *nfmsg; con...
0
29,797
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: virtual ~HttpNetworkTransactionTest() { ClientSocketPoolManager::set_max_sockets_per_pool( HttpNetworkSession::NORMAL_SOCKET_POOL, old_max_pool_sockets_); ClientSocketPoolManager::set_max_sockets_per_group( HttpNetworkSession::NORMAL_SOCKET_POOL, old_max_group_sockets_); } Commit Mess...
0
4,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: int put_compat_itimerval(struct compat_itimerval __user *o, const struct itimerval *i) { struct compat_itimerval v32; v32.it_interval.tv_sec = i->it_interval.tv_sec; v32.it_interval.tv_usec = i->it_interval.tv_usec; v32.it_value.tv_sec = i->it_value.tv_sec; v32.it_value.tv_usec = i->it_value.tv_usec; retur...
0
28,943
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: hook_fd (struct t_weechat_plugin *plugin, int fd, int flag_read, int flag_write, int flag_exception, t_hook_callback_fd *callback, void *callback_data) { struct t_hook *new_hook; struct t_hook_fd *new_hook_fd; if ((fd < 0) || hook_search_fd (fd) || !callback) return NULL; ...
0
8,698
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: LayerTreeCoordinator::LayerTreeCoordinator(WebPage* webPage) : LayerTreeHost(webPage) , m_notifyAfterScheduledLayerFlush(false) , m_isValid(true) , m_waitingForUIProcess(true) , m_isSuspended(false) , m_contentsScale(1) , m_shouldSendScrollPositionUpdate(true) , m_shouldSyncFrame(...
1
23,350
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: group_remove_rule(struct ofgroup *group, struct rule *rule) { rule_collection_remove(&group->rules, rule); } Commit Message: ofproto: Fix OVS crash when reverting old flows in bundle commit During bundle commit flows which are added in bundle are applied to ofproto in-order. In case if a flow cannot be adde...
0
10,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: static struct sc_card_driver * sc_get_driver(void) { if (iso_ops == NULL) iso_ops = sc_get_iso7816_driver()->ops; asepcos_ops = *iso_ops; asepcos_ops.match_card = asepcos_match_card; asepcos_ops.init = asepcos_init; asepcos_ops.select_file = asepcos_select_file; asepcos_ops.set_s...
0
5,729
Analyze the following 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 Con_ClearNotify( void ) { int i; for ( i = 0 ; i < NUM_CON_TIMES ; i++ ) { con.times[i] = 0; } } Commit Message: Merge some file writing extension checks from OpenJK. Thanks Ensiform. https://github.com/JACoders/OpenJK/commit/05928a57f9e4aae15a3bd0 https://github.com/JACoders/OpenJK/commit/ef124fd0...
0
26,991
Analyze the following 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 extent_crypt_complete(struct crypto_async_request *req, int rc) { struct extent_crypt_result *ecr = req->data; if (rc == -EINPROGRESS) return; ecr->rc = rc; complete(&ecr->completion); } Commit Message: eCryptfs: Remove buggy and unnecessary write in file name decode routine Dmitry Chernenko...
0
924
Analyze the following 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 sm_adaptive_routing(p_fm_config_conx_hdlt hdl, fm_mgr_type_t mgr, int argc, char *argv[]) { fm_mgr_config_errno_t res; fm_msg_ret_code_t ret_code; uint32_t enable=0; if (argc == 1) { enable = atol(argv[0]); if((res = fm_mgr_simple_query(hdl, FM_ACT_GET, FM_DT_SM_SET_ADAPTIVE_ROUTING, mgr, sizeof(...
0
25,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: ProcXFixesChangeCursorByName(ClientPtr client) { CursorPtr pSource; Atom name; char *tchar; REQUEST(xXFixesChangeCursorByNameReq); REQUEST_FIXED_SIZE(xXFixesChangeCursorByNameReq, stuff->nbytes); VERIFY_CURSOR(pSource, stuff->source, client, DixReadAccess | DixGetAttrAc...
0
6,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: bool PrintWebViewHelper::IsPrintingEnabled() { bool result = false; Send(new PrintHostMsg_IsPrintingEnabled(routing_id(), &result)); return result; } Commit Message: Crash on nested IPC handlers in PrintWebViewHelper Class is not designed to handle nested IPC. Regular flows also does not expect them. Stil...
0
6,264
Analyze the following 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 GLES2DecoderPassthroughImpl::DoUniformMatrix3fv( GLint location, GLsizei count, GLboolean transpose, const volatile GLfloat* value) { api()->glUniformMatrix3fvFn(location, count, transpose, const_cast<const GLfloat*>(value)); return error::kNoError; }...
0
21,531
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void GpuProcessHostUIShim::OnVideoMemoryUsageStatsReceived( const GPUVideoMemoryUsageStats& video_memory_usage_stats) { GpuDataManagerImpl::GetInstance()->UpdateVideoMemoryUsageStats( video_memory_usage_stats); } Commit Message: Implement TextureImageTransportSurface using texture mailbox This has ...
0
25,994
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ffs_epfile_open(struct inode *inode, struct file *file) { struct ffs_epfile *epfile = inode->i_private; ENTER(); if (WARN_ON(epfile->ffs->state != FFS_ACTIVE)) return -ENODEV; file->private_data = epfile; ffs_data_opened(epfile->ffs); return 0; } Commit Message: usb: gadget: f_fs: Fix use-after-free ...
0
17,494
Analyze the following 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 WorkerFetchContext::SetFirstPartyCookieAndRequestorOrigin( ResourceRequest& out_request) { if (out_request.SiteForCookies().IsNull()) out_request.SetSiteForCookies(GetSiteForCookies()); if (!out_request.RequestorOrigin()) out_request.SetRequestorOrigin(GetSecurityOrigin()); } Commit Message:...
0
15,960
Analyze the following 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 __init blk_scsi_ioctl_init(void) { blk_set_cmd_filter_defaults(&blk_default_cmd_filter); return 0; } Commit Message: block: fail SCSI passthrough ioctls on partition devices Linux allows executing the SG_IO ioctl on a partition or LVM volume, and will pass the command to the underlying block device...
0
25,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: void js_rot3pop2(js_State *J) { /* A B C -> C */ STACK[TOP-3] = STACK[TOP-1]; TOP -= 2; } Commit Message: CWE ID: CWE-119
0
1,535
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: update_info_linux_md_component (Device *device) { if (g_strcmp0 (device->priv->id_type, "linux_raid_member") == 0) { const gchar *md_comp_level; gint md_comp_num_raid_devices; const gchar *md_comp_uuid; const gchar *md_comp_home_host; const gchar *md_comp_name; const gcha...
0
22,508
Analyze the following 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 u64 min_vruntime(u64 min_vruntime, u64 vruntime) { s64 delta = (s64)(vruntime - min_vruntime); if (delta < 0) min_vruntime = vruntime; return min_vruntime; } Commit Message: sched/fair: Fix infinite loop in update_blocked_averages() by reverting a9e7f6544b9c Zhipeng Xie, Xie XiuQi and Sargun...
0
24,695
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: BarProp* LocalDOMWindow::locationbar() const { if (!locationbar_) locationbar_ = BarProp::Create(GetFrame(), BarProp::kLocationbar); return locationbar_.Get(); } Commit Message: MacViews: Enable secure text input for password Textfields. In Cocoa the NSTextInputContext automatically enables secure text ...
0
15,556
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: undefinedCharacter(widechar c, const TranslationTableHeader *table, int pos, const InString *input, OutString *output, int *posMapping, int *cursorPosition, int *cursorStatus) { /* Display an undefined character in the output buffer */ int k; char *display; widechar displayDots[20]; if (table->undefined)...
0
28,349
Analyze the following 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 floadAlice(void *clientData, uint8_t **output, uint32_t *size, zrtpFreeBuffer_callback *cb) { /* get filename from ClientData */ my_Context_t *clientContext = (my_Context_t *)clientData; char *filename = clientContext->zidFilename; FILE *ALICECACHE = fopen(filename, "r+"); fseek(ALICECACHE, 0L, SEEK_END)...
0
14,391
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void WebContentsImpl::ResetOverrideEncoding() { canonical_encoding_.clear(); Send(new ViewMsg_ResetPageEncodingToDefault(GetRoutingID())); } Commit Message: Don't call WebContents::DownloadImage() callback if the WebContents were deleted BUG=583718 Review URL: https://codereview.chromium.org/1685343004 Cr...
0
22,793
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: JArithmeticDecoderStats *getRefinementRegionStats() { return refinementRegionStats; } Commit Message: CWE ID: CWE-189
0
16,566
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void RenderFrameImpl::OnBeforeUnload() { CHECK(!frame_->parent()); base::TimeTicks before_unload_start_time = base::TimeTicks::Now(); bool proceed = frame_->dispatchBeforeUnloadEvent(); base::TimeTicks before_unload_end_time = base::TimeTicks::Now(); Send(new FrameHostMsg_BeforeUnload_ACK(routing_id_, ...
0
7,211
Analyze the following 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 quit_called() const { return quit_called_; } Commit Message: Fix PPB_Flash_MessageLoop. This CL suspends script callbacks and resource loads while running nested message loop using PPB_Flash_MessageLoop. BUG=569496 Review URL: https://codereview.chromium.org/1559113002 Cr-Commit-Position: refs/heads/m...
0
5,567
Analyze the following 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 port_fops_read(struct file *filp, char __user *ubuf, size_t count, loff_t *offp) { struct port *port; ssize_t ret; port = filp->private_data; /* Port is hot-unplugged. */ if (!port->guest_connected) return -ENODEV; if (!port_has_data(port)) { /* * If nothing's connected on ...
0
18,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: int LocalDOMWindow::outerWidth() const { if (!GetFrame()) return 0; Page* page = GetFrame()->GetPage(); if (!page) return 0; ChromeClient& chrome_client = page->GetChromeClient(); if (page->GetSettings().GetReportScreenSizeInPhysicalPixelsQuirk()) return lroundf(chrome_client.RootWindowRec...
0
26,509
Analyze the following 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 set_freepointer(struct kmem_cache *s, void *object, void *fp) { *(void **)(object + s->offset) = fp; } 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 that the d...
0
3,768
Analyze the following 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 WebGL2RenderingContextBase::copyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, G...
0
26,031
Analyze the following 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 ssl3_get_certificate_request(SSL *s) { int ok, ret = 0; unsigned long n, nc, l; unsigned int llen, ctype_num, i; X509_NAME *xn = NULL; const unsigned char *p, *q; unsigned char *d; STACK_OF(X509_NAME) *ca_sk = NULL; n = s->method->ssl_get_message(s, ...
0
20,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: file_info_cancel (NautilusDirectory *directory) { if (directory->details->get_info_in_progress != NULL) { g_cancellable_cancel (directory->details->get_info_in_progress->cancellable); directory->details->get_info_in_progress->directory = NULL; directory->details->get_info_in_progre...
0
5,669
Analyze the following 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 TabletModeWindowManager::OnDisplayRemoved( const display::Display& display) { DisplayConfigurationChanged(); } Commit Message: Fix the crash after clamshell -> tablet transition in overview mode. This CL just reverted some changes that were made in https://chromium-review.googlesource.com/c/chromium/...
0
19,271
Analyze the following 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 iw_set_intermed_channeltypes(struct iw_context *ctx) { int i; for(i=0;i<ctx->intermed_numchannels;i++) { ctx->intermed_ci[i].channeltype = iw_get_channeltype(ctx->intermed_imgtype,i); } } Commit Message: Fixed a bug that could cause invalid memory to be accessed The bug could happen when transp...
0
29,809
Analyze the following 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::OnRAILModeChanged(v8::RAILMode rail_mode) { blink::MainThreadIsolate()->SetRAILMode(rail_mode); blink::SetRAILModeOnWorkerThreadIsolates(rail_mode); } Commit Message: Roll src/third_party/boringssl/src 664e99a64..696c13bd6 https://boringssl.googlesource.com/boringssl/+log/664e99a6486c...
0
13,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: smb_flush_file(struct smb_request *sr, struct smb_ofile *ofile) { sr->user_cr = smb_ofile_getcred(ofile); if ((ofile->f_node->flags & NODE_FLAGS_WRITE_THROUGH) == 0) (void) smb_fsop_commit(sr, sr->user_cr, ofile->f_node); } Commit Message: 7483 SMB flush on pipe triggers NULL pointer dereference in module sm...
1
19,455
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: box_overright(PG_FUNCTION_ARGS) { BOX *box1 = PG_GETARG_BOX_P(0); BOX *box2 = PG_GETARG_BOX_P(1); PG_RETURN_BOOL(FPge(box1->low.x, box2->low.x)); } Commit Message: Predict integer overflow to avoid buffer overruns. Several functions, mostly type input functions, calculated an allocation size such th...
0
18,946
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { if (size > 512) return 0; net::ProxyBypassRules rules; std::string input(data, data + size); rules.ParseFromString(input); rules.ParseFromStringUsingSuffixMatching(input); return 0; } Commit Message: Implicitly bypass...
1
17,286
Analyze the following 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 WavpackUpdateNumSamples (WavpackContext *wpc, void *first_block) { uint32_t wrapper_size; WavpackLittleEndianToNative (first_block, WavpackHeaderFormat); SET_TOTAL_SAMPLES (* (WavpackHeader *) first_block, WavpackGetSampleIndex64 (wpc)); if (wpc->riff_header_created && WavpackGetWrapperLoca...
0
20,637
Analyze the following 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 spl_filesystem_dir_it_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC) { spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter); ZVAL_LONG(key, object->u.dir.index); } Commit Message: Fix bug #72262 - do not overflow int CWE ID: CWE-190
0
13,268
Analyze the following 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 Element::setScrollLeft(int newLeft) { document()->updateLayoutIgnorePendingStylesheets(); if (RenderBox* rend = renderBox()) rend->setScrollLeft(static_cast<int>(newLeft * rend->style()->effectiveZoom())); } Commit Message: Set Attr.ownerDocument in Element#setAttributeNode() Attr objects c...
0
14,529
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void OobeUI::ShowSigninScreen(const LoginScreenContext& context, SigninScreenHandlerDelegate* delegate, NativeWindowDelegate* native_window_delegate) { policy::BrowserPolicyConnectorChromeOS* connector = g_browser_process->platform_part()->browse...
0
26,126
Analyze the following 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 esp_do_dma(ESPState *s) { uint32_t len; int to_device; to_device = (s->ti_size < 0); len = s->dma_left; if (s->do_cmd) { trace_esp_do_dma(s->cmdlen, len); s->dma_memory_read(s->dma_opaque, &s->cmdbuf[s->cmdlen], len); s->ti_size = 0; s->cmdlen = 0; ...
0
15,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: GBool ASCIIHexStream::isBinary(GBool last) { return str->isBinary(gFalse); } Commit Message: CWE ID: CWE-119
0
21,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: bool DateTimeFieldElement::isDateTimeFieldElement() const { return true; } Commit Message: INPUT_MULTIPLE_FIELDS_UI: Inconsistent value of aria-valuetext attribute https://bugs.webkit.org/show_bug.cgi?id=107897 Reviewed by Kentaro Hara. Source/WebCore: aria-valuetext and aria-valuenow attributes had incon...
0
28,736
Analyze the following 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_RSHUTDOWN_FUNCTION(phar) /* {{{ */ { int i; PHAR_G(request_ends) = 1; if (PHAR_G(request_init)) { phar_release_functions(); zend_hash_destroy(&(PHAR_G(phar_alias_map))); PHAR_G(phar_alias_map.u.flags) = 0; zend_hash_destroy(&(PHAR_G(phar_fname_map))); PHAR_G(phar_fname_map.u.flags) = 0; zend...
0
17,229
Analyze the following 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_do_create(struct inode *dir, struct dentry *dentry, struct nfs4_createdata *data) { int status = rpc_call_sync(NFS_CLIENT(dir), &data->msg, 0); if (status == 0) { update_changeattr(dir, &data->res.dir_cinfo); nfs_post_op_update_inode(dir, data->res.dir_fattr); status = nfs_instantiate(dent...
0
20,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 menu_cache_file_dir_unref(MenuCacheFileDir *file_dir) { if (file_dir && g_atomic_int_dec_and_test(&file_dir->n_ref)) { g_free(file_dir->dir); g_free(file_dir); } } Commit Message: CWE ID: CWE-20
0
15,829
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static inline LineContribType *_gdContributionsCalc(unsigned int line_size, unsigned int src_size, double scale_d, const interpolation_method pFilter) { double width_d; double scale_f_d = 1.0; const double filter_width_d = DEFAULT_BOX_RADIUS; int windows_size; unsigned int u; LineContribType *res; if (sc...
1
6,949
Analyze the following 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 OMX::freeNode(node_id node) { OMXNodeInstance *instance = findInstance(node); { Mutex::Autolock autoLock(mLock); ssize_t index = mLiveNodes.indexOfKey(IInterface::asBinder(instance->observer())); if (index < 0) { return OK; } mLiveNodes.removeItemsAt(index); } IInterface::asBinder(inst...
0
14,377
Analyze the following 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 ExtensionInstallPrompt::ShowConfirmation() { scoped_ptr<const PermissionSet> permissions_wrapper; const PermissionSet* permissions_to_display = nullptr; if (custom_permissions_.get()) { permissions_to_display = custom_permissions_.get(); } else if (extension_) { extensions::PermissionsUpdater...
0
25,634
Analyze the following 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 FileBrowserPrivateRequestAccessTokenFunction::RunAsync() { using extensions::api::file_browser_private::RequestAccessToken::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); drive::DriveServiceInterface* const drive_service = drive::util::Get...
0
795
Analyze the following 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::repaintTreeAfterLayout() { ASSERT(RuntimeEnabledFeatures::repaintAfterLayoutEnabled()); ASSERT(!needsLayout()); const LayoutRect oldRepaintRect = previousRepaintRect(); setPreviousRepaintRect(clippedOverflowRectForRepaint(containerForRepaint())); if (view()->doingFullRepaint...
0
13,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: error::Error GLES2DecoderPassthroughImpl::DoDeleteShader(GLuint shader) { return DeleteHelper( shader, &resources_->shader_id_map, [this](GLuint shader) { api()->glDeleteShaderFn(shader); }); } Commit Message: Add GL_PROGRAM_COMPLETION_QUERY_CHROMIUM This makes the query of GL_COMPLETION_STATUS_KH...
0
23,955
Analyze the following 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 RenderViewImpl::registerIntentService( WebFrame* frame, const WebIntentServiceInfo& service) { string16 title = service.title(); if (title.empty()) title = webview()->mainFrame()->document().title(); Send(new IntentsHostMsg_RegisterIntentService(routing_id_, ...
0
20,903
Analyze the following 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 ahci_mem_write(void *opaque, hwaddr addr, uint64_t val, unsigned size) { AHCIState *s = opaque; /* Only aligned reads are allowed on AHCI */ if (addr & 3) { fprintf(stderr, "ahci: Mis-aligned write to addr 0x" TARGET_FMT_plx "\n", addr); ...
0
7,159
Analyze the following 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 ipv4_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, u32 mtu) { const struct iphdr *iph = (const struct iphdr *) skb->data; struct flowi4 fl4; struct rtable *rt; struct dst_entry *odst = NULL; bool new = false; bh_lock_sock(sk); if (!ip_sk_accept_pmtu(sk)) goto out; odst = sk_dst_get(sk); ...
0
18,572
Analyze the following 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 DH_compute_key_padded(unsigned char *key, const BIGNUM *pub_key, DH *dh) { int rv, pad; rv = dh->meth->compute_key(key, pub_key, dh); if (rv <= 0) return rv; pad = BN_num_bytes(dh->p) - rv; if (pad > 0) { memmove(key + pad, key, rv); memset(key, 0, pad); } r...
0
26,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: void DownloadManagerImpl::DetermineDownloadTarget( DownloadItemImpl* item, const DownloadTargetCallback& callback) { if (!delegate_ || !delegate_->DetermineDownloadTarget(item, callback)) { base::FilePath target_path = item->GetForcedFilePath(); callback.Run(target_path, DownloadItem::TARGET_DISPOSI...
0
16,591
Analyze the following 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 WebString GetValueWrapper(WebFormControlElement element) { if (element.FormControlType() == "textarea") return element.To<WebFormControlElement>().Value(); if (element.FormControlType() == "select-one") return element.To<WebSelectElement>().Value(); return element.To<WebInputEle...
0
12,438
Analyze the following 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_prepare_memory_region(struct kvm *kvm, struct kvm_memory_slot *memslot, struct kvm_userspace_memory_region *mem, enum kvm_mr_change change) { return 0; } Commit Message: ARM: KVM: prevent NULL pointer dereferences with KVM VCPU ioctl Some ARM KVM VCPU ioctls require the vCPU t...
0
6,233
Analyze the following 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 gup_huge_pmd(pmd_t orig, pmd_t *pmdp, unsigned long addr, unsigned long end, int write, struct page **pages, int *nr) { struct page *head, *page; int refs; if (write && !pmd_write(orig)) return 0; refs = 0; head = pmd_page(orig); page = head + ((addr & ~PMD_MASK) >> PAGE_SHIFT); do { VM_...
0
4,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 mac80211_hwsim_cancel_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif) { struct mac80211_hwsim_data *hwsim = hw->priv; struct cfg80211_scan_info info = { .aborted = true, }; wiphy_dbg(hw->wiphy, "hwsim cancel_hw_scan\n"); cancel_delayed_work_sync(&hwsim->hw_scan); mutex_lo...
0
21,255
Analyze the following 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 FrameworkListener::registerCmd(FrameworkCommand *cmd) { mCommands->push_back(cmd); } Commit Message: Fix vold vulnerability in FrameworkListener Modify FrameworkListener to ignore commands that exceed the maximum buffer length and send an error message. Bug: 29831647 Change-Id: I9e57d1648d55af2ca0191b...
0
7,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: void Plugin::DispatchProgressEvent(int32_t result) { PLUGIN_PRINTF(("Plugin::DispatchProgressEvent (result=%" NACL_PRId32")\n", result)); if (result < 0) { return; } if (progress_events_.empty()) { PLUGIN_PRINTF(("Plugin::DispatchProgressEvent: no pending events\n")); return; ...
0
19,762
Analyze the following 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 send_monitor_event(struct sk_buff *skb) { struct sock *sk; struct hlist_node *node; BT_DBG("len %d", skb->len); read_lock(&hci_sk_list.lock); sk_for_each(sk, node, &hci_sk_list.head) { struct sk_buff *nskb; if (sk->sk_state != BT_BOUND) continue; if (hci_pi(sk)->channel != HCI_CHANN...
0
4,426
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: iperf_set_test_reporter_interval(struct iperf_test *ipt, double reporter_interval) { ipt->reporter_interval = reporter_interval; } Commit Message: Fix a buffer overflow / heap corruption issue that could occur if a malformed JSON string was passed on the control channel. This issue, present in the cJSON lib...
0
1,913
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: X509_CRL *X509_CRL_diff(X509_CRL *base, X509_CRL *newer, EVP_PKEY *skey, const EVP_MD *md, unsigned int flags) { X509_CRL *crl = NULL; int i; STACK_OF(X509_REVOKED) *revs = NULL; /* CRLs can't be delta already */ if (base->base_crl_number || newer->base_crl_number) { ...
0
13,043
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GahpClient::condor_job_hold(const char *schedd_name, PROC_ID job_id, const char *reason) { static const char* command = "CONDOR_JOB_HOLD"; if (server->m_commands_supported->contains_anycase(command)==FALSE) { return GAHPCLIENT_COMMAND_NOT_SUPPORTED; } if (!schedd_name) schedd_name=NULLSTRING; if ...
0
29,110
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: png_do_background(png_row_infop row_info, png_bytep row, png_color_16p trans_values, png_color_16p background #ifdef PNG_READ_GAMMA_SUPPORTED , png_color_16p background_1, png_bytep gamma_table, png_bytep gamma_from_1, png_bytep gamma_to_1, png_uint_16pp gamma_16, png_uint_16pp gamma_16_from_1, png...
0
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: void mnt_drop_write(struct vfsmount *mnt) { __mnt_drop_write(mnt); sb_end_write(mnt->mnt_sb); } Commit Message: vfs: Carefully propogate mounts across user namespaces As a matter of policy MNT_READONLY should not be changable if the original mounter had more privileges than creator of the mount namespace. Ad...
0
21,607
Analyze the following 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 ipv6_gro_complete(struct sk_buff *skb, int nhoff) { const struct net_offload *ops; struct ipv6hdr *iph = (struct ipv6hdr *)(skb->data + nhoff); int err = -ENOSYS; if (skb->encapsulation) { skb_set_inner_protocol(skb, cpu_to_be16(ETH_P_IPV6)); skb_set_inner_network_header(skb, nhoff); } iph-...
0
28,126
Analyze the following 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 ProfileImplIOData::Handle::ClearNetworkingHistorySince( base::Time time) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); LazyInitialize(); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::Bind( &ClearNetworkingHistorySinceOnIOThread, io_data_, ...
0
16,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 gdImageCopy (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h) { int c; int x, y; int tox, toy; int i; int colorMap[gdMaxColors]; if (dst->trueColor) { /* 2.0: much easier when the destination is truecolor. */ /* 2.0.10: needs a transparent-index check that is s...
0
27,041
Analyze the following 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 sk_buff **ipv6_gro_receive(struct sk_buff **head, struct sk_buff *skb) { const struct net_offload *ops; struct sk_buff **pp = NULL; struct sk_buff *p; struct ipv6hdr *iph; unsigned int nlen; unsigned int hlen; unsigned int off; u16 flush = 1; int proto; off = skb_gro_offset(skb); h...
0
22,250
Analyze the following 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::updateTextTrackDisplay() { BLINK_MEDIA_LOG << "updateTextTrackDisplay(" << (void*)this << ")"; ensureTextTrackContainer().updateDisplay( *this, TextTrackContainer::DidNotStartExposingControls); } Commit Message: [Blink>Media] Allow autoplay muted on Android by default There was...
0
19,468
Analyze the following 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 variadicStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); TestObjectV8Internal::variadicStringMethodMethod(info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); } Commit Message: document.location bind...
0
24,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: bool AppCacheDatabase::AddEntryFlags(const GURL& entry_url, int64_t cache_id, int additional_flags) { if (!LazyOpen(kDontCreate)) return false; static const char kSql[] = "UPDATE Entries SET flags = flags | ? WHERE cache_id =...
0
11,719
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GahpClient::cream_job_suspend(const char *service, const char *job_id) { static const char* command = "CREAM_JOB_SUSPEND"; if (server->m_commands_supported->contains_anycase(command)==FALSE) { return GAHPCLIENT_COMMAND_NOT_SUPPORTED; } if (!service) service=NULLSTRING; if (!job_id) job_id=NULLSTRING; s...
0
6,660
Analyze the following 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::HandleCompressedTexImage3DBucket( uint32_t immediate_data_size, const volatile void* cmd_data) { if (!feature_info_->IsWebGL2OrES3Context()) return error::kUnknownCommand; const volatile gles2::cmds::CompressedTexImage3DBucket& c = *static_cast<const volatile gles2...
0
26,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 WebLocalFrameImpl::CommitDataNavigation( const WebData& data, const WebString& mime_type, const WebString& text_encoding, const WebURL& base_url, const WebURL& unreachable_url, bool replace, WebFrameLoadType web_frame_load_type, const WebHistoryItem& item, bool is_client_r...
0
27,020
Analyze the following 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 hci_sock_setsockopt(struct socket *sock, int level, int optname, char __user *optval, unsigned int len) { struct hci_ufilter uf = { .opcode = 0 }; struct sock *sk = sock->sk; int err = 0, opt = 0; BT_DBG("sk %p, opt %d", sk, optname); lock_sock(sk); if (hci_pi(sk)->channel != HCI_CHA...
0
25,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: static int genprime_cb(int p, int n, BN_GENCB *arg) { char c='*'; if (p == 0) c='.'; if (p == 1) c='+'; if (p == 2) c='*'; if (p == 3) c='\n'; putc(c, stderr); fflush(stderr); return 1; } Commit Message: Fix for CVE-2014-3570 (with minor bn_asm.c revamp). Reviewed-by: Emilia Kasper <emilia@openssl.or...
0
21,989
Analyze the following 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 Eina_Bool _ewk_frame_contents_set_internal(Ewk_Frame_Smart_Data* smartData, const char* contents, size_t contentsSize, const char* mimeType, const char* encoding, const char* baseUri, const char* unreachableUri) { size_t length = strlen(contents); if (contentsSize < 1 || contentsSize > length) ...
0
27,591
Analyze the following 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 SubsetterImpl::ResolveCompositeGlyphs(const unsigned int* glyph_ids, size_t glyph_count, IntegerSet* glyph_id_processed) { if (glyph_ids == NULL || glyph_count == 0 || glyph_id_processed == NULL) { return false; } ...
1
15,212
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: blink::WebSize WebMediaPlayerImpl::NaturalSize() const { DCHECK(main_task_runner_->BelongsToCurrentThread()); return blink::WebSize(pipeline_metadata_.natural_size); } Commit Message: Simplify "WouldTaintOrigin" concept in media/blink Currently WebMediaPlayer has three predicates: - DidGetOpaqueResponseFr...
0
5,657