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 sctp_setsockopt_initmsg(struct sock *sk, char __user *optval, unsigned int optlen) { struct sctp_initmsg sinit; struct sctp_sock *sp = sctp_sk(sk); if (optlen != sizeof(struct sctp_initmsg)) return -EINVAL; if (copy_from_user(&sinit, optval, optlen)) return -EFAULT; if (sinit.sinit_num_ostre...
0
9,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: ShouldIgnoreFeatureUsageEvent() { if (!writer_) return true; if (TabLoadTracker::Get()->GetLoadingState(web_contents()) != LoadingState::LOADED) { return true; } return false; } Commit Message: Connect the LocalDB to TabManager. Bug: 773382 Change-Id: Iec8fe5226ee175105d51f300f30b486...
0
18,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: void *Type_LUT8_Read(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, cmsUInt32Number* nItems, cmsUInt32Number SizeOfTag) { cmsUInt8Number InputChannels, OutputChannels, CLUTpoints; cmsUInt8Number* Temp = NULL; cmsPipeline* NewLUT = NULL; cmsUInt32Number nTabSize, i; cmsFloat64Number Ma...
0
5,899
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: vips_foreign_load_gif_buffer_open( VipsForeignLoadGif *gif ) { VipsForeignLoadGifBuffer *buffer = (VipsForeignLoadGifBuffer *) gif; vips_foreign_load_gif_close( gif ); buffer->p = buffer->buf->data; buffer->bytes_to_go = buffer->buf->length; gif->read_func = vips_giflib_buffer_read;; return( VIPS_FOREIGN_...
0
3,777
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int php_stream_memory_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC) /* {{{ */ { php_stream_memory_data *ms = (php_stream_memory_data*)stream->abstract; size_t newsize; switch(option) { case PHP_STREAM_OPTION_TRUNCATE_API: ...
1
5,065
Analyze the following 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_memslots(struct kvm_memslots *slots, struct kvm_memory_slot *new) { int id = new->id; int i = slots->id_to_index[id]; struct kvm_memory_slot *mslots = slots->memslots; WARN_ON(mslots[i].id != id); if (!new->npages) { WARN_ON(!mslots[i].npages); if (mslots[i].npages) slots->u...
0
4,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: void QQuickWebView::dropEvent(QDropEvent* event) { Q_D(QQuickWebView); d->pageView->eventHandler()->handleDropEvent(event); } Commit Message: [Qt][WK2] Allow transparent WebViews https://bugs.webkit.org/show_bug.cgi?id=80608 Reviewed by Tor Arne Vestbø. Added support for transparentBackground in QQuick...
0
8,589
Analyze the following 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 uint32_t ne2000_mem_readw(NE2000State *s, uint32_t addr) { addr &= ~1; /* XXX: check exact behaviour if not even */ if (addr < 32 || (addr >= NE2000_PMEM_START && addr < NE2000_MEM_SIZE)) { return le16_to_cpu(*(uint16_t *)(s->mem + addr)); } else { return 0xffff; ...
0
27,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: const char* ContentSecurityPolicy::GetDirectiveName(const DirectiveType& type) { switch (type) { case DirectiveType::kBaseURI: return "base-uri"; case DirectiveType::kBlockAllMixedContent: return "block-all-mixed-content"; case DirectiveType::kChildSrc: return "child-src"; case...
0
5,326
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: long arch_ptrace(struct task_struct *child, long request, unsigned long addr, unsigned long data) { int ret = -EPERM; void __user *datap = (void __user *) data; switch (request) { case PTRACE_PEEKTEXT: /* read word at location addr. */ case PTRACE_PEEKDATA: ret = generic_ptrace_peekdata(child, addr, da...
0
7,631
Analyze the following 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_send_client_verify(SSL *s) { unsigned char *p,*d; unsigned char data[MD5_DIGEST_LENGTH+SHA_DIGEST_LENGTH]; EVP_PKEY *pkey; EVP_PKEY_CTX *pctx=NULL; EVP_MD_CTX mctx; unsigned u=0; unsigned long n; int j; EVP_MD_CTX_init(&mctx); if (s->state == SSL3_ST_CW_CERT_VRFY_A) { d=(unsigned char *)...
0
19,686
Analyze the following 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 AddPageToHistory(const GURL& url, const base::string16& title, const history::RedirectList& redirects, base::Time time) { history_service()->AddPage( url, time, reinterpret_cast<ContextID>(1), 0, GURL(), redirects, ...
0
8,475
Analyze the following 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 ClipboardMessageFilter::OnMessageReceived(const IPC::Message& message, bool* message_was_ok) { bool handled = true; IPC_BEGIN_MESSAGE_MAP_EX(ClipboardMessageFilter, message, *message_was_ok) IPC_MESSAGE_HANDLER(ClipboardHostMsg_WriteObjectsAsync, OnWrite...
0
13,339
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Document& Document::topDocument() const { Document* doc = const_cast<Document*>(this); for (HTMLFrameOwnerElement* element = doc->ownerElement(); element; element = doc->ownerElement()) doc = &element->document(); ASSERT(doc); return *doc; } Commit Message: Change Document::detach() to R...
0
5,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: NPObjectAccessorWithIdentifier::NPObjectAccessorWithIdentifier( NPObject* object, NPIdentifier identifier, bool allow_integer_identifier) : object_(PluginObject::FromNPObject(object)), identifier_(PP_MakeUndefined()) { if (object_) { identifier_ = Var::NPIdentifierToPPVar(object_->inst...
0
25,253
Analyze the following 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_CEILING( INS_ARG ) { DO_CEILING } Commit Message: CWE ID: CWE-119
0
3,642
Analyze the following 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 merge_all_config(GF_AVCConfig *avc_cfg, GF_HEVCConfig *hevc_cfg, GF_MediaBox *mdia) { u32 i; GF_TrackReferenceTypeBox *scal = NULL; Track_FindRef(mdia->mediaTrack, GF_ISOM_REF_SCAL, &scal); if (!scal) return; for (i=0; i<scal->trackIDCount; i++) { GF_TrackBox *a_track = GetTrackbyID(mdia->mediaTrack...
0
11,674
Analyze the following 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 vrend_destroy_streamout_object(struct vrend_streamout_object *obj) { int i; list_del(&obj->head); for (i = 0; i < obj->num_targets; i++) vrend_so_target_reference(&obj->so_targets[i], NULL); if (vrend_state.have_tf2) glDeleteTransformFeedbacks(1, &obj->id); FREE(obj); } Com...
0
15,835
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: DefaultWebClientState GetDefaultWebClientStateFromShellUtilDefaultState( ShellUtil::DefaultState default_state) { switch (default_state) { case ShellUtil::UNKNOWN_DEFAULT: return DefaultWebClientState::UNKNOWN_DEFAULT; case ShellUtil::NOT_DEFAULT: return DefaultWebClientState::NOT_DEFAUL...
0
12,369
Analyze the following 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 perf_event_task_disable(void) { struct perf_event *event; mutex_lock(&current->perf_event_mutex); list_for_each_entry(event, &current->perf_event_list, owner_entry) perf_event_for_each_child(event, perf_event_disable); mutex_unlock(&current->perf_event_mutex); return 0; } Commit Message: perf: Remov...
0
13,543
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: deleteFiles() { Buffer *buf; char *f; for (CurrentTab = FirstTab; CurrentTab; CurrentTab = CurrentTab->nextTab) { while (Firstbuf && Firstbuf != NO_BUFFER) { buf = Firstbuf->nextBuffer; discardBuffer(Firstbuf); Firstbuf = buf; } } while ((f = popText(fileToDelete)) != NULL) {...
0
1,935
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: isofile_add_data_file(struct iso9660 *iso9660, struct isofile *file) { file->datanext = NULL; *iso9660->data_file_list.last = file; iso9660->data_file_list.last = &(file->datanext); } Commit Message: Issue 711: Be more careful about verifying filename lengths when writing ISO9660 archives * Don't cast size_...
0
4,970
Analyze the following 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 RenderFlexibleBox::flowAwarePaddingAfter() const { switch (transformedWritingMode()) { case TopToBottomWritingMode: return paddingBottom(); case BottomToTopWritingMode: return paddingTop(); case LeftToRightWritingMode: return paddingRight(); case RightToLeftW...
0
28,972
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int fb_get_fscreeninfo(struct fb_info *info, unsigned int cmd, unsigned long arg) { mm_segment_t old_fs; struct fb_fix_screeninfo fix; struct fb_fix_screeninfo32 __user *fix32; int err; fix32 = compat_ptr(arg); old_fs = get_fs(); set_fs(KERNEL_DS); err = do_fb_ioctl(info, cmd, (unsigned ...
0
11,005
Analyze the following 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 nfsd4_session_too_many_ops(struct svc_rqst *rqstp, struct nfsd4_session *session) { struct nfsd4_compoundargs *args = rqstp->rq_argp; return args->opcnt > session->se_fchannel.maxops; } Commit Message: Merge tag 'nfsd-4.12' of git://linux-nfs.org/~bfields/linux Pull nfsd updates from Bruce Fields...
0
19,205
Analyze the following 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 BN_ucmp(const BIGNUM *a, const BIGNUM *b) { int i; BN_ULONG t1,t2,*ap,*bp; bn_check_top(a); bn_check_top(b); i=a->top-b->top; if (i != 0) return(i); ap=a->d; bp=b->d; for (i=a->top-1; i>=0; i--) { t1= ap[i]; t2= bp[i]; if (t1 != t2) return((t1 > t2) ? 1 : -1); } return(0); } Commit...
0
26,191
Analyze the following 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 TIFFSetProfiles(TIFF *tiff,Image *image) { const char *name; const StringInfo *profile; if (image->profiles == (void *) NULL) return; ResetImageProfileIterator(image); for (name=GetNextImageProfile(image); name != (const char *) NULL; ) { profile=GetImageProfile(image,nam...
0
15,506
Analyze the following 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 V8InjectedScriptHost::getInternalPropertiesCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { if (info.Length() < 1) return; v8::Local<v8::Array> properties; if (unwrapInspector(info)->debugger()->internalProperties(info.GetIsolate()->GetCurrentContext(), info[0]).ToLocal(&proper...
0
16,456
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: BlackBerry::Platform::String WebPage::selectedText() const { return d->m_selectionHandler->selectedText(); } Commit Message: [BlackBerry] Adapt to new BlackBerry::Platform::TouchPoint API https://bugs.webkit.org/show_bug.cgi?id=105143 RIM PR 171941 Reviewed by Rob Buis. Internally reviewed by George Staikos...
0
28,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: _tiffUnmapProc(thandle_t fd, void* base, toff_t size) { (void) fd; (void) size; UnmapViewOfFile(base); } Commit Message: * libtiff/tif_{unix,vms,win32}.c (_TIFFmalloc): ANSI C does not require malloc() to return NULL pointer if requested allocation size is zero. Assure that _TIFFmalloc does. CWE ID: CWE-369
0
13,403
Analyze the following 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 __used unaligned_panic(char *str, struct pt_regs *regs) { die_if_kernel(str, regs); } 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 ...
0
1,541
Analyze the following 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 RenderThread::OnSetZoomLevelForCurrentURL(const GURL& url, double zoom_level) { RenderViewZoomer zoomer(url, zoom_level); RenderView::ForEach(&zoomer); } Commit Message: DevTools: move DevToolsAgent/Client into content. BUG=84078 TEST= Review URL: http://...
0
17,595
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GF_Box *rssr_New() { ISOM_DECL_BOX_ALLOC(GF_ReceivedSsrcBox, GF_ISOM_BOX_TYPE_RSSR); return (GF_Box *)tmp; } Commit Message: fixed 2 possible heap overflows (inc. #1088) CWE ID: CWE-125
0
23,474
Analyze the following 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 WebPluginAcceleratedSurfaceProxy::StartDrawing() { if (!surface_) return; surface_->MakeCurrent(); surface_->Clear(gfx::Rect(surface_->GetSize())); } Commit Message: iwyu: Include callback_old.h where appropriate, final. BUG=82098 TEST=none Review URL: http://codereview.chromium.org/7003003 gi...
0
23,301
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void ContainerNode::appendChildCommon(Node& child) { child.setParentOrShadowHostNode(this); if (m_lastChild) { child.setPreviousSibling(m_lastChild); m_lastChild->setNextSibling(&child); } else { setFirstChild(&child); } setLastChild(&child); } Commit Message: Fix an...
0
4,335
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GF_Err pasp_Write(GF_Box *s, GF_BitStream *bs) { GF_PixelAspectRatioBox *ptr = (GF_PixelAspectRatioBox *)s; GF_Err e = gf_isom_box_write_header(s, bs); if (e) return e; gf_bs_write_u32(bs, ptr->hSpacing); gf_bs_write_u32(bs, ptr->vSpacing); return GF_OK; } Commit Message: fixed 2 possible heap overflows (i...
0
25,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 sdtp_del(GF_Box *s) { GF_SampleDependencyTypeBox *ptr = (GF_SampleDependencyTypeBox*)s; if (ptr == NULL) return; if (ptr->sample_info) gf_free(ptr->sample_info); gf_free(ptr); } Commit Message: fixed 2 possible heap overflows (inc. #1088) CWE ID: CWE-125
0
25,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 inline struct page *alloc_hugepage(int defrag) { return alloc_pages(alloc_hugepage_gfpmask(defrag, 0), HPAGE_PMD_ORDER); } Commit Message: mm: thp: fix /dev/zero MAP_PRIVATE and vm_flags cleanups The huge_memory.c THP page fault was allowed to run if vm_ops was null (which would succeed for /dev/z...
0
11,843
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void imap_allow_reopen(struct Context *ctx) { struct ImapData *idata = NULL; if (!ctx || !ctx->data || ctx->magic != MUTT_IMAP) return; idata = ctx->data; if (idata->ctx == ctx) idata->reopen |= IMAP_REOPEN_ALLOW; } Commit Message: quote imap strings more carefully Co-authored-by: JerikoOne <je...
0
10,992
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: json_lex(JsonLexContext *lex) { char *s; int len; /* Skip leading whitespace. */ s = lex->token_terminator; len = s - lex->input; while (len < lex->input_length && (*s == ' ' || *s == '\t' || *s == '\n' || *s == '\r')) { if (*s == '\n') ++lex->line_number; ++s; ++len; } lex->token_sta...
0
29,016
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int __init crypto_authenc_module_init(void) { return crypto_register_template(&crypto_authenc_tmpl); } Commit Message: crypto: include crypto- module prefix in template This adds the module loading prefix "crypto-" to the template lookup as well. For example, attempting to load 'vfat(blowfish)' via AF_...
0
27,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: static TEE_Result set_rmem_param(const struct optee_msg_param_rmem *rmem, struct param_mem *mem) { uint64_t shm_ref = READ_ONCE(rmem->shm_ref); mem->mobj = mobj_reg_shm_get_by_cookie(shm_ref); if (!mem->mobj) return TEE_ERROR_BAD_PARAMETERS; mem->offs = READ_ONCE(rmem->offs); mem->size = REA...
1
8,618
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void list_modules(GF_ModuleManager *modules) { u32 i; fprintf(stderr, "\rAvailable modules:\n"); for (i=0; i<gf_modules_get_count(modules); i++) { char *str = (char *) gf_modules_get_file_name(modules, i); if (str) fprintf(stderr, "\t%s\n", str); } fprintf(stderr, "\n"); } Commit Message: add some bound...
0
3,407
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void stroke_terminate_srcip(private_stroke_socket_t *this, stroke_msg_t *msg, FILE *out) { pop_string(msg, &msg->terminate_srcip.start); pop_string(msg, &msg->terminate_srcip.end); DBG1(DBG_CFG, "received stroke: terminate-srcip %s-%s", msg->terminate_srcip.start, msg->terminate_srcip.end)...
0
11,373
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xfs_icache_inode_is_allocated( struct xfs_mount *mp, struct xfs_trans *tp, xfs_ino_t ino, bool *inuse) { struct xfs_inode *ip; int error; error = xfs_iget(mp, tp, ino, XFS_IGET_INCORE, 0, &ip); if (error) return error; *inuse = !!(VFS_I(ip)->i_mode); IRELE(ip); return 0; } Commit Message: xfs...
0
13,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: static size_t TracePath(PrimitiveInfo *primitive_info,const char *path) { char token[MagickPathExtent]; const char *p; int attribute, last_attribute; double x, y; PointInfo end = {0.0, 0.0}, points[4] = { {0.0,0.0}, {0.0,0.0}, {0.0,0.0}, {0.0,0.0} }, point = {0.0,...
0
12,269
Analyze the following 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 InputHandler::PointIsWithinContents(gfx::PointF point) const { gfx::Rect bounds = host_->GetView()->GetViewBounds(); bounds -= bounds.OffsetFromOrigin(); // Translate the bounds to (0,0). return bounds.Contains(point.x(), point.y()); } Commit Message: DevTools: speculative fix for crash in NetworkHan...
0
2,911
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static MagickBooleanType WriteGROUP4Image(const ImageInfo *image_info, Image *image) { char filename[MaxTextExtent]; FILE *file; Image *huffman_image; ImageInfo *write_info; int unique_file; MagickBooleanType status; register ssize_t i; ssize_t count; TI...
1
28,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 *rds_ib_wc_status_str(enum ib_wc_status status) { return rds_str_array(rds_ib_wc_status_strings, ARRAY_SIZE(rds_ib_wc_status_strings), status); } Commit Message: rds: prevent BUG_ON triggering on congestion map updates Recently had this bug halt reported to me: kernel BUG at net/rds/send.c:329! O...
0
24,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: dotraplinkage void do_coprocessor_error(struct pt_regs *regs, long error_code) { enum ctx_state prev_state; prev_state = exception_enter(); math_error(regs, error_code, X86_TRAP_MF); exception_exit(prev_state); } Commit Message: x86_64, traps: Stop using IST for #SS On a 32-bit kernel, this has no effect, ...
0
15,441
Analyze the following 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 hugepage_subpool *hugepage_new_subpool(struct hstate *h, long max_hpages, long min_hpages) { struct hugepage_subpool *spool; spool = kzalloc(sizeof(*spool), GFP_KERNEL); if (!spool) return NULL; spin_lock_init(&spool->lock); spool->count = 1; spool->max_hpages = max_hpages; spool->hstate =...
0
13,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: SkColor WebContentsImpl::GetThemeColor() const { return theme_color_; } Commit Message: Don't call WebContents::DownloadImage() callback if the WebContents were deleted BUG=583718 Review URL: https://codereview.chromium.org/1685343004 Cr-Commit-Position: refs/heads/master@{#375700} CWE ID:
0
12,253
Analyze the following 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_FUNCTION(imagecreatefromwebp) { _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_WEBP, "WEBP", gdImageCreateFromWebp, gdImageCreateFromWebpCtx); } Commit Message: Fixed bug #66356 (Heap Overflow Vulnerability in imagecrop()) And also fixed the bug: arguments are altered after some ca...
0
2,175
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Parcel::Blob::Blob() : 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 data buffer...
0
7,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: static int apply_to_pud_range(struct mm_struct *mm, pgd_t *pgd, unsigned long addr, unsigned long end, pte_fn_t fn, void *data) { pud_t *pud; unsigned long next; int err; pud = pud_alloc(mm, pgd, addr); if (!pud) return -ENOMEM; do { next = pud_addr_end(addr, end); err = apply_to_pm...
0
18,193
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: rad_create_request(struct rad_handle *h, int code) { int i; h->request[POS_CODE] = code; h->request[POS_IDENT] = ++h->ident; /* Create a random authenticator */ for (i = 0; i < LEN_AUTH; i += 2) { long r; TSRMLS_FETCH(); r = php_rand(TSRMLS_C); h->request[POS_AUTH+i] = (unsigned char) r; h->requ...
0
26,748
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int nfs4_proc_bind_conn_to_session(struct nfs_client *clp, struct rpc_cred *cred) { int status; struct nfs41_bind_conn_to_session_args args = { .client = clp, .dir = NFS4_CDFC4_FORE_OR_BOTH, }; struct nfs41_bind_conn_to_session_res res; struct rpc_message msg = { .rpc_proc = &nfs4_procedures[NFSPROC...
0
2,745
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int_unix_date(uint32_t dos_date) { struct tm t; if (dos_date == 0) return(0); interpret_dos_date(dos_date, &t); t.tm_wday = 1; t.tm_yday = 1; t.tm_isdst = 0; return (mktime(&t)); } Commit Message: CVE-2017-12893/SMB/CIFS: Add a bounds check in name_len(). After we advance the poi...
0
18,023
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: EncodedJSValue JSC_HOST_CALL JSSharedWorkerConstructor::constructJSSharedWorker(ExecState* exec) { JSSharedWorkerConstructor* jsConstructor = jsCast<JSSharedWorkerConstructor*>(exec->callee()); if (exec->argumentCount() < 1) return throwVMError(exec, createTypeError(exec, "Not enough arguments...
1
10,001
Analyze the following 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 hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size) { hid->dev_rdesc = kmemdup(start, size, GFP_KERNEL); if (!hid->dev_rdesc) return -ENOMEM; hid->dev_rsize = size; return 0; } Commit Message: HID: core: prevent out-of-bound readings Plugging a Logitech DJ receiver with KASAN activate...
0
17,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: bool EditorClientBlackBerry::isGrammarCheckingEnabled() { notImplemented(); return false; } Commit Message: [BlackBerry] Prevent text selection inside Colour and Date/Time input fields https://bugs.webkit.org/show_bug.cgi?id=111733 Reviewed by Rob Buis. PR 305194. Prevent selection for popup input fie...
0
11,524
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: _dbus_header_delete_field (DBusHeader *header, int field) { DBusTypeReader reader; DBusTypeReader realign_root; if (_dbus_header_cache_known_nonexistent (header, field)) return TRUE; /* nothing to do */ /* Scan to the field we want, delete and realign, reappend ...
0
16,818
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MagickExport MagickBooleanType ClipImage(Image *image,ExceptionInfo *exception) { return(ClipImagePath(image,"#1",MagickTrue,exception)); } Commit Message: Set pixel cache to undefined if any resource limit is exceeded CWE ID: CWE-119
0
27,319
Analyze the following 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 f2fs_submit_page_mbio(struct f2fs_io_info *fio) { struct f2fs_sb_info *sbi = fio->sbi; enum page_type btype = PAGE_TYPE_OF_BIO(fio->type); struct f2fs_bio_info *io; bool is_read = is_read_io(fio->op); struct page *bio_page; int err = 0; io = is_read ? &sbi->read_io : &sbi->write_io[btype]; if (fio->...
0
17,805
Analyze the following 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::prepareForDestruction() { disconnectDescendantFrames(); if (DOMWindow* window = this->domWindow()) window->willDetachDocumentFromFrame(); detach(); } Commit Message: Unreviewed, rolling out r147402. http://trac.webkit.org/changeset/147402 https://bugs.webkit.org/show_bug.cgi?id...
0
19,831
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: process_colcache(STREAM s) { COLOURENTRY *entry; COLOURMAP map; RD_HCOLOURMAP hmap; uint8 cache_id; int i; in_uint8(s, cache_id); in_uint16_le(s, map.ncolours); map.colours = (COLOURENTRY *) xmalloc(sizeof(COLOURENTRY) * map.ncolours); for (i = 0; i < map.ncolours; i++) { entry = &map.colours[i]; ...
0
11,905
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: get_link_name (const char *name, int count, int max_length) { const char *format; char *result; int unshortened_length; gboolean use_count; g_assert (name != NULL); if (count < 0) { g_warning ("bad count in get_link_name"); ...
0
6,678
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int cm_init_qp_rts_attr(struct cm_id_private *cm_id_priv, struct ib_qp_attr *qp_attr, int *qp_attr_mask) { unsigned long flags; int ret; spin_lock_irqsave(&cm_id_priv->lock, flags); switch (cm_id_priv->id.state) { /* Allow transition to RTS before sending REP */ case IB_CM_REQ_RC...
0
5,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: static inline void xts_round(struct sinfo *s, void *dst, const void *src) { be128_xor(dst, s->t, src); /* PP <- T xor P */ s->fn(s->tfm, dst, dst); /* CC <- E(Key1,PP) */ be128_xor(dst, dst, s->t); /* C <- T xor CC */ } Commit Message: crypto: include crypto- module prefix in template This adds the module...
0
27,091
Analyze the following 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 compat_get_timeval(struct timeval *tv, const void __user *utv) { if (COMPAT_USE_64BIT_TIME) return copy_from_user(tv, utv, sizeof(*tv)) ? -EFAULT : 0; else return __compat_get_timeval(tv, utv); } Commit Message: compat: fix 4-byte infoleak via uninitialized struct field Commit 3a4d44b61625 ("ntp: Move...
0
21,366
Analyze the following 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::WebContentsTreeNode::OnFrameTreeNodeDestroyed( FrameTreeNode* node) { DCHECK_EQ(outer_contents_frame_tree_node_id_, node->frame_tree_node_id()) << "WebContentsTreeNode should only receive notifications for the " "FrameTreeNode in its outer WebContents that hosts it."; ...
0
28,625
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: tsize_t t2p_write_pdf_catalog(T2P* t2p, TIFF* output) { tsize_t written = 0; char buffer[32]; int buflen = 0; written += t2pWriteFile(output, (tdata_t)"<< \n/Type /Catalog \n/Pages ", 27); buflen = snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_pages); check_snprintf_ret(t2p, buflen,...
0
5,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 int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb, struct frag_hdr *fhdr, int nhoff) { struct sk_buff *prev, *next; struct net_device *dev; int offset, end; struct net *net = dev_net(skb_dst(skb)->dev); if (fq->q.last_in & INET_FRAG_COMPLETE) goto err; offset = ntohs(fhdr->frag_...
1
22,963
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int cac_match_card(sc_card_t *card) { int r; SC_FUNC_CALLED(card->ctx, SC_LOG_DEBUG_VERBOSE); /* Since we send an APDU, the card's logout function may be called... * however it may be in dirty memory */ card->ops->logout = NULL; r = cac_find_and_initialize(card, 0); return (r == SC_SUCCESS); /* ne...
0
11,952
Analyze the following 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 IsUninitializedMemory(void* object_pointer, size_t object_size) { Address* object_fields = reinterpret_cast<Address*>(object_pointer); for (size_t i = 0; i < object_size / sizeof(Address); ++i) { if (object_fields[i]) return false; } return true; } Commit Message: [oilpan] Fix GCInfoTable ...
0
9,528
Analyze the following 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 print_ls(int mode, const unsigned char *sha1, const char *path) { static struct strbuf line = STRBUF_INIT; /* See show_tree(). */ const char *type = S_ISGITLINK(mode) ? commit_type : S_ISDIR(mode) ? tree_type : blob_type; if (!mode) { /* missing SP path LF */ strbuf_reset(&line); str...
0
2,274
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void CreateTextFile(const FilePath& filename, const std::wstring& contents) { std::wofstream file; file.open(filename.value().c_str()); ASSERT_TRUE(file.is_open()); file << contents; file.close(); } Commit Message: Fix creating target paths in file_util_posix CopyDirectory. BUG=167...
0
20,592
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: entry_guard_has_higher_priority(entry_guard_t *a, entry_guard_t *b) { tor_assert(a && b); if (a == b) return 0; /* Confirmed is always better than unconfirmed; lower index better than higher */ if (a->confirmed_idx < 0) { if (b->confirmed_idx >= 0) return 0; } else { if (b->confi...
0
25,485
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static long macvtap_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { return macvtap_ioctl(file, cmd, (unsigned long)compat_ptr(arg)); } Commit Message: macvtap: zerocopy: validate vectors before building skb There're several reasons that the vectors need to be validated: - Return er...
0
19,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: void Document::close() { if (!scriptableDocumentParser() || !scriptableDocumentParser()->wasCreatedByScript() || !scriptableDocumentParser()->isParsing()) return; explicitClose(); } Commit Message: Don't change Document load progress in any page dismissal events. This can confuse the logic for ...
0
4,124
Analyze the following 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 hfsplus_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) { return hfsplus_mknod(dir, dentry, mode | S_IFDIR, 0); } Commit Message: hfsplus: Fix potential buffer overflows Commit ec81aecb2966 ("hfs: fix a potential buffer overflow") fixed a few potential buffer overflows in the hfs files...
0
21,206
Analyze the following 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 v9fs_xattr_fid_clunk(V9fsPDU *pdu, V9fsFidState *fidp) { int retval = 0; if (fidp->fs.xattr.copied_len == -1) { /* getxattr/listxattr fid */ goto free_value; } /* * if this is fid for setxattr. clunk should * result in setxattr localcall */ if (fidp->...
0
21,161
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: size_t utf8_to_utf32_length(const char *src, size_t src_len) { if (src == NULL || src_len == 0) { return 0; } size_t ret = 0; const char* cur; const char* end; size_t num_to_skip; for (cur = src, end = src + src_len, num_to_skip = 1; cur < end; cur += num_to_skip, ret++) { const char fi...
0
23,777
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: status_t CameraService::removeListener( const sp<ICameraServiceListener>& listener) { ALOGV("%s: Remove listener %p", __FUNCTION__, listener.get()); if (listener == 0) { ALOGE("%s: Listener must not be null", __FUNCTION__); return BAD_VALUE; } Mutex::Autolock lock(mServiceLock); Vector<sp<ICa...
0
5,384
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: main (int argc, char *argv[]) { Object info; GBool ok; int exitCode; exitCode = 99; ok = parseArgs (argDesc, &argc, argv); if (!ok || argc != 3 || printVersion || printHelp) { fprintf (stderr, "pdfseparate version %s\n", PACKAGE_VERSION); fprintf (stderr, "%s\n", popplerCopyright); ...
0
13,431
Analyze the following 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 Downmix_foldGeneric( uint32_t mask, int16_t *pSrc, int16_t*pDst, size_t numFrames, bool accumulate) { if (mask & kUnsupported) { ALOGE("Unsupported channels (top or front left/right of center)"); return false; } if ((mask & AUDIO_CHANNEL_OUT_STEREO) != AUDIO_CHANNEL_OUT_STEREO) { ALOGE("...
0
13,247
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: process_mux_close_fwd(u_int rid, Channel *c, Buffer *m, Buffer *r) { struct Forward fwd, *found_fwd; char *fwd_desc = NULL; const char *error_reason = NULL; char *listen_addr = NULL, *connect_addr = NULL; u_int ftype; int i, ret = 0; u_int lport, cport; memset(&fwd, 0, sizeof(fwd)); if (buffer_get_int_...
0
23,805
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: pdf_array_push_drop(fz_context *ctx, pdf_obj *obj, pdf_obj *item) { RESOLVE(obj); if (obj >= PDF_OBJ__LIMIT) { fz_try(ctx) pdf_array_push(ctx, obj, item); fz_always(ctx) pdf_drop_obj(ctx, item); fz_catch(ctx) fz_rethrow(ctx); } } Commit Message: CWE ID: CWE-416
0
27,330
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: RelayEnsureFileExists( scoped_refptr<base::MessageLoopProxy> message_loop_proxy, const FilePath& file_path, base::FileUtilProxy::EnsureFileExistsCallback* callback) : message_loop_proxy_(message_loop_proxy), file_path_(file_path), callback_(callback), created_(fal...
0
14,184
Analyze the following 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 ExtensionList* ExtensionService::disabled_extensions() const { return &disabled_extensions_; } Commit Message: Limit extent of webstore app to just chrome.google.com/webstore. BUG=93497 TEST=Try installing extensions and apps from the webstore, starting both being initially logged in, and not. Review ...
0
3,138
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool GLES2Implementation::GetProgramResourceivHelper(GLuint program, GLenum program_interface, GLuint index, GLsizei prop_count, ...
0
14,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: flatpak_proxy_add_wildcarded_policy (FlatpakProxy *proxy, const char *name, FlatpakPolicy policy) { g_hash_table_replace (proxy->wildcard_policy, g_strdup (name), GINT_TO_POINTER (policy)); } Commit Message: Fix vulnerability in dbus p...
0
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 enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedSrational(TIFF* tif, TIFFDirEntry* direntry, double* value) { UInt64Aligned_t m; assert(sizeof(double)==8); assert(sizeof(uint64)==8); assert(sizeof(int32)==4); assert(sizeof(uint32)==4); if (!(tif->tif_flags&TIFF_BIGTIFF)) { enum TIFFReadDirEntryErr...
0
665
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: XML_SetStartElementHandler(XML_Parser parser, XML_StartElementHandler start) { if (parser != NULL) parser->m_startElementHandler = start; } Commit Message: xmlparse.c: Fix extraction of namespace prefix from XML name (#186) CWE ID: CWE-611
0
29,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: bool Instance::IsOverlayScrollbar() { return GetScrollbarReservedThickness() == 0; } Commit Message: Let PDFium handle event when there is not yet a visible page. Speculative fix for 415307. CF will confirm. The stack trace for that bug indicates an attempt to index by -1, which is consistent with no visible ...
0
20,133
Analyze the following 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 i2d_ECParameters(EC_KEY *a, unsigned char **out) { if (a == NULL) { ECerr(EC_F_I2D_ECPARAMETERS, ERR_R_PASSED_NULL_PARAMETER); return 0; } return i2d_ECPKParameters(a->group, out); } Commit Message: CWE ID:
0
17,954
Analyze the following 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 RenderWidgetHostViewAura::ExtendSelectionAndDelete( size_t before, size_t after) { NOTIMPLEMENTED(); } 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 co...
0
23,337
Analyze the following 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::uniform4uiv( const WebGLUniformLocation* location, const FlexibleUint32ArrayView& v, GLuint src_offset, GLuint src_length) { if (isContextLost() || !ValidateUniformParameters<WTF::Uint32Array>("uniform4uiv", location, v, ...
0
20,283
Analyze the following 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 DTLS_RECORD_LAYER_clear(RECORD_LAYER *rl) { DTLS_RECORD_LAYER *d; pitem *item = NULL; DTLS1_RECORD_DATA *rdata; pqueue *unprocessed_rcds; pqueue *processed_rcds; pqueue *buffered_app_data; d = rl->d; while ((item = pqueue_pop(d->unprocessed_rcds.q)) != NULL) { rdata ...
0
21,846
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: align_by_4 (guint32 offset) { return (offset + 4 - 1) & ~(4 - 1); } Commit Message: Fix vulnerability in dbus proxy During the authentication all client data is directly forwarded to the dbus daemon as is, until we detect the BEGIN command after which we start filtering the binary dbus protocol. Unfortunatel...
0
17,330