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: void BaseRenderingContext2D::putImageData(ImageData* data, int dx, int dy, int dirty_x, int dirty_y, int...
0
149,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 vm_info_final(struct user_ta_ctx *utc) { if (!utc->vm_info) return; /* clear MMU entries to avoid clash when asid is reused */ tlbi_asid(utc->vm_info->asid); asid_free(utc->vm_info->asid); while (!TAILQ_EMPTY(&utc->vm_info->regions)) umap_remove_region(utc->vm_info, TAILQ_FIRST(&utc->vm_inf...
0
86,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 __audit_free(struct task_struct *tsk) { struct audit_context *context; context = audit_take_context(tsk, 0, 0); if (!context) return; /* Check for system calls that do not go through the exit * function (e.g., exit_group), then free context block. * We use GFP_ATOMIC here because we might be doin...
0
51,122
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: AutocompleteResult::const_iterator AutocompleteResult::begin() const { return matches_.begin(); } Commit Message: Adds per-provider information to omnibox UMA logs. Adds a fairly general structure to omnibox logs that can be used to pass information (that's not per-result information) from providers to the UM...
0
103,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: filesystem_create_wait_for_luks_device_not_seen_cb (gpointer user_data) { MkfsLuksData *data = user_data; throw_error (data->context, ERROR_FAILED, "Error creating luks encrypted file system: timeout (10s) waiting for luks device to show up"); g_signal_handler_disconnect (dat...
0
11,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: const Extension* ExtensionService::GetInstalledExtension( const std::string& id) const { return GetExtensionByIdInternal(id, true, true, true); } Commit Message: Limit extent of webstore app to just chrome.google.com/webstore. BUG=93497 TEST=Try installing extensions and apps from the webstore, starting b...
0
98,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: qboolean FS_Initialized( void ) { return (fs_searchpaths != NULL); } Commit Message: Don't load .pk3s as .dlls, and don't load user config files from .pk3s. CWE ID: CWE-269
0
96,034
Analyze the following 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 async_encrypt(struct ablkcipher_request *req) { struct crypto_tfm *tfm = req->base.tfm; struct blkcipher_alg *alg = &tfm->__crt_alg->cra_blkcipher; struct blkcipher_desc desc = { .tfm = __crypto_blkcipher_cast(tfm), .info = req->info, .flags = req->base.flags, }; return alg->encrypt(&desc,...
0
31,268
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: RenderAccessibility* RenderFrameImpl::GetRenderAccessibility() { return render_accessibility_; } Commit Message: Convert FrameHostMsg_DidAddMessageToConsole to Mojo. Note: Since this required changing the test RenderViewImplTest.DispatchBeforeUnloadCanDetachFrame, I manually re-introduced https://crbug.com/66...
0
139,682
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: thumbnail_stop (NautilusDirectory *directory) { NautilusFile *file; if (directory->details->thumbnail_state != NULL) { file = directory->details->thumbnail_state->file; if (file != NULL) { g_assert (NAUTILUS_IS_FILE (file)); g_assert (file->details->di...
0
61,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: get_ed_command_letter (char const *line) { char const *p = line; char letter; bool pair = false; if (ISDIGIT (*p)) { while (ISDIGIT (*++p)) /* do nothing */ ; if (*p == ',') { if (! ISDIGIT (*++p)) return 0; while (ISDIGIT (*++p)) /* do nothing */ ; pair = true; } ...
0
2,682
Analyze the following 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 RenderMenuList::itemIsLabel(unsigned listIndex) const { const Vector<HTMLElement*>& listItems = toHTMLSelectElement(node())->listItems(); return listIndex < listItems.size() && listItems[listIndex]->hasTagName(optgroupTag); } Commit Message: PopupMenuClient::multiple() should be const https://bugs.w...
0
97,993
Analyze the following 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 shm_close(struct vm_area_struct *vma) { struct file * file = vma->vm_file; struct shm_file_data *sfd = shm_file_data(file); struct shmid_kernel *shp; struct ipc_namespace *ns = sfd->ns; down_write(&shm_ids(ns).rwsem); /* remove from the list of attaches of the shm segment */ shp = shm_lock(ns,...
0
27,963
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GF_Err tbox_dump(GF_Box *a, FILE * trace) { GF_TextBoxBox*p = (GF_TextBoxBox*)a; gf_isom_box_dump_start(a, "TextBoxBox", trace); fprintf(trace, ">\n"); tx3g_dump_box(trace, &p->box); gf_isom_box_dump_done("TextBoxBox", a, trace); return GF_OK; } Commit Message: fixed 2 possible heap overflows (inc. #1088) ...
0
80,863
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int init_percpu_info(struct f2fs_sb_info *sbi) { int err; err = percpu_counter_init(&sbi->alloc_valid_block_count, 0, GFP_KERNEL); if (err) return err; return percpu_counter_init(&sbi->total_valid_inode_count, 0, GFP_KERNEL); } Commit Message: f2fs: sanity check checkpoint segno and blkoff...
0
63,889
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Sample::Sample(int sampleID, int fd, int64_t offset, int64_t length) { init(); mSampleID = sampleID; mFd = dup(fd); mOffset = offset; mLength = length; ALOGV("create sampleID=%d, fd=%d, offset=%" PRId64 " length=%" PRId64, mSampleID, mFd, mLength, mOffset); } Commit Message: DO NO...
0
161,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: static void __rpc_queue_timer_fn(unsigned long ptr) { struct rpc_wait_queue *queue = (struct rpc_wait_queue *)ptr; struct rpc_task *task, *n; unsigned long expires, now, timeo; spin_lock(&queue->lock); expires = now = jiffies; list_for_each_entry_safe(task, n, &queue->timer_list.list, u.tk_wait.timer_list)...
0
34,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: test_set_variable (struct EventFixture *ef, const void *data) { (void) data; /* set a string */ parse_cmd_line("set useragent = Uzbl browser kthxbye!", NULL); ASSERT_EVENT(ef, "VARIABLE_SET useragent str Uzbl browser kthxbye!"); g_assert_cmpstr("Uzbl browser kthxbye!", ==, uzbl.net.useragent)...
0
18,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: v8::Local<v8::Context> V8Proxy::currentContext() { return v8::Context::GetCurrent(); } Commit Message: [V8] Pass Isolate to throwNotEnoughArgumentsError() https://bugs.webkit.org/show_bug.cgi?id=86983 Reviewed by Adam Barth. The objective is to pass Isolate around in V8 bindings. This patch passes Isolate ...
0
109,731
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: views::View* BrowserView::GetContentsView() { return contents_container_; } Commit Message: Remove TabContents from TabStripModelObserver::TabDetachedAt. BUG=107201 TEST=no visible change Review URL: https://chromiumcodereview.appspot.com/11293205 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167122 ...
0
118,349
Analyze the following 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 PageHandler::OnSynchronousSwapCompositorFrame( viz::CompositorFrameMetadata frame_metadata) { if (has_compositor_frame_metadata_) { last_compositor_frame_metadata_ = std::move(next_compositor_frame_metadata_); } else { last_compositor_frame_metadata_ = frame_metadata.Clone(); } ne...
0
143,619
Analyze the following 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 __cpuinit init_idle(struct task_struct *idle, int cpu) { struct rq *rq = cpu_rq(cpu); unsigned long flags; raw_spin_lock_irqsave(&rq->lock, flags); __sched_fork(idle); idle->state = TASK_RUNNING; idle->se.exec_start = sched_clock(); cpumask_copy(&idle->cpus_allowed, cpumask_of(cpu)); /* * We're ...
0
22,461
Analyze the following 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 unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock, struct msghdr *msg, size_t len) { struct sock_iocb *siocb = kiocb_to_siocb(kiocb); struct sock *sk = sock->sk; struct sock *other = NULL; int err, size; struct sk_buff *skb; int sent = 0; struct scm_cookie tmp_scm; bool fds...
0
40,748
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void CL_DownloadsComplete( void ) { #ifndef _WIN32 char *fs_write_path; #endif char *fn; if ( autoupdateStarted ) { if ( strlen( autoupdateFilename ) > 4 ) { #ifdef _WIN32 fn = va( "%s/%s", FS_ShiftStr( AUTOUPDATE_DIR, AUTOUPDATE_DIR_SHIFT ), autoupdateFilename ); #else fs_write_path = Cvar_V...
0
95,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: static int usb_console_setup(struct console *co, char *options) { struct usbcons_info *info = &usbcons_info; int baud = 9600; int bits = 8; int parity = 'n'; int doflow = 0; int cflag = CREAD | HUPCL | CLOCAL; char *s; struct usb_serial *serial; struct usb_serial_port *port; int retval; struct tty_stru...
0
95,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: bool MockInputMethod::OnUntranslatedIMEMessage(const base::NativeEvent& event, NativeEventResult* result) { if (result) *result = NativeEventResult(); return false; } Commit Message: MacViews: Enable secure text input for password Textfields. In Cocoa the N...
0
126,483
Analyze the following 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 wbinvd_interception(struct vcpu_svm *svm) { kvm_emulate_wbinvd(&svm->vcpu); return 1; } Commit Message: KVM: svm: unconditionally intercept #DB This is needed to avoid the possibility that the guest triggers an infinite stream of #DB exceptions (CVE-2015-8104). VMX is not affected: because it does...
0
41,923
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: mojom::ReportingMode FakePlatformSensor::GetReportingMode() { return mojom::ReportingMode::ON_CHANGE; } Commit Message: android: Fix sensors in device service. This patch fixes a bug that prevented more than one sensor data to be available at once when using the device motion/orientation API. The issue was i...
0
148,908
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WORD32 impeg2d_get_slice_pos(dec_state_multi_core_t *ps_dec_state_multi_core) { WORD32 u4_bits; WORD32 i4_row; dec_state_t *ps_dec = ps_dec_state_multi_core->ps_dec_state[0]; WORD32 i4_prev_row; stream_t s_bitstrm; WORD32 i4_start_row; WORD32 i4_slice_bistream_ofst; WORD32 i; s_bit...
0
161,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: unsigned long Tracks::GetTracksCount() const { const ptrdiff_t result = m_trackEntriesEnd - m_trackEntries; assert(result >= 0); return static_cast<unsigned long>(result); } Commit Message: external/libvpx/libwebm: Update snapshot Update libwebm snapshot. This update contains security fixes from upstream. ...
0
160,816
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: XcursorImageCreate (int width, int height) { XcursorImage *image; image = malloc (sizeof (XcursorImage) + width * height * sizeof (XcursorPixel)); if (!image) image->height = height; image->delay = 0; return image; } Commit Message: CWE ID: CWE-190
1
164,626
Analyze the following 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 read_tIME_chunk(Image *image,png_struct *ping,png_info *info, ExceptionInfo *exception) { png_timep time; if (png_get_tIME(ping,info,&time)) { char timestamp[21]; FormatLocaleString(timestamp,21,"%04d-%02d-%02dT%02d:%02d:%02dZ", time->year,time->month,time->...
0
63,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: int dtls1_do_write(SSL *s, int type) { int ret; int curr_mtu; unsigned int len, frag_off, mac_size, blocksize; /* AHA! Figure out the MTU, and stick to the right size */ if (s->d1->mtu < dtls1_min_mtu() && !(SSL_get_options(s) & SSL_OP_NO_QUERY_MTU)) { s->d1->mtu = BIO_ctrl(SSL_get_wbio(s), BIO_CT...
0
14,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: void* H264SwDecMalloc(u32 size) { return malloc(size); } Commit Message: h264dec: check for overflows when calculating allocation size. Bug: 27855419 Change-Id: Idabedca52913ec31ea5cb6a6109ab94e3fb2badd CWE ID: CWE-119
1
173,872
Analyze the following 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 release_tree_content(struct tree_content *t) { struct avail_tree_content *f = (struct avail_tree_content*)t; unsigned int hc = hc_entries(f->entry_capacity); f->next_avail = avail_tree_table[hc]; avail_tree_table[hc] = f; } Commit Message: prefer memcpy to strcpy When we already know the length ...
0
55,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: WebString WebPageSerializer::generateMarkOfTheWebDeclaration(const WebURL& url) { return String::format("\n<!-- saved from url=(%04d)%s -->\n", static_cast<int>(url.spec().length()), url.spec().data()); } Commit Message: Escape "--" in the page URL at pa...
1
171,787
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SPICE_GNUC_VISIBLE int spice_server_init(SpiceServer *s, SpiceCoreInterface *core) { int ret; spice_assert(reds == s); ret = do_spice_init(core); if (default_renderer) { red_dispatcher_add_renderer(default_renderer); } return ret; } Commit Message: CWE ID: CWE-119
0
1,962
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int pfkey_broadcast(struct sk_buff *skb, gfp_t allocation, int broadcast_flags, struct sock *one_sk, struct net *net) { struct netns_pfkey *net_pfkey = net_generic(net, pfkey_net_id); struct sock *sk; struct hlist_node *node; struct sk_buff *skb2 = NULL; int err = -ESRCH; /* XXX Do we ne...
0
31,406
Analyze the following 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 RenderMenuList::adjustInnerStyle() { RenderStyle* innerStyle = m_innerBlock->style(); innerStyle->setBoxFlex(1); innerStyle->setPaddingLeft(Length(theme()->popupInternalPaddingLeft(style()), Fixed)); innerStyle->setPaddingRight(Length(theme()->popupInternalPaddingRight(style()), Fixed));...
0
97,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: static int lo_compat_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, unsigned long arg) { struct loop_device *lo = bdev->bd_disk->private_data; int err; switch(cmd) { case LOOP_SET_STATUS: mutex_lock(&lo->lo_ctl_mutex); err = loop_set_status_compat( lo, (const struct compat_loop...
0
84,694
Analyze the following 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 getInternalOption( const void *data, size_t size, T *out) { if (size != sizeof(T)) { return false; } *out = *(T*)data; return true; } Commit Message: IOMX: allow configuration after going to loaded state This was disallowed recently but we still use it as MediaCodcec.stop only goes to loaded s...
0
157,728
Analyze the following 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 irq_time_write_begin(void) { } Commit Message: perf: Remove the nmi parameter from the swevent and overflow interface The nmi parameter indicated if we could do wakeups from the current context, if not, we would set some state and self-IPI and let the resulting interrupt do the wakeup. For t...
0
26,298
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void RenderViewImpl::OnSelectWordAroundCaret() { bool did_select = false; int start_adjust = 0; int end_adjust = 0; if (webview()) { WebLocalFrame* focused_frame = GetWebView()->FocusedFrame(); if (focused_frame) { input_handler_->set_handling_input_event(true); blink::WebRange initia...
0
147,997
Analyze the following 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 ChromeContentBrowserClient::CreateMediaRemoter( content::RenderFrameHost* render_frame_host, media::mojom::RemotingSourcePtr source, media::mojom::RemoterRequest request) { CastRemotingConnector::CreateMediaRemoter( render_frame_host, std::move(source), std::move(request)); } Commit Mess...
0
142,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: LinkRewritingDelegate( const std::map<GURL, base::FilePath>& url_to_local_path, const std::map<int, base::FilePath>& frame_routing_id_to_local_path) : url_to_local_path_(url_to_local_path), frame_routing_id_to_local_path_(frame_routing_id_to_local_path) {} Commit Message: Convert Fram...
0
139,718
Analyze the following 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 int ep_op_has_event(int op) { return op != EPOLL_CTL_DEL; } Commit Message: epoll: clear the tfile_check_list on -ELOOP An epoll_ctl(,EPOLL_CTL_ADD,,) operation can return '-ELOOP' to prevent circular epoll dependencies from being created. However, in that case we do not properly clear the 'tfil...
0
19,571
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: BrowserPpapiHostImpl* PepperRendererConnection::GetHostForChildProcess( int child_process_id) const { DCHECK_CURRENTLY_ON(BrowserThread::IO); BrowserPpapiHostImpl* host = static_cast<BrowserPpapiHostImpl*>( GetContentClient()->browser()->GetExternalBrowserPpapiHost( child_process_id)); ...
0
135,574
Analyze the following 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 playlist *new_playlist(HLSContext *c, const char *url, const char *base) { struct playlist *pls = av_mallocz(sizeof(struct playlist)); if (!pls) return NULL; reset_packet(&pls->pkt); ff_make_absolute_url(pls->url, sizeof(pls->url), base, u...
0
61,806
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: fz_device_cmyk(fz_context *ctx) { return ctx->colorspace->cmyk; } Commit Message: CWE ID: CWE-20
0
361
Analyze the following 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 cliOutputGenericHelp(void) { sds version = cliVersion(); printf( "redis-cli %s\n" "To get help about Redis commands type:\n" " \"help @<group>\" to get a list of commands in <group>\n" " \"help <command>\" for help on <command>\n" " \"help...
0
81,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: static void posix_cpu_timers_init_group(struct signal_struct *sig) { unsigned long cpu_limit; /* Thread group counters. */ thread_group_cputime_init(sig); cpu_limit = ACCESS_ONCE(sig->rlim[RLIMIT_CPU].rlim_cur); if (cpu_limit != RLIM_INFINITY) { sig->cputime_expires.prof_exp = secs_to_cputime(cpu_limit);...
0
22,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: gs_setdevice_no_erase(gs_gstate * pgs, gx_device * dev) { int open_code = 0, code; gs_lib_ctx_t *libctx = gs_lib_ctx_get_interp_instance(pgs->memory); /* If the ICC manager is not yet initialized, set it up now. But only if we have file io capability now */ if (libctx->io_device_table != ...
0
2,795
Analyze the following 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 http_connect(http_subtransport *t) { int error; if (t->connected && http_should_keep_alive(&t->parser) && t->parse_finished) return 0; if (t->io) { git_stream_close(t->io); git_stream_free(t->io); t->io = NULL; t->connected = 0; } if (t->connection_data.use_ssl) { error = git_tl...
1
168,526
Analyze the following 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 fbStore(PicturePtr pict, int x, int y, int width, CARD32 *buffer) { FbBits *bits; FbStride stride; int bpp; int xoff, yoff; storeProc store = storeProcForPicture(pict); miIndexedPtr indexed = (miIndexedPtr) pict->pFormat->index.devPrivate; fbGetDrawable (pict->pDrawable, b...
0
11,465
Analyze the following 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 SampleTable::buildSampleEntriesTable() { Mutex::Autolock autoLock(mLock); if (mSampleTimeEntries != NULL || mNumSampleSizes == 0) { if (mNumSampleSizes == 0) { ALOGE("b/23247055, mNumSampleSizes(%u)", mNumSampleSizes); } return; } mTotalSize += (uint64_t)mNumSampleSizes * sizeof(Sampl...
0
162,228
Analyze the following 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 clearDatabasePage( BtShared *pBt, /* The BTree that contains the table */ Pgno pgno, /* Page number to clear */ int freePageFlag, /* Deallocate page if true */ int *pnChange /* Add number of Cells freed to this counter */ ){ MemPage *pPage; int rc; ...
0
136,394
Analyze the following 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 Image *ReadMNGImage(const ImageInfo *image_info,ExceptionInfo *exception) { Image *image; MagickBooleanType logging, status; MngInfo *mng_info; /* Open image file. */ assert(image_info != (const ImageInfo *) NULL); assert(image_info->signature == MagickSignature); (void) ...
0
62,141
Analyze the following 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 CLASS redcine_load_raw() { #ifdef HAVE_LIBJASPER int c, row, col; jas_stream_t *in; jas_image_t *jimg; jas_matrix_t *jmat; jas_seqent_t *data; ushort *img, *pix; jas_init(); in = jas_stream_fopen (ifname, "rb"); jas_stream_seek (in, data_offset+20, SEEK_SET); jimg = jas_image_decode (in,...
0
43,366
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void reset_packet(AVPacket *pkt) { av_init_packet(pkt); pkt->data = NULL; } Commit Message: avformat/hls: Fix DoS due to infinite loop Fixes: loop.m3u The default max iteration count of 1000 is arbitrary and ideas for a better solution are welcome Found-by: Xiaohei and Wangchu from Alibaba Secu...
0
61,816
Analyze the following 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 PrerenderTestURL(const std::string& html_file, FinalStatus expected_final_status, int total_navigations) { std::deque<FinalStatus> expected_final_status_queue(1, expected_final_status); Prerender...
0
99,961
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: lldp_print(netdissect_options *ndo, register const u_char *pptr, register u_int len) { uint8_t subtype; uint16_t tlv, cap, ena_cap; u_int oui, tlen, hexdump, tlv_type, tlv_len; const u_char *tptr; char *network_addr; tptr = pptr; tlen = len; ND_PRINT((ndo, "LLDP, lengt...
0
62,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: struct net *get_net_ns_by_id(struct net *net, int id) { struct net *peer; if (id < 0) return NULL; rcu_read_lock(); spin_lock_bh(&net->nsid_lock); peer = idr_find(&net->netns_ids, id); if (peer) get_net(peer); spin_unlock_bh(&net->nsid_lock); rcu_read_unlock(); return peer; } Commit Message...
1
169,427
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: XCustomCursorCache() {} Commit Message: Make shared memory segments writable only by their rightful owners. BUG=143859 TEST=Chrome's UI still works on Linux and Chrome OS Review URL: https://chromiumcodereview.appspot.com/10854242 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@158289 0039d316-1c4b-4281-...
0
119,222
Analyze the following 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 TestingAutomationProvider::GetNetworkInfo(DictionaryValue* args, IPC::Message* reply_message) { scoped_ptr<DictionaryValue> return_value(new DictionaryValue); NetworkLibrary* network_library = CrosLibrary::Get()->GetNetworkLibrary(); return_value->SetBool...
0
109,214
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void ldm_frag_free (struct list_head *list) { struct list_head *item, *tmp; BUG_ON (!list); list_for_each_safe (item, tmp, list) kfree (list_entry (item, struct frag, list)); } Commit Message: Fix for buffer overflow in ldm_frag_add not sufficient As Ben Hutchings discovered [1], the patch for CVE...
0
27,310
Analyze the following 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 venc_dev::venc_use_buf(void *buf_addr, unsigned port,unsigned index) { struct pmem *pmem_tmp; struct v4l2_buffer buf; struct v4l2_plane plane[VIDEO_MAX_PLANES]; int rc = 0; unsigned int extra_idx; pmem_tmp = (struct pmem *)buf_addr; DEBUG_PRINT_LOW("venc_use_buf:: pmem_tmp = %p", pmem_tmp); ...
0
159,319
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void __init dma_contiguous_remap(void) { int i; for (i = 0; i < dma_mmu_remap_num; i++) { phys_addr_t start = dma_mmu_remap[i].base; phys_addr_t end = start + dma_mmu_remap[i].size; struct map_desc map; unsigned long addr; if (end > arm_lowmem_limit) end = arm_lowmem_limit; if (start >= end) ...
0
58,319
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void free_history_entry(krb5_context context, osa_pw_hist_ent *hist) { int i; for (i = 0; i < hist->n_key_data; i++) krb5_free_key_data_contents(context, &hist->key_data[i]); free(hist->key_data); } Commit Message: Null pointer deref in kadmind [CVE-2012-1013] The fix for #6626 could cause ...
0
21,487
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void RenderFrameImpl::OnScrollFocusedEditableNodeIntoRect( const gfx::Rect& rect) { ScrollFocusedEditableElementIntoRect(rect); } Commit Message: If a page calls |window.focus()|, kick it out of fullscreen. BUG=776418, 800056 Change-Id: I1880fe600e4814c073f247c43b1c1ac80c8fc017 Reviewed-on: https://chrom...
0
147,867
Analyze the following 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 bigint *sig_verify(BI_CTX *ctx, const uint8_t *sig, int sig_len, bigint *modulus, bigint *pub_exp) { int i, size; bigint *decrypted_bi, *dat_bi; bigint *bir = NULL; uint8_t *block = (uint8_t *)malloc(sig_len); /* decrypt */ dat_bi = bi_import(ctx, sig, sig_len); ...
1
169,086
Analyze the following 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 long ramfs_nommu_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags) { unsigned long maxpages, lpages, nr, loop, ret; struct inode *inode = file_inode(file); struct page **pages = NULL, **ptr, *page; loff_t isi...
0
46,349
Analyze the following 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 GLenum GetGLESOverlayTransform(gfx::OverlayTransform plane_transform) { switch (plane_transform) { case gfx::OVERLAY_TRANSFORM_INVALID: break; case gfx::OVERLAY_TRANSFORM_NONE: return GL_OVERLAY_TRANSFORM_NONE_CHROMIUM; case gfx::OVERLAY_TRANSFORM_FLIP_HORIZONTAL: return GL_...
0
140,991
Analyze the following 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_login (struct t_irc_server *server) { const char *password, *username, *realname; password = IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_PASSWORD); username = IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_USERNAME); realname = IRC_SERVER_OPTION_STRING(server, IRC_SERVER...
0
3,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: static void voidMethodSequenceDictionaryArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { if (UNLIKELY(info.Length() < 1)) { throwTypeError(ExceptionMessages::failedToExecute("voidMethodSequenceDictionaryArg", "TestObjectPython", ExceptionMessages::notEnoughArguments(1, info.Length())), inf...
0
122,872
Analyze the following 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 Smb4KMountJob::setupMount( Smb4KShare *share, QWidget *parent ) { Q_ASSERT( share ); m_shares << new Smb4KShare( *share ); m_parent_widget = parent; } Commit Message: CWE ID: CWE-20
0
6,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: static enum iwch_ep_state state_read(struct iwch_ep_common *epc) { unsigned long flags; enum iwch_ep_state state; spin_lock_irqsave(&epc->lock, flags); state = epc->state; spin_unlock_irqrestore(&epc->lock, flags); return state; } Commit Message: iw_cxgb3: Fix incorrectly returning error on success The c...
0
56,903
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void OnCanDownloadDecided(bool allow) { if (!completion_closure_.is_null()) { base::ResetAndReturn(&completion_closure_).Run(); EXPECT_EQ(allow, expectation_); } else { on_decided_called_ = true; last_allow_ = allow; } } Commit Message: When turning a download into a navig...
0
151,932
Analyze the following 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 rawv6_close(struct sock *sk, long timeout) { if (inet_sk(sk)->inet_num == IPPROTO_RAW) ip6_ra_control(sk, -1); ip6mr_sk_done(sk); sk_common_release(sk); } Commit Message: inet: prevent leakage of uninitialized memory to user in recv syscalls Only update *addr_len when we actually fill in sockad...
0
40,196
Analyze the following 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 srpt_ioctx **srpt_alloc_ioctx_ring(struct srpt_device *sdev, int ring_size, int ioctx_size, int dma_size, enum dma_data_direction dir) { struct srpt_ioctx **ring; int i; WARN_ON(ioctx_size != sizeof(struct srpt_recv_ioctx) && ioctx_size != sizeof(struct srpt_send_ioctx)); ring = kmal...
0
50,625
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void BrowserCommandController::InitCommandState() { if (is_locked_fullscreen_) return; command_updater_.UpdateCommandEnabled(IDC_RELOAD, true); command_updater_.UpdateCommandEnabled(IDC_RELOAD_BYPASSING_CACHE, true); command_updater_.UpdateCommandEnabled(IDC_RELOAD_CLEARING_CACHE, true); command_...
0
153,510
Analyze the following 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 mac80211_hwsim_set_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u64 tsf) { struct mac80211_hwsim_data *data = hw->priv; u64 now = mac80211_hwsim_get_tsf(hw, vif); u32 bcn_int = data->beacon_int; u64 delta = abs(tsf - now); /* adjust after beaconing with new timestamp at old TBTT */ ...
0
83,858
Analyze the following 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 NetworkChangeNotifierMac::SetInitialConnectionType() { struct sockaddr_in addr = {0}; addr.sin_len = sizeof(addr); addr.sin_family = AF_INET; reachability_.reset(SCNetworkReachabilityCreateWithAddress( kCFAllocatorDefault, reinterpret_cast<struct sockaddr*>(&addr))); SCNetworkConnectionFlag...
0
156,294
Analyze the following 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 npidentifier_cache_destroy(void) { if (g_npidentifier_cache) { g_hash_table_destroy(g_npidentifier_cache); g_npidentifier_cache = NULL; } } Commit Message: Support all the new variables added CWE ID: CWE-264
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: GLES2DecoderPassthroughImpl::DoStencilThenCoverStrokePathInstancedCHROMIUM( GLsizei numPaths, GLenum pathNameType, const GLvoid* paths, GLsizei pathsBufsize, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat* transformValue...
0
142,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: ofproto_mirror_register(struct ofproto *ofproto, void *aux, const struct ofproto_mirror_settings *s) { return (ofproto->ofproto_class->mirror_set ? ofproto->ofproto_class->mirror_set(ofproto, aux, s) : EOPNOTSUPP); } Commit Message: ofproto: Fix OVS crash when ...
0
77,336
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WebUI* WebContentsImpl::CreateSubframeWebUI(const GURL& url, const std::string& frame_name) { DCHECK(!frame_name.empty()); return CreateWebUI(url, frame_name); } Commit Message: Don't call WebContents::DownloadImage() callback if the WebContents were deleted BUG=5...
0
131,782
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: kdc_process_s4u_x509_user(krb5_context context, krb5_kdc_req *request, krb5_pa_data *pa_data, krb5_keyblock *tgs_subkey, krb5_keyblock *tgs_session, krb5_pa_s4u_x509_user **s4u_x509_us...
1
168,043
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GLuint GLES2Implementation::GenPathsCHROMIUM(GLsizei range) { GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGenPathsCHROMIUM(" << range << ")"); GPU_CLIENT_SINGLE_THREAD_CHECK(); static const char kFunctionName[] = "glGenPathsCHROMIUM"; if (range < 0) { SetGLError(GL_INVALID_VALUE,...
0
140,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 SandboxIPCHandler::HandleLocaltime( int fd, base::PickleIterator iter, const std::vector<base::ScopedFD>& fds) { std::string time_string; if (!iter.ReadString(&time_string) || time_string.size() != sizeof(time_t)) return; time_t time; memcpy(&time, time_string.data(), size...
1
172,925
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xmlCtxtReadMemory(xmlParserCtxtPtr ctxt, const char *buffer, int size, const char *URL, const char *encoding, int options) { xmlParserInputBufferPtr input; xmlParserInputPtr stream; if (ctxt == NULL) return (NULL); if (buffer == NULL) return (NULL); xmlInitParser(); xmlCtxtReset(ctxt); ...
0
163,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: gdImagePtr gdImageRotateBicubicFixed(gdImagePtr src, const float degrees, const int bgColor) { const float _angle = (float)((- degrees / 180.0f) * M_PI); const int src_w = gdImageSX(src); const int src_h = gdImageSY(src); const unsigned int new_width = abs((int)(src_w*cos(_angle))) + abs((int)(src_h*sin(_angl...
0
58,407
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int kill_something_info(int sig, struct siginfo *info, pid_t pid) { int ret; if (pid > 0) { rcu_read_lock(); ret = kill_pid_info(sig, info, find_vpid(pid)); rcu_read_unlock(); return ret; } read_lock(&tasklist_lock); if (pid != -1) { ret = __kill_pgrp_info(sig, info, pid ? find_vpid(-p...
0
31,774
Analyze the following 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::TexSubImage3DImpl(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei zoffset, ...
0
141,138
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: float GM2TabStyle::GetTopCornerRadiusForWidth(int width) { const int ideal_radius = GetCornerRadius(); const int top_width = width - ideal_radius * 2; const float radius = top_width / 3.f; return base::ClampToRange<float>(radius, 0, ideal_radius); } Commit Message: Paint tab groups with the group color....
0
140,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: static int apparmor_file_open(struct file *file, const struct cred *cred) { struct aa_file_cxt *fcxt = file->f_security; struct aa_profile *profile; int error = 0; if (!mediated_filesystem(file->f_path.dentry)) return 0; /* If in exec, permission is handled by bprm hooks. * Cache permissions granted by...
0
51,081
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void attrWithSetterExceptionAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) { INC_STATS("DOM.TestObj.attrWithSetterException._set"); TestObj* imp = V8TestObj::toNative(info.Holder()); int v = toInt32(value); ExceptionCode ec = 0; imp->set...
0
109,525
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: parse_field(netdissect_options *ndo, const char **pptr, int *len) { const char *s; if (*len <= 0 || !pptr || !*pptr) return NULL; if (*pptr > (const char *) ndo->ndo_snapend) return NULL; s = *pptr; while (*pptr <= (const char *) ndo->ndo_snapend && *len >= 0 && **pptr) { (*pptr)++; ...
1
167,935
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static AttributeTextStyle textStyleFromMask(int64_t mask) { AttributeTextStyle style; if (mask & COMPOSED_TEXT_ATTRIB) addCompositionTextStyleToAttributeTextStyle(style); if (mask & ACTIVE_REGION_ATTRIB) addActiveTextStyleToAttributeTextStyle(style); return style; } Commit Messa...
0
104,584
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void ChildProcessSecurityPolicyImpl::GrantPermissionsForFile( int child_id, const base::FilePath& file, int permissions) { base::AutoLock lock(lock_); SecurityStateMap::iterator state = security_state_.find(child_id); if (state == security_state_.end()) return; state->second->GrantPermissionsFor...
0
125,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: static int translate_table(struct xt_table_info *newinfo, void *entry0, const struct arpt_replace *repl) { struct arpt_entry *iter; unsigned int i; int ret = 0; newinfo->size = repl->size; newinfo->number = repl->num_entries; /* Init all hooks to impossible value. */ for (i = 0; i < NF_ARP_NUMHOOKS...
0
52,380