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: megasas_get_pd_list(struct megasas_instance *instance) { int ret = 0, pd_index = 0; struct megasas_cmd *cmd; struct megasas_dcmd_frame *dcmd; struct MR_PD_LIST *ci; struct MR_PD_ADDRESS *pd_addr; dma_addr_t ci_h = 0; if (instance->pd_list_not_supported) { dev_info(&instance->pdev->dev, "MR_DCMD_PD_LIST_...
0
90,357
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: status_t Parcel::writeUtf8AsUtf16(const std::string& str) { const uint8_t* strData = (uint8_t*)str.data(); const size_t strLen= str.length(); const ssize_t utf16Len = utf8_to_utf16_length(strData, strLen); if (utf16Len < 0 || utf16Len> std::numeric_limits<int32_t>::max()) { return BAD_VALUE; } status_t er...
0
163,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: compat_user_backtrace(struct compat_frame_tail __user *tail, struct perf_callchain_entry *entry) { struct compat_frame_tail buftail; unsigned long err; /* Also check accessibility of one struct frame_tail beyond */ if (!access_ok(VERIFY_READ, tail, sizeof(buftail))) return NULL; pagefault_disable...
0
56,225
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int emulator_read_emulated(struct x86_emulate_ctxt *ctxt, unsigned long addr, void *val, unsigned int bytes, struct x86_exception *exception) { return emulator_read_write(ctxt, addr, val, bytes, exception, &read_emultor); } Commit Message: KVM: Ensure all vcpus are consiste...
0
20,681
Analyze the following 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 show_pte(struct mm_struct *mm, unsigned long addr) { pgd_t *pgd; if (!mm) mm = &init_mm; pr_alert("pgd = %p\n", mm->pgd); pgd = pgd_offset(mm, addr); pr_alert("[%08lx] *pgd=%016llx", addr, pgd_val(*pgd)); do { pud_t *pud; pmd_t *pmd; pte_t *pte; if (pgd_none(*pgd) || pgd_bad(*pgd)) bre...
0
58,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: OMX_ERRORTYPE omx_vdec::allocate_color_convert_buf::cache_ops( unsigned int index, unsigned int cmd) { if (!enabled) { return OMX_ErrorNone; } if (!omx || index >= omx->drv_ctx.op_buf.actualcount) { DEBUG_PRINT_ERROR("%s: Invalid param", __func__); return OMX_ErrorBadParameter; } struct ion_flus...
0
160,247
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GDataEntry* GDataFile::FromDocumentEntry( GDataDirectory* parent, DocumentEntry* doc, GDataDirectoryService* directory_service) { DCHECK(doc->is_hosted_document() || doc->is_file()); GDataFile* file = new GDataFile(parent, directory_service); file->title_ = UTF16ToUTF8(doc->title()); if (do...
1
171,485
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static inline void hrtick_clear(struct rq *rq) { } Commit Message: Sched: fix skip_clock_update optimization idle_balance() drops/retakes rq->lock, leaving the previous task vulnerable to set_tsk_need_resched(). Clear it after we return from balancing instead, and in setup_thread_stack() as well, so no success...
0
22,447
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: RenderText* SimplifiedBackwardsTextIterator::handleFirstLetter(int& startOffset, int& offsetInNode) { RenderText* renderer = toRenderText(m_node->renderer()); startOffset = (m_node == m_startNode) ? m_startOffset : 0; if (!renderer->isTextFragment()) { offsetInNode = 0; return rendere...
0
113,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: static void t1_printf(const char *fmt, ...) { va_list args; va_start(args, fmt); vsprintf(t1_line_array, fmt, args); t1_puts(t1_line_array); va_end(args); } Commit Message: writet1 protection against buffer overflow git-svn-id: svn://tug.org/texlive/trunk/Build/source@48697 c570f23f-e606-041...
0
76,658
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static ssize_t o2nm_node_local_show(struct config_item *item, char *page) { return sprintf(page, "%d\n", to_o2nm_node(item)->nd_local); } Commit Message: ocfs2: subsystem.su_mutex is required while accessing the item->ci_parent The subsystem.su_mutex is required while accessing the item->ci_parent, otherwise, ...
0
85,763
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static __be32 nfsd4_encode_components_esc(struct xdr_stream *xdr, char sep, char *components, char esc_enter, char esc_exit) { __be32 *p; __be32 pathlen; int pathlen_offset; int strlen, count=0; char *str, *end, *next; dprintk("nfsd4_encode_components(%s)\n", components); pathlen_offset = x...
0
65,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: String Location::pathname() const { return DOMURLUtilsReadOnly::pathname(Url()); } Commit Message: Check the source browsing context's CSP in Location::SetLocation prior to dispatching a navigation to a `javascript:` URL. Makes `javascript:` navigations via window.location.href compliant with https://html.spe...
0
152,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: static int check_resource_valid(struct vrend_renderer_resource_create_args *args) { /* do not accept handle 0 */ if (args->handle == 0) return -1; /* limit the target */ if (args->target >= PIPE_MAX_TEXTURE_TYPES) return -1; if (args->format >= VIRGL_FORMAT_MAX) return -1; /...
0
8,790
Analyze the following 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 __perf_addr_filters_adjust(struct perf_event *event, void *data) { struct perf_addr_filters_head *ifh = perf_event_addr_filters(event); struct vm_area_struct *vma = data; unsigned long off = vma->vm_pgoff << PAGE_SHIFT, flags; struct file *file = vma->vm_file; struct perf_addr_filter *filter; un...
0
68,288
Analyze the following 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 AddRegistryKeyWatcher(const wchar_t* key_path) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); auto reg_key = std::make_unique<base::win::RegKey>(HKEY_CURRENT_USER, key_path, KEY_NOTIFY); if (reg_key->Valid() && reg_key->Sta...
0
144,654
Analyze the following 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 pfkey_dump_sp_done(struct pfkey_sock *pfk) { xfrm_policy_walk_done(&pfk->dump.u.policy); } Commit Message: af_key: initialize satype in key_notify_policy_flush() This field was left uninitialized. Some user daemons perform check against this field. Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6...
0
31,417
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void ff_parse_close(AVCodecParserContext *s) { ParseContext *pc = s->priv_data; av_freep(&pc->buffer); } Commit Message: avcodec/parser: reset indexes on realloc failure Fixes Ticket2982 Signed-off-by: Michael Niedermayer <michaelni@gmx.at> CWE ID: CWE-119
0
28,027
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: long Cluster::Load(long long& pos, long& len) const { assert(m_pSegment); assert(m_pos >= m_element_start); if (m_timecode >= 0) // at least partially loaded return 0; assert(m_pos == m_element_start); assert(m_element_size < 0); IMkvReader* const pReader = m_pSegment->m_pReader; long long tota...
1
173,830
Analyze the following 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 apic_reg_write(struct kvm_lapic *apic, u32 reg, u32 val) { int ret = 0; trace_kvm_apic_write(reg, val); switch (reg) { case APIC_ID: /* Local APIC ID */ if (!apic_x2apic_mode(apic)) kvm_apic_set_id(apic, val >> 24); else ret = 1; break; case APIC_TASKPRI: report_tpr_access(apic, ...
0
28,730
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void hns_nic_poll_controller(struct net_device *ndev) { struct hns_nic_priv *priv = netdev_priv(ndev); unsigned long flags; int i; local_irq_save(flags); for (i = 0; i < priv->ae_handle->q_num * 2; i++) napi_schedule(&priv->ring_data[i].napi); local_irq_restore(flags); } Commit Message: net: hns: Fix a ...
0
85,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: xmlBufSetAllocationScheme(xmlBufPtr buf, xmlBufferAllocationScheme scheme) { if ((buf == NULL) || (buf->error != 0)) { #ifdef DEBUG_BUFFER xmlGenericError(xmlGenericErrorContext, "xmlBufSetAllocationScheme: buf == NULL or in error\n"); #endif return(-1); } i...
0
150,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: String AXListBoxOption::textAlternative(bool recursive, bool inAriaLabelledByTraversal, AXObjectSet& visited, AXNameFrom& nameFrom, AXRelatedObjectVector*...
0
127,112
Analyze the following 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 SetURLText(const base::string16& text) { if (editor_->details_.type != BookmarkEditor::EditDetails::NEW_FOLDER) editor_->url_tf_->SetText(text); } Commit Message: Prevent interpretating userinfo as url scheme when editing bookmarks Chrome's Edit Bookmark dialog formats urls for display such...
0
130,769
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static struct bpf_func_state *func(struct bpf_verifier_env *env, const struct bpf_reg_state *reg) { struct bpf_verifier_state *cur = env->cur_state; return cur->frame[reg->frameno]; } Commit Message: bpf: 32-bit RSH verification must truncate input before the ALU op When I wrote commit 468f6eafa6c4 ("...
0
76,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: void RenderViewHostImpl::OnUpdateTargetURL(int32 page_id, const GURL& url) { if (!is_swapped_out_) delegate_->UpdateTargetURL(page_id, url); Send(new ViewMsg_UpdateTargetURL_ACK(GetRoutingID())); } Commit Message: Filter more incoming URLs in the CreateWindow path. BUG=170532 Review URL: https://chrom...
0
117,283
Analyze the following 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 md_do_sync(struct md_thread *thread) { struct mddev *mddev = thread->mddev; struct mddev *mddev2; unsigned int currspeed = 0, window; sector_t max_sectors,j, io_sectors, recovery_done; unsigned long mark[SYNC_MARKS]; unsigned long update_time; sector_t mark_cnt[SYNC_MARKS]; int last_mark,m; struc...
0
42,426
Analyze the following 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 WebGLRenderingContextBase::ValidateStencilSettings( const char* function_name) { if (stencil_mask_ != stencil_mask_back_ || stencil_func_ref_ != stencil_func_ref_back_ || stencil_func_mask_ != stencil_func_mask_back_) { SynthesizeGLError(GL_INVALID_OPERATION, function_name, ...
0
133,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: int vrend_renderer_init(struct vrend_if_cbs *cbs, uint32_t flags) { int gl_ver; virgl_gl_context gl_context; struct virgl_gl_ctx_param ctx_params; if (!vrend_state.inited) { vrend_state.inited = true; vrend_object_init_resource_table(); vrend_clicbs = cbs; } ctx_params.shared...
0
8,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: GahpClient::setNormalProxy( Proxy *proxy ) { if ( !server->can_cache_proxies ) { return; } if ( normal_proxy != NULL && proxy == normal_proxy->proxy ) { return; } if ( normal_proxy != NULL ) { server->UnregisterProxy( normal_proxy->proxy ); } GahpProxyInfo *gahp_proxy = server->RegisterProxy( proxy )...
0
16,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: void MojoAudioOutputIPC::ReceivedDeviceAuthorization( media::OutputDeviceStatus status, const media::AudioParameters& params, const std::string& device_id) const { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); DCHECK(delegate_); delegate_->OnDeviceAuthorized(status, params, device_id); } Comm...
0
149,369
Analyze the following 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 RequestFaviconSyncForPageURL(const GURL& page_url) { base::RunLoop run_loop; quit_closure_ = run_loop.QuitClosure(); favicon_service_->GetRawFaviconForPageURL( page_url, {favicon_base::IconType::kFavicon}, gfx::kFaviconSize, /*fallback_to_host=*/false, base::Bind(&Remove...
0
154,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: int __init snd_card_info_init(void) { struct snd_info_entry *entry; entry = snd_info_create_module_entry(THIS_MODULE, "cards", NULL); if (! entry) return -ENOMEM; entry->c.text.read = snd_card_info_read; if (snd_info_register(entry) < 0) { snd_info_free_entry(entry); return -ENOMEM; } snd_card_info_...
0
36,521
Analyze the following 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 kmem_cache_free(struct kmem_cache *cachep, void *objp) { unsigned long flags; cachep = cache_from_obj(cachep, objp); if (!cachep) return; local_irq_save(flags); debug_check_no_locks_freed(objp, cachep->object_size); if (!(cachep->flags & SLAB_DEBUG_OBJECTS)) debug_check_no_obj_freed(objp, cachep->...
0
68,904
Analyze the following 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 TriggerShowLoginWizardFinish( std::string switch_locale, std::unique_ptr<ShowLoginWizardSwitchLanguageCallbackData> data) { if (switch_locale.empty()) { ShowLoginWizardFinish(data->first_screen, data->startup_manifest); } else { chromeos::locale_util::SwitchLanguageCallback callback( ...
0
131,665
Analyze the following 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_lookup_alternate_content(fz_xml *node) { for (node = fz_xml_down(node); node; node = fz_xml_next(node)) { if (!strcmp(fz_xml_tag(node), "mc:Choice") && fz_xml_att(node, "Requires")) { char list[64]; char *next = list, *item; fz_strlcpy(list, fz_xml_att(node, "Requires"), sizeof(list)); while...
0
13,149
Analyze the following 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 hid_match_one_id(struct hid_device *hdev, const struct hid_device_id *id) { return (id->bus == HID_BUS_ANY || id->bus == hdev->bus) && (id->group == HID_GROUP_ANY || id->group == hdev->group) && (id->vendor == HID_ANY_ID || id->vendor == hdev->vendor) && (id->product == HID_ANY_ID || id->prod...
0
49,501
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: uint32_t ReverbGetDecayTime(ReverbContext *pContext){ LVREV_ControlParams_st ActiveParams; /* Current control Parameters */ LVREV_ReturnStatus_en LvmStatus=LVREV_SUCCESS; /* Function call status */ /* Get the current settings */ LvmStatus = LVREV_GetControlParameters(pContext->hInstance, &Activ...
0
157,433
Analyze the following 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 ChromeDownloadManagerDelegate::ShouldCompleteDownload( DownloadItem* item, const base::Closure& user_complete_callback) { return IsDownloadReadyForCompletion(item, base::Bind( &ChromeDownloadManagerDelegate::ShouldCompleteDownloadInternal, weak_ptr_factory_.GetWeakPtr(), item->GetId(), ...
0
146,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: static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, char __user *optval, int optlen) { struct sock *sk = sock->sk; struct bt_security sec; int len, err = 0; u32 opt; BT_DBG("sk %p", sk); if (level == SOL_L2CAP) return l2cap_sock_setsockopt_old(sock, optname, optval, optlen); ...
0
58,976
Analyze the following 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 local_flush_tlb_kernel_range(unsigned long start, unsigned long end) { /* FIXME: Optimize this later.. */ flush_tlb_all(); } 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...
0
25,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 FrameLoader::RestoreScrollPositionAndViewState( WebFrameLoadType load_type, bool is_same_document, HistoryItem::ViewState* view_state, HistoryScrollRestorationType scroll_restoration_type) { LocalFrameView* view = frame_->View(); if (!view || !view->LayoutViewportScrollableArea() || ...
0
154,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: void* GenericMPEdup(struct _cms_typehandler_struct* self, const void *Ptr, cmsUInt32Number n) { return (void*) cmsStageDup((cmsStage*) Ptr); cmsUNUSED_PARAMETER(n); cmsUNUSED_PARAMETER(self); } Commit Message: Added an extra check to MLU bounds Thanks to Ibrahim el-sayed for spotting the bug CWE ID...
0
70,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: UNCURL_EXPORT int32_t uncurl_ws_write(struct uncurl_conn *ucc, char *buf, uint32_t buf_len, uint8_t opcode) { struct ws_header h; memset(&h, 0, sizeof(struct ws_header)); h.fin = 1; h.mask = ucc->ws_mask; h.opcode = opcode; h.payload_len = buf_len; if (h.payload_len + WS_HEADER_SIZE > ucc->netbuf_size) {...
0
84,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: int udp_lib_setsockopt(struct sock *sk, int level, int optname, char __user *optval, unsigned int optlen, int (*push_pending_frames)(struct sock *)) { struct udp_sock *up = udp_sk(sk); int val; int err = 0; int is_udplite = IS_UDPLITE(sk); if (optlen < sizeof(int)) return -EINVAL; if (...
0
19,093
Analyze the following 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 acm_write_bulk(struct urb *urb) { struct acm_wb *wb = urb->context; struct acm *acm = wb->instance; unsigned long flags; int status = urb->status; if (status || (urb->actual_length != urb->transfer_buffer_length)) dev_vdbg(&acm->data->dev, "%s - len %d/%d, status %d\n", __func__, urb->ac...
0
54,223
Analyze the following 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 StartupBrowserCreator::AddFirstRunTab(const GURL& url) { first_run_tabs_.push_back(url); } Commit Message: Prevent regular mode session startup pref type turning to default. When user loses past session tabs of regular mode after invoking a new window from the incognito mode. This was happening because ...
0
137,490
Analyze the following 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 spl_heap_it_rewind(zend_object_iterator *iter TSRMLS_DC) /* {{{ */ { /* do nothing, the iterator always points to the top element */ } /* }}} */ Commit Message: CWE ID:
0
14,899
Analyze the following 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 bool is_frwd(struct usb_device *dev) { return ((le16_to_cpu(dev->descriptor.idVendor) == VENDOR_ID_FRWD) && (le16_to_cpu(dev->descriptor.idProduct) == PRODUCT_ID_CYPHIDCOM_FRWD)); } Commit Message: USB: cypress_m8: add endpoint sanity check An attack using missing endpoints exists. CVE-2016-31...
0
54,253
Analyze the following 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 yv12_extend_frame_bottom_c(YV12_BUFFER_CONFIG *ybf) { int i; unsigned char *src_ptr1, *src_ptr2; unsigned char *dest_ptr2; unsigned int Border; int plane_stride; int plane_height; /***********/ /* Y Plane */ /***********/ Border = ybf->border; plane_stride = ybf->y_stride; plane_he...
0
162,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: OVS_REQUIRES(ofproto_mutex) { if (m->flags & NXFMF_INITIAL) { ofproto_collect_ofmonitor_refresh_rules(m, 0, rules); } } Commit Message: ofproto: Fix OVS crash when reverting old flows in bundle commit During bundle commit flows which are added in bundle are applied to ofproto in-order. In ca...
0
77,185
Analyze the following 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 media_device_get_info(struct media_device *dev, struct media_device_info __user *__info) { struct media_device_info info; memset(&info, 0, sizeof(info)); strlcpy(info.driver, dev->dev->driver->name, sizeof(info.driver)); strlcpy(info.model, dev->model, sizeof(info.model)); strlcpy(info.seri...
0
39,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: OMX_ERRORTYPE SoftG711::internalGetParameter( OMX_INDEXTYPE index, OMX_PTR params) { switch (index) { case OMX_IndexParamAudioPcm: { OMX_AUDIO_PARAM_PCMMODETYPE *pcmParams = (OMX_AUDIO_PARAM_PCMMODETYPE *)params; if (pcmParams->nPortIndex > 1) { ...
1
174,205
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ModuleExport void UnregisterPSDImage(void) { (void) UnregisterMagickInfo("PSB"); (void) UnregisterMagickInfo("PSD"); } Commit Message: https://github.com/ImageMagick/ImageMagick/issues/714 CWE ID: CWE-834
0
61,527
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu) { /* Address WBINVD may be executed by guest */ if (need_emulate_wbinvd(vcpu)) { if (kvm_x86_ops->has_wbinvd_exit()) cpumask_set_cpu(cpu, vcpu->arch.wbinvd_dirty_mask); else if (vcpu->cpu != -1 && vcpu->cpu != cpu) smp_call_function_single(vcpu->...
0
33,281
Analyze the following 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 InspectorResourceAgent::didReceiveWebSocketFrame(unsigned long identifier, int opCode, bool masked, const char* payload, size_t payloadLength) { RefPtr<TypeBuilder::Network::WebSocketFrame> frameObject = TypeBuilder::Network::WebSocketFrame::create() .setOpcode(opCode) .setMask(masked) ...
0
114,152
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: string16 SessionCrashedInfoBarDelegate::GetMessageText() const { return l10n_util::GetStringUTF16(IDS_SESSION_CRASHED_VIEW_MESSAGE); } Commit Message: chromeos: Move audio, power, and UI files into subdirs. This moves more files from chrome/browser/chromeos/ into subdirectories. BUG=chromium-os:22896 TEST=di...
0
109,381
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ClientMajorVersion(ClientPtr client) { VidModePrivPtr pPriv; pPriv = VM_GETPRIV(client); if (!pPriv) return 0; else return pPriv->major; } Commit Message: CWE ID: CWE-20
0
17,693
Analyze the following 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 btrfs_dirty_inode(struct inode *inode) { struct btrfs_root *root = BTRFS_I(inode)->root; struct btrfs_trans_handle *trans; int ret; if (test_bit(BTRFS_INODE_DUMMY, &BTRFS_I(inode)->runtime_flags)) return 0; trans = btrfs_join_transaction(root); if (IS_ERR(trans)) return PTR_ERR(trans); re...
0
41,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: virtual ~WorkerThreadTask() { } Commit Message: Correctly keep track of isolates for microtask execution BUG=487155 R=haraken@chromium.org Review URL: https://codereview.chromium.org/1161823002 git-svn-id: svn://svn.chromium.org/blink/trunk@195985 bbb929c8-8fbe-4397-9dbb-9b2b20218538 CWE ID: CWE-254
0
127,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: bool RenderWidgetHostImpl::IsFullscreen() const { return false; } Commit Message: Implement TextureImageTransportSurface using texture mailbox This has a couple of advantages: - allow tearing down and recreating the UI parent context without losing the renderer contexts - do not require a context to be able t...
0
114,637
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: JSObject* createRangeError(ExecState* exec, const UString& message) { return createRangeError(exec->lexicalGlobalObject(), message); } Commit Message: [JSC] Implement a helper method createNotEnoughArgumentsError() https://bugs.webkit.org/show_bug.cgi?id=85102 Reviewed by Geoffrey Garen. In bug 84787, kbr@...
0
101,008
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: OMX_ERRORTYPE SoftG711::internalGetParameter( OMX_INDEXTYPE index, OMX_PTR params) { switch (index) { case OMX_IndexParamAudioPcm: { OMX_AUDIO_PARAM_PCMMODETYPE *pcmParams = (OMX_AUDIO_PARAM_PCMMODETYPE *)params; if (!isValidOMXParam(pcmParams)) { return OMX_ErrorBadParameter; } if (...
0
160,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: CrossSiteRedirectResponseHandler(const net::EmbeddedTestServer* test_server, const net::test_server::HttpRequest& request) { net::HttpStatusCode http_status_code; size_t length_of_chosen_prefix; std::string prefix_302("/cross-site/"); std::string prefix_307("/cross-site-3...
0
156,032
Analyze the following 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 int JBIG2Bitmap::nextPixel(JBIG2BitmapPtr *ptr) { int pix; if (!ptr->p) { pix = 0; } else if (ptr->x < 0) { ++ptr->x; pix = 0; } else { pix = (*ptr->p >> ptr->shift) & 1; if (++ptr->x == w) { ptr->p = NULL; } else if (ptr->shift == 0) { ++ptr->p; ptr->shif...
0
1,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: add_opt_anc_info(OptAnc* to, int anc) { if (is_left(anc)) to->left |= anc; else to->right |= anc; } Commit Message: Fix CVE-2019-13225: problem in converting if-then-else pattern to bytecode. CWE ID: CWE-476
0
89,104
Analyze the following 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 AudioMixerAlsa::ConnectInternal() { DCHECK(MessageLoop::current() == thread_->message_loop()); num_connection_attempts_++; int err; snd_mixer_t* handle = NULL; if ((err = snd_mixer_open(&handle, 0)) < 0) { if (num_connection_attempts_ == kConnectionAttemptToLogFailure) LOG(WARNING) << "M...
0
109,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: PHP_FUNCTION(imagecopy) { zval *SIM, *DIM; long SX, SY, SW, SH, DX, DY; gdImagePtr im_dst, im_src; int srcH, srcW, srcY, srcX, dstY, dstX; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrllllll", &DIM, &SIM, &DX, &DY, &SX, &SY, &SW, &SH) == FAILURE) { return; } ZEND_FETCH_RESOURCE(im_src, gdIma...
0
15,159
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MagickExport void *AcquireAlignedMemory(const size_t count,const size_t quantum) { #define AlignedExtent(size,alignment) \ (((size)+((alignment)-1)) & ~((alignment)-1)) size_t alignment, extent, size; void *memory; if (CheckMemoryOverflow(count,quantum) != MagickFalse) return((void ...
0
71,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: bool HTMLLinkElement::LoadLink(const LinkLoadParameters& params) { return link_loader_->LoadLink(params, GetDocument(), NetworkHintsInterfaceImpl()); } Commit Message: Avoid crash when setting rel=stylesheet on <link> in shadow root. Link elements in shadow roots without rel=st...
0
143,330
Analyze the following 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 RenderBlockFlow::shouldRelayoutForPagination(LayoutUnit& pageLogicalHeight, LayoutUnit layoutOverflowLogicalBottom) const { ColumnInfo* colInfo = columnInfo(); LayoutUnit columnHeight = pageLogicalHeight; const int minColumnCount = colInfo->forcedBreaks() + 1; const int desiredColumnCount = c...
0
116,433
Analyze the following 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 WebPluginProxy::UpdateIMEStatus() { int input_type; gfx::Rect caret_rect; if (!delegate_->GetIMEStatus(&input_type, &caret_rect)) return; Send(new PluginHostMsg_NotifyIMEStatus(route_id_, input_type, caret_rect)); } Commit Message: Convert plugin and GPU process to brokered handle duplication. ...
0
107,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: void RenderFrameHostImpl::OnBeginNavigation( const CommonNavigationParams& common_params, const BeginNavigationParams& begin_params) { CHECK(IsBrowserSideNavigationEnabled()); if (!is_active()) return; CommonNavigationParams validated_params = common_params; GetProcess()->FilterURL(false, &val...
0
127,833
Analyze the following 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 int php_var_unserialize_ex(UNSERIALIZE_PARAMETER) { var_entries *orig_var_entries = (*var_hash)->last; zend_long orig_used_slots = orig_var_entries ? orig_var_entries->used_slots : 0; int result; result = php_var_unserialize_internal(UNSERIALIZE_PASSTHRU); if (!result) { /* If the unserialization...
0
50,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: bson_iter_dup_utf8 (const bson_iter_t *iter, /* IN */ uint32_t *length) /* OUT */ { uint32_t local_length = 0; const char *str; char *ret = NULL; BSON_ASSERT (iter); if ((str = bson_iter_utf8 (iter, &local_length))) { ret = bson_malloc0 (local_length + 1); m...
0
77,831
Analyze the following 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 rds_ib_dev_put(struct rds_ib_device *rds_ibdev) { BUG_ON(atomic_read(&rds_ibdev->refcount) <= 0); if (atomic_dec_and_test(&rds_ibdev->refcount)) queue_work(rds_wq, &rds_ibdev->free_work); } Commit Message: rds: prevent dereference of a NULL device Binding might result in a NULL device, which is derefer...
0
40,105
Analyze the following 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 AuthenticatorBlePowerOnAutomaticSheetModel::IsAcceptButtonVisible() const { return true; } Commit Message: chrome/browser/ui/webauthn: long domains may cause a line break. As requested by UX in [1], allow long host names to split a title into two lines. This allows us to show more of the name before elid...
0
142,951
Analyze the following 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 VectorClamp3(DDSVector3 *value) { value->x = MinF(1.0f,MaxF(0.0f,value->x)); value->y = MinF(1.0f,MaxF(0.0f,value->y)); value->z = MinF(1.0f,MaxF(0.0f,value->z)); } Commit Message: CWE ID: CWE-119
0
71,491
Analyze the following 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 perf_swevent_start_hrtimer(struct perf_event *event) { struct hw_perf_event *hwc = &event->hw; s64 period; if (!is_sampling_event(event)) return; period = local64_read(&hwc->period_left); if (period) { if (period < 0) period = 10000; local64_set(&hwc->period_left, 0); } else { peri...
0
56,140
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: char* _multi_string_alloc_and_copy( LPCWSTR in ) { char *chr; int len = 0; if ( !in ) { return in; } while ( in[ len ] != 0 || in[ len + 1 ] != 0 ) { len ++; } chr = malloc( len + 2 ); len = 0; while ( in[ len ] != 0 || in[ len + 1 ] != 0 ) ...
1
169,313
Analyze the following 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 CALLBACK tq_timer_cb(PVOID arg, BOOLEAN timed_out) { zend_bool *php_timed_out; /* The doc states it'll be always true, however it theoretically could be FALSE when the thread was signaled. */ if (!timed_out) { return; } php_timed_out = (zend_bool *)arg; *php_timed_out = 1; } Commit Message: Use ...
0
57,314
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SwapPromiseManager* LayerTreeHost::GetSwapPromiseManager() { return &swap_promise_manager_; } Commit Message: (Reland) Discard compositor frames from unloaded web content This is a reland of https://codereview.chromium.org/2707243005/ with a small change to fix an uninitialized memory error that fails on MSAN...
0
137,118
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: BOOLEAN btif_hl_find_app_idx(UINT8 app_id, UINT8 *p_app_idx){ BOOLEAN found=FALSE; UINT8 i; for (i=0; i < BTA_HL_NUM_APPS ; i ++) { if (btif_hl_cb.acb[i].in_use && (btif_hl_cb.acb[i].app_id == app_id)) { found = TRUE; *p_app_idx = i; break; } } BTIF_TRACE_DEBUG("%s found=%d app_...
0
158,677
Analyze the following 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_libxml_getParameterEntity(void* user_data, const xmlChar *name) { raptor_sax2* sax2 = (raptor_sax2*)user_data; return libxml2_getParameterEntity(sax2->xc, name); } Commit Message: CVE-2012-0037 Enforce entity loading policy in raptor_libxml_resolveEntity and raptor_libxml_getEntity by checking for fi...
0
21,969
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: DocumentVisibilityObserver::DocumentVisibilityObserver(Document& document) : m_document(nullptr) { registerObserver(document); } Commit Message: Correctly keep track of isolates for microtask execution BUG=487155 R=haraken@chromium.org Review URL: https://codereview.chromium.org/1161823002 git-svn-id:...
0
127,499
Analyze the following 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 DaemonProcess::CloseDesktopSession(int terminal_id) { DCHECK(caller_task_runner()->BelongsToCurrentThread()); if (!IsTerminalIdKnown(terminal_id)) { LOG(ERROR) << "An invalid terminal ID. terminal_id=" << terminal_id; RestartNetworkProcess(); DeleteAllDesktopSessions(); return; } De...
0
118,760
Analyze the following 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 callWithScriptStateScriptArgumentsVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); ScriptState* currentState = ScriptState::current(); if (!currentState) return; ScriptState& state = *curren...
0
122,186
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static unsigned int mntns_inum(void *ns) { struct mnt_namespace *mnt_ns = ns; return mnt_ns->proc_inum; } Commit Message: vfs: Carefully propogate mounts across user namespaces As a matter of policy MNT_READONLY should not be changable if the original mounter had more privileges than creator of the mount name...
0
32,403
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ftp_delete(ftpbuf_t *ftp, const char *path) { if (ftp == NULL) { return 0; } if (!ftp_putcmd(ftp, "DELE", path)) { return 0; } if (!ftp_getresp(ftp) || ftp->resp != 250) { return 0; } return 1; } Commit Message: CWE ID: CWE-119
0
14,789
Analyze the following 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 aac_send_raw_srb(struct aac_dev* dev, void __user * arg) { struct fib* srbfib; int status; struct aac_srb *srbcmd = NULL; struct user_aac_srb *user_srbcmd = NULL; struct user_aac_srb __user *user_srb = arg; struct aac_srb_reply __user *user_reply; struct aac_srb_reply* reply; u32 fibsize = 0; ...
1
165,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: void kvm_ioapic_scan_entry(struct kvm_vcpu *vcpu, ulong *ioapic_handled_vectors) { struct kvm_ioapic *ioapic = vcpu->kvm->arch.vioapic; struct dest_map *dest_map = &ioapic->rtc_status.dest_map; union kvm_ioapic_redirect_entry *e; int index; spin_lock(&ioapic->lock); /* Make sure we see any missing RTC EOI...
0
47,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 int hns_gmac_config_loopback(void *mac_drv, enum hnae_loop loop_mode, u8 enable) { struct mac_driver *drv = (struct mac_driver *)mac_drv; switch (loop_mode) { case MAC_INTERNALLOOP_MAC: dsaf_set_dev_bit(drv, GMAC_LOOP_REG, GMAC_LP_REG_CF2MI_LP_EN_B, !!enable); break; default: dev_er...
0
85,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: status_t FLACSource::start(MetaData * /* params */) { ALOGV("FLACSource::start"); CHECK(!mStarted); mParser->allocateBuffers(); mStarted = true; return OK; } Commit Message: FLACExtractor: copy protect mWriteBuffer Bug: 30895578 Change-Id: I4cba36bbe3502678210e5925181683df9726b431 CWE ID: CW...
0
162,532
Analyze the following 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::DidUpdateBrowserControls() const { web_view_->DidUpdateBrowserControls(); } 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 ...
0
148,140
Analyze the following 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 sctp_pf *sctp_get_pf_specific(sa_family_t family) { switch (family) { case PF_INET: return sctp_pf_inet_specific; case PF_INET6: return sctp_pf_inet6_specific; default: return NULL; } } Commit Message: sctp: fix race on protocol/netns initialization Consider sctp module is unloaded and is bein...
0
42,912
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static size_t ZSTD_crossEntropyCost(short const* norm, unsigned accuracyLog, unsigned const* count, unsigned const max) { unsigned const shift = 8 - accuracyLog; size_t cost = 0; unsigned s; assert(accuracyLog <= 8); for (s = 0; s <= max; ++s) { unsi...
0
90,048
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void RenderViewImpl::DidAutoResize(const blink::WebSize& newSize) { GetWidget()->DidAutoResize(newSize); } Commit Message: Prevent renderer initiated back navigation to cancel a browser one. Renderer initiated back/forward navigations must not be able to cancel ongoing browser initiated navigation if they are...
0
145,097
Analyze the following 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(time_sleep_until) { double d_ts, c_ts; struct timeval tm; struct timespec php_req, php_rem; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &d_ts) == FAILURE) { return; } if (gettimeofday((struct timeval *) &tm, NULL) != 0) { RETURN_FALSE; } c_ts = (double)(d_ts - tm.tv_sec -...
0
4,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 int tx_ack(struct t3cdev *tdev, struct sk_buff *skb, void *ctx) { struct iwch_ep *ep = ctx; struct cpl_wr_ack *hdr = cplhdr(skb); unsigned int credits = ntohs(hdr->credits); unsigned long flags; int post_zb = 0; PDBG("%s ep %p credits %u\n", __func__, ep, credits); if (credits == 0) { PDBG("%s 0...
0
56,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: void RTCPeerConnectionHandler::OnDataChannel( std::unique_ptr<RtcDataChannelHandler> handler) { DCHECK(task_runner_->RunsTasksInCurrentSequence()); TRACE_EVENT0("webrtc", "RTCPeerConnectionHandler::OnDataChannelImpl"); if (peer_connection_tracker_) { peer_connection_tracker_->TrackCreateDataChannel...
0
152,971