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: ScriptValue WebGLRenderingContextBase::getShaderParameter( ScriptState* script_state, WebGLShader* shader, GLenum pname) { if (isContextLost() || !ValidateWebGLObject("getShaderParameter", shader)) return ScriptValue::CreateNull(script_state); GLint value = 0; switch (pname) { case GL_DE...
0
133,834
Analyze the following 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::UpdateSubresourceLoaderFactories( std::unique_ptr<URLLoaderFactoryBundleInfo> subresource_loaders) { DCHECK(loader_factories_); static_cast<URLLoaderFactoryBundle*>(loader_factories_.get()) ->Update(std::move(subresource_loaders)); } Commit Message: If a page calls |window.foc...
0
147,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 int tty_tiocgicount(struct tty_struct *tty, void __user *arg) { int retval = -EINVAL; struct serial_icounter_struct icount; memset(&icount, 0, sizeof(icount)); if (tty->ops->get_icount) retval = tty->ops->get_icount(tty, &icount); if (retval != 0) return retval; if (copy_to_user(arg, &icount, siz...
0
55,947
Analyze the following 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 GeometryMapper::PointVisibleInAncestorSpace( const PropertyTreeState& local_state, const PropertyTreeState& ancestor_state, const FloatPoint& local_point) { for (const auto* clip = local_state.Clip(); clip && clip != ancestor_state.Clip(); clip = clip->Parent()) { FloatPoint mapped_p...
0
125,632
Analyze the following 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::RemoveObserver( WallpaperManagerBase::Observer* observer) { observers_.RemoveObserver(observer); } Commit Message: [reland] Do not set default wallpaper unless it should do so. TBR=bshe@chromium.org, alemate@chromium.org Bug: 751382 Change-Id: Id0793dfe467f737526a95b1e66ed01fbb...
0
128,079
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ChromeDownloadManagerDelegate::~ChromeDownloadManagerDelegate() { DCHECK(!download_manager_); } Commit Message: Downloads : Fixed an issue of opening incorrect download file When one download overwrites another completed download, calling download.open in the old download causes the new download to open, whic...
0
146,274
Analyze the following 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 ExternalProtocolHandler::LaunchUrlWithDelegate( const GURL& url, int render_process_host_id, int render_view_routing_id, ui::PageTransition page_transition, bool has_user_gesture, Delegate* delegate) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); std::string escaped_url_str...
1
172,687
Analyze the following 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 InputDispatcher::traceOutboundQueueLengthLocked(const sp<Connection>& connection) { if (ATRACE_ENABLED()) { char counterName[40]; snprintf(counterName, sizeof(counterName), "oq:%s", connection->getWindowName()); ATRACE_INT(counterName, connection->outboundQueue.count()); } } Commit Messag...
0
163,848
Analyze the following 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::MessageLoop* RenderThreadImpl::GetMainLoop() { return message_loop(); } Commit Message: Suspend shared timers while blockingly closing databases BUG=388771 R=michaeln@chromium.org Review URL: https://codereview.chromium.org/409863002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284785 0039d316-...
0
111,137
Analyze the following 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 DesktopWindowTreeHostX11::StackAbove(aura::Window* window) { if (window && window->GetRootWindow()) { ::Window window_below = window->GetHost()->GetAcceleratedWidget(); std::vector<::Window> window_below_parents = GetParentsList(xdisplay_, window_below); std::vector<::Window> window_abo...
0
140,609
Analyze the following 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 vm_fault_t hugetlb_no_page(struct mm_struct *mm, struct vm_area_struct *vma, struct address_space *mapping, pgoff_t idx, unsigned long address, pte_t *ptep, unsigned int flags) { struct hstate *h = hstate_vma(vma); vm_fault_t ret = VM_FAULT_SIGBUS; int anon_rmap = 0; unsigned long size; struc...
0
97,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 Com_WriteConfigToFile( const char *filename ) { fileHandle_t f; f = FS_FOpenFileWrite( filename ); if ( !f ) { Com_Printf( "Couldn't write %s.\n", filename ); return; } FS_Printf( f, "// generated by RTCW, do not modify\n" ); Key_WriteBindings( f ); Cvar_WriteVariables( f ); FS_FCloseFile( f );...
0
95,621
Analyze the following 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 PrintingFrameHasPageSizeStyle(blink::WebFrame* frame, int total_page_count) { if (!frame) return false; bool frame_has_custom_page_size_style = false; for (int i = 0; i < total_page_count; ++i) { if (frame->hasCustomPageSizeStyle(i)) { frame_has_custom_p...
0
126,664
Analyze the following 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_Box *segr_New() { ISOM_DECL_BOX_ALLOC(FDSessionGroupBox, GF_ISOM_BOX_TYPE_SEGR); return (GF_Box *)tmp; } Commit Message: fixed 2 possible heap overflows (inc. #1088) CWE ID: CWE-125
0
80,396
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void MediaPlayerService::removeClient(wp<Client> client) { Mutex::Autolock lock(mLock); mClients.remove(client); } Commit Message: Add bound checks to utf16_to_utf8 Bug: 29250543 Change-Id: I3518416e89ed901021970958fb6005fd69129f7c (cherry picked from commit 1d3f4278b2666d1a145af2f54782c993aa07d1d9) CWE I...
0
163,639
Analyze the following 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 nr_listen(struct socket *sock, int backlog) { struct sock *sk = sock->sk; lock_sock(sk); if (sk->sk_state != TCP_LISTEN) { memset(&nr_sk(sk)->user_addr, 0, AX25_ADDR_LEN); sk->sk_max_ack_backlog = backlog; sk->sk_state = TCP_LISTEN; release_sock(sk); return 0; } release_sock(s...
0
30,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: vrrp_init_sands(list l) { vrrp_t *vrrp; element e; LIST_FOREACH(l, vrrp, e) { vrrp->sands.tv_sec = TIMER_DISABLED; rb_insert_sort_cached(&vrrp->sockets->rb_sands, vrrp, rb_sands, vrrp_timer_cmp); vrrp_init_instance_sands(vrrp); vrrp->reload_master = false; } } Commit Message: When opening files for ...
0
76,080
Analyze the following 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 const char *csv_escape_str(AVBPrint *dst, const char *src, const char sep, void *log_ctx) { char meta_chars[] = { sep, '"', '\n', '\r', '\0' }; int needs_quoting = !!src[strcspn(src, meta_chars)]; if (needs_quoting) av_bprint_chars(dst, '"', 1); for (; *src; src++) { if (*...
0
61,323
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int pmcraid_chr_fasync(int fd, struct file *filep, int mode) { struct pmcraid_instance *pinstance; int rc; pinstance = filep->private_data; mutex_lock(&pinstance->aen_queue_lock); rc = fasync_helper(fd, filep, mode, &pinstance->aen_queue); mutex_unlock(&pinstance->aen_queue_lock); return rc; } Co...
0
26,424
Analyze the following 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 InputType::TypeMismatchText() const { return GetLocale().QueryString(WebLocalizedString::kValidationTypeMismatch); } Commit Message: MacViews: Enable secure text input for password Textfields. In Cocoa the NSTextInputContext automatically enables secure text input when activated and it's in the secure ...
0
126,261
Analyze the following 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 check_pmd_range(struct vm_area_struct *vma, pud_t *pud, unsigned long addr, unsigned long end, const nodemask_t *nodes, unsigned long flags, void *private) { pmd_t *pmd; unsigned long next; pmd = pmd_offset(pud, addr); do { next = pmd_addr_end(addr, end); split_huge_page_pmd(vm...
1
165,634
Analyze the following 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_emulate_cpuid(struct kvm_vcpu *vcpu) { u32 function, index; struct kvm_cpuid_entry2 *best; function = kvm_register_read(vcpu, VCPU_REGS_RAX); index = kvm_register_read(vcpu, VCPU_REGS_RCX); kvm_register_write(vcpu, VCPU_REGS_RAX, 0); kvm_register_write(vcpu, VCPU_REGS_RBX, 0); kvm_register_write(...
0
41,374
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: pch_c_function (void) { return p_c_function; } Commit Message: CWE ID: CWE-78
0
2,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: raptor_option_get_value_type_label(const raptor_option_value_type type) { if(type > RAPTOR_OPTION_VALUE_TYPE_LAST) return NULL; return raptor_option_value_type_labels[type]; } Commit Message: CVE-2012-0037 Enforce entity loading policy in raptor_libxml_resolveEntity and raptor_libxml_getEntity by checki...
0
21,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: void Plugin::DispatchProgressEvent(int32_t result) { PLUGIN_PRINTF(("Plugin::DispatchProgressEvent (result=%" NACL_PRId32")\n", result)); if (result < 0) { return; } if (progress_events_.empty()) { PLUGIN_PRINTF(("Plugin::DispatchProgressEvent: no pending events\n")); return; ...
0
103,337
Analyze the following 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 xen_netbk_tx_build_gops(struct xen_netbk *netbk) { struct gnttab_copy *gop = netbk->tx_copy_ops, *request_gop; struct sk_buff *skb; int ret; while (((nr_pending_reqs(netbk) + MAX_SKB_FRAGS) < MAX_PENDING_REQS) && !list_empty(&netbk->net_schedule_list)) { struct xenvif *vif; struct xen_n...
0
34,019
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gpu::SyncToken SkiaOutputSurfaceImpl::SubmitPaint( base::OnceClosure on_finished) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); DCHECK(current_paint_); DCHECK(!deferred_framebuffer_draw_closure_); bool painting_render_pass = current_paint_->render_pass_id() != 0; gpu::SyncToken sync_token( ...
0
135,999
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: rc_free_srcgtag_profile(gs_memory_t * mem, void *ptr_in, client_name_t cname) { cmm_srcgtag_profile_t *srcgtag_profile = (cmm_srcgtag_profile_t *)ptr_in; int k; gs_memory_t *mem_nongc = srcgtag_profile->memory; if (srcgtag_profile->rc.ref_count <= 1 ) { /* Decrement any profiles. */ ...
0
14,006
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: raptor_rss_emit_item(raptor_parser* rdf_parser, raptor_rss_item *item) { raptor_rss_parser* rss_parser = (raptor_rss_parser*)rdf_parser->context; int f; raptor_rss_block *block; raptor_uri *type_uri; if(!item->fields_count) return 0; /* HACK - FIXME - set correct atom output class type */ if(...
0
22,036
Analyze the following 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 exec_mmap(struct mm_struct *mm) { struct task_struct *tsk; struct mm_struct * old_mm, *active_mm; /* Notify parent that we're no longer interested in the old VM */ tsk = current; old_mm = current->mm; mm_release(tsk, old_mm); if (old_mm) { sync_mm_rss(old_mm); /* * Make sure that if the...
0
30,898
Analyze the following 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(SplFileObject, setFlags) { spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &intern->flags) == FAILURE) { return; } } /* }}} */ /* {{{ proto int SplFileObject::getFlags() Commit M...
0
51,334
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int InputHandler::selectionStart() const { return selectionPosition(true); } Commit Message: [BlackBerry] Adapt to new BlackBerry::Platform::TouchPoint API https://bugs.webkit.org/show_bug.cgi?id=105143 RIM PR 171941 Reviewed by Rob Buis. Internally reviewed by George Staikos. Source/WebCore: TouchPoint i...
0
104,557
Analyze the following 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::DidFailProvisionalLoad( const WebURLError& error, blink::WebHistoryCommitType commit_type) { TRACE_EVENT1("navigation,benchmark,rail", "RenderFrameImpl::didFailProvisionalLoad", "id", routing_id_); NotifyObserversOfFailedProvisionalLoad(error); WebDocumentLoader...
0
139,596
Analyze the following 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 _mkp_exit() { } Commit Message: Mandril: check decoded URI (fix #92) Signed-off-by: Eduardo Silva <eduardo@monkey.io> CWE ID: CWE-264
0
41,044
Analyze the following 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 ChromeClientImpl::chromeDestroyed() { } Commit Message: Delete apparently unused geolocation declarations and include. BUG=336263 Review URL: https://codereview.chromium.org/139743014 git-svn-id: svn://svn.chromium.org/blink/trunk@165601 bbb929c8-8fbe-4397-9dbb-9b2b20218538 CWE ID: CWE-399
0
118,591
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void PrintRenderFrameHelper::OnFramePreparedForPreviewDocument() { if (reset_prep_frame_view_) { PrepareFrameForPreviewDocument(); return; } DidFinishPrinting(CreatePreviewDocument() ? OK : FAIL_PREVIEW); } Commit Message: Correct mojo::WrapSharedMemoryHandle usage Fixes some incorrect uses of moj...
0
149,119
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: skia::PlatformCanvas* TransportDIB::GetPlatformCanvas(int w, int h) { if (address_ == kInvalidAddress && !Map()) return NULL; scoped_ptr<skia::PlatformCanvas> canvas(new skia::PlatformCanvas); if (!canvas->initialize(w, h, true, reinterpret_cast<uint8_t*>(memory()))) return NULL; return canvas.rel...
0
119,242
Analyze the following 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 ACodec::onSignalEndOfInputStream() { sp<AMessage> notify = mNotify->dup(); notify->setInt32("what", CodecBase::kWhatSignaledInputEOS); status_t err = mOMX->signalEndOfInputStream(mNode); if (err != OK) { notify->setInt32("err", err); } notify->post(); } Commit Message: Fix initializa...
0
164,115
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: inline static unsigned short xml_encode_iso_8859_1(unsigned char c) { return (unsigned short)c; } Commit Message: CWE ID: CWE-119
0
11,001
Analyze the following 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 __init platform_bus_init(void) { int error; early_platform_cleanup(); error = device_register(&platform_bus); if (error) return error; error = bus_register(&platform_bus_type); if (error) device_unregister(&platform_bus); of_platform_register_reconfig_notifier(); return error; } Commit Message...
0
63,085
Analyze the following 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 ssize_t WritePSDChannels(const PSDInfo *psd_info, const ImageInfo *image_info,Image *image,Image *next_image, MagickOffsetType size_offset,const MagickBooleanType separate) { Image *mask; MagickOffsetType rows_offset; size_t channels, count, length, offset_length; uns...
1
170,103
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: DevHasCursor(DeviceIntPtr pDev) { return pDev->spriteInfo->spriteOwner; } Commit Message: CWE ID: CWE-119
0
4,823
Analyze the following 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 RenderViewImpl::HasAddedInputHandler() const { return has_added_input_handler_; } Commit Message: If a page calls |window.focus()|, kick it out of fullscreen. BUG=776418, 800056 Change-Id: I1880fe600e4814c073f247c43b1c1ac80c8fc017 Reviewed-on: https://chromium-review.googlesource.com/852378 Reviewed-by:...
0
147,979
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: rdp_out_ts_sound_capabilityset(STREAM s) { uint16 soundflags = SOUND_BEEPS_FLAG; out_uint16_le(s, RDP_CAPSET_SOUND); out_uint16_le(s, RDP_CAPLEN_SOUND); out_uint16_le(s, soundflags); /* soundFlags */ out_uint16_le(s, 0); /* pad2OctetsA */ } Commit Message: Malicious RDP server security fixes This commit ...
0
93,024
Analyze the following 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 FormatStringForOS(base::string16* text) { #if defined(OS_POSIX) static const base::char16 kCr[] = {L'\r', L'\0'}; static const base::char16 kBlank[] = {L'\0'}; base::ReplaceChars(*text, kCr, kBlank, text); #elif defined(OS_WIN) #else NOTIMPLEMENTED(); #endif } Commit Message: [pdf] Defer page unload...
0
140,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: void AppCacheUpdateJob::ContinueHandleManifestFetchCompleted(bool changed) { DCHECK(internal_state_ == FETCH_MANIFEST); if (!changed) { DCHECK(update_type_ == UPGRADE_ATTEMPT); internal_state_ = NO_UPDATE; FetchMasterEntries(); MaybeCompleteUpdate(); // if not done, run async 6.9.4 step 7 s...
0
124,128
Analyze the following 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 calc_stack(const char *str, int *parens, int *preds, int *err) { bool is_pred = false; int nr_preds = 0; int open = 1; /* Count the expression as "(E)" */ int last_quote = 0; int max_open = 1; int quote = 0; int i; *err = 0; for (i = 0; str[i]; i++) { if (isspace(str[i])) continue; if...
0
81,556
Analyze the following 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 __pure struct page *pgvec_to_page(const void *addr) { if (is_vmalloc_addr(addr)) return vmalloc_to_page(addr); else return virt_to_page(addr); } Commit Message: net: rework recvmsg handler msg_name and msg_namelen logic This patch now always passes msg->msg_namelen as 0. recvmsg handlers must set m...
0
40,577
Analyze the following 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 off_t flush_command(char* buf, size_t bufsz, uint8_t cmd, uint32_t exptime, bool use_extra) { protocol_binary_request_flush *request = (void*)buf; assert(bufsz > sizeof(*request)); memset(request, 0, sizeof(*request)); request->message.header.request.magic = PROTOCOL_BINARY_REQ; reques...
0
94,230
Analyze the following 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 gpr_set(struct task_struct *target, const struct user_regset *regset, unsigned int pos, unsigned int count, const void *kbuf, const void __user *ubuf) { unsigned long reg; int ret; if (target->thread.regs == NULL) return -EIO; CHECK_FULL_REGS(target->thread.regs); ret = user_regset_...
0
25,484
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool BrowserGpuChannelHostFactory::IsIOThread() { return BrowserThread::CurrentlyOn(BrowserThread::IO); } Commit Message: Convert plugin and GPU process to brokered handle duplication. BUG=119250 Review URL: https://chromiumcodereview.appspot.com/9958034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13...
0
106,689
Analyze the following 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 RenderBox::addVisualOverflow(const LayoutRect& rect) { LayoutRect borderBox = borderBoxRect(); if (borderBox.contains(rect) || rect.isEmpty()) return; if (!m_overflow) m_overflow = adoptPtr(new RenderOverflow(clientBoxRect(), borderBox)); m_overflow->addVisualOve...
0
101,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: void CWebServer::DisplayLanguageCombo(std::string & content_part) { std::map<std::string, std::string> _ltypes; char szTmp[200]; int ii = 0; while (guiLanguage[ii].szShort != NULL) { _ltypes[guiLanguage[ii].szLong] = guiLanguage[ii].szShort; ii++; } for (const auto & itt : _ltypes...
0
91,028
Analyze the following 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 WebMediaPlayerImpl::OnWebLayerUpdated() {} Commit Message: Simplify "WouldTaintOrigin" concept in media/blink Currently WebMediaPlayer has three predicates: - DidGetOpaqueResponseFromServiceWorker - HasSingleSecurityOrigin - DidPassCORSAccessCheck . These are used to determine whether the response body ...
0
144,476
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bgp_route_refresh_print(netdissect_options *ndo, const u_char *pptr, int len) { const struct bgp_route_refresh *bgp_route_refresh_header; ND_TCHECK2(pptr[0], BGP_ROUTE_REFRESH_SIZE); /* some little sanity checking */ if (len<BGP_ROUTE_REFRESH_SIZE) re...
0
93,158
Analyze the following 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 __kprobes int notify_page_fault(struct pt_regs *regs) { int ret = 0; /* kprobe_running() needs smp_processor_id() */ if (kprobes_built_in() && !user_mode(regs)) { preempt_disable(); if (kprobe_running() && kprobe_fault_handler(regs, 0)) ret = 1; preempt_enable(); } return ret; } Comm...
0
25,744
Analyze the following 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 query_formats(AVFilterContext *ctx) { static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); ...
0
29,743
Analyze the following 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 nodeAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) { TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); V8TRYCATCH_VOID(Node*, cppValue, V8Node::toNativeWithTypeCheck(info.GetIsolate(), jsValue)); imp->setNodeAttribute(W...
0
122,412
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: status_t Parcel::readAligned(T *pArg) const { COMPILE_TIME_ASSERT_FUNCTION_SCOPE(PAD_SIZE_UNSAFE(sizeof(T)) == sizeof(T)); if ((mDataPos+sizeof(T)) <= mDataSize) { const void* data = mData+mDataPos; mDataPos += sizeof(T); *pArg = *reinterpret_cast<const T*>(data); return NO_ERROR; } else { retu...
0
160,191
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int compat_do_ebt_set_ctl(struct sock *sk, int cmd, void __user *user, unsigned int len) { int ret; struct net *net = sock_net(sk); if (!ns_capable(net->user_ns, CAP_NET_ADMIN)) return -EPERM; switch (cmd) { case EBT_SO_SET_ENTRIES: ret = compat_do_replace(net, user, len); break; case EBT_S...
0
84,847
Analyze the following 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 NTPResourceCache::CreateNewTabCSS() { ui::ThemeProvider* tp = ThemeServiceFactory::GetForProfile(profile_); DCHECK(tp); SkColor color_background = tp->GetColor(ThemeService::COLOR_NTP_BACKGROUND); SkColor color_text = tp->GetColor(ThemeService::COLOR_NTP_TEXT); SkColor color_link = tp->GetCo...
0
107,784
Analyze the following 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 acpi_os_wait_events_complete(void) { /* * Make sure the GPE handler or the fixed event handler is not used * on another CPU after removal. */ if (acpi_sci_irq_valid()) synchronize_hardirq(acpi_sci_irq); flush_workqueue(kacpid_wq); flush_workqueue(kacpi_notify_wq); } Commit Message: acpi: Disable...
0
53,878
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static GF_ESD *FFD_GetESDescriptor(FFDemux *ffd, Bool for_audio) { GF_BitStream *bs; Bool dont_use_sl; GF_ESD *esd = (GF_ESD *) gf_odf_desc_esd_new(0); esd->ESID = 1 + (for_audio ? ffd->audio_st : ffd->video_st); esd->decoderConfig->streamType = for_audio ? GF_STREAM_AUDIO : GF_STREAM_VISUAL; esd->decoderCo...
0
92,857
Analyze the following 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 gdImageStringUp (gdImagePtr im, gdFontPtr f, int x, int y, unsigned char *s, int color) { int i; int l; l = strlen ((char *) s); for (i = 0; (i < l); i++) { gdImageCharUp(im, f, x, y, s[i], color); y -= f->w; } } Commit Message: iFixed bug #72446 - Integer Overflow in gdImagePaletteToTrueColor() re...
0
51,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: void php_snmp_write_property(zval *object, zval *member, zval *value, const zend_literal *key TSRMLS_DC) { zval tmp_member; php_snmp_object *obj; php_snmp_prop_handler *hnd; int ret; if (Z_TYPE_P(member) != IS_STRING) { tmp_member = *member; zval_copy_ctor(&tmp_member); convert_to_string(&tmp_member);...
0
9,556
Analyze the following 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 InputType::DisableSecureTextInput() {} Commit Message: MacViews: Enable secure text input for password Textfields. In Cocoa the NSTextInputContext automatically enables secure text input when activated and it's in the secure text entry mode. RenderWidgetHostViewMac did the similar thing for ages following...
0
126,189
Analyze the following 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 ihevcd_get_pic_mv_bank_size(WORD32 num_luma_samples) { WORD32 size; WORD32 pic_size; WORD32 mv_bank_size; WORD32 num_pu; WORD32 num_ctb; pic_size = num_luma_samples; num_pu = pic_size / (MIN_PU_SIZE * MIN_PU_SIZE); num_ctb = pic_size / (MIN_CTB_SIZE * MIN_CTB_SIZE); ...
0
162,370
Analyze the following 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 auto_connect(struct socket *sock, struct tipc_msg *msg) { struct tipc_sock *tsock = tipc_sk(sock->sk); struct tipc_port *p_ptr; tsock->peer_name.ref = msg_origport(msg); tsock->peer_name.node = msg_orignode(msg); p_ptr = tipc_port_deref(tsock->p->ref); if (!p_ptr) return -EINVAL; __tipc_conn...
0
30,448
Analyze the following 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 IDNToUnicodeOneComponent(const base::char16* comp, size_t comp_len, base::string16* out) { DCHECK(out); if (comp_len == 0) return false; static const base::char16 kIdnPrefix[] = {'x', 'n', '-', '-'}; if ((comp_len > arraysize(kIdnP...
1
172,390
Analyze the following 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_table_width(struct table *t, short *orgwidth, short *cellwidth, int flag) { #ifdef __GNUC__ short newwidth[t->maxcol + 1]; #else /* not __GNUC__ */ short newwidth[MAXCOL]; #endif /* not __GNUC__ */ int i; int swidth; struct table_cell *cell = &t->cell; int rulewidth = table_rule_...
0
84,629
Analyze the following 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 WebGLRenderingContextBase::commit() { int width = GetDrawingBuffer()->Size().Width(); int height = GetDrawingBuffer()->Size().Height(); if (PaintRenderingResultsToCanvas(kBackBuffer)) { if (Host()->GetOrCreateCanvasResourceProvider(kPreferAcceleration)) { Host()->Commit(Host()->ResourceProvi...
0
142,329
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: cdf_count_chain(const cdf_sat_t *sat, cdf_secid_t sid, size_t size) { size_t i, j; cdf_secid_t maxsector = (cdf_secid_t)(sat->sat_len * size); DPRINTF(("Chain:")); for (j = i = 0; sid >= 0; i++, j++) { DPRINTF((" %d", sid)); if (j >= CDF_LOOP_LIMIT) { DPRINTF(("Counting chain loop limit")); errno =...
0
39,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: single_step_cont(struct pt_regs *regs, struct die_args *args) { /* * Single step exception from kernel space to user space so * eat the exception and continue the process: */ printk(KERN_ERR "KGDB: trap/step from kernel to user space, " "resuming...\n"); kgdb_arch_handle_exception(args->trapnr, args->...
0
25,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: void ReadableStream::error(DOMException* exception) { if (m_state != ReadableStream::Readable) return; m_exception = exception; clearQueue(); rejectAllPendingReads(m_exception); m_state = Errored; if (m_reader) m_reader->error(); } Commit Message: Remove blink::ReadableSt...
0
120,341
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ContentBrowserClient* RenderViewTest::CreateContentBrowserClient() { return new ContentBrowserClient; } Commit Message: Connect WebUSB client interface to the devices app This provides a basic WebUSB client interface in content/renderer. Most of the interface is unimplemented, but this CL hooks up navigator.u...
0
123,062
Analyze the following 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 fuse_notify_inval_inode(struct fuse_conn *fc, unsigned int size, struct fuse_copy_state *cs) { struct fuse_notify_inval_inode_out outarg; int err = -EINVAL; if (size != sizeof(outarg)) goto err; err = fuse_copy_one(cs, &outarg, sizeof(outarg)); if (err) goto err; fuse_copy_finish(cs)...
0
24,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: void ap_flush_queue(struct ap_device *ap_dev) { spin_lock_bh(&ap_dev->lock); __ap_flush_queue(ap_dev); spin_unlock_bh(&ap_dev->lock); } Commit Message: crypto: prefix module autoloading with "crypto-" This prefixes all crypto module loading with "crypto-" so we never run the risk of exposing module auto-load...
0
47,594
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SYSCALL_DEFINE1(sched_get_priority_max, int, policy) { int ret = -EINVAL; switch (policy) { case SCHED_FIFO: case SCHED_RR: ret = MAX_USER_RT_PRIO-1; break; case SCHED_NORMAL: case SCHED_BATCH: case SCHED_IDLE: ret = 0; break; } return ret; } Commit Message: Sched: fix skip_clock_update optimiz...
0
22,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: void BlobData::appendData(PassRefPtr<RawData> data, long long offset, long long length) { m_items.append(BlobDataItem(data, offset, length)); } Commit Message: Remove BlobRegistry indirection since there is only one implementation. BUG= Review URL: https://chromiumcodereview.appspot.com/15851008 git-svn-i...
0
102,505
Analyze the following 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 dns_validate_dns_response(unsigned char *resp, unsigned char *bufend, struct dns_resolution *resolution, int max_answer_records) { unsigned char *reader; char *previous_dname, tmpname[DNS_MAX_NAME_SIZE]; int len, flags, offset; int dns_query_record_id; int nb_saved_records; struct dns_qu...
1
164,600
Analyze the following 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 cmd_xstats(char *tag, int c) { int metric; if (backend_current) { /* remote mailbox */ const char *cmd = "Xstats"; prot_printf(backend_current->out, "%s %s ", tag, cmd); if (!pipe_command(backend_current, 65536)) { pipe_including_tag(backend_curren...
0
95,191
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int __init dccp_v6_init(void) { int err = proto_register(&dccp_v6_prot, 1); if (err != 0) goto out; err = inet6_add_protocol(&dccp_v6_protocol, IPPROTO_DCCP); if (err != 0) goto out_unregister_proto; inet6_register_protosw(&dccp_v6_protosw); err = register_pernet_subsys(&dccp_v6_ops); if (er...
0
18,766
Analyze the following 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 ext_index_add_object(struct object *object, const char *name) { struct eindex *eindex = &bitmap_git.ext_index; khiter_t hash_pos; int hash_ret; int bitmap_pos; hash_pos = kh_put_sha1_pos(eindex->positions, object->oid.hash, &hash_ret); if (hash_ret > 0) { if (eindex->count >= eindex->alloc) {...
0
54,927
Analyze the following 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_xmlwriter_end(INTERNAL_FUNCTION_PARAMETERS, xmlwriter_read_int_t internal_function) { zval *pind; xmlwriter_object *intern; xmlTextWriterPtr ptr; int retval; #ifdef ZEND_ENGINE_2 zval *this = getThis(); if (this) { XMLWRITER_FROM_OBJECT(intern, this); if (zend_parse_parameters_none() =...
0
15,333
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: dtls1_fix_message_header(SSL *s, unsigned long frag_off, unsigned long frag_len) { struct hm_header_st *msg_hdr = &s->d1->w_msg_hdr; msg_hdr->frag_off = frag_off; msg_hdr->frag_len = frag_len; } Commit Message: CWE ID: CWE-399
0
14,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 QQuickWebViewExperimental::setAlertDialog(QQmlComponent* alertDialog) { Q_D(QQuickWebView); if (d->alertDialog == alertDialog) return; d->alertDialog = alertDialog; emit alertDialogChanged(); } Commit Message: [Qt][WK2] There's no way to test the gesture tap on WTR https://bugs.webki...
0
108,038
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WebURLRequest::RequestContext ResourceFetcher::DetermineRequestContext( Resource::Type type, IsImageSet is_image_set, bool is_main_frame) { DCHECK((is_image_set == kImageNotImageSet) || (type == Resource::kImage && is_image_set == kImageIsImageSet)); switch (type) { case Resource::kMa...
0
138,877
Analyze the following 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::Function> createCaptor(String* value) { return StringCapturingFunction::createFunction(getScriptState(), value); } Commit Message: Remove blink::ReadableStream This CL removes two stable runtime enabled flags - ResponseConstructedWithReadableStream - ResponseBodyWithV8ExtraSt...
0
120,365
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MetricsWebContentsObserver* MetricsWebContentsObserver::CreateForWebContents( content::WebContents* web_contents, std::unique_ptr<PageLoadMetricsEmbedderInterface> embedder_interface) { DCHECK(web_contents); MetricsWebContentsObserver* metrics = FromWebContents(web_contents); if (!metrics) { me...
0
140,128
Analyze the following 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 brcmf_cfg80211_detach(struct brcmf_cfg80211_info *cfg) { if (!cfg) return; brcmf_btcoex_detach(cfg); wiphy_unregister(cfg->wiphy); kfree(cfg->ops); wl_deinit_priv(cfg); brcmf_free_wiphy(cfg->wiphy); } Commit Message: brcmfmac: avoid potential stack overflow in brcmf_cfg80211_start_ap() User-space ...
0
49,011
Analyze the following 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 ext3_quota_on_mount(struct super_block *sb, int type) { return dquot_quota_on_mount(sb, EXT3_SB(sb)->s_qf_names[type], EXT3_SB(sb)->s_jquota_fmt, type); } Commit Message: ext3: Fix format string issues ext3_msg() takes the printk prefix as the second parameter and the format string as the third...
0
32,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 void RemoveObserver(Observer* observer) {} Commit Message: Remove use of libcros from InputMethodLibrary. BUG=chromium-os:16238 TEST==confirm that input methods work as before on the netbook. Also confirm that the chrome builds and works on the desktop as before. Review URL: http://codereview.chromi...
0
100,840
Analyze the following 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 u32 tun_get_msglevel(struct net_device *dev) { #ifdef TUN_DEBUG struct tun_struct *tun = netdev_priv(dev); return tun->debug; #else return -EOPNOTSUPP; #endif } Commit Message: net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared After the last patch, We are left in a state in which...
0
23,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 RenderFrameImpl::SetEffectiveConnectionTypeForTesting( blink::WebEffectiveConnectionType type) { effective_connection_type_ = type; } Commit Message: Convert FrameHostMsg_DidAddMessageToConsole to Mojo. Note: Since this required changing the test RenderViewImplTest.DispatchBeforeUnloadCanDetachFrame,...
0
139,843
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void AutofillDialogViews::UpdateSection(DialogSection section) { UpdateSectionImpl(section, true); } Commit Message: Clear out some minor TODOs. BUG=none Review URL: https://codereview.chromium.org/1047063002 Cr-Commit-Position: refs/heads/master@{#322959} CWE ID: CWE-20
0
110,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: cff_builder_init( CFF_Builder* builder, TT_Face face, CFF_Size size, CFF_GlyphSlot glyph, FT_Bool hinting ) { builder->path_begun = 0; builder->load_points = 1; builder->face = face; buil...
0
10,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: net::RequestPriority ConvertWebKitPriorityToNetPriority( const WebURLRequest::Priority& priority) { switch (priority) { case WebURLRequest::PriorityVeryHigh: return net::HIGHEST; case WebURLRequest::PriorityHigh: return net::MEDIUM; case WebURLRequest::PriorityMedium: return ...
0
113,055
Analyze the following 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 BlobRegistryProxy::registerBlobURL(const KURL& url, const KURL& srcURL) { if (m_webBlobRegistry) m_webBlobRegistry->registerBlobURL(url, srcURL); } Commit Message: Remove BlobRegistry indirection since there is only one implementation. BUG= Review URL: https://chromiumcodereview.appspot.com/15...
0
102,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: static inline unsigned long cpu_util(int cpu) { struct cfs_rq *cfs_rq; unsigned int util; cfs_rq = &cpu_rq(cpu)->cfs; util = READ_ONCE(cfs_rq->avg.util_avg); if (sched_feat(UTIL_EST)) util = max(util, READ_ONCE(cfs_rq->avg.util_est.enqueued)); return min_t(unsigned long, util, capacity_orig_of(cpu)); }...
0
92,517
Analyze the following 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 reds_get_mouse_mode(void) { return reds->mouse_mode; } Commit Message: CWE ID: CWE-119
0
1,866