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 MediaStreamManager::SetUpDesktopCaptureChangeSourceRequest( DeviceRequest* request, const std::string& label) { DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK(IsDesktopCaptureMediaType(request->video_type())); DCHECK(request->request_type() == MEDIA_GENERATE_STREAM || request->request_...
0
2,324
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void GLES2DecoderImpl::DoTexStorage2DImageCHROMIUM(GLenum target, GLenum internal_format, GLenum buffer_usage, GLsizei width, ...
0
16,794
Analyze the following 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 DocumentLoader::DidObserveLoadingBehavior( WebLoadingBehaviorFlag behavior) { if (frame_) { DCHECK_GE(state_, kCommitted); GetLocalFrameClient().DidObserveLoadingBehavior(behavior); } } Commit Message: Fix detach with open()ed document leaving parent loading indefinitely Change-Id: I26c2a05...
0
984
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void MediaElementAudioSourceNode::SetFormat(size_t number_of_channels, float sample_rate) { GetMediaElementAudioSourceHandler().SetFormat(number_of_channels, sample_rate); } Commit Message: Redirect should not circumv...
0
22,664
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: sparse_extract_file (int fd, struct tar_stat_info *st, off_t *size) { bool rc = true; struct tar_sparse_file file; size_t i; if (!tar_sparse_init (&file)) return dump_status_not_implemented; file.stat_info = st; file.fd = fd; file.seekable = lseek (fd, 0, SEEK_SET) == 0; file.offset = 0; ...
0
19,895
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: DeleteDNS(short family, wchar_t *if_name) { wchar_t *proto = (family == AF_INET6) ? L"ipv6" : L"ip"; return netsh_dns_cmd(L"delete", proto, if_name, NULL); } Commit Message: Fix potential double-free() in Interactive Service (CVE-2018-9336) Malformed input data on the service pipe towards the OpenVPN in...
0
19,699
Analyze the following 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::CreateWebGraphicsContext3DProvider( CanvasRenderingContextHost* host, const CanvasContextCreationAttributesCore& attributes, unsigned webgl_version, bool* using_gpu_compositing) { if (host->IsWebGLBlocked()) { host->SetContextCreationWasBlocked(); host->HostDis...
0
28,105
Analyze the following 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 WebGLRenderingContextBase::ValidateBlendEquation(const char* function_name, GLenum mode) { switch (mode) { case GL_FUNC_ADD: case GL_FUNC_SUBTRACT: case GL_FUNC_REVERSE_SUBTRACT: return true; case GL_MIN_EXT: case GL_MAX_EXT: ...
0
1,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: MagickExport PixelPacket *GetAuthenticPixelCacheNexus(Image *image, const ssize_t x,const ssize_t y,const size_t columns,const size_t rows, NexusInfo *nexus_info,ExceptionInfo *exception) { CacheInfo *magick_restrict cache_info; PixelPacket *magick_restrict pixels; /* Transfer pixels from ...
0
14,185
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: FloatRect EffectPaintPropertyNode::MapRect(const FloatRect& input_rect) const { FloatRect rect = input_rect; rect.MoveBy(-state_.paint_offset); FloatRect result = state_.filter.MapRect(rect); result.MoveBy(state_.paint_offset); return result; } Commit Message: Reland "[CI] Make paint property nodes non...
0
13,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: show_signal_msg(struct pt_regs *regs, unsigned long error_code, unsigned long address, struct task_struct *tsk) { if (!unhandled_signal(tsk, SIGSEGV)) return; if (!printk_ratelimit()) return; printk("%s%s[%d]: segfault at %lx ip %p sp %p error %lx", task_pid_nr(tsk) > 1 ? KERN_INFO : KERN_EMERG, ts...
0
26,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: void WebGLRenderingContextBase::vertexAttrib1f(GLuint index, GLfloat v0) { if (isContextLost()) return; ContextGL()->VertexAttrib1f(index, v0); SetVertexAttribType(index, kFloat32ArrayType); } Commit Message: Reset ES3 pixel pack parameters and PIXEL_PACK_BUFFER binding in DrawingBuffer before ReadPixe...
0
13,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: static enum bp_state reserve_additional_memory(void) { long credit; struct resource *resource; int nid, rc; unsigned long balloon_hotplug; credit = balloon_stats.target_pages + balloon_stats.target_unpopulated - balloon_stats.total_pages; /* * Already hotplugged enough pages? Wait for them to be * ...
0
13,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: void GetInterface(const std::string& interface_name, mojo::ScopedMessagePipeHandle handle) { DCHECK(thread_checker_.CalledOnValidThread()); DCHECK_CURRENTLY_ON(BrowserThread::IO); service_manager::mojom::InterfaceProvider* provider = registry_.get(); base::AutoLock lock(enab...
0
29,307
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: LayerTreeHostTestUIResource() : num_ui_resources_(0) {} Commit Message: (Reland) Discard compositor frames from unloaded web content This is a reland of https://codereview.chromium.org/2707243005/ with a small change to fix an uninitialized memory error that fails on MSAN bots. BUG=672847 TBR=danakj@chromium...
0
10,861
Analyze the following 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 InputDispatcher::notifyKey(const NotifyKeyArgs* args) { #if DEBUG_INBOUND_EVENT_DETAILS ALOGD("notifyKey - eventTime=%lld, deviceId=%d, source=0x%x, policyFlags=0x%x, action=0x%x, " "flags=0x%x, keyCode=0x%x, scanCode=0x%x, metaState=0x%x, downTime=%lld", args->eventTime, args->deviceId, arg...
0
15,245
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Browser::CreateParams Browser::CreateParams::CreateForApp( const std::string& app_name, bool trusted_source, const gfx::Rect& window_bounds, Profile* profile, bool user_gesture) { DCHECK(!app_name.empty()); CreateParams params(TYPE_POPUP, profile, user_gesture); params.app_name = app_na...
0
12,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: BOOLEAN ParaNdis_BindRxBufferToPacket( PARANDIS_ADAPTER *pContext, pRxNetDescriptor p) { ULONG i; PMDL *NextMdlLinkage = &p->Holder; for(i = PARANDIS_FIRST_RX_DATA_PAGE; i < p->PagesAllocated; i++) { *NextMdlLinkage = NdisAllocateMdl(pContext->MiniportHandle, p->PhysicalPages[i].V...
0
25,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 snd_timer_check_master(struct snd_timer_instance *master) { struct snd_timer_instance *slave, *tmp; /* check all pending slaves */ list_for_each_entry_safe(slave, tmp, &snd_timer_slave_list, open_list) { if (slave->slave_class == master->slave_class && slave->slave_id == master->slave_id) ...
0
8,627
Analyze the following 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 is_spillable_regtype(enum bpf_reg_type type) { switch (type) { case PTR_TO_MAP_VALUE: case PTR_TO_MAP_VALUE_OR_NULL: case PTR_TO_STACK: case PTR_TO_CTX: case FRAME_PTR: case CONST_PTR_TO_MAP: return true; default: return false; } } Commit Message: bpf: fix refcnt overflow On a system wi...
0
28,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: PHP_METHOD(PharFileInfo, getPharFlags) { PHAR_ENTRY_OBJECT(); if (zend_parse_parameters_none() == FAILURE) { return; } RETURN_LONG(entry_obj->ent.entry->flags & ~(PHAR_ENT_PERM_MASK|PHAR_ENT_COMPRESSION_MASK)); } Commit Message: CWE ID:
0
16,800
Analyze the following 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 SyncBackendHost::Core::DoStartSyncing() { DCHECK_EQ(MessageLoop::current(), sync_loop_); sync_manager_->StartSyncingNormally(); } Commit Message: [Sync] Cleanup all tab sync enabling logic now that its on by default. BUG=none TEST= Review URL: https://chromiumcodereview.appspot.com/10443046 git-svn-...
0
6,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: composite_to_json(Datum composite, StringInfo result, bool use_line_feeds) { HeapTupleHeader td; Oid tupType; int32 tupTypmod; TupleDesc tupdesc; HeapTupleData tmptup, *tuple; int i; bool needsep = false; const char *sep; sep = use_line_feeds ? ",\n " : ","; td = DatumGetHeapTupleHeader(co...
0
24,983
Analyze the following 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 jas_stream_read(jas_stream_t *stream, void *buf, int cnt) { int n; int c; char *bufptr; JAS_DBGLOG(100, ("jas_stream_read(%p, %p, %d)\n", stream, buf, cnt)); if (cnt < 0) { jas_deprecated("negative count for jas_stream_read"); } bufptr = buf; n = 0; while (n < cnt) { if ((c = jas_stream_ge...
0
10,073
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int test_gf2m_mod_exp(BIO *bp,BN_CTX *ctx) { BIGNUM *a,*b[2],*c,*d,*e,*f; int i, j, ret = 0; int p0[] = {163,7,6,3,0,-1}; int p1[] = {193,15,0,-1}; a=BN_new(); b[0]=BN_new(); b[1]=BN_new(); c=BN_new(); d=BN_new(); e=BN_new(); f=BN_new(); BN_GF2m_arr2poly(p0, b[0]); BN_GF2m_arr2poly(p1, b[1]); fo...
0
11,758
Analyze the following 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 inode *ilookup5(struct super_block *sb, unsigned long hashval, int (*test)(struct inode *, void *), void *data) { struct inode *inode = ilookup5_nowait(sb, hashval, test, data); if (inode) wait_on_inode(inode); return inode; } Commit Message: fs,userns: Change inode_capable to capable_wrt_inode_ui...
0
6,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: bool jsvIsArray(const JsVar *v) { return v && (v->flags&JSV_VARTYPEMASK)==JSV_ARRAY; } Commit Message: fix jsvGetString regression CWE ID: CWE-119
0
13,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 void picmemset(PicContext *s, AVFrame *frame, int value, int run, int *x, int *y, int *plane, int bits_per_plane) { uint8_t *d; int shift = *plane * bits_per_plane; int mask = ((1 << bits_per_plane) - 1) << shift; value <<= shift; while (run > 0) { int ...
0
28,714
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void RenderWidgetHostImpl::InitializeOverscrollController() { overscroll_controller_.reset(new OverscrollController(this)); } Commit Message: Implement TextureImageTransportSurface using texture mailbox This has a couple of advantages: - allow tearing down and recreating the UI parent context without losing t...
0
24,386
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: atusb_set_cca_ed_level(struct ieee802154_hw *hw, s32 mbm) { struct atusb *atusb = hw->priv; u32 i; for (i = 0; i < hw->phy->supported.cca_ed_levels_size; i++) { if (hw->phy->supported.cca_ed_levels[i] == mbm) return atusb_write_subreg(atusb, SR_CCA_ED_THRES, i); } return -EINVAL; } Commit Message: ie...
0
13,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 RenderWidgetHostViewGtk::OnDestroy(GtkWidget* widget) { DCHECK(is_fullscreen_); host_->Shutdown(); } Commit Message: Implement TextureImageTransportSurface using texture mailbox This has a couple of advantages: - allow tearing down and recreating the UI parent context without losing the renderer contex...
0
12,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: void TabStripGtk::TabMiniStateChanged(WebContents* contents, int index) { if (GetTabAt(index)->mini() == model_->IsMiniTab(index)) return; GetTabAt(index)->set_mini(model_->IsMiniTab(index)); if (window_ && window_->window() && gtk_widget_get_visible(GTK_WIDGET(window_->window()))) { StartMin...
0
23,305
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static inline int get_duration(AVIStream *ast, int len) { if (ast->sample_size) return len; else if (ast->dshow_block_align) return (len + ast->dshow_block_align - 1) / ast->dshow_block_align; else return 1; } Commit Message: avformat/avidec: Limit formats in gab2 to srt and a...
0
16,499
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void RenderWidgetHostImpl::ScrollBackingStoreRect(const gfx::Vector2d& delta, const gfx::Rect& clip_rect, const gfx::Size& view_size) { if (is_hidden_) { needs_repainting_on_restore_ = true; return; } ...
0
6,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 tmax_del(GF_Box *s) { gf_free((GF_TMAXBox *)s); } Commit Message: fixed 2 possible heap overflows (inc. #1088) CWE ID: CWE-125
0
14,157
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int32_t EqualizerGetBand(EffectContext *pContext __unused, uint32_t targetFreq){ int band = 0; if(targetFreq < bandFreqRange[0][0]){ return -EINVAL; }else if(targetFreq == bandFreqRange[0][0]){ return 0; } for(int i=0; i<FIVEBAND_NUMBANDS;i++){ if((targetFreq > bandFreqRange[i][0])&&(targetFreq <= bandFr...
0
22,061
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int ext4_ext_truncate_extend_restart(handle_t *handle, struct inode *inode, int needed) { int err; if (!ext4_handle_valid(handle)) return 0; if (handle->h_buffer_credits >= needed) return 0; /* * If we need to extend the journal get a few extra blocks * while we're at it for ...
0
28,217
Analyze the following 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 cryp_polling_mode(struct cryp_ctx *ctx, struct cryp_device_data *device_data) { int len = ctx->blocksize / BYTES_PER_WORD; int remaining_length = ctx->datalen; u32 *indata = (u32 *)ctx->indata; u32 *outdata = (u32 *)ctx->outdata; while (remaining_length > 0) { writesl(&device_data->ba...
0
344
Analyze the following 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 ExecuteMoveWordBackwardAndModifySelection(LocalFrame& frame, Event*, EditorCommandSource, const String&) { frame.Selection().Modify(Select...
0
1,381
Analyze the following 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 *php_http_url_to_string(const php_http_url_t *url, char **url_str, size_t *url_len, zend_bool persistent) { php_http_buffer_t buf; php_http_buffer_init_ex(&buf, PHP_HTTP_BUFFER_DEFAULT_SIZE, persistent ? PHP_HTTP_BUFFER_INIT_PERSISTENT : 0); if (url->scheme && *url->scheme) { php_http_buffer_append...
0
13,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: ip6_finddst(netdissect_options *ndo, struct in6_addr *dst, const struct ip6_hdr *ip6) { const u_char *cp; int advance; u_int nh; const void *dst_addr; const struct ip6_rthdr *dp; const struct ip6_rthdr0 *dp0; const struct in6_addr *addr; int i, len; cp = (const u_char *)ip6; advance = sizeo...
0
22,704
Analyze the following 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 FS_Restart( int checksumFeed ) { const char *lastGameDir; FS_Shutdown( qfalse ); fs_checksumFeed = checksumFeed; FS_ClearPakReferences( 0 ); FS_Startup(com_basegame->string); #ifndef STANDALONE FS_CheckPak0( ); #endif if ( FS_ReadFile( "default.cfg", NULL ) <= 0 ) { if ( lastValidBase[0] ) { ...
0
25,577
Analyze the following 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 crypto_rfc4543_free(struct crypto_instance *inst) { struct crypto_rfc4543_instance_ctx *ctx = crypto_instance_ctx(inst); crypto_drop_aead(&ctx->aead); crypto_drop_skcipher(&ctx->null); kfree(inst); } Commit Message: crypto: include crypto- module prefix in template This adds the module loading...
0
20,064
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool InputDispatcher::transferTouchFocus(const sp<InputChannel>& fromChannel, const sp<InputChannel>& toChannel) { #if DEBUG_FOCUS ALOGD("transferTouchFocus: fromChannel=%s, toChannel=%s", fromChannel->getName().string(), toChannel->getName().string()); #endif { // acquire lock AutoMutex _l(mLo...
0
3,518
Analyze the following 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 WaitUntilHidden() { while (is_visible_) { message_loop_runner_ = new MessageLoopRunner; message_loop_runner_->Run(); } } Commit Message: If a page shows a popup, end fullscreen. This was implemented in Blink r159834, but it is susceptible to a popup/fullscreen race. This CL reverts ...
0
28,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: view_focus_set(Browser_Window *window, Eina_Bool focus) { /* We steal focus away from elm's focus model and start to do things * manually here, so elm now has no clue what's up. Tell elm that its * toplevel widget is to be unfocused so elm gives up the focus */ elm_object_focus_set(elm_object_to...
0
15,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 int nl80211_set_mpath(struct sk_buff *skb, struct genl_info *info) { struct cfg80211_registered_device *rdev = info->user_ptr[0]; struct net_device *dev = info->user_ptr[1]; u8 *dst = NULL; u8 *next_hop = NULL; if (!info->attrs[NL80211_ATTR_MAC]) return -EINVAL; if (!info->attrs[NL80211_ATTR_MPAT...
0
20,581
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: request_rec *ap_read_request(conn_rec *conn) { request_rec *r; apr_pool_t *p; const char *expect; int access_status; apr_bucket_brigade *tmp_bb; apr_socket_t *csd; apr_interval_time_t cur_timeout; apr_pool_create(&p, conn->pool); apr_pool_tag(p, "request"); r = apr_pcallo...
0
25,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: find_opening_op(int opening_op, gs_composite_t **ppcte, gs_compositor_closing_state return_code) { /* Assuming a right *BEGIN* - *END* operation balance. */ gs_composite_t *pcte = *ppcte; for (;;) { if (pcte->type->comp_id == GX_COMPOSITOR_PDF14_TRANS) { gs_pdf14tr...
0
19,658
Analyze the following 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 flush_tags(fz_context *ctx, pdf_filter_processor *p, tag_record **tags) { tag_record *tag = *tags; if (tag == NULL) return; if (tag->prev) flush_tags(ctx, p, &tag->prev); if (tag->bdc) { if (p->chain->op_BDC) p->chain->op_BDC(ctx, p->chain, tag->tag, tag->raw, tag->cooked); } else if ...
0
26,278
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void PrintHeaderFooterText( const string16& text, WebKit::WebCanvas* canvas, HeaderFooterPaint paint, float webkit_scale_factor, const printing::PageSizeMargins& page_layout, printing::HorizontalHeaderFooterPosition horizontal_position, printing::VerticalHeaderFooterPosition vertical_p...
0
11,231
Analyze the following 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 ImapStatus *imap_mboxcache_get(struct ImapData *idata, const char *mbox, bool create) { struct ImapStatus *status = NULL; #ifdef USE_HCACHE header_cache_t *hc = NULL; void *uidvalidity = NULL; void *uidnext = NULL; #endif struct ListNode *np; STAILQ_FOREACH(np, &idata->mboxcache, entries) { ...
0
17,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: void WebGL2RenderingContextBase::uniform2iv( const WebGLUniformLocation* location, Vector<GLint>& v) { WebGLRenderingContextBase::uniform2iv(location, v); } Commit Message: Reset ES3 pixel pack parameters and PIXEL_PACK_BUFFER binding in DrawingBuffer before ReadPixels() and recover them later. BUG=74...
0
2,291
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: fit(peer_t *p, double rd) { if ((p->reachable_bits & (p->reachable_bits-1)) == 0) { /* One or zero bits in reachable_bits */ VERB4 bb_error_msg("peer %s unfit for selection: unreachable", p->p_dotted); return 0; } #if 0 /* we filter out such packets earlier */ if ((p->lastpkt_status & LI_ALARM) == LI_ALA...
0
19,897
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: evutil_parse_servname(const char *servname, const char *protocol, const struct evutil_addrinfo *hints) { int n = parse_numeric_servname(servname); if (n>=0) return n; #if defined(EVENT__HAVE_GETSERVBYNAME) || defined(_WIN32) if (!(hints->ai_flags & EVUTIL_AI_NUMERICSERV)) { struct servent *ent = getser...
0
7,730
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void TabStripGtk::FinishAnimation(TabStripGtk::TabAnimation* animation, bool layout) { active_animation_.reset(NULL); for (int i = 0, count = GetTabCount(); i < count; ++i) GetTabAt(i)->set_animating_mini_change(false); if (layout) Layout(); } Commit Message: Rem...
0
27,128
Analyze the following 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
1,466
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void update_irq(struct HPETTimer *timer, int set) { uint64_t mask; HPETState *s; int route; if (timer->tn <= 1 && hpet_in_legacy_mode(timer->state)) { /* if LegacyReplacementRoute bit is set, HPET specification requires * timer0 be routed to IRQ0 in NON-APIC or IRQ2 in the...
0
9,328
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: RenderView::~RenderView() { history_page_ids_.clear(); if (decrement_shared_popup_at_destruction_) shared_popup_counter_->data--; while (!file_chooser_completions_.empty()) { if (file_chooser_completions_.front()->completion) { file_chooser_completions_.front()->completion->didChooseFile( ...
0
22,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: void ContentSecurityPolicy::FillInCSPHashValues( const String& source, uint8_t hash_algorithms_used, Vector<CSPHashValue>* csp_hash_values) { static const struct { ContentSecurityPolicyHashAlgorithm csp_hash_algorithm; HashAlgorithm algorithm; } kAlgorithmMap[] = { {kContentSecurityP...
0
14,919
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xsltStyleInitializeStylesheetModule(xsltStylesheetPtr style, const xmlChar * URI) { xsltExtDataPtr dataContainer; void *userData = NULL; xsltExtModulePtr module; if ((style == NULL) || (URI == NULL)) return(NULL); if (xsltExtensionsHash == NULL) { #ifdef WITH_XSLT_DEBUG_EXTENSIONS ...
0
15,111
Analyze the following 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 netlink_queue_mmaped_skb(struct sock *sk, struct sk_buff *skb) { struct nl_mmap_hdr *hdr; hdr = netlink_mmap_hdr(skb); hdr->nm_len = skb->len; hdr->nm_group = NETLINK_CB(skb).dst_group; hdr->nm_pid = NETLINK_CB(skb).creds.pid; hdr->nm_uid = from_kuid(sk_user_ns(sk), NETLINK_CB(skb).creds.uid); ...
0
18,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 DragController::DragExited(DragData* drag_data, LocalFrame& local_root) { DCHECK(drag_data); LocalFrameView* frame_view(local_root.View()); if (frame_view) { DataTransferAccessPolicy policy = kDataTransferTypesReadable; DataTransfer* data_transfer = CreateDraggingDataTransfer(policy, drag_data...
0
23,082
Analyze the following 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 intel_pmu_cpu_starting(int cpu) { struct cpu_hw_events *cpuc = &per_cpu(cpu_hw_events, cpu); int core_id = topology_core_id(cpu); int i; init_debug_store_on_cpu(cpu); /* * Deal with CPUs that don't clear their LBRs on power-up. */ intel_pmu_lbr_reset(); cpuc->lbr_sel = NULL; if (!cpuc->...
0
22,386
Analyze the following 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 tcp_fin(struct sock *sk) { struct tcp_sock *tp = tcp_sk(sk); inet_csk_schedule_ack(sk); sk->sk_shutdown |= RCV_SHUTDOWN; sock_set_flag(sk, SOCK_DONE); switch (sk->sk_state) { case TCP_SYN_RECV: case TCP_ESTABLISHED: /* Move to CLOSE_WAIT */ tcp_set_state(sk, TCP_CLOSE_WAIT); inet_csk(sk)->ics...
0
5,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: static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb, netdev_features_t features) { struct sk_buff *segs = ERR_PTR(-EINVAL); unsigned int mss; unsigned int unfrag_ip6hlen, unfrag_len; struct frag_hdr *fptr; u8 *packet_start, *prevhdr; u8 nexthdr; u8 frag_hdr_sz = sizeof(struct frag_hdr); int...
1
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: int cap_capset(struct cred *new, const struct cred *old, const kernel_cap_t *effective, const kernel_cap_t *inheritable, const kernel_cap_t *permitted) { if (cap_inh_is_capped() && !cap_issubset(*inheritable, cap_combine(old->cap_inheritable, old->cap_permitted...
0
6,936
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: juniper_mlppp_print(netdissect_options *ndo, const struct pcap_pkthdr *h, register const u_char *p) { struct juniper_l2info_t l2info; l2info.pictype = DLT_JUNIPER_MLPPP; if (juniper_parse_header(ndo, p, h, &l2info) == 0) return l2info.header_len; /...
0
17,893
Analyze the following 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 cuse_send_init(struct cuse_conn *cc) { int rc; struct fuse_req *req; struct page *page; struct fuse_conn *fc = &cc->fc; struct cuse_init_in *arg; void *outarg; BUILD_BUG_ON(CUSE_INIT_INFO_MAX > PAGE_SIZE); req = fuse_get_req_for_background(fc, 1); if (IS_ERR(req)) { rc = PTR_ERR(req); go...
0
24,893
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: psf_get_cues (SF_PRIVATE * psf, void * data, size_t datasize) { if (psf->cues) { uint32_t cue_count = (datasize - sizeof (uint32_t)) / sizeof (SF_CUE_POINT) ; cue_count = SF_MIN (cue_count, psf->cues->cue_count) ; memcpy (data, psf->cues, SF_CUES_VAR_SIZE (cue_count)) ; ((SF_CUES*) data)->cue_count = cue...
0
29,236
Analyze the following 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 BaseMultipleFieldsDateAndTimeInputType::shouldHaveSecondField(const DateComponents& date) const { StepRange stepRange = createStepRange(AnyIsDefaultStep); return date.second() || date.millisecond() || !stepRange.minimum().remainder(static_cast<int>(msPerMinute)).isZero() || !stepRange...
0
3,288
Analyze the following 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 Curl_cookie_cleanup(struct CookieInfo *c) { struct Cookie *co; struct Cookie *next; if(c) { if(c->filename) free(c->filename); co = c->cookies; while(co) { next = co->next; freecookie(co); co = next; } free(c); /* free the base struct as well */ } } Commi...
0
23,248
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int cap_validate_magic(cap_user_header_t header, unsigned *tocopy) { __u32 version; if (get_user(version, &header->version)) return -EFAULT; switch (version) { case _LINUX_CAPABILITY_VERSION_1: warn_legacy_capability_use(); *tocopy = _LINUX_CAPABILITY_U32S_1; break; case _LINUX_CAPABILITY_VE...
0
111
Analyze the following 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 nr_insert_socket(struct sock *sk) { spin_lock_bh(&nr_list_lock); sk_add_node(sk, &nr_list); spin_unlock_bh(&nr_list_lock); } Commit Message: netrom: fix info leak via msg_name in nr_recvmsg() In case msg_name is set the sockaddr info gets filled out, as requested, but the code fails to initialize...
0
27,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: GahpClient::gt4_gram_client_job_start(const char * job_contact) { static const char* command = "GT4_GRAM_JOB_START"; if (server->m_commands_supported->contains_anycase(command)==FALSE) { return GAHPCLIENT_COMMAND_NOT_SUPPORTED; } if (!job_contact) job_contact=NULLSTRING; std::string reqline; int x = sp...
0
9,814
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void GLES2DecoderImpl::DoUniformMatrix3fv( GLint fake_location, GLsizei count, GLboolean transpose, const GLfloat* value) { GLenum type = 0; GLint real_location = -1; if (!PrepForSetUniformByLocation( fake_location, "glUniformMatrix3fv", &real_location, &type, &count)) { return; } glUn...
0
10,263
Analyze the following 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 avcodec_parameters_copy(AVCodecParameters *dst, const AVCodecParameters *src) { codec_parameters_reset(dst); memcpy(dst, src, sizeof(*dst)); dst->extradata = NULL; dst->extradata_size = 0; if (src->extradata) { dst->extradata = av_mallocz(src->extradata_size + AV_INPUT_BUFFER...
0
17,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: static void reds_char_device_add_state(SpiceCharDeviceState *st) { SpiceCharDeviceStateItem *item = spice_new0(SpiceCharDeviceStateItem, 1); item->st = st; ring_add(&reds->char_devs_states, &item->link); } Commit Message: CWE ID: CWE-119
0
17,329
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: virtual void GetBucketsForArgs(const ListValue* args, BucketList* buckets) { for (size_t i = 0; i < args->GetSize(); i++) { int id; ASSERT_TRUE(args->GetInteger(i, &id)); if (buckets_.find(id) == buckets_.end()) buckets_[id] = new Bucket(); buckets->push_back(buckets_[id]); ...
0
20,694
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int br_multicast_add_group(struct net_bridge *br, struct net_bridge_port *port, struct br_ip *group) { struct net_bridge_mdb_entry *mp; struct net_bridge_port_group *p; struct net_bridge_port_group __rcu **pp; int err; spin_lock(&br->multicast_lock); if (!netif_running(br->dev) || (...
0
26,120
Analyze the following 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::explicitClose() { if (RefPtrWillBeRawPtr<DocumentParser> parser = m_parser) parser->finish(); if (!m_frame) { implicitClose(); return; } m_frame->loader().checkCompleted(); } Commit Message: Don't change Document load progress in any page dismissal events....
0
22,962
Analyze the following 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_cmdline(int idx, const char *cmdline) { strncpy(get_saved_cmdlines(idx), cmdline, TASK_COMM_LEN); } Commit Message: Merge branch 'page-refs' (page ref overflow) Merge page ref overflow branch. Jann Horn reported that he can overflow the page ref count with sufficient memory (and a files...
0
23,008
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void QQuickWebView::mousePressEvent(QMouseEvent* event) { Q_D(QQuickWebView); forceActiveFocus(); d->pageView->eventHandler()->handleMousePressEvent(event); } Commit Message: [Qt][WK2] Allow transparent WebViews https://bugs.webkit.org/show_bug.cgi?id=80608 Reviewed by Tor Arne Vestbø. Added suppor...
0
14,220
Analyze the following 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 ssl_security_cert_key(SSL *s, SSL_CTX *ctx, X509 *x, int op) { int secbits = -1; EVP_PKEY *pkey = X509_get0_pubkey(x); if (pkey) { /* * If no parameters this will return -1 and fail using the default * security callback for any non-zero security level. This will ...
0
22,616
Analyze the following 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::DidFailProvisionalLoad( const WebURLError& error, blink::WebHistoryCommitType commit_type) { TRACE_EVENT1("navigation,benchmark,rail", "RenderFrameImpl::didFailProvisionalLoad", "id", routing_id_); NotifyObserversOfFailedProvisionalLoad(error); WebDocumentLoader...
0
19,164
Analyze the following 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::setNeedsFocusedElementCheck() { if (!m_focusedElement || m_didPostCheckFocusedElementTask) return; postTask(CheckFocusedElementTask::create()); m_didPostCheckFocusedElementTask = true; } Commit Message: Refactoring: Move m_mayDisplaySeamlesslyWithParent down to Document The me...
0
26,708
Analyze the following 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) * load_all_certs_from_file(char *certfile) { STACK_OF(X509_INFO) *sk=NULL; STACK_OF(X509) *stack=NULL, *ret=NULL; BIO *in=NULL; X509_INFO *xi; if(!(stack = sk_X509_new_null())) { php_error_docref(NULL, E_ERROR, "memory allocation failure"); goto end; } if (php_openssl_open_base_...
0
3,244
Analyze the following 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 kvm_vcpu_ioctl_x86_set_debugregs(struct kvm_vcpu *vcpu, struct kvm_debugregs *dbgregs) { if (dbgregs->flags) return -EINVAL; memcpy(vcpu->arch.db, dbgregs->db, sizeof(vcpu->arch.db)); vcpu->arch.dr6 = dbgregs->dr6; kvm_update_dr6(vcpu); vcpu->arch.dr7 = dbgregs->dr7; kvm_update_dr7(vc...
0
3,671
Analyze the following 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 Parcel::Blob::clear() { mMapped = false; mData = NULL; mSize = 0; } Commit Message: Disregard alleged binder entities beyond parcel bounds When appending one parcel's contents to another, ignore binder objects within the source Parcel that appear to lie beyond the formal bounds of that Parcel's...
0
24,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 __perf_event__output_id_sample(struct perf_output_handle *handle, struct perf_sample_data *data) { u64 sample_type = data->type; if (sample_type & PERF_SAMPLE_TID) perf_output_put(handle, data->tid_entry); if (sample_type & PERF_SAMPLE_TIME) perf_output_put(handle, data->time); if (...
0
8,357
Analyze the following 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 orinoco_ioctl_getrid(struct net_device *dev, struct iw_request_info *info, struct iw_point *data, char *extra) { struct orinoco_private *priv = ndev_priv(dev); hermes_t *hw = &priv->hw; int rid = data->flags; u16 length; int err; unsigned long flags; /* It's a "get" function, but we...
0
9,026
Analyze the following 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 addrconf_add_mroute(struct net_device *dev) { struct fib6_config cfg = { .fc_table = RT6_TABLE_LOCAL, .fc_metric = IP6_RT_PRIO_ADDRCONF, .fc_ifindex = dev->ifindex, .fc_dst_len = 8, .fc_flags = RTF_UP, .fc_nlinfo.nl_net = dev_net(dev), }; ipv6_addr_set(&cfg.fc_dst, htonl(0xFF000000), 0...
0
21,804
Analyze the following 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 Block* BlockGroup::GetBlock() const { return &m_block; } Commit Message: libwebm: Pull from upstream Rolling mkvparser from upstream. Primarily for fixing a bug on parsing failures with certain Opus WebM files. Upstream commit hash of this pull: 574045edd4ecbeb802ee3f1d214b5510269852ae The diff is s...
1
807
Analyze the following 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 SoundPool::play(int sampleID, float leftVolume, float rightVolume, int priority, int loop, float rate) { ALOGV("play sampleID=%d, leftVolume=%f, rightVolume=%f, priority=%d, loop=%d, rate=%f", sampleID, leftVolume, rightVolume, priority, loop, rate); sp<Sample> sample; SoundChann...
1
18,533
Analyze the following 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_set_sCAL_s(png_structp png_ptr, png_infop info_ptr, int unit, png_charp swidth, png_charp sheight) { png_uint_32 length; png_debug1(1, "in %s storage function", "sCAL"); if (png_ptr == NULL || info_ptr == NULL) return; info_ptr->scal_unit = (png_byte)unit; length = png_st...
0
23,500
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ZEND_API int add_index_double(zval *arg, ulong index, double d) /* {{{ */ { zval *tmp; MAKE_STD_ZVAL(tmp); ZVAL_DOUBLE(tmp, d); return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL); } /* }}} */ Commit Message: CWE ID: CWE-416
0
8,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: MockMojoVideoCaptureHost() : released_buffer_count_(0) { ON_CALL(*this, GetDeviceSupportedFormatsMock(_, _, _)) .WillByDefault(WithArgs<2>(Invoke(RunEmptyFormatsCallback))); ON_CALL(*this, GetDeviceFormatsInUseMock(_, _, _)) .WillByDefault(WithArgs<2>(Invoke(RunEmptyFormatsCallback))); ...
0
27,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 usbnet_link_change(struct usbnet *dev, bool link, bool need_reset) { /* update link after link is reseted */ if (link && !need_reset) netif_carrier_on(dev->net); else netif_carrier_off(dev->net); if (need_reset && link) usbnet_defer_kevent(dev, EVENT_LINK_RESET); else usbnet_defer_kevent(dev, E...
0
22,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: on_pb(PG_FUNCTION_ARGS) { Point *pt = PG_GETARG_POINT_P(0); BOX *box = PG_GETARG_BOX_P(1); PG_RETURN_BOOL(pt->x <= box->high.x && pt->x >= box->low.x && pt->y <= box->high.y && pt->y >= box->low.y); } Commit Message: Predict integer overflow to avoid buffer overruns. Several functions, mostly ...
0
20,912
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: DevToolsAgentHostImpl::DevToolsAgentHostImpl(const std::string& id) : id_(id) { DCHECK_CURRENTLY_ON(BrowserThread::UI); } Commit Message: [DevTools] Do not allow chrome.debugger to attach to web ui pages If the page navigates to web ui, we force detach the debugger extension. TBR=alexclarke@chromium.org Bug...
0
27,548