instruction
stringclasses
1 value
input
stringlengths
64
129k
output
int64
0
1
__index_level_0__
int64
0
30k
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int jas_iccprof_readhdr(jas_stream_t *in, jas_icchdr_t *hdr) { if (jas_iccgetuint32(in, &hdr->size) || jas_iccgetuint32(in, &hdr->cmmtype) || jas_iccgetuint32(in, &hdr->version) || jas_iccgetuint32(in, &hdr->clas) || jas_iccgetuint32(in, &hdr->colorspc) || jas_iccgetuint32(in, &hdr->refcolo...
0
1,607
Analyze the following 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 skcipher_accept_parent(void *private, struct sock *sk) { struct skcipher_ctx *ctx; struct alg_sock *ask = alg_sk(sk); unsigned int len = sizeof(*ctx) + crypto_skcipher_reqsize(private); ctx = sock_kmalloc(sk, len, GFP_KERNEL); if (!ctx) return -ENOMEM; ctx->iv = sock_kmalloc(sk, crypt...
1
4,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: void ScrollHitTestDisplayItem::Record( GraphicsContext& context, const DisplayItemClient& client, DisplayItem::Type type, scoped_refptr<const TransformPaintPropertyNode> scroll_offset_node) { PaintController& paint_controller = context.GetPaintController(); DCHECK_NE(paint_controller.C...
1
14,631
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: hb_buffer_get_script (hb_buffer_t *buffer) { return buffer->script; } Commit Message: CWE ID:
0
10,837
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xps_select_font_encoding(xps_font_t *font, int idx) { byte *cmapdata, *entry; int pid, eid; if (idx < 0 || idx >= font->cmapsubcount) return 0; cmapdata = font->data + font->cmaptable; entry = cmapdata + 4 + idx * 8; pid = u16(entry + 0); eid = u16(entry + 2); font->cmapsub...
0
9,155
Analyze the following 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 perf_tp_event(u16 event_type, u64 count, void *record, int entry_size, struct pt_regs *regs, struct hlist_head *head, int rctx, struct task_struct *task) { struct perf_sample_data data; struct perf_event *event; struct perf_raw_record raw = { .frag = { .size = entry_size, .data = record...
0
4,473
Analyze the following 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_xdr_enc_getacl(struct rpc_rqst *req, __be32 *p, struct nfs_getaclargs *args) { struct xdr_stream xdr; struct rpc_auth *auth = req->rq_task->tk_msg.rpc_cred->cr_auth; struct compound_hdr hdr = { .nops = 2, }; int replen, status; xdr_init_encode(&xdr, &req->rq_snd_buf, p); encode_compound_hdr(&xd...
0
17,443
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON *item, char *buf, const int len, const cJSON_bool fmt) { printbuffer p = { 0, 0, 0, 0, 0, 0, { 0, 0, 0 } }; if ((len < 0) || (buf == NULL)) { return false; } p.buffer = (unsigned char*)buf; p.length = (size_t)len; p.offse...
0
19,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: void* sspi_SecureHandleGetUpperPointer(SecHandle* handle) { void* pointer; if (!handle) return NULL; pointer = (void*) ~((size_t) handle->dwUpper); return pointer; } Commit Message: nla: invalidate sec handle after creation If sec pointer isn't invalidated after creation it is not possible to che...
1
15,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: test_bson_visit_unsupported_type (void) { /* {k: 1}, but instead of BSON type 0x10 (int32), use unknown type 0x33 */ const char data[] = "\x0c\x00\x00\x00\x33k\x00\x01\x00\x00\x00\x00"; bson_t b; bson_iter_t iter; unsupported_type_test_data_t context = {0}; bson_visitor_t visitor = {0}; visi...
0
24,985
Analyze the following 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 SimulateGesturePinchSequence(WebContents* web_contents, const gfx::Point& point, float scale, blink::WebGestureDevice source_device) { RenderWidgetHostImpl* widget_host = RenderWidgetHostImpl::From( ...
0
5,595
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: String AXNodeObject::nativeTextAlternative( AXObjectSet& visited, AXNameFrom& nameFrom, AXRelatedObjectVector* relatedObjects, NameSources* nameSources, bool* foundTextAlternative) const { if (!getNode()) return String(); if (nameSources) ASSERT(relatedObjects); String textAlte...
0
6,193
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void NavigationNotificationObserver::ConditionMet( AutomationMsg_NavigationResponseValues navigation_result) { if (automation_) { if (use_json_interface_) { if (navigation_result == AUTOMATION_MSG_NAVIGATION_SUCCESS) { DictionaryValue dict; dict.SetInteger("result", navigation_resu...
0
23,415
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: get_schema_version(const char *name) { int lpc = 0; if(name == NULL) { name = "none"; } for (; lpc < xml_schema_max; lpc++) { if (safe_str_eq(name, known_schemas[lpc].name)) { return lpc; } } return -1; } Commit Message: Fix: acl: Do not delay evaluati...
0
27,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: String AXNodeObject::placeholderFromNativeAttribute() const { Node* node = getNode(); if (!node || !isTextControlElement(node)) return String(); return toTextControlElement(node)->strippedPlaceholder(); } Commit Message: Switch to equalIgnoringASCIICase throughout modules/accessibility BUG=627682 Rev...
0
8,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: void SendNotifications(AppCacheEventID event_id) { for (NotifyHostMap::iterator it = hosts_to_notify.begin(); it != hosts_to_notify.end(); ++it) { AppCacheFrontend* frontend = it->first; frontend->OnEventRaised(it->second, event_id); } } Commit Message: AppCache: fix a browser cr...
0
14,742
Analyze the following 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 Plugin::GetExitStatus(NaClSrpcArg* prop_value) { PLUGIN_PRINTF(("GetExitStatus (this=%p)\n", reinterpret_cast<void*>(this))); prop_value->tag = NACL_SRPC_ARG_TYPE_INT; prop_value->u.ival = exit_status(); } Commit Message: Revert 143656 - Add an IPC channel between the NaCl loader process and the rende...
0
11,919
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int append_camera_metadata(camera_metadata_t *dst, const camera_metadata_t *src) { if (dst == NULL || src == NULL ) return ERROR; if (dst->entry_capacity < src->entry_count + dst->entry_count) return ERROR; if (dst->data_capacity < src->data_count + dst->data_count) return ERROR; memcpy(get_entries(dst)...
0
6,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 PPResultAndExceptionToNPResult::IgnoreException() { checked_exception_ = true; } Commit Message: Fix invalid read in ppapi code BUG=77493 TEST=attached test Review URL: http://codereview.chromium.org/6883059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82172 0039d316-1c4b-4281-b951-d872f2087c98 ...
0
23,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 RTCPeerConnectionHandlerChromium::setLocalDescription(PassRefPtr<RTCVoidRequest> request, PassRefPtr<RTCSessionDescriptionDescriptor> sessionDescription) { if (!m_webHandler) return; m_webHandler->setLocalDescription(request, sessionDescription); } Commit Message: Unreviewed, rolling out r12...
1
4,643
Analyze the following 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 bi_complete(struct bio *bio, int error) { complete((struct completion *)bio->bi_private); } Commit Message: ext4: use ext4_get_block_write in buffer write Allocate uninitialized extent before ext4 buffer write and convert the extent to initialized after io completes. The purpose is to make sure an ...
0
16,315
Analyze the following 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 __init int ftrace_test_event_filter(void) { int i; printk(KERN_INFO "Testing ftrace filter: "); for (i = 0; i < DATA_CNT; i++) { struct event_filter *filter = NULL; struct test_filter_data_t *d = &test_filter_data[i]; int err; err = create_filter(&event_ftrace_test_filter, d->filter, ...
0
10,221
Analyze the following 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 icccomponents(i_ctx_t * i_ctx_p, ref *space, int *n) { int code = 0; ref *tempref, ICCdict; code = array_get(imemory, space, 1, &ICCdict); if (code < 0) return code; code = dict_find_string(&ICCdict, "N", &tempref); if (code < 0) return code; if (code == 0)...
0
12,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 HTMLFormControlElement::didRecalcStyle(StyleRecalcChange) { if (RenderObject* renderer = this->renderer()) renderer->updateFromElement(); } Commit Message: Add HTMLFormControlElement::supportsAutofocus to fix a FIXME comment. This virtual function should return true if the form control can hanl...
0
27,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 AutocompleteEditModel::FinalizeInstantQuery( const string16& input_text, const string16& suggest_text, bool skip_inline_autocomplete) { if (skip_inline_autocomplete) { const string16 final_text = input_text + suggest_text; view_->OnBeforePossibleChange(); view_->SetWindowTextAndCare...
0
11,764
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: JNI_ChromeFeatureList_GetFieldTrialParamByFeature( JNIEnv* env, const JavaParamRef<jclass>& clazz, const JavaParamRef<jstring>& jfeature_name, const JavaParamRef<jstring>& jparam_name) { const base::Feature* feature = FindFeatureExposedToJava(ConvertJavaStringToUTF8(env, jfeature_name)); ...
0
21,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: static int __dev_set_mtu(struct net_device *dev, int new_mtu) { const struct net_device_ops *ops = dev->netdev_ops; if (ops->ndo_change_mtu) return ops->ndo_change_mtu(dev, new_mtu); dev->mtu = new_mtu; return 0; } Commit Message: tunnels: Don't apply GRO to multiple layers of encapsulation. When driver...
0
8,985
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: zisofs_finish_entry(struct archive_write *a) { struct iso9660 *iso9660 = a->format_data; struct isofile *file = iso9660->cur_file; unsigned char buff[16]; size_t s; int64_t tail; /* Direct temp file stream to zisofs temp file stream. */ archive_entry_set_size(file->entry, iso9660->zisofs.total_size); /*...
0
19,810
Analyze the following 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::ContentRestrictionsChanged(WebContents* source) { command_controller_->ContentRestrictionsChanged(); } Commit Message: Remove TabContents from TabStripModelObserver::TabDetachedAt. BUG=107201 TEST=no visible change Review URL: https://chromiumcodereview.appspot.com/11293205 git-svn-id: svn://...
0
8,553
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: client_skip_proxy(struct archive_read_filter *self, int64_t request) { if (request < 0) __archive_errx(1, "Negative skip requested."); if (request == 0) return 0; if (self->archive->client.skipper != NULL) { /* Seek requests over 1GiB are broken down into * multiple seeks. This avoids overflows when...
0
10,926
Analyze the following 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 HB_Error Lookup_PairPos( GPOS_Instance* gpi, HB_GPOS_SubTable* st, HB_Buffer buffer, HB_UShort flags, HB_UShort context_length, int nesting_level ) { HB_Error error; HB_UShort index, property; HB_UInt first_pos;...
0
1,518
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int tcp_cookie_generator(u32 *bakery) { unsigned long jiffy = jiffies; if (unlikely(time_after_eq(jiffy, tcp_secret_generating->expires))) { spin_lock_bh(&tcp_secret_locker); if (!time_after_eq(jiffy, tcp_secret_generating->expires)) { /* refreshed by another */ memcpy(bakery, &tcp_secret_g...
0
17,941
Analyze the following 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 ecryptfs_exit(void) { int rc; rc = ecryptfs_destroy_crypto(); if (rc) printk(KERN_ERR "Failure whilst attempting to destroy crypto; " "rc = [%d]\n", rc); ecryptfs_release_messaging(); ecryptfs_destroy_kthread(); do_sysfs_unregistration(); unregister_filesystem(&ecryptfs_fs_ty...
0
13,618
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int WebPEncodeProgress(int percent,const WebPPicture* picture) { #define EncodeImageTag "Encode/Image" Image *image; MagickBooleanType status; image=(Image *) picture->custom_ptr; status=SetImageProgress(image,EncodeImageTag,percent-1,100); return(status == MagickFalse ? 0 : 1); } Co...
0
12,136
Analyze the following 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 ResetState() { nav_handle1_.reset(); nav_handle2_.reset(); nav_handle3_.reset(); throttle1_.reset(); throttle2_.reset(); throttle3_.reset(); contents1_.reset(); contents2_.reset(); contents3_.reset(); } Commit Message: Connect the LocalDB to TabManager. Bug: 773...
1
29,859
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PHPAPI void var_push_dtor_no_addref(php_unserialize_data_t *var_hashx, zval **rval) { var_entries *var_hash = (*var_hashx)->last_dtor; #if VAR_ENTRIES_DBG fprintf(stderr, "var_push_dtor_no_addref(%ld): %d (%d)\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(rval), Z_REFCOUNT_PP(rval)); #endif if (!var_hash |...
0
28,130
Analyze the following 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 FactoryRegistry::ResetFunctions() { RegisterFunction<GetWindowFunction>(); RegisterFunction<GetCurrentWindowFunction>(); RegisterFunction<GetLastFocusedWindowFunction>(); RegisterFunction<GetAllWindowsFunction>(); RegisterFunction<CreateWindowFunction>(); RegisterFunction<UpdateWindowFunction>()...
1
22,005
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void CloseObjectFiles() { #if !defined(NDEBUG) std::map<std::string, int>::iterator it; for (it = modules_.begin(); it != modules_.end(); ++it) { int ret = IGNORE_EINTR(close(it->second)); DCHECK(!ret); it->second = -1; } modules_.clear(); #endif // !defined(NDEBUG) } Commi...
0
14,147
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gst_asf_demux_handle_src_event (GstPad * pad, GstObject * parent, GstEvent * event) { GstASFDemux *demux; gboolean ret; demux = GST_ASF_DEMUX (parent); switch (GST_EVENT_TYPE (event)) { case GST_EVENT_SEEK: GST_LOG_OBJECT (pad, "seek event"); ret = gst_asf_demux_handle_seek_event (de...
0
15,131
Analyze the following 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 BrowserWindowGtk::InvalidateInfoBarBits() { gtk_widget_queue_draw(toolbar_border_); gtk_widget_queue_draw(toolbar_->widget()); if (bookmark_bar_.get() && browser_->bookmark_bar_state() != BookmarkBar::DETACHED) { gtk_widget_queue_draw(bookmark_bar_->widget()); } } Commit Message: Remove Ta...
0
22,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: _zip_u2d_time(time_t intime, zip_uint16_t *dtime, zip_uint16_t *ddate) { struct tm *tm; tm = localtime(&intime); if (tm->tm_year < 80) { tm->tm_year = 80; } *ddate = (zip_uint16_t)(((tm->tm_year+1900-1980)<<9) + ((tm->tm_mon+1)<<5) + tm->tm_mday); *dtime = (zip_uint16_t)(((tm->tm_hour)<...
0
7,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: void ProcessInfoObserver::OnDetailsAvailable() { scoped_ptr<DictionaryValue> return_value(new DictionaryValue); ListValue* browser_proc_list = new ListValue(); const std::vector<ProcessData>& all_processes = processes(); for (size_t index = 0; index < all_processes.size(); ++index) { DictionaryValue* ...
0
25,481
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: vfs_kern_mount(struct file_system_type *type, int flags, const char *name, void *data) { struct mount *mnt; struct dentry *root; if (!type) return ERR_PTR(-ENODEV); mnt = alloc_vfsmnt(name); if (!mnt) return ERR_PTR(-ENOMEM); if (flags & MS_KERNMOUNT) mnt->mnt.mnt_flags = MNT_INTERNAL; root = mou...
0
10,454
Analyze the following 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 sock *nfc_llcp_accept_dequeue(struct sock *parent, struct socket *newsock) { struct nfc_llcp_sock *lsk, *n, *llcp_parent; struct sock *sk; llcp_parent = nfc_llcp_sock(parent); list_for_each_entry_safe(lsk, n, &llcp_parent->accept_queue, accept_queue) { sk = &lsk->sk; lock_sock(sk); ...
0
6,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: blink::WebMediaPlayer* RenderFrameImpl::createMediaPlayer( blink::WebLocalFrame* frame, const blink::WebURL& url, WebMediaPlayerClient* client, WebMediaPlayerEncryptedMediaClient* encrypted_client, WebContentDecryptionModule* initial_cdm) { #if defined(VIDEO_HOLE) if (!contains_media_player_...
0
25,811
Analyze the following 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 dirtyLineBoxesForRenderer(RenderObject* o, bool fullLayout) { if (o->isText()) { RenderText* renderText = toRenderText(o); renderText->dirtyLineBoxes(fullLayout); } else toRenderInline(o)->dirtyLineBoxes(fullLayout); } Commit Message: Update containtingIsolate t...
0
3,348
Analyze the following 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 smp_task_done(struct sas_task *task) { if (!del_timer(&task->slow_task->timer)) return; complete(&task->slow_task->completion); } Commit Message: scsi: libsas: fix memory leak in sas_smp_get_phy_events() We've got a memory leak with the following producer: while true; do cat /sys/class/sas_phy/...
0
7,975
Analyze the following 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 DownloadItemImpl::UpdateValidatorsOnResumption( const DownloadCreateInfo& new_create_info) { DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_EQ(RESUMING_INTERNAL, state_); DCHECK(!new_create_info.url_chain.empty()); std::vector<GURL>::const_iterator chain_iter = new_create_info.url_chain.be...
0
5,712
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gdImagePtr gdImageScaleTwoPass(const gdImagePtr src, const unsigned int src_width, const unsigned int src_height, const unsigned int new_width, const unsigned int new_height) { gdImagePtr tmp_im; gdImagePtr dst; tmp_im = gdImageCreateTrueColor(new_width, src_height); if (tmp_im == NULL) { return NULL; } ...
0
22,297
Analyze the following 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 hmac_sha256_init(struct ahash_request *req) { struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); struct hash_ctx *ctx = crypto_ahash_ctx(tfm); ctx->config.data_format = HASH_DATA_8_BITS; ctx->config.algorithm = HASH_ALGO_SHA256; ctx->config.oper_mode = HASH_OPER_MODE_HMAC; ctx->digestsize = S...
0
10,636
Analyze the following 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 ~CQTest() {} Commit Message: Merge Conflict Fix CL to lmp-mr1-release for ag/849478 DO NOT MERGE - libvpx: Pull from upstream Current HEAD: 7105df53d7dc13d5e575bc8df714ec8d1da36b06 BUG=23452792 Change-Id: Ic78176fc369e0bacc71d423e0e2e6075d004aaec CWE ID: CWE-119
0
2,771
Analyze the following 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 nntp_connect_error(struct NntpServer *nserv) { nserv->status = NNTP_NONE; mutt_error(_("Server closed connection!")); return -1; } Commit Message: Add alloc fail check in nntp_fetch_headers CWE ID: CWE-20
0
12,534
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xsltMergeSASCallback(xsltAttrElemPtr values, xsltStylesheetPtr style, const xmlChar *name, const xmlChar *ns, ATTRIBUTE_UNUSED const xmlChar *ignored) { int ret; xsltAttrElemPtr topSet; ret = xmlHashAddEntry2(style->attributeSets, name, ns, values); if (ret < 0) { /* *...
0
28,124
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void freefieldlist(struct fieldlist *l) { struct fieldlist *n; while (l) { n = l->next; free(l->section); strarray_free(l->fields); free(l->trail); if (l->rock) free(l->rock); free((char *)l); l = n; } } Commit Message: imapd: check for ...
0
28,395
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SynchronousCompositorOutputSurface::DemandDrawSw(SkCanvas* canvas) { DCHECK(CalledOnValidThread()); DCHECK(canvas); DCHECK(!current_sw_canvas_); base::AutoReset<SkCanvas*> canvas_resetter(&current_sw_canvas_, canvas); SkIRect canvas_clip; canvas->getClipDeviceBounds(&canvas_clip); gfx::Rect clip =...
0
12,450
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: _tiffWriteProc(thandle_t fd, void* buf, tmsize_t size) { size_t size_io = (size_t) size; if ((tmsize_t) size_io != size) { errno=EINVAL; return (tmsize_t) -1; } return ((tmsize_t) write((int) fd, buf, size_io)); } Commit Message: * libtiff/tif_{unix,vms,win32}.c (_TIFFmalloc): ANSI C does not require ma...
0
21,771
Analyze the following 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 odtt_dump(GF_Box *a, FILE * trace) { GF_OMADRMTransactionTrackingBox *ptr = (GF_OMADRMTransactionTrackingBox *)a; gf_isom_box_dump_start(a, "OMADRMTransactionTrackingBox", trace); fprintf(trace, "TransactionID=\""); dump_data(trace, ptr->TransactionID, 16); fprintf(trace, "\">\n"); gf_isom_box_dump_...
0
28,208
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Document* Document::CreateForTest() { return MakeGarbageCollected<Document>(DocumentInit::Create()); } Commit Message: Cleanup and remove dead code in SetFocusedElement This early-out was added in: https://crrev.com/ce8ea3446283965c7eabab592cbffe223b1cf2bc Back then, we applied fragment focus in LayoutUpdat...
0
1,072
Analyze the following 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 RenderFrameImpl::OverrideLegacySymantecCertConsoleMessage( const blink::WebURL& url, blink::WebString* console_message) { std::string console_message_string; if (GetContentClient()->renderer()->OverrideLegacySymantecCertConsoleMessage( GURL(url), &console_message_string)) { *console...
0
27,154
Analyze the following 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 svcauth_gss_set_log_badauth_func( auth_gssapi_log_badauth_func func, caddr_t data) { log_badauth = func; log_badauth_data = data; } Commit Message: Fix gssrpc data leakage [CVE-2014-9423] [MITKRB5-SA-2015-001] In svcauth_gss_accept_sec_context(), do not copy bytes from the union context into the handle...
0
23,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: static ScrollPaintPropertyNode::State ScrollState1() { ScrollPaintPropertyNode::State state; state.container_rect = IntRect(3, 5, 11, 13); state.contents_rect = IntRect(-3, -5, 27, 31); state.user_scrollable_horizontal = true; return state; } Commit Message: Reland "[CI] Make paint property nodes non-r...
0
4,171
Analyze the following 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 ExtensionTabUtil::ResolvePossiblyRelativeURL(const std::string& url_string, const extensions::Extension* extension) { NOTIMPLEMENTED(); return GURL(); } Commit Message: Do not pass URLs in onUpdated events to extensions unless they have the "tabs" permission. BUG=168442 Review URL: https://chromi...
0
9,457
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: rad_init_send_request(struct rad_handle *h, int *fd, struct timeval *tv) { int srv; /* Make sure we have a socket to use */ if (h->fd == -1) { struct sockaddr_in sin; if ((h->fd = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) { #ifdef PHP_WIN32 generr(h, "Cannot create socket: %d", WSAGetLastError(...
0
4,818
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void OmniboxViewViews::UpdateContextMenu(ui::SimpleMenuModel* menu_contents) { if (send_tab_to_self::ShouldOfferFeature( location_bar_view_->GetWebContents())) { send_tab_to_self::RecordSendTabToSelfClickResult( send_tab_to_self::kOmniboxMenu, SendTabToSelfClickResult::kShowItem); int ...
0
9,124
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void NavigationControllerImpl::NotifyNavigationEntryCommitted( LoadCommittedDetails* details) { details->entry = GetLastCommittedEntry(); ssl_manager_.DidCommitProvisionalLoad(*details); delegate_->NotifyNavigationStateChanged(INVALIDATE_TYPE_ALL); delegate_->NotifyNavigationEntryCommitted(*details)...
0
28,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: struct inode *find_inode_nowait(struct super_block *sb, unsigned long hashval, int (*match)(struct inode *, unsigned long, void *), void *data) { struct hlist_head *head = inode_hashtable + hash(sb, hashval); struct inode *inode, *ret_inode = NULL; int mval; spin_lock(&inode_hash_lock);...
0
10,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: Document& Document::AxObjectCacheOwner() const { Document* doc = const_cast<Document*>(this); if (doc->GetFrame() && doc->GetFrame()->PagePopupOwner()) { DCHECK(!doc->ax_object_cache_); return doc->GetFrame() ->PagePopupOwner() ->GetDocument() .AxObjectCacheOwner(); } retur...
0
16,855
Analyze the following 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 WebPagePrivate::setCompositorDrawsRootLayer(bool compositorDrawsRootLayer) { #if USE(ACCELERATED_COMPOSITING) if (m_page->settings()->forceCompositingMode() == compositorDrawsRootLayer) return; m_page->settings()->setForceCompositingMode(compositorDrawsRootLayer); if (!m_mainFrame) ...
0
12,023
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static apr_byte_t oidc_check_cookie_domain(request_rec *r, oidc_cfg *cfg, oidc_session_t *session) { const char *c_cookie_domain = cfg->cookie_domain ? cfg->cookie_domain : oidc_get_current_url_host(r); const char *s_cookie_domain = oidc_session_get_cookie_domain(r, session); if ((s_cookie_domain == ...
0
23,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: static void perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) { TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); RefPtr<TestInterfaceEmpty> result(imp->perWorldBindingsReadonlyTestInterfaceEmptyAttribute()); ...
0
7,414
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: irc_server_timer_sasl_cb (void *data, int remaining_calls) { struct t_irc_server *server; /* make C compiler happy */ (void) remaining_calls; server = (struct t_irc_server *)data; if (!server) return WEECHAT_RC_ERROR; server->hook_timer_sasl = NULL; if ...
0
26,865
Analyze the following 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 checkMidpoints(LineMidpointState& lineMidpointState, InlineIterator& lBreak) { if (lBreak.m_obj && lineMidpointState.numMidpoints && !(lineMidpointState.numMidpoints % 2)) { InlineIterator* midpoints = lineMidpointState.midpoints.data(); InlineIterator& endpoint = midpoints[lineMid...
0
19,992
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int coolkey_final_iterator(list_t *list) { list_iterator_stop(list); return SC_SUCCESS; } Commit Message: fixed out of bounds reads Thanks to Eric Sesterhenn from X41 D-SEC GmbH for reporting and suggesting security fixes. CWE ID: CWE-125
0
16,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: PHP_FUNCTION(stream_context_set_params) { zval *params, *zcontext; php_stream_context *context; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra", &zcontext, &params) == FAILURE) { RETURN_FALSE; } context = decode_context_param(zcontext TSRMLS_CC); if (!context) { php_error_docref(NULL TSRMLS_...
0
2,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: static dbus_uint32_t fromAscii(char ascii) { if(ascii >= '0' && ascii <= '9') return ascii - '0'; if(ascii >= 'A' && ascii <= 'F') return ascii - 'A' + 10; if(ascii >= 'a' && ascii <= 'f') return ascii - 'a' + 10; return 0; } Commit Message: CWE ID: CWE-20
0
9,832
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ssh_packet_read_seqnr(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p) { struct session_state *state = ssh->state; int len, r, ms_remain; fd_set *setp; char buf[8192]; struct timeval timeout, start, *timeoutp = NULL; DBG(debug("packet_read()")); setp = calloc(howmany(state->connection_in + 1, NFD...
0
20,089
Analyze the following 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 VideoCaptureManager::TakePhoto( int session_id, media::VideoCaptureDevice::TakePhotoCallback callback) { DCHECK_CURRENTLY_ON(BrowserThread::IO); VideoCaptureController* controller = LookupControllerBySessionId(session_id); if (!controller) return; if (controller->IsDeviceAlive()) { c...
0
14,382
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: RootInlineBox* RenderBlock::lineAtIndex(int i) const { ASSERT(i >= 0); if (style()->visibility() != VISIBLE) return 0; if (childrenInline()) { for (RootInlineBox* box = firstRootBox(); box; box = box->nextRootBox()) if (!i--) return box; } else { ...
0
18,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: bool HTMLFormElement::matchesValidityPseudoClasses() const { return true; } Commit Message: Enforce form-action CSP even when form.target is present. BUG=630332 Review-Url: https://codereview.chromium.org/2464123004 Cr-Commit-Position: refs/heads/master@{#429922} CWE ID: CWE-19
0
21,254
Analyze the following 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 CL_DownloadsComplete( void ) { #ifdef USE_CURL if(clc.cURLUsed) { clc.cURLUsed = qfalse; CL_cURL_Shutdown(); if( clc.cURLDisconnected ) { if(clc.downloadRestart) { FS_Restart(clc.checksumFeed); clc.downloadRestart = qfalse; } clc.cURLDisconnected = qfalse; CL_Reconnect_f(); re...
0
28,939
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ProfileSyncServiceHarness* LiveSyncTest::GetClient(int index) { if (clients_.empty()) LOG(FATAL) << "SetupClients() has not yet been called."; if (index < 0 || index >= static_cast<int>(clients_.size())) LOG(FATAL) << "GetClient(): Index is out of bounds."; return clients_[index]; } Commit Message:...
0
13,531
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GLvoid StubGLVertexAttrib4fv(GLuint indx, const GLfloat* values) { glVertexAttrib4fv(indx, values); } Commit Message: Add chromium_code: 1 to surface.gyp and gl.gyp to pick up -Werror. It looks like this was dropped accidentally in http://codereview.chromium.org/6718027 (surface.gyp) and http://codereview.chr...
0
27,885
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xsltCompilationCtxtFree(xsltCompilerCtxtPtr cctxt) { if (cctxt == NULL) return; #ifdef WITH_XSLT_DEBUG_PARSING xsltGenericDebug(xsltGenericDebugContext, "Freeing compilation context\n"); xsltGenericDebug(xsltGenericDebugContext, "### Max inodes: %d\n", cctxt->maxNodeInfos); xsltGenericDebug(xsl...
0
26,540
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: free_options(struct mtree_option *head) { struct mtree_option *next; for (; head != NULL; head = next) { next = head->next; free(head->value); free(head); } } Commit Message: Fix libarchive/archive_read_support_format_mtree.c:1388:11: error: array subscript is above array bounds CWE ID: CWE-119
0
22,164
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void Wait() { std::vector<DownloadItem*> downloads; manager_->GetAllDownloads(&downloads); if (!downloads.empty()) return; waiting_ = true; content::RunMessageLoop(); waiting_ = false; } Commit Message: When turning a download into a navigation, navigate the right frame Code ch...
0
9,685
Analyze the following 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 RenderViewImpl::willSendRequest(WebFrame* frame, unsigned identifier, WebURLRequest& request, const WebURLResponse& redirect_response) { if (request.url().isEmpty()) return; WebFrame* top_f...
0
13,581
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void reportResourceTiming(ResourceTimingInfo* info, Document* initiatorDocument, bool isMainResource) { if (initiatorDocument && isMainResource) initiatorDocument = initiatorDocument->parentDocument(); if (!initiatorDocument || !initiatorDocument->loader()) return; if (DOMWindow...
0
14,022
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ExtensionFunction::ResponseAction TabsGoForwardFunction::Run() { std::unique_ptr<tabs::GoForward::Params> params( tabs::GoForward::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); int tab_id = params->tab_id ? *params->tab_id : -1; std::string error; WebContents* web_contents =...
0
19,259
Analyze the following 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 readonlyDOMTimeStampMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); TestObjectPythonV8Internal::readonlyDOMTimeStampMethodMethod(info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); } Commit Message: docu...
0
19,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: bool ShouldHandle(const HttpRequest& request, const std::string& path_prefix) { GURL url = request.GetURL(); return url.path() == path_prefix || base::StartsWith(url.path(), path_prefix + "/", base::CompareCase::SENSITIVE); } Commit Message: Fix ChromeResourceDispatcherHost...
0
14,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: void WallpaperManagerBase::OnCustomizedDefaultWallpaperDecoded( const GURL& wallpaper_url, std::unique_ptr<CustomizedWallpaperRescaledFiles> rescaled_files, std::unique_ptr<user_manager::UserImage> wallpaper) { DCHECK(thread_checker_.CalledOnValidThread()); if (wallpaper->image().isNull()) { ...
0
7,955
Analyze the following 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::canDeleteRange(const EphemeralRange& range) const { if (range.isCollapsed()) return false; Node* startContainer = range.startPosition().computeContainerNode(); Node* endContainer = range.endPosition().computeContainerNode(); if (!startContainer || !endContainer) return false; retu...
0
15,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: static int sched_domain_debug_one(struct sched_domain *sd, int cpu, int level, struct cpumask *groupmask) { struct sched_group *group = sd->groups; cpumask_clear(groupmask); printk(KERN_DEBUG "%*s domain %d: ", level, "", level); if (!(sd->flags & SD_LOAD_BALANCE)) { printk("does not load-balance\n...
0
8,855
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: exsltDateDurationFunction (xmlXPathParserContextPtr ctxt, int nargs) { xmlChar *ret; xmlChar *number = NULL; if ((nargs < 0) || (nargs > 1)) { xmlXPathSetArityError(ctxt); return; } if (nargs == 1) { number = xmlXPathPopString(ctxt); if (xmlXPathCheckError(ctxt)) { xmlXPathSetTypeEr...
0
23,328
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void IRCView::updateAppearance() { if (Preferences::self()->customTextFont()) setFont(Preferences::self()->textFont()); else setFont(KGlobalSettings::generalFont()); setVerticalScrollBarPolicy(Preferences::self()->showIRCViewScrollBar() ? Qt::ScrollBarAlwaysOn : Qt::ScrollBarAlwaysOff...
0
2,703
Analyze the following 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 FileAPIMessageFilter::OnCreateSnapshotFile( int request_id, const GURL& blob_url, const GURL& path) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); FileSystemURL url(path); base::Callback<void(const FilePath&)> register_file_callback = base::Bind(&FileAPIMessageFilter::RegisterFil...
1
21,854
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int test_path_access(const char *program, int mode) { char *envpath, *p, *colon; int ret, our_errno = 1500; /* outside errno range */ if (program[0] == '/' || !(envpath = getenv("PATH"))) return access(program, mode); if (!(envpath = strdup(envpath))) { errno = ENOMEM; return -1; } for (p = ...
0
4,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: static inline void tcp_set_rto(struct sock *sk) { const struct tcp_sock *tp = tcp_sk(sk); /* Old crap is replaced with new one. 8) * * More seriously: * 1. If rtt variance happened to be less 50msec, it is hallucination. * It cannot be less due to utterly erratic ACK generation made * at least b...
0
9,503
Analyze the following 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 GetBookmarkDragOperation(content::BrowserContext* browser_context, const BookmarkNode* node) { PrefService* prefs = user_prefs::UserPrefs::Get(browser_context); BookmarkModel* model = BookmarkModelFactory::GetForBrowserContext(browser_context); int move = ui::DragDrop...
0
9,120
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int insert_header(struct ctl_dir *dir, struct ctl_table_header *header) { struct ctl_table *entry; int err; /* Is this a permanently empty directory? */ if (is_empty_dir(&dir->header)) return -EROFS; /* Am I creating a permanently empty directory? */ if (header->ctl_table == sysctl_mount_point) {...
0
23,215