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: explicit UseSynchronousResizeModeVisitor(bool enable) : enable_(enable) {} Commit Message: content: Rename webkit_test_helpers.{cc,h} to blink_test_helpers.{cc,h} Now that webkit/ is gone, we are preparing ourselves for the merge of third_party/WebKit into //blink. BUG=None BUG=content_shell && content_unitt...
0
123,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: int wc_ecc_ctx_reset(ecEncCtx* ctx, WC_RNG* rng) { if (ctx == NULL || rng == NULL) return BAD_FUNC_ARG; ecc_ctx_init(ctx, ctx->protocol); return ecc_ctx_set_salt(ctx, ctx->protocol, rng); } Commit Message: Change ECDSA signing to use blinding. CWE ID: CWE-200
0
81,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: xmlSaveUriRealloc(xmlChar *ret, int *max) { xmlChar *temp; int tmp; if (*max > MAX_URI_LENGTH) { xmlURIErrMemory("reaching arbitrary MAX_URI_LENGTH limit\n"); return(NULL); } tmp = *max * 2; temp = (xmlChar *) xmlRealloc(ret, (tmp + 1)); if (temp == NULL) { xmlURIErrMemory("savin...
0
163,362
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: IW_IMPL(void) iw_set_output_colorspace(struct iw_context *ctx, const struct iw_csdescr *csdescr) { ctx->req.output_cs = *csdescr; // struct copy optimize_csdescr(&ctx->req.output_cs); ctx->req.output_cs_valid = 1; } Commit Message: Double-check that the input image's density is valid Fixes a bug that could r...
0
65,004
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PrintFlush() { display = curr->w_pdisplay; if (display && printcmd) { char *bp = curr->w_string; int len = curr->w_stringp - curr->w_string; int r; while (len && display->d_printfd >= 0) { r = write(display->d_printfd, bp, len); if (r <= 0) { WMsg(curr, errno, "p...
0
741
Analyze the following 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_external_key_retries(struct sc_card *card, unsigned char kid, unsigned char *retries) { int r; struct sc_apdu apdu; unsigned char random[16] = { 0 }; r = sc_get_challenge(card, random, 8); LOG_TEST_RET(card->ctx, r, "get challenge get_external_key_retries failed"); sc_format_apdu(card, &apdu, SC_APDU_...
0
78,414
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PHP_METHOD(Phar, webPhar) { zval *mimeoverride = NULL, *rewrite = NULL; char *alias = NULL, *error, *index_php = NULL, *f404 = NULL, *ru = NULL; int alias_len = 0, ret, f404_len = 0, free_pathinfo = 0, ru_len = 0; char *fname, *path_info, *mime_type = NULL, *entry, *pt; const char *basename; int fname_len, ...
1
165,290
Analyze the following 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 nump_dump(GF_Box *a, FILE * trace) { GF_NUMPBox *p; p = (GF_NUMPBox *)a; gf_isom_box_dump_start(a, "LargeTotalPacketBox", trace); fprintf(trace, "PacketsSent=\""LLD"\">\n", LLD_CAST p->nbPackets); gf_isom_box_dump_done("LargeTotalPacketBox", a, trace); return GF_OK; } Commit Message: fixed 2 possib...
0
80,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: bool in_mouse_drag() const { return in_mouse_drag_; } Commit Message: ash: Add launcher overflow bubble. - Host a LauncherView in bubble to display overflown items; - Mouse wheel and two-finger scroll to scroll the LauncherView in bubble in case overflow bubble is overflown; - Fit bubble when items are added/...
0
106,306
Analyze the following 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 handle_xsetbv(struct kvm_vcpu *vcpu) { u64 new_bv = kvm_read_edx_eax(vcpu); u32 index = kvm_register_read(vcpu, VCPU_REGS_RCX); if (kvm_set_xcr(vcpu, index, new_bv) == 0) skip_emulated_instruction(vcpu); return 1; } Commit Message: x86,kvm,vmx: Preserve CR4 across VM entry CR4 isn't constant; ...
0
37,102
Analyze the following 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 xen_blkbk_map(struct xen_blkif_ring *ring, struct grant_page *pages[], int num, bool ro) { struct gnttab_map_grant_ref map[BLKIF_MAX_SEGMENTS_PER_REQUEST]; struct page *pages_to_gnt[BLKIF_MAX_SEGMENTS_PER_REQUEST]; struct persistent_gnt *persistent_gnt = NULL; phys_addr_t addr = 0; int i, ...
0
63,740
Analyze the following 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 TreeView::SetModel(TreeModel* model) { if (model == model_) return; if (model_ && tree_view_) DeleteRootItems(); RemoveObserverFromModel(); model_ = model; if (tree_view_ && model_) { CreateRootItems(); AddObserverToModel(); HIMAGELIST last_image_list = image_list_; image_...
0
100,791
Analyze the following 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::UnguessableToken LocalFrameClientImpl::GetDevToolsFrameToken() const { return web_frame_->Client()->GetDevToolsFrameToken(); } 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 initia...
0
145,279
Analyze the following 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 __net_init int rt_genid_init(struct net *net) { get_random_bytes(&net->ipv4.rt_genid, sizeof(net->ipv4.rt_genid)); get_random_bytes(&net->ipv4.dev_addr_genid, sizeof(net->ipv4.dev_addr_genid)); return 0; } Commit Message: net: Compute protocol sequence numbers and fragment IDs using MD5. Compu...
0
25,175
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: status_t MyOpusExtractor::verifyOpusComments(MediaBuffer *buffer) { int32_t commentSize = buffer->range_length() + 1; sp<ABuffer> aBuf = new ABuffer(commentSize); if (aBuf->capacity() <= buffer->range_length()) { return ERROR_MALFORMED; } uint8_t* commentData = aBuf->data(); memcpy(commentData, (ui...
0
162,202
Analyze the following 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 ParseWave64HeaderConfig (FILE *infile, char *infilename, char *fourcc, WavpackContext *wpc, WavpackConfig *config) { int64_t total_samples = 0, infilesize; Wave64ChunkHeader chunk_header; Wave64FileHeader filehdr; WaveHeader WaveHeader; uint32_t bcount; infilesize = DoGetFileSiz...
1
169,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: INST_HANDLER (lac) { // LAC Z, Rd int d = ((buf[0] >> 4) & 0xf) | ((buf[1] & 0x1) << 4); __generic_ld_st (op, "ram", 'z', 1, 0, 0, 0); // 0: Read (RAMPZ:Z) ESIL_A ("r%d,0xff,^,&,", d); // 0: (Z) & ~Rd ESIL_A ("DUP,r%d,=,", d); // Rd = [0] __generic_ld_st (op, "ram", 'z', 1, 0, 0, 1); // Store in RAM } ...
0
82,727
Analyze the following 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 proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb, struct usbdevfs_iso_packet_desc __user *iso_frame_desc, void __user *arg) { struct usbdevfs_iso_packet_desc *isopkt = NULL; struct usb_host_endpoint *ep; struct async *as = NULL; struct usb_ctrlrequest *dr = NULL; unsigne...
0
53,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: bool XmlConfigParser::IsParsingData() const { const std::string data_path[] = {"response", "app", "data"}; return elements_.size() == arraysize(data_path) && std::equal(elements_.begin(), elements_.end(), data_path); } Commit Message: Use install_static::GetAppGuid instead of the hardcoded string in...
0
132,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: d2flac8_array (const double *src, int32_t *dest, int count, int normalize) { double normfact = normalize ? (1.0 * 0x7F) : 1.0 ; while (--count >= 0) dest [count] = lrint (src [count] * normfact) ; } /* d2flac8_array */ Commit Message: src/flac.c: Improve error handling Especially when dealing with corrupt o...
0
67,098
Analyze the following 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 DevToolsDataSource::ShouldAddContentSecurityPolicy() const { return false; } Commit Message: DevTools: move front-end URL handling to DevToolsUIBindingds BUG=662859 Review-Url: https://codereview.chromium.org/2607833002 Cr-Commit-Position: refs/heads/master@{#440926} CWE ID: CWE-200
0
138,455
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: VncInfo *qmp_query_vnc(Error **errp) { VncInfo *info = g_malloc0(sizeof(*info)); if (vnc_display == NULL || vnc_display->display == NULL) { info->enabled = false; } else { VncClientInfoList *cur_item = NULL; struct sockaddr_storage sa; socklen_t salen = sizeof(sa); ...
0
17,919
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int WebContext::devtoolsPort() const { if (IsInitialized()) { return DevToolsManager::Get(context_.get())->port(); } return construct_props_->devtools_port; } Commit Message: CWE ID: CWE-20
0
16,985
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void BrowserInit::LaunchWithProfile::CheckDefaultBrowser(Profile* profile) { if (!profile->GetPrefs()->GetBoolean(prefs::kCheckDefaultBrowser) || is_first_run_) { return; } if (g_browser_process->local_state()->IsManagedPreference( prefs::kDefaultBrowserSettingEnabled)) { if (g_browser_p...
0
109,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: void PrintPreviewHandler::HandlePrintToPdf( const base::DictionaryValue& settings) { PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>( web_ui()->GetController()); if (print_to_pdf_path_.get()) { scoped_refptr<base::RefCountedBytes> data; print_preview_ui->GetPrintPreviewDataFo...
0
105,808
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: linux_lvm2_lv_stop_completed_cb (DBusGMethodInvocation *context, Device *device, gboolean job_was_cancelled, int status, const char *stderr, const ch...
0
11,737
Analyze the following 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 ResourceDispatcherHostImpl::HandleExternalProtocol(ResourceLoader* loader, const GURL& url) { if (!delegate_) return false; ResourceRequestInfoImpl* info = loader->GetRequestInfo(); if (!IsResourceTypeFrame(info->GetResourceType())) retu...
0
132,819
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ofputil_protocol_to_base(enum ofputil_protocol protocol) { return ofputil_protocol_set_tid(protocol, false); } Commit Message: ofp-group: Don't assert-fail decoding bad OF1.5 group mod type or command. When decoding a group mod, the current code validates the group type and command after the whole group mod...
0
77,662
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: JsVarFloat stringToFloatWithRadix( const char *s, //!< The string to be converted to a float int forceRadix, //!< The radix of the string data, or 0 to guess const char **endOfFloat //!< If nonzero, this is set to the point at which the float finished in the string ) { while (isWhitespace(*s)) s++;...
0
82,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: void RenderBox::repaintDuringLayoutIfMoved(const LayoutRect& oldRect) { if (oldRect.location() != m_frameRect.location()) { LayoutRect newRect = m_frameRect; m_frameRect = oldRect; repaint(); repaintOverhangingFloats(true); m_frameRect = newRect; repaint(); ...
0
116,589
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: BlackBerry::Platform::String WebPage::title() const { if (d->m_mainFrame->document()) return d->m_mainFrame->loader()->documentLoader()->title().string(); return BlackBerry::Platform::String::emptyString(); } Commit Message: [BlackBerry] Adapt to new BlackBerry::Platform::TouchPoint API https://b...
0
104,451
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: mm_auth2_read_banner(void) { Buffer m; char *banner; debug3("%s entering", __func__); buffer_init(&m); mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTH2_READ_BANNER, &m); buffer_clear(&m); mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_AUTH2_READ_BANNER, &m); banner = buffer_get_str...
0
42,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 ResourceFetcher::ClearPreloads(ClearPreloadsPolicy policy) { LogPreloadStats(policy); Vector<PreloadKey> keys_to_be_removed; for (const auto& pair : preloads_) { Resource* resource = pair.value; if (policy == kClearAllPreloads || !resource->IsLinkPreload()) { GetMemoryCache()->Remove(res...
0
138,870
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: upnpevents_addSubscriber(const char * eventurl, const char * callback, int callbacklen, int timeout) { struct subscriber * tmp; /*static char uuid[42];*/ /* "uuid:00000000-0000-0000-0000-000000000000"; 5+36+1=42bytes */ syslog(LOG_DEBUG, "addSubscriber(%s, %.*...
0
89,888
Analyze the following 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 set_msr_mce(struct kvm_vcpu *vcpu, u32 msr, u64 data) { u64 mcg_cap = vcpu->arch.mcg_cap; unsigned bank_num = mcg_cap & 0xff; switch (msr) { case MSR_IA32_MCG_STATUS: vcpu->arch.mcg_status = data; break; case MSR_IA32_MCG_CTL: if (!(mcg_cap & MCG_CTL_P)) return 1; if (data != 0 && data...
0
37,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: static void gs_usb_disconnect(struct usb_interface *intf) { unsigned i; struct gs_usb *dev = usb_get_intfdata(intf); usb_set_intfdata(intf, NULL); if (!dev) { dev_err(&intf->dev, "Disconnect (nodata)\n"); return; } for (i = 0; i < GS_MAX_INTF; i++) if (dev->canch[i]) gs_destroy_candev(dev->canch[...
0
66,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: setMemoryAllocationChangedCallbackCHROMIUM( WebGraphicsMemoryAllocationChangedCallbackCHROMIUM* callback) { memory_allocation_changed_callback_ = callback; } Commit Message: Convert plugin and GPU process to brokered handle duplication. BUG=119250 Review URL: https://chromiumcodereview.appspot.com...
0
106,841
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void __exit au1100fb_unload(void) { platform_driver_unregister(&au1100fb_driver); } Commit Message: Fix a few incorrectly checked [io_]remap_pfn_range() calls Nico Golde reports a few straggling uses of [io_]remap_pfn_range() that really should use the vm_iomap_memory() helper. This trivially converts ...
0
28,335
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: size_t GraphicBuffer::getFlattenedSize() const { return (10 + (handle ? handle->numInts : 0))*sizeof(int); } Commit Message: Fix for corruption when numFds or numInts is too large. Bug: 18076253 Change-Id: I4c5935440013fc755e1d123049290383f4659fb6 (cherry picked from commit dfd06b89a4b77fc75eb85a3c1c700da3621c...
0
157,678
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: t2p_sample_rgbaa_to_rgb(tdata_t data, uint32 samplecount) { uint32 i; /* For the 3 first samples, there is overlapping between souce and destination, so use memmove(). See http://bugzilla.maptools.org/show_bug.cgi?id=2577 */ for(i = 0; i < 3 && i < samplecount; i++) memmove((uint8...
0
71,382
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void cmd_xconvmultisort(char *tag) { int c; struct sortcrit *sortcrit = NULL; struct searchargs *searchargs = NULL; struct windowargs *windowargs = NULL; struct conversations_state *cstate = NULL; clock_t start = clock(); char mytime[100]; int r; if (backend_current) { ...
0
95,183
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: rad_strerror(struct rad_handle *h) { return h->errmsg; } Commit Message: Fix a security issue in radius_get_vendor_attr(). The underlying rad_get_vendor_attr() function assumed that it would always be given valid VSA data. Indeed, the buffer length wasn't even passed in; the assumption was that the length fiel...
0
31,552
Analyze the following 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 unloadModule(PlatformModule module) { return ::FreeLibrary(module); } Commit Message: [WIN] Implement WebCore::fileSystemRepresentation() for !USE(CF) https://bugs.webkit.org/show_bug.cgi?id=104456 Reviewed by Brent Fulgham. Convert the UTF-16 path to the system default Windows ANSI code page (usually...
0
103,900
Analyze the following 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 getFrameSize(bool isWide, unsigned FT) { static const size_t kFrameSizeNB[16] = { 95, 103, 118, 134, 148, 159, 204, 244, 39, 43, 38, 37, // SID 0, 0, 0, // future use 0 // no data }; static const size_t kFrameSizeWB[16] = { 132, 177, 253, 285, 317, 365, 397, 461, 477, 40, // SID 0, 0, 0, 0...
0
162,404
Analyze the following 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::InputState::MotionMemento::setPointers(const MotionEntry* entry) { pointerCount = entry->pointerCount; for (uint32_t i = 0; i < entry->pointerCount; i++) { pointerProperties[i].copyFrom(entry->pointerProperties[i]); pointerCoords[i].copyFrom(entry->pointerCoords[i]); } ...
0
163,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: void V8TestObject::UnrestrictedDoubleAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_unrestrictedDoubleAttribute_Getter"); test_object_v8_internal::UnrestrictedDoubleAttributeAttributeGetter(...
0
135,275
Analyze the following 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 aes_t4_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, const unsigned char *iv, int enc) { int ret, mode, bits; EVP_AES_KEY *dat = EVP_C_DATA(EVP_AES_KEY,ctx); mode = EVP_CIPHER_CTX_mode(ctx); bits = EVP_CIPHER_CTX_key_length(ctx) * 8; if ((mode =...
0
69,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: static int proc_task_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) { struct inode *inode = dentry->d_inode; struct task_struct *p = get_proc_task(inode); generic_fillattr(inode, stat); if (p) { stat->nlink += get_nr_threads(p); put_task_struct(p); } return 0; } Commit Messa...
0
26,894
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: TIFFReadBufferSetup(TIFF* tif, void* bp, tmsize_t size) { static const char module[] = "TIFFReadBufferSetup"; assert((tif->tif_flags&TIFF_NOREADRAW)==0); tif->tif_flags &= ~TIFF_BUFFERMMAP; if (tif->tif_rawdata) { if (tif->tif_flags & TIFF_MYBUFFER) _TIFFfree(tif->tif_rawdata); tif->tif_rawdata = NUL...
0
70,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: base::string16 AuthenticatorClientPinEntrySheetModel::GetStepDescription() const { return l10n_util::GetStringUTF16( mode_ == AuthenticatorClientPinEntrySheetModel::Mode::kPinEntry ? IDS_WEBAUTHN_PIN_ENTRY_DESCRIPTION : IDS_WEBAUTHN_PIN_SETUP_DESCRIPTION); } Commit Message: chrome...
0
142,887
Analyze the following 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 AecCreate(preproc_effect_t *effect) { webrtc::EchoControlMobile *aec = effect->session->apm->echo_control_mobile(); ALOGV("AecCreate got aec %p", aec); if (aec == NULL) { ALOGW("AgcCreate Error"); return -ENOMEM; } effect->engine = static_cast<preproc_fx_handle_t>(aec); AecInit (effect...
0
157,456
Analyze the following 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 map_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos, int cap_setid, struct uid_gid_map *map, struct uid_gid_map *parent_map) { struct seq_file *seq = file->private_data; struct user_namespace *ns = seq->private; struct uid_gid_map new_map; unsigned id...
1
168,998
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: error::Error GLES2DecoderImpl::HandleVertexAttribIPointer( uint32_t immediate_data_size, const volatile void* cmd_data) { if (!feature_info_->IsWebGL2OrES3Context()) return error::kUnknownCommand; const volatile gles2::cmds::VertexAttribIPointer& c = *static_cast<const volatile gles2::cmds::...
0
145,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: static int emulator_do_task_switch(struct x86_emulate_ctxt *ctxt, u16 tss_selector, int idt_index, int reason, bool has_error_code, u32 error_code) { const struct x86_emulate_ops *ops = ctxt->ops; struct desc_struct curr_tss_desc, next_tss_desc; int ret; u16 old_tss_sel = get_segment_selector(ct...
0
47,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: static unsigned int file_hashval(struct knfsd_fh *fh) { return nfsd_fh_hashval(fh) & (FILE_HASH_SIZE - 1); } Commit Message: Merge tag 'nfsd-4.12' of git://linux-nfs.org/~bfields/linux Pull nfsd updates from Bruce Fields: "Another RDMA update from Chuck Lever, and a bunch of miscellaneous bugfixes" * tag '...
0
65,440
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool IsControlChar(const base::string16& text) { const std::string str = base::UTF16ToUTF8(text); if (str.length() != 1) return false; for (const auto& t : kControlCharToKeyEvent) { if (str[0] == std::get<0>(t)) return true; } return false; } Commit Message: Clear |composing_text_| after ...
0
156,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: error::Error GLES2DecoderPassthroughImpl::DoVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z) { api()->glVertexAttrib3fFn(in...
0
142,182
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: DecodeNumber(int flen, char *str, int fmask, int *tmask, struct tm * tm, fsec_t *fsec, int *is2digits, bool EuroDates) { int val; char *cp; *tmask = 0; val = strtol(str, &cp, 10); if (cp == str) return -1; if (*cp == '.') { /* * More than two digits? Then could be a date or a run-together t...
0
40,049
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: htmlCtxtUseOptions(htmlParserCtxtPtr ctxt, int options) { if (ctxt == NULL) return(-1); if (options & HTML_PARSE_NOWARNING) { ctxt->sax->warning = NULL; ctxt->vctxt.warning = NULL; options -= XML_PARSE_NOWARNING; ctxt->options |= XML_PARSE_NOWARNING; } if (options...
0
150,777
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: DGAProcessKeyboardEvent(ScreenPtr pScreen, DGAEvent * event, DeviceIntPtr keybd) { KeyClassPtr keyc = keybd->key; DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen); DeviceIntPtr pointer = GetMaster(keybd, POINTER_OR_FLOAT); DeviceEvent ev = { .header = ET_Internal, .length = ...
0
17,715
Analyze the following 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 PermissionPromptImpl::CanAcceptRequestUpdate() { return !(bubble_delegate_ && bubble_delegate_->IsMouseHovered()); } Commit Message: Elide the permission bubble title from the head of the string. Long URLs can be used to spoof other origins in the permission bubble title. This CL customises the title to ...
0
146,950
Analyze the following 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 _dns_result_aaaa(struct dns_ctx *ctx, struct dns_rr_a6 *result, void *data) { dnsquery_t query = data; char ip[INET6_ADDRSTRLEN]; int i; assert(query != NULL); query->query = NULL; if (ctx != NULL && result == NULL) { log_debug(ZONE, "dns failure for %s@%p: AAAA %s (%d...
0
19,181
Analyze the following 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 boolean ReadIPTCProfile(j_decompress_ptr jpeg_info) { char magick[MaxTextExtent]; ErrorManager *error_manager; Image *image; MagickBooleanType status; register ssize_t i; register unsigned char *p; size_t length; StringInfo *iptc_profile, *profile;...
0
63,373
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xfs_attr3_leaf_firstused_to_disk( struct xfs_da_geometry *geo, struct xfs_attr_leafblock *to, struct xfs_attr3_icleaf_hdr *from) { struct xfs_attr3_leaf_hdr *hdr3; uint32_t firstused; /* magic value should only be seen on disk */ ASSERT(from->firstused != XFS_ATTR3_LEAF_NULLOFF); /* * Scale down th...
0
79,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 void qeth_print_status_no_portname(struct qeth_card *card) { if (card->info.portname[0]) dev_info(&card->gdev->dev, "Device is a%s " "card%s%s%s\nwith link type %s " "(no portname needed by interface).\n", qeth_get_cardname(card), (card->info.mcl_level[0]) ? " (level:...
0
28,601
Analyze the following 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 nfs4_locku_done(struct rpc_task *task, void *data) { struct nfs4_unlockdata *calldata = data; if (!nfs4_sequence_done(task, &calldata->res.seq_res)) return; switch (task->tk_status) { case 0: memcpy(calldata->lsp->ls_stateid.data, calldata->res.stateid.data, sizeof(calldata->lsp->...
0
23,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: void ImageLoader::notifyFinished(CachedResource* resource) { ASSERT(m_failedLoadURL.isEmpty()); ASSERT(resource == m_image.get()); m_imageComplete = true; if (!hasPendingBeforeLoadEvent()) updateRenderer(); if (!m_hasPendingLoadEvent) return; if (m_element->fastHasAttrib...
0
113,486
Analyze the following 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 ExtensionGlobalError::GenerateMessageSection( const ExtensionIdSet* extensions, int template_message_id) { CHECK(extensions); CHECK(template_message_id); string16 message; for (ExtensionIdSet::const_iterator iter = extensions->begin(); iter != extensions->end(); ++iter) { c...
1
170,980
Analyze the following 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::GetQuotaSettings( content::BrowserContext* context, content::StoragePartition* partition, storage::OptionalQuotaSettingsCallback callback) { if (g_default_quota_settings) { std::move(callback).Run(*g_default_quota_settings); return; } storage::GetNominalD...
0
152,378
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: explicit CancelTestJob(URLRequest* request, NetworkDelegate* network_delegate) : URLRequestTestJob(request, network_delegate, true) {} Commit Message: Tests were marked as Flaky. BUG=151811,151810 TBR=droger@chromium.org,shalev@chromium.org NOTRY=true Review URL: https://chromiumcodereview.appspot.com/10...
0
102,244
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bits_image_fetch_untransformed_repeat_none (bits_image_t *image, pixman_bool_t wide, int x, int y, int width...
0
15,435
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void t1_puts(PDF pdf, const char *s) { if (s != t1_line_array) strcpy(t1_line_array, s); t1_line_ptr = strend(t1_line_array); t1_putline(pdf); } Commit Message: writet1 protection against buffer overflow git-svn-id: svn://tug.org/texlive/trunk/Build/source@48697 c570f23f-e606-0410-a88...
0
76,702
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: UtilityServiceFactory::~UtilityServiceFactory() {} Commit Message: media: Support hosting mojo CDM in a standalone service Currently when mojo CDM is enabled it is hosted in the MediaService running in the process specified by "mojo_media_host". However, on some platforms we need to run mojo CDM and other mojo ...
0
127,496
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PrintJobWorker::~PrintJobWorker() { DCHECK(owner_->RunsTasksInCurrentSequence()); Stop(); } Commit Message: If JavaScript shows a dialog, cause the page to lose fullscreen. BUG=670135, 550017, 726761, 728276 Review-Url: https://codereview.chromium.org/2906133004 Cr-Commit-Position: refs/heads/master@{#4788...
0
135,606
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SkBitmap Extension::GetCachedImage(const ExtensionResource& source, const gfx::Size& max_size) const { DCHECK(source.extension_root() == path()); // The resource must come from SkBitmap* image = GetCachedImageImpl(source, max_size); return image ? *image : SkBitmap(); } ...
0
99,727
Analyze the following 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 PDFiumEngine::MouseDownState::Reset() { area_ = PDFiumPage::NONSELECTABLE_AREA; target_ = PDFiumPage::LinkTarget(); } Commit Message: [pdf] Defer page unloading in JS callback. One of the callbacks from PDFium JavaScript into the embedder is to get the current page number. In Chromium, this will trigge...
0
140,409
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ui::AXMode ChromeContentBrowserClient::GetAXModeForBrowserContext( content::BrowserContext* browser_context) { Profile* profile = Profile::FromBrowserContext(browser_context); return AccessibilityLabelsServiceFactory::GetForProfile(profile)->GetAXMode(); } Commit Message: Move IsDataSaverEnabledByUser to...
0
142,631
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static inline int is_packetized(struct file *file) { return (file->f_flags & O_DIRECT) != 0; } Commit Message: pipe: limit the per-user amount of pages allocated in pipes On no-so-small systems, it is possible for a single process to cause an OOM condition by filling large pipes with data that are never read. ...
0
54,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: GLint GLES2Implementation::GetFragDataLocationHelper(GLuint program, const char* name) { typedef cmds::GetFragDataLocation::Result Result; SetBucketAsCString(kResultBucketId, name); auto result = GetResultAs<Result>(); if (!result) { return -1; } ...
0
140,990
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MagickPrivate Cache ReferencePixelCache(Cache cache) { CacheInfo *magick_restrict cache_info; assert(cache != (Cache *) NULL); cache_info=(CacheInfo *) cache; assert(cache_info->signature == MagickCoreSignature); LockSemaphoreInfo(cache_info->semaphore); cache_info->reference_count++; UnlockSem...
0
94,808
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Direct_Move_Orig_Y( EXEC_OP_ TT_GlyphZone zone, FT_UShort point, FT_F26Dot6 distance ) { FT_UNUSED_EXEC; zone->org[point].y += distance; } Commit Message: CWE ID: CWE-119
0
10,078
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void RenderProcessHostImpl::SendAecDumpFileToRenderer( int id, IPC::PlatformFileForTransit file_for_transit) { if (file_for_transit == IPC::InvalidPlatformFileForTransit()) return; Send(new AecDumpMsg_EnableAecDump(id, file_for_transit)); } Commit Message: Switching AudioOutputAuthorizationHandle...
0
128,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: void FrameView::maintainScrollPositionAtAnchor(Node* anchorNode) { m_maintainScrollPositionAnchor = anchorNode; if (!m_maintainScrollPositionAnchor) return; m_frame->document()->updateRenderTreeIfNeeded(); RenderView* renderView = this->renderView(); if (renderView && renderView->need...
0
119,870
Analyze the following 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 Extension::HasCachedImage(const ExtensionResource& source, const gfx::Size& max_size) const { DCHECK(source.extension_root() == path()); // The resource must come from return GetCachedImageImpl(source, max_size) != NULL; } Commit Message: Extend TTS extension API to suppo...
0
99,747
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: png_check_chunk_length(png_const_structrp png_ptr, const png_uint_32 length) { png_alloc_size_t limit = PNG_UINT_31_MAX; # ifdef PNG_SET_USER_LIMITS_SUPPORTED if (png_ptr->user_chunk_malloc_max > 0 && png_ptr->user_chunk_malloc_max < limit) limit = png_ptr->user_chunk_malloc_max; # elif PNG_US...
1
169,151
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void V8TestObject::VoidMethodStringFrozenArrayMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodStringFrozenArrayMethod"); test_object_v8_internal::VoidMethodStringFrozenArrayMethodMethod(info); ...
0
135,482
Analyze the following 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 TestURLLoader::Init() { if (!CheckTestingInterface()) { instance_->AppendError("Testing interface not available"); return false; } const PPB_FileIO* file_io_interface = static_cast<const PPB_FileIO*>( pp::Module::Get()->GetBrowserInterface(PPB_FILEIO_INTERFACE)); if (!file_io_interface...
0
156,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 Element::setPseudo(const AtomicString& value) { setAttribute(pseudoAttr, value); } Commit Message: Set Attr.ownerDocument in Element#setAttributeNode() Attr objects can move across documents by setAttributeNode(). So It needs to reset ownerDocument through TreeScopeAdoptr::adoptIfNeeded(). BUG=248950 ...
0
112,392
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: t1operator_seac( T1_Decoder decoder, FT_Pos asb, FT_Pos adx, FT_Pos ady, FT_Int bchar, FT_Int achar ) { FT_Error error; FT_Int bchar_index, achar_index; #if 0 FT_Int ...
0
7,470
Analyze the following 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(SplObjectStorage, offsetGet) { zval *obj; spl_SplObjectStorageElement *element; spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(getThis()); zend_string *hash; if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &obj) == FAILURE) { return; } hash = spl_object_storage_get_hash(intern, getThis(), ...
0
73,670
Analyze the following 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 BnDrm::onTransact( uint32_t code, const Parcel &data, Parcel *reply, uint32_t flags) { switch (code) { case INIT_CHECK: { CHECK_INTERFACE(IDrm, data, reply); reply->writeInt32(initCheck()); return OK; } case IS_CRYPTO_SUPPORTED: { CHECK_INTERFACE(IDrm, data, r...
1
173,891
Analyze the following 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_r_log(kdc_request_t r, int level, const char *fmt, ...) { va_list ap; char *s; va_start(ap, fmt); s = kdc_log_msg_va(r->context, r->config, level, fmt, ap); if(s) free(s); va_end(ap); } Commit Message: Security: Avoid NULL structure pointer member dereference This can happen in the ...
0
59,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 jswrap_graphics_drawImage(JsVar *parent, JsVar *image, int xPos, int yPos) { JsGraphics gfx; if (!graphicsGetFromVar(&gfx, parent)) return; if (!jsvIsObject(image)) { jsExceptionHere(JSET_ERROR, "Expecting first argument to be an object"); return; } int imageWidth = (int)jsvGetIntegerAndUnLoc...
0
82,565
Analyze the following 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 *__packet_lookup_frame_in_block(struct packet_sock *po, struct sk_buff *skb, int status, unsigned int len ) { struct tpacket_kbdq_core *pkc; struct tpacket_block_desc *pbd; char *curr, *end; pkc = GET_PBDQC_FROM_RB(&po->rx_ring); pbd = GET_CURR_PBLOCK_DESC_FROM_C...
0
60,410
Analyze the following 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 skb_append(struct sk_buff *old, struct sk_buff *newsk, struct sk_buff_head *list) { unsigned long flags; spin_lock_irqsave(&list->lock, flags); __skb_queue_after(list, old, newsk); spin_unlock_irqrestore(&list->lock, flags); } Commit Message: skbuff: skb_segment: orphan frags before copying skb_segmen...
0
39,873
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Strfgets(FILE * f) { Str s = Strnew(); int c; while ((c = fgetc(f)) != EOF) { Strcat_char(s, c); if (c == '\n') break; } return s; } Commit Message: Merge pull request #27 from kcwu/fix-strgrow Fix potential heap buffer corruption due to Strgrow CWE ID: CWE-119
0
48,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: static int dnxhd_decode_dct_block_12_444(const DNXHDContext *ctx, RowContext *row, int n) { return dnxhd_decode_dct_block(ctx, row, n, 6, 32, 4, 2); } Commit Message: avcodec/dnxhddec: Move mb height check out of non hr branch Fixes: out of array access Fixes: poc.dn...
0
63,183
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int br_mdb_add(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) { struct net *net = sock_net(skb->sk); struct br_mdb_entry *entry; struct net_device *dev; struct net_bridge *br; int err; err = br_mdb_parse(skb, nlh, &dev, &entry); if (err < 0) return err; br = netdev_priv(dev); err = __b...
0
30,995
Analyze the following 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 OxideQQuickWebView::incognito() const { Q_D(const OxideQQuickWebView); if (!d->proxy_) { return d->construct_props_->incognito; } return d->proxy_->incognito(); } Commit Message: CWE ID: CWE-20
0
17,114
Analyze the following 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 btif_hl_select_wakeup_callback( fd_set *p_org_set , int wakeup_signal){ BTIF_TRACE_DEBUG("entering %s wakeup_signal=0x%04x",__FUNCTION__, wakeup_signal); if (wakeup_signal == btif_hl_signal_select_wakeup ) { btif_hl_add_socket_to_set(p_org_set); } else if (wakeup_signal == btif_hl_signal_sel...
0
158,745