instruction
stringclasses
1 value
input
stringlengths
56
241k
output
int64
0
1
__index_level_0__
int64
0
175k
Analyze the following 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(Array, key) { if (zend_parse_parameters_none() == FAILURE) { return; } spl_array_iterator_key(getThis(), return_value TSRMLS_CC); } /* }}} */ void spl_array_iterator_key(zval *object, zval *return_value TSRMLS_DC) /* {{{ */ Commit Message: Fix bug #73029 - Missing type check when unserializing ...
0
49,860
Analyze the following 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 ReadPSDChannel(Image *image,const PSDInfo *psd_info, LayerInfo* layer_info,const size_t channel, const PSDCompressionType compression,ExceptionInfo *exception) { Image *channel_image, *mask; MagickOffsetType offset; MagickBooleanType status; channel_image=im...
0
73,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: int pdf_width(struct pdf_doc *pdf) { return pdf->width; } Commit Message: jpeg: Fix another possible buffer overrun Found via the clang libfuzzer CWE ID: CWE-125
0
83,021
Analyze the following 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 DiceTurnSyncOnHelper::OnEnterpriseAccountConfirmation( SigninChoice choice) { UMA_HISTOGRAM_ENUMERATION("Enterprise.UserSigninChoice", choice, DiceTurnSyncOnHelper::SIGNIN_CHOICE_SIZE); switch (choice) { case SIGNIN_CHOICE_CANCEL: base::RecordAction( ba...
0
143,237
Analyze the following 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 reflectedTreatNullAsNullStringTreatUndefinedAsNullStringURLAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); CustomElementCallbackDispatcher::CallbackDeliveryScope...
0
121,957
Analyze the following 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 BrowserLauncherItemController::Launch(int event_flags) { DCHECK(!app_id().empty()); launcher_controller()->LaunchApp(app_id(), event_flags); } Commit Message: Remove TabContents from TabStripModelObserver::TabDetachedAt. BUG=107201 TEST=no visible change Review URL: https://chromiumcodereview.appspot...
0
117,730
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: std::unique_ptr<WebContentsImpl> WebContentsImpl::CreateWithOpener( const WebContents::CreateParams& params, RenderFrameHostImpl* opener_rfh) { TRACE_EVENT0("browser", "WebContentsImpl::CreateWithOpener"); FrameTreeNode* opener = nullptr; if (opener_rfh) opener = opener_rfh->frame_tree_node(); ...
0
144,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: int do_print(const char *path_p, const struct stat *st, int walk_flags, void *unused) { const char *default_prefix = NULL; acl_t acl = NULL, default_acl = NULL; int error = 0; if (walk_flags & WALK_TREE_FAILED) { fprintf(stderr, "%s: %s: %s\n", progname, xquote(path_p, "\n\r"), strerror(errno)); retur...
0
28
Analyze the following 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 MetricsWebContentsObserver::OnVisibilityChanged( content::Visibility visibility) { if (web_contents_will_soon_be_destroyed_) return; bool was_in_foreground = in_foreground_; in_foreground_ = visibility == content::Visibility::VISIBLE; if (in_foreground_ == was_in_foreground) return; i...
0
140,151
Analyze the following 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 GraphicsContext3D::paintToCanvas(const unsigned char* imagePixels, int imageWidth, int imageHeight, int canvasWidth, int canvasHeight, CGContextRef context) { if (!imagePixels || imageWidth <= 0 || imageHeight <= 0 || canvasWidth <= 0 || canvasHeight <= 0 || !context) return; int rowBytes = i...
0
107,234
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: pgm_print(netdissect_options *ndo, register const u_char *bp, register u_int length, register const u_char *bp2) { register const struct pgm_header *pgm; register const struct ip *ip; register char ch; uint16_t sport, dport; u_int nla_afnum; char nla_buf[INET6_ADDRSTRLEN]; register cons...
1
167,874
Analyze the following 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 ib_uverbs_add_one(struct ib_device *device) { int devnum; dev_t base; struct ib_uverbs_device *uverbs_dev; int ret; if (!device->alloc_ucontext) return; uverbs_dev = kzalloc(sizeof *uverbs_dev, GFP_KERNEL); if (!uverbs_dev) return; ret = init_srcu_struct(&uverbs_dev->disassociate_srcu);...
0
52,880
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xsltAddTextString(xsltTransformContextPtr ctxt, xmlNodePtr target, const xmlChar *string, int len) { /* * optimization */ if ((len <= 0) || (string == NULL) || (target == NULL)) return(target); if (ctxt->lasttext == target->content) { if (ctxt->lasttuse + len >= ctxt->lasttsiz...
0
156,804
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: message_send_chat_otr(const char *const barejid, const char *const msg, gboolean request_receipt) { xmpp_ctx_t * const ctx = connection_get_ctx(); char *state = chat_session_get_state(barejid); char *jid = chat_session_get_jid(barejid); char *id = create_unique_id("msg"); xmpp_stanza_t *mess...
0
68,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: unsigned venc_dev::venc_stop_done(void) { struct venc_msg venc_msg; free_extradata(); venc_msg.msgcode=VEN_MSG_STOP; venc_msg.statuscode=VEN_S_SUCCESS; venc_handle->async_message_process(venc_handle,&venc_msg); return 0; } Commit Message: DO NOT MERGE mm-video-v4l2: venc: add checks before acce...
0
159,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: int iscsi_login_tx_data( struct iscsi_conn *conn, char *pdu_buf, char *text_buf, int text_length) { int length, tx_sent, iov_cnt = 1; struct kvec iov[2]; length = (ISCSI_HDR_LEN + text_length); memset(&iov[0], 0, 2 * sizeof(struct kvec)); iov[0].iov_len = ISCSI_HDR_LEN; iov[0].iov_base = pdu_buf; ...
0
30,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 GLES2DecoderImpl::DoUniformMatrix2fv(GLint fake_location, GLsizei count, GLboolean transpose, const volatile GLfloat* value) { GLenum type = 0; GLint real_location = -1; if (tra...
0
141,398
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: uiserver_decrypt (void *engine, gpgme_data_t ciph, gpgme_data_t plain) { return _uiserver_decrypt (engine, 0, ciph, plain); } Commit Message: CWE ID: CWE-119
0
12,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: static void event_epilog(UNUSED_ATTR void *context) { vendor->send_async_command(VENDOR_DO_EPILOG, NULL); } Commit Message: DO NOT MERGE Fix potential DoS caused by delivering signal to BT process Bug: 28885210 Change-Id: I63866d894bfca47464d6e42e3fb0357c4f94d360 Conflicts: btif/co/bta_hh_co.c btif/src/bt...
0
158,956
Analyze the following 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 UkmPageLoadMetricsObserver::OnLoadedResource( const page_load_metrics::ExtraRequestCompleteInfo& extra_request_complete_info) { if (was_hidden_) return; if (extra_request_complete_info.was_cached) { cache_bytes_ += extra_request_complete_info.raw_body_bytes; } else { network_byt...
0
140,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: static void overloadedMethodCMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { if (((info.Length() == 1) && (info[0]->IsObject()))) { overloadedMethodC1Method(info); return; } if (((info.Length() == 1))) { overloadedMethodC2Method(info); return; } Except...
0
121,866
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: OMX_BUFFERHEADERTYPE *OMXNodeInstance::findBufferHeader(OMX::buffer_id buffer) { if (buffer == 0) { return NULL; } Mutex::Autolock autoLock(mBufferIDLock); ssize_t index = mBufferIDToBufferHeader.indexOfKey(buffer); if (index < 0) { CLOGW("findBufferHeader: buffer %u not found", bu...
1
173,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: nm_ip4_config_new (int ifindex) { g_return_val_if_fail (ifindex >= -1, NULL); return (NMIP4Config *) g_object_new (NM_TYPE_IP4_CONFIG, NM_IP4_CONFIG_IFINDEX, ifindex, NULL); } Commit Message: CWE ID: CWE-20
0
6,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: group_sched_in(struct perf_event *group_event, struct perf_cpu_context *cpuctx, struct perf_event_context *ctx) { struct perf_event *event, *partial_group = NULL; struct pmu *pmu = ctx->pmu; u64 now = ctx->time; bool simulate = false; if (group_event->state == PERF_EVENT_STATE_OFF) return ...
0
56,050
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int DH_check(const DH *dh, int *ret) { int ok = 0; BN_CTX *ctx = NULL; BN_ULONG l; BIGNUM *t1 = NULL, *t2 = NULL; *ret = 0; ctx = BN_CTX_new(); if (ctx == NULL) goto err; BN_CTX_start(ctx); t1 = BN_CTX_get(ctx); if (t1 == NULL) goto err; t2 = BN_CTX_get...
0
13,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 RTCPeerConnection::didRemoveRemoteStream(MediaStreamDescriptor* streamDescriptor) { ASSERT(scriptExecutionContext()->isContextThread()); ASSERT(streamDescriptor->owner()); RefPtr<MediaStream> stream = static_cast<MediaStream*>(streamDescriptor->owner()); stream->streamEnded(); if (m_rea...
0
99,368
Analyze the following 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 KURL& Document::firstPartyForCookies() const { return topDocument()->url(); } Commit Message: Refactoring: Move m_mayDisplaySeamlesslyWithParent down to Document The member is used only in Document, thus no reason to stay in SecurityContext. TEST=none BUG=none R=haraken@chromium.org, abarth, haraken,...
0
102,730
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void imapd_check(struct backend *be, int usinguid) { if (backend_current && backend_current != be) { /* remote mailbox */ char mytag[128]; proxy_gentag(mytag, sizeof(mytag)); prot_printf(backend_current->out, "%s Noop\r\n", mytag); pipe_until_tag(backend_curren...
0
95,218
Analyze the following 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 Layer::SetDoubleSided(bool double_sided) { DCHECK(IsPropertyChangeAllowed()); if (double_sided_ == double_sided) return; double_sided_ = double_sided; SetNeedsCommit(); } Commit Message: Removed pinch viewport scroll offset distribution The associated change in Blink makes the pinch viewport a ...
0
111,902
Analyze the following 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(getopt) { char *options = NULL, **argv = NULL; char opt[2] = { '\0' }; char *optname; int argc = 0, options_len = 0, len, o; char *php_optarg = NULL; int php_optind = 1; zval *val, **args = NULL, *p_longopts = NULL; int optname_len = 0; opt_struct *opts, *orig_opts; if (zend_parse_paramete...
0
4,256
Analyze the following 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 credssp_recv(rdpCredssp* credssp) { wStream* s; int length; int status; UINT32 version; s = Stream_New(NULL, 4096); status = transport_read(credssp->transport, s); Stream_Length(s) = status; if (status < 0) { fprintf(stderr, "credssp_recv() error: %d\n", status); Stream_Free(s, TRUE); return...
0
58,523
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void RenderFlexibleBox::applyStretchAlignmentToChild(RenderBox* child, LayoutUnit lineCrossAxisExtent) { if (!isColumnFlow() && child->style()->logicalHeight().isAuto()) { if (!hasOrthogonalFlow(child)) { LayoutUnit heightBeforeStretching = needToStretchChildLogicalHeight(child) ? constrai...
0
116,637
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void LineWidth::fitBelowFloats() { ASSERT(!m_committedWidth); ASSERT(!fitsOnLine()); LayoutUnit floatLogicalBottom; LayoutUnit lastFloatLogicalBottom = m_block->logicalHeight(); float newLineWidth = m_availableWidth; float newLineLeft = m_left; float newLineRight = m_right; while ...
0
111,352
Analyze the following 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 double filter_bicubic(const double t) { const double abs_t = (double)fabs(t); const double abs_t_sq = abs_t * abs_t; if (abs_t<1) return 1-2*abs_t_sq+abs_t_sq*abs_t; if (abs_t<2) return 4 - 8*abs_t +5*abs_t_sq - abs_t_sq*abs_t; return 0; } Commit Message: gdImageScaleTwoPass memory leak fix Fixing m...
0
56,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: int ib_cm_notify(struct ib_cm_id *cm_id, enum ib_event_type event) { int ret; switch (event) { case IB_EVENT_COMM_EST: ret = cm_establish(cm_id); break; case IB_EVENT_PATH_MIG: ret = cm_migrate(cm_id); break; default: ret = -EINVAL; } return ret; } Commit Message: IB/core: Don't resolve passive...
0
38,432
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int ext4_can_truncate(struct inode *inode) { if (S_ISREG(inode->i_mode)) return 1; if (S_ISDIR(inode->i_mode)) return 1; if (S_ISLNK(inode->i_mode)) return !ext4_inode_is_fast_symlink(inode); return 0; } Commit Message: ext4: fix races between page faults and hole punching Currently, page faults and h...
0
56,547
Analyze the following 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 short vmcs_field_to_offset(unsigned long field) { if (field >= max_vmcs_field || vmcs_field_to_offset_table[field] == 0) return -1; return vmcs_field_to_offset_table[field]; } Commit Message: x86,kvm,vmx: Preserve CR4 across VM entry CR4 isn't constant; at least the TSD and PCE bits can vary. ...
0
37,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: gsicc_get_device_class(cmm_profile_t *icc_profile) { return gscms_get_device_class(icc_profile->profile_handle); } Commit Message: CWE ID: CWE-20
0
13,960
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void UrlmonUrlRequestManager::OnReadComplete(int request_id, const std::string& data) { DCHECK_NE(request_id, -1); DVLOG(1) << __FUNCTION__ << " id: " << request_id; DCHECK(LookupRequest(request_id) != NULL); ++calling_delegate_; delegate_->OnReadComplete(req...
0
100,958
Analyze the following 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 * xmlThrDefTreeIndentString(const char * v) { const char * ret; xmlMutexLock(xmlThrDefMutex); ret = xmlTreeIndentStringThrDef; xmlTreeIndentStringThrDef = v; xmlMutexUnlock(xmlThrDefMutex); return ret; } Commit Message: Attempt to address libxml crash. BUG=129930 Review URL: h...
0
107,340
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int brcmf_setup_wiphy(struct wiphy *wiphy, struct brcmf_if *ifp) { struct brcmf_pub *drvr = ifp->drvr; const struct ieee80211_iface_combination *combo; struct ieee80211_supported_band *band; u16 max_interfaces = 0; bool gscan; __le32 bandlist[3]; u32 n_bands; int err, i; wiphy->max_scan_ssids = W...
0
67,257
Analyze the following 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 smbXcli_conn_received(struct tevent_req *subreq) { struct smbXcli_conn *conn = tevent_req_callback_data(subreq, struct smbXcli_conn); TALLOC_CTX *frame = talloc_stackframe(); NTSTATUS status; uint8_t *inbuf; ssize_t received; int err; if (subreq != conn->read_smb_req) { DEBUG(1, ("Intern...
0
2,464
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PopupMenuStyle PopupContainer::menuStyle() const { return m_listBox->m_popupClient->menuStyle(); } Commit Message: [REGRESSION] Refreshed autofill popup renders garbage https://bugs.webkit.org/show_bug.cgi?id=83255 http://code.google.com/p/chromium/issues/detail?id=118374 The code used to update only the Po...
0
108,580
Analyze the following 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_connect_hardlink_files(struct iso9660 *iso9660) { struct archive_rb_node *n; struct hardlink *hl; struct isofile *target, *nf; ARCHIVE_RB_TREE_FOREACH(n, &(iso9660->hardlink_rbtree)) { hl = (struct hardlink *)n; /* The first entry must be a hardlink target. */ target = hl->file_list.first; a...
0
50,849
Analyze the following 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 OmniboxViewWin::OnKillFocus(HWND focus_wnd) { if (m_hWnd == focus_wnd) { SetMsgHandled(false); return; } model_->OnWillKillFocus(focus_wnd); ClosePopup(); GetSelection(saved_selection_for_focus_change_); model_->OnKillFocus(); ScopedFreeze freeze(this, GetTextObjectModel()); DefW...
0
107,489
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: __xmlStructuredError(void) { if (IS_MAIN_THREAD) return (&xmlStructuredError); else return (&xmlGetGlobalState()->xmlStructuredError); } Commit Message: Attempt to address libxml crash. BUG=129930 Review URL: https://chromiumcodereview.appspot.com/10458051 git-svn-id: svn://svn.chromium.org/chrome/tr...
0
107,314
Analyze the following 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 kvm_arch_destroy_vm(struct kvm *kvm) { kvm_iommu_unmap_guest(kvm); #ifdef KVM_CAP_DEVICE_ASSIGNMENT kvm_free_all_assigned_devices(kvm); #endif kfree(kvm->arch.vioapic); kvm_release_vm_pages(kvm); } Commit Message: KVM: Ensure all vcpus are consistent with in-kernel irqchip settings (cherry picked from...
0
20,580
Analyze the following 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 setup_dev_symlinks(const struct lxc_rootfs *rootfs) { char path[MAXPATHLEN]; int ret,i; struct stat s; for (i = 0; i < sizeof(dev_symlinks) / sizeof(dev_symlinks[0]); i++) { const struct dev_symlinks *d = &dev_symlinks[i]; ret = snprintf(path, sizeof(path), "%s/dev/%s", rootfs->path ? rootfs-...
0
44,633
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: u32 rds_tcp_write_seq(struct rds_tcp_connection *tc) { /* seq# of the last byte of data in tcp send buffer */ return tcp_sk(tc->t_sock->sk)->write_seq; } Commit Message: net: rds: force to destroy connection if t_sock is NULL in rds_tcp_kill_sock(). When it is to cleanup net namespace, rds_tcp_exit_net() will...
0
90,203
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GPMF_ERR GPMF_FindNext(GPMF_stream *ms, uint32_t fourcc, GPMF_LEVELS recurse) { GPMF_stream prevstate; if (ms) { memcpy(&prevstate, ms, sizeof(GPMF_stream)); if (ms->pos < ms->buffer_size_longs) { while (0 == GPMF_Next(ms, recurse)) { if (ms->buffer[ms->pos] == fourcc) { return GPMF_...
0
88,435
Analyze the following 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 __be32 nfsd4_map_bcts_dir(u32 *dir) { switch (*dir) { case NFS4_CDFC4_FORE: case NFS4_CDFC4_BACK: return nfs_ok; case NFS4_CDFC4_FORE_OR_BOTH: case NFS4_CDFC4_BACK_OR_BOTH: *dir = NFS4_CDFC4_BOTH; return nfs_ok; }; return nfserr_inval; } Commit Message: Merge tag 'nfsd-4.12' of git://linux-nf...
0
65,614
Analyze the following 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 release_object(const sp<ProcessState>& proc, const flat_binder_object& obj, const void* who) { release_object(proc, obj, who, NULL); } Commit Message: Correctly handle dup() failure in Parcel::readNativeHandle bail out if dup() fails, instead of creating an invalid native_handle_t Bug: 28395952 Chan...
0
160,201
Analyze the following 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 SampleIterator::findSampleTimeAndDuration( uint32_t sampleIndex, uint32_t *time, uint32_t *duration) { if (sampleIndex >= mTable->mNumSampleSizes) { return ERROR_OUT_OF_RANGE; } while (sampleIndex >= mTTSSampleIndex + mTTSCount) { if (mTimeToSampleIndex == mTable->mTimeToSampleCount) { return ERR...
0
157,697
Analyze the following 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 load_xref_from_plaintext(FILE *fp, xref_t *xref) { int i, buf_idx, obj_id, added_entries; char c, buf[32] = {0}; long start, pos; start = ftell(fp); /* Get number of entries */ pos = xref->end; fseek(fp, pos, SEEK_SET); while (ftell(fp) != 0) if (SAFE_F(fp, (fg...
1
169,569
Analyze the following 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 testCrash_MakeOwner_Bug20080207() { UriParserStateA state; UriUriA sourceUri; state.uri = &sourceUri; const char * const sourceUriString = "http://user:pass@somehost.com:80/"; if (uriParseUriA(&state, sourceUriString) != 0) { TEST_ASSERT(false); } if (uriNormalizeSyntaxA(&sourceUri) != 0) {...
0
75,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: static void peer_abort_upcall(struct iwch_ep *ep) { struct iw_cm_event event; PDBG("%s ep %p\n", __func__, ep); memset(&event, 0, sizeof(event)); event.event = IW_CM_EVENT_CLOSE; event.status = -ECONNRESET; if (ep->com.cm_id) { PDBG("abort delivered ep %p cm_id %p tid %d\n", ep, ep->com.cm_id, ep-...
0
56,883
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ProcXF86DRIDestroyDrawable(register ClientPtr client) { REQUEST(xXF86DRIDestroyDrawableReq); DrawablePtr pDrawable; int rc; REQUEST_SIZE_MATCH(xXF86DRIDestroyDrawableReq); if (stuff->screen >= screenInfo.numScreens) { client->errorValue = stuff->screen; return BadValue; }...
0
17,736
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void aio_free_ring(struct kioctx *ctx) { struct aio_ring_info *info = &ctx->ring_info; long i; for (i=0; i<info->nr_pages; i++) put_page(info->ring_pages[i]); if (info->mmap_size) { BUG_ON(ctx->mm != current->mm); vm_munmap(info->mmap_base, info->mmap_size); } if (info->ring_pages && info->r...
0
58,707
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void GetMinimumPixelList(PixelList *pixel_list,MagickPixelPacket *pixel) { register SkipList *list; register ssize_t channel; size_t color, minimum; ssize_t count; unsigned short channels[ListChannels]; /* Find the minimum value for each of the color. */ for...
0
88,940
Analyze the following 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 vmci_transport_is_trusted(struct vsock_sock *vsock, u32 peer_cid) { return vsock->trusted || vmci_is_context_owner(peer_cid, vsock->owner->uid); } Commit Message: VSOCK: vmci - fix possible info leak in vmci_transport_dgram_dequeue() In case we received no data on the call to skb_recv_datag...
0
30,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: int SpdyProxyClientSocket::Connect(const CompletionCallback& callback) { DCHECK(read_callback_.is_null()); if (next_state_ == STATE_OPEN) return OK; DCHECK_EQ(STATE_DISCONNECTED, next_state_); next_state_ = STATE_GENERATE_AUTH_TOKEN; int rv = DoLoop(OK); if (rv == ERR_IO_PENDING) read_callba...
0
129,352
Analyze the following 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 WebKitTestController::ResetAfterLayoutTest() { DCHECK(CalledOnValidThread()); printer_->PrintTextFooter(); printer_->PrintImageFooter(); printer_->CloseStderr(); send_configuration_to_next_host_ = false; test_phase_ = BETWEEN_TESTS; is_compositing_test_ = false; enable_pixel_dumping_ = false;...
0
123,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: static AttributeTextStyle compositionTextStyle() { AttributeTextStyle style; addCompositionTextStyleToAttributeTextStyle(style); return style; } 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...
0
104,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 void tsc_khz_changed(void *data) { struct cpufreq_freqs *freq = data; unsigned long khz = 0; if (data) khz = freq->new; else if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC)) khz = cpufreq_quick_get(raw_smp_processor_id()); if (!khz) khz = tsc_khz; __this_cpu_write(cpu_tsc_khz, khz); } Commit Mess...
0
20,886
Analyze the following 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 gf_isom_linf_write_entry(void *entry, GF_BitStream *bs) { GF_LHVCLayerInformation* ptr = (GF_LHVCLayerInformation *)entry; u32 i, count; if (!ptr) return GF_OK; gf_bs_write_int(bs, 0, 2); count=gf_list_count(ptr->num_layers_in_track); gf_bs_write_int(bs, count, 6); for (i = 0; i < count; i++) { L...
0
84,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: LocalFrame* ResourceFetcher::frame() const { if (m_documentLoader) return m_documentLoader->frame(); if (m_document && m_document->importsController()) return m_document->importsController()->master()->frame(); return 0; } Commit Message: Enforce SVG image security rules SVG images h...
0
121,249
Analyze the following 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::FocusNextPane() { UserMetrics::RecordAction(UserMetricsAction("FocusNextPane"), profile_); window_->RotatePaneFocus(true); } 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...
0
98,234
Analyze the following 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 InputMethodController::SetComposition( const String& text, const Vector<CompositionUnderline>& underlines, int selection_start, int selection_end) { Editor::RevealSelectionScope reveal_selection_scope(&GetEditor()); GetDocument().UpdateStyleAndLayoutTree(); SelectComposition(); if ...
0
124,893
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void V8Console::CommandLineAPIScope::accessorGetterCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) { CommandLineAPIScope* scope = static_cast<CommandLineAPIScope*>(info.Data().As<v8::External>()->Value()); DCHECK(scope); v8::Local<v8::Context> context = info.GetIso...
0
130,282
Analyze the following 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 createDecodingBaseline(SharedBuffer* data, Vector<unsigned>* baselineHashes) { OwnPtr<GIFImageDecoder> decoder = createDecoder(); decoder->setData(data, true); size_t frameCount = decoder->frameCount(); for (size_t i = 0; i < frameCount; ++i) { ImageFrame* frame = decoder->frameBuffer...
0
129,088
Analyze the following 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 PrintViewManager::PrintPreviewDone() { DCHECK_CURRENTLY_ON(BrowserThread::UI); if (print_preview_state_ == NOT_PREVIEWING) return; if (print_preview_state_ == SCRIPTED_PREVIEW) { auto& map = g_scripted_print_preview_closure_map.Get(); auto it = map.find(scripted_print_preview_rph_); CH...
0
135,615
Analyze the following 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 fm10k_rx_checksum(struct fm10k_ring *ring, union fm10k_rx_desc *rx_desc, struct sk_buff *skb) { skb_checksum_none_assert(skb); /* Rx checksum disabled via ethtool */ if (!(ring->netdev->features & NETIF_F_RXCSUM)) return; /* TCP/UDP checksum error bit is set */ if (fm...
0
87,943
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: HRESULT CGaiaCredentialBase::GetComboBoxValueCount(DWORD field_id, DWORD* pcItems, DWORD* pdwSelectedItem) { return E_NOTIMPL; } Commit Message: [GCPW] Disallow sign in of consumer accounts when mdm is enabled...
0
130,692
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SkSampler* SkIcoCodec::getSampler(bool createIfNecessary) { if (fCurrScanlineCodec) { SkASSERT(!fCurrIncrementalCodec); return fCurrScanlineCodec->getSampler(createIfNecessary); } if (fCurrIncrementalCodec) { return fCurrIncrementalCodec->getSampler(createIfNecessary); } return nullptr; } Commit Messag...
0
162,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: base::string16 GetDisplayName(int64_t display_id) { return base::UTF8ToUTF16( GetDisplayManager()->GetDisplayNameForId(display_id)); } Commit Message: Avoid Showing rotation change notification when source is accelerometer BUG=717252 TEST=Manually rotate device with accelerometer and observe there's no ...
0
129,488
Analyze the following 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 infe_dump(GF_Box *a, FILE * trace) { GF_ItemInfoEntryBox *p = (GF_ItemInfoEntryBox *)a; gf_isom_box_dump_start(a, "ItemInfoEntryBox", trace); fprintf(trace, "item_ID=\"%d\" item_protection_index=\"%d\" item_name=\"%s\" content_type=\"%s\" content_encoding=\"%s\" item_type=\"%s\">\n", p->item_ID, p->item...
0
80,769
Analyze the following 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 write_node_summaries(struct f2fs_sb_info *sbi, block_t start_blk) { write_normal_summaries(sbi, start_blk, CURSEG_HOT_NODE); } Commit Message: f2fs: fix a panic caused by NULL flush_cmd_control Mount fs with option noflush_merge, boot failed for illegal address fcc in function f2fs_issue_flush: i...
0
85,434
Analyze the following 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 rngapi_reset(struct crypto_rng *tfm, const u8 *seed, unsigned int slen) { u8 *buf = NULL; u8 *src = (u8 *)seed; int err; if (slen) { buf = kmalloc(slen, GFP_KERNEL); if (!buf) return -ENOMEM; memcpy(buf, seed, slen); src = buf; } err = crypto_old_rng_alg(tfm)->rng_reset(tfm, src, sl...
1
167,734
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PassRefPtr<EntityReference> Document::createEntityReference(const String& name, ExceptionCode& ec) { if (!isValidName(name)) { ec = INVALID_CHARACTER_ERR; return 0; } if (isHTMLDocument()) { ec = NOT_SUPPORTED_ERR; return 0; } return EntityReference::create(this...
0
105,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: ExtensionInfoMap* ExtensionSystemImpl::info_map() { return shared_->info_map(); } Commit Message: Check prefs before allowing extension file access in the permissions API. R=mpcomplete@chromium.org BUG=169632 Review URL: https://chromiumcodereview.appspot.com/11884008 git-svn-id: svn://svn.chromium.org/ch...
0
115,942
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: virtual status_t getPropertyByteArray(String8 const &name, Vector<uint8_t> &value) const { Parcel data, reply; data.writeInterfaceToken(IDrm::getInterfaceDescriptor()); data.writeString8(name); status_t status = remote()->transact(GET_PROPERTY_BYTE_ARRAY, data, &reply); if (status != OK) { r...
0
161,286
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void ipa_draw_polygon(wmfAPI * API, wmfPolyLine_t * polyline) { if (polyline->count <= 2) return; if (TO_FILL(polyline) || TO_DRAW(polyline)) { int point; /* Save graphic wand */ (void) PushDrawingWand(WmfDrawingWand); util_set_pen(API, polyline->dc); ut...
0
71,827
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: format_DEC_MPLS_TTL(const struct ofpact_null *a OVS_UNUSED, struct ds *s) { ds_put_format(s, "%sdec_mpls_ttl%s", colors.value, colors.end); } Commit Message: ofp-actions: Avoid buffer overread in BUNDLE action decoding. Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9052 Signed-off-by: B...
0
76,921
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xsltCleanupTemplates(xsltStylesheetPtr style ATTRIBUTE_UNUSED) { } Commit Message: Handle a bad XSLT expression better. BUG=138672 Review URL: https://chromiumcodereview.appspot.com/10830177 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150123 0039d316-1c4b-4281-b951-d872f2087c98 CWE ID: CWE-399
0
106,440
Analyze the following 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::BindFullscreen( mojom::FullscreenVideoElementHandlerAssociatedRequest request) { fullscreen_binding_.Bind(std::move(request), GetTaskRunner(blink::TaskType::kInternalIPC)); } Commit Message: Convert FrameHostMsg_DidAddMessageToConsole to Mojo. Note: Since t...
0
139,520
Analyze the following 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 GLES2Implementation::SetColorSpaceMetadataCHROMIUM( GLuint texture_id, GLColorSpace color_space) { #if defined(__native_client__) SetGLError(GL_INVALID_VALUE, "GLES2::SetColorSpaceMetadataCHROMIUM", "not supported"); #else gfx::ColorSpace* gfx_color_space = reinterpret_cast<gfx...
0
141,117
Analyze the following 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 WebContentsImpl::IsLoadingToDifferentDocument() const { return IsLoading() && is_load_to_different_document_; } Commit Message: Don't show current RenderWidgetHostView while interstitial is showing. Also moves interstitial page tracking from RenderFrameHostManager to WebContents, since interstitial page...
0
136,251
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void cpu_clock_event_stop(struct perf_event *event, int flags) { perf_swevent_cancel_hrtimer(event); cpu_clock_event_update(event); } 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 no...
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: static void _php_image_bw_convert(gdImagePtr im_org, gdIOCtx *out, int threshold) { gdImagePtr im_dest; int white, black; int color, color_org, median; int dest_height = gdImageSY(im_org); int dest_width = gdImageSX(im_org); int x, y; TSRMLS_FETCH(); im_dest = gdImageCreate(dest_width, dest_height); if ...
0
15,183
Analyze the following 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 kvp_key_delete(int pool, __u8 *key, int key_size) { int i; int j, k; int num_records; struct kvp_record *record; /* * First update the in-memory state. */ kvp_update_mem_state(pool); num_records = kvp_file_info[pool].num_records; record = kvp_file_info[pool].records; for (i = 0; i < num...
0
18,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: MagickExport MagickBooleanType BlackThresholdImage(Image *image, const char *thresholds,ExceptionInfo *exception) { #define ThresholdImageTag "Threshold/Image" CacheView *image_view; GeometryInfo geometry_info; MagickBooleanType status; MagickOffsetType progress; PixelInfo th...
0
89,046
Analyze the following 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 rose_set_loopback_timer(void) { del_timer(&loopback_timer); loopback_timer.data = 0; loopback_timer.function = &rose_loopback_timer; loopback_timer.expires = jiffies + 10; add_timer(&loopback_timer); } Commit Message: rose: Add length checks to CALL_REQUEST parsing Define some constant o...
0
22,225
Analyze the following 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 gdImageColorClosest (gdImagePtr im, int r, int g, int b) { return gdImageColorClosestAlpha (im, r, g, b, gdAlphaOpaque); } Commit Message: iFixed bug #72446 - Integer Overflow in gdImagePaletteToTrueColor() resulting in heap overflow CWE ID: CWE-190
0
51,422
Analyze the following 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 output_frame(H264Context *h, AVFrame *dst, Picture *srcp) { AVFrame *src = &srcp->f; int i; int ret = av_frame_ref(dst, src); if (ret < 0) return ret; av_dict_set(&dst->metadata, "stereo_mode", ff_h264_sei_stereo_mode(h), 0); if (!srcp->crop) return 0; for...
0
28,264
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void ChromeRenderMessageFilter::OnCanTriggerClipboardRead( const GURL& origin, bool* allowed) { *allowed = extension_info_map_->SecurityOriginHasAPIPermission( origin, render_process_id_, ExtensionAPIPermission::kClipboardRead); } Commit Message: Make chrome.appWindow.create() provide access to the c...
0
105,322
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: virtual void AddObserver(ImageTransportFactoryObserver* observer) { observer_list_.AddObserver(observer); } 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 ...
0
114,468
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool MultibufferDataSource::GetSize(int64_t* size_out) { base::AutoLock auto_lock(lock_); if (total_bytes_ != kPositionNotSpecified) { *size_out = total_bytes_; return true; } *size_out = 0; return false; } Commit Message: Simplify "WouldTaintOrigin" concept in media/blink Currently WebMediaPl...
0
144,216
Analyze the following 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 floppy_module_exit(void) { int drive; blk_unregister_region(MKDEV(FLOPPY_MAJOR, 0), 256); unregister_blkdev(FLOPPY_MAJOR, "fd"); platform_driver_unregister(&floppy_driver); destroy_workqueue(floppy_wq); for (drive = 0; drive < N_DRIVE; drive++) { del_timer_sync(&motor_off_timer[drive...
0
39,368
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: String HTMLFormControlElement::nameForAutofill() const { String fullName = name(); String trimmedName = fullName.stripWhiteSpace(); if (!trimmedName.isEmpty()) return trimmedName; fullName = getIdAttribute(); trimmedName = fullName.stripWhiteSpace(); return trimmedName; } Commit M...
0
113,929
Analyze the following 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 sspi_SecureHandleSetUpperPointer(SecHandle* handle, void* pointer) { if (!handle) return; handle->dwUpper = (ULONG_PTR) (~((size_t) pointer)); } Commit Message: nla: invalidate sec handle after creation If sec pointer isn't invalidated after creation it is not possible to check if the upper and lower ...
0
58,621