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: void SetOnAuthRequired( const base::Callback<void(SocketStreamEvent*)>& callback) { on_auth_required_ = callback; } Commit Message: Revert a workaround commit for a Use-After-Free crash. Revert a workaround commit r20158 for a Use-After-Free issue (http://crbug.com/244746) because a cleaner CL r20...
0
22,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: void ArthurOutputDev::fill(GfxState *state) { m_painter->fillPath( convertPath( state, state->getPath(), Qt::WindingFill ), m_currentBrush ); } Commit Message: CWE ID: CWE-189
0
24,719
Analyze the following 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 index_entry_create( git_index_entry **out, git_repository *repo, const char *path, bool from_workdir) { size_t pathlen = strlen(path), alloclen; struct entry_internal *entry; unsigned int path_valid_flags = GIT_PATH_REJECT_INDEX_DEFAULTS; /* always reject placing `.git` in the index and direct...
0
29,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: off_t size_autodetect(int fhandle) { off_t es; u64 bytes; struct stat stat_buf; int error; #ifdef HAVE_SYS_MOUNT_H #ifdef HAVE_SYS_IOCTL_H #ifdef BLKGETSIZE64 DEBUG("looking for export size with ioctl BLKGETSIZE64\n"); if (!ioctl(fhandle, BLKGETSIZE64, &bytes) && bytes) { return (off_t)bytes; } #endif /...
0
28,329
Analyze the following 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 bn_GF2m_mul_1x1(BN_ULONG *r1, BN_ULONG *r0, const BN_ULONG a, const BN_ULONG b) { register BN_ULONG h, l, s; BN_ULONG tab[16], top3b = a >> 61; register BN_ULONG a1, a2, a4, a8; a1 = a & (0x1FFFFFFFFFFFFFFFULL); a2 = a1 << 1; a4 = a2 << 1; a8 = ...
0
1,835
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: test_path_simplify (void) { static const struct { const char *test, *result; enum url_scheme scheme; bool should_modify; } tests[] = { { "", "", SCHEME_HTTP, false }, { ".", "", SCHEME_HTTP, true }, { "./", ...
0
18,032
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int dm_grab_bdev_for_ioctl(struct mapped_device *md, struct block_device **bdev, fmode_t *mode) { struct dm_target *tgt; struct dm_table *map; int srcu_idx, r; retry: r = -ENOTTY; map = dm_get_live_table(md, &srcu_idx); if (!map || !dm_table_get_size(map)) goto out; /* We only suppor...
0
16,875
Analyze the following 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 server_connect_callback_readpipe(SERVER_REC *server) { RESOLVED_IP_REC iprec; IPADDR *ip; const char *errormsg; char *servername = NULL; g_source_remove(server->connect_tag); server->connect_tag = -1; net_gethostbyname_return(server->connect_pipe[0], &iprec); g_io_channel_close(serve...
0
15,059
Analyze the following 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 sk_sp<SkImage> premulSkImageToUnPremul(SkImage* input) { SkImageInfo info = SkImageInfo::Make(input->width(), input->height(), kN32_SkColorType, kUnpremul_SkAlphaType); RefPtr<Uint8Array> dstPixels = copySkImageData(input, info); if (!dstPixels) return null...
1
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 limitedWithMissingDefaultAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; TestObjec...
0
25,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: base::Optional<download::DownloadEntry> DownloadManagerImpl::GetInProgressEntry( download::DownloadItemImpl* download) { return in_progress_manager_->GetInProgressEntry(download); } Commit Message: Early return if a download Id is already used when creating a download This is protect against download Id o...
0
9,102
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void srpt_release_channel_work(struct work_struct *w) { struct srpt_rdma_ch *ch; struct srpt_device *sdev; struct se_session *se_sess; ch = container_of(w, struct srpt_rdma_ch, release_work); pr_debug("ch = %p; ch->sess = %p; release_done = %p\n", ch, ch->sess, ch->release_done); sdev = ch->spor...
0
17,701
Analyze the following 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 RenderWidgetHostImpl::AccessibilityScrollToPoint( int acc_obj_id, gfx::Point point) { Send(new AccessibilityMsg_ScrollToPoint( GetRoutingID(), acc_obj_id, point)); } Commit Message: Implement TextureImageTransportSurface using texture mailbox This has a couple of advantages: - allow tearing dow...
0
14,730
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool IsZipArchiverUnpackerEnabled() { return !base::CommandLine::ForCurrentProcess()->HasSwitch( kDisableZipArchiverUnpacker); } Commit Message: Add a fake DriveFS launcher client. Using DriveFS requires building and deploying ChromeOS. Add a client for the fake DriveFS launcher to allow the use of a re...
0
20,530
Analyze the following 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
14,017
Analyze the following 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 cac_apdu_io(sc_card_t *card, int ins, int p1, int p2, const u8 * sendbuf, size_t sendbuflen, u8 ** recvbuf, size_t * recvbuflen) { int r; sc_apdu_t apdu; u8 rbufinitbuf[CAC_MAX_SIZE]; u8 *rbuf; size_t rbuflen; unsigned int apdu_case = SC_APDU_CASE_1; SC_FUNC_CALLED(card->ctx, SC_LOG_DEBUG_VE...
0
24,366
Analyze the following 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 AppListControllerDelegate::UninstallApp(Profile* profile, const std::string& app_id) { ExtensionUninstaller* uninstaller = new ExtensionUninstaller(profile, app_id, this); uninstaller->Run(); } Commit Message: [Extensions] Add GetInstalledExtension() me...
0
13,907
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: error::Error GLES2DecoderImpl::HandleTexSubImage2DImmediate( uint32 immediate_data_size, const gles2::TexSubImage2DImmediate& c) { GLboolean internal = static_cast<GLboolean>(c.internal); if (internal == GL_TRUE && tex_image_2d_failed_) return error::kNoError; GLenum target = static_cast<GLenum>(c....
0
23,205
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void FrameLoader::DidExplicitOpen() { if (!state_machine_.CommittedFirstRealDocumentLoad()) state_machine_.AdvanceTo(FrameLoaderStateMachine::kCommittedFirstRealLoad); if (Frame* parent = frame_->Tree().Parent()) { if ((parent->IsLocalFrame() && ToLocalFrame(parent)->GetDocument()->LoadEvent...
0
18,713
Analyze the following 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 DevToolsDownloadManagerDelegate::ShouldOpenDownload( content::DownloadItem* item, const content::DownloadOpenDelayedCallback& callback) { DevToolsDownloadManagerHelper* download_helper = DevToolsDownloadManagerHelper::FromWebContents(item->GetWebContents()); if (download_helper) return...
0
23,105
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: HTMLFormControlElement* HTMLFormControlElement::enclosingFormControlElement(Node* node) { for (; node; node = node->parentNode()) { if (node->isElementNode() && toElement(node)->isFormControlElement()) return toHTMLFormControlElement(node); } return 0; } Commit Message: Add HTMLFo...
0
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: Node* HTMLFormElement::elementFromPastNamesMap(const AtomicString& pastName) const { if (pastName.isEmpty() || !m_pastNamesMap) return 0; Node* node = m_pastNamesMap->get(pastName.impl()); #if !ASSERT_DISABLED if (!node) return 0; ASSERT_WITH_SECURITY_IMPLICATION(toHTMLElement(node...
0
15,355
Analyze the following 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 venc_dev::venc_set_extradata(OMX_U32 extra_data, OMX_BOOL enable) { struct v4l2_control control; DEBUG_PRINT_HIGH("venc_set_extradata:: %x", (int) extra_data); if (enable == OMX_FALSE) { /* No easy way to turn off extradata to the driver * at the moment */ return false; } control.id ...
0
29,539
Analyze the following 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 frame_worker_hook(void *arg1, void *arg2) { FrameWorkerData *const frame_worker_data = (FrameWorkerData *)arg1; const uint8_t *data = frame_worker_data->data; (void)arg2; frame_worker_data->result = vp9_receive_compressed_data(frame_worker_data->pbi, frame_...
0
12,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: ViewMsg_Navigate_Type::Value GetNavigationType( BrowserContext* browser_context, const NavigationEntryImpl& entry, NavigationController::ReloadType reload_type) { switch (reload_type) { case NavigationControllerImpl::RELOAD: return ViewMsg_Navigate_Type::RELOAD; case NavigationControllerIm...
0
3,809
Analyze the following 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 __vmx_load_host_state(struct vcpu_vmx *vmx) { if (!vmx->host_state.loaded) return; ++vmx->vcpu.stat.host_state_reload; vmx->host_state.loaded = 0; #ifdef CONFIG_X86_64 if (is_long_mode(&vmx->vcpu)) rdmsrl(MSR_KERNEL_GS_BASE, vmx->msr_guest_kernel_gs_base); #endif if (vmx->host_state.gs_ldt_r...
0
564
Analyze the following 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 fm10k_qv_enable(struct fm10k_q_vector *q_vector) { /* Enable auto-mask and clear the current mask */ u32 itr = FM10K_ITR_ENABLE; /* Update Tx ITR */ fm10k_update_itr(&q_vector->tx); /* Update Rx ITR */ fm10k_update_itr(&q_vector->rx); /* Store Tx itr in timer slot 0 */ itr |= (q_vector->tx....
0
20,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: PPVarArrayFromNPVariantArray::PPVarArrayFromNPVariantArray( PluginInstance* instance, size_t size, const NPVariant* variants) : size_(size) { if (size_ > 0) { array_.reset(new PP_Var[size_]); for (size_t i = 0; i < size_; i++) array_[i] = Var::NPVariantToPPVar(instance, &variants[i...
0
10,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: static struct ctl_table *find_entry(struct ctl_table_header **phead, struct ctl_dir *dir, const char *name, int namelen) { struct ctl_table_header *head; struct ctl_table *entry; struct rb_node *node = dir->root.rb_node; while (node) { struct ctl_node *ctl_node; const char *procname; int cmp; ctl_...
0
10,557
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void WebContentsImpl::SystemDragEnded() { if (GetRenderViewHost()) GetRenderViewHost()->DragSourceSystemDragEnded(); if (browser_plugin_embedder_.get()) browser_plugin_embedder_->SystemDragEnded(); } Commit Message: Don't call WebContents::DownloadImage() callback if the WebContents were deleted BUG...
0
15,449
Analyze the following 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 ap_query_configuration(void) { #ifdef CONFIG_64BIT if (ap_configuration_available()) { if (!ap_configuration) ap_configuration = kzalloc(sizeof(struct ap_config_info), GFP_KERNEL); if (ap_configuration) __ap_query_configuration(ap_configuration); } else ap_configuration = NULL; ...
0
26,521
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: base::Optional<WebGestureEvent> GetAndResetLastForwardedGestureEvent() { base::Optional<WebGestureEvent> ret; last_forwarded_gesture_event_.swap(ret); return ret; } Commit Message: Start rendering timer after first navigation Currently the new content rendering timer in the browser process, whic...
0
6,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: ui::AXTreeIDRegistry::AXTreeID RenderFrameHostImpl::RoutingIDToAXTreeID( int routing_id) { RenderFrameHostImpl* rfh = nullptr; RenderFrameProxyHost* rfph = nullptr; LookupRenderFrameHostOrProxy(GetProcess()->GetID(), routing_id, &rfh, &rfph); if (rfph) { rfh = rfph->frame_tree_node()->current_fram...
0
2,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: static const ut8 *r_bin_dwarf_parse_attr_value(const ut8 *obuf, int obuf_len, RBinDwarfAttrSpec *spec, RBinDwarfAttrValue *value, const RBinDwarfCompUnitHdr *hdr, const ut8 *debug_str, size_t debug_str_len) { const ut8 *buf = obuf; const ut8 *buf_end = obuf + obuf_len; size_t j; if (!spec || !value ...
1
3,940
Analyze the following 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 *_unescape_lf(char *str) { char *c, *p = str; gsize len = 0; while ((c = strchr(p, '\\')) != NULL) { if (p != &str[len]) memmove(&str[len], p, c - p); len += (c - p); if (c[1] == 'n') { str[len++] = '\n'; c++; ...
0
27,794
Analyze the following 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 ne2000_buffer_full(NE2000State *s) { int avail, index, boundary; index = s->curpag << 8; boundary = s->boundary << 8; if (index < boundary) return 1; return 0; } Commit Message: CWE ID: CWE-20
1
13,101
Analyze the following 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::ForwardMessageToPortalHost( blink::TransferableMessage message, const url::Origin& source_origin, const base::Optional<url::Origin>& target_origin) { frame_->ForwardMessageToPortalHost(std::move(message), source_origin, target_origin); } Co...
0
25,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: static int really_register_bound_param(struct pdo_bound_param_data *param, pdo_stmt_t *stmt, int is_param TSRMLS_DC) /* {{{ */ { HashTable *hash; struct pdo_bound_param_data *pparam = NULL; hash = is_param ? stmt->bound_params : stmt->bound_columns; if (!hash) { ALLOC_HASHTABLE(hash); zend_hash_init(has...
0
2,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: toomany(struct magic_set *ms, const char *name, uint16_t num) { if (file_printf(ms, ", too many %s header sections (%u)", name, num ) == -1) return -1; return 0; } Commit Message: Stop reporting bad capabilities after the first few. CWE ID: CWE-399
0
17,921
Analyze the following 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::Handle<v8::Value> optionsObjectCallback(const v8::Arguments& args) { INC_STATS("DOM.TestObj.optionsObject"); if (args.Length() < 1) return V8Proxy::throwNotEnoughArgumentsError(); TestObj* imp = V8TestObj::toNative(args.Holder()); EXCEPTION_BLOCK(Dictionary, oo, MAYBE_MISSI...
1
29,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: bool brcmf_cfg80211_vif_event_armed(struct brcmf_cfg80211_info *cfg) { struct brcmf_cfg80211_vif_event *event = &cfg->vif_event; bool armed; spin_lock(&event->vif_event_lock); armed = event->vif != NULL; spin_unlock(&event->vif_event_lock); return armed; } Commit Message: brcmfmac: avoid potential stack ...
0
27,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: int HttpBridge::GetResponseContentLength() const { DCHECK_EQ(MessageLoop::current(), created_on_loop_); base::AutoLock lock(fetch_state_lock_); DCHECK(fetch_state_.request_completed); return fetch_state_.response_content.size(); } Commit Message: Use URLFetcher::Create instead of new in http_bridge.cc. ...
0
18,942
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gio_read_socket (GIOChannel *gio, GIOCondition condition, gpointer data) { struct gio_to_qb_poll *adaptor = (struct gio_to_qb_poll *)data; gint fd = g_io_channel_unix_get_fd(gio); crm_trace("%p.%d %d (ref=%d)", data, fd, condition, gio_adapter_refcount(adaptor)); if(condition & G_IO_NVAL) { ...
0
27,761
Analyze the following 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 AppCacheDatabase::InsertGroup(const GroupRecord* record) { if (!LazyOpen(kCreateIfNeeded)) return false; static const char kSql[] = "INSERT INTO Groups" " (group_id, origin, manifest_url, creation_time, last_access_time," " last_full_update_check_time, first_evictable_error_time...
0
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: static int do_page_mkwrite(struct vm_area_struct *vma, struct page *page, unsigned long address) { struct vm_fault vmf; int ret; vmf.virtual_address = (void __user *)(address & PAGE_MASK); vmf.pgoff = page->index; vmf.flags = FAULT_FLAG_WRITE|FAULT_FLAG_MKWRITE; vmf.page = page; vmf.cow_page = NUL...
0
1,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: void account_user_time(struct task_struct *p, cputime_t cputime, cputime_t cputime_scaled) { struct cpu_usage_stat *cpustat = &kstat_this_cpu.cpustat; cputime64_t tmp; /* Add user time to process. */ p->utime = cputime_add(p->utime, cputime); p->utimescaled = cputime_add(p->utimescaled, cputime_sca...
0
14,010
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static __net_init int net_ns_net_init(struct net *net) { #ifdef CONFIG_NET_NS net->ns.ops = &netns_operations; #endif return ns_alloc_inum(&net->ns); } Commit Message: net: Fix double free and memory corruption in get_net_ns_by_id() (I can trivially verify that that idr_remove in cleanup_net happens after th...
0
19,274
Analyze the following 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 WebPagePrivate::shouldPluginEnterFullScreen(PluginView* plugin, const char* windowUniquePrefix) { return m_client->shouldPluginEnterFullScreen(); } Commit Message: [BlackBerry] Adapt to new BlackBerry::Platform::TouchPoint API https://bugs.webkit.org/show_bug.cgi?id=105143 RIM PR 171941 Reviewed by Rob...
0
3,427
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: AP_DECLARE(apr_size_t) ap_send_mmap(apr_mmap_t *mm, request_rec *r, apr_size_t offset, apr_size_t length) { conn_rec *c = r->connection; apr_bucket_brigade *bb = NULL; apr_bucket *b; bb = a...
0
1,062
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void ExtensionDevToolsClientHost::SendMessageToBackend( DebuggerSendCommandFunction* function, const std::string& method, SendCommand::Params::CommandParams* command_params) { base::DictionaryValue protocol_request; int request_id = ++last_request_id_; pending_requests_[request_id] = function; ...
0
2,600
Analyze the following 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 WebGLRenderingContextBase::TexImageBitmapByGPU( ImageBitmap* bitmap, GLenum target, GLuint target_texture, GLint xoffset, GLint yoffset, const IntRect& source_sub_rect) { bitmap->BitmapImage()->CopyToTexture( GetDrawingBuffer()->ContextProvider()->ContextGL(), target, ta...
0
28,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: RegistrationDeletionListener( scoped_refptr<ServiceWorkerRegistration> registration, base::OnceClosure callback) : registration_(std::move(registration)), callback_(std::move(callback)) {} Commit Message: Convert FrameHostMsg_DidAddMessageToConsole to Mojo. Note: Since this required ...
0
27,268
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static inline u8 ip6_frag_ecn(const struct ipv6hdr *ipv6h) { return 1 << (ipv6_get_dsfield(ipv6h) & INET_ECN_MASK); } Commit Message: netfilter: ipv6: nf_defrag: drop mangled skb on ream error Dmitry Vyukov reported GPF in network stack that Andrey traced down to negative nh offset in nf_ct_frag6_queue(). Pro...
0
20,977
Analyze the following 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 brcmf_internal_escan_add_info(struct cfg80211_scan_request *req, u8 *ssid, u8 ssid_len, u8 channel) { struct ieee80211_channel *chan; enum nl80211_band band; int freq, i; if (channel <= CH_MAX_2G_CHANNEL) band = NL80211_BAND_2GHZ; else band = NL80211_BAND_5GHZ; freq = ieee80211_channe...
0
8,356
Analyze the following 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 opj_bool pi_next_pcrl(opj_pi_iterator_t * pi) { opj_pi_comp_t *comp = NULL; opj_pi_resolution_t *res = NULL; long index = 0; if (!pi->first) { comp = &pi->comps[pi->compno]; goto LABEL_SKIP; } else { int compno, resno; pi->first = 0; pi->dx = 0; ...
1
13,692
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void Element::setChildrenAffectedByFirstChildRules() { ensureElementRareData()->setChildrenAffectedByFirstChildRules(true); } Commit Message: Set Attr.ownerDocument in Element#setAttributeNode() Attr objects can move across documents by setAttributeNode(). So It needs to reset ownerDocument through TreeScop...
0
20,758
Analyze the following 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 vfat_build_slots(struct inode *dir, const unsigned char *name, int len, int is_dir, int cluster, struct timespec *ts, struct msdos_dir_slot *slots, int *nr_slots) { struct msdos_sb_info *sbi = MSDOS_SB(dir->i_sb); struct fat_mount_options *opts = &sbi->options; struct msdos_dir_...
0
26,900
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: status_t ACodec::setupAMRCodec(bool encoder, bool isWAMR, int32_t bitrate) { OMX_AUDIO_PARAM_AMRTYPE def; InitOMXParams(&def); def.nPortIndex = encoder ? kPortIndexOutput : kPortIndexInput; status_t err = mOMX->getParameter(mNode, OMX_IndexParamAudioAmr, &def, sizeof(def)); if (err != OK) { ...
0
14,716
Analyze the following 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 RenderThreadImpl::WidgetHidden() { DCHECK_LT(hidden_widget_count_, widget_count_); hidden_widget_count_++; if (widget_count_ && hidden_widget_count_ == widget_count_) { #if !defined(SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE) #endif if (GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden...
0
28,863
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: cifs_sb_master_tlink(struct cifs_sb_info *cifs_sb) { return cifs_sb->master_tlink; } Commit Message: cifs: always do is_path_accessible check in cifs_mount Currently, we skip doing the is_path_accessible check in cifs_mount if there is no prefixpath. I have a report of at least one server however that allows a...
0
29,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: void IndexedDBConnection::VersionChangeIgnored() { if (!database_.get()) return; database_->VersionChangeIgnored(); } Commit Message: [IndexedDB] Fixed transaction use-after-free vuln Bug: 725032 Change-Id: I689ded6c74d5563403587b149c3f3e02e807e4aa Reviewed-on: https://chromium-review.googlesource.com/5...
0
20,538
Analyze the following 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 HTMLImportsController::ShouldBlockScriptExecution( const Document& document) const { DCHECK_EQ(document.ImportsController(), this); if (HTMLImportLoader* loader = LoaderFor(document)) return loader->ShouldBlockScriptExecution(); return root_->GetState().ShouldBlockScriptExecution(); } Commit M...
0
20,237
Analyze the following 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 MSG_WriteDeltaKeyFloat( msg_t *msg, int key, float oldV, float newV ) { floatint_t fi; if ( oldV == newV ) { MSG_WriteBits( msg, 0, 1 ); return; } fi.f = newV; MSG_WriteBits( msg, 1, 1 ); MSG_WriteBits( msg, fi.i ^ key, 32 ); } Commit Message: Fix/improve buffer overflow in MSG_ReadBits/MSG_WriteB...
0
19,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: dwarf_elf_object_access_load_section(void* obj_in, Dwarf_Half section_index, Dwarf_Small** section_data, int* error) { dwarf_elf_object_access_internals_t*obj = (dwarf_elf_object_access_internals_t*)obj_in; if (section_index == 0) { return DW_DLV_NO_ENTRY; } { ...
1
20,668
Analyze the following 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 drm_mode_config_init(struct drm_device *dev) { mutex_init(&dev->mode_config.mutex); mutex_init(&dev->mode_config.idr_mutex); INIT_LIST_HEAD(&dev->mode_config.fb_list); INIT_LIST_HEAD(&dev->mode_config.crtc_list); INIT_LIST_HEAD(&dev->mode_config.connector_list); INIT_LIST_HEAD(&dev->mode_config.encoder...
0
5,422
Analyze the following 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 ext4_inode_csum_verify(struct inode *inode, struct ext4_inode *raw, struct ext4_inode_info *ei) { __u32 provided, calculated; if (EXT4_SB(inode->i_sb)->s_es->s_creator_os != cpu_to_le32(EXT4_OS_LINUX) || !ext4_has_metadata_csum(inode->i_sb)) return 1; provided = le16_to_cpu(raw->...
0
3,761
Analyze the following 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 CNBL::IsSendDone() { return m_BuffersDone == m_BuffersNumber; } Commit Message: NetKVM: BZ#1169718: Checking the length only on read Signed-off-by: Joseph Hindin <yhindin@rehat.com> CWE ID: CWE-20
0
1,104
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static u32 vmci_transport_peer_rid(u32 peer_cid) { if (VMADDR_CID_HYPERVISOR == peer_cid) return VMCI_TRANSPORT_HYPERVISOR_PACKET_RID; return VMCI_TRANSPORT_PACKET_RID; } Commit Message: net: rework recvmsg handler msg_name and msg_namelen logic This patch now always passes msg->msg_namelen as 0. recvmsg h...
0
16,621
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool asn1_pop_tag(struct asn1_data *data) { struct nesting *nesting; size_t len; nesting = data->nesting; if (!nesting) { data->has_error = true; return false; } len = data->ofs - (nesting->start+1); /* yes, this is ugly. We don't know in advance how many bytes the length of a tag will take, so w...
0
26,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: static int ecb_decrypt(struct blkcipher_desc *desc, struct scatterlist *dst, struct scatterlist *src, unsigned int nbytes) { return glue_ecb_crypt_128bit(&serpent_dec, desc, dst, src, nbytes); } Commit Message: crypto: prefix module autoloading with "crypto-" This prefixes all crypto module loading wi...
0
22,941
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void GraphicsContext::strokeRect(const FloatRect& rect, float lineWidth) { if (paintingDisabled()) return; if (!isRectSkiaSafe(getCTM(), rect)) return; SkPaint paint; platformContext()->setupPaintForStroking(&paint, 0, 0); paint.setStrokeWidth(WebCoreFloatToSkScalar(lineWidth...
0
11,881
Analyze the following 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 lut_init(AVFilterContext *ctx) { return 0; } Commit Message: avfilter: fix plane validity checks Fixes out of array accesses Signed-off-by: Michael Niedermayer <michaelni@gmx.at> CWE ID: CWE-119
0
3,237
Analyze the following 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 update_metadata(HTTPContext *s, char *data) { char *key; char *val; char *end; char *next = data; while (*next) { key = next; val = strstr(key, "='"); if (!val) break; end = strstr(val, "';"); if (!end) break; ...
0
5,260
Analyze the following 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 bte_av_sink_media_callback(tBTA_AV_EVT event, tBTA_AV_MEDIA* p_data) { switch (event) { case BTA_AV_SINK_MEDIA_DATA_EVT: { btif_sm_state_t state = btif_sm_get_state(btif_av_cb.sm_handle); if ((state == BTIF_AV_STATE_STARTED) || (state == BTIF_AV_STATE_OPENED)...
0
9,860
Analyze the following 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 arcmsr_hbaA_message_isr(struct AdapterControlBlock *acb) { struct MessageUnit_A __iomem *reg = acb->pmuA; /*clear interrupt and message state*/ writel(ARCMSR_MU_OUTBOUND_MESSAGE0_INT, &reg->outbound_intstatus); schedule_work(&acb->arcmsr_do_message_isr_bh); } Commit Message: scsi: arcmsr: Buffer...
0
13,843
Analyze the following 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 show_slab_objects(struct kmem_cache *s, char *buf, unsigned long flags) { unsigned long total = 0; int node; int x; unsigned long *nodes; unsigned long *per_cpu; nodes = kzalloc(2 * sizeof(unsigned long) * nr_node_ids, GFP_KERNEL); if (!nodes) return -ENOMEM; per_cpu = nodes + nr_...
0
15,340
Analyze the following 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_param_option(char *option) { Str tmp = Strnew(); char *p = option, *q; while (*p && !IS_SPACE(*p) && *p != '=') Strcat_char(tmp, *p++); while (*p && IS_SPACE(*p)) p++; if (*p == '=') { p++; while (*p && IS_SPACE(*p)) p++; } Strlower(tmp); if (set_param(tmp->ptr, p)) ...
0
17,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 StreamTcp4WHSTest03 (void) { int ret = 0; Packet *p = SCMalloc(SIZE_OF_PACKET); FAIL_IF(unlikely(p == NULL)); Flow f; ThreadVars tv; StreamTcpThread stt; TCPHdr tcph; memset(p, 0, SIZE_OF_PACKET); PacketQueue pq; memset(&pq,0,sizeof(PacketQueue)); memset (&f,...
0
19,901
Analyze the following 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_description (GsmXSMPClient *client) { SmProp *prop; const char *id; prop = find_property (client, SmProgram, NULL); id = gsm_client_peek_startup_id (GSM_CLIENT (client)); g_free (client->priv->description); if (prop) { client->priv->descrip...
0
19,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: vmnc_handle_hextile_rectangle (GstVMncDec * dec, struct RfbRectangle *rect, const guint8 * data, int len, gboolean decode) { int tilesx = GST_ROUND_UP_16 (rect->width) / 16; int tilesy = GST_ROUND_UP_16 (rect->height) / 16; int x, y, z; int off = 0; int subrects; int coloured; int width, height;...
0
1,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: void RenderViewImpl::DidAutoResize(const blink::WebSize& newSize) { GetWidget()->DidAutoResize(newSize); } Commit Message: Prevent renderer initiated back navigation to cancel a browser one. Renderer initiated back/forward navigations must not be able to cancel ongoing browser initiated navigation if they are...
0
1,558
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: IW_IMPL(int) iw_get_sample_size(void) { return (int)sizeof(iw_float32); } Commit Message: Double-check that the input image's density is valid Fixes a bug that could result in division by zero, at least for a JPEG source image. Fixes issues #19, #20 CWE ID: CWE-369
0
17,543
Analyze the following 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 adjust(LayoutSize& offset) const { LayoutUnit currLogicalLeftOffset = (m_isHorizontal ? m_colRect.x() : m_colRect.y()) - m_logicalLeft; offset += m_isHorizontal ? LayoutSize(currLogicalLeftOffset, m_currLogicalTopOffset) : LayoutSize(m_currLogicalTopOffset, currLogicalLeftOffset); ...
0
3,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: GLES2Implementation::DeferErrorCallbacks::~DeferErrorCallbacks() { DCHECK_EQ(true, gles2_implementation_->deferring_error_callbacks_); gles2_implementation_->deferring_error_callbacks_ = false; gles2_implementation_->CallDeferredErrorCallbacks(); } Commit Message: Add GL_PROGRAM_COMPLETION_QUERY_CHROMIUM ...
0
4,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: static void mark_ptr_or_null_reg(struct bpf_func_state *state, struct bpf_reg_state *reg, u32 id, bool is_null) { if (reg_type_may_be_null(reg->type) && reg->id == id) { /* Old offset (both fixed and variable parts) should * have been known-zero, because we don't allow pointer * arithmetic on p...
0
16,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: brcmf_cfg80211_sched_scan_start(struct wiphy *wiphy, struct net_device *ndev, struct cfg80211_sched_scan_request *request) { struct brcmf_if *ifp = netdev_priv(ndev); struct brcmf_cfg80211_info *cfg = wiphy_priv(wiphy); struct brcmf_pno_net_param_le pfn; int i; int ret = 0; brcmf_dbg(SCAN, "Enter n...
0
15,853
Analyze the following 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 decode_link(struct xdr_stream *xdr, struct nfs4_change_info *cinfo) { int status; status = decode_op_hdr(xdr, OP_LINK); if (status) return status; return decode_change_info(xdr, cinfo); } Commit Message: NFSv4: Convert the open and close ops to use fmode Signed-off-by: Trond Myklebust <Trond....
0
5,767
Analyze the following 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 free_pmu_context(struct pmu *pmu) { mutex_lock(&pmus_lock); free_percpu(pmu->pmu_cpu_context); mutex_unlock(&pmus_lock); } Commit Message: perf/core: Fix the perf_cpu_time_max_percent check Use "proc_dointvec_minmax" instead of "proc_dointvec" to check the input value from user-space. If not, we...
0
28,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 list_locations(struct kmem_cache *s, char *buf, enum track_item alloc) { int len = 0; unsigned long i; struct loc_track t = { 0, 0, NULL }; int node; if (!alloc_loc_track(&t, PAGE_SIZE / sizeof(struct location), GFP_TEMPORARY)) return sprintf(buf, "Out of memory\n"); /* Push back cpu ...
1
16,980
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool HTMLInputElement::sizeShouldIncludeDecoration(int& preferredSize) const { return m_inputTypeView->sizeShouldIncludeDecoration(defaultSize, preferredSize); } Commit Message: Add HTMLFormControlElement::supportsAutofocus to fix a FIXME comment. This virtual function should return true if the form control...
0
15,294
Analyze the following 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 read_user_stack_64(unsigned long __user *ptr, unsigned long *ret) { if ((unsigned long)ptr > TASK_SIZE - sizeof(unsigned long) || ((unsigned long)ptr & 7)) return -EFAULT; pagefault_disable(); if (!__get_user_inatomic(*ret, ptr)) { pagefault_enable(); return 0; } pagefault_enable(); ...
0
27,587
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: cnid_to_array(uint32_t cnid, uint8_t array[4]) { array[3] = (cnid >> 0) & 0xff; array[2] = (cnid >> 8) & 0xff; array[1] = (cnid >> 16) & 0xff; array[0] = (cnid >> 24) & 0xff; } Commit Message: Merge pull request #1374 from JordyZomer/develop Fix CVE-2018-19497. CWE ID: CWE-125
0
3,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: __be32 nfsd4_encode_fattr_to_buf(__be32 **p, int words, struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry, u32 *bmval, struct svc_rqst *rqstp, int ignore_crossmnt) { struct xdr_buf dummy; struct xdr_stream xdr; __be32 ret; svcxdr_init_encode_from_buffer(&xdr, &dummy, *p, words << 2);...
0
3,125
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GSList *nicklist_get_same_unique(SERVER_REC *server, void *id) { NICKLIST_GET_SAME_UNIQUE_REC rec; GSList *tmp; g_return_val_if_fail(IS_SERVER(server), NULL); g_return_val_if_fail(id != NULL, NULL); rec.id = id; rec.list = NULL; for (tmp = server->channels; tmp != NULL; tmp = tmp->next) { rec.ch...
0
27,445
Analyze the following 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_set_port_info(struct snd_seq_client *client, void __user *arg) { struct snd_seq_client_port *port; struct snd_seq_port_info info; if (copy_from_user(&info, arg, sizeof(info))) return -EFAULT; if (info.addr.client != client->number) /* only set our own ports ! */ retur...
0
28,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: void ContextualSearchDelegate::SendSurroundingText(int max_surrounding_chars) { const base::string16& surrounding = context_->surrounding_text; int surrounding_length = surrounding.length(); // Cast to int. int num_after_characters = std::min( surrounding_length - context_->end_offset, max_surroundi...
0
4,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 void coroutine_fn v9fs_setattr(void *opaque) { int err = 0; int32_t fid; V9fsFidState *fidp; size_t offset = 7; V9fsIattr v9iattr; V9fsPDU *pdu = opaque; err = pdu_unmarshal(pdu, offset, "dI", &fid, &v9iattr); if (err < 0) { goto out_nofid; } fidp = get_fid...
0
3,071
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static size_t pull_ucs2(char *dest, const void *src, size_t dest_len, size_t src_len, int flags) { size_t size = 0; if (ucs2_align(NULL, src, flags)) { src = (const void *)((const char *)src + 1); if (src_len > 0) src_len--; } if (flags & STR_TERMINATE) { if (src_len == (size_t)-1) { src_len = u...
0
16,730
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void DelegatedFrameHost::LockResources() { DCHECK(frame_provider_ || !surface_id_.is_null()); delegated_frame_evictor_->LockFrame(); } Commit Message: repairs CopyFromCompositingSurface in HighDPI This CL removes the DIP=>Pixel transform in DelegatedFrameHost::CopyFromCompositingSurface(), because said tran...
0
1,159
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void LiveSyncTest::SetUpCommandLine(CommandLine* cl) { if (!cl->HasSwitch(switches::kSyncNotificationMethod)) cl->AppendSwitchASCII(switches::kSyncNotificationMethod, "p2p"); if (!cl->HasSwitch(switches::kEnableSyncSessions)) cl->AppendSwitch(switches::kEnableSyncSessions); if (!cl->HasSwitch(swit...
0
23,563