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: method_entry_loop(mrb_state *mrb, struct RClass* klass, khash_t(st)* set) { khint_t i; khash_t(mt) *h = klass->mt; if (!h || kh_size(h) == 0) return; for (i=0;i<kh_end(h);i++) { if (kh_exist(h, i)) { mrb_method_t m = kh_value(h, i); if (MRB_METHOD_UNDEF_P(m)) continue; kh_put(st, mr...
0
82,172
Analyze the following 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 super_block *get_super_thawed(struct block_device *bdev) { while (1) { struct super_block *s = get_super(bdev); if (!s || s->s_writers.frozen == SB_UNFROZEN) return s; up_read(&s->s_umount); wait_event(s->s_writers.wait_unfrozen, s->s_writers.frozen == SB_UNFROZEN); put_super(s); } } ...
0
46,190
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PHPAPI php_stream *php_stream_generic_socket_factory(const char *proto, size_t protolen, const char *resourcename, size_t resourcenamelen, const char *persistent_id, int options, int flags, struct timeval *timeout, php_stream_context *context STREAMS_DC) { php_stream *stream = NULL; php_netstream_data_t...
0
67,777
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void stat_remove(SpiceStatNode *node) { pthread_mutex_lock(&reds->stat_lock); node->flags &= ~SPICE_STAT_NODE_FLAG_ENABLED; reds->stat->generation++; reds->stat->num_of_nodes--; pthread_mutex_unlock(&reds->stat_lock); } Commit Message: CWE ID: CWE-119
0
1,999
Analyze the following 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 dns_packet_validate(DnsPacket *p) { assert(p); if (p->size < DNS_PACKET_HEADER_SIZE) return -EBADMSG; if (p->size > DNS_PACKET_SIZE_MAX) return -EBADMSG; return 1; } Commit Message: resolved: bugfix of null pointer p->question dereferencing (...
0
64,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: static v8::Handle<v8::Value> supplementalMethod1Callback(const v8::Arguments& args) { INC_STATS("DOM.TestInterface.supplementalMethod1"); TestInterface* imp = V8TestInterface::toNative(args.Holder()); TestSupplemental::supplementalMethod1(imp); return v8::Handle<v8::Value>(); } Commit Message: [V...
0
109,492
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int isFileInVirtualDir( /*! [in] Directory path to be tested for virtual directory. */ char *filePath) { virtualDirList *pCurVirtualDir; size_t webDirLen; pCurVirtualDir = pVirtualDirList; while (pCurVirtualDir != NULL) { webDirLen = strlen(pCurVirtualDir->dirName); if (webDirLen) { if (pCurV...
0
73,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: void Browser::OpenPasswordManager() { UserMetrics::RecordAction(UserMetricsAction("Options_ShowPasswordManager")); ShowOptionsTab(chrome::kPasswordManagerSubPage); } Commit Message: Implement a bubble that appears at the top of the screen when a tab enters fullscreen mode via webkitRequestFullScreen(), tell...
0
97,311
Analyze the following 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 snd_timer_user_read(struct file *file, char __user *buffer, size_t count, loff_t *offset) { struct snd_timer_user *tu; long result = 0, unit; int qhead; int err = 0; tu = file->private_data; unit = tu->tread ? sizeof(struct snd_timer_tread) : sizeof(struct snd_timer_read); spin_l...
1
170,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: static const char *register_named_block_function_hook(const char *name, cmd_parms *cmd, void *mconfig, const char *line) { const char *function = NU...
0
35,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: TreeWalker* Document::createTreeWalker(Node* root, unsigned what_to_show, V8NodeFilter* filter) { DCHECK(root); return TreeWalker::Create(root, what_to_show, filter); } Commit Message: Cleanup and remove dead code in SetFocusedElem...
0
129,955
Analyze the following 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 oidc_clean_expired_state_cookies(request_rec *r, oidc_cfg *c, const char *currentCookieName, int delete_oldest) { int number_of_valid_state_cookies = 0; oidc_state_cookies_t *first = NULL, *last = NULL; char *cookie, *tokenizerCtx = NULL; char *cookies = apr_pstrdup(r->pool, oidc_util_hdr_in_cook...
0
87,060
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: compat_do_ipt_set_ctl(struct sock *sk, int cmd, void __user *user, unsigned int len) { int ret; if (!ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN)) return -EPERM; switch (cmd) { case IPT_SO_SET_REPLACE: ret = compat_do_replace(sock_net(sk), user, len); break; case IPT_SO_SET_ADD_COUNTERS:...
0
84,989
Analyze the following 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 handle_tx(struct vhost_net *net) { struct vhost_net_virtqueue *nvq = &net->vqs[VHOST_NET_VQ_TX]; struct vhost_virtqueue *vq = &nvq->vq; unsigned out, in, s; int head; struct msghdr msg = { .msg_name = NULL, .msg_namelen = 0, .msg_control = NULL, .msg_controllen = 0, .msg_iov = vq->iov, ...
0
39,946
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: CreateWebKitSessionDescription( const webrtc::SessionDescriptionInterface* native_desc) { if (!native_desc) { LOG(ERROR) << "Native session description is null."; return blink::WebRTCSessionDescription(); } std::string sdp; if (!native_desc->ToString(&sdp)) { LOG(ERROR) << "Failed to get ...
0
152,936
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: TestCase& TabletMode() { tablet_mode = true; return *this; } Commit Message: [Files app] Fix open new window command Change background page |launcher| namesspace to use var instead of const to be accessible in the foreground page. Test: --gtest_filter="KeyboardOperations/FilesAppBrowserTest.Test/ke...
0
130,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: int nfc_genl_se_added(struct nfc_dev *dev, u32 se_idx, u16 type) { struct sk_buff *msg; void *hdr; msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); if (!msg) return -ENOMEM; hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, NFC_EVENT_SE_ADDED); if (!hdr) goto free_msg; if (nla_put_u32(msg, NFC_...
0
89,455
Analyze the following 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 trep_del(GF_Box *s) { GF_TrackExtensionPropertiesBox *ptr = (GF_TrackExtensionPropertiesBox *)s; if (ptr == NULL) return; gf_free(ptr); } Commit Message: fixed 2 possible heap overflows (inc. #1088) CWE ID: CWE-125
0
80,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: and_code_range_buf(BBuf* bbuf1, int not1, BBuf* bbuf2, int not2, BBuf** pbuf) { int r; OnigCodePoint i, j, n1, n2, *data1, *data2; OnigCodePoint from, to, from1, to1, from2, to2; *pbuf = (BBuf* )NULL; if (IS_NULL(bbuf1)) { if (not1 != 0 && IS_NOT_NULL(bbuf2)) /* not1 != 0 -> not2 == 0 */ retu...
0
64,703
Analyze the following 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 LayerTreeHostImpl::SetViewportSize(const gfx::Size& device_viewport_size) { if (device_viewport_size == device_viewport_size_) return; TRACE_EVENT_INSTANT2("cc", "LayerTreeHostImpl::SetViewportSize", TRACE_EVENT_SCOPE_THREAD, "width", device_viewport_size...
0
137,383
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: long Cluster::Load(long long& pos, long& len) const { assert(m_pSegment); assert(m_pos >= m_element_start); if (m_timecode >= 0) //at least partially loaded return 0; assert(m_pos == m_element_start); assert(m_element_size < 0); IMkvReader* const pReader = m_pSegment->m_pRea...
1
174,393
Analyze the following 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 CreatePictureFromSkiaPixmap(Display* display, XID pixmap) { XID picture = XRenderCreatePicture( display, pixmap, GetRenderARGB32Format(display), 0, NULL); return picture; } Commit Message: Make shared memory segments writable only by their rightful owners. BUG=143859 TEST=Chrome's UI still works ...
0
119,151
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: sch_handle_egress(struct sk_buff *skb, int *ret, struct net_device *dev) { struct tcf_proto *cl = rcu_dereference_bh(dev->egress_cl_list); struct tcf_result cl_res; if (!cl) return skb; /* qdisc_skb_cb(skb)->pkt_len was already set by the caller. */ qdisc_bstats_cpu_update(cl->q, skb); switch (tcf_clas...
0
93,458
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: LayoutUnit RenderFlexibleBox::crossAxisIntrinsicExtentForChild(RenderBox* child) const { return isHorizontalFlow() ? childIntrinsicHeight(child) : childIntrinsicWidth(child); } Commit Message: Separate repaint and layout requirements of StyleDifference (Step 1) Previously StyleDifference was an enum that pr...
0
116,654
Analyze the following 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 on_failed_event(const char *event_name) { /* Don't show the 'on failure' button if the processed event * was started by that button. (avoid infinite loop) */ if (strcmp(event_name, EMERGENCY_ANALYSIS_EVENT_NAME) == 0) return; add_warning( _("Processing of the problem fail...
0
42,845
Analyze the following 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 nft_unregister_afinfo(struct nft_af_info *afi) { nfnl_lock(NFNL_SUBSYS_NFTABLES); list_del_rcu(&afi->list); nfnl_unlock(NFNL_SUBSYS_NFTABLES); } Commit Message: netfilter: nf_tables: fix flush ruleset chain dependencies Jumping between chains doesn't mix well with flush ruleset. Rules from a different c...
0
58,041
Analyze the following 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 btif_dm_ble_tx_test_cback(void *p) { btif_transfer_context(btif_dm_generic_evt, BTIF_DM_CB_LE_TX_TEST, (char *)p, 1, NULL); } Commit Message: DO NOT MERGE Fix potential DoS caused by delivering signal to BT process Bug: 28885210 Change-Id: I63866d894bfca47464d6e42e3fb0357c4f94d360 Conflicts: ...
0
158,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 int __packet_snd_vnet_parse(struct virtio_net_hdr *vnet_hdr, size_t len) { unsigned short gso_type = 0; if ((vnet_hdr->flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) && (__virtio16_to_cpu(vio_le(), vnet_hdr->csum_start) + __virtio16_to_cpu(vio_le(), vnet_hdr->csum_offset) + 2 > __virtio16_to_cpu...
0
49,153
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static inline void unimac_mdio_writel(struct unimac_mdio_priv *priv, u32 val, u32 offset) { if (IS_ENABLED(CONFIG_MIPS) && IS_ENABLED(CONFIG_CPU_BIG_ENDIAN)) __raw_writel(val, priv->base + offset); else writel_relaxed(val, priv->base + offset); } Commit Message: net: phy: mdio-bcm-unimac: fix pot...
0
83,883
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: format_CT(const struct ofpact_conntrack *a, struct ds *s) { ds_put_format(s, "%sct(%s", colors.paren, colors.end); if (a->flags & NX_CT_F_COMMIT) { ds_put_format(s, "%scommit%s,", colors.value, colors.end); } if (a->recirc_table != NX_CT_RECIRC_NONE) { ds_put_format(s, "%stable=%s%...
0
76,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: static int burl_contains_ctrls (const buffer *b) { const char * const s = b->ptr; const int used = (int)buffer_string_length(b); for (int i = 0; i < used; ++i) { if (s[i] == '%' && (s[i+1] < '2' || (s[i+1] == '7' && s[i+2] == 'F'))) return 1; } return 0; } Commit Message: ...
0
90,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 int vmx_update_pi_irte(struct kvm *kvm, unsigned int host_irq, uint32_t guest_irq, bool set) { struct kvm_kernel_irq_routing_entry *e; struct kvm_irq_routing_table *irq_rt; struct kvm_lapic_irq irq; struct kvm_vcpu *vcpu; struct vcpu_data vcpu_info; int idx, ret = -EINVAL; if (!kvm_arch_ha...
0
48,145
Analyze the following 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 PaintArtifactCompositor::RemoveChildLayers() { cc::LayerTreeHost* host = root_layer_->layer_tree_host(); if (!host) return; for (auto child : root_layer_->children()) { host->UnregisterElement(child->element_id(), cc::ElementListType::ACTIVE); } root_layer_->RemoveAllChildren(); if (extra...
0
125,531
Analyze the following 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 InspectorHandler::TargetCrashed() { frontend_->TargetCrashed(); } Commit Message: DevTools: speculative fix for crash in NetworkHandler::Disable This keeps BrowserContext* and StoragePartition* instead of RenderProcessHost* in an attemp to resolve UAF of RenderProcessHost upon closure of DevTools front-e...
0
148,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: GLint ComputeImageDataSize(GLint width, GLint height) const { GLint row_size = width * bytes_per_pixel_; if (height > 1) { GLint temp = row_size + pack_alignment_ - 1; GLint padded_row_size = (temp / pack_alignment_) * pack_alignment_; GLint size_of_all_but_last_row = (height - 1) * pa...
0
99,346
Analyze the following 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 BackFramebuffer::Create() { ScopedGLErrorSuppressor suppressor("BackFramebuffer::Create", decoder_->GetErrorState()); Destroy(); glGenFramebuffersEXT(1, &id_); } Commit Message: Framebuffer clear() needs to consider the situation some draw buffers are disabled. Th...
0
120,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 HTMLFormControlElement::isDefaultButtonForForm() const { return isSuccessfulSubmitButton() && form() && form()->defaultButton() == this; } Commit Message: Add HTMLFormControlElement::supportsAutofocus to fix a FIXME comment. This virtual function should return true if the form control can hanlde 'autof...
0
113,923
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void nfs4_layoutcommit_release(void *calldata) { struct nfs4_layoutcommit_data *data = calldata; pnfs_cleanup_layoutcommit(data); nfs_post_op_update_inode_force_wcc(data->args.inode, data->res.fattr); put_rpccred(data->cred); nfs_iput_and_deactive(data->inode); kfree(data); } Commit Message...
0
57,147
Analyze the following 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 hls_slice_header(HEVCContext *s) { GetBitContext *gb = &s->HEVClc->gb; SliceHeader *sh = &s->sh; int i, ret; sh->first_slice_in_pic_flag = get_bits1(gb); if ((IS_IDR(s) || IS_BLA(s)) && sh->first_slice_in_pic_flag) { s->seq_decode = (s->seq_decode + 1) & 0xff; ...
1
169,707
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WireToLibRange( xRecordRange *wire_range, XRecordRange *lib_range) { lib_range->core_requests.first = wire_range->coreRequestsFirst; lib_range->core_requests.last = wire_range->coreRequestsLast; lib_range->core_replies.first = wire_range->coreRepliesFirst; lib_range->core_replies.last = wi...
0
8,259
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: qboolean FS_IsExt(const char *filename, const char *ext, int namelen) { int extlen; extlen = strlen(ext); if(extlen > namelen) return qfalse; filename += namelen - extlen; return !Q_stricmp(filename, ext); } Commit Message: All: Don't load .pk3s as .dlls, and don't load user config files from .pk3s CW...
0
95,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: cl_block (GifCtx *ctx) /* table clear for block compress */ { cl_hash ( (count_int) hsize, ctx ); ctx->free_ent = ctx->ClearCode + 2; ctx->clear_flg = 1; output( (code_int)ctx->ClearCode, ctx); } Commit Message: Sync with upstream Even though libgd/libgd#492 is not ...
0
91,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: bool UnprivilegedProcessDelegate::CreateConnectedIpcChannel( const std::string& channel_name, IPC::Listener* delegate, ScopedHandle* client_out, scoped_ptr<IPC::ChannelProxy>* server_out) { scoped_ptr<IPC::ChannelProxy> server; if (!CreateIpcChannel(channel_name, kDaemonIpcSecurityDescriptor, ...
1
171,544
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: YR_API void yr_object_print_data( YR_OBJECT* object, int indent, int print_identifier) { YR_DICTIONARY_ITEMS* dict_items; YR_ARRAY_ITEMS* array_items; YR_STRUCTURE_MEMBER* member; char indent_spaces[32]; int i; indent = yr_min(indent, sizeof(indent_spaces) - 1); memset(indent_spaces, ...
0
66,052
Analyze the following 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 RenderFrameImpl::RunModalPromptDialog( const blink::WebString& message, const blink::WebString& default_value, blink::WebString* actual_value) { base::string16 result; bool ok = RunJavaScriptDialog(JAVASCRIPT_DIALOG_TYPE_PROMPT, message.Utf16(), default_value.U...
0
147,905
Analyze the following 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 network_bind_socket (int fd, const struct addrinfo *ai, const int interface_idx) { #if KERNEL_SOLARIS char loop = 0; #else int loop = 0; #endif int yes = 1; /* allow multiple sockets to use the same PORT number */ if (setsockopt (fd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)) == -1) { ...
0
50,735
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: make_err_msg(const char *name) { gss_buffer_desc buffer; if (name == NULL) { buffer.length = 0; buffer.value = NULL; } else { buffer.length = strlen(name)+1; buffer.value = make_spnego_token(name); } return (buffer); } Commit Message: Fix null deref in SPNEGO acceptor [CVE-2014-4344] When process...
0
36,722
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PaintLayerScrollableArea::GetCompositorAnimationTimeline() const { return layer_->GetLayoutObject() .GetFrameView() ->GetCompositorAnimationTimeline(); } Commit Message: Always call UpdateCompositedScrollOffset, not just for the root layer Bug: 927560 Change-Id: I1d5522aae4f11dd3f5b8947bb089bac1bf...
0
130,043
Analyze the following 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 Textfield::OnBlur() { gfx::RenderText* render_text = GetRenderText(); render_text->set_focused(false); if (PlatformStyle::kTextfieldScrollsToStartOnFocusChange) model_->MoveCursorTo(gfx::SelectionModel(0, gfx::CURSOR_FORWARD)); if (GetInputMethod()) { GetInputMethod()->DetachTextInputClient...
1
171,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: search_text (WebKitWebView *page, GArray *argv, const gboolean forward) { if (argv_idx(argv, 0) && (*argv_idx(argv, 0) != '\0')) { if (g_strcmp0 (uzbl.state.searchtx, argv_idx(argv, 0)) != 0) { webkit_web_view_unmark_text_matches (page); webkit_web_view_mark_text_matches (page,...
0
18,399
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: circle_eq(PG_FUNCTION_ARGS) { CIRCLE *circle1 = PG_GETARG_CIRCLE_P(0); CIRCLE *circle2 = PG_GETARG_CIRCLE_P(1); PG_RETURN_BOOL(FPeq(circle_ar(circle1), circle_ar(circle2))); } Commit Message: Predict integer overflow to avoid buffer overruns. Several functions, mostly type input functions, calculated ...
0
38,848
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: nextproto4_cksum(netdissect_options *ndo, const struct ip *ip, const uint8_t *data, u_int len, u_int covlen, u_int next_proto) { struct phdr { uint32_t src; uint32_t dst; u_char mbz; u_char proto; uint16_t len; } ph; struct cksum_vec vec[2]; /* pseudo-header.. */ ...
0
62,339
Analyze the following 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 dtls1_send_hello_verify_request(SSL *s) { unsigned int msg_len; unsigned char *msg, *buf, *p; if (s->state == DTLS1_ST_SW_HELLO_VERIFY_REQUEST_A) { buf = (unsigned char *)s->init_buf->data; msg = p = &(buf[DTLS1_HM_HEADER_LENGTH]); /* Always use DTLS 1.0 version: see RFC 6347 */ *(p++) = DTLS1...
0
45,189
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: RenderViewHostManager::RenderViewHostManager( RenderViewHostDelegate* render_view_delegate, RenderWidgetHostDelegate* render_widget_delegate, Delegate* delegate) : delegate_(delegate), cross_navigation_pending_(false), render_view_delegate_(render_view_delegate), render_widget_de...
0
115,812
Analyze the following 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 posix_get_realtime_coarse(clockid_t which_clock, struct timespec64 *tp) { *tp = current_kernel_time64(); return 0; } Commit Message: posix-timer: Properly check sigevent->sigev_notify timer_create() specifies via sigevent->sigev_notify the signal delivery for the new timer. The valid modes are SIGE...
0
85,142
Analyze the following 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 ChildProcessSecurityPolicyImpl::RegisterFileSystemPermissionPolicy( storage::FileSystemType type, int policy) { base::AutoLock lock(lock_); file_system_policy_map_[type] = policy; } Commit Message: This patch implements a mechanism for more granular link URL permissions (filtering on scheme/host...
0
125,173
Analyze the following 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 RunLoop::Quit() { if (!origin_task_runner_->RunsTasksInCurrentSequence()) { origin_task_runner_->PostTask( FROM_HERE, base::BindOnce(&RunLoop::Quit, Unretained(this))); return; } quit_called_ = true; if (running_ && delegate_->active_run_loops_.top() == this) { delegate_->Quit()...
0
126,584
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void Document::setDecoder(PassRefPtr<TextResourceDecoder> decoder) { m_decoder = decoder; setEncoding(m_decoder ? m_decoder->encoding() : WTF::TextEncoding()); } Commit Message: Refactoring: Move m_mayDisplaySeamlesslyWithParent down to Document The member is used only in Document, thus no reason to sta...
0
102,861
Analyze the following 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 OMXNodeInstance::useBuffer( OMX_U32 portIndex, const sp<IMemory> &params, OMX::buffer_id *buffer, OMX_U32 allottedSize) { if (params == NULL || buffer == NULL) { ALOGE("b/25884056"); return BAD_VALUE; } Mutex::Autolock autoLock(mLock); if (allottedSize > params->size() || po...
1
174,147
Analyze the following 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 freefieldlist(struct fieldlist *l) { struct fieldlist *n; while (l) { n = l->next; free(l->section); strarray_free(l->fields); free(l->trail); if (l->rock) free(l->rock); free((char *)l); l = n; } } Commit Message: imapd: check for ...
0
95,206
Analyze the following 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 ShouldQuicRaceStaleDNSOnConnection( const VariationParameters& quic_trial_params) { return base::LowerCaseEqualsASCII( GetVariationParam(quic_trial_params, "race_stale_dns_on_connection"), "true"); } Commit Message: Fix a bug in network_session_configurator.cc in which support for HTTPS UR...
0
152,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: void DocumentLoader::addAllArchiveResources(Archive* archive) { if (!m_archiveResourceCollection) m_archiveResourceCollection = adoptPtr(new ArchiveResourceCollection); ASSERT(archive); if (!archive) return; m_archiveResourceCollection->addAllResources(archive); }...
0
105,682
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: NewlibPackagedAppTest() : PackagedAppTest("newlib") { } Commit Message: Fix PPB_Flash_MessageLoop. This CL suspends script callbacks and resource loads while running nested message loop using PPB_Flash_MessageLoop. BUG=569496 Review URL: https://codereview.chromium.org/1559113002 Cr-Commit-Position: refs/h...
0
131,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: GF_Err tref_dump(GF_Box *a, FILE * trace) { gf_isom_box_dump_start(a, "TrackReferenceBox", trace); fprintf(trace, ">\n"); gf_isom_box_dump_done("TrackReferenceBox", a, trace); return GF_OK; } Commit Message: fixed 2 possible heap overflows (inc. #1088) CWE ID: CWE-125
0
80,879
Analyze the following 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_FUNCTION(snmpget) { php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_GET, SNMP_VERSION_1); } Commit Message: CWE ID: CWE-416
0
9,514
Analyze the following 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 pvscsi_vmstate_need_pcie_device(void *opaque) { PVSCSIState *s = PVSCSI(opaque); return !(s->compat_flags & PVSCSI_COMPAT_DISABLE_PCIE); } Commit Message: CWE ID: CWE-399
0
8,459
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: e1000e_read_lgcy_rx_descr(E1000ECore *core, uint8_t *desc, hwaddr *buff_addr) { struct e1000_rx_desc *d = (struct e1000_rx_desc *) desc; *buff_addr = le64_to_cpu(d->buffer_addr); } Commit Message: CWE ID: CWE-835
0
6,026
Analyze the following 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 sig_channel_created(CHANNEL_REC *channel) { g_return_if_fail(IS_CHANNEL(channel)); channel->nicks = g_hash_table_new((GHashFunc) g_istr_hash, (GCompareFunc) g_istr_equal); } Commit Message: Merge branch 'security' into 'master' Security Closes #10 See merge request !17 CWE ID: CWE-416
0
63,703
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: post_post_garbage_hack( httpd_conn* hc ) { char buf[2]; /* If we are in a sub-process, turn on no-delay mode in case we ** previously cleared it. */ if ( sub_process ) httpd_set_ndelay( hc->conn_fd ); /* And read up to 2 bytes. */ (void) read( hc->conn_fd, buf, sizeof(buf) ); ...
0
63,833
Analyze the following 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 RenderViewHostManager::CreateRenderView( SiteInstance* instance, int opener_route_id, bool swapped_out) { CHECK(instance); RenderViewHostImpl* new_render_view_host = static_cast<RenderViewHostImpl*>( GetSwappedOutRenderViewHost(instance)); if (new_render_view_host) { if (!swapped_...
0
115,799
Analyze the following 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::formatForDebugger(char* buffer, unsigned length) const { StringBuilder result; String s; result.append(nodeName()); s = getIdAttribute(); if (s.length() > 0) { if (result.length() > 0) result.appendLiteral("; "); result.appendLiteral("id="); ...
0
112,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: void ShellContentUtilityClient::RegisterNetworkBinders( service_manager::BinderRegistry* registry) { network_service_test_helper_->RegisterNetworkBinders(registry); } Commit Message: Fix content_shell with network service enabled not loading pages. This regressed in my earlier cl r528763. This is a relan...
0
131,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: netdutils::Status XfrmController::ipSecDeleteSecurityAssociation( int32_t transformId, const std::string& sourceAddress, const std::string& destinationAddress, int32_t spi, int32_t markValue, int32_t markMask) { ALOGD("XfrmController:%s, line=%d", __FUNCTION__, __LINE__); ALOGD("transformId=%d", transfo...
0
162,715
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: do_bundle_commit(struct ofconn *ofconn, uint32_t id, uint16_t flags) { struct ofproto *ofproto = ofconn_get_ofproto(ofconn); ovs_version_t version = ofproto->tables_version + 1; struct ofp_bundle *bundle; struct ofp_bundle_entry *be; enum ofperr error; bundle = ofconn_get_bundle(ofconn, i...
0
77,221
Analyze the following 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 rpc_task *__nlm_async_call(struct nlm_rqst *req, u32 proc, struct rpc_message *msg, const struct rpc_call_ops *tk_ops) { struct nlm_host *host = req->a_host; struct rpc_clnt *clnt; struct rpc_task_setup task_setup_data = { .rpc_message = msg, .callback_ops = tk_ops, .callback_data = req, ...
0
34,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: mm_audit_run_command(const char *command) { Buffer m; debug3("%s entering command %s", __func__, command); buffer_init(&m); buffer_put_cstring(&m, command); mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUDIT_COMMAND, &m); buffer_free(&m); } Commit Message: Don't resend username to PAM; it already has...
0
42,136
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static struct xfrm_policy *pfkey_compile_policy(struct sock *sk, int opt, u8 *data, int len, int *dir) { struct net *net = sock_net(sk); struct xfrm_policy *xp; struct sadb_x_policy *pol = (struct sadb_x_policy*)data; struct sadb_x_sec_ctx *sec_ctx; switch (sk->sk_family) { case AF_INET: if (opt !=...
0
31,409
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: trash_or_delete_internal (GList *files, GtkWindow *parent_window, gboolean try_trash, NautilusDeleteCallback done_callback, gpointer done_callback_da...
0
61,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: GLenum WebGLRenderingContextBase::checkFramebufferStatus(GLenum target) { if (isContextLost()) return GL_FRAMEBUFFER_UNSUPPORTED; if (!ValidateFramebufferTarget(target)) { SynthesizeGLError(GL_INVALID_ENUM, "checkFramebufferStatus", "invalid target"); return 0; } WebGLFra...
0
133,779
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void add_background(ASS_Renderer *render_priv, EventImages *event_images) { void *nbuffer = ass_aligned_alloc(1, event_images->width * event_images->height, false); if (!nbuffer) return; memset(nbuffer, 0xFF, event_images->width * event_images->height); ASS_Image *img = my_draw_bitm...
0
73,339
Analyze the following 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 unsigned short cma_family(struct rdma_id_private *id_priv) { return id_priv->id.route.addr.src_addr.ss_family; } Commit Message: IB/core: Don't resolve passive side RoCE L2 address in CMA REQ handler The code that resolves the passive side source MAC within the rdma_cm connection request handler ...
0
38,475
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int socket_connect_unix(const char *filename) { struct sockaddr_un name; int sfd = -1; size_t size; struct stat fst; if (stat(filename, &fst) != 0) { if (verbose >= 2) fprintf(stderr, "%s: stat '%s': %s\n", __func__, filename, strerror(errno)); return -1; } if (!S_ISSOCK(fst.st_mode)) { if (...
0
52,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 srpt_get_ioc(struct srpt_port *sport, u32 slot, struct ib_dm_mad *mad) { struct srpt_device *sdev = sport->sdev; struct ib_dm_ioc_profile *iocp; iocp = (struct ib_dm_ioc_profile *)mad->data; if (!slot || slot > 16) { mad->mad_hdr.status = cpu_to_be16(DM_MAD_STATUS_INVALID_FIELD); retu...
0
50,660
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int setup_rootfs_pivot_root(const char *rootfs, const char *pivotdir) { int oldroot = -1, newroot = -1; oldroot = open("/", O_DIRECTORY | O_RDONLY); if (oldroot < 0) { SYSERROR("Error opening old-/ for fchdir"); return -1; } newroot = open(rootfs, O_DIRECTORY | O_RDONLY); if (newroot < 0) { SY...
0
44,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: int can_do_mlock(void) { if (capable(CAP_IPC_LOCK)) return 1; if (rlimit(RLIMIT_MEMLOCK) != 0) return 1; return 0; } Commit Message: mm: try_to_unmap_cluster() should lock_page() before mlocking A BUG_ON(!PageLocked) was triggered in mlock_vma_page() by Sasha Levin fuzzing with trinity. The call site tr...
0
38,273
Analyze the following 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 HTMLMediaElement::enterPictureInPicture( WebMediaPlayer::PipWindowSizeCallback callback) { if (GetWebMediaPlayer()) GetWebMediaPlayer()->EnterPictureInPicture(std::move(callback)); } Commit Message: defeat cors attacks on audio/video tags Neutralize error messages and fire no progress events unti...
0
154,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: int btrfs_bin_search(struct extent_buffer *eb, struct btrfs_key *key, int level, int *slot) { return bin_search(eb, key, level, slot); } Commit Message: Btrfs: make xattr replace operations atomic Replacing a xattr consists of doing a lookup for its existing value, delete the current value from the resp...
0
45,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: set_alloc_limit (size_t size) { alloc_limit = size; } Commit Message: Fix integer overflows and harden memory allocator. CWE ID: CWE-190
0
68,242
Analyze the following 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 pg_init_done(void *data, int errors) { struct pgpath *pgpath = data; struct priority_group *pg = pgpath->pg; struct multipath *m = pg->m; unsigned long flags; unsigned delay_retry = 0; /* device or driver problems */ switch (errors) { case SCSI_DH_OK: break; case SCSI_DH_NOSYS: if (!m->h...
0
23,608
Analyze the following 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::ViewDestroyed() { RejectMouseLockOrUnlockIfNecessary(); SetView(nullptr); } Commit Message: Force a flush of drawing to the widget when a dialog is shown. BUG=823353 TEST=as in bug Change-Id: I5da777068fc29c5638ef02d50e59d5d7b2729260 Reviewed-on: https://chromium-review.googleso...
0
155,619
Analyze the following 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 jas_matrix_setall(jas_matrix_t *matrix, jas_seqent_t val) { int i; int j; jas_seqent_t *rowstart; int rowstep; jas_seqent_t *data; if (jas_matrix_numrows(matrix) > 0 && jas_matrix_numcols(matrix) > 0) { assert(matrix->rows_); rowstep = jas_matrix_rowstep(matrix); for (i = matrix->numrows_, rowst...
0
70,397
Analyze the following 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 compute_mac(struct crypto_cipher *tfm, u8 *data, int n, struct crypto_ccm_req_priv_ctx *pctx) { unsigned int bs = 16; u8 *odata = pctx->odata; u8 *idata = pctx->idata; int datalen, getlen; datalen = n; /* first time in here, block may be partially filled. */ getlen = bs - pctx->ilen;...
0
45,569
Analyze the following 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_device_changed_cb (Daemon *daemon, const char *object_path, gpointer user_data) { RemoveComponentData *data = user_data; Device *device; GError *error; error = NULL; device = daemon_loca...
0
11,753
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int xfrm_send_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport) { struct net *net = xs_net(x); struct sk_buff *skb; if (x->id.proto != IPPROTO_ESP) return -EINVAL; if (!x->encap) return -EINVAL; skb = nlmsg_new(xfrm_mapping_msgsize(), GFP_ATOMIC); if (skb == NULL) r...
0
33,173
Analyze the following 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 jpc_enc_rlvl_t *rlvl_create(jpc_enc_rlvl_t *rlvl, jpc_enc_cp_t *cp, jpc_enc_tcmpt_t *tcmpt, jpc_tsfb_band_t *bandinfos) { uint_fast16_t rlvlno; uint_fast32_t tlprctlx; uint_fast32_t tlprctly; uint_fast32_t brprcbrx; uint_fast32_t brprcbry; uint_fast16_t bandno; jpc_enc_band_t *band; /* Deduce th...
0
72,930
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: hstore_to_array_internal(HStore *hs, int ndims) { HEntry *entries = ARRPTR(hs); char *base = STRPTR(hs); int count = HS_COUNT(hs); int out_size[2] = {0, 2}; int lb[2] = {1, 1}; Datum *out_datums; bool *out_nulls; int i; Assert(ndims < 3); if (count == 0 || ndims == 0) return cons...
0
38,764
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ProcCreateColormap(ClientPtr client) { VisualPtr pVisual; ColormapPtr pmap; Colormap mid; WindowPtr pWin; ScreenPtr pScreen; REQUEST(xCreateColormapReq); int i, result; REQUEST_SIZE_MATCH(xCreateColormapReq); if ((stuff->alloc != AllocNone) && (stuff->alloc != AllocAll)) { ...
0
14,963
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: FeatureInfo::FeatureInfo() { InitializeBasicState(base::CommandLine::InitializedForCurrentProcess() ? base::CommandLine::ForCurrentProcess() : nullptr); } Commit Message: gpu: Disallow use of IOSurfaces for half-float format with swiftshader. R=kbr@chromiu...
0
137,053
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: hstore_out(PG_FUNCTION_ARGS) { HStore *in = PG_GETARG_HS(0); int buflen, i; int count = HS_COUNT(in); char *out, *ptr; char *base = STRPTR(in); HEntry *entries = ARRPTR(in); if (count == 0) PG_RETURN_CSTRING(pstrdup("")); buflen = 0; /* * this loop overestimates due to pe...
0
38,733
Analyze the following 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 AutoFillManager::set_metric_logger( const AutoFillMetrics* metric_logger) { metric_logger_.reset(metric_logger); } Commit Message: Add support for autofill server experiments BUG=none TEST=unit_tests --gtest_filter=AutoFillMetricsTest.QualityMetricsWithExperimentId:AutoFillQueryXmlParserTest.ParseExp...
0
101,904