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: static CURLcode create_conn(struct Curl_easy *data, struct connectdata **in_connect, bool *async) { CURLcode result = CURLE_OK; struct connectdata *conn; struct connectdata *conn_temp = NULL; bool reuse; bool connections_available = TRUE; bool fo...
0
2,070
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: linux_md_remove_component_completed_cb (DBusGMethodInvocation *context, Device *device, gboolean job_was_cancelled, int status, const char *stderr, ...
0
20,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: void V8TestObject::CSSAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_cssAttribute_Getter"); test_object_v8_internal::CSSAttributeAttributeGetter(info); } Commit Message: bindings: Support "...
0
19,498
Analyze the following 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 PageCaptureSaveAsMHTMLFunction::ResolvePermissionRequest( const PermissionIDSet& allowed_permissions) { if (allowed_permissions.ContainsID(APIPermission::kPageCapture)) { base::PostTaskWithTraits( FROM_HERE, kCreateTemporaryFileTaskTraits, base::BindOnce(&PageCaptureSaveAsMHTMLFunct...
0
4,909
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: poly_send(PG_FUNCTION_ARGS) { POLYGON *poly = PG_GETARG_POLYGON_P(0); StringInfoData buf; int32 i; pq_begintypsend(&buf); pq_sendint(&buf, poly->npts, sizeof(int32)); for (i = 0; i < poly->npts; i++) { pq_sendfloat8(&buf, poly->p[i].x); pq_sendfloat8(&buf, poly->p[i].y); } PG_RETURN_BYTEA_P(pq_e...
0
15,898
Analyze the following 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 Browser::ContentsZoomChange(bool zoom_in) { chrome::ExecuteCommand(this, zoom_in ? IDC_ZOOM_PLUS : IDC_ZOOM_MINUS); } Commit Message: Remove TabContents from TabStripModelObserver::TabDetachedAt. BUG=107201 TEST=no visible change Review URL: https://chromiumcodereview.appspot.com/11293205 git-svn-id: ...
0
3,227
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool LayerWebKitThread::filtersCanBeComposited(const FilterOperations& filters) { if (!filters.size()) return false; for (unsigned i = 0; i < filters.size(); ++i) { const FilterOperation* filterOperation = filters.at(i); switch (filterOperation->getOperationType()) { case ...
0
1,223
Analyze the following 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 tg3_set_loopback(struct net_device *dev, netdev_features_t features) { struct tg3 *tp = netdev_priv(dev); if (features & NETIF_F_LOOPBACK) { if (tp->mac_mode & MAC_MODE_PORT_INT_LPBACK) return; spin_lock_bh(&tp->lock); tg3_mac_loopback(tp, true); netif_carrier_on(tp->dev); spin_unlock...
0
8,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: void WebBluetoothServiceImpl::RemoteCharacteristicReadValue( const std::string& characteristic_instance_id, RemoteCharacteristicReadValueCallback callback) { DCHECK_CURRENTLY_ON(BrowserThread::UI); const CacheQueryResult query_result = QueryCacheForCharacteristic(characteristic_instance_id); ...
0
16,635
Analyze the following 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 shmem_init_inode(void *foo) { struct shmem_inode_info *info = foo; inode_init_once(&info->vfs_inode); } Commit Message: tmpfs: fix use-after-free of mempolicy object The tmpfs remount logic preserves filesystem mempolicy if the mpol=M option is not specified in the remount request. A new policy c...
0
21,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: bool HTMLInputElement::HasValidDataListOptions() const { HTMLDataListElement* data_list = DataList(); if (!data_list) return false; HTMLDataListOptionsCollection* options = data_list->options(); for (unsigned i = 0; HTMLOptionElement* option = options->Item(i); ++i) { if (!option->value().IsEmpty(...
0
15,003
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: net::CacheType BackendImpl::GetCacheType() const { return cache_type_; } Commit Message: Blockfile cache: fix long-standing sparse + evict reentrancy problem Thanks to nedwilliamson@ (on gmail) for an alternative perspective plus a reduction to make fixing this much easier. Bug: 826626, 518908, 537063, 80288...
0
17,091
Analyze the following 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 net_bridge_mdb_entry *br_mdb_get(struct net_bridge *br, struct sk_buff *skb, u16 vid) { struct net_bridge_mdb_htable *mdb = rcu_dereference(br->mdb); struct br_ip ip; if (br->multicast_disabled) return NULL; if (BR_INPUT_SKB_CB(skb)->igmp) return NULL; ip.proto = skb->protocol; ip.vid = v...
0
19,269
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void RenderWidgetHostImpl::ForwardGestureEventImmediately( const WebKit::WebGestureEvent& gesture_event) { if (ignore_input_events_ || process_->IgnoreInputEvents()) return; ForwardInputEvent(gesture_event, sizeof(WebGestureEvent), false); } Commit Message: Implement TextureImageTransportSurface usin...
0
257
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static inline void adjust_tsc_offset_host(struct kvm_vcpu *vcpu, s64 adjustment) { if (vcpu->arch.tsc_scaling_ratio != kvm_default_tsc_scaling_ratio) WARN_ON(adjustment < 0); adjustment = kvm_scale_tsc(vcpu, (u64) adjustment); kvm_x86_ops->adjust_tsc_offset_guest(vcpu, adjustment); } Commit Message: KVM: x8...
0
19,932
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static struct fib6_node * fib6_lookup_1(struct fib6_node *root, struct lookup_args *args) { struct fib6_node *fn; __be32 dir; if (unlikely(args->offset == 0)) return NULL; /* * Descend on a tree */ fn = root; for (;;) { struct fib6_node *next; dir = addr_bit_set(args->addr, fn->fn_bit); ...
0
24,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 void tcp_drop(struct sock *sk, struct sk_buff *skb) { sk_drops_add(sk, skb); __kfree_skb(skb); } Commit Message: tcp: make challenge acks less predictable Yue Cao claims that current host rate limiting of challenge ACKS (RFC 5961) could leak enough information to allow a patient attacker to hijack TCP ...
0
16,773
Analyze the following 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 ath_txq_schedule(struct ath_softc *sc, struct ath_txq *txq) { struct ath_atx_ac *ac, *last_ac; struct ath_atx_tid *tid, *last_tid; bool sent = false; if (test_bit(SC_OP_HW_RESET, &sc->sc_flags) || list_empty(&txq->axq_acq)) return; rcu_read_lock(); last_ac = list_entry(txq->axq_acq.prev, stru...
0
12,506
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WebUI* WebContentsImpl::CreateWebUI(const GURL& url, const std::string& frame_name) { WebUIImpl* web_ui = new WebUIImpl(this, frame_name); WebUIController* controller = WebUIControllerFactoryRegistry::GetInstance()-> CreateWebUIControllerForURL(web_ui, url); if (con...
0
6,674
Analyze the following 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 cmd_noop(char *tag, char *cmd) { if (backend_current) { /* remote mailbox */ prot_printf(backend_current->out, "%s %s\r\n", tag, cmd); pipe_including_tag(backend_current, tag, 0); return; } index_check(imapd_index, 1, 0); prot_printf(imapd_out, "%s OK...
0
18,395
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: access_check(i_ctx_t *i_ctx_p, int access, /* mask for attrs */ bool modify) /* if true, reduce access */ { os_ptr op = osp; ref *aop; switch (r_type(op)) { case t_dictionary: aop = dict_access_ref(op); if (modify) { ...
0
7,382
Analyze the following 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 sk_release_orig_filter(struct sk_filter *fp) { struct sock_fprog_kern *fprog = fp->orig_prog; if (fprog) { kfree(fprog->filter); kfree(fprog); } } Commit Message: filter: prevent nla extensions to peek beyond the end of the message The BPF_S_ANC_NLATTR and BPF_S_ANC_NLATTR_NEST extensions fa...
0
26,780
Analyze the following 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 tun_flow_entry *tun_flow_find(struct hlist_head *head, u32 rxhash) { struct tun_flow_entry *e; hlist_for_each_entry_rcu(e, head, hash_link) { if (e->rxhash == rxhash) return e; } return NULL; } Commit Message: tun: call dev_get_valid_name() before register_netdevice() register_netdevice(...
0
29,493
Analyze the following 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 wvlan_get_porttype(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { struct wl_private *lp = wl_priv(dev); unsigned long flags; int ret = 0; int status = -1; hcf_16 *pPortType; __u32 *pData = (__u32 *)extra; /*-----------------...
0
23,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 bool blk_mq_attempt_merge(struct request_queue *q, struct blk_mq_ctx *ctx, struct bio *bio) { struct request *rq; int checked = 8; list_for_each_entry_reverse(rq, &ctx->rq_list, queuelist) { int el_ret; if (!checked--) break; if (!blk_rq_merge_ok(rq, bio)) continue; el_ret = blk_t...
0
21,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 trusted_destroy(struct key *key) { struct trusted_key_payload *p = key->payload.data[0]; if (!p) return; memset(p->key, 0, p->key_len); kfree(key->payload.data[0]); } Commit Message: KEYS: Fix handling of stored error in a negatively instantiated user key If a user key gets negatively instant...
0
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: int iscsi_copy_param_list( struct iscsi_param_list **dst_param_list, struct iscsi_param_list *src_param_list, int leading) { struct iscsi_param *param = NULL; struct iscsi_param *new_param = NULL; struct iscsi_param_list *param_list = NULL; param_list = kzalloc(sizeof(struct iscsi_param_list), GFP_KERNEL)...
0
6,648
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: v8::Local<v8::Object> AsObjectOrEmpty(v8::Local<v8::Value> value) { return value->IsObject() ? value.As<v8::Object>() : v8::Local<v8::Object>(); } Commit Message: [Extensions] Expand bindings access checks BUG=601149 BUG=601073 Review URL: https://codereview.chromium.org/1866103002 Cr-Commit-Position: refs/...
0
23,928
Analyze the following 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::DidNotifySubtreeInsertionsToDocument() { ListAttributeTargetChanged(); } Commit Message: MacViews: Enable secure text input for password Textfields. In Cocoa the NSTextInputContext automatically enables secure text input when activated and it's in the secure text entry mode. RenderWidg...
0
11,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 NavigationControllerImpl::RendererDidNavigateToNewPage( RenderFrameHostImpl* rfh, const FrameHostMsg_DidCommitProvisionalLoad_Params& params, bool is_same_document, bool replace_entry, NavigationHandleImpl* handle) { std::unique_ptr<NavigationEntryImpl> new_entry; bool update_virtual_...
0
7,149
Analyze the following 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::Clipboard* CreateClipboard() { return BrowserPlatformIntegration::GetInstance()->CreateClipboard(); } Commit Message: CWE ID: CWE-20
0
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 inline struct kmem_cache_node *get_node(struct kmem_cache *s, int node) { #ifdef CONFIG_NUMA return s->node[node]; #else return &s->local_node; #endif } Commit Message: remove div_long_long_rem x86 is the only arch right now, which provides an optimized for div_long_long_rem and it has the downside tha...
0
8,431
Analyze the following 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 iscsi_check_acceptor_state(struct iscsi_param *param, char *value, struct iscsi_conn *conn) { u8 acceptor_boolean_value = 0, proposer_boolean_value = 0; char *negoitated_value = NULL; if (IS_PSTATE_ACCEPTOR(param)) { pr_err("Received key \"%s\" twice, protocol error.\n", param->name); r...
0
25,759
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: RenderFrameHostImpl::CreateInitiatorSpecificURLLoaderFactories( const base::flat_set<url::Origin>& initiator_origins) { URLLoaderFactoryBundleInfo::OriginMap result; for (const url::Origin& initiator : initiator_origins) { network::mojom::URLLoaderFactoryPtrInfo factory_info; CreateNetworkServiceD...
0
17,697
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static MagickBooleanType IsVICAR(const unsigned char *magick, const size_t length) { if (length < 14) return(MagickFalse); if (LocaleNCompare((const char *) magick,"LBLSIZE",7) == 0) return(MagickTrue); if (LocaleNCompare((const char *) magick,"NJPL1I",6) == 0) return(MagickTrue); if (Locale...
0
29,902
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static 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
20,759
Analyze the following 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 offset_il_node(struct mempolicy *pol, struct vm_area_struct *vma, unsigned long n) { unsigned nnodes = nodes_weight(pol->v.nodes); unsigned target; int i; int nid; if (!nnodes) return numa_node_id(); target = (unsigned int)n % nnodes; nid = first_node(pol->v.nodes); for (i = 0...
0
16,231
Analyze the following 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 MagickBooleanType WritePSDImage(const ImageInfo *image_info, Image *image) { char layer_name[MaxTextExtent]; const char *property; const StringInfo *icc_profile, *info; Image *base_image, *next_image; MagickBooleanType status; MagickOffsetType *layer_size_...
0
11,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: CIFSSMBQFSInfo(const int xid, struct cifs_tcon *tcon, struct kstatfs *FSData) { /* level 0x103 SMB_QUERY_FILE_SYSTEM_INFO */ TRANSACTION2_QFSI_REQ *pSMB = NULL; TRANSACTION2_QFSI_RSP *pSMBr = NULL; FILE_SYSTEM_INFO *response_data; int rc = 0; int bytes_returned = 0; __u16 params, byte_count; cFYI(1, "In Q...
0
25,424
Analyze the following 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 V8TestObject::FloatAttributeAttributeSetterCallback( const v8::FunctionCallbackInfo<v8::Value>& info) { RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_floatAttribute_Setter"); v8::Local<v8::Value> v8_value = info[0]; test_object_v8_internal::FloatAttributeAttrib...
0
28,765
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: person_set_offset(person_t* person, point2_t offset) { person->x_offset = offset.x; person->y_offset = offset.y; } Commit Message: Fix integer overflow in layer_resize in map_engine.c (#268) * Fix integer overflow in layer_resize in map_engine.c There's a buffer overflow bug in the function layer_resize. I...
0
1,134
Analyze the following 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_nonprimary_guard_idle_timeout(void) { return networkstatus_get_param(NULL, "guard-nonprimary-guard-idle-timeout", DFLT_NONPRIMARY_GUARD_IDLE_TIMEOUT, 1, INT32_MAX); } Commit Message: Consider the exit family ...
0
1,953
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: XID GetX11WindowFromGdkWindow(GdkWindow* window) { return GDK_WINDOW_XID(window); } Commit Message: Make shared memory segments writable only by their rightful owners. BUG=143859 TEST=Chrome's UI still works on Linux and Chrome OS Review URL: https://chromiumcodereview.appspot.com/10854242 git-svn-id: svn://...
0
5,837
Analyze the following 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 vpx_img_flip(vpx_image_t *img) { /* Note: In the calculation pointer adjustment calculation, we want the * rhs to be promoted to a signed type. Section 6.3.1.8 of the ISO C99 * standard indicates that if the adjustment parameter is unsigned, the * stride parameter will be promoted to unsigned, caus...
0
23,647
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int trunc_start(struct inode *inode, u64 oldsize, u64 newsize) { struct gfs2_inode *ip = GFS2_I(inode); struct gfs2_sbd *sdp = GFS2_SB(inode); struct address_space *mapping = inode->i_mapping; struct buffer_head *dibh; int journaled = gfs2_is_jdata(ip); int error; error = gfs2_trans_begin(sdp, ...
0
21,696
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GC_API void * GC_CALL GC_generic_malloc(size_t lb, int k) { void * result; DCL_LOCK_STATE; if (EXPECT(GC_have_errors, FALSE)) GC_print_all_errors(); GC_INVOKE_FINALIZERS(); if (SMALL_OBJ(lb)) { LOCK(); result = GC_generic_malloc_inner((word)lb, k); UNLOCK(); ...
0
1,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: status_t CameraClient::startPreviewMode() { LOG1("startPreviewMode"); status_t result = NO_ERROR; if (mHardware->previewEnabled()) { return NO_ERROR; } if (mPreviewWindow != 0) { native_window_set_scaling_mode(mPreviewWindow.get(), NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW); ...
0
16,345
Analyze the following 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 PageHandler::NavigationReset(NavigationRequest* navigation_request) { if (!navigate_callback_) return; WebContentsImpl* web_contents = GetWebContents(); if (!web_contents) { navigate_callback_->sendFailure(Response::InternalError()); return; } std::string frame_id = web_contents-...
0
11,092
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int crypto_fpu_init_tfm(struct crypto_tfm *tfm) { struct crypto_instance *inst = crypto_tfm_alg_instance(tfm); struct crypto_spawn *spawn = crypto_instance_ctx(inst); struct crypto_fpu_ctx *ctx = crypto_tfm_ctx(tfm); struct crypto_blkcipher *cipher; cipher = crypto_spawn_blkcipher(spawn); if (IS_ERR...
0
27,953
Analyze the following 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 br_nf_dev_queue_xmit(struct sk_buff *skb) { return br_dev_queue_push_xmit(skb); } Commit Message: bridge: reset IPCB in br_parse_ip_options Commit 462fb2af9788a82 (bridge : Sanitize skb before it enters the IP stack), missed one IPCB init before calling ip_options_compile() Thanks to Scot Do...
0
17,791
Analyze the following 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 Dispatcher::OnUnloaded(const std::string& id) { if (!RendererExtensionRegistry::Get()->Remove(id)) return; active_extension_ids_.erase(id); script_injection_manager_->OnExtensionUnloaded(id); ScriptInjection::RemoveIsolatedWorld(id); std::set<ScriptContext*> removed_contexts = script_...
0
4,343
Analyze the following 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 WriteFromUrlOperation::OnURLFetchDownloadProgress( const net::URLFetcher* source, int64_t current, int64_t total, int64_t current_network_bytes) { DCHECK_CURRENTLY_ON(BrowserThread::FILE); if (IsCancelled()) { url_fetcher_.reset(NULL); } int progress = (kProgressComplete * curre...
0
9,091
Analyze the following 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_get_challenge(sc_card_t *card, u8 *rnd, size_t len) { /* CAC requires 8 byte response */ u8 rbuf[8]; u8 *rbufp = &rbuf[0]; size_t out_len = sizeof rbuf; int r; LOG_FUNC_CALLED(card->ctx); r = cac_apdu_io(card, 0x84, 0x00, 0x00, NULL, 0, &rbufp, &out_len); LOG_TEST_RET(card->ctx, r, "Could...
0
26,988
Analyze the following 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 futex_lock_pi(u32 __user *uaddr, unsigned int flags, int detect, ktime_t *time, int trylock) { struct hrtimer_sleeper timeout, *to = NULL; struct futex_hash_bucket *hb; struct futex_q q = futex_q_init; int res, ret; if (refill_pi_state_cache()) return -ENOMEM; if (time) { to = &timeout;...
0
19,220
Analyze the following 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 dev_new_index(struct net *net) { int ifindex = net->ifindex; for (;;) { if (++ifindex <= 0) ifindex = 1; if (!__dev_get_by_index(net, ifindex)) return net->ifindex = ifindex; } } Commit Message: tunnels: Don't apply GRO to multiple layers of encapsulation. When drivers express support fo...
0
9,431
Analyze the following 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 CCLayerTreeHost::composite() { ASSERT(!m_settings.enableCompositorThread); static_cast<CCSingleThreadProxy*>(m_proxy.get())->compositeImmediately(); } Commit Message: [chromium] Fix shutdown race when posting main thread task to CCThreadProxy and enable tests https://bugs.webkit.org/show_bug.cgi?id=...
0
23,037
Analyze the following 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 webkit_web_view_get_preferred_width(GtkWidget* widget, gint* minimum, gint* natural) { WebKitWebView* web_view = WEBKIT_WEB_VIEW(widget); Frame* coreFrame = core(webkit_web_view_get_main_frame(web_view)); if (!coreFrame) return; FrameView* view = coreFrame->view(); if (!vi...
0
27,490
Analyze the following 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 uas_stat_cmplt(struct urb *urb) { struct iu *iu = urb->transfer_buffer; struct Scsi_Host *shost = urb->context; struct uas_dev_info *devinfo = (struct uas_dev_info *)shost->hostdata; struct urb *data_in_urb = NULL; struct urb *data_out_urb = NULL; struct scsi_cmnd *cmnd; struct uas_cmd_info *cm...
0
29,664
Analyze the following 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 OfflinePageModelImpl::OnMarkPageAccesseDone( const OfflinePageItem& offline_page_item, std::unique_ptr<OfflinePagesUpdateResult> result) { if (result->updated_items.size() > 0) offline_pages_[offline_page_item.offline_id] = offline_page_item; } Commit Message: Add the method to check if offli...
0
4,063
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: cancel_link_info_for_file (NautilusDirectory *directory, NautilusFile *file) { if (directory->details->link_info_read_state != NULL && directory->details->link_info_read_state->file == file) { link_info_cancel (directory); } } Commit Message: mime-actio...
0
15,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 _TIFFFillStrilesInternal( TIFF *tif, int loadStripByteCount ) { #if defined(DEFER_STRILE_LOAD) register TIFFDirectory *td = &tif->tif_dir; int return_value = 1; if( td->td_stripoffset != NULL ) return 1; if( td->td_stripoffset_entry.tdir_count == 0 ) ...
0
13,341
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int __init crypto_module_init(void) { return crypto_register_template(&crypto_tmpl); } Commit Message: crypto: include crypto- module prefix in template This adds the module loading prefix "crypto-" to the template lookup as well. For example, attempting to load 'vfat(blowfish)' via AF_ALG now correctl...
0
20,395
Analyze the following 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 ChromeClientImpl::AttachRootLayer(WebLayer* root_layer, LocalFrame* local_frame) { WebLocalFrameImpl* web_frame = WebLocalFrameImpl::FromFrame(local_frame)->LocalRoot(); DCHECK(web_frame->FrameWidget() || !root_layer); if (web_frame->FrameWidget()) web_...
0
26,223
Analyze the following 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 GfxDeviceRGBColorSpace::getGray(GfxColor *color, GfxGray *gray) { *gray = clip01((GfxColorComp)(0.3 * color->c[0] + 0.59 * color->c[1] + 0.11 * color->c[2] + 0.5)); } Commit Message: CWE ID: CWE-189
0
6,381
Analyze the following 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 WebContentsImpl::IsConnectedToBluetoothDevice() const { return bluetooth_connected_device_count_ > 0; } Commit Message: If JavaScript shows a dialog, cause the page to lose fullscreen. BUG=670135, 550017, 726761, 728276 Review-Url: https://codereview.chromium.org/2906133004 Cr-Commit-Position: refs/head...
0
14,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: status_t MediaRecorder::init() { ALOGV("init"); if (mMediaRecorder == NULL) { ALOGE("media recorder is not initialized yet"); return INVALID_OPERATION; } if (!(mCurrentState & MEDIA_RECORDER_IDLE)) { ALOGE("init called in an invalid state(%d)", mCurrentState); return INVALID_OPERATION; }...
0
12,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: static void dispatch_reassembled(BT_HDR *packet) { assert((packet->event & MSG_EVT_MASK) != MSG_HC_TO_STACK_HCI_EVT); assert(upwards_data_queue != NULL); if (upwards_data_queue) { fixed_queue_enqueue(upwards_data_queue, packet); } else { LOG_ERROR("%s had no queue to place upwards data packet in. D...
0
15,391
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: QUrl QQuickWebView::url() const { Q_D(const QQuickWebView); RefPtr<WebFrameProxy> mainFrame = d->webPageProxy->mainFrame(); if (!mainFrame) return QUrl(); return QUrl(QString(mainFrame->url())); } Commit Message: [Qt][WK2] Allow transparent WebViews https://bugs.webkit.org/show_bug.cgi?id...
0
18,756
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GF_Err txtc_Read(GF_Box *s, GF_BitStream *bs) { u32 size, i; char *str; GF_TextConfigBox *ptr = (GF_TextConfigBox*)s; size = (u32) ptr->size; str = (char *)gf_malloc(sizeof(char)*size); i=0; while (size) { str[i] = gf_bs_read_u8(bs); size--; if (!str[i]) break; i++; } if (i) ptr->config = g...
0
21,628
Analyze the following 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 plist_data_hash(const void* key) { plist_data_t data = plist_get_data((plist_t) key); unsigned int hash = data->type; unsigned int i = 0; char *buff = NULL; unsigned int size = 0; switch (data->type) { case PLIST_BOOLEAN: case PLIST_UINT: case PLIST_R...
0
29,596
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Range::CompareResults Range::compareNode(Node* refNode, ExceptionCode& ec) const { if (!refNode) { ec = NOT_FOUND_ERR; return NODE_BEFORE; } if (!m_start.container() && refNode->attached()) { ec = INVALID_STATE_ERR; return NODE_BEFORE; } if (m_start.conta...
0
22,392
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: XML_DefaultCurrent(XML_Parser parser) { if (parser == NULL) return; if (parser->m_defaultHandler) { if (parser->m_openInternalEntities) reportDefault(parser, parser->m_internalEncoding, parser->m_openInternalEntities->internalEventPtr, parser->m_openIntern...
0
10,630
Analyze the following 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 MediaStreamImpl::EnsurePeerConnectionFactory() { DCHECK(CalledOnValidThread()); if (!signaling_thread_) { jingle_glue::JingleThreadWrapper::EnsureForCurrentThread(); jingle_glue::JingleThreadWrapper::current()->set_send_allowed(true); signaling_thread_ = jingle_glue::JingleThreadWrapper::curr...
0
11,263
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: netlink_update_listeners(struct sock *sk) { struct netlink_table *tbl = &nl_table[sk->sk_protocol]; unsigned long mask; unsigned int i; struct listeners *listeners; listeners = nl_deref_protected(tbl->listeners); if (!listeners) return; for (i = 0; i < NLGRPLONGS(tbl->groups); i++) { mask = 0; sk_f...
0
25,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: static unsigned int fuse_req_hash(u64 unique) { return hash_long(unique & ~FUSE_INT_REQ_BIT, FUSE_PQ_HASH_BITS); } Commit Message: Merge branch 'page-refs' (page ref overflow) Merge page ref overflow branch. Jann Horn reported that he can overflow the page ref count with sufficient memory (and a filesystem th...
0
10,607
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void hwsim_mcast_del_radio(int id, const char *hwname, struct genl_info *info) { struct sk_buff *skb; void *data; int ret; skb = genlmsg_new(GENLMSG_DEFAULT_SIZE, GFP_KERNEL); if (!skb) return; data = genlmsg_put(skb, 0, 0, &hwsim_genl_family, 0, HWSIM_CMD_DEL_RADIO); if (!data) go...
0
28,138
Analyze the following 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 DCTStream::close() { int i, j; for (i = 0; i < 4; ++i) { for (j = 0; j < 32; ++j) { gfree(rowBuf[i][j]); rowBuf[i][j] = NULL; } gfree(frameBuf[i]); frameBuf[i] = NULL; } FilterStream::close(); } Commit Message: CWE ID: CWE-119
0
1,044
Analyze the following 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 Shutdown(int exit_code) { DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); if (shutting_down_) return; shutting_down_ = true; exit_code_ = exit_code; if (host_) { host_->Shutdown(base::Bind( &HostProcess::OnShutdownFinished, base::Unretained(thi...
0
26,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: pch_newfirst (void) { return p_newfirst; } Commit Message: CWE ID: CWE-78
0
1,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: static int parse_options(char *options, struct super_block *sb, unsigned long *journal_devnum, unsigned int *journal_ioprio, ext4_fsblk_t *n_blocks_count, int is_remount) { struct ext4_sb_info *sbi = EXT4_SB(sb); char *p; substring_t args[MAX_OPT_ARGS]; int data_opt = 0; int option; #ifdef CONFIG...
1
9,191
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GahpClient::setDelegProxy( Proxy *proxy ) { if ( !server->can_cache_proxies ) { return; } if ( deleg_proxy != NULL && proxy == deleg_proxy->proxy ) { return; } if ( deleg_proxy != NULL ) { server->UnregisterProxy( deleg_proxy->proxy ); } GahpProxyInfo *gahp_proxy = server->RegisterProxy( proxy ); AS...
0
10,390
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PHP_METHOD(snmp, getError) { php_snmp_object *snmp_object; zval *object = getThis(); snmp_object = Z_SNMP_P(object); RETURN_STRING(snmp_object->snmp_errstr); } Commit Message: CWE ID: CWE-20
0
5,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 void php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAMETERS, xmlwriter_read_one_char_t internal_function, char *err_string) { zval *pind; xmlwriter_object *intern; xmlTextWriterPtr ptr; char *name; int name_len, retval; #ifdef ZEND_ENGINE_2 zval *this = getThis(); if (this) { if (zend_parse_para...
0
10,635
Analyze the following 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 process_named_entity_html(const char **buf, const char **start, size_t *length) { *start = *buf; /* "&" is represented by a 0x26 in all supported encodings. That means * the byte after represents a character or is the leading byte of an * sequence of 8-bit code units. If in the ranges bel...
0
24,171
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: getu32(int swap, uint32_t value) { union { uint32_t ui; char c[4]; } retval, tmpval; if (swap) { tmpval.ui = value; retval.c[0] = tmpval.c[3]; retval.c[1] = tmpval.c[2]; retval.c[2] = tmpval.c[1]; retval.c[3] = tmpval.c[0]; return retval.ui; } else return value; } Commit Message: Avoid O...
0
8,919
Analyze the following 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 _radius_close(zend_rsrc_list_entry *rsrc TSRMLS_DC) { radius_descriptor *raddesc = (radius_descriptor *)rsrc->ptr; rad_close(raddesc->radh); efree(raddesc); } Commit Message: Fix a security issue in radius_get_vendor_attr(). The underlying rad_get_vendor_attr() function assumed that it would always be g...
0
9,614
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gdImagePtr gdImageScaleBicubicFixed(gdImagePtr src, const unsigned int width, const unsigned int height) { const long new_width = MAX(1, width); const long new_height = MAX(1, height); const int src_w = gdImageSX(src); const int src_h = gdImageSY(src); const gdFixed f_dx = gd_ftofx((float)src_w / (float)new_...
0
9,507
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void x25_kill_by_neigh(struct x25_neigh *nb) { struct sock *s; write_lock_bh(&x25_list_lock); sk_for_each(s, &x25_list) if (x25_sk(s)->neighbour == nb) x25_disconnect(s, ENETUNREACH, 0, 0); write_unlock_bh(&x25_list_lock); /* Remove any related forwards */ x25_clear_forward_by_dev(nb->dev); } Comm...
0
3,918
Analyze the following 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_get_bidder(struct archive_read *a, struct archive_read_filter_bidder **bidder) { int i, number_slots; number_slots = sizeof(a->bidders) / sizeof(a->bidders[0]); for (i = 0; i < number_slots; i++) { if (a->bidders[i].bid == NULL) { memset(a->bidders + i, 0, sizeof(a->bidders[0])); *...
0
18,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: _pango_emoji_iter_init (PangoEmojiIter *iter, const char *text, int length) { iter->text_start = text; if (length >= 0) iter->text_end = text + length; else iter->text_end = text + strlen (text); iter->start = text; iter->end = text; iter->is_emoji = (gboolean) 2; /* HAC...
0
25,137
Analyze the following 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 setenv_cstp_opts(struct openconnect_info *vpninfo) { char *env_buf; int buflen = 0; int bufofs = 0; struct vpn_option *opt; for (opt = vpninfo->cstp_options; opt; opt = opt->next) buflen += 2 + strlen(opt->option) + strlen(opt->value); env_buf = malloc(buflen + 1); if (!env_buf) return; ...
0
23,250
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static unsigned uivector_copy(uivector* p, const uivector* q) { size_t i; if(!uivector_resize(p, q->size)) return 0; for(i = 0; i < q->size; i++) p->data[i] = q->data[i]; return 1; } Commit Message: Fixed #5645: realloc return handling CWE ID: CWE-772
0
5,446
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: device_partition_create (Device *device, guint64 offset, guint64 size, const char *type, const char *label, char **flags, char **options, c...
0
21,478
Analyze the following 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 tcp_v4_md5_do_del(struct sock *sk, __be32 addr) { struct tcp_sock *tp = tcp_sk(sk); int i; for (i = 0; i < tp->md5sig_info->entries4; i++) { if (tp->md5sig_info->keys4[i].addr == addr) { /* Free the key */ kfree(tp->md5sig_info->keys4[i].base.key); tp->md5sig_info->entries4--; if (tp->md5si...
0
2,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: static MagickBooleanType ReadPSDMergedImage(const ImageInfo *image_info, Image* image,const PSDInfo* psd_info,ExceptionInfo *exception) { MagickOffsetType *sizes; MagickBooleanType status; PSDCompressionType compression; register ssize_t i; compression=(PSDCompressionType) ReadBlob...
0
8,364
Analyze the following 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 svm_vcpu_load(struct kvm_vcpu *vcpu, int cpu) { struct vcpu_svm *svm = to_svm(vcpu); int i; if (unlikely(cpu != vcpu->cpu)) { svm->asid_generation = 0; mark_all_dirty(svm->vmcb); } #ifdef CONFIG_X86_64 rdmsrl(MSR_GS_BASE, to_svm(vcpu)->host.gs_base); #endif savesegment(fs, svm->host.fs); ...
0
1,317
Analyze the following 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::MarkInitiatorAsRequiringSeparateURLLoaderFactory( const url::Origin& initiator_origin, network::mojom::URLLoaderFactoryPtr url_loader_factory) { DCHECK(base::FeatureList::IsEnabled(network::features::kNetworkService)); GetLoaderFactoryBundle(); auto factory_bundle = std::make_...
0
26,493
Analyze the following 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 spl_array_skip_protected(spl_array_object *intern, HashTable *aht TSRMLS_DC) /* {{{ */ { char *string_key; uint string_length; ulong num_key; if (Z_TYPE_P(intern->array) == IS_OBJECT) { do { if (zend_hash_get_current_key_ex(aht, &string_key, &string_length, &num_key, 0, &intern->pos) == HASH_...
0
19,773
Analyze the following 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 HTMLSelectElement::childShouldCreateRenderer(const NodeRenderingContext& childContext) const { if (!HTMLFormControlElementWithState::childShouldCreateRenderer(childContext)) return false; if (!usesMenuList()) return childContext.node()->hasTagName(HTMLNames::optionTag) || isHTMLOptGro...
0
13,953
Analyze the following 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 XSSAuditor::IsLikelySafeResource(const String& url) { if (url.IsEmpty() || url == BlankURL().GetString()) return true; if (document_url_.Host().IsEmpty()) return false; KURL resource_url(document_url_, url); return (document_url_.Host() == resource_url.Host() && resource_url.Query...
0
22,656