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: ChromeContentBrowserClient::CreateLoginDelegate( net::AuthChallengeInfo* auth_info, content::ResourceRequestInfo::WebContentsGetter web_contents_getter, const content::GlobalRequestID& request_id, bool is_request_for_main_frame, const GURL& url, scoped_refptr<net::HttpResponseHeaders> resp...
0
15,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: static bool pdptrs_changed(struct kvm_vcpu *vcpu) { u64 pdpte[ARRAY_SIZE(vcpu->arch.walk_mmu->pdptrs)]; bool changed = true; int offset; gfn_t gfn; int r; if (is_long_mode(vcpu) || !is_pae(vcpu)) return false; if (!test_bit(VCPU_EXREG_PDPTR, (unsigned long *)&vcpu->arch.regs_avail)) return tr...
0
13,583
Analyze the following 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 ff_thread_release_buffer(AVCodecContext *avctx, ThreadFrame *f) { if (f->f) av_frame_unref(f->f); } Commit Message: avcodec/utils: correct align value for interplay Fixes out of array access Fixes: 452/fuzz-1-ffmpeg_VIDEO_AV_CODEC_ID_INTERPLAY_VIDEO_fuzzer Found-by: continuous fuzzing process ...
0
12,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: BlackBerry::Platform::String WebPage::renderTreeAsText() { return externalRepresentation(d->m_mainFrame); } 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
2,561
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MagickExport Image *MeanShiftImage(const Image *image,const size_t width, const size_t height,const double color_distance,ExceptionInfo *exception) { #define MaxMeanShiftIterations 100 #define MeanShiftImageTag "MeanShift/Image" CacheView *image_view, *mean_view, *pixel_view; Image *mean...
1
14,726
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: enqueue_waiting_conn(conn c) { tube t; size_t i; global_stat.waiting_ct++; c->type |= CONN_TYPE_WAITING; for (i = 0; i < c->watch.used; i++) { t = c->watch.items[i]; t->stat.waiting_ct++; ms_append(&t->waiting, c); } } Commit Message: Discard job body bytes if the...
0
15,851
Analyze the following 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 StreamTcpSessionPoolCleanup(void *s) { if (s != NULL) { StreamTcpSessionCleanup(s); /** \todo not very clean, as the memory is not freed here */ StreamTcpDecrMemuse((uint64_t)sizeof(TcpSession)); } } Commit Message: stream: support RST getting lost/ignored In case of ...
0
27,887
Analyze the following 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 vfat_fill_super(struct super_block *sb, void *data, int silent) { return fat_fill_super(sb, data, silent, 1, setup); } Commit Message: NLS: improve UTF8 -> UTF16 string conversion routine The utf8s_to_utf16s conversion routine needs to be improved. Unlike its utf16s_to_utf8s sibling, it doesn't acc...
0
11,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: size_t ZSTD_CCtxParams_init_advanced(ZSTD_CCtx_params* cctxParams, ZSTD_parameters params) { if (!cctxParams) { return ERROR(GENERIC); } CHECK_F( ZSTD_checkCParams(params.cParams) ); memset(cctxParams, 0, sizeof(*cctxParams)); cctxParams->cParams = params.cParams; cctxParams->fParams = params....
0
21,318
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: DocumentParser* Document::ImplicitOpen( ParserSynchronizationPolicy parser_sync_policy) { RemoveChildren(); DCHECK(!focused_element_); SetCompatibilityMode(kNoQuirksMode); if (!ThreadedParsingEnabledForTesting()) { parser_sync_policy = kForceSynchronousParsing; } else if (parser_sync_policy ==...
0
25,334
Analyze the following 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 stb_vorbis * vorbis_alloc(stb_vorbis *f) { stb_vorbis *p = (stb_vorbis *) setup_malloc(f, sizeof(*p)); return p; } Commit Message: fix unchecked length in stb_vorbis that could crash on corrupt/invalid files CWE ID: CWE-119
0
14,757
Analyze the following 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 dump_list_l() { struct listnode *node; vol_listener_context_t *context; ALOGW("DUMP_START :: ==========="); list_for_each(node, &vol_effect_list) { context = node_to_item(node, struct vol_listener_context_s, effect_list_node); ALOGW("%s: streamType [%s] Device [%d] state [%...
0
16,320
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static png_uint_32 png_log8bit(unsigned x) { if (x > 0) return (png_uint_32)floor(.5-log(x/255.)*L2INV); return 0xffffffff; } Commit Message: DO NOT MERGE Update libpng to 1.6.20 BUG:23265085 Change-Id: I85199805636d771f3597b691b63bc0bf46084833 (cherry picked from commit bbe98b40cda082024b669fa508931042eed1...
0
3,965
Analyze the following 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 PushMessagingServiceImpl::Shutdown() { GetGCMDriver()->RemoveAppHandler(kPushMessagingAppIdentifierPrefix); HostContentSettingsMapFactory::GetForProfile(profile_)->RemoveObserver(this); } Commit Message: Remove some senseless indirection from the Push API code Four files to call one Java function. Let'...
0
746
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int get_crl_sk(X509_STORE_CTX *ctx, X509_CRL **pcrl, X509_CRL **pdcrl, X509 **pissuer, int *pscore, unsigned int *preasons, STACK_OF(X509_CRL) *crls) { int i, crl_score, best_score = *pscore; unsigned int reasons, best_reasons = 0; X509 *x = ctx->curr...
0
27,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: profCallgraphAdd(xsltTemplatePtr templ, xsltTemplatePtr parent) { int i; if (templ->templMax == 0) { templ->templMax = 4; templ->templCalledTab = (xsltTemplatePtr *) xmlMalloc(templ->templMax * sizeof(templ->templCalledTab[0])); ...
0
995
Analyze the following 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 _setup_step_complete_msg(slurm_msg_t *msg, void *data) { slurm_msg_t_init(msg); msg->msg_type = REQUEST_STEP_COMPLETE; msg->data = data; } Commit Message: Fix security issue in _prolog_error(). Fix security issue caused by insecure file path handling triggered by the failure of a Prolog script. T...
0
19,374
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: vrrp_bfd_thread(thread_t * thread) { bfd_event_t evt; bfd_thread = thread_add_read(master, vrrp_bfd_thread, NULL, thread->u.fd, TIMER_NEVER); if (thread->type != THREAD_READY_FD) return 0; while (read(thread->u.fd, &evt, sizeof(bfd_event_t)) != -1) vrrp_handle_bfd_event(&evt); return 0; } C...
0
6,075
Analyze the following 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 ~OpenChannelToPpapiBrokerCallback() {} Commit Message: Follow-on fixes and naming changes for https://codereview.chromium.org/12086077/ BUG=172573 Review URL: https://codereview.chromium.org/12177018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180600 0039d316-1c4b-4281-b951-d872f2087c98 CWE I...
0
28,487
Analyze the following 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 arcmsr_hbaA_stop_bgrb(struct AdapterControlBlock *acb) { struct MessageUnit_A __iomem *reg = acb->pmuA; acb->acb_flags &= ~ACB_F_MSG_START_BGRB; writel(ARCMSR_INBOUND_MESG0_STOP_BGRB, &reg->inbound_msgaddr0); if (!arcmsr_hbaA_wait_msgint_ready(acb)) { printk(KERN_NOTICE "arcmsr%d: wait 'stop ...
0
6,930
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void xmlwriter_free_resource_ptr(xmlwriter_object *intern TSRMLS_DC) { if (intern) { if (intern->ptr) { xmlFreeTextWriter(intern->ptr); intern->ptr = NULL; } if (intern->output) { xmlBufferFree(intern->output); intern->output = NULL; } efree(intern); } } Commit Message: CWE ID: C...
0
2,546
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ScriptValue WebGL2RenderingContextBase::getFramebufferAttachmentParameter( ScriptState* script_state, GLenum target, GLenum attachment, GLenum pname) { const char kFunctionName[] = "getFramebufferAttachmentParameter"; if (isContextLost() || !ValidateGetFramebufferAttachmentParameterFunc( ...
0
14,035
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Compute_Funcs( EXEC_OP ) { #ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING if ( CUR.face->unpatented_hinting ) { /* If both vectors point rightwards along the x axis, set */ /* `both-x-axis' true, otherwise set it false. The x values only */ /* need be tested because the ...
0
8,149
Analyze the following 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 handle_next_ime_count() const { return handle_next_ime_count_; } Commit Message: accelerators: Remove deprecated Accelerator ctor that takes booleans. BUG=128242 R=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/10399085 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13795...
0
17,240
Analyze the following 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 SkiaOutputSurfaceImpl::BufferPresented( const gfx::PresentationFeedback& feedback) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); DCHECK(client_); client_->DidReceivePresentationFeedback(feedback); if (update_vsync_parameters_callback_ && feedback.flags & gfx::PresentationFeedback::kVSyn...
0
18,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: bool RenderProcessHostImpl::Init() { if (channel_.get()) return true; CommandLine::StringType renderer_prefix; #if defined(OS_POSIX) const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); renderer_prefix = browser_command_line.GetSwitchValueNative(switches::kRendererCmdPre...
0
25,878
Analyze the following 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 vhost_attach_cgroups_work(struct vhost_work *work) { struct vhost_attach_cgroups_struct *s; s = container_of(work, struct vhost_attach_cgroups_struct, work); s->ret = cgroup_attach_task_all(s->owner, current); } Commit Message: vhost: fix length for cross region descriptor If a single descriptor...
0
17,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: void TestTransactionConsumer::OnIOComplete(int result) { switch (state_) { case STARTING: DidStart(result); break; case READING: DidRead(result); break; default: NOTREACHED(); } } Commit Message: Replace fixed string uses of AddHeaderFromString Uses of AddHeaderFrom...
0
13,623
Analyze the following 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 SVGStyleElement::ParseAttribute( const AttributeModificationParams& params) { if (params.name == SVGNames::titleAttr) { if (sheet_ && IsInDocumentTree()) sheet_->SetTitle(params.new_value); return; } SVGElement::ParseAttribute(params); } Commit Message: Do not crash while reentrant...
0
10,325
Analyze the following 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 mptsas_config_manufacturing_3(MPTSASState *s, uint8_t **data, int address) { PCIDeviceClass *pcic = PCI_DEVICE_GET_CLASS(s); return MPTSAS_CONFIG_PACK(3, MPI_CONFIG_PAGETYPE_MANUFACTURING, 0x00, "wb*b*l", pcic->device_id, pcic->revision); ...
0
25,723
Analyze the following 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 ASessionDescription::countTracks() const { return mTracks.size(); } Commit Message: Fix corruption via buffer overflow in mediaserver change unbound sprintf() to snprintf() so network-provided values can't overflow the buffers. Applicable to all K/L/M/N branches. Bug: 25747670 Change-Id: Id6a5120c2d08...
0
23,115
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void Disconnect() { ServiceProcessControl::GetInstance()->Disconnect(); } Commit Message: Migrate ServiceProcessControl tests off of QuitCurrent*Deprecated(). Bug: 844016 Change-Id: I9403b850456c8ee06cd2539f7cec9599302e81a0 Reviewed-on: https://chromium-review.googlesource.com/1126576 Commit-Queue: Wez...
0
2,353
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: DGAStealButtonEvent(DeviceIntPtr dev, int index, int button, int is_down) { DGAScreenPtr pScreenPriv; DGAEvent event; if (!DGAScreenKeyRegistered) /* no DGA */ return FALSE; pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]); if (!pScreenPriv || !pScreenPriv->grabMo...
0
26,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: static inline void rpc_set_waitqueue_owner(struct rpc_wait_queue *queue, pid_t pid) { queue->owner = pid; queue->nr = RPC_BATCH_COUNT; } Commit Message: NLM: Don't hang forever on NLM unlock requests If the NLM daemon is killed on the NFS server, we can currently end up hanging forever on an 'unlock' request,...
0
3,853
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SPL_METHOD(SplHeap, key) { spl_heap_object *intern = (spl_heap_object*)zend_object_store_get_object(getThis() TSRMLS_CC); if (zend_parse_parameters_none() == FAILURE) { return; } RETURN_LONG(intern->heap->count - 1); } Commit Message: CWE ID:
0
6,904
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: lou_translateString(const char *tableList, const widechar *inbufx, int *inlen, widechar *outbuf, int *outlen, formtype *typeform, char *spacing, int mode) { return lou_translate(tableList, inbufx, inlen, outbuf, outlen, typeform, spacing, NULL, NULL, NULL, mode); } Commit Message: Fix a buffer overflow Fi...
0
6,772
Analyze the following 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::DoSetEnableDCLayersCHROMIUM(GLboolean enable) { Framebuffer* framebuffer = GetFramebufferInfoForTarget(GL_DRAW_FRAMEBUFFER); if (framebuffer) { LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glSetEnableDCLayersCHROMIUM", "framebuffer must not be bound"); return...
0
13,781
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: core_dump_init(void) { struct rlimit orig_rlim, rlim; if (set_core_dump_pattern) { /* If we set the core_pattern here, we will attempt to restore it when we * exit. This will be fine if it is a child of ours that core dumps, * but if we ourself core dump, then the core_pattern will not be restored */ ...
0
7,495
Analyze the following 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_PGSQL_API int php_pgsql_result2array(PGresult *pg_result, zval *ret_array TSRMLS_DC) { zval *row; char *field_name; size_t num_fields; int pg_numrows, pg_row; uint i; assert(Z_TYPE_P(ret_array) == IS_ARRAY); if ((pg_numrows = PQntuples(pg_result)) <= 0) { return FAILURE; } for (pg_row = 0; pg_row...
0
25,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 TestNavigationManager::WaitForResponse() { desired_state_ = NavigationState::RESPONSE; return WaitForDesiredState(); } Commit Message: Apply ExtensionNavigationThrottle filesystem/blob checks to all frames. BUG=836858 Change-Id: I34333a72501129fd40b5a9aa6378c9f35f1e7fc2 Reviewed-on: https://chromium-r...
0
15,077
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GURL LinkDoctorBaseURL() { if (gUseMockLinkDoctorBaseURLForTesting) return GURL("http://mock.linkdoctor.url/for?testing"); return GURL(LINKDOCTOR_SERVER_REQUEST_URL); } Commit Message: Fix ChromeResourceDispatcherHostDelegateMirrorBrowserTest.MirrorRequestHeader with network service. The functionality w...
0
23,459
Analyze the following 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 not_unsigned(const char *str) { int rv = 0; const char *ptr = str; while (*ptr != ' ' && *ptr != '\t' && *ptr != '\0') { if (!isdigit(*ptr)) { rv = 1; break; } ptr++; } return rv; } Commit Message: security fix CWE ID: CWE-269
0
14,095
Analyze the following 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_vm_page_mkwrite( struct vm_area_struct *vma, struct vm_fault *vmf) { return block_page_mkwrite(vma, vmf, xfs_get_blocks); } Commit Message: ->splice_write() via ->write_iter() iter_file_splice_write() - a ->splice_write() instance that gathers the pipe buffers, builds a bio_vec-based iov_iter covering t...
0
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: static void networt_send_buffer_plain (sockent_t *se, /* {{{ */ const char *buffer, size_t buffer_size) { int status; while (42) { status = sockent_client_connect (se); if (status != 0) return; status = sendto (se->data.client.fd, buffer, buffer_size, /* flags = */ 0, (struct sockaddr *) s...
0
26,077
Analyze the following 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 license_recv(rdpLicense* license, wStream* s) { BYTE flags; BYTE bMsgType; UINT16 wMsgSize; UINT16 length; UINT16 channelId; UINT16 securityFlags; if (!rdp_read_header(license->rdp, s, &length, &channelId)) { fprintf(stderr, "Incorrect RDP header.\n"); return -1; } if (!rdp_read_security_heade...
0
21,281
Analyze the following 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 hyp_init_cpu_notify(struct notifier_block *self, unsigned long action, void *cpu) { switch (action) { case CPU_STARTING: case CPU_STARTING_FROZEN: cpu_init_hyp_mode(NULL); break; } return NOTIFY_OK; } Commit Message: ARM: KVM: prevent NULL pointer dereferences with KVM VCPU ioctl ...
0
27,558
Analyze the following 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 QQuickWebViewFlickablePrivate::updateContentsSize(const QSizeF& size) { ASSERT(flickProvider); if (!userDidOverrideContentWidth) flickProvider->setContentWidth(size.width()); if (!userDidOverrideContentHeight) flickProvider->setContentHeight(size.height()); } Commit Message: [Qt...
0
29,258
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: TEE_Result syscall_cryp_obj_restrict_usage(unsigned long obj, unsigned long usage) { TEE_Result res; struct tee_ta_session *sess; struct tee_obj *o; res = tee_ta_get_current_session(&sess); if (res != TEE_SUCCESS) goto exit; res = tee_obj_get(to_user_ta_ctx(sess->ctx), tee_svc_uref_to_vaddr(obj)...
0
6,325
Analyze the following 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 BrowserPolicyConnector::DeviceStopAutoRetry() { #if defined(OS_CHROMEOS) if (device_cloud_policy_subsystem_.get()) device_cloud_policy_subsystem_->StopAutoRetry(); #endif } Commit Message: Reset the device policy machinery upon retrying enrollment. BUG=chromium-os:18208 TEST=See bug description ...
1
16,709
Analyze the following 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 vcbprintf( vcbprintf_callback user_callback, //!< Unknown void *user_data, //!< Unknown const char *fmt, //!< The format specified va_list argp //!< List of parameter values ) { char buf[32]; while (*fmt) { if (*fmt == '%') { ...
0
25,199
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: base::TimeDelta WebMediaPlayerImpl::GetPipelineMediaDuration() const { DCHECK(main_task_runner_->BelongsToCurrentThread()); return pipeline_media_duration_for_test_.value_or( pipeline_controller_.GetMediaDuration()); } Commit Message: Simplify "WouldTaintOrigin" concept in media/blink Currently WebMe...
0
26,484
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void vmxnet3_get_ring_from_file(QEMUFile *f, Vmxnet3Ring *r) { r->pa = qemu_get_be64(f); r->size = qemu_get_be32(f); r->cell_size = qemu_get_be32(f); r->next = qemu_get_be32(f); r->gen = qemu_get_byte(f); } Commit Message: CWE ID: CWE-200
0
13,047
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int sha256_sparc64_update(struct shash_desc *desc, const u8 *data, unsigned int len) { struct sha256_state *sctx = shash_desc_ctx(desc); unsigned int partial = sctx->count % SHA256_BLOCK_SIZE; /* Handle the fast case right here */ if (partial + len < SHA256_BLOCK_SIZE) { sctx->count += len; m...
0
23,375
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xmlBufShrink(xmlBufPtr buf, size_t len) { if ((buf == NULL) || (buf->error != 0)) return(0); CHECK_COMPAT(buf) if (len == 0) return(0); if (len > buf->use) return(0); buf->use -= len; if ((buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) || ((buf->alloc == XML_BUFFER_ALLOC_IO) && (buf->c...
0
4,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: AffineTransform SVGElement::LocalCoordinateSpaceTransform(CTMScope) const { return AffineTransform(); } Commit Message: Fix SVG crash for v0 distribution into foreignObject. We require a parent element to be an SVG element for non-svg-root elements in order to create a LayoutObject for them. However, we check...
0
16,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: bool ScrollStateIsUnknown() const { return scroll_state() == OverscrollController::ScrollState::NONE; } Commit Message: Start rendering timer after first navigation Currently the new content rendering timer in the browser process, which clears an old page's contents 4 seconds after a navigation if the n...
0
8,605
Analyze the following 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 _xml_xmlcharlen(const XML_Char *s) { int len = 0; while (*s) { len++; s++; } return len; } Commit Message: CWE ID: CWE-119
0
26,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: PanoramiXRenderTriFan(ClientPtr client) { PanoramiXRes *src, *dst; int result = Success, j; REQUEST(xRenderTriFanReq); char *extra; int extra_len; REQUEST_AT_LEAST_SIZE(xRenderTriFanReq); VERIFY_XIN_PICTURE(src, stuff->src, client, DixReadAccess); VERIFY_XIN_PICTURE(dst, stuff->...
0
8,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: sysapi_uname_arch(void) { return sysapi_condor_arch(); } Commit Message: CWE ID: CWE-134
0
3,400
Analyze the following 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 PrepareTabstripForSelectionTest(TabStripModel* model, int tab_count, int pinned_count, const std::string& selected_tabs) { for (int i = 0; i < tab_count; ++i) { TabContentsWrapper*...
0
13,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 RenderLayerScrollableArea::isPointInResizeControl(const IntPoint& absolutePoint, ResizerHitTestType resizerHitTestType) const { if (!box().canResize()) return false; IntPoint localPoint = roundedIntPoint(box().absoluteToLocal(absolutePoint, UseTransforms)); IntRect localBounds(0, 0, box(...
0
2,270
Analyze the following 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 inode *new_simple_dir(struct super_block *s, struct btrfs_key *key, struct btrfs_root *root) { struct inode *inode = new_inode(s); if (!inode) return ERR_PTR(-ENOMEM); BTRFS_I(inode)->root = root; memcpy(&BTRFS_I(inode)->location, key, sizeof(*key)); set_bit(BTRFS_INODE_DUMM...
0
12,584
Analyze the following 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 ssh_comp_none_disable(void *handle) { return 0; } Commit Message: CWE ID: CWE-119
0
17,752
Analyze the following 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 BlobStorageContext::OnEnoughSpaceForCopies(const std::string& uuid, bool success) { if (!success) { CancelBuildingBlob(uuid, BlobStatus::ERR_OUT_OF_MEMORY); return; } BlobEntry* entry = registry_.GetEntry(uuid); if (!entry) return; if (en...
0
13,412
Analyze the following 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_xcrs(struct kvm_vcpu *vcpu, struct kvm_xcrs *guest_xcrs) { int i, r = 0; if (!cpu_has_xsave) return -EINVAL; if (guest_xcrs->nr_xcrs > KVM_MAX_XCRS || guest_xcrs->flags) return -EINVAL; for (i = 0; i < guest_xcrs->nr_xcrs; i++) /* Only support XCR0 current...
0
24,477
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: FixedPolicySubresourceFilter(LoadPolicy policy, int* filtered_load_counter) : policy_(policy), filtered_load_counter_(filtered_load_counter) {} Commit Message: DevTools: send proper resource type in Network.RequestWillBeSent This patch plumbs resoure type into the DispatchWillSendRequest instrumenation....
0
15,602
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void lock_two_nondirectories(struct inode *inode1, struct inode *inode2) { if (inode1 > inode2) swap(inode1, inode2); if (inode1 && !S_ISDIR(inode1->i_mode)) mutex_lock(&inode1->i_mutex); if (inode2 && !S_ISDIR(inode2->i_mode) && inode2 != inode1) mutex_lock_nested(&inode2->i_mutex, I_MUTEX_NONDIR2); } ...
0
2,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 undoReadTag() { if (m_position > 0) --m_position; } Commit Message: Replace further questionable HashMap::add usages in bindings BUG=390928 R=dcarney@chromium.org Review URL: https://codereview.chromium.org/411273002 git-svn-id: svn://svn.chromium.org/blink/trunk@178823 bb...
0
15,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: MagickExport Image *FlopImage(const Image *image,ExceptionInfo *exception) { #define FlopImageTag "Flop/Image" CacheView *flop_view, *image_view; Image *flop_image; MagickBooleanType status; MagickOffsetType progress; RectangleInfo page; ssize_t y; assert(image !=...
0
24,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: static int sctp_getsockopt_peeloff_flags(struct sock *sk, int len, char __user *optval, int __user *optlen) { sctp_peeloff_flags_arg_t peeloff; struct file *newfile = NULL; int retval = 0; if (len < sizeof(sctp_peeloff_flags_arg_t)) return -EINVAL; len = sizeof(sctp_peeloff_flags_arg_t); if (copy_f...
0
14,188
Analyze the following 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 Editor::canSmartReplaceWithPasteboard(Pasteboard* pasteboard) { return smartInsertDeleteEnabled() && pasteboard->canSmartReplace(); } Commit Message: Make TypingCommand::insertText() to take SelectionInDOMTree instead of VisibleSelection This patch makes |TypingCommand::insertText()| to take |SelectionIn...
0
25,015
Analyze the following 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 RenderFrameHostManager::ResetProxyHosts() { for (const auto& pair : proxy_hosts_) { static_cast<SiteInstanceImpl*>(pair.second->GetSiteInstance()) ->RemoveObserver(this); } proxy_hosts_.clear(); } Commit Message: Don't show current RenderWidgetHostView while interstitial is showing. Also ...
0
18,915
Analyze the following 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 ecb_aes_set_key(struct crypto_tfm *tfm, const u8 *in_key, unsigned int key_len) { struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm); int ret; ret = need_fallback(key_len); if (ret > 0) { sctx->key_len = key_len; return setkey_fallback_blk(tfm, in_key, key_len); } switch (key_len) { cas...
0
9,460
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ikev2_print(netdissect_options *ndo, const u_char *bp, u_int length, const u_char *bp2 _U_, struct isakmp *base) { const struct isakmp *p; const u_char *ep; u_char np; int phase; p = (const struct isakmp *)bp; ep = ndo->ndo_snapend; phase = (EXTRACT_32BITS(base->msgid) == 0) ? 1 : 2; if (phas...
0
29,890
Analyze the following 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 PrelinEval8(register const cmsUInt16Number Input[], register cmsUInt16Number Output[], register const void* D) { cmsUInt8Number r, g, b; cmsS15Fixed16Number rx, ry, rz; cmsS15Fixed16Number c0, c1, c2, c3, Rest; int OutChan;...
0
12,078
Analyze the following 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 jpc_dec_process_unk(jpc_dec_t *dec, jpc_ms_t *ms) { /* Eliminate compiler warnings about unused variables. */ dec = 0; jas_eprintf("warning: ignoring unknown marker segment (0x%x)\n", ms->id); jpc_ms_dump(ms, stderr); return 0; } Commit Message: Fixed an array overflow problem in the JPC deco...
0
8,317
Analyze the following 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 __exit cast5_mod_fini(void) { crypto_unregister_alg(&alg); } Commit Message: crypto: prefix module autoloading with "crypto-" This prefixes all crypto module loading with "crypto-" so we never run the risk of exposing module auto-loading to userspace via a crypto API, as demonstrated by Mathias Kra...
0
17,405
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void FrameLoader::DidFinishNavigation() { DCHECK((document_loader_ && document_loader_->SentDidFinishLoad()) || !HasProvisionalNavigation()); if (!document_loader_ || !document_loader_->SentDidFinishLoad() || HasProvisionalNavigation()) { return; } if (frame_->IsLoading() && !protect_p...
0
27,293
Analyze the following 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 AutofillManager::OnFullCardRequestSucceeded( const payments::FullCardRequest& full_card_request, const CreditCard& card, const base::string16& cvc) { FormStructure* form_structure = nullptr; AutofillField* autofill_field = nullptr; if (!GetCachedFormAndField(unmasking_form_, unmasking_field...
0
15,668
Analyze the following 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_issue_flush(struct f2fs_sb_info *sbi) { struct flush_cmd_control *fcc = SM_I(sbi)->fcc_info; struct flush_cmd cmd; int ret; if (test_opt(sbi, NOBARRIER)) return 0; if (!test_opt(sbi, FLUSH_MERGE)) { ret = submit_flush_wait(sbi); atomic_inc(&fcc->issued_flush); return ret; } if (!atomic_...
0
25,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: ZEND_API void zend_hash_bucket_swap(Bucket *p, Bucket *q) { zval val; zend_ulong h; zend_string *key; ZVAL_COPY_VALUE(&val, &p->val); h = p->h; key = p->key; ZVAL_COPY_VALUE(&p->val, &q->val); p->h = q->h; p->key = q->key; ZVAL_COPY_VALUE(&q->val, &val); q->h = h; q->key = key; } Commit Message: F...
0
6,727
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: hook_valid (struct t_hook *hook) { int type; struct t_hook *ptr_hook; for (type = 0; type < HOOK_NUM_TYPES; type++) { for (ptr_hook = weechat_hooks[type]; ptr_hook; ptr_hook = ptr_hook->next_hook) { if (!ptr_hook->deleted && (ptr_hook == hook)) ...
0
27,060
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: unsigned HTMLFormElement::formElementIndexWithFormAttribute(Element* element, unsigned rangeStart, unsigned rangeEnd) { if (m_associatedElements.isEmpty()) return 0; ASSERT(rangeStart <= rangeEnd); if (rangeStart == rangeEnd) return rangeStart; unsigned left = rangeStart; un...
0
9,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: TabStripModel::InsertionPolicy TabStripModel::insertion_policy() const { return order_controller_->insertion_policy(); } Commit Message: chromeos: fix bug where "aw snap" page replaces first tab if it was a NTP when closing window with > 1 tab. BUG=chromium-os:12088 TEST=verify bug per bug report. Review URL:...
0
29,176
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: AXObjectCache* Document::ExistingAXObjectCache() const { auto& cache_owner = AxObjectCacheOwner(); if (!cache_owner.GetLayoutView()) return nullptr; return cache_owner.ax_object_cache_.Get(); } Commit Message: Inherit referrer and policy when creating a nested browsing context BUG=763194 R=estark@ch...
0
214
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: CacheQueryResult WebBluetoothServiceImpl::QueryCacheForService( const std::string& service_instance_id) { auto device_iter = service_id_to_device_address_.find(service_instance_id); if (device_iter == service_id_to_device_address_.end()) { CrashRendererAndClosePipe(bad_message::BDH_INVALID_SERVICE_ID...
0
22,410
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: snd_compr_get_caps(struct snd_compr_stream *stream, unsigned long arg) { int retval; struct snd_compr_caps caps; if (!stream->ops->get_caps) return -ENXIO; retval = stream->ops->get_caps(stream, &caps); if (retval) goto out; if (copy_to_user((void __user *)arg, &caps, sizeof(caps))) retval = -EFAULT...
0
17,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: void ResourceDispatcherHostImpl::OnDidLoadResourceFromMemoryCache( const GURL& url, const std::string& security_info, const std::string& http_method, const std::string& mime_type, ResourceType::Type resource_type) { if (!url.is_valid() || !(url.SchemeIs("http") || url.SchemeIs("https"))) ...
0
5,498
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void Unpack<WebGLImageConversion::kDataFormatBGRA8, uint8_t, uint8_t>( const uint8_t* source, uint8_t* destination, unsigned pixels_per_row) { const uint32_t* source32 = reinterpret_cast_ptr<const uint32_t*>(source); uint32_t* destination32 = reinterpret_cast_ptr<uint32_t*>(destination); #if defi...
0
170
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: V8ValueConverterImpl::V8ValueConverterImpl() : date_allowed_(false), reg_exp_allowed_(false), function_allowed_(false), strip_null_from_objects_(false), avoid_identity_hash_for_testing_(false), strategy_(NULL) {} Commit Message: V8ValueConverter::ToV8Value should not trigger set...
0
26,753
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void HeadlessWebContentsImpl::RenderFrameCreated( content::RenderFrameHost* render_frame_host) { for (const MojoService& service : mojo_services_) { registry_.AddInterface( service.service_name, base::Bind(&HeadlessWebContentsImpl::CreateMojoService, base::Unretained(t...
0
6,027
Analyze the following 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 OfflinePageModelImpl::GetPagesMatchingQueryWhenLoadDone( std::unique_ptr<OfflinePageModelQuery> query, const MultipleOfflinePageItemCallback& callback) { DCHECK(query); DCHECK(is_loaded_); MultipleOfflinePageItemResult offline_pages_result; for (const auto& id_page_pair : offline_pages_) { ...
0
24,725
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void free_ringmemory(struct b43_dmaring *ring) { dma_free_coherent(ring->dev->dev->dma_dev, B43_DMA_RINGMEMSIZE, ring->descbase, ring->dmabase); } Commit Message: b43: allocate receive buffers big enough for max frame len + offset Otherwise, skb_put inside of dma_rx can fail... https://bugzilla.k...
0
29,081
Analyze the following 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 mov_read_meta(MOVContext *c, AVIOContext *pb, MOVAtom atom) { while (atom.size > 8) { uint32_t tag = avio_rl32(pb); atom.size -= 4; if (tag == MKTAG('h','d','l','r')) { avio_seek(pb, -8, SEEK_CUR); atom.size += 8; return mov_read_default(c...
0
8,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: connection_edge_destroy(circid_t circ_id, edge_connection_t *conn) { if (!conn->base_.marked_for_close) { log_info(LD_EDGE, "CircID %u: At an edge. Marking connection for close.", (unsigned) circ_id); if (conn->base_.type == CONN_TYPE_AP) { entry_connection_t *entry_conn = EDGE_TO_ENT...
0
418
Analyze the following 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 GpuCommandBufferStub::OnDestroyTransferBuffer( int32 id, IPC::Message* reply_message) { TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnDestroyTransferBuffer"); if (command_buffer_.get()) { command_buffer_->DestroyTransferBuffer(id); } else { reply_message->set_reply_error(); } Send(re...
0
27,759
Analyze the following 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 RegisterAwContents(JNIEnv* env) { return RegisterNativesImpl(env); } Commit Message: sync compositor: pass simple gfx types by const ref See bug for reasoning BUG=159273 Review URL: https://codereview.chromium.org/1417893006 Cr-Commit-Position: refs/heads/master@{#356653} CWE ID: CWE-399
0
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: void blk_mq_stop_hw_queue(struct blk_mq_hw_ctx *hctx) { cancel_delayed_work(&hctx->run_work); cancel_delayed_work(&hctx->delay_work); set_bit(BLK_MQ_S_STOPPED, &hctx->state); } Commit Message: blk-mq: fix race between timeout and freeing request Inside timeout handler, blk_mq_tag_to_rq() is called to retriev...
0
17,396
Analyze the following 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_websocket_close(lua_State *L) { apr_socket_t *sock; char prelude[2]; request_rec *r = ap_lua_check_request_rec(L, 1); sock = ap_get_conn_socket(r->connection); /* Send a header that says: socket is closing. */ prelude[0] = 0x88; /* closing socket opcode */ pre...
0
15,119
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void pdf_run_SC_pattern(fz_context *ctx, pdf_processor *proc, const char *name, pdf_pattern *pat, int n, float *color) { pdf_run_processor *pr = (pdf_run_processor *)proc; pr->dev->flags &= ~FZ_DEVFLAG_STROKECOLOR_UNDEFINED; pdf_set_pattern(ctx, pr, PDF_STROKE, pat, color); } Commit Message: CWE ID: C...
0
2,664