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: String DOMWindow::SanitizedCrossDomainAccessErrorMessage( const LocalDOMWindow* calling_window) const { if (!calling_window || !calling_window->document() || !GetFrame()) return String(); const KURL& calling_window_url = calling_window->document()->Url(); if (calling_window_url.IsNull()) return...
0
148,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: void Document::didAssociateFormControlsTimerFired(Timer<Document>* timer) { ASSERT_UNUSED(timer, timer == &m_didAssociateFormControlsTimer); if (!frame() || !frame()->page()) return; WillBeHeapVector<RefPtrWillBeMember<Element>> associatedFormControls; copyToVector(m_associatedFormControl...
0
127,512
Analyze the following 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 DecodePSDPixels(const size_t number_compact_pixels, const unsigned char *compact_pixels,const ssize_t depth, const size_t number_pixels,unsigned char *pixels) { int pixel; register ssize_t i, j; size_t length; ssize_t packets; packets=(ssize_t) number_compact_p...
0
71,646
Analyze the following 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 WebLocalFrameImpl::ExecuteScriptInIsolatedWorld( int world_id, const WebScriptSource* sources_in, unsigned num_sources, WebVector<v8::Local<v8::Value>>* results) { DCHECK(GetFrame()); CHECK_GT(world_id, 0); CHECK_LT(world_id, DOMWrapperWorld::kEmbedderWorldIdLimit); HeapVector<Script...
0
134,297
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: struct mount *__lookup_mnt_last(struct vfsmount *mnt, struct dentry *dentry) { struct mount *p, *res = NULL; p = __lookup_mnt(mnt, dentry); if (!p) goto out; if (!(p->mnt.mnt_flags & MNT_UMOUNT)) res = p; hlist_for_each_entry_continue(p, mnt_hash) { if (&p->mnt_parent->mnt != mnt || p->mnt_mountpoint !...
0
50,925
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void LayerTreeHost::SetNeedsDisplayOnAllLayers() { for (auto* layer : *this) layer->SetNeedsDisplay(); } 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 tha...
0
137,171
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MagickExport MagickBooleanType ListThresholdMaps(FILE *file, ExceptionInfo *exception) { const StringInfo *option; LinkedListInfo *options; MagickStatusType status; status=MagickTrue; if (file == (FILE *) NULL) file=stdout; options=GetConfigureOptions(ThresholdsFilename,exception)...
0
89,022
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: parse_snapshot(const char *str) { txid xmin; txid xmax; txid last_val = 0, val; const char *str_start = str; const char *endp; StringInfo buf; xmin = str2txid(str, &endp); if (*endp != ':') goto bad_format; str = endp + 1; xmax = str2txid(str, &endp); if (*endp != ':') goto bad_format; st...
0
39,054
Analyze the following 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 ComponentUpdaterPolicyTest::SetUpCommandLine( base::CommandLine* command_line) { ASSERT_TRUE(https_server_.InitializeAndListen()); const std::string val = base::StringPrintf( "url-source=%s", https_server_.GetURL("/service/update2").spec().c_str()); command_line->AppendSwitchASCII(switches::k...
0
157,096
Analyze the following 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 RecordParallelizableContentLength(int64_t content_length) { UMA_HISTOGRAM_CUSTOM_COUNTS("Download.ContentLength.Parallelizable", content_length / 1024, 1, kMaxFileSizeKb, 50); } Commit Message: Add .desktop file to download_file_types.asciipb .desktop files act as shortcuts ...
0
153,420
Analyze the following 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 char *sockfs_dname(struct dentry *dentry, char *buffer, int buflen) { return dynamic_dname(dentry, buffer, buflen, "socket:[%lu]", dentry->d_inode->i_ino); } Commit Message: Fix order of arguments to compat_put_time[spec|val] Commit 644595f89620 ("compat: Handle COMPAT_USE_64BIT_TIME in net/socket.c...
0
18,709
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xmlParseExtParsedEnt(xmlParserCtxtPtr ctxt) { xmlChar start[4]; xmlCharEncoding enc; if ((ctxt == NULL) || (ctxt->input == NULL)) return(-1); xmlDefaultSAXHandlerInit(); xmlDetectSAX2(ctxt); GROW; /* * SAX: beginning of the document processing. */ if ((ctxt->...
1
171,291
Analyze the following 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 ChromeDownloadManagerDelegate::SubstituteGDataDownloadPathCallback( int32 download_id, bool should_prompt, bool is_forced_path, content::DownloadDangerType danger_type, const FilePath& suggested_path) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DownloadItem* download = ...
0
106,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: psf_decode_frame_count (SF_PRIVATE *psf) { sf_count_t count, readlen, total = 0 ; BUF_UNION ubuf ; /* If we're reading from a pipe or the file is too long, just return SF_COUNT_MAX. */ if (psf_is_pipe (psf) || psf->datalength > 0x1000000) return SF_COUNT_MAX ; psf_fseek (psf, psf->dataoffset, SEEK_SET) ; ...
0
95,328
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void HTMLInputElement::blur() { m_inputType->blur(); } Commit Message: Setting input.x-webkit-speech should not cause focus change In r150866, we introduced element()->focus() in destroyShadowSubtree() to retain focus on <input> when its type attribute gets changed. But when x-webkit-speech attribute is cha...
0
112,866
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: do_device_not_available(struct pt_regs *regs, long error_code) { unsigned long cr0; RCU_LOCKDEP_WARN(!rcu_is_watching(), "entry code didn't wake RCU"); #ifdef CONFIG_MATH_EMULATION if (!boot_cpu_has(X86_FEATURE_FPU) && (read_cr0() & X86_CR0_EM)) { struct math_emu_info info = { }; cond_local_irq_enable(r...
0
83,488
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: mojom::StoragePartitionService* RenderThreadImpl::GetStoragePartitionService() { return storage_partition_service_.get(); } Commit Message: Roll src/third_party/boringssl/src 664e99a64..696c13bd6 https://boringssl.googlesource.com/boringssl/+log/664e99a6486c293728097c661332f92bf2d847c6..696c13bd6ab78011adfe7b...
0
150,528
Analyze the following 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 RList *maps(RBinFile *bf) { if (bf && bf->o) { return Elf_(r_bin_elf_get_maps)(bf->o->bin_obj); } return NULL; } Commit Message: Fix #9904 - crash in r2_hoobr_r_read_le32 (over 9000 entrypoints) and read_le oobread (#9923) CWE ID: CWE-125
0
82,936
Analyze the following 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 u64 cfs_rq_last_update_time(struct cfs_rq *cfs_rq) { u64 last_update_time_copy; u64 last_update_time; do { last_update_time_copy = cfs_rq->load_last_update_time_copy; smp_rmb(); last_update_time = cfs_rq->avg.last_update_time; } while (last_update_time != last_update_time_copy); return ...
0
92,487
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void Uint8ArrayAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) { v8::Local<v8::Object> holder = info.Holder(); TestObject* impl = V8TestObject::ToImpl(holder); V8SetReturnValueFast(info, impl->uint8ArrayAttribute(), impl); } Commit Message: bindings: Support "attribute Fr...
0
135,262
Analyze the following 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 WebGraphicsContext3DCommandBufferImpl::OnContextLost( ContentGLContext::ContextLostReason reason) { context_lost_reason_ = convertReason(reason); if (context_lost_callback_) { context_lost_callback_->onContextLost(); } if (attributes_.shareResources) ClearSharedContexts(); if (ShouldUse...
0
109,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: void TopSitesCacheTest::InitTopSiteCache(const char** spec, size_t size) { BuildTopSites(spec, size); cache_.SetTopSites(top_sites_); } Commit Message: TopSites: Clear thumbnails from the cache when their URLs get removed We already cleared the thumbnails from persistent storage, but they remained in the in...
0
147,050
Analyze the following 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 GtkScrollablePolicy getVerticalScrollPolicy(WebKitWebView* webView) { return webView->priv->verticalScrollingPolicy; } Commit Message: 2011-06-02 Joone Hur <joone.hur@collabora.co.uk> Reviewed by Martin Robinson. [GTK] Only load dictionaries if spell check is enabled https:...
0
100,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: static void coroutine_fn v9fs_lock(void *opaque) { int8_t status; V9fsFlock flock; size_t offset = 7; struct stat stbuf; V9fsFidState *fidp; int32_t fid, err = 0; V9fsPDU *pdu = opaque; status = P9_LOCK_ERROR; v9fs_string_init(&flock.client_id); err = pdu_unmarshal(pdu, of...
0
7,724
Analyze the following 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 AddAboutStrings(content::WebUIDataSource* html_source) { LocalizedString localized_strings[] = { {"aboutProductLogoAlt", IDS_SHORT_PRODUCT_LOGO_ALT_TEXT}, {"aboutPageTitle", IDS_SETTINGS_ABOUT_PROGRAM}, #if defined(OS_CHROMEOS) {"aboutProductTitle", IDS_PRODUCT_OS_NAME}, #else {"aboutProduc...
0
148,750
Analyze the following 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 ContainOnlyOneKeyboardLayout( const ImeConfigValue& value) { return (value.type == ImeConfigValue::kValueTypeStringList && value.string_list_value.size() == 1 && chromeos::input_method::IsKeyboardLayout( value.string_list_value[0])); } Commit Message...
1
170,483
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int macvlan_ethtool_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) { const struct macvlan_dev *vlan = netdev_priv(dev); return dev_ethtool_get_settings(vlan->lowerdev, cmd); } Commit Message: net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared After the last patc...
0
23,805
Analyze the following 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 treatReturnedNullStringAsNullStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); v8SetReturnValueStringOrNull(info, imp->treatReturnedNullStringAsNullStringMethod(), info.GetIsolate()); } Commit Message: do...
0
122,732
Analyze the following 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 snd_timer_open(struct snd_timer_instance **ti, char *owner, struct snd_timer_id *tid, unsigned int slave_id) { struct snd_timer *timer; struct snd_timer_instance *timeri = NULL; if (tid->dev_class == SNDRV_TIMER_CLASS_SLAVE) { /* open a slave instance */ if (tid->dev_sclass <= SNDRV_TIMER_SC...
0
58,849
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: QWebViewportInfo* QQuickWebViewExperimental::viewportInfo() { return m_viewportInfo; } Commit Message: [Qt][WK2] Allow transparent WebViews https://bugs.webkit.org/show_bug.cgi?id=80608 Reviewed by Tor Arne Vestbø. Added support for transparentBackground in QQuickWebViewExperimental. This uses the existing...
0
101,798
Analyze the following 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 dm_lock_for_deletion(struct mapped_device *md, bool mark_deferred, bool only_deferred) { int r = 0; spin_lock(&_minor_lock); if (dm_open_count(md)) { r = -EBUSY; if (mark_deferred) set_bit(DMF_DEFERRED_REMOVE, &md->flags); } else if (only_deferred && !test_bit(DMF_DEFERRED_REMOVE, &md->flags)) ...
0
85,913
Analyze the following 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 GLES2DecoderImpl::OnFboChanged() const { if (workarounds().restore_scissor_on_fbo_change) state_.fbo_binding_for_scissor_workaround_dirty_ = true; } Commit Message: Framebuffer clear() needs to consider the situation some draw buffers are disabled. This is when we expose DrawBuffers extension. BUG=3...
0
120,996
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: AXObjectCache* Document::axObjectCache() const { if (!AXObjectCache::accessibilityEnabled()) return 0; Document* topDocument = this->topDocument(); if (!topDocument->renderer()) return 0; ASSERT(topDocument == this || !m_axObjectCache); if (!topDocument->m_axObjectCache)...
0
105,446
Analyze the following 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 GLES2DecoderImpl::InvalidateFramebufferImpl( GLenum target, GLsizei count, const volatile GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height, const char* function_name, FramebufferOperation op) { Framebuffer* framebuffer = GetFramebufferInfoForTarget(ta...
0
141,617
Analyze the following 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 fanout_release(struct sock *sk) { struct packet_sock *po = pkt_sk(sk); struct packet_fanout *f; f = po->fanout; if (!f) return; mutex_lock(&fanout_mutex); po->fanout = NULL; if (atomic_dec_and_test(&f->sk_ref)) { list_del(&f->list); dev_remove_pack(&f->prot_hook); fanout_release_data...
0
49,168
Analyze the following 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 HasPrimarySurface() const { return GetDelegatedFrameHost()->HasPrimarySurface(); } Commit Message: Start rendering timer after first navigation Currently the new content rendering timer in the browser process, which clears an old page's contents 4 seconds after a navigation if the new page doesn't ...
0
145,603
Analyze the following 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 txq2vq(int txq) { return txq * 2 + 1; } Commit Message: virtio-net: drop NETIF_F_FRAGLIST virtio declares support for NETIF_F_FRAGLIST, but assumes that there are at most MAX_SKB_FRAGS + 2 fragments which isn't always true with a fraglist. A longer fraglist in the skb will make the call to skb_to_s...
0
42,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: static int TraceCubicBezier(FT_Vector *p,FT_Vector *q,FT_Vector *to, DrawInfo *draw_info) { AffineMatrix affine; char path[MagickPathExtent]; affine=draw_info->affine; (void) FormatLocaleString(path,MagickPathExtent,"C%g,%g %g,%g %g,%g", affine.tx+p->x/64.0,affine.ty-p->y/64.0,affine.tx+q-...
0
88,983
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: V8SchemaRegistry::V8SchemaRegistry() { } Commit Message: [Extensions] Finish freezing schema BUG=604901 BUG=603725 BUG=591164 Review URL: https://codereview.chromium.org/1906593002 Cr-Commit-Position: refs/heads/master@{#388945} CWE ID: CWE-200
0
132,705
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SVGDocumentExtensions::~SVGDocumentExtensions() { } Commit Message: SVG: Moving animating <svg> to other iframe should not crash. Moving SVGSVGElement with its SMILTimeContainer already started caused crash before this patch. |SVGDocumentExtentions::startAnimations()| calls begin() against all SMILTimeContainer...
0
120,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: MagickExport void DestroyImageProperties(Image *image) { assert(image != (Image *) NULL); assert(image->signature == MagickCoreSignature); if (image->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s", image->filename); if (image->properties != (void *) NULL) image...
0
94,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: base::ProcessHandle RenderProcessHostImpl::GetHandle() const { if (run_renderer_in_process()) return base::Process::Current().handle(); if (!child_process_launcher_.get() || child_process_launcher_->IsStarting()) return base::kNullProcessHandle; return child_process_launcher_->GetHandle(); } Comm...
0
116,717
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: const DOMWindow* DOMWindow::ToDOMWindow() const { return this; } 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: Nasko Oskov <nasko@ch...
0
148,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: static void promiseAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); TestObjectPythonV8Internal::promiseAttributeAttributeGetter(info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); } ...
0
122,529
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ext4_xattr_ibody_list(struct dentry *dentry, char *buffer, size_t buffer_size) { struct inode *inode = d_inode(dentry); struct ext4_xattr_ibody_header *header; struct ext4_inode *raw_inode; struct ext4_iloc iloc; void *end; int error; if (!ext4_test_inode_state(inode, EXT4_STATE_XATTR)) return 0; error...
0
95,007
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SAPI_API SAPI_POST_READER_FUNC(sapi_read_standard_form_data) { int read_bytes; int allocated_bytes=SAPI_POST_BLOCK_SIZE+1; if ((SG(post_max_size) > 0) && (SG(request_info).content_length > SG(post_max_size))) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "POST Content-Length of %ld bytes exceeds the limit o...
0
56,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: PanoramiXRenderReset(void) { int i; for (i = 0; i < RenderNumberRequests; i++) ProcRenderVector[i] = PanoramiXSaveRenderVector[i]; RenderErrBase = 0; } Commit Message: CWE ID: CWE-20
0
17,561
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: DefragSturgesNovakLinuxTest(void) { /* Expected data. */ u_char expected[] = { "AAAAAAAA" "AAAAAAAA" "AAAAAAAA" "JJJJJJJJ" "JJJJJJJJ" "BBBBBBBB" "KKKKKKKK" "KKKKKKKK" "KKKKKKKK" "LLLLLLLL" "LLLLLLLL" "LLLLLLLL"...
0
67,850
Analyze the following 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 ChromeDownloadManagerDelegate::OpenDownload(DownloadItem* download) { DCHECK_EQ(DownloadItem::COMPLETE, download->GetState()); DCHECK(!download->GetTargetFilePath().empty()); if (!download->CanOpenDownload()) return; MaybeSendDangerousDownloadOpenedReport(download, ...
0
146,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: int ssl3_get_next_proto(SSL *s) { int ok; int proto_len, padding_len; long n; const unsigned char *p; /* Clients cannot send a NextProtocol message if we didn't see the * extension in their ClientHello */ if (!s->s3->next_proto_neg_seen) { SSLerr(SSL_F_SSL3_GET_NEXT_PROTO,SSL_R_GOT_NEXT_PROTO_WITHOU...
0
45,179
Analyze the following 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 mcryptd_hash_setkey(struct crypto_ahash *parent, const u8 *key, unsigned int keylen) { struct mcryptd_hash_ctx *ctx = crypto_ahash_ctx(parent); struct crypto_ahash *child = ctx->child; int err; crypto_ahash_clear_flags(child, CRYPTO_TFM_REQ_MASK); crypto_ahash_set_flags(child, crypto_aha...
0
71,301
Analyze the following 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 AudioOutputDevice::PauseOnIOThread(bool flush) { DCHECK(message_loop()->BelongsToCurrentThread()); if (stream_id_ && is_started_) { ipc_->PauseStream(stream_id_); if (flush) ipc_->FlushStream(stream_id_); } else { play_on_start_ = false; } } Commit Message: Revert r157378 as it cau...
0
103,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: static int hugetlb_vm_op_fault(struct vm_fault *vmf) { BUG(); return 0; } Commit Message: userfaultfd: hugetlbfs: prevent UFFDIO_COPY to fill beyond the end of i_size This oops: kernel BUG at fs/hugetlbfs/inode.c:484! RIP: remove_inode_hugepages+0x3d0/0x410 Call Trace: hugetlbfs_setattr+0xd9/0x130 ...
0
86,397
Analyze the following 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::SanitizeUserInputValue(const String& proposed_value) const { return SanitizeValue(proposed_value); } 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 ...
0
126,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 netlbl_cipsov4_list(struct sk_buff *skb, struct genl_info *info) { int ret_val; struct sk_buff *ans_skb = NULL; u32 nlsze_mult = 1; void *data; u32 doi; struct nlattr *nla_a; struct nlattr *nla_b; struct cipso_v4_doi *doi_def; u32 iter; if (!info->attrs[NLBL_CIPSOV4_A_DOI]) { ret_val = -EI...
0
94,212
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: StatsResponse(const scoped_refptr<LocalRTCStatsRequest>& request, scoped_refptr<base::SingleThreadTaskRunner> task_runner) : request_(request.get()), main_thread_(task_runner) { TRACE_EVENT_ASYNC_BEGIN0("webrtc", "getStats_Native", this); DETACH_FROM_THREAD(signaling_thread_checker...
0
153,007
Analyze the following 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 nfc_genl_deactivate_target(struct sk_buff *skb, struct genl_info *info) { struct nfc_dev *dev; u32 device_idx, target_idx; int rc; if (!info->attrs[NFC_ATTR_DEVICE_INDEX]) return -EINVAL; device_idx = nla_get_u32(info->attrs[NFC_ATTR_DEVICE_INDEX]); dev = nfc_get_device(devic...
1
169,645
Analyze the following 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 hns_xgmac_config_max_frame_length(void *mac_drv, u16 newval) { struct mac_driver *drv = (struct mac_driver *)mac_drv; dsaf_write_dev(drv, XGMAC_MAC_MAX_PKT_SIZE_REG, newval); } Commit Message: net: hns: fix ethtool_get_strings overflow in hns driver hns_get_sset_count() returns HNS_NET_STATS_CNT ...
0
85,627
Analyze the following 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 quitNow() { m_messageLoop->quitNow(); } Commit Message: [4/4] Process clearBrowserCahce/cookies commands in browser. BUG=366585 Review URL: https://codereview.chromium.org/251183005 git-svn-id: svn://svn.chromium.org/blink/trunk@172984 bbb929c8-8fbe-4397-9dbb-9b2b20218538 CWE ...
0
114,227
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: UsageAndQuotaDispatcherTask( QuotaManager* manager, const HostAndType& host_and_type) : QuotaTask(manager), host_and_type_(host_and_type), started_(false), host_quota_(-1), global_usage_(-1), global_unlimited_usage_(-1), host_usage_(-1), ...
0
102,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 RenderBox::mapAbsoluteToLocalPoint(MapCoordinatesFlags mode, TransformState& transformState) const { ASSERT(!view() || !view()->layoutStateEnabled()); bool isFixedPos = style()->position() == FixedPosition; bool hasTransform = hasLayer() && layer()->transform(); if (hasTransform && !isFixedP...
0
116,547
Analyze the following 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 AecInit (preproc_effect_t *effect) { ALOGV("AecInit"); webrtc::EchoControlMobile *aec = static_cast<webrtc::EchoControlMobile *>(effect->engine); aec->set_routing_mode(kAecDefaultMode); aec->enable_comfort_noise(kAecDefaultComfortNoise); return 0; } Commit Message: audio effects: fix heap ov...
0
157,460
Analyze the following 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 BluetoothRemoteGATTServer::GetPrimaryServicesCallback( mojom::blink::WebBluetoothGATTQueryQuantity quantity, ScriptPromiseResolver* resolver, mojom::blink::WebBluetoothResult result, Optional<Vector<mojom::blink::WebBluetoothRemoteGATTServicePtr>> services) { if (!resolver->getExecutionCont...
0
129,052
Analyze the following 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 aacDecoder_drcReadCompression ( HANDLE_FDK_BITSTREAM bs, CDrcPayload *pDrcBs, UINT payloadPosition ) { int bitCnt = 0; int dmxLevelsPresent, extensionPresent, compressionPresent; int coarseGrainTcPresent, fineGrainTcPresent; /* Move to the beginning of the DRC payload...
0
161,257
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void DownloadItemImpl::OnTargetResolved() { DCHECK_CURRENTLY_ON(BrowserThread::UI); DVLOG(20) << __func__ << "() download=" << DebugString(true); DCHECK((state_ == TARGET_PENDING_INTERNAL && deferred_interrupt_reason_ == DOWNLOAD_INTERRUPT_REASON_NONE) || (state_ == INTERRUPTED_TARGET_PEN...
0
146,367
Analyze the following 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 voidMethodCompareHowArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); TestObjectPythonV8Internal::voidMethodCompareHowArgMethod(info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); } Commit Message: document.l...
0
122,805
Analyze the following 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 V8Window::indexedSecurityCheckCustom(v8::Local<v8::Object> host, uint32_t index, v8::AccessType type, v8::Local<v8::Value>) { v8::Isolate* isolate = v8::Isolate::GetCurrent(); v8::Handle<v8::Object> window = V8Window::findInstanceInPrototypeChain(host, isolate); if (window.IsEmpty()) retu...
0
129,073
Analyze the following 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 genl_notify(const struct genl_family *family, struct sk_buff *skb, struct genl_info *info, u32 group, gfp_t flags) { struct net *net = genl_info_net(info); struct sock *sk = net->genl_sock; int report = 0; if (info->nlhdr) report = nlmsg_report(info->nlhdr); if (WARN_ON_ONCE(group >= family->n_mc...
0
88,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: static int crypto_grab_nivcipher(struct crypto_skcipher_spawn *spawn, const char *name, u32 type, u32 mask) { struct crypto_alg *alg; int err; type = crypto_skcipher_type(type); mask = crypto_skcipher_mask(mask)| CRYPTO_ALG_GENIV; alg = crypto_alg_mod_lookup(name, type, mask); if (IS_ERR(alg)) retur...
0
31,289
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb, struct net_device *dev) { struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); struct ieee80211_chanctx_conf *chanctx_conf; struct ieee80211_channel *chan; struct ieee80211_radiotap_header *prthdr = (struct ieee80211_radiotap_head...
0
35,465
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void install_local_socket(asocket* s) { adb_mutex_lock(&socket_list_lock); s->id = local_socket_next_id++; if (local_socket_next_id == 0) { local_socket_next_id = 1; } insert_local_socket(s, &local_socket_list); adb_mutex_unlock(&socket_list_lock); } Commit Message: ad...
1
174,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: static void sapi_read_post_data(TSRMLS_D) { sapi_post_entry *post_entry; uint content_type_length = strlen(SG(request_info).content_type); char *content_type = estrndup(SG(request_info).content_type, content_type_length); char *p; char oldchar=0; void (*post_reader_func)(TSRMLS_D) = NULL; /* dedicated im...
0
56,285
Analyze the following 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::FormatPEMForFileOutput(const std::string& input, std::string* output, bool is_public) { DCHECK(output); if (input.length() == 0) return false; *output = ""; output->append(kKeyBeginHeaderMarker); output->ap...
0
114,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: tree_mod_log_insert_move(struct btrfs_fs_info *fs_info, struct extent_buffer *eb, int dst_slot, int src_slot, int nr_items, gfp_t flags) { struct tree_mod_elem *tm = NULL; struct tree_mod_elem **tm_list = NULL; int ret = 0; int i; int locked = 0; if (!tree_mod_need_log(fs_info, eb)) return 0; t...
0
45,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: static v8::Local<v8::Object> classObjectOfPrivateScript(ScriptState* scriptState, String className) { ASSERT(scriptState->perContextData()); ASSERT(scriptState->getExecutionContext()); v8::Isolate* isolate = scriptState->isolate(); v8::Local<v8::Value> compiledClass = scriptState->perContextData()...
0
130,474
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: garp_group_end_handler(void) { garp_delay_t *delay = LIST_TAIL_DATA(garp_delay); element e, next; interface_t *ifp; if (!delay->have_garp_interval && !delay->have_gna_interval) { report_config_error(CONFIG_GENERAL_ERROR, "garp group %d does not have any delay set - removing", delay->aggregation_group); ...
0
75,972
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Dispatcher::~Dispatcher() {} Commit Message: In chromedriver, add /log url to get the contents of the chromedriver log remotely. Also add a 'chrome.verbose' boolean startup option. Remove usage of VLOG(1) in chromedriver. We do not need as complicated logging as in Chrome. BUG=85241 TEST=none Review URL: http:/...
0
100,746
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SProcXvDispatch(ClientPtr client) { REQUEST(xReq); UpdateCurrentTime(); if (stuff->data >= xvNumRequests) { return BadRequest; } return SXvProcVector[stuff->data] (client); } Commit Message: CWE ID: CWE-20
0
17,480
Analyze the following 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 vmrun_interception(struct vcpu_svm *svm) { if (nested_svm_check_permissions(svm)) return 1; /* Save rip after vmrun instruction */ kvm_rip_write(&svm->vcpu, kvm_rip_read(&svm->vcpu) + 3); if (!nested_svm_vmrun(svm)) return 1; if (!nested_svm_vmrun_msrpm(svm)) goto failed; return 1; fai...
0
37,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 rtl8150_suspend(struct usb_interface *intf, pm_message_t message) { rtl8150_t *dev = usb_get_intfdata(intf); netif_device_detach(dev->netdev); if (netif_running(dev->netdev)) { usb_kill_urb(dev->rx_urb); usb_kill_urb(dev->intr_urb); } return 0; } Commit Message: rtl8150: Use heap buffers fo...
0
66,512
Analyze the following 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 Gfx::opEndPath(Object args[], int numArgs) { doEndPath(); } Commit Message: CWE ID: CWE-20
0
8,124
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int perform_cow(BlockDriverState *bs, QCowL2Meta *m, Qcow2COWRegion *r) { BDRVQcowState *s = bs->opaque; int ret; if (r->nb_sectors == 0) { return 0; } qemu_co_mutex_unlock(&s->lock); ret = copy_sectors(bs, m->offset / BDRV_SECTOR_SIZE, m->alloc_offset, ...
0
16,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: map_set_camera_xy(point2_t where) { s_camera_x = where.x; s_camera_y = where.y; } Commit Message: Fix integer overflow in layer_resize in map_engine.c (#268) * Fix integer overflow in layer_resize in map_engine.c There's a buffer overflow bug in the function layer_resize. It allocates a buffer `tilemap` w...
0
75,061
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: id3_skip (SF_PRIVATE * psf) { unsigned char buf [10] ; memset (buf, 0, sizeof (buf)) ; psf_binheader_readf (psf, "pb", 0, buf, 10) ; if (buf [0] == 'I' && buf [1] == 'D' && buf [2] == '3') { int offset = buf [6] & 0x7f ; offset = (offset << 7) | (buf [7] & 0x7f) ; offset = (offset << 7) | (buf [8] & 0x7...
1
168,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: void UiSceneCreator::CreateCloseButton() { base::Callback<void()> click_handler = base::Bind( [](Model* model, UiBrowserInterface* browser) { if (model->fullscreen) { browser->ExitFullscreen(); } if (model->in_cct) { browser->ExitCct(); } }, ...
0
155,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 _nfs4_proc_access(struct inode *inode, struct nfs_access_entry *entry) { struct nfs_server *server = NFS_SERVER(inode); struct nfs4_accessargs args = { .fh = NFS_FH(inode), .bitmask = server->attr_bitmask, }; struct nfs4_accessres res = { .server = server, }; struct rpc_message msg = { .r...
0
23,171
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: String BaseRenderingContext2D::lineJoin() const { return LineJoinName(GetState().GetLineJoin()); } Commit Message: [PE] Distinguish between tainting due to canvas content and filter. A filter on a canvas can itself lead to origin tainting, for reasons other than that the canvas contents are tainted. This CL c...
0
149,934
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void WebPagePrivate::layoutFinished() { if (!m_contentsSizeChanged && !m_overflowExceedsContentsSize) return; m_contentsSizeChanged = false; // Toggle to turn off notification again. m_overflowExceedsContentsSize = false; if (contentsSize().isEmpty()) return; if (didLayoutEx...
0
104,252
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: R_API ut64 r_bin_java_attr_calc_size(RBinJavaAttrInfo *attr) { return attr ? ((RBinJavaAttrMetas *) attr->metas->type_info)->allocs->calc_size (attr) : 0; } Commit Message: Fix #10498 - Crash in fuzzed java file CWE ID: CWE-125
0
79,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: cf2_initGlobalRegionBuffer( CFF_Decoder* decoder, CF2_UInt idx, CF2_Buffer buf ) { FT_ASSERT( decoder && decoder->globals ); FT_ZERO( buf ); idx += decoder->globals_bias; if ( idx >= decoder->num_globals ) ret...
1
165,221
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void luaD_reallocCI (lua_State *L, int newsize) { CallInfo *oldci = L->base_ci; luaM_reallocvector(L, L->base_ci, L->size_ci, newsize, CallInfo); L->size_ci = newsize; L->ci = (L->ci - oldci) + L->base_ci; L->end_ci = L->base_ci + L->size_ci - 1; } Commit Message: disable loading lua bytecode CWE ID: C...
0
43,052
Analyze the following 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::AXTreeIDRegistry::AXTreeID RenderFrameHostImpl::RoutingIDToAXTreeID( int routing_id) { RenderFrameHostImpl* rfh = nullptr; RenderFrameProxyHost* rfph = RenderFrameProxyHost::FromID( GetProcess()->GetID(), routing_id); if (rfph) { FrameTree* frame_tree = rfph->frame_tree_node()->frame_tree(...
0
127,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: status_t Parcel::readBool(bool *pArg) const { int32_t tmp; status_t ret = readInt32(&tmp); *pArg = (tmp != 0); return ret; } Commit Message: Add bound checks to utf16_to_utf8 Bug: 29250543 Change-Id: I518e7b2fe10aaa3f1c1987586a09b1110aff7e1a (cherry picked from commit 7e93b2ddcb49b5365fbe1dab134ffb38e6f1c71...
0
163,559
Analyze the following 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 AutocompleteResult::AddMatch(const AutocompleteMatch& match) { DCHECK(default_match_ != end()); DCHECK_EQ(AutocompleteMatch::SanitizeString(match.contents), match.contents); DCHECK_EQ(AutocompleteMatch::SanitizeString(match.description), match.description); ACMatches::iterator insertion_p...
0
103,772
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PHP_METHOD(HttpParams, offsetGet) { char *name_str; int name_len; zval **zparam, *zparams; if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name_str, &name_len)) { return; } zparams = php_http_ztyp(IS_ARRAY, zend_read_property(php_http_params_class_entry, getThis(), ZEND_STRL("param...
0
93,982
Analyze the following 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::AddPendingView() { pending_views_++; } 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 ...
0
114,506
Analyze the following 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 write_version( FILE *fp, const char *fname, const char *dirname, xref_t *xref) { long start; char *c, *new_fname, data; FILE *new_fp; start = ftell(fp); /* Create file */ if ((c = strstr(fname, ".pdf"))) *c = '\0'; new_fname = mallo...
1
169,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: PHP_FUNCTION(stream_context_get_params) { zval *zcontext, *options; php_stream_context *context; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zcontext) == FAILURE) { RETURN_FALSE; } context = decode_context_param(zcontext TSRMLS_CC); if (!context) { php_error_docref(NULL TSRMLS_CC, E_WAR...
0
15,266
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: raid_disks_store(struct mddev *mddev, const char *buf, size_t len) { unsigned int n; int err; err = kstrtouint(buf, 10, &n); if (err < 0) return err; err = mddev_lock(mddev); if (err) return err; if (mddev->pers) err = update_raid_disks(mddev, n); else if (mddev->reshape_position != MaxSector) { ...
0
42,507
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ip_vs_service_get(struct net *net, int af, __u32 fwmark, __u16 protocol, const union nf_inet_addr *vaddr, __be16 vport) { struct ip_vs_service *svc; struct netns_ipvs *ipvs = net_ipvs(net); read_lock(&__ip_vs_svc_lock); /* * Check the table hashed by fwmark first */ if (fwmark) { svc = __ip_vs_sv...
0
34,226