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: bool TestBrowserWindow::IsDownloadShelfVisible() const { return false; } Commit Message: Mac: turn popups into new tabs while in fullscreen. It's platform convention to show popups as new tabs while in non-HTML5 fullscreen. (Popups cause tabs to lose HTML5 fullscreen.) This was implemented for Cocoa in a Bro...
0
3,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: static unsigned int task_scan_start(struct task_struct *p) { unsigned long smin = task_scan_min(p); unsigned long period = smin; /* Scale the maximum scan period with the amount of shared memory. */ if (p->numa_group) { struct numa_group *ng = p->numa_group; unsigned long shared = group_faults_shared(ng)...
0
29,588
Analyze the following 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 spl_load_simple_fit(struct spl_image_info *spl_image, struct spl_load_info *info, ulong sector, void *fit) { int sectors; ulong size; unsigned long count; struct spl_image_info image_info; int node = -1; int images, ret; int base_offset, hsize, align_len = ARCH_DMA_MINALIGN - 1; int index = 0; int...
0
23,267
Analyze the following 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 String8::setTo(const String8& other) { SharedBuffer::bufferFromData(other.mString)->acquire(); SharedBuffer::bufferFromData(mString)->release(); mString = other.mString; } Commit Message: libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8 Inconsistent behaviour between ut...
0
27,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: FTC_SNode_Compare( FTC_SNode snode, FTC_GQuery gquery, FTC_Cache cache, FT_Bool* list_changed ) { return ftc_snode_compare( FTC_NODE( snode ), gquery, cache, list_changed ); } Commit Message: CWE ID: C...
0
1,987
Analyze the following 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::drawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenu...
0
27,578
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GetMulticastIdCommand(wifi_handle handle, const char *name, const char *group) : WifiCommand("GetMulticastIdCommand", handle, 0) { mName = name; mGroup = group; mId = -1; } Commit Message: Fix use-after-free in wifi_cleanup() Release reference to cmd only after possibly calling getTy...
0
25,862
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PDFiumEngine::~PDFiumEngine() { for (auto& page : pages_) page->Unload(); if (doc_) { FORM_DoDocumentAAction(form_, FPDFDOC_AACTION_WC); FPDFDOC_ExitFormFillEnvironment(form_); FPDF_CloseDocument(doc_); } FPDFAvail_Destroy(fpdf_availability_); } Commit Message: [pdf] Use a temporary list...
0
24,437
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: RenderBlock* RenderBlock::clone() const { RenderBlock* cloneBlock; if (isAnonymousBlock()) { cloneBlock = createAnonymousBlock(); cloneBlock->setChildrenInline(childrenInline()); } else { RenderObject* cloneRenderer = toElement(node())->createRenderer(style()); clon...
0
19,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: void LE_reset(LoudnessEnhancerContext *pContext) { ALOGV(" > LE_reset(%p)", pContext); if (pContext->mCompressor != NULL) { float targetAmp = pow(10, pContext->mTargetGainmB/2000.0f); // mB to linear amplification ALOGV("LE_reset(): Target gain=%dmB <=> factor=%.2fX", pContext->mTargetGainmB, targ...
0
27,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: PHP_FUNCTION(openssl_x509_export_to_file) { X509 * cert; zval ** zcert; zend_bool notext = 1; BIO * bio_out; long certresource; char * filename; int filename_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zs|b", &zcert, &filename, &filename_len, &notext) == FAILURE) { return; } RETVAL_FAL...
0
20,411
Analyze the following 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 codebook_decode_step(vorb *f, Codebook *c, float *output, int len, int step) { int i,z = codebook_decode_start(f,c); float last = CODEBOOK_ELEMENT_BASE(c); if (z < 0) return FALSE; if (len > c->dimensions) len = c->dimensions; #ifdef STB_VORBIS_DIVIDES_IN_CODEBOOK if (c->lookup_type == ...
0
14,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: NavigateParams::NavigateParams(Browser* a_browser, TabContentsWrapper* a_target_contents) : target_contents(a_target_contents), source_contents(NULL), disposition(CURRENT_TAB), transition(content::PAGE_TRANSITION_LINK), tabstrip_index(-1), tabs...
1
13,402
Analyze the following 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 IsWindowVisible(XID window) { XWindowAttributes win_attributes; if (!XGetWindowAttributes(GetXDisplay(), window, &win_attributes)) return false; if (win_attributes.map_state != IsViewable) return false; int window_desktop, current_desktop; return (!GetWindowDesktop(window, &window_desktop) ...
0
28,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 void hide_next_step_button() { /* replace 'Forward' with 'Close' button */ /* 1. hide next button */ gtk_widget_hide(g_btn_next); /* 2. move close button to the last position */ gtk_box_set_child_packing(g_box_buttons, g_btn_close, false, false, 5, GTK_PACK_END); } Commit Message: wiza...
0
10,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: static bool has_intersects_mems_allowed(struct task_struct *start, const nodemask_t *mask) { struct task_struct *tsk; bool ret = false; rcu_read_lock(); for_each_thread(start, tsk) { if (mask) { /* * If this is a mempolicy constrained oom, tsk's * cpuset is irrelevant. Only return true if ...
0
16,255
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: inline unsigned long copy_fpr_to_user(void __user *to, struct task_struct *task) { return __copy_to_user(to, task->thread.fp_state.fpr, ELF_NFPREG * sizeof(double)); } Commit Message: powerpc/tm: Block signal return setting invalid MSR state Currently we allow both the MSR T and S bits to be...
0
2,090
Analyze the following 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 vpx_codec_err_t decoder_destroy(vpx_codec_alg_priv_t *ctx) { if (ctx->frame_workers != NULL) { int i; for (i = 0; i < ctx->num_frame_workers; ++i) { VPxWorker *const worker = &ctx->frame_workers[i]; FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1; vpx_get_worker_inte...
0
17,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: static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) { struct sockaddr_in6 *usin = (struct sockaddr_in6 *)uaddr; struct inet_connection_sock *icsk = inet_csk(sk); struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk); struct dccp_sock *dp = dccp_sk(sk...
1
14,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: static void destroy_t1_glyph_tree(struct avl_table *gl_tree) { assert(gl_tree != NULL); avl_destroy(gl_tree, NULL); } Commit Message: writet1 protection against buffer overflow git-svn-id: svn://tug.org/texlive/trunk/Build/source@48697 c570f23f-e606-0410-a88d-b1316a301751 CWE ID: CWE-119
0
10,429
Analyze the following 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_NAMED_FUNCTION(zif_locale_set_default) { char* locale_name = NULL; int len=0; if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s", &locale_name ,&len ) == FAILURE) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "locale_set_default: unable to parse input params", 0 TSRMLS_CC ); ...
1
15,873
Analyze the following 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 GfxRadialShading::getColor(double t, GfxColor *color) { double out[gfxColorMaxComps]; int i; for (i = 0; i < gfxColorMaxComps; ++i) { out[i] = 0; } for (i = 0; i < nFuncs; ++i) { funcs[i]->transform(&t, &out[i]); } for (i = 0; i < gfxColorMaxComps; ++i) { color->c[i] = dblToCol(out...
0
28,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: struct tpm_chip *tpm_register_hardware(struct device *dev, const struct tpm_vendor_specific *entry) { #define DEVNAME_SIZE 7 char *devname; struct tpm_chip *chip; /* Driver specific per-device data */ chip = kzalloc(sizeof(*chip), GFP_KERNEL); devname = kmalloc(DEVNAME_SIZE, GFP_KERNEL); if (chip ==...
0
22,721
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: IntPoint WebPagePrivate::mapToTransformed(const IntPoint& point) const { return roundTransformedPoint(m_transformationMatrix->mapPoint(FloatPoint(point))); } Commit Message: [BlackBerry] Adapt to new BlackBerry::Platform::TouchPoint API https://bugs.webkit.org/show_bug.cgi?id=105143 RIM PR 171941 Reviewed b...
0
22,106
Analyze the following 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 StreamTcp4WHSTest01 (void) { int ret = 0; Packet *p = SCMalloc(SIZE_OF_PACKET); if (unlikely(p == NULL)) return 0; Flow f; ThreadVars tv; StreamTcpThread stt; TCPHdr tcph; memset(p, 0, SIZE_OF_PACKET); PacketQueue pq; memset(&pq,0,sizeof(PacketQueue)); ...
0
7,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: cifs_setup_volume_info(struct smb_vol *volume_info, char *mount_data, const char *devname) { int rc = 0; if (cifs_parse_mount_options(mount_data, devname, volume_info)) return -EINVAL; if (volume_info->nullauth) { cifs_dbg(FYI, "Anonymous login\n"); kfree(volume_info->username); volume_info->usern...
0
1,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: status_t SampleTable::setSyncSampleParams(off64_t data_offset, size_t data_size) { if (mSyncSampleOffset >= 0 || data_size < 8) { return ERROR_MALFORMED; } mSyncSampleOffset = data_offset; uint8_t header[8]; if (mDataSource->readAt( data_offset, header, sizeof(header)) < (ssize_t)sizeof...
1
25,601
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: unset_addr_list_add(UnsetAddrList* list, int offset, struct _Node* node) { UnsetAddr* p; int size; if (list->num >= list->alloc) { size = list->alloc * 2; p = (UnsetAddr* )xrealloc(list->us, sizeof(UnsetAddr) * size); CHECK_NULL_RETURN_MEMERR(p); list->alloc = size; list->us = p; }...
0
11,578
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SpoolssRRPCN_q(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep) { guint32 changeid; /* Parse packet */ offset = dissect_nt_policy_hnd( tvb, offset, pinfo, tree, di, drep, hf_hnd, NULL, NULL, FALSE, FALSE); offset = dissect_ndr_uint32( tvb, offset, p...
0
21,275
Analyze the following 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 lodepng_chunk_create(unsigned char** out, size_t* outlength, unsigned length, const char* type, const unsigned char* data) { unsigned i; unsigned char *chunk, *new_buffer; size_t new_length = (*outlength) + length + 12; if(new_length < length + 12 || new_length < (*o...
0
11,937
Analyze the following 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 AudioSource::dataCallback(const AudioRecord::Buffer& audioBuffer) { int64_t timeUs = systemTime() / 1000ll; timeUs -= mRecord->latency() * 1000LL; ALOGV("dataCallbackTimestamp: %" PRId64 " us", timeUs); Mutex::Autolock autoLock(mLock); if (!mStarted) { ALOGW("Spurious callback from Au...
0
21,013
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: pvscsi_ring_cleanup(PVSCSIRingInfo *mgr) { mgr->rs_pa = 0; mgr->txr_len_mask = 0; mgr->rxr_len_mask = 0; mgr->msg_len_mask = 0; mgr->consumed_ptr = 0; mgr->filled_cmp_ptr = 0; mgr->filled_msg_ptr = 0; memset(mgr->req_ring_pages_pa, 0, sizeof(mgr->req_ring_pages_pa)); memset(mgr...
0
5,611
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int cirrus_bitblt_videotovideo_patterncopy(CirrusVGAState * s) { return cirrus_bitblt_common_patterncopy(s, s->vga.vram_ptr + ((s->cirrus_blt_srcaddr & ~7) & s->cirrus_addr_mask)); } Commit Message: CWE ID: CWE-119
0
12,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: nvmet_fc_fodnum(struct nvmet_fc_fcp_iod *fodptr) { return (fodptr - fodptr->queue->fod); } Commit Message: nvmet-fc: ensure target queue id within range. When searching for queue id's ensure they are within the expected range. Signed-off-by: James Smart <james.smart@broadcom.com> Signed-off-by: Christoph Hell...
0
26,672
Analyze the following 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 ng_pkt(git_pkt **out, const char *line, size_t len) { git_pkt_ng *pkt; const char *ptr; size_t alloclen; pkt = git__malloc(sizeof(*pkt)); GITERR_CHECK_ALLOC(pkt); pkt->ref = NULL; pkt->type = GIT_PKT_NG; line += 3; /* skip "ng " */ if (!(ptr = strchr(line, ' '))) goto out_err; len ...
1
9,048
Analyze the following 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 patternvalidate(i_ctx_t *i_ctx_p, ref *space, float *values, int num_comps) { os_ptr op = osp; check_op(1); if (!r_has_type(op, t_dictionary) && !r_has_type(op, t_null)) return_error(gs_error_typecheck); return 0; } Commit Message: CWE ID: CWE-704
0
7,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: static struct vfsmount *fs_set_subtype(struct vfsmount *mnt, const char *fstype) { int err; const char *subtype = strchr(fstype, '.'); if (subtype) { subtype++; err = -EINVAL; if (!subtype[0]) goto err; } else subtype = ""; mnt->mnt_sb->s_subtype = kstrdup(subtype, GFP_KERNEL); err = -ENOMEM; i...
0
4,397
Analyze the following 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 LayerTreeHost::InitializeOutputSurfaceIfNeeded() { if (!output_surface_can_be_initialized_) return false; if (output_surface_lost_) proxy_->CreateAndInitializeOutputSurface(); return !output_surface_lost_; } Commit Message: Removed pinch viewport scroll offset distribution The associated cha...
0
11,738
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: invoke_NPN_ReleaseObject(NPObject *npobj) { npw_return_val_if_fail(rpc_method_invoke_possible(g_rpc_connection), npobj->referenceCount); int error = rpc_method_invoke(g_rpc_connection, RPC_METHOD_NPN_RELEASE_OBJECT, RPC_TYPE_NP_OBJECT, npobj, RPC_TYPE_INVALID); if (error != ...
0
910
Analyze the following 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 msr_io(struct kvm_vcpu *vcpu, struct kvm_msrs __user *user_msrs, int (*do_msr)(struct kvm_vcpu *vcpu, unsigned index, u64 *data), int writeback) { struct kvm_msrs msrs; struct kvm_msr_entry *entries; int r, n; unsigned size; r = -EFAULT; if (copy_from_user(&msrs, user_msrs, sizeof ms...
0
5,074
Analyze the following 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 HTMLFormControlElement::willChangeForm() { ListedElement::willChangeForm(); formOwnerSetNeedsValidityCheck(); if (formOwner() && canBeSuccessfulSubmitButton()) formOwner()->invalidateDefaultButtonStyle(); } Commit Message: Form validation: Do not show validation bubble if the page is invisible. B...
0
25,852
Analyze the following 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 ResourceMultiBufferDataProvider::Start() { DVLOG(1) << __func__ << " @ " << byte_pos(); if (url_data_->length() > 0 && byte_pos() >= url_data_->length()) { base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindOnce(&ResourceMultiBufferDataProvider::Terminate, ...
0
28,106
Analyze the following 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 *cJSON_PrintBuffered(cJSON *item,int prebuffer,int fmt) { printbuffer p; p.buffer=(char*)cJSON_malloc(prebuffer); p.length=prebuffer; p.offset=0; return print_value(item,0,fmt,&p); } Commit Message: fix buffer overflow (#30) CWE ID: CWE-125
0
10,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 Browser::ActivateContents(WebContents* contents) { chrome::ActivateTabAt(this, tab_strip_model_->GetIndexOfWebContents(contents), false); window_->Activate(); } Commit Message: Remove TabContents from TabStripModelObserver::TabDetachedAt. BUG=107201 TEST=no visible change Revi...
0
29,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 inline void vpid_sync_vcpu_single(int vpid) { if (vpid == 0) return; if (cpu_has_vmx_invvpid_single()) __invvpid(VMX_VPID_EXTENT_SINGLE_CONTEXT, vpid, 0); } Commit Message: KVM: x86: work around infinite loop in microcode when #AC is delivered It was found that a guest can DoS a host by triggering...
0
2,471
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PaintLayerScrollableArea::ConvertFromScrollbarToContainingEmbeddedContentView( const Scrollbar& scrollbar, const IntRect& scrollbar_rect) const { LayoutView* view = GetLayoutBox()->View(); if (!view) return scrollbar_rect; IntRect rect = scrollbar_rect; rect.Move(ScrollbarOffset(scrollbar)); ...
0
2,160
Analyze the following 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 BaseArena::lazySweepWithDeadline(double deadlineSeconds) { static const int deadlineCheckInterval = 10; RELEASE_ASSERT(getThreadState()->isSweepingInProgress()); ASSERT(getThreadState()->sweepForbidden()); ASSERT(!getThreadState()->isMainThread() || ScriptForbiddenScope::isScriptForbidden()...
0
3,938
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void NTPInfoObserver::Observe(int type, const content::NotificationSource& source, const content::NotificationDetails& details) { if (type == chrome::NOTIFICATION_TOP_SITES_LOADED) { OnTopSitesLoaded(); } else if (type == chrome::NOTIFICATION_TOP...
0
15,966
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: generate_fips (RSA_secret_key *sk, unsigned int nbits, unsigned long use_e, gcry_sexp_t testparms, int transient_key) { gcry_mpi_t p, q; /* the two primes */ gcry_mpi_t d; /* the private key */ gcry_mpi_t u; gcry_mpi_t p1, q1; gcry_mpi_t n; /* the public key */ gcry_mpi_t e; /*...
0
13,316
Analyze the following 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 pmcraid_eh_device_reset_handler(struct scsi_cmnd *scmd) { scmd_printk(KERN_INFO, scmd, "resetting device due to an I/O command timeout.\n"); return pmcraid_reset_device(scmd, PMCRAID_INTERNAL_TIMEOUT, RESET_DEVICE_LUN); } Commit Message: [SCSI] pmcraid: reject negative request ...
0
13,012
Analyze the following 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::BindNavigationClient( mojom::NavigationClientAssociatedRequest request) { navigation_client_impl_ = std::make_unique<NavigationClient>(this); navigation_client_impl_->Bind(std::move(request)); } Commit Message: Convert FrameHostMsg_DidAddMessageToConsole to Mojo. Note: Since this r...
0
26,198
Analyze the following 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 GaiaCookieManagerService::ExternalCcResultFetcher::Start() { m_external_cc_result_start_time_ = base::Time::Now(); CleanupTransientState(); results_.clear(); helper_->gaia_auth_fetcher_.reset( helper_->signin_client_->CreateGaiaAuthFetcher( this, helper_->GetDefaultSourceForRequest()...
0
3,153
Analyze the following 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 *SSL_rstate_string_long(const SSL *s) { switch (s->rlayer.rstate) { case SSL_ST_READ_HEADER: return "read header"; case SSL_ST_READ_BODY: return "read body"; case SSL_ST_READ_DONE: return "read done"; default: return "unknown"; } } Commit Message...
0
8,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: int PE_(bin_pe_get_overlay)(struct PE_(r_bin_pe_obj_t)* bin, ut64* size) { ut64 largest_offset = 0; ut64 largest_size = 0; *size = 0; int i; if (!bin) { return 0; } if (bin->optional_header) { computeOverlayOffset ( bin->nt_header_offset+4+sizeof(bin->nt_headers->file_header), bin->nt_headers...
0
16,100
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: test_bson_reinit (void) { bson_t b = BSON_INITIALIZER; int i; for (i = 0; i < 1000; i++) { bson_append_int32 (&b, "", 0, i); } bson_reinit (&b); for (i = 0; i < 1000; i++) { bson_append_int32 (&b, "", 0, i); } bson_destroy (&b); } Commit Message: Fix for CVE-2018-16790 -- ...
0
12,715
Analyze the following 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 encoding_filter_script_to_intermediate(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length TSRMLS_DC) { return zend_multibyte_encoding_converter(to, to_length, from, from_length, zend_multibyte_encoding_utf8, LANG_SCNG(script_encoding) TSRMLS_CC); } Commit Message:...
0
13,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: static void vnc_release_modifiers(VncState *vs) { static const int keycodes[] = { /* shift, control, alt keys, both left & right */ 0x2a, 0x36, 0x1d, 0x9d, 0x38, 0xb8, }; int i, keycode; if (!qemu_console_is_graphic(NULL)) { return; } for (i = 0; i < ARRAY_SIZE(key...
0
24,924
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: box_lt(PG_FUNCTION_ARGS) { BOX *box1 = PG_GETARG_BOX_P(0); BOX *box2 = PG_GETARG_BOX_P(1); PG_RETURN_BOOL(FPlt(box_ar(box1), box_ar(box2))); } Commit Message: Predict integer overflow to avoid buffer overruns. Several functions, mostly type input functions, calculated an allocation size such that th...
0
20,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: bool ExtensionRegistry::AddEnabled( const scoped_refptr<const Extension>& extension) { return enabled_extensions_.Insert(extension); } Commit Message: [Extensions] Add GetInstalledExtension() method to ExtensionRegistry This CL adds GetInstalledExtension() method to ExtensionRegistry and uses it instea...
0
16,471
Analyze the following 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 omx_vdec::append_portdef_extradata(OMX_OTHER_EXTRADATATYPE *extra) { OMX_PARAM_PORTDEFINITIONTYPE *portDefn = NULL; extra->nSize = OMX_PORTDEF_EXTRADATA_SIZE; extra->nVersion.nVersion = OMX_SPEC_VERSION; extra->nPortIndex = OMX_CORE_OUTPUT_PORT_INDEX; extra->eType = (OMX_EXTRADATATYPE)OMX...
0
4,920
Analyze the following 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 InspectorClientImpl::resetTraceEventCallback() { if (WebDevToolsAgentImpl* agent = devToolsAgent()) agent->resetTraceEventCallback(); } Commit Message: [4/4] Process clearBrowserCahce/cookies commands in browser. BUG=366585 Review URL: https://codereview.chromium.org/251183005 git-svn-id: svn...
0
1,342
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: __nfs4_find_state_byowner(struct inode *inode, struct nfs4_state_owner *owner) { struct nfs_inode *nfsi = NFS_I(inode); struct nfs4_state *state; list_for_each_entry(state, &nfsi->open_states, inode_states) { if (state->owner != owner) continue; if (atomic_inc_not_zero(&state->count)) return state; ...
0
15,364
Analyze the following 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 ffprobe_show_program_version(WriterContext *w) { AVBPrint pbuf; av_bprint_init(&pbuf, 1, AV_BPRINT_SIZE_UNLIMITED); writer_print_section_header(w, SECTION_ID_PROGRAM_VERSION); print_str("version", FFMPEG_VERSION); print_fmt("copyright", "Copyright (c) %d-%d the FFmpeg developers",...
0
16,917
Analyze the following 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 string_registers_quirk(struct x86_emulate_ctxt *ctxt) { /* * Intel CPUs mask the counter and pointers in quite strange * manner when ECX is zero due to REP-string optimizations. */ #ifdef CONFIG_X86_64 if (ctxt->ad_bytes != 4 || !vendor_intel(ctxt)) return; *reg_write(ctxt, VCPU_REGS_RCX) ...
0
13,053
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: cluster_finish (void) { hash_free (cluster_hash); cluster_hash = NULL; } Commit Message: CWE ID:
0
6,512
Analyze the following 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 regulator_disable(struct regulator *regulator) { struct regulator_dev *rdev = regulator->rdev; int ret = 0; if (regulator->always_on) return 0; mutex_lock(&rdev->mutex); ret = _regulator_disable(rdev); mutex_unlock(&rdev->mutex); if (ret == 0 && rdev->supply) regulator_disable(rdev->supply); r...
0
13,498
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int tg3_phy_toggle_auxctl_smdsp(struct tg3 *tp, bool enable) { u32 val; int err; err = tg3_phy_auxctl_read(tp, MII_TG3_AUXCTL_SHDWSEL_AUXCTL, &val); if (err) return err; if (enable) val |= MII_TG3_AUXCTL_ACTL_SMDSP_ENA; else val &= ~MII_TG3_AUXCTL_ACTL_SMDSP_ENA; err = tg3_phy_auxctl_write...
0
11,988
Analyze the following 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 do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask) { if (p->sched_class && p->sched_class->set_cpus_allowed) p->sched_class->set_cpus_allowed(p, new_mask); cpumask_copy(&p->cpus_allowed, new_mask); p->nr_cpus_allowed = cpumask_weight(new_mask); } Commit Message: sched: Fix info...
0
27,003
Analyze the following 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 call_extract_if_dead(struct connectdata *conn, void *param) { struct prunedead *p = (struct prunedead *)param; if(extract_if_dead(conn, p->data)) { /* stop the iteration here, pass back the connection that was extracted */ p->extracted = conn; return 1; } return 0; /* continue itera...
0
16,508
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void AppCacheHost::LoadSelectedCache(int64 cache_id) { DCHECK(cache_id != kAppCacheNoCacheId); pending_selected_cache_id_ = cache_id; storage()->LoadCache(cache_id, this); } Commit Message: Fix possible map::end() dereference in AppCacheUpdateJob triggered by a compromised renderer. BUG=551044 Review URL...
0
15,009
Analyze the following 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::WasShown() { if (!is_hidden_) return; is_hidden_ = false; SendScreenRects(); BackingStore* backing_store = BackingStoreManager::Lookup(this); bool needs_repainting; if (needs_repainting_on_restore_ || !backing_store || is_accelerated_compositing_active()) { n...
0
19,025
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: lspping_print(netdissect_options *ndo, register const u_char *pptr, register u_int len) { const struct lspping_common_header *lspping_com_header; const struct lspping_tlv_header *lspping_tlv_header; const struct lspping_tlv_header *lspping_subtlv_header; const u_char *tptr,*tlv_tptr,...
0
29,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: ReadUserLogState::ScoreFile( const char *path, int rot ) const { StatStructType statbuf; if ( NULL == path ) { path = CurPath( ); } if ( rot < 0 ) { rot = m_cur_rot; } if ( StatFile( path, statbuf ) ) { dprintf( D_FULLDEBUG, "ScoreFile: stat Error\n" ); return -1; } return ScoreFile( statbuf, ro...
0
10,667
Analyze the following 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 CheckVPrediction() const { for (int p = 0; p < num_planes_; p++) for (int y = 0; y < block_size_; y++) ASSERT_EQ(0, memcmp(&data_ptr_[p][-stride_], &data_ptr_[p][y * stride_], block_size_)); } Commit Message: Merge Conflict Fix CL to lmp-mr1-release for ag/849478 DO NOT MERGE - libvpx: Pull fr...
0
15,439
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int user_reset_fdc(int drive, int arg, bool interruptible) { int ret; if (lock_fdc(drive)) return -EINTR; if (arg == FD_RESET_ALWAYS) FDCS->reset = 1; if (FDCS->reset) { cont = &reset_cont; ret = wait_til_done(reset_fdc, interruptible); if (ret == -EINTR) return -EINTR; } process_fd_re...
0
6,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: OJPEGReadBlock(OJPEGState* sp, uint16 len, void* mem) { uint16 mlen; uint8* mmem; uint16 n; assert(len>0); mlen=len; mmem=mem; do { if (sp->in_buffer_togo==0) { if (OJPEGReadBufferFill(sp)==0) return(0); assert(sp->in_buffer_togo>0); } n=mlen; if (n>sp->in_buffer_togo) n=sp->in_buff...
0
14,187
Analyze the following 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 core_create_proxy_req(request_rec *r, request_rec *pr) { return core_create_req(pr); } Commit Message: core: Disallow Methods' registration at run time (.htaccess), they may be used only if registered at init time (httpd.conf). Calling ap_method_register() in children processes is not the right s...
0
24,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 ScriptController::initializeThreading() { static bool initializedThreading = false; if (!initializedThreading) { WTF::initializeThreading(); WTF::initializeMainThread(); initializedThreading = true; } } Commit Message: [V8] Pass Isolate to throwNotEnoughArgumentsError() h...
0
7,537
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: n_tty_receive_char_special(struct tty_struct *tty, unsigned char c) { struct n_tty_data *ldata = tty->disc_data; if (I_IXON(tty)) { if (c == START_CHAR(tty)) { start_tty(tty); process_echoes(tty); return 0; } if (c == STOP_CHAR(tty)) { stop_tty(tty); return 0; } } if (L_ISIG(tty)) { ...
0
17,479
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bt_status_t btif_storage_remove_ble_local_keys(void) { int ret = 1; if(btif_config_exist("Adapter", "LE_LOCAL_KEY_IR")) ret &= btif_config_remove("Adapter", "LE_LOCAL_KEY_IR"); if(btif_config_exist("Adapter", "LE_LOCAL_KEY_IRK")) ret &= btif_config_remove("Adapter", "LE_LOCAL_KEY_IRK"); if(bti...
0
6,986
Analyze the following 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 FileBrowserPrivateGetDriveFilesFunction::OnFileReady( drive::FileError error, const base::FilePath& local_path, scoped_ptr<drive::ResourceEntry> entry) { base::FilePath drive_path = remaining_drive_paths_.front(); if (error == drive::FILE_ERROR_OK) { local_paths_.push_back(local_path.AsU...
0
27,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: void AutofillDialogViews::OnNativeThemeChanged( const ui::NativeTheme* theme) { if (!legal_document_view_) return; views::StyledLabel::RangeStyleInfo default_style; default_style.color = theme->GetSystemColor(ui::NativeTheme::kColorId_LabelDisabledColor); legal_document_view_->SetDefaultSt...
0
17,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 bool parseMacAddress(JNIEnv *env, jobject obj, mac_addr addr) { JNIHelper helper(env); JNIObject<jstring> macAddrString = helper.getStringField(obj, "bssid"); if (macAddrString == NULL) { ALOGE("Error getting bssid field"); return false; } ScopedUtfChars chars(env, macAddrString); const cha...
0
14,219
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static jobject android_net_wifi_getLinkLayerStats (JNIEnv *env, jclass cls, jint iface) { JNIHelper helper(env); wifi_stats_result_handler handler; memset(&handler, 0, sizeof(handler)); handler.on_link_stats_results = &onLinkStatsResults; wifi_interface_handle handle = getIfaceHandle(helper, cls...
0
20,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: OobeUI* LoginDisplayHostWebUI::GetOobeUI() const { if (!login_view_) return nullptr; return login_view_->GetOobeUI(); } Commit Message: cros: Check initial auth type when showing views login. Bug: 859611 Change-Id: I0298db9bbf4aed6bd40600aef2e1c5794e8cd058 Reviewed-on: https://chromium-review.googlesour...
0
27,949
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static bool AllDescendantsAreComplete(Frame* frame) { if (!frame) return true; for (Frame* child = frame->Tree().FirstChild(); child; child = child->Tree().TraverseNext(frame)) { if (child->IsLoading()) return false; } return true; } Commit Message: Cleanup and remove dead code in Se...
0
6,788
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: TabCloseableStateWatcher::TabStripWatcher::TabStripWatcher( TabCloseableStateWatcher* main_watcher, const Browser* browser) : main_watcher_(main_watcher), browser_(browser) { browser_->tabstrip_model()->AddObserver(this); } Commit Message: chromeos: fix bug where "aw snap" page replaces first tab...
0
24,066
Analyze the following 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 tcm_loop_slave_alloc(struct scsi_device *sd) { set_bit(QUEUE_FLAG_BIDI, &sd->request_queue->queue_flags); return 0; } Commit Message: loopback: off by one in tcm_loop_make_naa_tpg() This is an off by one 'tgpt' check in tcm_loop_make_naa_tpg() that could result in memory corruption. Signed-off-by:...
0
7,494
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int genl_unregister_family(const struct genl_family *family) { genl_lock_all(); if (!genl_family_find_byid(family->id)) { genl_unlock_all(); return -ENOENT; } genl_unregister_mc_groups(family); idr_remove(&genl_fam_idr, family->id); up_write(&cb_lock); wait_event(genl_sk_destructing_waitq, ato...
0
3,354
Analyze the following 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 fsmMkdir(const char *path, mode_t mode) { int rc = mkdir(path, (mode & 07777)); if (_fsm_debug) rpmlog(RPMLOG_DEBUG, " %8s (%s, 0%04o) %s\n", __func__, path, (unsigned)(mode & 07777), (rc < 0 ? strerror(errno) : "")); if (rc < 0) rc = RPMERR_MKDIR_FAILED; return rc; } ...
0
6,417
Analyze the following 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 autocreate_inbox(void) { if (imapd_userisadmin) return; if (imapd_userisproxyadmin) return; if (config_getint(IMAPOPT_AUTOCREATE_QUOTA) >= 0) { char *inboxname = mboxname_user_mbox(imapd_userid, NULL); int r = mboxlist_lookup(inboxname, NULL, NULL); free(inboxname)...
0
1,891
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: sd_source_finalize (GSource *source) { SdSource *sd_source = (SdSource*)source; sd_login_monitor_unref (sd_source->monitor); } Commit Message: CWE ID: CWE-200
0
2,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: std::unique_ptr<base::ListValue> HostCache::GetAsListValue( bool include_staleness) const { std::unique_ptr<base::ListValue> entry_list(new base::ListValue()); for (const auto& pair : entries_) { const Key& key = pair.first; const Entry& entry = pair.second; std::unique_ptr<base::Dictionary...
0
29,002
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void init_once(void *foo) { struct udf_inode_info *ei = (struct udf_inode_info *)foo; ei->i_ext.i_data = NULL; inode_init_once(&ei->vfs_inode); } Commit Message: udf: Avoid run away loop when partition table length is corrupted Check provided length of partition table so that (possibly maliciously) c...
0
1,295
Analyze the following 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 red_client_add_channel(RedClient *client, RedChannelClient *rcc) { spice_assert(rcc && client); ring_add(&client->channels, &rcc->client_link); if (client->during_target_migrate && client->seamless_migrate) { red_channel_client_set_migration_seamless(rcc); } client->channel...
0
11,296
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: double_lock_hb(struct futex_hash_bucket *hb1, struct futex_hash_bucket *hb2) { if (hb1 <= hb2) { spin_lock(&hb1->lock); if (hb1 < hb2) spin_lock_nested(&hb2->lock, SINGLE_DEPTH_NESTING); } else { /* hb1 > hb2 */ spin_lock(&hb2->lock); spin_lock_nested(&hb1->lock, SINGLE_DEPTH_NESTING); } } Commit M...
0
8,650
Analyze the following 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 nfs4_state *nfs4_opendata_to_nfs4_state(struct nfs4_opendata *data) { struct inode *inode; struct nfs4_state *state = NULL; struct nfs_delegation *delegation; int ret; if (!data->rpc_done) { state = nfs4_try_open_cached(data); goto out; } ret = -EAGAIN; if (!(data->f_attr.valid & NFS_A...
0
5,655
Analyze the following 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_SetNotStandaloneHandler(XML_Parser parser, XML_NotStandaloneHandler handler) { if (parser != NULL) parser->m_notStandaloneHandler = handler; } Commit Message: xmlparse.c: Fix extraction of namespace prefix from XML name (#186) CWE ID: CWE-611
0
3,025
Analyze the following 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 sse16_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) { int s, i; uint32_t *sq = ff_squareTbl + 256; s = 0; for (i = 0; i < h; i++) { s += sq[pix1[ 0] - pix2[ 0]]; s += sq[pix1[ 1] - pix2[ 1]]; s += sq[pix1[ 2] - pix2[ 2]]; s += sq[pix1[ 3...
0
715
Analyze the following 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_OR( INS_ARG ) { DO_OR } Commit Message: CWE ID: CWE-119
0
22,179