instruction
stringclasses
1 value
input
stringlengths
64
129k
output
int64
0
1
__index_level_0__
int64
0
30k
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void RenderWidgetHostImpl::ForwardKeyboardEventWithCommands( const NativeWebKeyboardEvent& key_event, const ui::LatencyInfo& latency, const std::vector<EditCommand>* commands, bool* update_event) { TRACE_EVENT0("input", "RenderWidgetHostImpl::ForwardKeyboardEvent"); if (owner_delegate_ && ...
0
17,804
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void limitedWithEmptyMissingInvalidAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); TestObjectV8Internal::limitedWithEmptyMissingInvalidAttributeAttributeGetter(info); TRACE_EVENT_SET...
0
8,414
Analyze the following 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 http_buf_read_compressed(URLContext *h, uint8_t *buf, int size) { HTTPContext *s = h->priv_data; int ret; if (!s->inflate_buffer) { s->inflate_buffer = av_malloc(DECOMPRESS_BUF_SIZE); if (!s->inflate_buffer) return AVERROR(ENOMEM); } if (s->inflate_stre...
0
13,454
Analyze the following 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 cbc_aes_decrypt(struct blkcipher_desc *desc, struct scatterlist *dst, struct scatterlist *src, unsigned int nbytes) { struct aes_ctx *ctx = blk_aes_ctx(desc->tfm); struct blkcipher_walk walk; int err; int ts_state; padlock_reset_key(&ctx->cword.encrypt); blkcipher_walk_init(&walk, d...
0
21,210
Analyze the following 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 log_tracing_state(const SSL *ssl, conn_rec *c, server_rec *s, int where, int rc) { /* * create the various trace messages */ if (where & SSL_CB_HANDSHAKE_START) { ap_log_cerror(APLOG_MARK, APLOG_TRACE3, 0, c, "%s: Handshake:...
0
3,686
Analyze the following 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 bnep_init(void) { char flt[50] = ""; #ifdef CONFIG_BT_BNEP_PROTO_FILTER strcat(flt, "protocol "); #endif #ifdef CONFIG_BT_BNEP_MC_FILTER strcat(flt, "multicast"); #endif BT_INFO("BNEP (Ethernet Emulation) ver %s", VERSION); if (flt[0]) BT_INFO("BNEP filters: %s", flt); bnep_sock_init...
0
16,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: GahpClient::blah_job_status(const char *job_id, ClassAd **status_ad) { static const char* command = "BLAH_JOB_STATUS"; if (server->m_commands_supported->contains_anycase(command)==FALSE) { return GAHPCLIENT_COMMAND_NOT_SUPPORTED; } if (!job_id) job_id=NULLSTRING; std::string reqline; int x = sprintf( r...
0
28,247
Analyze the following 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 swevent_hlist_get(struct perf_event *event) { int err; int cpu, failed_cpu; get_online_cpus(); for_each_possible_cpu(cpu) { err = swevent_hlist_get_cpu(event, cpu); if (err) { failed_cpu = cpu; goto fail; } } put_online_cpus(); return 0; fail: for_each_possible_cpu(cpu) { if (cp...
0
21,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: f2flac8_clip_array (const float *src, int32_t *dest, int count, int normalize) { float normfact, scaled_value ; normfact = normalize ? (8.0 * 0x10) : 1.0 ; while (--count >= 0) { scaled_value = src [count] * normfact ; if (CPU_CLIPS_POSITIVE == 0 && scaled_value >= (1.0 * 0x7F)) { dest [count] = 0x7F ; ...
0
25,800
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: jiffies_to_compat_timeval(unsigned long jiffies, struct compat_timeval *value) { /* * Convert jiffies to nanoseconds and separate with * one divide. */ u64 nsec = (u64)jiffies * TICK_NSEC; long rem; value->tv_sec = div_long_long_rem(nsec, NSEC_PER_SEC, &rem); value->tv_usec = rem / NSEC_PER_USEC; ...
1
14,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: WebDateTimeChooserCompletion* ChooserCompletion() { return chooser_completion_; } Commit Message: If a page calls |window.focus()|, kick it out of fullscreen. BUG=776418, 800056 Change-Id: I1880fe600e4814c073f247c43b1c1ac80c8fc017 Reviewed-on: https://chromium-review.googlesource.com/852378 Reviewed-by...
0
7,832
Analyze the following 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::write(const String& text, Document* entered_document, ExceptionState& exception_state) { write(SegmentedString(text), entered_document, exception_state); } Commit Message: Inherit CSP when we inherit the security origin This prevents attacks that use ma...
0
10,348
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void rollback_registered_many(struct list_head *head) { struct net_device *dev, *tmp; LIST_HEAD(close_head); BUG_ON(dev_boot_phase); ASSERT_RTNL(); list_for_each_entry_safe(dev, tmp, head, unreg_list) { /* Some devices call without registering * for initialization unwind. Remove those * devi...
0
8,911
Analyze the following 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 pfkey_delete(struct sock *sk, struct sk_buff *skb, const struct sadb_msg *hdr, void * const *ext_hdrs) { struct net *net = sock_net(sk); struct xfrm_state *x; struct km_event c; int err; if (!ext_hdrs[SADB_EXT_SA-1] || !present_and_same_family(ext_hdrs[SADB_EXT_ADDRESS_SRC-1], ext_h...
0
27,318
Analyze the following 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 fuse_copy_page(struct fuse_copy_state *cs, struct page **pagep, unsigned offset, unsigned count, int zeroing) { int err; struct page *page = *pagep; if (page && zeroing && count < PAGE_SIZE) clear_highpage(page); while (count) { if (cs->write && cs->pipebufs && page) { return fuse_ref...
0
22,832
Analyze the following 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 WebContext::IsInitialized() const { return context_.get() != nullptr; } Commit Message: CWE ID: CWE-20
0
7,966
Analyze the following 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 set_dabr(struct arch_hw_breakpoint *brk) { unsigned long dabr, dabrx; dabr = brk->address | (brk->type & HW_BRK_TYPE_DABR); dabrx = ((brk->type >> 3) & 0x7); if (ppc_md.set_dabr) return ppc_md.set_dabr(dabr, dabrx); return __set_dabr(dabr, dabrx); } Commit Message: powerpc/tm: Fix cra...
0
28,858
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int ext4_blks_to_allocate(Indirect *branch, int k, unsigned int blks, int blocks_to_boundary) { unsigned int count = 0; /* * Simple case, [t,d]Indirect block(s) has not allocated yet * then it's clear blocks on that path have not allocated */ if (k > 0) { /* right now we don't handle cross...
0
2,501
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: mkfs_data_unref (MkfsData *data) { g_free (data); } Commit Message: CWE ID: CWE-200
0
12,266
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static av_cold int init(AVFilterContext *ctx) { VignetteContext *s = ctx->priv; #define PARSE_EXPR(name) do { \ int ret = av_expr_parse(&s->name##_pexpr, s->name##_expr, var_names, \ NULL, NULL, NULL, NULL, 0, ctx); ...
0
15,743
Analyze the following 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 ExtensionInstallPrompt::Prompt::GetDialogButtons() const { if (type_ == POST_INSTALL_PERMISSIONS_PROMPT && ShouldDisplayRevokeButton()) { return kButtons[type_] | ui::DIALOG_BUTTON_OK; } return kButtons[type_]; } Commit Message: Make the webstore inline install dialog be tab-modal Also clean up a...
0
19,991
Analyze the following 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 sco_disconn_cfm(struct hci_conn *hcon, __u8 reason) { if (hcon->type != SCO_LINK && hcon->type != ESCO_LINK) return; BT_DBG("hcon %p reason %d", hcon, reason); sco_conn_del(hcon, bt_to_errno(reason)); } Commit Message: bluetooth: Validate socket address length in sco_sock_bind(). Signed-off-b...
0
12,315
Analyze the following 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<WebUIImpl> WebContentsImpl::CreateWebUI(const GURL& url) { std::unique_ptr<WebUIImpl> web_ui = std::make_unique<WebUIImpl>(this); WebUIController* controller = WebUIControllerFactoryRegistry::GetInstance() ->CreateWebUIControllerForURL(web_ui.get(), url); if (controller) { ...
0
21,157
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xfs_rw_ilock_demote( struct xfs_inode *ip, int type) { xfs_ilock_demote(ip, type); if (type & XFS_IOLOCK_EXCL) mutex_unlock(&VFS_I(ip)->i_mutex); } Commit Message: ->splice_write() via ->write_iter() iter_file_splice_write() - a ->splice_write() instance that gathers the pipe buffers, builds a bio_vec-b...
0
28,448
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GfxShading *GfxFunctionShading::copy() { return new GfxFunctionShading(this); } Commit Message: CWE ID: CWE-189
0
5,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 void crypto_authenc_exit_tfm(struct crypto_tfm *tfm) { struct crypto_authenc_ctx *ctx = crypto_tfm_ctx(tfm); crypto_free_ahash(ctx->auth); crypto_free_ablkcipher(ctx->enc); } Commit Message: crypto: include crypto- module prefix in template This adds the module loading prefix "crypto-" to the templat...
0
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: static bool GetPageWithUnsafeWorkerPath( const net::TestServer& expired_https_server, std::string* page_with_unsafe_worker_path) { GURL imported_js_url = expired_https_server.GetURL("files/ssl/imported.js"); std::vector<net::TestServer::StringPair> replacement_text_for_unsafe_worker; rep...
0
3,238
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: virtual void SetUp() { int i; UUT = GetParam(); memset(input, 0, sizeof(input)); /* Set up guard blocks */ for (i = 0; i < 256; i++) output[i] = ((i & 0xF) < 4 && (i < 64)) ? 0 : -1; } Commit Message: Merge Conflict Fix CL to lmp-mr1-release for ag/849478 DO NOT MERGE - libvpx: Pull from ups...
0
5,194
Analyze the following 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_mod_instance_methods(mrb_state *mrb, mrb_value mod) { struct RClass *c = mrb_class_ptr(mod); mrb_bool recur = TRUE; mrb_get_args(mrb, "|b", &recur); return mrb_class_instance_method_list(mrb, recur, c, 0); } Commit Message: `mrb_class_real()` did not work for `BasicObject`; fix #4037 CWE ID: CWE-476
0
3,369
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int tun_mainloop(struct openconnect_info *vpninfo, int *timeout) { int work_done = 0; int prefix_size = 0; #ifdef TUN_HAS_AF_PREFIX if (!vpninfo->script_tun) prefix_size = sizeof(int); #endif if (FD_ISSET(vpninfo->tun_fd, &vpninfo->select_rfds)) { while (1) { int len = vpninfo->mtu; if (!out_pkt)...
0
7,558
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool Browser::UseVerticalTabs() const { return use_vertical_tabs_.GetValue(); } Commit Message: Implement a bubble that appears at the top of the screen when a tab enters fullscreen mode via webkitRequestFullScreen(), telling the user how to exit fullscreen. This is implemented as an NSView rather than an ...
0
15,083
Analyze the following 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 RenderBlock::updateLogicalWidthForAlignment(const ETextAlign& textAlign, const RootInlineBox* rootInlineBox, BidiRun* trailingSpaceRun, float& logicalLeft, float& totalLogicalWidth, float& availableLogicalWidth, int expansionOpportunityCount) { TextDirection direction; if (rootInlineBox && rootInline...
0
2,308
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: lexer_construct_function_object (parser_context_t *context_p, /**< context */ uint32_t extra_status_flags) /**< extra status flags */ { ecma_compiled_code_t *compiled_code_p; lexer_literal_t *literal_p; uint16_t result_index; if (context_p->literal_count >= PARSER_MAXIMUM...
0
24,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: raptor_rdfxml_process_property_attributes(raptor_parser *rdf_parser, raptor_rdfxml_element *attributes_element, raptor_rdfxml_element *resource_element, raptor_term *property_node_identif...
0
1,212
Analyze the following 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 file *sock_alloc_file(struct socket *sock, int flags, const char *dname) { struct qstr name = { .name = "" }; struct path path; struct file *file; if (dname) { name.name = dname; name.len = strlen(name.name); } else if (sock->sk) { name.name = sock->sk->sk_prot_creator->name; name.len = strle...
0
26,042
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: NavigationEntryImpl* NavigationControllerImpl::GetVisibleEntry() const { if (transient_entry_index_ != -1) return entries_[transient_entry_index_].get(); bool safe_to_show_pending = pending_entry_ && pending_entry_index_ == -1 && (!pending_entry_->is_renderer_initiated() || IsUnmodifiedB...
0
17,076
Analyze the following 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 assign_proto_idx(struct proto *prot) { prot->inuse_idx = find_first_zero_bit(proto_inuse_idx, PROTO_INUSE_NR); if (unlikely(prot->inuse_idx == PROTO_INUSE_NR - 1)) { pr_err("PROTO_INUSE_NR exhausted\n"); return; } set_bit(prot->inuse_idx, proto_inuse_idx); } Commit Message: net: sock: valid...
0
27,666
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void __addrconf_sysctl_unregister(struct ipv6_devconf *p) { struct addrconf_sysctl_table *t; if (p->sysctl == NULL) return; t = p->sysctl; p->sysctl = NULL; unregister_net_sysctl_table(t->sysctl_header); kfree(t); } Commit Message: ipv6: addrconf: validate new MTU before applying it Currently w...
0
5,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: void WebGL2RenderingContextBase::RemoveBoundBuffer(WebGLBuffer* buffer) { if (bound_copy_read_buffer_ == buffer) bound_copy_read_buffer_ = nullptr; if (bound_copy_write_buffer_ == buffer) bound_copy_write_buffer_ = nullptr; if (bound_pixel_pack_buffer_ == buffer) bound_pixel_pack_buffer_ = nullp...
0
2,681
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: _cserve2_start() { pid_t cs_child; cs_child = fork(); if (cs_child == 0) { char *cs_args[2] = { NULL, NULL }; cs_args[0] = (char *)evas_cserve_path_get(); execv(cs_args[0], cs_args); exit(-1); } else if (cs_child > 0) { putenv("EVAS_CSERVE2=1"); ...
0
16,090
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: explicit DummyCapsLockDelegate(bool consume) : consume_(consume), handle_caps_lock_count_(0) { } Commit Message: accelerators: Remove deprecated Accelerator ctor that takes booleans. BUG=128242 R=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/10399085 git-svn-id: svn://s...
0
17,078
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { int i, a, ret = 0; int subset = 0; initializeLibxml2(); for (a = 1; a < argc;a++) { if (!strcmp(argv[a], "-v")) verbose = 1; else if (!strcmp(argv[a], "-u")) update_results = 1; else if (!strcmp(arg...
0
253
Analyze the following 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::PerWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_perWorldBindingsReadonlyTestInterfaceEmptyAttribute_Getter"); test_object_v8_inter...
0
12,841
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Report(const StatsReport* report) : id_(report->id()->ToString()), type_(report->type()), type_name_(report->TypeToString()), timestamp_(report->timestamp()), values_(report->values()) {} Commit Message: Check weak pointers in RTCPeerConnectionHandler::WebRtcSe...
0
6,119
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: VoiceInteractionControllerClient* voice_interaction_controller_client() { return voice_interaction_controller_client_.get(); } Commit Message: arc: add test for blocking incognito windows in screenshot BUG=778852 TEST=ArcVoiceInteractionFrameworkServiceUnittest. CapturingScreenshotBlocksIncognitoWindo...
0
21,234
Analyze the following 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 Camera3Device::getInputBufferProducer( sp<IGraphicBufferProducer> *producer) { Mutex::Autolock il(mInterfaceLock); Mutex::Autolock l(mLock); if (producer == NULL) { return BAD_VALUE; } else if (mInputStream == NULL) { return INVALID_OPERATION; } return mInputStream->getInputBufferProduc...
0
1,094
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: RenderWidgetHostViewAndroid::RenderWidgetHostViewAndroid( RenderWidgetHostImpl* widget_host, ContentViewCoreImpl* content_view_core) : host_(widget_host), is_layer_attached_(true), content_view_core_(NULL), ime_adapter_android_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), cached_b...
1
551
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: IW_IMPL(int) iw_round_to_int(double x) { if(x<0.0) return -(int)(0.5-x); return (int)(0.5+x); } Commit Message: Trying to fix some invalid left shift operations Fixes issue #16 CWE ID: CWE-682
0
14,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: Condor_Auth_SSL::decrypt(unsigned char* input, int input_len, unsigned char* & output, int& output_len) { return encrypt_or_decrypt(false,input,input_len,output,output_len); } Commit Message: CWE ID: CWE-134
0
19,802
Analyze the following 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 perf_event_mmap_output(struct perf_event *event, struct perf_mmap_event *mmap_event) { struct perf_output_handle handle; struct perf_sample_data sample; int size = mmap_event->event_id.header.size; int ret; perf_event_header__init_id(&mmap_event->event_id.header, &sample, event); ret =...
0
6,974
Analyze the following 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 regulator_list_hardware_vsel(struct regulator *regulator, unsigned selector) { struct regulator_dev *rdev = regulator->rdev; const struct regulator_ops *ops = rdev->desc->ops; if (selector >= rdev->desc->n_voltages) return -EINVAL; if (ops->set_voltage_sel != regulator_set_voltage_sel_regmap) re...
0
28,328
Analyze the following 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 zend_long parse_iv(const unsigned char *p) { return parse_iv2(p, NULL); } Commit Message: Fix bug #72663 - destroy broken object when unserializing (cherry picked from commit 448c9be157f4147e121f1a2a524536c75c9c6059) CWE ID: CWE-502
0
12,472
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SProcRenderQueryPictIndexValues (ClientPtr client) { register int n; REQUEST(xRenderQueryPictIndexValuesReq); swaps(&stuff->length, n); swapl(&stuff->format, n); return (*ProcRenderVector[stuff->renderReqType]) (client); } Commit Message: CWE ID: CWE-20
0
26,217
Analyze the following 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_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type) { zval *result; long field; PGresult *pgsql_result; pgsql_result_handle *pg_result; Oid oid; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &result, &field) == FAILURE) { return; } ZEND_FETCH_RESOURCE(pg_res...
0
7,276
Analyze the following 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 coolkey_get_token_info(sc_card_t *card, sc_pkcs15_tokeninfo_t * token_info) { coolkey_private_data_t * priv = COOLKEY_DATA(card); char *label = NULL; char *manufacturer_id = NULL; char *serial_number = NULL; SC_FUNC_CALLED(card->ctx, SC_LOG_DEBUG_NORMAL); label = strdup((char *)priv->token_name)...
0
23,336
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: s32 brcmf_notify_escan_complete(struct brcmf_cfg80211_info *cfg, struct brcmf_if *ifp, bool aborted, bool fw_abort) { struct brcmf_scan_params_le params_le; struct cfg80211_scan_request *scan_request; s32 err = 0; brcmf_dbg(SCAN, "Enter\n"); /* clear scan request, because the FW abort can cause a s...
0
17,949
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: log_syslog(struct passwd const *pw, bool successful) { const char *new_user, *old_user, *tty; new_user = pw->pw_name; /* The utmp entry (via getlogin) is probably the best way to identify the user, especially if someone su's from a su-shell. */ old_user = getlogin (); if (!old_user) { /...
0
12,155
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: mysqlnd_old_escape_string(char * newstr, const char * escapestr, size_t escapestr_len TSRMLS_DC) { DBG_ENTER("mysqlnd_old_escape_string"); DBG_RETURN(mysqlnd_cset_escape_slashes(mysqlnd_find_charset_name("latin1"), newstr, escapestr, escapestr_len TSRMLS_CC)); } Commit Message: CWE ID: CWE-284
0
10,545
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gs_interp_reset(i_ctx_t *i_ctx_p) { /* Reset the stacks. */ ref_stack_clear(&o_stack); ref_stack_clear(&e_stack); esp++; make_oper(esp, 0, interp_exit); ref_stack_pop_to(&d_stack, min_dstack_size); dict_set_top(); } Commit Message: CWE ID: CWE-200
0
12,451
Analyze the following 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 TestingAutomationProvider::SetProxySettings(Browser* browser, DictionaryValue* args, IPC::Message* reply_message) { AutomationJSONReply reply(this, reply_message); std::string key; base::Value* value; if...
0
6,025
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: print_options(void) { const struct dhcp_opt *opt; const char **p; for (p = if_params; *p; p++) printf(" - %s\n", *p); for (p = dhcp_params; *p; p++) printf(" %s\n", *p); for (opt = dhcp_opts; opt->option; opt++) if (opt->var) printf("%03d %s\n", opt->option, opt->var); } Commit Message: Impro...
0
28,949
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SendTabToSelfModel* GetModel(const JavaParamRef<jobject>& j_profile) { Profile* profile = ProfileAndroid::FromProfileAndroid(j_profile); SendTabToSelfModel* model = SendTabToSelfSyncServiceFactory::GetInstance() ->GetForProfile(profile) ->Get...
0
9,476
Analyze the following 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 WebPage::clearNeverRememberSites() { #if ENABLE(BLACKBERRY_CREDENTIAL_PERSIST) if (d->m_webSettings->isCredentialAutofillEnabled()) credentialManager().clearNeverRememberSites(); #endif } Commit Message: [BlackBerry] Adapt to new BlackBerry::Platform::TouchPoint API https://bugs.webkit.org/show_...
0
6,638
Analyze the following 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 ehci_get_fetch_addr(EHCIState *s, int async) { return async ? s->a_fetch_addr : s->p_fetch_addr; } Commit Message: CWE ID: CWE-772
0
29,590
Analyze the following 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 xmlParserInputPtr MSLResolveEntity(void *context, const xmlChar *public_id,const xmlChar *system_id) { MSLInfo *msl_info; xmlParserInputPtr stream; /* Special entity resolver, better left to the parser, it has more context than the application layer. The default behaviour is to ...
0
22,601
Analyze the following 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 cap_bprm_set_creds(struct linux_binprm *bprm) { const struct cred *old = current_cred(); struct cred *new = bprm->cred; bool effective, has_cap = false; int ret; effective = false; ret = get_file_caps(bprm, &effective, &has_cap); if (ret < 0) return ret; if (!issecure(SECURE_NOROOT)) { /* * I...
1
12,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: WebKit::WebString TestWebKitPlatformSupport::defaultLocale() { return ASCIIToUTF16("en-US"); } Commit Message: Use a new scheme for swapping out RenderViews. BUG=118664 TEST=none Review URL: http://codereview.chromium.org/9720004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127986 0039d316-1c4b-4281...
0
26,162
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: pdf_set_colorspace(fz_context *ctx, pdf_run_processor *pr, int what, fz_colorspace *colorspace) { pdf_gstate *gstate = pr->gstate + pr->gtop; pdf_material *mat; int n = fz_colorspace_n(ctx, colorspace); gstate = pdf_flush_text(ctx, pr); mat = what == PDF_FILL ? &gstate->fill : &gstate->stroke; fz_drop_co...
0
1,163
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: cJSON *cJSON_DetachItemFromObject( cJSON *object, const char *string ) { int i = 0; cJSON *c = object->child; while ( c && cJSON_strcasecmp( c->string, string ) ) { ++i; c = c->next; } if ( c ) return cJSON_DetachItemFromArray( object, i ); return 0; } Commit Message: Fix a buffer overflow / heap cor...
1
1,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: static void red_channel_client_peer_on_out_block(void *opaque) { RedChannelClient *rcc = (RedChannelClient *)opaque; rcc->send_data.blocked = TRUE; rcc->channel->core->watch_update_mask(rcc->stream->watch, SPICE_WATCH_EVENT_READ | ...
0
21,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 int instantiate_veth(char *n1, char **n2) { int err; err = snprintf(*n2, IFNAMSIZ, "%sp", n1); if (err < 0 || err >= IFNAMSIZ) { fprintf(stderr, "nic name too long\n"); return -1; } err = lxc_veth_create(n1, *n2); if (err) { fprintf(stderr, "failed to create %s-%s : %s\n", n1, *n2, st...
0
25,019
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static const struct cpumask *sd_numa_mask(int cpu) { return sched_domains_numa_masks[sched_domains_curr_level][cpu_to_node(cpu)]; } Commit Message: Merge branch 'stacking-fixes' (vfs stacking fixes from Jann) Merge filesystem stacking fixes from Jann Horn. * emailed patches from Jann Horn <jannh@google.com>: ...
0
25,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: static int mcryptd_hash_digest_enqueue(struct ahash_request *req) { return mcryptd_hash_enqueue(req, mcryptd_hash_digest); } 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(blo...
0
7,275
Analyze the following 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 ComponentUpdaterPolicyTest::SetUpCommandLine( base::CommandLine* command_line) { ASSERT_TRUE(https_server_.InitializeAndListen()); const std::string val = base::StringPrintf( "url-source=%s", https_server_.GetURL("/service/update2").spec().c_str()); command_line->AppendSwitchASCII(switches::k...
0
6,629
Analyze the following 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 rxe_mem_cleanup(void *arg) { struct rxe_mem *mem = arg; int i; if (mem->umem) ib_umem_release(mem->umem); if (mem->map) { for (i = 0; i < mem->num_map; i++) kfree(mem->map[i]); kfree(mem->map); } } Commit Message: IB/rxe: Fix mem_check_range integer overflow Update the range check to avoid...
0
9,207
Analyze the following 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 sk_buff **tcp6_gro_receive(struct sk_buff **head, struct sk_buff *skb) { const struct ipv6hdr *iph = skb_gro_network_header(skb); switch (skb->ip_summed) { case CHECKSUM_COMPLETE: if (!tcp_v6_check(skb_gro_len(skb), &iph->saddr, &iph->daddr, skb->csum)) { skb->ip_summed = CHECKS...
0
17,255
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool Document::allowExecutingScripts(Node* node) { LocalFrame* frame = executingFrame(); if (!frame) return false; if (!node->document().executingFrame()) return false; if (!frame->script().canExecuteScripts(AboutToExecuteScript)) return false; return true; } Commit Me...
0
6,274
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool WebContentsImpl::IsHidden() { return !IsBeingCaptured() && visibility_ != Visibility::VISIBLE; } Commit Message: Prevent renderer initiated back navigation to cancel a browser one. Renderer initiated back/forward navigations must not be able to cancel ongoing browser initiated navigation if they are not ...
0
13,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 SyncBackendHost::SetAutofillMigrationState( syncable::AutofillMigrationState state) { return core_->syncapi()->SetAutofillMigrationState(state); } Commit Message: Enable HistoryModelWorker by default, now that bug 69561 is fixed. BUG=69561 TEST=Run sync manually and run integration tests, sync should...
0
23,793
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: NOINLINE void ResetThread_PROCESS_LAUNCHER( std::unique_ptr<BrowserProcessSubThread> thread) { volatile int inhibit_comdat = __LINE__; ALLOW_UNUSED_LOCAL(inhibit_comdat); thread.reset(); } Commit Message: Roll src/third_party/boringssl/src 664e99a64..696c13bd6 https://boringssl.googlesource.com/boring...
0
2,617
Analyze the following 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 TypingCommand::textDataForInputEvent() const { if (m_commands.isEmpty() || isIncrementalInsertion()) return m_textToInsert; return m_commands.back()->textDataForInputEvent(); } Commit Message: Make TypingCommand::insertText() to take SelectionInDOMTree instead of VisibleSelection This patch makes...
0
11,929
Analyze the following 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 VoidMethodSequenceLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { ExceptionState exception_state(info.GetIsolate(), ExceptionState::kExecutionContext, "TestObject", "voidMethodSequenceLongArg"); TestObject* impl = V8TestObject::ToImpl(info.Holder()); if (UNLIKELY(info.Length()...
0
4,981
Analyze the following 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 Resource::SetPreviewsState(WebURLRequest::PreviewsState previews_state) { resource_request_.SetPreviewsState(previews_state); } Commit Message: Check CORS using PassesAccessControlCheck() with supplied SecurityOrigin Partial revert of https://chromium-review.googlesource.com/535694. Bug: 799477 Change-I...
0
17,563
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void PrintPreviewDialogDelegate::GetDialogSize(gfx::Size* size) const { DCHECK(size); const gfx::Size kMinDialogSize(800, 480); const int kBorder = 25; *size = kMinDialogSize; web_modal::WebContentsModalDialogHost* host = nullptr; content::WebContents* outermost_web_contents = guest_view::Guest...
0
18,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: download::DownloadItem* DownloadManagerImpl::CreateDownloadItem( const std::string& guid, uint32_t id, const base::FilePath& current_path, const base::FilePath& target_path, const std::vector<GURL>& url_chain, const GURL& referrer_url, const GURL& site_url, const GURL& tab_url, ...
0
11,143
Analyze the following 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 FrameSelection::MoveRangeSelectionExtent(const IntPoint& contents_point) { if (ComputeVisibleSelectionInDOMTree().IsNone()) return; SetSelection( SelectionInDOMTree::Builder( GetGranularityStrategy()->UpdateExtent(contents_point, frame_)) .Build(), SetSelectionOptions...
0
4,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: static unsigned long write_large_blob_data(struct git_istream *st, struct sha1file *f, const unsigned char *sha1) { git_zstream stream; unsigned char ibuf[1024 * 16]; unsigned char obuf[1024 * 16]; unsigned long olen = 0; git_deflate_init(&stream, pack_compression_level); for (;;) { ssize_t read...
0
20,098
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: LayoutObject* ImageInputType::createLayoutObject(const ComputedStyle& style) const { if (m_useFallbackContent) return new LayoutBlockFlow(&element()); LayoutImage* image = new LayoutImage(&element()); image->setImageResource(LayoutImageResource::create()); return image; } Commit Message: ...
0
4,177
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: sf_set_string (SNDFILE *sndfile, int str_type, const char* str) { SF_PRIVATE *psf ; VALIDATE_SNDFILE_AND_ASSIGN_PSF (sndfile, psf, 1) ; return psf_set_string (psf, str_type, str) ; } /* sf_get_string */ Commit Message: src/ : Move to a variable length header buffer Previously, the `psf->header` buffer was ...
0
2,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: void QueryTopSites(TopSitesImpl* top_sites, bool wait) { QueryAllTopSites(top_sites, wait, false); } Commit Message: TopSites: Clear thumbnails from the cache when their URLs get removed We already cleared the thumbnails from persistent storage, but they remained in the in-memory cache, so they remained...
0
9,516
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int lex_scan_number(lex_t *lex, int c, json_error_t *error) { const char *saved_text; char *end; double doubleval; lex->token = TOKEN_INVALID; if(c == '-') c = lex_get_save(lex, error); if(c == '0') { c = lex_get_save(lex, error); if(l_isdigit(c)) { ...
0
9,637
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: IHEVCD_ERROR_T ihevcd_parse_sei(codec_t *ps_codec, nal_header_t *ps_nal) { IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS; parse_ctxt_t *ps_parse = &ps_codec->s_parse; UWORD32 u4_payload_type = 0, u4_last_payload_type_byte = 0; UWORD32 u4_payload_size = 0, u4_last_payload_size_byte = 0; UWOR...
0
6,219
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: fmac(struct sh_fpu_soft_struct *fregs, struct pt_regs *regs, int m, int n) { FP_DECL_EX; FP_DECL_S(Fr); FP_DECL_S(Ft); FP_DECL_S(F0); FP_DECL_S(Fm); FP_DECL_S(Fn); UNPACK_S(F0, FR0); UNPACK_S(Fm, FRm); UNPACK_S(Fn, FRn); FP_MUL_S(Ft, Fm, F0); FP_ADD_S(Fr, Fn, Ft); PACK_S(FRn, Fr); return 0; } Commit...
0
4,745
Analyze the following 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_env(pool *p, cmd_rec *cmd, char *user, char *pass) { struct passwd *pw; config_rec *c, *tmpc; char *origuser, *ourname = NULL, *anonname = NULL, *anongroup = NULL, *ugroup = NULL; char *defaulttransfermode, *defroot = NULL,*defchdir = NULL,*xferlog = NULL; const char *sess_ttyname; in...
0
3,533
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: LayoutRect RenderMenuList::controlClipRect(const LayoutPoint& additionalOffset) const { LayoutRect outerBox(additionalOffset.x() + borderLeft() + paddingLeft(), additionalOffset.y() + borderTop() + paddingTop(), contentWidth(), contentHeight()); ...
0
14,822
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: AccessibilityRole AXNodeObject::ariaRoleAttribute() const { return m_ariaRole; } Commit Message: Switch to equalIgnoringASCIICase throughout modules/accessibility BUG=627682 Review-Url: https://codereview.chromium.org/2793913007 Cr-Commit-Position: refs/heads/master@{#461858} CWE ID: CWE-254
0
8,794
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int ext2_setup_super (struct super_block * sb, struct ext2_super_block * es, int read_only) { int res = 0; struct ext2_sb_info *sbi = EXT2_SB(sb); if (le32_to_cpu(es->s_rev_level) > EXT2_MAX_SUPP_REV) { ext2_msg(sb, KERN_ERR, "error: revision level too high, " "forcing read-on...
0
25,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: bool SaveCardBubbleControllerImpl::InputCvcIsValid( const base::string16& input_text) const { base::string16 trimmed_text; base::TrimWhitespace(input_text, base::TRIM_ALL, &trimmed_text); return IsValidCreditCardSecurityCode(trimmed_text, card_.network()); } Commit Message: [autofill] Avoid duplicate i...
0
22,984
Analyze the following 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 ClientDiscardableSharedMemoryManager::MemoryUsageChanged( size_t new_bytes_total, size_t new_bytes_free) const { static crash_reporter::CrashKeyString<24> discardable_memory_allocated( "discardable-memory-allocated"); discardable_memory_allocated.Set(base::NumberToString(new_bytes_total)); ...
0
7,852
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: __trace_array_vprintk(struct ring_buffer *buffer, unsigned long ip, const char *fmt, va_list args) { struct trace_event_call *call = &event_print; struct ring_buffer_event *event; int len = 0, size, pc; struct print_entry *entry; unsigned long flags; char *tbuffer; if (tracing_disabled || tracing_...
0
26,878