instruction
stringclasses
1 value
input
stringlengths
64
129k
output
int64
0
1
__index_level_0__
int64
0
30k
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: AuthenticatorTransportSelectorSheetModel::GetStepIllustration( ImageColorScheme color_scheme) const { return color_scheme == ImageColorScheme::kDark ? kWebauthnWelcomeDarkIcon : kWebauthnWelcomeIcon; } Commit Message: chrome/browser/ui/webauthn: long domains...
0
8,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: R_API void r_bin_java_annotation_free(void /*RBinJavaAnnotation*/ *a) { RBinJavaAnnotation *annotation = a; if (annotation) { r_list_free (annotation->element_value_pairs); free (annotation); } } Commit Message: Fix #10498 - Crash in fuzzed java file CWE ID: CWE-125
0
27,967
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MojoResult MojoPlatformHandleToScopedPlatformHandle( const MojoPlatformHandle* platform_handle, ScopedPlatformHandle* out_handle) { if (platform_handle->struct_size != sizeof(MojoPlatformHandle)) return MOJO_RESULT_INVALID_ARGUMENT; if (platform_handle->type == MOJO_PLATFORM_HANDLE_TYPE_INVALID) ...
0
19,042
Analyze the following 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::DoLinkProgram(GLuint program_id) { TRACE_EVENT0("gpu", "GLES2DecoderImpl::DoLinkProgram"); SCOPED_UMA_HISTOGRAM_TIMER("GPU.DoLinkProgramTime"); Program* program = GetProgramInfoNotShader( program_id, "glLinkProgram"); if (!program) { return; } LogClientServiceForInfo(...
0
9,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: GURL ConfirmInfoBarDelegate::GetLinkURL() const { return GURL(); } Commit Message: Allow to specify elide behavior for confrim infobar message Used in "<extension name> is debugging this browser" infobar. Bug: 823194 Change-Id: Iff6627097c020cccca8f7cc3e21a803a41fd8f2c Reviewed-on: https://chromium-review.go...
0
15,341
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool FrameView::didFirstLayout() const { return !m_firstLayout; } Commit Message: Defer call to updateWidgetPositions() outside of RenderLayerScrollableArea. updateWidgetPositions() can destroy the render tree, so it should never be called from inside RenderLayerScrollableArea. Leaving it there allows for t...
0
26,119
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int show_numa_map(struct seq_file *m, void *v) { struct numa_maps_private *numa_priv = m->private; struct proc_maps_private *proc_priv = &numa_priv->proc_maps; struct vm_area_struct *vma = v; struct numa_maps *md = &numa_priv->md; struct file *file = vma->vm_file; struct mm_struct *mm = vma->vm_mm; ...
0
26,166
Analyze the following 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 LayerTreeHostImpl::AnimateBrowserControls(base::TimeTicks time) { if (!browser_controls_offset_manager_->has_animation()) return false; gfx::Vector2dF scroll = browser_controls_offset_manager_->Animate(time); if (browser_controls_offset_manager_->has_animation()) SetNeedsOneBeginImplFrame(); ...
0
18,661
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SYSCALL_DEFINE1(nice, int, increment) { long nice, retval; /* * Setpriority might change our priority at the same moment. * We don't have to worry. Conceptually one call occurs first * and we have a single winner. */ if (increment < -40) increment = -40; if (increment > 40) increment = 40; nice...
0
16,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: void Part::slotActivated(const QModelIndex &index) { Q_UNUSED(index) if (QGuiApplication::keyboardModifiers() != Qt::ShiftModifier && QGuiApplication::keyboardModifiers() != Qt::ControlModifier) { ArkSettings::defaultOpenAction() == ArkSettings::EnumDefaultOpenAction::Preview ? slotOpenEn...
0
25,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: static int btrfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) { struct inode *inode = NULL; struct btrfs_trans_handle *trans; struct btrfs_root *root = BTRFS_I(dir)->root; int err = 0; int drop_on_err = 0; u64 objectid = 0; u64 index = 0; /* * 2 items for inode and ref * 2 items for ...
0
13,210
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: vips_tracked_get_mem_highwater( void ) { size_t mx; vips_tracked_init(); g_mutex_lock( vips_tracked_mutex ); mx = vips_tracked_mem_highwater; g_mutex_unlock( vips_tracked_mutex ); return( mx ); } Commit Message: zero memory on malloc to prevent write of uninit memory under some error conditions tha...
0
25,584
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GLvoid StubGLUniform3iv(GLint location, GLsizei count, const GLint* v) { glUniform3iv(location, count, v); } Commit Message: Add chromium_code: 1 to surface.gyp and gl.gyp to pick up -Werror. It looks like this was dropped accidentally in http://codereview.chromium.org/6718027 (surface.gyp) and http://coderev...
0
10,195
Analyze the following 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 EnterLayerOneSandbox(LinuxSandbox* linux_sandbox, const bool using_layer1_sandbox, base::Closure* post_fork_parent_callback) { DCHECK(linux_sandbox); ZygotePreSandboxInit(); #if !defined(THREAD_SANITIZER) CHECK(sandbox::ThreadHe...
0
17,753
Analyze the following 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 dentry *user_path_create(int dfd, const char __user *pathname, struct path *path, unsigned int lookup_flags) { struct filename *tmp = getname(pathname); struct dentry *res; if (IS_ERR(tmp)) return ERR_CAST(tmp); res = filename_create(dfd, tmp, path, lookup_flags); putname(tmp); return res; } C...
0
11,648
Analyze the following 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 tty_unregister_driver(struct tty_driver *driver) { #if 0 /* FIXME */ if (driver->refcount) return -EBUSY; #endif unregister_chrdev_region(MKDEV(driver->major, driver->minor_start), driver->num); mutex_lock(&tty_mutex); list_del(&driver->tty_drivers); mutex_unlock(&tty_mutex); return 0; } Commit ...
0
4,647
Analyze the following 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 IsAppLauncherPresent() { return GetAppLauncherInstallationState() != NOT_INSTALLED; } Commit Message: Upgrade old app host to new app launcher on startup This patch is a continuation of https://codereview.chromium.org/16805002/. BUG=248825 Review URL: https://chromiumcodereview.appspot.com/17022015 gi...
0
3,871
Analyze the following 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 set_vma_private_data(struct vm_area_struct *vma, unsigned long value) { vma->vm_private_data = (void *)value; } Commit Message: hugetlb: fix resv_map leak in error path When called for anonymous (non-shared) mappings, hugetlb_reserve_pages() does a resv_map_alloc(). It depends on code in hu...
0
27,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: WebGLRenderingContextBaseSet& ActiveContexts() { DEFINE_THREAD_SAFE_STATIC_LOCAL( ThreadSpecific<Persistent<WebGLRenderingContextBaseSet>>, active_contexts, ()); Persistent<WebGLRenderingContextBaseSet>& active_contexts_persistent = *active_contexts; if (!active_contexts_persistent) { ...
0
16,877
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static struct ipmi_smi_msg *smi_add_send_msg(struct ipmi_smi *intf, struct ipmi_smi_msg *smi_msg, int priority) { if (intf->curr_msg) { if (priority > 0) list_add_tail(&smi_msg->link, &intf->hp_xmit_msgs); else list_add_tail(&smi_msg->link, &intf->xmit_msgs); smi_msg = NULL; } el...
0
3,305
Analyze the following 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 isKanaLetter(UChar character) { if (character >= 0x3041 && character <= 0x3096) return true; if (character >= 0x30A1 && character <= 0x30FA) return true; if (character >= 0x31F0 && character <= 0x31FF) return true; if (character >= 0xFF66 && character <...
0
23,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: static struct mfc6_cache *ip6mr_cache_alloc(void) { struct mfc6_cache *c = kmem_cache_zalloc(mrt_cachep, GFP_KERNEL); if (!c) return NULL; c->mfc_un.res.last_assert = jiffies - MFC_ASSERT_THRESH - 1; c->mfc_un.res.minvif = MAXMIFS; return c; } Commit Message: ipv6: check sk sk_type and protocol early in i...
0
19,384
Analyze the following 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 tlbflush_read_file(struct file *file, char __user *user_buf, size_t count, loff_t *ppos) { char buf[32]; unsigned int len; len = sprintf(buf, "%ld\n", tlb_single_page_flush_ceiling); return simple_read_from_buffer(user_buf, count, ppos, buf, len); } Commit Message: x86/mm: Add barrier...
0
24,697
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void Framebuffer::MarkAttachmentsAsCleared( RenderbufferManager* renderbuffer_manager, TextureManager* texture_manager, bool cleared) { for (AttachmentMap::iterator it = attachments_.begin(); it != attachments_.end(); ++it) { Attachment* attachment = it->second.get(); if (attach...
0
23,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 Document::clearFocusedElementTimerFired(Timer<Document>*) { updateLayoutTreeIfNeeded(); m_clearFocusedElementTimer.stop(); if (m_focusedElement && !m_focusedElement->isFocusable()) m_focusedElement->blur(); } Commit Message: Change Document::detach() to RELEASE_ASSERT all subframes are ...
0
7,473
Analyze the following 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 dname_external(const struct dentry *dentry) { return dentry->d_name.name != dentry->d_iname; } Commit Message: dentry name snapshots take_dentry_name_snapshot() takes a safe snapshot of dentry name; if the name is a short one, it gets copied into caller-supplied structure, otherwise an extr...
0
24,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: GfxState::~GfxState() { int i; if (fillColorSpace) { delete fillColorSpace; } if (strokeColorSpace) { delete strokeColorSpace; } if (fillPattern) { delete fillPattern; } if (strokePattern) { delete strokePattern; } for (i = 0; i < 4; ++i) { if (transfer[i]) { delete ...
0
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: static void nicklist_rename_list(SERVER_REC *server, void *new_nick_id, const char *old_nick, const char *new_nick, GSList *nicks) { CHANNEL_REC *channel; NICK_REC *nickrec; GSList *tmp; for (tmp = nicks; tmp != NULL; tmp = tmp->next->next) { channel = tmp->data; nickrec = tmp->next->data; /...
0
6,475
Analyze the following 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 WebGL2RenderingContextBase::Trace(blink::Visitor* visitor) { visitor->Trace(read_framebuffer_binding_); visitor->Trace(transform_feedback_binding_); visitor->Trace(default_transform_feedback_); visitor->Trace(bound_copy_read_buffer_); visitor->Trace(bound_copy_write_buffer_); visitor->Trace(bound...
0
12,009
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int convert_ctx_accesses(struct bpf_verifier_env *env) { const struct bpf_verifier_ops *ops = env->prog->aux->ops; const int insn_cnt = env->prog->len; struct bpf_insn insn_buf[16], *insn; struct bpf_prog *new_prog; enum bpf_access_type type; int i, cnt, delta = 0; if (ops->gen_prologue) { cnt = ...
0
29,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: void GraphicsContext::platformInit(PlatformGraphicsContext* context) { m_data = new GraphicsContextPlatformPrivate; setPaintingDisabled(!context); if (context) { setPlatformFillColor(fillColor(), ColorSpaceDeviceRGB); setPlatformStrokeColor(strokeColor(), ColorSpaceDeviceRGB); } #...
0
16,685
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void RenderFrameImpl::RenderFallbackContentInParentProcess() { Send(new FrameHostMsg_RenderFallbackContentInParentProcess(routing_id_)); } Commit Message: Convert FrameHostMsg_DidAddMessageToConsole to Mojo. Note: Since this required changing the test RenderViewImplTest.DispatchBeforeUnloadCanDetachFrame, I m...
0
26,546
Analyze the following 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 checkTreePage( IntegrityCk *pCheck, /* Context for the sanity check */ int iPage, /* Page number of the page to check */ i64 *piMinKey, /* Write minimum integer primary key here */ i64 maxKey /* Error if integer primary key greater than this */ ){ MemPage *pPage ...
0
24,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: CronTab::CronTab() { this->lastRunTime = CRONTAB_INVALID; this->valid = false; } Commit Message: CWE ID: CWE-134
0
991
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int mac80211_hwsim_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_ampdu_params *params) { struct ieee80211_sta *sta = params->sta; enum ieee80211_ampdu_mlme_action action = params->action; u16 tid = params->tid; switch (action) { case IEEE80211...
0
24,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: static void voidMethodSequenceStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); TestObjectPythonV8Internal::voidMethodSequenceStringArgMethod(info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); } Commit Message: do...
0
22,981
Analyze the following 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 IsEmptyValue( const blink::incremental_marking_test::StrongWeakPair& value) { return !value.first; } Commit Message: [oilpan] Fix GCInfoTable for multiple threads Previously, grow and access from different threads could lead to a race on the table backing; see bug. - Rework the table ...
0
7,092
Analyze the following 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 regulator_bulk_get(struct device *dev, int num_consumers, struct regulator_bulk_data *consumers) { int i; int ret; for (i = 0; i < num_consumers; i++) consumers[i].consumer = NULL; for (i = 0; i < num_consumers; i++) { consumers[i].consumer = regulator_get(dev, consumers[i].supp...
0
25,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: ModuleExport void UnregisterMATImage(void) { (void) UnregisterMagickInfo("MAT"); } Commit Message: https://github.com/ImageMagick/ImageMagick/issues/598 CWE ID: CWE-617
0
25,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: static int attach_auth_trunc(struct xfrm_algo_auth **algpp, u8 *props, struct nlattr *rta) { struct xfrm_algo_auth *p, *ualg; struct xfrm_algo_desc *algo; if (!rta) return 0; ualg = nla_data(rta); algo = xfrm_aalg_get_byname(ualg->alg_name, 1); if (!algo) return -ENOSYS; if (ualg->alg_trunc_...
0
12,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: void RenderViewImpl::DidCommitCompositorFrame() { RenderWidget::DidCommitCompositorFrame(); FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidCommitCompositorFrame()); } Commit Message: Let the browser handle external navigations from DevTools. BUG=180555 Review URL: https://chromiumcodereview.appspot....
0
4,712
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: jas_iccprof_t *jas_iccprof_createfrombuf(uchar *buf, int len) { jas_stream_t *in; jas_iccprof_t *prof; if (!(in = jas_stream_memopen(JAS_CAST(char *, buf), len))) goto error; if (!(prof = jas_iccprof_load(in))) goto error; jas_stream_close(in); return prof; error: if (in) jas_stream_close(in); re...
1
23,060
Analyze the following 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 IsExampleOf(AutofillMetrics::FieldTypeQualityMetric metric, ServerFieldType predicted_type, ServerFieldType actual_type) { if (predicted_type == NO_SERVER_DATA) predicted_type = UNKNOWN_TYPE; switch (metric) { case AutofillMetrics::TRUE_POSITIVE: ...
0
15,192
Analyze the following 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 kioctx *ioctx_alloc(unsigned nr_events) { struct mm_struct *mm = current->mm; struct kioctx *ctx; int err = -ENOMEM; /* * We keep track of the number of available ringbuffer slots, to prevent * overflow (reqs_available), and we also use percpu counters for this. * * So since up to half ...
0
21,333
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int ip6mr_ioctl(struct sock *sk, int cmd, void __user *arg) { struct sioc_sg_req6 sr; struct sioc_mif_req6 vr; struct mif_device *vif; struct mfc6_cache *c; struct net *net = sock_net(sk); struct mr6_table *mrt; mrt = ip6mr_get_table(net, raw6_sk(sk)->ip6mr_table ? : RT6_TABLE_DFLT); if (!mrt) return -...
0
3,457
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool RenderProcessHostImpl::StopWebRTCEventLog() { return webrtc_eventlog_host_.StopWebRTCEventLog(); } Commit Message: Switching AudioOutputAuthorizationHandler from using AudioManager interface to AudioSystem one. BUG=672468 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;mas...
0
28,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: static int __init init_zero_pfn(void) { zero_pfn = page_to_pfn(ZERO_PAGE(0)); return 0; } Commit Message: mm: thp: fix pmd_bad() triggering in code paths holding mmap_sem read mode commit 1a5a9906d4e8d1976b701f889d8f35d54b928f25 upstream. In some cases it may happen that pmd_none_or_clear_bad() is called wit...
0
21,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: static int tcos_match_card(sc_card_t *card) { int i; i = _sc_match_atr(card, tcos_atrs, &card->type); if (i < 0) return 0; return 1; } Commit Message: fixed out of bounds writes Thanks to Eric Sesterhenn from X41 D-SEC GmbH for reporting the problems. CWE ID: CWE-415
0
23,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: static u16 cellSizePtrNoPayload(MemPage *pPage, u8 *pCell){ u8 *pIter = pCell + 4; /* For looping over bytes of pCell */ u8 *pEnd; /* End mark for a varint */ #ifdef SQLITE_DEBUG /* The value returned by this function should always be the same as ** the (CellInfo.nSize) value found by doing ...
0
12,500
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: random_choice(void) { unsigned char x; RANDOMIZE(x); return x & 1; } Commit Message: DO NOT MERGE Update libpng to 1.6.20 BUG:23265085 Change-Id: I85199805636d771f3597b691b63bc0bf46084833 (cherry picked from commit bbe98b40cda082024b669fa508931042eed18f82) CWE ID:
0
27,511
Analyze the following 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 seqStore_t* ZSTD_getSeqStore(const ZSTD_CCtx* ctx) { return &(ctx->seqStore); } Commit Message: fixed T36302429 CWE ID: CWE-362
0
19,586
Analyze the following 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 sha1_s390_fini(void) { crypto_unregister_shash(&alg); } Commit Message: crypto: prefix module autoloading with "crypto-" This prefixes all crypto module loading with "crypto-" so we never run the risk of exposing module auto-loading to userspace via a crypto API, as demonstrated by Mathias K...
0
2,394
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int vmx_get_msr_feature(struct kvm_msr_entry *msr) { switch (msr->index) { case MSR_IA32_VMX_BASIC ... MSR_IA32_VMX_VMFUNC: if (!nested) return 1; return vmx_get_vmx_msr(&vmcs_config.nested, msr->index, &msr->data); default: return 1; } return 0; } Commit Message: kvm: nVMX: Enforce cpl=0 f...
0
29,187
Analyze the following 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 CCThreadProxy::setNeedsRedraw() { ASSERT(isMainThread()); TRACE_EVENT("CCThreadProxy::setNeedsRedraw", this, 0); s_ccThread->postTask(createCCThreadTask(this, &CCThreadProxy::setNeedsRedrawOnCCThread)); } Commit Message: [chromium] Fix shutdown race when posting main thread task to CCThreadProxy...
0
3,437
Analyze the following 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 GLES2Util::GetCoefficientCountForGLPathFragmentInputGenMode( uint32_t gen_mode) { switch (gen_mode) { case GL_EYE_LINEAR_CHROMIUM: return 4; case GL_OBJECT_LINEAR_CHROMIUM: return 3; case GL_CONSTANT_CHROMIUM: return 1; case GL_NONE: default: return 0; } ...
0
1,269
Analyze the following 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 RunCoeffCheck() { ACMRandom rnd(ACMRandom::DeterministicSeed()); const int count_test_block = 5000; DECLARE_ALIGNED_ARRAY(16, int16_t, input_block, kNumCoeffs); DECLARE_ALIGNED_ARRAY(16, int16_t, output_ref_block, kNumCoeffs); DECLARE_ALIGNED_ARRAY(16, int16_t, output_block, kNumCoef...
1
17,757
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void AppCacheUpdateJob::DiscardDuplicateResponses() { storage_->DoomResponses(manifest_url_, duplicate_response_ids_); } Commit Message: AppCache: fix a browser crashing bug that can happen during updates. BUG=558589 Review URL: https://codereview.chromium.org/1463463003 Cr-Commit-Position: refs/heads/maste...
0
26,765
Analyze the following 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_proc_unlink_setup(struct rpc_message *msg, struct inode *dir) { struct nfs_server *server = NFS_SERVER(dir); struct nfs_removeargs *args = msg->rpc_argp; struct nfs_removeres *res = msg->rpc_resp; args->bitmask = server->attr_bitmask; res->server = server; msg->rpc_proc = &nfs4_procedures[...
0
14,000
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void GLES2Implementation::RemoveMappedBufferRangeById(GLuint buffer) { if (buffer > 0) { auto iter = mapped_buffer_range_map_.find(buffer); if (iter != mapped_buffer_range_map_.end() && iter->second.shm_memory) { mapped_memory_->FreePendingToken(iter->second.shm_memory, ...
0
21,014
Analyze the following 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 WebContentsImpl::WasHidden() { if (capturer_count_ == 0) { if (auto* view = GetRenderWidgetHostView()) view->Hide(); if (!ShowingInterstitialPage()) SetVisibilityForChildViews(true); SendPageMessage(new PageMsg_WasHidden(MSG_ROUTING_NONE)); } last_hidden_time_ = base::TimeTic...
0
16,371
Analyze the following 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 SetPSDPixel(Image *image,const size_t channels, const ssize_t type,const size_t packet_size,const Quantum pixel,Quantum *q, ExceptionInfo *exception) { if (image->storage_class == PseudoClass) { if (packet_size == 1) SetPixelIndex(image,ScaleQuantumToChar(pixel),q); ...
0
27,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 int do_rt_tgsigqueueinfo(pid_t tgid, pid_t pid, int sig, siginfo_t *info) { /* This is only valid for single tasks */ if (pid <= 0 || tgid <= 0) return -EINVAL; /* Not even root can pretend to send signals from the kernel. * Nor can they impersonate a kill()/tgkill(), which adds source info. */ ...
0
13,009
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: decode_NXAST_RAW_BUNDLE_LOAD(const struct nx_action_bundle *nab, enum ofp_version ofp_version OVS_UNUSED, const struct vl_mff_map *vl_mff_map, uint64_t *tlv_bitmap, struct ofpbuf *out) { return decode_bundle(true, nab, vl_m...
0
22,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: void MediaRecorder::stop(ExceptionState& exception_state) { if (state_ == State::kInactive) { exception_state.ThrowDOMException( DOMExceptionCode::kInvalidStateError, "The MediaRecorder's state is '" + StateToString(state_) + "'."); return; } StopRecording(); } Commit Message: Chec...
0
25,544
Analyze the following 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 stsd_Read(GF_Box *s, GF_BitStream *bs) { gf_bs_read_u32(bs); ISOM_DECREASE_SIZE(s, 4) return gf_isom_box_array_read_ex(s, bs, stsd_AddBox, GF_ISOM_BOX_TYPE_STSD); } Commit Message: fixed 2 possible heap overflows (inc. #1088) CWE ID: CWE-125
0
27,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 TopSitesCacheTest::BuildTopSites(const char** spec, size_t size) { std::set<std::string> urls_seen; for (size_t i = 0; i < size; ++i) { const char* spec_item = spec[i]; while (*spec_item && *spec_item == ' ') // Eat indent. ++spec_item; if (urls_seen.find(spec_item) != urls_seen.end())...
0
3,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: void WebGL2RenderingContextBase::compressedTexImage2D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, MaybeShared<DOMArrayBufferView> data, GLuint src_offset, GLuint src_length_override) { if (isContextLost()) return; if ...
0
7,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: cmsBool ReadMPEElem(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, void* Cargo, cmsUInt32Number n, cmsUInt32Number SizeOfTag) { cmsStageSignature ElementSig; cmsTagTypeHandler* TypeHandler; cmsUInt32Number nItems;...
0
15,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: FixedPolicySubresourceFilter(LoadPolicy policy, int* filtered_load_counter) : policy_(policy), filtered_load_counter_(filtered_load_counter) {} Commit Message: DevTools: send proper resource type in Network.RequestWillBeSent This patch plumbs resoure type into the DispatchWillSendRequest instrumenation....
0
29,144
Analyze the following 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 crypto_ccm_free(struct aead_instance *inst) { struct ccm_instance_ctx *ctx = aead_instance_ctx(inst); crypto_drop_ahash(&ctx->mac); crypto_drop_skcipher(&ctx->ctr); kfree(inst); } Commit Message: crypto: ccm - move cbcmac input off the stack Commit f15f05b0a5de ("crypto: ccm - switch to separat...
0
15,734
Analyze the following 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 onNewCommandConnect(RIL_SOCKET_ID socket_id) { int rilVer = s_callbacks.version; RIL_UNSOL_RESPONSE(RIL_UNSOL_RIL_CONNECTED, &rilVer, sizeof(rilVer), socket_id); RIL_UNSOL_RESPONSE(RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED, NULL, 0, socket_id); if (s_lastN...
0
16,209
Analyze the following 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 get_num_discard_bios(struct dm_target *ti) { return ti->num_discard_bios; } Commit Message: dm: fix race between dm_get_from_kobject() and __dm_destroy() The following BUG_ON was hit when testing repeat creation and removal of DM devices: kernel BUG at drivers/md/dm.c:2919! CPU: 7 PID:...
0
9,752
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: mfr_print(netdissect_options *ndo, register const u_char *p, u_int length) { u_int tlen,idx,hdr_len = 0; uint16_t sequence_num; uint8_t ie_type,ie_len; const uint8_t *tptr; /* * FRF.16 Link Integrity Control Frame * * 7 6 5 4 3 2 1 0 * +----+----+----+-...
0
17,800
Analyze the following 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_replace(struct net *net, const char *name, unsigned int valid_hooks, struct xt_table_info *newinfo, unsigned int num_counters, void __user *counters_ptr) { int ret; struct xt_table *t; struct xt_table_info *oldinfo; struct xt_counters *counters; struct ipt_entry *iter; ret = 0; counters =...
0
5,264
Analyze the following 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 TabStripModel::ExtendSelectionTo(int index) { DCHECK(ContainsIndex(index)); TabStripSelectionModel new_model; new_model.Copy(selection_model_); new_model.SetSelectionFromAnchorTo(index); SetSelection(new_model, NOTIFY_DEFAULT); } Commit Message: Remove TabContents from TabStripModelObserver::TabDe...
0
9,250
Analyze the following 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 Tags::Tag::ShallowCopy(Tag& rhs) const { rhs.m_simple_tags = m_simple_tags; rhs.m_simple_tags_size = m_simple_tags_size; rhs.m_simple_tags_count = m_simple_tags_count; } Commit Message: Fix ParseElementHeader to support 0 payload elements Cherry-pick'ing Change 5c83bbec9a5f6f00a349674ddad85b753d2ea21...
0
21,829
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PaintLayerScrollableArea::ScrollingBackgroundDisplayItemClient::VisualRect() const { const auto* box = scrollable_area_->GetLayoutBox(); const auto& paint_offset = box->FirstFragment().PaintOffset(); auto overflow_clip_rect = PixelSnappedIntRect(box->OverflowClipRect(paint_offset)); auto scroll_...
0
17,593
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: set_salt_padata(METHOD_DATA *md, Salt *salt) { if (salt) { realloc_method_data(md); md->val[md->len - 1].padata_type = salt->type; der_copy_octet_string(&salt->salt, &md->val[md->len - 1].padata_value); } } Commit Message: Security: Avoid NULL structure p...
0
24,775
Analyze the following 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 XMLHttpRequest::didReceiveData(const char* data, int len) { if (m_error) return; if (m_state < HEADERS_RECEIVED) changeState(HEADERS_RECEIVED); bool useDecoder = m_responseTypeCode == ResponseTypeDefault || m_responseTypeCode == ResponseTypeText || m_responseTypeCode == Response...
0
4,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: static void hns_nic_drop_rx_fetch(struct hns_nic_ring_data *ring_data, struct sk_buff *skb) { dev_kfree_skb_any(skb); } Commit Message: net: hns: Fix a skb used after free bug skb maybe freed in hns_nic_net_xmit_hw() and return NETDEV_TX_OK, which cause hns_nic_net_xmit to use a freed skb. BUG: KASAN: ...
0
28,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: SetIsInertMessageFilter() : content::BrowserMessageFilter(FrameMsgStart), msg_received_(false) {} Commit Message: Add a check for disallowing remote frame navigations to local resources. Previously, RemoteFrame navigations did not perform any renderer-side checks and relied solely on the browser...
0
29,083
Analyze the following 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 NavigationControllerImpl::InsertEntriesFrom( const NavigationControllerImpl& source, int max_index) { DCHECK_LE(max_index, source.GetEntryCount()); size_t insert_index = 0; for (int i = 0; i < max_index; i++) { if (source.entries_[i].get()->GetPageType() != PAGE_TYPE_INTERSTITIAL) {...
0
22,012
Analyze the following 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 char *smb_fn_name(int type) { const char *unknown_name = "SMBunknown"; if (smb_messages[type].name == NULL) return(unknown_name); return(smb_messages[type].name); } Commit Message: CWE ID:
0
10,207
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GLboolean WebGLRenderingContextBase::isFramebuffer( WebGLFramebuffer* framebuffer) { if (!framebuffer || isContextLost()) return 0; if (!framebuffer->HasEverBeenBound()) return 0; if (framebuffer->IsDeleted()) return 0; return ContextGL()->IsFramebuffer(framebuffer->Object()); } Commit ...
0
19,930
Analyze the following 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 PPB_URLLoader_Impl::SetStatusCallback( PP_URLLoaderTrusted_StatusCallback cb) { status_callback_ = cb; } Commit Message: Maintain a map of all resources in the resource tracker and clear instance back pointers when needed, BUG=85808 Review URL: http://codereview.chromium.org/7196001 git-svn-id: svn:...
0
14,749
Analyze the following 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 ext4_ext_space_block_idx(struct inode *inode, int check) { int size; size = (inode->i_sb->s_blocksize - sizeof(struct ext4_extent_header)) / sizeof(struct ext4_extent_idx); #ifdef AGGRESSIVE_TEST if (!check && size > 5) size = 5; #endif return size; } Commit Message: ext4: race-condit...
0
20,354
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: httpd_destroy_conn( httpd_conn* hc ) { if (hc->initialized) { free(hc->read_buf); free(hc->decodedurl); free(hc->origfilename); free(hc->expnfilename); free(hc->encodings); free(hc->pathinfo); free(hc->query); free(hc->accept); free(hc->accepte); free(hc->reqhost); free(hc->hostdir); free(hc->remo...
0
4,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: static int bnep_net_open(struct net_device *dev) { netif_start_queue(dev); return 0; } Commit Message: net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared After the last patch, We are left in a state in which only drivers calling ether_setup have IFF_TX_SKB_SHARING set (we assume that driv...
0
1,736
Analyze the following 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 WebRuntimeFeatures::EnableWebAuthGetTransports(bool enable) { RuntimeEnabledFeatures::SetWebAuthGetTransportsEnabled(enable); } Commit Message: Remove RequireCSSExtensionForFile runtime enabled flag. The feature has long since been stable (since M64) and doesn't seem to be a need for this flag. BUG=7889...
0
4,452
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int __init dcbnl_init(void) { INIT_LIST_HEAD(&dcb_app_list); rtnl_register(PF_UNSPEC, RTM_GETDCB, dcb_doit, NULL, NULL); rtnl_register(PF_UNSPEC, RTM_SETDCB, dcb_doit, NULL, NULL); return 0; } Commit Message: dcbnl: fix various netlink info leaks The dcb netlink interface leaks stack memory in vari...
0
19,497
Analyze the following 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 Sample::doLoad() { uint32_t sampleRate; int numChannels; audio_format_t format; status_t status; mHeap = new MemoryHeapBase(kDefaultHeapSize); ALOGV("Start decode"); if (mUrl) { status = MediaPlayer::decode( NULL /* httpService */, mUrl, &sampleRate,...
0
22,371
Analyze the following 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::setCompatibilityMode(CompatibilityMode mode) { if (m_compatibilityModeLocked || mode == m_compatibilityMode) return; m_compatibilityMode = mode; selectorQueryCache().invalidate(); } Commit Message: Change Document::detach() to RELEASE_ASSERT all subframes are gone. BUG=556724,...
0
20,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: String preloadTypeToString(WebMediaPlayer::Preload preloadType) { switch (preloadType) { case WebMediaPlayer::PreloadNone: return "none"; case WebMediaPlayer::PreloadMetaData: return "metadata"; case WebMediaPlayer::PreloadAuto: return "auto"; } NOTREACHED(); return String()...
0
21,902
Analyze the following 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 netdev_init_queue_locks(struct net_device *dev) { netdev_for_each_tx_queue(dev, __netdev_init_queue_locks_one, NULL); __netdev_init_queue_locks_one(dev, &dev->rx_queue, NULL); } Commit Message: veth: Dont kfree_skb() after dev_forward_skb() In case of congestion, netif_rx() frees the skb, so we mu...
0
28,153
Analyze the following 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 CameraClient::getOrientation(int degrees, bool mirror) { if (!mirror) { if (degrees == 0) return 0; else if (degrees == 90) return HAL_TRANSFORM_ROT_90; else if (degrees == 180) return HAL_TRANSFORM_ROT_180; else if (degrees == 270) return HAL_TRANSFORM_ROT_270; } else { // Do mirror (horizontal flip) ...
0
25,115
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void region_abort(struct resv_map *resv, long f, long t) { spin_lock(&resv->lock); VM_BUG_ON(!resv->region_cache_count); resv->adds_in_progress--; spin_unlock(&resv->lock); } Commit Message: userfaultfd: hugetlbfs: prevent UFFDIO_COPY to fill beyond the end of i_size This oops: kernel BUG at fs/hu...
0
2,607
Analyze the following 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::OnPasteAndMatchStyle() { if (!webview()) return; base::AutoReset<bool> handling_select_range(&handling_select_range_, true); webview()->focusedFrame()->executeCommand( WebString::fromUTF8("PasteAndMatchStyle")); } Commit Message: Let the browser handle external navigations f...
0
11,958
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: figure_mime( httpd_conn* hc ) { char* prev_dot; char* dot; char* ext; int me_indexes[100], n_me_indexes; size_t ext_len, encodings_len; int i, top, bot, mid; int r; char* default_type = "application/octet-stream"; /* Peel off encoding extensions until there aren't any more...
0
29,632
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int xc2028_set_params(struct dvb_frontend *fe) { struct dtv_frontend_properties *c = &fe->dtv_property_cache; u32 delsys = c->delivery_system; u32 bw = c->bandwidth_hz; struct xc2028_data *priv = fe->tuner_priv; int rc; unsigned int type = 0; u16 demod = 0; tuner_dbg("%s calle...
0
21,399
Analyze the following 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 drm_mode_setcrtc(struct drm_device *dev, void *data, struct drm_file *file_priv) { struct drm_mode_config *config = &dev->mode_config; struct drm_mode_crtc *crtc_req = data; struct drm_mode_object *obj; struct drm_crtc *crtc, *crtcfb; struct drm_connector **connector_set = NULL, *connector; struc...
0
24,239