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: void BrowserWindowGtk::HandleKeyboardEvent( const NativeWebKeyboardEvent& event) { GdkEventKey* os_event = &event.os_event->key; if (!os_event || event.type != WebKit::WebInputEvent::RawKeyDown) return; int id = GetCustomCommandId(os_event); if (id != -1) chrome::ExecuteCommand(browser_.get(...
0
117,948
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ShellContentBrowserClient::CreateRequestContextForStoragePartition( BrowserContext* content_browser_context, const base::FilePath& partition_path, bool in_memory, ProtocolHandlerMap* protocol_handlers, URLRequestInterceptorScopedVector request_interceptors) { ShellBrowserContext* shell_brows...
0
123,466
Analyze the following 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 default_policy_setup(char *str) { ima_use_tcb = 1; return 1; } Commit Message: ima: fix add LSM rule bug If security_filter_rule_init() doesn't return a rule, then not everything is as fine as the return code implies. This bug only occurs when the LSM (eg. SELinux) is disabled at runtime. ...
0
27,840
Analyze the following 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_DEFINE3(getresgid, gid_t __user *, rgid, gid_t __user *, egid, gid_t __user *, sgid) { const struct cred *cred = current_cred(); int retval; if (!(retval = put_user(cred->gid, rgid)) && !(retval = put_user(cred->egid, egid))) retval = put_user(cred->sgid, sgid); return retval; } Commit Mess...
0
162,040
Analyze the following 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 RenderWidgetHostViewGtk::AccessibilitySetTextSelection( int acc_obj_id, int start_offset, int end_offset) { if (!host_) return; host_->AccessibilitySetTextSelection(acc_obj_id, start_offset, end_offset); } Commit Message: Implement TextureImageTransportSurface using texture mailbox This has a ...
0
114,924
Analyze the following 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 tls_process_ske_psk_preamble(SSL *s, PACKET *pkt, int *al) { #ifndef OPENSSL_NO_PSK PACKET psk_identity_hint; /* PSK ciphersuites are preceded by an identity hint */ if (!PACKET_get_length_prefixed_2(pkt, &psk_identity_hint)) { *al = SSL_AD_DECODE_ERROR; SSLerr(SSL_F_TLS_P...
0
69,389
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: BadgedProfilePhoto::BadgeType GetProfileBadgeType(Profile* profile) { if (profile->IsSupervised()) { return profile->IsChild() ? BadgedProfilePhoto::BADGE_TYPE_CHILD : BadgedProfilePhoto::BADGE_TYPE_SUPERVISOR; } if (AccountConsistencyModeManager::IsDiceEnabledForProfile(pr...
0
143,158
Analyze the following 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 InspectorNetworkAgent::DidReceiveWebSocketHandshakeResponse( Document*, unsigned long identifier, const WebSocketHandshakeRequest* request, const WebSocketHandshakeResponse* response) { DCHECK(response); std::unique_ptr<protocol::Network::WebSocketResponse> response_object = protoco...
0
138,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 bool ip6_pkt_too_big(const struct sk_buff *skb, unsigned int mtu) { if (skb->len <= mtu) return false; /* ipv6 conntrack defrag sets max_frag_size + ignore_df */ if (IP6CB(skb)->frag_max_size && IP6CB(skb)->frag_max_size > mtu) return true; if (skb->ignore_df) return false; if (skb_is_gso(skb...
0
97,049
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void DeprecateAsOverloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) { TestObject* impl = V8TestObject::ToImpl(info.Holder()); impl->DeprecateAsOverloadedMethod(); } Commit Message: bindings: Support "attribute FrozenArray<T>?" Adds a quick hack to support a case of "attribute Fr...
0
134,646
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: const std::string& WebContentsImpl::GetEncoding() const { return canonical_encoding_; } Commit Message: Don't call WebContents::DownloadImage() callback if the WebContents were deleted BUG=583718 Review URL: https://codereview.chromium.org/1685343004 Cr-Commit-Position: refs/heads/master@{#375700} CWE ID:
0
131,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: NO_INLINE JsVar *jspeFactorFunctionCall() { /* The parent if we're executing a method call */ bool isConstructor = false; if (lex->tk==LEX_R_NEW) { JSP_ASSERT_MATCH(LEX_R_NEW); isConstructor = true; if (lex->tk==LEX_R_NEW) { jsExceptionHere(JSET_ERROR, "Nesting 'new' operators is unsuppor...
0
82,326
Analyze the following 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 char *ifsection(cmd_parms *cmd, void *mconfig, const char *arg) { const char *errmsg; const char *endp = ap_strrchr_c(arg, '>'); int old_overrides = cmd->override; char *old_path = cmd->path; core_dir_config *conf; const command_rec *thiscmd = cmd->cmd; ap_conf_vector_t *n...
0
64,245
Analyze the following 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 MultibufferDataSource::ProgressCallback(int64_t begin, int64_t end) { DVLOG(1) << __func__ << "(" << begin << ", " << end << ")"; DCHECK(render_task_runner_->BelongsToCurrentThread()); if (assume_fully_buffered()) return; base::AutoLock auto_lock(lock_); if (end > begin) { if (stop_signa...
0
144,226
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: exsltCryptoCryptoApiHash (xmlXPathParserContextPtr ctxt, ALG_ID algorithm, const char *msg, unsigned long msglen, char dest[HASH_DIGEST_LENGTH]) { HCRYPTPROV hCryptProv; HCRYPTHASH hHash; if (!CryptAcquireContext (&hCryptProv, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | C...
0
156,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: _dbus_get_is_errno_eagain_or_ewouldblock (void) { return errno == WSAEWOULDBLOCK; } Commit Message: CWE ID: CWE-20
0
3,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: void AXNodeObject::increment() { UserGestureIndicator gestureIndicator(DocumentUserGestureToken::create( getDocument(), UserGestureToken::NewGesture)); alterSliderValue(true); } Commit Message: Switch to equalIgnoringASCIICase throughout modules/accessibility BUG=627682 Review-Url: https://codereview...
0
127,152
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: fbCombineConjointOutPart (CARD8 a, CARD8 b) { /* max (1-b/a,0) */ /* = 1-min(b/a,1) */ /* min (1, (1-b) / a) */ if (b >= a) /* b >= a -> b/a >= 1 */ return 0x00; /* 0 */ return ~FbIntDiv(b,a); /* 1 - b/a */ } Commit Message: CWE ID: CWE-189
0
11,349
Analyze the following 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 NavigationPolicy MaybeCheckCSP( const ResourceRequest& request, NavigationType type, LocalFrame* frame, NavigationPolicy policy, bool should_check_main_world_content_security_policy, ContentSecurityPolicy::CheckHeaderType check_header_type) { return policy; } Commit Message: On...
0
154,763
Analyze the following 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 Core::GetSerializedMessageContents( MojoMessageHandle message_handle, void** buffer, uint32_t* num_bytes, MojoHandle* handles, uint32_t* num_handles, MojoGetSerializedMessageContentsFlags flags) { if (!message_handle || (num_handles && *num_handles && !handles)) return MOJ...
0
149,599
Analyze the following 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::WeakPtr<BluetoothAdapter> BluetoothAdapter::GetWeakPtrForTesting() { return weak_ptr_factory_.GetWeakPtr(); } Commit Message: bluetooth: Implement getAvailability() This change implements the getAvailability() method for navigator.bluetooth as defined in the specification. Bug: 707640 Change-Id: I9e9b3...
0
138,176
Analyze the following 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 platform_irq_count(struct platform_device *dev) { int ret, nr = 0; while ((ret = platform_get_irq(dev, nr)) >= 0) nr++; if (ret == -EPROBE_DEFER) return ret; return nr; } Commit Message: driver core: platform: fix race condition with driver_override The driver_override implementation is susceptib...
0
63,106
Analyze the following 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 beta(u32 da, u32 dm) { u32 d2, d3; d2 = dm / 10; if (da <= d2) return BETA_MIN; d3 = (8 * dm) / 10; if (da >= d3 || d3 <= d2) return BETA_MAX; /* * Based on: * * bmin d3 - bmax d2 * k3 = ------------------- * d3 - d2 * * bmax - bmin * k4 = ------------- ...
0
18,526
Analyze the following 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 ifb_init_one(int index) { struct net_device *dev_ifb; int err; dev_ifb = alloc_netdev(sizeof(struct ifb_private), "ifb%d", ifb_setup); if (!dev_ifb) return -ENOMEM; dev_ifb->rtnl_link_ops = &ifb_link_ops; err = register_netdevice(dev_ifb); if (err < 0) goto err; return 0; e...
0
23,787
Analyze the following 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 show_object(struct object *object, struct strbuf *path, const char *last, void *data) { struct bitmap *base = data; int bitmap_pos; bitmap_pos = bitmap_position(object->oid.hash); if (bitmap_pos < 0) { char *name = path_name(path, last); bitmap_pos = ext_index_add_object(object, na...
1
167,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 megasas_dcmd_pd_get_list(MegasasState *s, MegasasCmd *cmd) { struct mfi_pd_list info; size_t dcmd_size = sizeof(info); BusChild *kid; uint32_t offset, dcmd_limit, num_pd_disks = 0, max_pd_disks; memset(&info, 0, dcmd_size); offset = 8; dcmd_limit = offset + sizeof(struct mf...
0
10,430
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: FT_Set_Pixel_Sizes( FT_Face face, FT_UInt pixel_width, FT_UInt pixel_height ) { FT_Size_RequestRec req; if ( pixel_width == 0 ) pixel_width = pixel_height; else if ( pixel_height == 0 ) pixel_height = pixel_width; if ( pixel_width ...
0
10,270
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: std::unique_ptr<NavigationRequest> NavigationRequest::CreateBrowserInitiated( FrameTreeNode* frame_tree_node, const GURL& dest_url, const Referrer& dest_referrer, const FrameNavigationEntry& frame_entry, const NavigationEntryImpl& entry, FrameMsg_Navigate_Type::Value navigation_type, P...
0
144,118
Analyze the following 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 tcmu_glfs_close(struct tcmu_device *dev) { struct glfs_state *gfsp = tcmu_get_dev_private(dev); glfs_close(gfsp->gfd); gluster_cache_refresh(gfsp->fs, tcmu_get_path(dev)); gluster_free_server(&gfsp->hosts); free(gfsp); } Commit Message: glfs: discard glfs_check_config Signed-off-by: Prasanna K...
0
59,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: static void virtfs_reset(V9fsPDU *pdu) { V9fsState *s = pdu->s; V9fsFidState *fidp = NULL; /* Free all fids */ while (s->fid_list) { fidp = s->fid_list; s->fid_list = fidp->next; if (fidp->ref) { fidp->clunked = 1; } else { free_fid(pdu, fi...
0
8,246
Analyze the following 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 ssl_verify_alarm_type(long type) { int al; switch (type) { case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT: case X509_V_ERR_UNABLE_TO_GET_CRL: case X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER: al = SSL_AD_UNKNOWN_CA; break; case X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE: case ...
0
12,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: int blkid_flush_cache(blkid_cache cache) { struct list_head *p; char *tmp = NULL; char *opened = NULL; char *filename; FILE *file = NULL; int fd, ret = 0; struct stat st; if (!cache) return -BLKID_ERR_PARAM; if (list_empty(&cache->bic_devs) || !(cache->bic_flags & BLKID_BIC_FL_CHANGED)) { DBG(...
0
74,624
Analyze the following 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 RenderView::OnZoom(PageZoom::Function function) { if (!webview()) // Not sure if this can happen, but no harm in being safe. return; webview()->hidePopups(); double old_zoom_level = webview()->zoomLevel(); double zoom_level; if (function == PageZoom::RESET) { zoom_level = 0; } else if ...
0
98,973
Analyze the following 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 smbXcli_req_cleanup(struct tevent_req *req, enum tevent_req_state req_state) { struct smbXcli_req_state *state = tevent_req_data(req, struct smbXcli_req_state); TALLOC_FREE(state->write_req); switch (req_state) { case TEVENT_REQ_RECEIVED: /* * Make sure we really remove it from *...
0
2,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: static int __init init_inet_pernet_ops(void) { return register_pernet_subsys(&af_inet_ops); } Commit Message: net: add validation for the socket syscall protocol argument 郭永刚 reported that one could simply crash the kernel as root by using a simple program: int socket_fd; struct sockaddr_in addr; addr.sin_...
0
41,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: error::Error GLES2DecoderPassthroughImpl::DoBlendEquation(GLenum mode) { api()->glBlendEquationFn(mode); return error::kNoError; } Commit Message: Add GL_PROGRAM_COMPLETION_QUERY_CHROMIUM This makes the query of GL_COMPLETION_STATUS_KHR to programs much cheaper by minimizing the round-trip to the GPU thread...
0
141,885
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: BlobStorageContext::BlobSlice::BlobSlice(const BlobEntry& source, uint64_t slice_offset, uint64_t slice_size) { const auto& source_items = source.items(); const auto& offsets = source.offsets(); DCHECK_LE(slice_offset + slice_...
0
150,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: OxideQQuickWebViewAttached::OxideQQuickWebViewAttached(QObject* parent) : QObject(parent), view_(nullptr) {} Commit Message: CWE ID: CWE-20
0
17,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: nsPluginInstance::setupProxy(const std::string& url) { #if NPAPI_VERSION != 190 if (!NPNFuncs.getvalueforurl) return; #endif char *proxy = 0; uint32_t length = 0; #if NPAPI_VERSION != 190 NPN_GetValueForURL(_instance, NPNURLVProxy, url.c_str(), &proxy, &length); #endif ...
0
13,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: COMPAT_SYSCALL_DEFINE3(sched_setaffinity, compat_pid_t, pid, unsigned int, len, compat_ulong_t __user *, user_mask_ptr) { cpumask_var_t new_mask; int retval; if (!alloc_cpumask_var(&new_mask, GFP_KERNEL)) return -ENOMEM; retval = compat_get_user_cpu_mask(user_mask_ptr, len, new_mask); i...
0
82,627
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static u32 map_id_up(struct uid_gid_map *map, u32 id) { unsigned idx, extents; u32 first, last; /* Find the matching extent */ extents = map->nr_extents; smp_read_barrier_depends(); for (idx = 0; idx < extents; idx++) { first = map->extent[idx].lower_first; last = first + map->extent[idx].count - 1; ...
0
29,910
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: sg_fill_request_table(Sg_fd *sfp, sg_req_info_t *rinfo) { Sg_request *srp; int val; unsigned int ms; val = 0; list_for_each_entry(srp, &sfp->rq_list, entry) { if (val > SG_MAX_QUEUE) break; memset(&rinfo[val], 0, SZ_SG_REQ_INFO); rinfo[val].req_state = srp->done + 1; rinfo[val].problem = ...
1
167,740
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void mcryptd_hash_update(struct crypto_async_request *req_async, int err) { struct ahash_request *req = ahash_request_cast(req_async); struct mcryptd_hash_request_ctx *rctx = ahash_request_ctx(req); if (unlikely(err == -EINPROGRESS)) goto out; rctx->out = req->result; err = ahash_mcryptd_update(&r...
0
71,302
Analyze the following 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 dispatch(struct tipc_port *tport, struct sk_buff *buf) { struct sock *sk = (struct sock *)tport->usr_handle; u32 res; /* * Process message if socket is unlocked; otherwise add to backlog queue * * This code is based on sk_receive_skb(), but must be distinct from it * since a TIPC-specific f...
0
30,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: void Document::nodeWillBeRemoved(Node& n) { for (NodeIterator* ni : m_nodeIterators) ni->nodeWillBeRemoved(n); for (Range* range : m_ranges) range->nodeWillBeRemoved(n); if (LocalFrame* frame = this->frame()) { frame->eventHandler().nodeWillBeRemoved(n); frame->select...
0
124,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: void WebContentsImpl::SetIsLoading(bool is_loading, bool to_different_document, LoadNotificationDetails* details) { if (is_loading == is_loading_) return; if (!is_loading) { load_state_ = net::LoadStateWithParam(net::LOAD_STATE_IDL...
0
131,997
Analyze the following 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 perf_event_task_enable(void) { struct perf_event_context *ctx; struct perf_event *event; mutex_lock(&current->perf_event_mutex); list_for_each_entry(event, &current->perf_event_list, owner_entry) { ctx = perf_event_ctx_lock(event); perf_event_for_each_child(event, _perf_event_enable); perf_event_ct...
0
56,106
Analyze the following 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_recv_NPPrintData(rpc_message_t *message, void *p_value) { NPPrintData *printData = (NPPrintData *)p_value; int error; if ((error = rpc_message_recv_uint32(message, &printData->size)) < 0) return error; if ((error = rpc_message_recv_bytes(message, printData->data, printData->size)) < 0) re...
0
26,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: mrb_class_name(mrb_state *mrb, struct RClass* c) { mrb_value path = mrb_class_path(mrb, c); if (mrb_nil_p(path)) { path = mrb_str_new_lit(mrb, "#<Class:"); mrb_str_concat(mrb, path, mrb_ptr_to_str(mrb, c)); mrb_str_cat_lit(mrb, path, ">"); } return RSTRING_PTR(path); } Commit Message: `mrb_cl...
0
82,072
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: method_invocation_get_uid (GDBusMethodInvocation *context) { const gchar *sender; PolkitSubject *busname; PolkitSubject *process; uid_t uid; sender = g_dbus_method_invocation_get_sender (context); busname = polkit_system_bus_name_new (sender); process = polkit_system_bus_name_get_process_sync (POLKI...
1
165,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: void HTMLInputElement::ResetListAttributeTargetObserver() { const AtomicString& value = FastGetAttribute(listAttr); if (!value.IsNull() && isConnected()) { SetListAttributeTargetObserver( ListAttributeTargetObserver::Create(value, this)); } else { SetListAttributeTargetObserver(nullptr); }...
0
126,086
Analyze the following 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 CSPSourceList::matches(const KURL& url, ContentSecurityPolicy::RedirectStatus redirectStatus) const { if (m_allowStar) return true; KURL effectiveURL = m_policy->selfMatchesInnerURL() && SecurityOrigin::shouldUseInnerURL(url) ? SecurityOrigin::extractInnerURL(url) : url; if (m_al...
1
171,789
Analyze the following 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 add_server_options(struct dhcp_packet *packet) { struct option_set *curr = server_config.options; while (curr) { if (curr->data[OPT_CODE] != DHCP_LEASE_TIME) udhcp_add_binary_option(packet, curr->data); curr = curr->next; } packet->siaddr_nip = server_config.siaddr_nip; if (server_confi...
0
13,121
Analyze the following 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 common_mmap(int op, struct file *file, unsigned long prot, unsigned long flags) { int mask = 0; if (!file || !file->f_security) return 0; if (prot & PROT_READ) mask |= MAY_READ; /* * Private mappings don't require write perms since they don't * write back to the files */ if ((...
0
51,099
Analyze the following 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 recv_creds(int sock, struct ucred *cred, char *v) { struct msghdr msg = { 0 }; struct iovec iov; struct cmsghdr *cmsg; char cmsgbuf[CMSG_SPACE(sizeof(*cred))]; char buf[1]; int ret; int optval = 1; struct timeval tv; fd_set rfds; *v = '1'; cred->pid = -1; cred->uid = -1; cred->gid = -1;...
0
44,442
Analyze the following 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_siocgstampns(struct net *net, struct socket *sock, unsigned int cmd, struct compat_timespec __user *up) { mm_segment_t old_fs = get_fs(); struct timespec kts; int err; set_fs(KERNEL_DS); err = sock_do_ioctl(net, sock, cmd, (unsigned long)&kts); set_fs(old_fs); if (!err) { err = put_use...
0
22,727
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int EVP_EncodeBlock(unsigned char *t, const unsigned char *f, int dlen) { int i,ret=0; unsigned long l; for (i=dlen; i > 0; i-=3) { if (i >= 3) { l= (((unsigned long)f[0])<<16L)| (((unsigned long)f[1])<< 8L)|f[2]; *(t++)=conv_bin2ascii(l>>18L); *(t++)=conv_bin2ascii(l>>12L); *(t++)=con...
0
6,127
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int snd_interval_ranges(struct snd_interval *i, unsigned int count, const struct snd_interval *ranges, unsigned int mask) { unsigned int k; struct snd_interval range_union; struct snd_interval range; if (!count) { snd_interval_none(i); return -EINVAL; } snd_interval_any(&range_union); range_union.m...
0
47,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: dict_spot_params(const ref * pdict, gs_spot_halftone * psp, ref * psproc, ref * ptproc, gs_memory_t *mem) { int code; check_dict_read(*pdict); if ((code = dict_float_param(pdict, "Frequency", 0.0, &psp->screen.frequency)) != 0 || (code = dict_...
0
13,925
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: iakerb_make_token(iakerb_ctx_id_t ctx, krb5_data *realm, krb5_data *cookie, krb5_data *request, int initialContextToken, gss_buffer_t token) { krb5_error_code code; krb5_iakerb_header iah; krb5_data *data = NULL;...
0
43,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: static void config_work_handler(struct work_struct *work) { struct ports_device *portdev; portdev = container_of(work, struct ports_device, config_work); if (!use_multiport(portdev)) { struct virtio_device *vdev; struct port *port; u16 rows, cols; vdev = portdev->vdev; virtio_cread(vdev, struct vir...
0
66,578
Analyze the following 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 std::string error_headers() { return URLRequestTestJob::test_error_headers(); } Commit Message: Tests were marked as Flaky. BUG=151811,151810 TBR=droger@chromium.org,shalev@chromium.org NOTRY=true Review URL: https://chromiumcodereview.appspot.com/10968052 git-svn-id: svn://svn.chromium.org/chr...
0
102,286
Analyze the following 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 Contains(const Collection& collection, const Key& key) { return std::find(collection.begin(), collection.end(), key) != collection.end(); } Commit Message: Replace fixed string uses of AddHeaderFromString Uses of AddHeaderFromString() with a static string may as well be replaced with SetHeader(). D...
0
119,299
Analyze the following 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 WritePSDChannel(const PSDInfo *psd_info, const ImageInfo *image_info,Image *image,Image *next_image, const QuantumType quantum_type, unsigned char *compact_pixels, MagickOffsetType size_offset,const MagickBooleanType separate, ExceptionInfo *exception) { int y; MagickBooleanType ...
0
69,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: PassRefPtr<Image> WebGLRenderingContextBase::VideoFrameToImage( HTMLVideoElement* video) { IntSize size(video->videoWidth(), video->videoHeight()); ImageBuffer* buf = generated_image_cache_.GetImageBuffer(size); if (!buf) { SynthesizeGLError(GL_OUT_OF_MEMORY, "texImage2D", "out of memory"); retu...
0
133,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: int _nfs4_call_sync(struct rpc_clnt *clnt, struct nfs_server *server, struct rpc_message *msg, struct nfs4_sequence_args *args, struct nfs4_sequence_res *res, int cache_reply) { nfs41_init_sequence(args, res, cache_reply); return rpc_call_sync(clnt, msg, 0); } Commit Message: Fix ...
0
19,806
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int dw2102_load_firmware(struct usb_device *dev, const struct firmware *frmwr) { u8 *b, *p; int ret = 0, i; u8 reset; u8 reset16[] = {0, 0, 0, 0, 0, 0, 0}; const struct firmware *fw; switch (le16_to_cpu(dev->descriptor.idProduct)) { case 0x2101: ret = request_firmware(&fw, DW2101_FIRMWARE, &de...
0
66,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: void RunUntilIdle() { scoped_task_environment_.RunUntilIdle(); base::RunLoop().RunUntilIdle(); } Commit Message: Move IsDataSaverEnabledByUser to be a static method and use it This method now officially becomes the source of truth that everything in the code base eventually calls into to determine w...
0
142,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: add_durable_v2_context(struct kvec *iov, unsigned int *num_iovec, struct cifs_open_parms *oparms) { struct smb2_create_req *req = iov[0].iov_base; unsigned int num = *num_iovec; iov[num].iov_base = create_durable_v2_buf(oparms->fid); if (iov[num].iov_base == NULL) return -ENOMEM; iov[num].iov_len = ...
0
84,931
Analyze the following 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 *js_savetry(js_State *J) { if (J->trytop == JS_TRYLIMIT) js_error(J, "try: exception stack overflow"); J->trybuf[J->trytop].E = J->E; J->trybuf[J->trytop].envtop = J->envtop; J->trybuf[J->trytop].tracetop = J->tracetop; J->trybuf[J->trytop].top = J->top; J->trybuf[J->trytop].bot = J->bot; J->trybuf[...
0
13,480
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void OmniboxViewWin::OnSysChar(TCHAR ch, UINT repeat_count, UINT flags) { if (ch == VK_SPACE) SetMsgHandled(false); } Commit Message: Change omnibox behavior when stripping javascript schema to navigate after stripping the schema on drag drop. ...
0
107,508
Analyze the following 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 nl80211_set_bss(struct sk_buff *skb, struct genl_info *info) { struct cfg80211_registered_device *rdev = info->user_ptr[0]; struct net_device *dev = info->user_ptr[1]; struct bss_parameters params; memset(&params, 0, sizeof(params)); /* default to not changing parameters */ params.use_cts_prot =...
0
26,763
Analyze the following 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 movl_pcdisp_reg(RAnal* anal, RAnalOp* op, ut16 code){ op->type = R_ANAL_OP_TYPE_LOAD; op->src[0] = anal_pcrel_disp_mov (anal, op, code&0xFF, LONG_SIZE); op->dst = anal_fill_ai_rg (anal, GET_TARGET_REG(code)); return op->size; } Commit Message: Fix #9903 - oobread in RAnal.sh CWE ID: CWE-125
0
82,691
Analyze the following 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 uint64_t vmxnet3_get_mac_low(MACAddr *addr) { return VMXNET3_MAKE_BYTE(0, addr->a[0]) | VMXNET3_MAKE_BYTE(1, addr->a[1]) | VMXNET3_MAKE_BYTE(2, addr->a[2]) | VMXNET3_MAKE_BYTE(3, addr->a[3]); } Commit Message: CWE ID: CWE-200
0
8,993
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: http_DoConnection(const struct http *hp) { char *p, *q; const char *ret; unsigned u; if (!http_GetHdr(hp, H_Connection, &p)) { if (hp->protover < 11) return ("not HTTP/1.1"); return (NULL); } ret = NULL; AN(p); for (; *p; p++) { if (vct_issp(*p)) continue; if (*p == ',') continue; for ...
0
56,415
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: yytnamerr (char *yyres, const char *yystr) { if (*yystr == '"') { YYSIZE_T yyn = 0; char const *yyp = yystr; for (;;) switch (*++yyp) { case '\'': case ',': goto do_not_strip_quotes; case '\\': if (*++yyp != '\\') ...
0
64,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 PHP_GSHUTDOWN_FUNCTION(bcmath) { _bc_free_num_ex(&bcmath_globals->_zero_, 1); _bc_free_num_ex(&bcmath_globals->_one_, 1); _bc_free_num_ex(&bcmath_globals->_two_, 1); } Commit Message: CWE ID: CWE-20
0
11,008
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: daemon_linux_lvm2_lv_set_name (Daemon *daemon, const gchar *group_uuid, const gchar *uuid, const gchar *new_name, DBusGMethodInvocation *context) { daemon_local_check_auth (daemon, ...
0
11,588
Analyze the following 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_has_highlight_regex (const char *string, const char *regex) { regex_t reg; int rc; if (!string || !regex || !regex[0]) return 0; if (string_regcomp (&reg, regex, REG_EXTENDED | REG_ICASE) != 0) return 0; rc = string_has_highlight_regex_compiled (string, &reg); re...
0
7,319
Analyze the following 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_readpage_end_io_hook(struct page *page, u64 start, u64 end, struct extent_state *state, int mirror) { size_t offset = start - ((u64)page->index << PAGE_CACHE_SHIFT); struct inode *inode = page->mapping->host; struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; char *kaddr; u...
0
34,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: void free_http_req_rules(struct list *r) { struct http_req_rule *tr, *pr; list_for_each_entry_safe(pr, tr, r, list) { LIST_DEL(&pr->list); if (pr->action == HTTP_REQ_ACT_AUTH) free(pr->arg.auth.realm); regex_free(&pr->arg.hdr_add.re); free(pr); } } Commit Message: CWE ID: CWE-189
0
9,781
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateObj(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSTestObj::s_info)) return throwVMTypeError(exec); JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); ASSERT_GC_OBJ...
0
101,277
Analyze the following 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 BrowserOpenedWithExistingProfileNotificationObserver::Observe( int type, const content::NotificationSource& source, const content::NotificationDetails& details) { if (!automation_) { delete this; return; } if (type == chrome::NOTIFICATION_BROWSER_OPENED) { new_window_id_ = Exte...
0
117,594
Analyze the following 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 ext4_register_li_request(struct super_block *sb, ext4_group_t first_not_zeroed) { struct ext4_sb_info *sbi = EXT4_SB(sb); struct ext4_li_request *elr = NULL; ext4_group_t ngroups = EXT4_SB(sb)->s_groups_count; int ret = 0; mutex_lock(&ext4_li_mtx); if (sbi->s_li_request != NULL) { /* * Res...
0
56,689
Analyze the following 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 writeImageData(v8::Handle<v8::Value> value) { ImageData* imageData = V8ImageData::toNative(value.As<v8::Object>()); if (!imageData) return; Uint8ClampedArray* pixelArray = imageData->data(); m_writer.writeImageData(imageData->width(), imageData->height(), p...
0
120,566
Analyze the following 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 testFilenameUriConversion() { const bool FOR_UNIX = true; const bool FOR_WINDOWS = false; testFilenameUriConversionHelper(L"/bin/bash", L"file:///bin/bash", FOR_UNIX); testFilenameUriConversionHelper(L"/bin/bash", L"file:/bin/bash", FOR_UNIX, L"file:///bin/bash"); testFilenameUriConversionHelper(L...
0
75,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 migrate_tasks(unsigned int dead_cpu) { struct rq *rq = cpu_rq(dead_cpu); struct task_struct *next, *stop = rq->stop; int dest_cpu; /* * Fudge the rq selection such that the below task selection loop * doesn't get stuck on the currently eligible stop task. * * We're currently inside stop_m...
0
58,167
Analyze the following 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 Start( std::unique_ptr<network::SharedURLLoaderFactoryInfo> network_loader_factory_info, ServiceWorkerNavigationHandleCore* service_worker_navigation_handle_core, AppCacheNavigationHandleCore* appcache_handle_core, std::unique_ptr<NavigationRequestInfo> request_info, ...
0
145,389
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: uint32_t address_space_ldl(AddressSpace *as, hwaddr addr, MemTxAttrs attrs, MemTxResult *result) { return address_space_ldl_internal(as, addr, attrs, result, DEVICE_NATIVE_ENDIAN); } Commit Message: CWE ID: CWE-20
0
14,290
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void jslGetTokenString(char *str, size_t len) { if (lex->tk == LEX_ID) { espruino_snprintf(str, len, "ID:%s", jslGetTokenValueAsString()); } else if (lex->tk == LEX_STR) { espruino_snprintf(str, len, "String:'%s'", jslGetTokenValueAsString()); } else jslTokenAsString(lex->tk, str, len); } Commi...
0
82,560
Analyze the following 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 char *parse_ip6(struct parse_state *state, const char *ptr) { const char *error = NULL, *end = state->ptr, *tmp = memchr(ptr, ']', end - ptr); TSRMLS_FETCH_FROM_CTX(state->ts); if (tmp) { size_t addrlen = tmp - ptr + 1; char buf[16], *addr = estrndup(ptr + 1, addrlen - 2); int rv = inet_pto...
0
73,828
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ZSTDLIB_API size_t ZSTD_CCtx_setPledgedSrcSize(ZSTD_CCtx* cctx, unsigned long long pledgedSrcSize) { DEBUGLOG(4, "ZSTD_CCtx_setPledgedSrcSize to %u bytes", (U32)pledgedSrcSize); if (cctx->streamStage != zcss_init) return ERROR(stage_wrong); cctx->pledgedSrcSizePlusOne = pledgedSrcSize+1; return 0;...
0
89,996
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Segment::Segment(IMkvReader* pReader, long long elem_start, long long start, long long size) : m_pReader(pReader), m_element_start(elem_start), m_start(start), m_size(size), m_pos(start), m_pUnknownSize(0), m_pSeekHead(NULL), m_pInfo(NULL), m_pTracks(NULL), ...
0
164,302
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SetLedMapField(CompatInfo *info, LedInfo *ledi, const char *field, ExprDef *arrayNdx, ExprDef *value) { bool ok = true; if (istreq(field, "modifiers") || istreq(field, "mods")) { if (arrayNdx) return ReportLedNotArray(info, ledi, field); if (!ExprResolveModMask...
0
78,937
Analyze the following 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 may_lookup(struct nameidata *nd) { if (nd->flags & LOOKUP_RCU) { int err = inode_permission(nd->inode, MAY_EXEC|MAY_NOT_BLOCK); if (err != -ECHILD) return err; if (unlazy_walk(nd, NULL, 0)) return -ECHILD; } return inode_permission(nd->inode, MAY_EXEC); } Commit Message: vfs: Tes...
0
43,669
Analyze the following 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 esp_do_dma(ESPState *s) { uint32_t len; int to_device; len = s->dma_left; if (s->do_cmd) { trace_esp_do_dma(s->cmdlen, len); s->dma_memory_read(s->dma_opaque, &s->cmdbuf[s->cmdlen], len); return; } return; } Commit Message: CWE ID: CWE-7...
1
164,961
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: double WebMediaPlayerImpl::CurrentTime() const { DCHECK(main_task_runner_->BelongsToCurrentThread()); DCHECK_NE(ready_state_, WebMediaPlayer::kReadyStateHaveNothing); return (ended_ && !std::isinf(Duration())) ? Duration() : GetCurrentTimeInternal().InSecondsF(); } Commit Message...
0
144,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 php_pgsql_fd_set_option(php_stream *stream, int option, int value, void *ptrparam) /* {{{ */ { PGconn *pgsql = (PGconn *) stream->abstract; switch (option) { case PHP_STREAM_OPTION_BLOCKING: return PQ_SETNONBLOCKING(pgsql, value); default: return FAILURE; } } /* }}} */ Commit Message: CW...
0
5,236
Analyze the following 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 Adam7_getpassvalues(unsigned passw[7], unsigned passh[7], size_t filter_passstart[8], size_t padded_passstart[8], size_t passstart[8], unsigned w, unsigned h, unsigned bpp) { /*the passstart values have 8 values: the 8th one indicates the byte after the end of the 7th...
0
87,421
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gpu::error::Error CommandBufferProxyImpl::GetLastError() { return last_state_.error; } Commit Message: Convert plugin and GPU process to brokered handle duplication. BUG=119250 Review URL: https://chromiumcodereview.appspot.com/9958034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132303 0039d316-1c4b-...
0
106,721