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: static void derive_permissions_locked(struct fuse* fuse, struct node *parent, struct node *node) { appid_t appid; /* By default, each node inherits from its parent */ node->perm = PERM_INHERIT; node->userid = parent->userid; node->uid = parent->uid; node->under_android = parent->under_android;...
0
160,554
Analyze the following 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 free_thread_info(struct thread_info *ti) { free_memcg_kmem_pages((unsigned long)ti, THREAD_SIZE_ORDER); } Commit Message: userns: Don't allow CLONE_NEWUSER | CLONE_FS Don't allowing sharing the root directory with processes in a different user namespace. There doesn't seem to be any point, ...
0
32,883
Analyze the following 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 StartTracing() { CHECK(trace_log_ == NULL) << "Can only can start tracing once"; trace_log_ = base::trace_event::TraceLog::GetInstance(); base::trace_event::TraceOptions trace_options( base::trace_event::RECORD_UNTIL_FULL); trace_options.enable_sampling = true; trace_log_->SetEn...
0
128,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: DevToolsConfirmInfoBarDelegate::DevToolsConfirmInfoBarDelegate( const InfoBarCallback& callback, const base::string16& message) : ConfirmInfoBarDelegate(), callback_(callback), message_(message) { } Commit Message: DevTools: move front-end URL handling to DevToolsUIBindingds BUG=662859 ...
0
138,296
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: virConnectDomainEventDeregisterAny(virConnectPtr conn, int callbackID) { VIR_DEBUG("conn=%p, callbackID=%d", conn, callbackID); virResetLastError(); virCheckConnectReturn(conn, -1); virCheckNonNegativeArgGoto(callbackID, error); if (conn->driver && conn->d...
0
93,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: v8::Persistent<v8::FunctionTemplate> V8TestObj::GetTemplate() { V8BindingPerIsolateData* data = V8BindingPerIsolateData::current(); V8BindingPerIsolateData::TemplateMap::iterator result = data->templateMap().find(&info); if (result != data->templateMap().end()) return result->second; v8::...
0
109,516
Analyze the following 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 account_idle_ticks(unsigned long ticks) { account_idle_time(jiffies_to_cputime(ticks)); } Commit Message: Sched: fix skip_clock_update optimization idle_balance() drops/retakes rq->lock, leaving the previous task vulnerable to set_tsk_need_resched(). Clear it after we return from balancing instead, and i...
0
22,323
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: M_fs_error_t M_fs_copy(const char *path_old, const char *path_new, M_uint32 mode, M_fs_progress_cb_t cb, M_uint32 progress_flags) { char *norm_path_old; char *norm_path_new; char *join_path_old; char *join_path_new; M_fs_dir_entries_t ...
1
169,141
Analyze the following 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 ip_vs_dst_event(struct notifier_block *this, unsigned long event, void *ptr) { struct net_device *dev = ptr; struct net *net = dev_net(dev); struct netns_ipvs *ipvs = net_ipvs(net); struct ip_vs_service *svc; struct ip_vs_dest *dest; unsigned int idx; if (event != NETDEV_UNREGISTER || !i...
0
34,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: sd_parent_degenerate(struct sched_domain *sd, struct sched_domain *parent) { unsigned long cflags = sd->flags, pflags = parent->flags; if (sd_degenerate(parent)) return 1; if (!cpumask_equal(sched_domain_span(sd), sched_domain_span(parent))) return 0; /* Flags needing groups don't count if only 1 group...
0
55,642
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: DeviceManagerImpl::~DeviceManagerImpl() { } Commit Message: Connect WebUSB client interface to the devices app This provides a basic WebUSB client interface in content/renderer. Most of the interface is unimplemented, but this CL hooks up navigator.usb.getDevices() to the browser's Mojo devices app to enumerate...
0
123,288
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void SyncBackendHost::ConfigureDataTypes( const DataTypeController::TypeMap& data_type_controllers, const syncable::ModelTypeSet& types, sync_api::ConfigureReason reason, CancelableTask* ready_task) { DCHECK(!pending_config_mode_state_.get()); DCHECK(!pending_download_state_.get()); DCHECK(s...
0
101,418
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: htmlInitAutoClose(void) { int indx, i = 0; if (htmlStartCloseIndexinitialized) return; for (indx = 0;indx < 100;indx ++) htmlStartCloseIndex[indx] = NULL; indx = 0; while ((htmlStartClose[i] != NULL) && (indx < 100 - 1)) { htmlStartCloseIndex[indx++] = (const char**) &htmlStartClose[...
0
150,790
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: decompile5Action(int n, SWF_ACTION *actions,int indent) { int j; if( !n ) return NULL; pool = NULL; poolcounter = 0; dcinit(); for(j=0;j<256;j++) regs[j]=0; regs[1] = newVar("R1"); regs[2] = newVar("R2"); regs[3] = newVar("R3"); regs[4] = newVar("R4"); decompileActions(n, actions, indent); #ifde...
0
89,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: static int lo_open(struct block_device *bdev, fmode_t mode) { struct loop_device *lo; int err = 0; mutex_lock(&loop_index_mutex); lo = bdev->bd_disk->private_data; if (!lo) { err = -ENXIO; goto out; } atomic_inc(&lo->lo_refcnt); out: mutex_unlock(&loop_index_mutex); return err; } Commit Message:...
0
84,699
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SPICE_GNUC_VISIBLE int spice_server_add_client(SpiceServer *s, int socket, int skip_auth) { RedLinkInfo *link; RedsStream *stream; spice_assert(reds == s); if (!(link = reds_init_client_connection(socket))) { spice_warning("accept failed"); return -1; } link->skip_auth = ...
0
1,949
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static const struct policy *policyof(const struct in6_addr *a) { int i; for (i=0; ; i++) { if (memcmp(a->s6_addr, defpolicy[i].addr, defpolicy[i].len)) continue; if ((a->s6_addr[defpolicy[i].len] & defpolicy[i].mask) != defpolicy[i].addr[defpolicy[i].len]) continue; return defpolicy+i; } } C...
0
1,804
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: RendererProcessClosedObserver::~RendererProcessClosedObserver() {} Commit Message: Remove TabContents from TabStripModelObserver::TabDetachedAt. BUG=107201 TEST=no visible change Review URL: https://chromiumcodereview.appspot.com/11293205 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167122 0039d316-1c...
0
117,693
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void enabledAtRuntimeAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); TestObjectV8Internal::enabledAtRuntimeAttrAttributeSetter(jsValue, info); TRACE_EVENT_SET_SAM...
0
121,660
Analyze the following 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 s32 brcmf_set_frag(struct net_device *ndev, u32 frag_threshold) { s32 err = 0; err = brcmf_fil_iovar_int_set(netdev_priv(ndev), "fragthresh", frag_threshold); if (err) brcmf_err("Error (%d)\n", err); return err; } Commit Message: brcmfmac: avoid potential stack overflow in brcmf_cfg80211...
0
49,110
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ofproto_set_controllers(struct ofproto *p, const struct ofproto_controller *controllers, size_t n_controllers, uint32_t allowed_versions) { connmgr_set_controllers(p->connmgr, controllers, n_controllers, allowed_versions); } Commit M...
0
77,376
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xdr_gprincs_ret(XDR *xdrs, gprincs_ret *objp) { if (!xdr_ui_4(xdrs, &objp->api_version)) { return (FALSE); } if (!xdr_kadm5_ret_t(xdrs, &objp->code)) { return (FALSE); } if (objp->code == KADM5_OK) { if (!xdr_int(xdrs, &objp->count)) { return (FALSE); } if (!xdr_arr...
0
46,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: static void kvm_mmu_notifier_invalidate_range_start(struct mmu_notifier *mn, struct mm_struct *mm, unsigned long start, unsigned long end) { struct kvm *kvm = mmu_notifier_to_kvm(mn); int need_tlb_flush = 0, idx; idx = srcu_read_lock(&kvm->srcu); spin_lock(&kvm->mmu_lock); /* ...
0
29,089
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: v8::Local<v8::Object> RectToV8Object(v8::Isolate* isolate, const gfx::Rect& rect) { v8::Local<v8::Object> result(v8::Object::New(isolate)); result->Set(CreateV8String(isolate, "left"), v8::Integer::New(isolate, rect.x())); result->Set(CreateV8String(isolate...
0
156,369
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void hid_free_dynids(struct hid_driver *hdrv) { struct hid_dynid *dynid, *n; spin_lock(&hdrv->dyn_lock); list_for_each_entry_safe(dynid, n, &hdrv->dyn_list, list) { list_del(&dynid->list); kfree(dynid); } spin_unlock(&hdrv->dyn_lock); } Commit Message: HID: core: prevent out-of-bound readings P...
0
49,492
Analyze the following 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 sc_card_driver * sc_get_cac_driver(void) { return sc_get_driver(); } Commit Message: fixed out of bounds reads Thanks to Eric Sesterhenn from X41 D-SEC GmbH for reporting and suggesting security fixes. CWE ID: CWE-125
0
78,267
Analyze the following 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 ShelfLayoutManager::AdjustBoundsBasedOnAlignment(int inset, gfx::Rect* bounds) const { switch (alignment_) { case SHELF_ALIGNMENT_BOTTOM: bounds->Inset(gfx::Insets(0, 0, inset, 0)); break; case SHELF_ALIGNMENT_LEFT: bounds->Ins...
0
106,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: g_NPN_InvokeDefault(NPP instance, NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result) { if (!thread_check()) { npw_printf("WARNING: NPN_InvokeDefault not called from the main thread\n"); return false; } if (instance == NULL) return false; PluginInstance *plugin = PLUGIN...
0
27,055
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static char *get_path(const char *url, const char *www_dir) { const char *p; char *res; if (!strlen(url) || !strcmp(url, ".") || !strcmp(url, "/")) p = "/index.html"; else p = url; res = malloc(strlen(www_dir)+strlen(p)+1); strcpy(res, www_dir); strcat(res, p); return res; } Commit Message: CWE ...
0
18,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: struct megasas_cmd *megasas_get_cmd(struct megasas_instance *instance) { unsigned long flags; struct megasas_cmd *cmd = NULL; spin_lock_irqsave(&instance->mfi_pool_lock, flags); if (!list_empty(&instance->cmd_pool)) { cmd = list_entry((&instance->cmd_pool)->next, struct megasas_cmd, list); ...
0
90,348
Analyze the following 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 apparmor_path_chown(struct path *path, uid_t uid, gid_t gid) { struct path_cond cond = { path->dentry->d_inode->i_uid, path->dentry->d_inode->i_mode }; if (!mediated_filesystem(path->dentry->d_inode)) return 0; return common_perm(OP_CHOWN, path, AA_MAY_CHOWN, &cond); } Commit Message: ...
0
34,796
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: iscsi_set_events(IscsiLun *iscsilun) { struct iscsi_context *iscsi = iscsilun->iscsi; int ev = iscsi_which_events(iscsi); if (ev != iscsilun->events) { aio_set_fd_handler(iscsilun->aio_context, iscsi_get_fd(iscsi), false, (ev & POLLIN) ? i...
0
10,527
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static inline int check_mnt(struct mount *mnt) { return mnt->mnt_ns == current->nsproxy->mnt_ns; } Commit Message: vfs: Carefully propogate mounts across user namespaces As a matter of policy MNT_READONLY should not be changable if the original mounter had more privileges than creator of the mount namespace. ...
0
32,330
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void nl80211_send_mgmt_tx_status(struct cfg80211_registered_device *rdev, struct net_device *netdev, u64 cookie, const u8 *buf, size_t len, bool ack, gfp_t gfp) { struct sk_buff *msg; void *hdr; msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); if (!msg) return; hdr = nl80211hdr_put(msg, 0, 0, 0, ...
0
26,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: void AppCacheGroup::AddNewlyDeletableResponseIds( std::vector<int64_t>* response_ids) { if (is_being_deleted() || (!is_obsolete() && old_caches_.empty())) { storage_->DeleteResponses(manifest_url_, *response_ids); response_ids->clear(); return; } if (newly_deletable_response_ids_.empty()) {...
0
145,405
Analyze the following 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 ATSParser::Stream::parse( unsigned continuity_counter, unsigned payload_unit_start_indicator, ABitReader *br, SyncEvent *event) { if (mQueue == NULL) { return OK; } if (mExpectedContinuityCounter >= 0 && (unsigned)mExpectedContinuityCounter != continuity_counter) { ALOGI("discontinuity o...
0
160,495
Analyze the following 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 paintScrollbar(Scrollbar* scrollbar, GraphicsContext& context, const IntRect& clip) { if (!scrollbar) return; context.save(); const IntRect& scrollbarRect = scrollbar->frameRect(); context.translate(-scrollbarRect.x(), -scrollbarRect.y()); IntRect transformedClip = clip; ...
0
113,825
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: _tiffReadProc(thandle_t fd, void* buf, tmsize_t size) { /* tmsize_t is 64bit on 64bit systems, but the WinAPI ReadFile takes * 32bit sizes, so we loop through the data in suitable 32bit sized * chunks */ uint8* ma; uint64 mb; DWORD n; DWORD o; tmsize_t p; ma=(uint8*)buf; mb=size; p=0; while (mb>0) ...
0
86,810
Analyze the following 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 SyncTest::TearDownLocalTestServer() { if (test_server_handle_ != base::kNullProcessHandle) { EXPECT_TRUE(base::KillProcess(test_server_handle_, 0, false)) << "Could not stop local test server."; base::CloseProcessHandle(test_server_handle_); test_server_handle_ = base::kNullProcessHandl...
0
105,068
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: phar_entry_info *phar_get_entry_info(phar_archive_data *phar, char *path, int path_len, char **error, int security) /* {{{ */ { return phar_get_entry_info_dir(phar, path, path_len, 0, error, security); } /* }}} */ Commit Message: Fix bug #72928 - Out of bound when verify signature of zip phar in phar_parse_zipf...
0
49,889
Analyze the following 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::BindAutoplayConfiguration( blink::mojom::AutoplayConfigurationClientAssociatedRequest request) { autoplay_configuration_binding_.Bind( std::move(request), GetTaskRunner(blink::TaskType::kInternalIPC)); } Commit Message: Convert FrameHostMsg_DidAddMessageToConsole to Mojo. Note:...
0
139,515
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SmartScheduleTimer (int sig) { SmartScheduleTime += SmartScheduleInterval; } Commit Message: CWE ID: CWE-362
0
13,363
Analyze the following 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 php_curl_ssl_mutex_lock(void **m) { return tsrm_mutex_lock(*((MUTEX_T *) m)); } Commit Message: CWE ID:
0
5,113
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ps (char *path) { char *copy = xstrdup (path); path_simplify (copy); return copy; } Commit Message: CWE ID: CWE-93
0
8,690
Analyze the following 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 NavigationControllerImpl::GetIndexOfEntry( const NavigationEntryImpl* entry) const { for (size_t i = 0; i < entries_.size(); ++i) { if (entries_[i].get() == entry) return i; } return -1; } Commit Message: Add DumpWithoutCrashing in RendererDidNavigateToExistingPage This is intended to be...
0
137,778
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: user_local_get_shell(User *user) { return user->shell; } Commit Message: CWE ID: CWE-362
0
10,372
Analyze the following 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 x86_pmu_add(struct perf_event *event, int flags) { struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); struct hw_perf_event *hwc; int assign[X86_PMC_IDX_MAX]; int n, n0, ret; hwc = &event->hw; perf_pmu_disable(event->pmu); n0 = cpuc->n_events; ret = n = collect_events(cpuc, event, fal...
0
26,643
Analyze the following 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::HandleMouseUp() { if (delegate_) delegate_->HandleMouseUp(); } Commit Message: Cancel JavaScript dialogs when an interstitial appears. BUG=295695 TEST=See bug for repro steps. Review URL: https://chromiumcodereview.appspot.com/24360011 git-svn-id: svn://svn.chromium.org/chrome/trun...
0
110,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 GLES2DecoderImpl::DoGetTexParameteriv(GLenum target, GLenum pname, GLint* params, GLsizei params_size) { GetTexParameterImpl(target, pname, nullptr, params, "glGetTexParameteriv"...
0
141,330
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void account_shadowed(struct kvm *kvm, gfn_t gfn) { struct kvm_memory_slot *slot; struct kvm_lpage_info *linfo; int i; slot = gfn_to_memslot(kvm, gfn); for (i = PT_DIRECTORY_LEVEL; i < PT_PAGE_TABLE_LEVEL + KVM_NR_PAGE_SIZES; ++i) { linfo = lpage_info_slot(gfn, slot, i); linfo->write_count ...
0
37,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: void WebGL2RenderingContextBase::bindBufferBase(GLenum target, GLuint index, WebGLBuffer* buffer) { if (isContextLost()) return; bool deleted; if (!CheckObjectToBeBound("bindBufferBase", buffer, deleted)) ...
0
133,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 int clean_non_persistent_class(zval *zv) /* {{{ */ { zend_class_entry *ce = Z_PTR_P(zv); return (ce->type == ZEND_INTERNAL_CLASS) ? ZEND_HASH_APPLY_STOP : ZEND_HASH_APPLY_REMOVE; } /* }}} */ Commit Message: Use format string CWE ID: CWE-134
0
57,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: int CMSEXPORT cmsIT8FindDataFormat(cmsHANDLE hIT8, const char* cSample) { cmsIT8* it8 = (cmsIT8*) hIT8; _cmsAssert(hIT8 != NULL); return LocateSample(it8, cSample); } Commit Message: Upgrade Visual studio 2017 15.8 - Upgrade to 15.8 - Add check on CGATS memory allocation (thanks to Quang Nguyen fo...
0
78,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: void registerErrorURL(const char* file, int statusCode) { WebURLError error; error.reason = 0xdead + statusCode; error.domain = "PageSerializerTest"; WebURLResponse response; response.initialize(); response.setMIMEType("text/html"); response.setHTT...
0
118,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: void ServiceWorkerHandler::OnErrorReported( int64_t registration_id, int64_t version_id, const ServiceWorkerContextCoreObserver::ErrorInfo& info) { frontend_->WorkerErrorReported( ServiceWorker::ServiceWorkerErrorMessage::Create() .SetErrorMessage(base::UTF16ToUTF8(info.error_message...
0
148,602
Analyze the following 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 bit_reverse(unsigned int n) { n = ((n & 0xAAAAAAAA) >> 1) | ((n & 0x55555555) << 1); n = ((n & 0xCCCCCCCC) >> 2) | ((n & 0x33333333) << 2); n = ((n & 0xF0F0F0F0) >> 4) | ((n & 0x0F0F0F0F) << 4); n = ((n & 0xFF00FF00) >> 8) | ((n & 0x00FF00FF) << 8); return (n >> 16) | (n << 16); ...
0
75,233
Analyze the following 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 SetUpCommandLine(CommandLine* command_line) { ExtensionApiTest::SetUpCommandLine(command_line); command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); } Commit Message: Extend TTS extension API to support richer events returned from the engine to the client. Previously w...
0
99,681
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void _cgsem_init(cgsem_t *cgsem, const char *file, const char *func, const int line) { int ret; if ((ret = sem_init(cgsem, 0, 0))) quitfrom(1, file, func, line, "Failed to sem_init ret=%d errno=%d", ret, errno); } Commit Message: stratum: parse_notify(): Don't die on malformed bbversion/prev_hash/nbit/ntime....
0
36,548
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: queue_expected_reply (ProxySide *side, guint32 serial, ExpectedReplyType type) { g_hash_table_replace (side->expected_replies, GUINT_TO_POINTER (serial), GUINT_TO_POINTER (type)); } Commit Message: Fix vulnerability in dbus proxy During the authentication all cl...
0
84,418
Analyze the following 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 ehci_queues_rip_unused(EHCIState *ehci, int async) { EHCIQueueHead *head = async ? &ehci->aqueues : &ehci->pqueues; const char *warn = async ? "guest unlinked busy QH" : NULL; uint64_t maxage = FRAME_TIMER_NS * ehci->maxframes * 4; EHCIQueue *q, *tmp; QTAILQ_FOREACH_SAFE(q, head, ...
0
5,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: static int snd_seq_ioctl_get_subscription(struct snd_seq_client *client, void __user *arg) { int result; struct snd_seq_client *sender = NULL; struct snd_seq_client_port *sport = NULL; struct snd_seq_port_subscribe subs; struct snd_seq_subscribers *p; if (copy_from_user(&subs, arg, sizeof(subs))) ...
0
54,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: void WebLocalFrameImpl::PostPausableTask(PausableTaskCallback callback) { DCHECK(GetFrame()); Document* document = GetFrame()->GetDocument(); DCHECK(document); PausableTask::Post(document, std::move(callback)); } Commit Message: Do not forward resource timing to parent frame after back-forward navigation...
0
145,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: free_CodersInfo(struct _7z_coders_info *ci) { unsigned i; if (ci->folders) { for (i = 0; i < ci->numFolders; i++) free_Folder(&(ci->folders[i])); free(ci->folders); } } Commit Message: Issue #718: Fix TALOS-CAN-152 If a 7-Zip archive declares a rediculously large number of substreams, it can overflow...
0
53,548
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: archive_read_support_format_rar(struct archive *_a) { struct archive_read *a = (struct archive_read *)_a; struct rar *rar; int r; archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW, "archive_read_support_format_rar"); rar = (struct rar *)calloc(sizeof(*rar), 1); if (...
0
61,222
Analyze the following 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 int32 TIFFReadPixels(TIFF *tiff,const tsample_t sample,const ssize_t row, tdata_t scanline) { int32 status; status=TIFFReadScanline(tiff,scanline,(uint32) row,sample); return(status); } Commit Message: Fixed possible memory leak reported in #1206 CWE ID: CWE-772
0
77,987
Analyze the following 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 ssh_do_close(Ssh ssh, int notify_exit) { int ret = 0; struct ssh_channel *c; ssh->state = SSH_STATE_CLOSED; expire_timer_context(ssh); if (ssh->s) { sk_close(ssh->s); ssh->s = NULL; if (notify_exit) notify_remote_exit(ssh->frontend); else...
0
8,563
Analyze the following 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 RenderLayerCompositor::requiresCompositingForBackfaceVisibilityHidden(RenderObject* renderer) const { return canRender3DTransforms() && renderer->style()->backfaceVisibility() == BackfaceVisibilityHidden; } Commit Message: Disable some more query compositingState asserts. This gets the tests passing ag...
0
113,836
Analyze the following 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_size (guint8 * ptr, guint8 ** end) { int count = 4; int len = 0; while (count--) { int c = *ptr; ptr++; len = (len << 7) | (c & 0x7f); if (!(c & 0x80)) break; } if (end) *end = ptr; return len; } Commit Message: CWE ID: CWE-119
0
4,926
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void LockContentsView::OnUsersChanged( const std::vector<mojom::LoginUserInfoPtr>& users) { main_view_->RemoveAllChildViews(true /*delete_children*/); opt_secondary_big_view_ = nullptr; users_list_ = nullptr; rotation_actions_.clear(); users_.clear(); if (users.empty()) { LOG_IF(FATAL, screen...
1
172,197
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: content::WebContents* PrintingMessageFilter::GetWebContentsForRenderView( int render_view_id) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); content::RenderViewHost* view = content::RenderViewHost::FromID( render_process_id_, render_view_id); return content::WebContents::FromRenderViewHo...
0
105,779
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: channel_register_fds(Channel *c, int rfd, int wfd, int efd, int extusage, int nonblock, int is_tty) { /* Update the maximum file descriptor value. */ channel_max_fd = MAX(channel_max_fd, rfd); channel_max_fd = MAX(channel_max_fd, wfd); channel_max_fd = MAX(channel_max_fd, efd); if (rfd != -1) fcntl(rf...
0
2,255
Analyze the following 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_tcp_getsockopt(struct sock *sk, int level, int optname, char __user *optval, int __user *optlen) { struct inet_connection_sock *icsk = inet_csk(sk); struct tcp_sock *tp = tcp_sk(sk); struct net *net = sock_net(sk); int val, len; if (get_user(len, optlen)) return -EFAULT; len = min_t(unsi...
0
61,725
Analyze the following 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 ipv4_offload_init(void) { /* * Add offloads */ if (udpv4_offload_init() < 0) pr_crit("%s: Cannot add UDP protocol offload\n", __func__); if (tcpv4_offload_init() < 0) pr_crit("%s: Cannot add TCP protocol offload\n", __func__); dev_add_offload(&ip_packet_offload); inet_add_offload(&...
0
41,549
Analyze the following 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 DisplaySourceCustomBindings::Invalidate() { session_map_.clear(); weak_factory_.InvalidateWeakPtrs(); ObjectBackedNativeHandler::Invalidate(); } Commit Message: [Extensions] Expand bindings access checks BUG=601149 BUG=601073 Review URL: https://codereview.chromium.org/1866103002 Cr-Commit-Position...
0
132,592
Analyze the following 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 HistoryQuickProvider::Start(const AutocompleteInput& input, bool minimal_changes) { matches_.clear(); if (disabled_) return; if ((input.type() == AutocompleteInput::INVALID) || (input.type() == AutocompleteInput::FORCED_QUERY) || (input.matches_requeste...
0
108,130
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: privsep_preauth_child(void) { gid_t gidset[1]; struct passwd *pw; /* Enable challenge-response authentication for privilege separation */ privsep_challenge_enable(); #ifdef GSSAPI /* Cache supported mechanism OIDs for later use */ if (options.gss_authentication) ssh_gssapi_prepare_supported_oids(); #end...
0
72,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: ExtensionsUpdatedObserver::~ExtensionsUpdatedObserver() { } Commit Message: Remove TabContents from TabStripModelObserver::TabDetachedAt. BUG=107201 TEST=no visible change Review URL: https://chromiumcodereview.appspot.com/11293205 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167122 0039d316-1c4b-4281...
0
117,675
Analyze the following 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 Type_LUT8_Free(struct _cms_typehandler_struct* self, void* Ptr) { cmsPipelineFree((cmsPipeline*) Ptr); return; cmsUNUSED_PARAMETER(self); } Commit Message: Added an extra check to MLU bounds Thanks to Ibrahim el-sayed for spotting the bug CWE ID: CWE-125
0
71,001
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void WebTransformOperations::appendSkew(double x, double y) { WebTransformOperation toAdd; toAdd.matrix.skewX(x); toAdd.matrix.skewY(y); toAdd.type = WebTransformOperation::WebTransformOperationSkew; toAdd.skew.x = x; toAdd.skew.y = y; m_private->operations.append(toAdd); } Commit Mes...
0
108,165
Analyze the following 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 IsResourceLoadUserInteractionInputType(blink::WebInputEvent::Type type) { return type == blink::WebInputEvent::kMouseDown || type == blink::WebInputEvent::kTouchStart || type == blink::WebInputEvent::kRawKeyDown; } Commit Message: Prevent renderer initiated back navigation to cancel a br...
0
144,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: static PassRefPtr<Image> ImageFromNode(const Node& node) { DCHECK(!node.GetDocument().NeedsLayoutTreeUpdate()); DocumentLifecycle::DisallowTransitionScope disallow_transition( node.GetDocument().Lifecycle()); LayoutObject* layout_object = node.GetLayoutObject(); if (!layout_object) return nullp...
0
128,469
Analyze the following 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 vop_init_device_ctrl(struct vop_vdev *vdev, struct mic_device_desc *devpage) { struct mic_device_ctrl *dc; dc = (void *)devpage + mic_aligned_desc_size(devpage); dc->config_change = 0; dc->guest_ack = 0; dc->vdev_reset = 0; dc->host_ack = 0; dc->used_address_updated = 0; dc->c2h_vdev_db...
0
51,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: void V4L2JpegEncodeAccelerator::EncodedInstanceDmaBuf::Dequeue() { DCHECK(parent_->encoder_task_runner_->BelongsToCurrentThread()); struct v4l2_buffer dqbuf; struct v4l2_plane planes[kMaxNV12Plane]; while (InputBufferQueuedCount() > 0) { DCHECK(input_streamon_); memset(&dqbuf, 0, sizeof(dqbuf)); ...
0
136,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: PluginInfoMessageFilter::Context::Context() : render_process_id_(0), resource_context_(NULL), host_content_settings_map_(NULL) { } Commit Message: Handle crashing Pepper plug-ins the same as crashing NPAPI plug-ins. BUG=151895 Review URL: https://chromiumcodereview.appspot.com/10956065 git-svn...
0
103,129
Analyze the following 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 TabletModeWindowManager::GetNumberOfManagedWindows() { return window_state_map_.size(); } Commit Message: Fix the crash after clamshell -> tablet transition in overview mode. This CL just reverted some changes that were made in https://chromium-review.googlesource.com/c/chromium/src/+/1658955. In that CL...
0
137,527
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int inet_rtm_newroute(struct sk_buff *skb, struct nlmsghdr *nlh) { struct net *net = sock_net(skb->sk); struct fib_config cfg; struct fib_table *tb; int err; err = rtm_to_fib_config(net, skb, nlh, &cfg); if (err < 0) goto errout; tb = fib_new_table(net, cfg.fc_table); if (!tb) { err = -ENOBUF...
0
54,136
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: fpDiff(TIFF* tif, uint8* cp0, tmsize_t cc) { tmsize_t stride = PredictorState(tif)->stride; uint32 bps = tif->tif_dir.td_bitspersample / 8; tmsize_t wc = cc / bps; tmsize_t count; uint8 *cp = (uint8 *) cp0; uint8 *tmp = (uint8 *)_TIFFmalloc(cc); if((cc%(bps*stride))!=0) { TIFFErrorEx...
1
169,939
Analyze the following 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 Handle<Object> GetImpl(Handle<JSObject> holder, uint32_t entry) { Isolate* isolate = holder->GetIsolate(); Handle<String> string(GetString(*holder), isolate); uint32_t length = static_cast<uint32_t>(string->length()); if (entry < length) { return isolate->factory()->LookupSingleCharacterStringFromCod...
0
163,108
Analyze the following 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 WebContentsAndroid::ResumeResponseDeferredAtStart(JNIEnv* env, jobject obj) { static_cast<WebContentsImpl*>(web_contents_)->ResumeResponseDeferredAtStart(); } Commit Message: Revert "Load web contents after tab is created." This reverts commit 4c55f3...
0
109,899
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SSL_SESSION *SSL_get1_session(SSL *ssl) /* variant of SSL_get_session: caller really gets something */ { SSL_SESSION *sess; /* * Need to lock this all up rather than just use CRYPTO_add so that * somebody doesn't free ssl->session between when we check it's non-null * and when we up the ref...
0
12,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 ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame) { return ff_init_buffer_info(avctx, frame); } Commit Message: avcodec/utils: correct align value for interplay Fixes out of array access Fixes: 452/fuzz-1-ffmpeg_VIDEO_AV_CODEC_ID_INTERPLAY_VIDEO_fuzzer Found-by: continuous fuzzing process ht...
0
67,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: mm_auth_rsa_generate_challenge(Key *key) { Buffer m; BIGNUM *challenge; u_char *blob; u_int blen; debug3("%s entering", __func__); if ((challenge = BN_new()) == NULL) fatal("%s: BN_new failed", __func__); key->type = KEY_RSA; /* XXX cheat for key_to_blob */ if (key_to_blob(key, &blob, &blen) == 0)...
0
42,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: static uint32_t PushImpl(Handle<JSArray> receiver, Arguments* args, uint32_t push_size) { Handle<FixedArrayBase> backing_store(receiver->elements()); return Subclass::AddArguments(receiver, backing_store, args, push_size, AT_END); } Commit Message: Backport: Fix Object.entr...
0
163,164
Analyze the following 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 PolicyKitBackend::checkForResultChanged() { QHash<QString, Action::AuthStatus>::iterator i; for (i = m_cachedResults.begin(); i != m_cachedResults.end(); ++i) { if (i.value() != actionStatus(i.key())) { i.value() = actionStatus(i.key()); emit actionStatusChanged(i.key(...
0
7,197
Analyze the following 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 kvm_guest_time_update(struct kvm_vcpu *v) { unsigned long flags, this_tsc_khz; struct kvm_vcpu_arch *vcpu = &v->arch; struct kvm_arch *ka = &v->kvm->arch; s64 kernel_ns; u64 tsc_timestamp, host_tsc; struct pvclock_vcpu_time_info guest_hv_clock; u8 pvclock_flags; bool use_master_clock; kernel_...
0
35,792
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: DocumentInit& DocumentInit::WithURL(const KURL& url) { DCHECK(url_.IsNull()); url_ = url; return *this; } Commit Message: Inherit CSP when self-navigating to local-scheme URL As the linked bug example shows, we should inherit CSP when we navigate to a local-scheme URL (even if we are in a main browsing co...
0
144,081
Analyze the following 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_file_attributes (char const *to, enum file_attributes attr, char const *from, struct stat *st, mode_t mode, struct timespec *new_time) { if (attr & FA_TIMES) { struct timespec times[2]; if (new_time) times[0] = times[1] = *new_time; else { times[0] = get_stat_...
0
5,666
Analyze the following 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 copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src, struct vm_area_struct *vma) { pte_t *src_pte, *dst_pte, entry, dst_entry; struct page *ptepage; unsigned long addr; int cow; struct hstate *h = hstate_vma(vma); unsigned long sz = huge_page_size(h); struct mmu_notifier_range r...
0
96,987
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: hfs_block_is_alloc(HFS_INFO * hfs, TSK_DADDR_T a_addr) { TSK_FS_INFO *fs = &(hfs->fs_info); TSK_OFF_T b; size_t b2; if (hfs->blockmap_file == NULL) { if ((hfs->blockmap_file = tsk_fs_file_open_meta(fs, NULL, HFS_ALLOCATION_FILE_ID)) == NULL) { ...
0
75,673
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Strclear(Str s) { s->length = 0; s->ptr[0] = '\0'; } Commit Message: Merge pull request #27 from kcwu/fix-strgrow Fix potential heap buffer corruption due to Strgrow CWE ID: CWE-119
0
48,419