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: e1000e_intrmgr_pci_unint(E1000ECore *core) { int i; timer_del(core->radv.timer); timer_free(core->radv.timer); timer_del(core->rdtr.timer); timer_free(core->rdtr.timer); timer_del(core->raid.timer); timer_free(core->raid.timer); timer_del(core->tadv.timer); timer_free(core->t...
0
5,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 MagickPNGErrorHandler(png_struct *ping,png_const_charp message) { ExceptionInfo *exception; Image *image; PNGErrorInfo *error_info; error_info=(PNGErrorInfo *) png_get_error_ptr(ping); image=error_info->image; exception=error_info->exception; (void) LogMagickEvent(CoderEv...
0
63,297
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: fmov_mem_reg(struct sh_fpu_soft_struct *fregs, struct pt_regs *regs, int m, int n) { if (FPSCR_SZ) { FMOV_EXT(n); READ(FRn, Rm + 4); n++; READ(FRn, Rm); } else { READ(FRn, Rm); } return 0; } Commit Message: perf: Remove the nmi parameter from the swevent and overflow interface The nmi param...
0
25,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: xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len, int what, xmlChar end, xmlChar end2, xmlChar end3) { xmlChar *buffer = NULL; size_t buffer_size = 0; size_t nbchars = 0; xmlChar *current = NULL; xmlChar *rep = NULL; const xmlChar *last; xmlEntityPtr ent; int c,...
0
163,534
Analyze the following 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 do_futex(u32 __user *uaddr, int op, u32 val, ktime_t *timeout, u32 __user *uaddr2, u32 val2, u32 val3) { int cmd = op & FUTEX_CMD_MASK; unsigned int flags = 0; if (!(op & FUTEX_PRIVATE_FLAG)) flags |= FLAGS_SHARED; if (op & FUTEX_CLOCK_REALTIME) { flags |= FLAGS_CLOCKRT; if (cmd != FUTEX_WAIT &...
0
84,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: jsonb_object_field(PG_FUNCTION_ARGS) { Jsonb *jb = PG_GETARG_JSONB(0); text *key = PG_GETARG_TEXT_PP(1); JsonbValue *v; if (!JB_ROOT_IS_OBJECT(jb)) PG_RETURN_NULL(); v = findJsonbValueFromContainerLen(&jb->root, JB_FOBJECT, VARDATA_ANY(key), VARSIZE_ANY_EXHDR(key)); if (v ...
0
2,627
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: FileTransfer::AddDownloadFilenameRemaps(char const *remaps) { if(!download_filename_remaps.IsEmpty()) { download_filename_remaps += ";"; } download_filename_remaps += remaps; } Commit Message: CWE ID: CWE-134
0
16,561
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ShellContentUtilityClient::~ShellContentUtilityClient() { } Commit Message: Fix content_shell with network service enabled not loading pages. This regressed in my earlier cl r528763. This is a reland of r547221. Bug: 833612 Change-Id: I4c2649414d42773f2530e1abe5912a04fcd0ed9b Reviewed-on: https://chromium-r...
0
131,066
Analyze the following 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 ib_uverbs_release_dev(struct kobject *kobj) { struct ib_uverbs_device *dev = container_of(kobj, struct ib_uverbs_device, kobj); cleanup_srcu_struct(&dev->disassociate_srcu); kfree(dev); } Commit Message: IB/security: Restrict use of the write() interface The drivers/infiniband stack uses write...
0
52,900
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: virtual ~TestDevToolsClientHost() { EXPECT_TRUE(closed_); } Commit Message: Ensure extensions and the Chrome Web Store are loaded in new BrowsingInstances. BUG=174943 TEST=Can't post message to CWS. See bug for repro steps. Review URL: https://chromiumcodereview.appspot.com/12301013 git-svn-id: svn:...
0
115,797
Analyze the following 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 FramerVisitorCapturingAcks::OnAckFrame(const QuicAckFrame& frame) { frame_ = frame; } Commit Message: Add QuicStream and friends to QUIC code. Fix bug in tests that caused failures. Revert 165859 First Landed as 165858 Review URL: https://chromiumcodereview.appspot.com/11367082 git-svn-id: svn://sv...
0
117,487
Analyze the following 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 gen_op_jnz_ecx(TCGMemOp size, TCGLabel *label1) { tcg_gen_mov_tl(cpu_tmp0, cpu_regs[R_ECX]); gen_extu(size, cpu_tmp0); tcg_gen_brcondi_tl(TCG_COND_NE, cpu_tmp0, 0, label1); } Commit Message: tcg/i386: Check the size of instruction being translated This fixes the bug: 'user-to-root...
0
66,368
Analyze the following 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 kvm_destroy_vm(struct kvm *kvm) { int i; struct mm_struct *mm = kvm->mm; kvm_arch_sync_events(kvm); spin_lock(&kvm_lock); list_del(&kvm->vm_list); spin_unlock(&kvm_lock); kvm_free_irq_routing(kvm); for (i = 0; i < KVM_NR_BUSES; i++) kvm_io_bus_destroy(kvm->buses[i]); kvm_coalesced_mmio_fre...
0
29,316
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void ArthurOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, int *maskColors, GBool inlineImg) { unsigned char *buffer; unsigned int *dest; int x, y; ImageStream *imgStr; Guchar *pix; int i; double *ctm; QMatrix matrix; ...
1
164,603
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: asmlinkage long sys_oabi_epoll_wait(int epfd, struct oabi_epoll_event __user *events, int maxevents, int timeout) { struct epoll_event *kbuf; mm_segment_t fs; long ret, err, i; if (maxevents <= 0 || maxevents > (INT_MAX/sizeof(struct epoll_event))) return -EINVAL; kbuf = kmalloc(sizeof(*kb...
0
27,515
Analyze the following 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 __exit crypto_algapi_exit(void) { crypto_exit_proc(); } 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 correctly includes the "crypto-" p...
0
45,469
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int php_openssl_is_private_key(EVP_PKEY* pkey TSRMLS_DC) { assert(pkey != NULL); switch (pkey->type) { #ifndef NO_RSA case EVP_PKEY_RSA: case EVP_PKEY_RSA2: assert(pkey->pkey.rsa != NULL); if (pkey->pkey.rsa != NULL && (NULL == pkey->pkey.rsa->p || NULL == pkey->pkey.rsa->q)) { return 0; ...
0
4,683
Analyze the following 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 SystemUsesChromiumEVMetadata() { #if defined(USE_OPENSSL) return false; #elif defined(OS_MACOSX) return false; #else return true; #endif } Commit Message: Tests were marked as Flaky. BUG=151811,151810 TBR=droger@chromium.org,shalev@chromium.org NOTRY=true Review URL: https://chromiumcoderevie...
0
102,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: virtual sp<NativeHandle> getSidebandStream() const { Parcel data, reply; status_t err; data.writeInterfaceToken(IGraphicBufferConsumer::getInterfaceDescriptor()); if ((err = remote()->transact(GET_SIDEBAND_STREAM, data, &reply)) != NO_ERROR) { return NULL; } sp<NativeHandle> stream; if (rep...
0
160,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: static void __ip_vs_del_dest(struct net *net, struct ip_vs_dest *dest) { struct netns_ipvs *ipvs = net_ipvs(net); ip_vs_stop_estimator(net, &dest->stats); /* * Remove it from the d-linked list with the real services. */ write_lock_bh(&ipvs->rs_lock); ip_vs_rs_unhash(dest); write_unlock_bh(&ipvs->rs_l...
0
34,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: void ProCamera2Client::onExclusiveLockStolen() { ALOGV("%s: ProClient lost exclusivity (id %d)", __FUNCTION__, mCameraId); Mutex::Autolock icl(mBinderSerializationLock); SharedCameraCallbacks::Lock l(mSharedCameraCallbacks); if (mExclusiveLock && mRemoteCallback.get() != NULL) { mRemote...
0
161,838
Analyze the following 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 voidMethodPromiseArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); TestObjectPythonV8Internal::voidMethodPromiseArgMethod(info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); } Commit Message: document.locatio...
0
122,871
Analyze the following 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_new(SSL *s) { DTLS1_STATE *d1; if (!ssl3_new(s)) return (0); if ((d1 = OPENSSL_malloc(sizeof *d1)) == NULL) return (0); memset(d1, 0, sizeof *d1); /* d1->handshake_epoch=0; */ d1->unprocessed_rcds.q = pqueue_new(); d1->processed_rcds.q = pqueue_new(); d...
0
6,497
Analyze the following 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::ForwardMouseEventWithLatencyInfo( const blink::WebMouseEvent& mouse_event, const ui::LatencyInfo& ui_latency) { TRACE_EVENT2("input", "RenderWidgetHostImpl::ForwardMouseEvent", "x", mouse_event.x, "y", mouse_event.y); for (size_t i = 0; i < mouse_event_ca...
0
130,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: static void process_bin_complete_sasl_auth(conn *c) { assert(settings.sasl); const char *out = NULL; unsigned int outlen = 0; assert(c->item); init_sasl_conn(c); int nkey = c->binary_header.request.keylen; int vlen = c->binary_header.request.bodylen - nkey; char mech[nkey+1]; ...
0
18,264
Analyze the following 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 ThreadableBlobRegistry::finalizeStream(const KURL& url) { if (isMainThread()) { blobRegistry().finalizeStream(url); } else { OwnPtr<BlobRegistryContext> context = adoptPtr(new BlobRegistryContext(url)); callOnMainThread(&finalizeStreamTask, context.leakPtr()); } } Co...
1
170,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: int drm_mode_attachmode_crtc(struct drm_device *dev, struct drm_crtc *crtc, struct drm_display_mode *mode) { struct drm_connector *connector; int ret = 0; struct drm_display_mode *dup_mode; int need_dup = 0; list_for_each_entry(connector, &dev->mode_config.connector_list, head) { if (!connector->en...
0
21,878
Analyze the following 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::didRemoveAllPendingStylesheet() { m_needsNotifyRemoveAllPendingStylesheet = false; styleResolverChanged(RecalcStyleIfNeeded); if (ScriptableDocumentParser* parser = scriptableDocumentParser()) parser->executeScriptsWaitingForStylesheets(); if (m_gotoAnchorNeededAfterStyle...
0
105,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: void NormalPage::PoisonUnmarkedObjects() { for (Address header_address = Payload(); header_address < PayloadEnd();) { HeapObjectHeader* header = reinterpret_cast<HeapObjectHeader*>(header_address); DCHECK_LT(header->size(), BlinkPagePayloadSize()); if (header->IsFree()) { header_addres...
0
153,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: person_get_angle(const person_t* person) { return person->theta; } 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. It allocates a buffer `tilemap` with size `x_size...
0
75,075
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: AirPDcapWepMng( PAIRPDCAP_CONTEXT ctx, UCHAR *decrypt_data, guint mac_header_len, guint *decrypt_len, PAIRPDCAP_KEY_ITEM key, AIRPDCAP_SEC_ASSOCIATION *sa, INT offset) { UCHAR wep_key[AIRPDCAP_WEP_KEY_MAXLEN+AIRPDCAP_WEP_IVLEN]; size_t keylen; INT ret_value=1; INT key_i...
0
51,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 BrowserCommandController::UpdateCommandsForTabState() { WebContents* current_web_contents = chrome::GetActiveWebContents(browser_); if (!current_web_contents) // May be NULL during tab restore. return; command_updater_.UpdateCommandEnabled(IDC_BACK, CanGoBack(browser_)); command_updater_.Update...
0
117,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: xdr_decode_array2(struct xdr_buf *buf, unsigned int base, struct xdr_array2_desc *desc) { if (base >= buf->len) return -EINVAL; return xdr_xcode_array2(buf, base, desc, 0); } Commit Message: NFSv4: include bitmap in nfsv4 get acl data The NFSv4 bitmap size is unbounded: a server can return an arbitrary...
0
23,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: void clearLoader() { m_loader = nullptr; m_scriptState.clear(); } Commit Message: Move ImageLoader timer to frame-specific TaskRunnerTimer. Move ImageLoader timer m_derefElementTimer to frame-specific TaskRunnerTimer. This associates it with the frame's Networking timer task queue. BUG=624694 Revi...
0
128,109
Analyze the following 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 AppListSyncableService::DeleteSyncItem(SyncItem* sync_item) { if (SyncStarted()) { VLOG(2) << this << " -> SYNC DELETE: " << sync_item->ToString(); SyncChange sync_change(FROM_HERE, SyncChange::ACTION_DELETE, GetSyncDataFromSyncItem(sync_item)); sync_processor_->Proce...
0
123,896
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: perf_iterate_ctx(struct perf_event_context *ctx, perf_iterate_f output, void *data, bool all) { struct perf_event *event; list_for_each_entry_rcu(event, &ctx->event_list, event_entry) { if (!all) { if (event->state < PERF_EVENT_STATE_INACTIVE) continue; if (!event_filter_match(event)) ...
0
68,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: epass2003_refresh(struct sc_card *card) { int r = SC_SUCCESS; epass2003_exdata *exdata = NULL; if (!card->drv_data) return SC_ERROR_INVALID_ARGUMENTS; exdata = (epass2003_exdata *)card->drv_data; if (exdata->sm) { card->sm_ctx.sm_mode = 0; r = mutual_auth(card, g_init_key_enc, g_init_key_mac); ca...
0
78,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: void __readwrite_bug(const char *fn) { printk("%s called, but not implemented\n", fn); BUG(); } Commit Message: ARM: 7735/2: Preserve the user r/w register TPIDRURW on context switch and fork Since commit 6a1c53124aa1 the user writeable TLS register was zeroed to prevent it from being used as a covert channel...
0
58,363
Analyze the following 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 http_header_add_tail2(struct http_msg *msg, struct hdr_idx *hdr_idx, const char *text, int len) { int bytes; bytes = buffer_insert_line2(msg->chn->buf, msg->chn->buf->p + msg->eoh, text, len); if (!bytes) return -1; http_msg_move_end(msg, bytes); return hdr_idx_add(len, 1, hd...
0
6,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::SuppressLoadEvent() { if (!LoadEventFinished()) load_event_progress_ = kLoadEventCompleted; } Commit Message: Cleanup and remove dead code in SetFocusedElement This early-out was added in: https://crrev.com/ce8ea3446283965c7eabab592cbffe223b1cf2bc Back then, we applied fragment focus in L...
0
129,893
Analyze the following 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 classMethodWithOptionalMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); TestObjectV8Internal::classMethodWithOptionalMethod(info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); } Commit Message: document.locatio...
0
121,600
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int _nfs4_open_delegation_recall(struct nfs_open_context *ctx, struct nfs4_state *state, const nfs4_stateid *stateid) { struct nfs4_opendata *opendata; int ret; opendata = nfs4_open_recoverdata_alloc(ctx, state); if (IS_ERR(opendata)) return PTR_ERR(opendata); opendata->o_arg.claim = NFS4_OPEN_CLAI...
0
22,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 RenderFrameHostImpl::RequestTextSurroundingSelection( const TextSurroundingSelectionCallback& callback, int max_length) { DCHECK(!callback.is_null()); if (!text_surrounding_selection_callback_.is_null()) { callback.Run(base::string16(), 0, 0); return; } text_surrounding_selection_call...
0
127,887
Analyze the following 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 nft_dump_stats(struct sk_buff *skb, struct nft_stats __percpu *stats) { struct nft_stats *cpu_stats, total; struct nlattr *nest; unsigned int seq; u64 pkts, bytes; int cpu; memset(&total, 0, sizeof(total)); for_each_possible_cpu(cpu) { cpu_stats = per_cpu_ptr(stats, cpu); do { seq = u64_...
0
58,020
Analyze the following 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 blkcg_gq *blkg_create(struct blkcg *blkcg, struct request_queue *q, struct blkcg_gq *new_blkg) { struct blkcg_gq *blkg; struct bdi_writeback_congested *wb_congested; int i, ret; WARN_ON_ONCE(!rcu_read_lock_held()); lockdep_assert_held(q->queue_lock); /* blkg holds a reference...
0
84,133
Analyze the following 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 DownloadProtectionService::IsSupportedDownload( const content::DownloadItem& item, const base::FilePath& target_path) const { #if defined(OS_WIN) || defined(OS_MACOSX) DownloadCheckResultReason reason = REASON_MAX; ClientDownloadRequest::DownloadType type = ClientDownloadRequest::WIN_EXECUT...
0
123,749
Analyze the following 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 TestScopedKeyboardHook::LockSpecificKey(ui::DomCode dom_code) { keyboard_lock_active_ = true; locked_key_ = dom_code; } Commit Message: Start rendering timer after first navigation Currently the new content rendering timer in the browser process, which clears an old page's contents 4 seconds after a na...
0
145,611
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int snd_usb_apply_interface_quirk(struct snd_usb_audio *chip, int iface, int altno) { /* audiophile usb: skip altsets incompatible with device_setup */ if (chip->usb_id == USB_ID(0x0763, 0x2003)) return audiophile_skip_setting_quirk(chip, iface, altno); /* quattro usb: skip altsets incompatible w...
0
55,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 bool netlink_filter_tap(const struct sk_buff *skb) { struct sock *sk = skb->sk; bool pass = false; /* We take the more conservative approach and * whitelist socket protocols that may pass. */ switch (sk->sk_protocol) { case NETLINK_ROUTE: case NETLINK_USERSOCK: case NETLINK_SOCK_DIAG: case NET...
0
40,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: gx_dc_colored_masked_get_dev_halftone(const gx_device_color * pdevc) { return pdevc->colors.colored.c_ht; } Commit Message: CWE ID: CWE-704
0
1,668
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: mrb_class_name_class(mrb_state *mrb, struct RClass *outer, struct RClass *c, mrb_sym id) { mrb_value name; mrb_sym nsym = mrb_intern_lit(mrb, "__classname__"); if (mrb_obj_iv_defined(mrb, (struct RObject*)c, nsym)) return; if (outer == NULL || outer == mrb->object_class) { name = mrb_symbol_value(id)...
0
82,073
Analyze the following 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
59,914
Analyze the following 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 canon_copy_from_read_buf(struct tty_struct *tty, unsigned char __user **b, size_t *nr) { struct n_tty_data *ldata = tty->disc_data; size_t n, size, more, c; size_t eol; size_t tail; int ret, found = 0; /* N.B. avoid overrun if nr == 0 */ if (!*nr) return 0; n = min(*nr + 1, ...
0
76,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: static void release_tree_content_recursive(struct tree_content *t) { unsigned int i; for (i = 0; i < t->entry_count; i++) release_tree_entry(t->entries[i]); release_tree_content(t); } Commit Message: prefer memcpy to strcpy When we already know the length of a string (e.g., because we just malloc'd to fit ...
0
55,132
Analyze the following 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 posix_acl_fix_xattr_to_user(void *value, size_t size) { struct user_namespace *user_ns = current_user_ns(); if (user_ns == &init_user_ns) return; posix_acl_fix_xattr_userns(user_ns, &init_user_ns, value, size); } Commit Message: posix_acl: Clear SGID bit when setting file permissions When file permiss...
0
50,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: struct lruvec *mem_cgroup_lru_add_list(struct zone *zone, struct page *page, enum lru_list lru) { struct mem_cgroup_per_zone *mz; struct mem_cgroup *memcg; struct page_cgroup *pc; if (mem_cgroup_disabled()) return &zone->lruvec; pc = lookup_page_cgroup(page); memcg = pc->mem_cgroup; mz = pag...
0
21,434
Analyze the following 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 dump_backtrace() { HANDLE hCurrentThread; HANDLE hThread; DWORD dwThreadId; DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &hCurrentThread, 0, FALSE, DUPLICATE_SAME_ACCESS); hThread = CreateThread(NULL, 0, dump_thread_proc, (LPVOID)hCurrentThr...
0
3,828
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ChildProcessLauncherHelper::LaunchProcessOnLauncherThread( const base::LaunchOptions& options, std::unique_ptr<PosixFileDescriptorInfo> files_to_register, bool* is_synchronous_launch, int* launch_result) { *is_synchronous_launch = false; JNIEnv* env = AttachCurrentThread(); DCHECK(env); ...
0
151,843
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int _find_waiter(struct waiter *w, uint32_t *jp) { return (w->jobid == *jp); } Commit Message: Fix security issue in _prolog_error(). Fix security issue caused by insecure file path handling triggered by the failure of a Prolog script. To exploit this a user needs to anticipate or cause the Prolog to fa...
0
72,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: mm_make_entry(struct mm_master *mm, struct mmtree *head, void *address, size_t size) { struct mm_share *tmp, *tmp2; if (mm->mmalloc == NULL) tmp = xcalloc(1, sizeof(struct mm_share)); else tmp = mm_xmalloc(mm->mmalloc, sizeof(struct mm_share)); tmp->address = address; tmp->size = size; tmp2 = RB_I...
0
72,193
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: TestConnectionHelper(base::TaskRunner* runner, QuicClock* clock, MockUDPClientSocket* socket) : QuicConnectionHelper(runner, clock, socket) { } Commit Message: Fix uninitialized access in QuicConnectionHelperTest BUG=159928 Review URL: https://chromiumco...
0
115,440
Analyze the following 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 BackgroundLoaderOffliner::RunRenovations() { if (page_renovator_) { page_renovator_->RunRenovations( base::Bind(&BackgroundLoaderOffliner::RenovationsCompleted, weak_ptr_factory_.GetWeakPtr())); } } Commit Message: Remove unused histograms from the background loader offlin...
0
139,126
Analyze the following 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 authenc_esn_verify_ahash_update_done(struct crypto_async_request *areq, int err) { u8 *ihash; unsigned int authsize; struct ablkcipher_request *abreq; struct aead_request *req = areq->data; struct crypto_aead *authenc_esn = crypto_aead_reqtfm(req); struct crypto_authenc_esn_ctx *ctx = cry...
0
45,539
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: _gnutls_read_client_hello (gnutls_session_t session, opaque * data, int datalen) { uint8_t session_id_len; int pos = 0, ret; uint16_t suite_size, comp_size; gnutls_protocol_t adv_version; int neg_version; int len = datalen; opaque rnd[TLS_RANDOM_SIZE], *suite_ptr, *comp_ptr; if (session->in...
0
12,113
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void free_rsdr_hdr(SCV_RSDS_HEADER* rsds_hdr) { R_FREE (rsds_hdr->file_name); } Commit Message: Fix crash in pe CWE ID: CWE-125
0
82,906
Analyze the following 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 fastop(struct x86_emulate_ctxt *ctxt, void (*fop)(struct fastop *)) { ulong flags = (ctxt->eflags & EFLAGS_MASK) | X86_EFLAGS_IF; if (!(ctxt->d & ByteOp)) fop += __ffs(ctxt->dst.bytes) * FASTOP_SIZE; asm("push %[flags]; popf; call *%[fastop]; pushf; pop %[flags]\n" : "+a"(ctxt->dst.val), "+d"...
0
35,572
Analyze the following 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_server_setup_fill_chatnet(IRC_SERVER_CONNECT_REC *conn, IRC_CHATNET_REC *ircnet) { if (!IS_IRC_SERVER_CONNECT(conn)) return; g_return_if_fail(IS_IRCNET(ircnet)); if (ircnet->alternate_nick != NULL) { g_free_and_null(conn->alternate_nick); conn->alternate_nick = g_strdup(ircnet->al...
1
169,644
Analyze the following 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 init_userinfo(void) { unsigned int changed; const char *set, *nick, *user_name, *str; changed = 0; /* check if nick/username/realname wasn't read from setup.. */ set = settings_get_str("real_name"); if (set == NULL || *set == '\0') { str = g_getenv("IRCNAME"); settings_set_str("real_...
0
89,418
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: cosine_seek_read(wtap *wth, gint64 seek_off, struct wtap_pkthdr *phdr, Buffer *buf, int *err, gchar **err_info) { char line[COSINE_LINE_LENGTH]; if (file_seek(wth->random_fh, seek_off, SEEK_SET, err) == -1) return FALSE; if (file_gets(line, COSINE_LINE_LENGTH, wth->random_fh) == NULL) { *err = file_erro...
0
51,774
Analyze the following 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 jsvAppendStringVar(JsVar *var, const JsVar *str, size_t stridx, size_t maxLength) { assert(jsvIsString(var)); JsvStringIterator dst; jsvStringIteratorNew(&dst, var, 0); jsvStringIteratorGotoEnd(&dst); /* This isn't as fast as something single-purpose, but it's not that bad, * and is less like...
0
82,359
Analyze the following 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 insert_exceptions(struct pstore *ps, int (*callback)(void *callback_context, chunk_t old, chunk_t new), void *callback_context, int *full) { int r; unsigned int i; struct core_exception e; /* presume the area is full */ *full = 1; for (i = 0; i < ps->exceptions...
0
29,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: PassRefPtr<RenderStyle> Element::originalStyleForRenderer() { return document()->styleResolver()->styleForElement(this); } Commit Message: Set Attr.ownerDocument in Element#setAttributeNode() Attr objects can move across documents by setAttributeNode(). So It needs to reset ownerDocument through TreeScopeAd...
0
112,322
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: AddPinhole(struct upnphttp * h, const char * action, const char * ns) { int r; static const char resp[] = "<u:%sResponse " "xmlns:u=\"%s\">" "<UniqueID>%d</UniqueID>" "</u:%sResponse>"; char body[512]; int bodylen; struct NameValueParserData data; char * rem_host, * rem_port, * int_ip, * int_port, *...
0
89,846
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: CSSStyleSheet& Document::ElementSheet() { if (!elem_sheet_) elem_sheet_ = CSSStyleSheet::CreateInline(*this, base_url_); return *elem_sheet_; } Commit Message: Cleanup and remove dead code in SetFocusedElement This early-out was added in: https://crrev.com/ce8ea3446283965c7eabab592cbffe223b1cf2bc Back...
0
129,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: int bdrv_create(BlockDriver *drv, const char* filename, QEMUOptionParameter *options, Error **errp) { int ret; Coroutine *co; CreateCo cco = { .drv = drv, .filename = g_strdup(filename), .options = options, .ret = NOT_DONE, .err = NULL, }; if (!drv...
0
16,847
Analyze the following 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 DownloadManagerImpl::OpenDownload(download::DownloadItemImpl* download) { int num_unopened = 0; for (const auto& it : downloads_) { download::DownloadItemImpl* item = it.second.get(); if ((item->GetState() == download::DownloadItem::COMPLETE) && !item->GetOpened()) ++num_unopened; ...
0
151,229
Analyze the following 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 BluetoothAdapter::DeleteDeviceForTesting(const std::string& address) { devices_.erase(address); } Commit Message: bluetooth: Implement getAvailability() This change implements the getAvailability() method for navigator.bluetooth as defined in the specification. Bug: 707640 Change-Id: I9e9b3e7f8ea7f259e9...
0
138,169
Analyze the following 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 tun_detach(struct tun_struct *tun) { rtnl_lock(); __tun_detach(tun); rtnl_unlock(); } Commit Message: net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared After the last patch, We are left in a state in which only drivers calling ether_setup have IFF_TX_SKB_SHARING set (we assu...
0
23,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: static int sctp_getsockopt_sctp_status(struct sock *sk, int len, char __user *optval, int __user *optlen) { struct sctp_status status; struct sctp_association *asoc = NULL; struct sctp_transport *transport; sctp_assoc_t associd; int retval = 0; if (len < sizeof(status)) { retval = -...
0
60,677
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: HTMLMediaElement::HTMLMediaElement(const QualifiedName& tag_name, Document& document) : HTMLElement(tag_name, document), PausableObject(&document), load_timer_(document.GetTaskRunner(TaskType::kUnthrottled), this, &HTMLMediaEle...
0
154,122
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: R_API void r_bin_force_plugin(RBin *bin, const char *name) { free (bin->force); bin->force = (name && *name)? strdup (name): NULL; } Commit Message: Fix #8748 - Fix oobread on string search CWE ID: CWE-125
0
60,144
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int snd_msndmidi_new(struct snd_card *card, int device) { struct snd_msnd *chip = card->private_data; struct snd_msndmidi *mpu; struct snd_rawmidi *rmidi; int err; err = snd_rawmidi_new(card, "MSND-MIDI", device, 1, 1, &rmidi); if (err < 0) return err; mpu = kzalloc(sizeof(*mpu), GFP_KERNEL); if (mpu =...
0
64,105
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void SetGeneratingNodeInfo(TracedValue* value, const LayoutObject* layout_object, const char* id_field_name, const char* name_field_name = nullptr) { Node* node = nullptr; for (; layout_object && !node...
0
138,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: _dbus_win_error_from_last_error (void) { switch (GetLastError()) { case 0: return DBUS_ERROR_FAILED; case ERROR_NO_MORE_FILES: case ERROR_TOO_MANY_OPEN_FILES: return DBUS_ERROR_LIMITS_EXCEEDED; /* kernel out of memory */ case ERROR_ACCESS_DENIED: case ERROR_CANNOT_MAKE:...
0
3,820
Analyze the following 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 UnlockCompositor() { defer_compositor_lock_ = false; compositor_lock_ = NULL; } Commit Message: Implement TextureImageTransportSurface using texture mailbox This has a couple of advantages: - allow tearing down and recreating the UI parent context without losing the renderer contexts - do not r...
0
114,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: update_info_drive_adapter (Device *device) { Adapter *adapter; const gchar *adapter_object_path; adapter_object_path = NULL; adapter = daemon_local_find_enclosing_adapter (device->priv->daemon, device->priv->native_path); if (adapter != NULL) { adapter_object_path = adapter_local_get_object_...
0
11,829
Analyze the following 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 mca_ccb_dl_open(tMCA_CCB* p_ccb, UNUSED_ATTR tMCA_CCB_EVT* p_data) { osi_free_and_reset((void**)&p_ccb->p_tx_req); osi_free_and_reset((void**)&p_ccb->p_rx_msg); p_ccb->status = MCA_CCB_STAT_NORM; } Commit Message: Add packet length checks in mca_ccb_hdl_req Bug: 110791536 Test: manual Change-Id: Ica5...
0
162,889
Analyze the following 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_btn_failed_cb(GtkButton *button) { /* Since the Repeat button has been introduced, the event chain isn't * terminated upon a failure in order to be able to continue in processing * in the retry action. * * Now, user decided to run the emergency analysis instead of trying to ...
0
42,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: void PropertyTreeManager::SetupRootEffectNode() { cc::EffectTree& effect_tree = property_trees_.effect_tree; effect_tree.clear(); property_trees_.element_id_to_effect_node_index.clear(); cc::EffectNode& effect_node = *effect_tree.Node(effect_tree.Insert(cc::EffectNode(), kInvalidNodeId)); DCHECK_E...
1
171,829
Analyze the following 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 arch_ptrace(struct task_struct *child, long request, unsigned long addr, unsigned long data) { int ret; unsigned long __user *datap = (unsigned long __user *) data; switch (request) { case PTRACE_PEEKUSR: ret = ptrace_read_user(child, addr, datap); break; case PTRACE_POKEUSR: ret = ptrac...
1
167,580
Analyze the following 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 onRttResults(wifi_request_id id, unsigned num_results, wifi_rtt_result* results[]) { JNIHelper helper(mVM); ALOGD("onRttResults called, vm = %p, obj = %p", mVM, mCls); JNIObject<jobjectArray> rttResults = helper.newObjectArray( num_results, "android/net/wifi/RttManager$RttResult",...
0
159,135
Analyze the following 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 jfs_init_acl(tid_t tid, struct inode *inode, struct inode *dir) { struct posix_acl *default_acl, *acl; int rc = 0; rc = posix_acl_create(dir, &inode->i_mode, &default_acl, &acl); if (rc) return rc; if (default_acl) { rc = __jfs_set_acl(tid, inode, ACL_TYPE_DEFAULT, default_acl); posix_acl_release...
0
50,355
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int get_uint64(QEMUFile *f, void *pv, size_t size) { uint64_t *v = pv; qemu_get_be64s(f, v); return 0; } Commit Message: CWE ID: CWE-119
0
15,712
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: copy_opt_map(OptMap* to, OptMap* from) { *to = *from; } Commit Message: Fix CVE-2019-13225: problem in converting if-then-else pattern to bytecode. CWE ID: CWE-476
0
89,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: long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr, unsigned long shmlba) { struct shmid_kernel *shp; unsigned long addr; unsigned long size; struct file *file; int err; unsigned long flags; unsigned long prot; int acc_mode; struct ipc_namespace *ns; struct shm_file_dat...
1
168,379
Analyze the following 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 rmap_item *unstable_tree_search_insert(struct rmap_item *rmap_item, struct page *page, struct page **tree_pagep) { struct rb_node **new = &root_unstable_tree.rb_node; struct rb_node *parent = NULL; while (*new) { struct rmap_item *tree_rmap_item; struct page *tree_page; int...
0
27,304
Analyze the following 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 filter_level_for_mb(VP8Context *s, VP8Macroblock *mb, VP8FilterStrength *f, int is_vp7) { int interior_limit, filter_level; if (s->segmentation.enabled) { filter_level = s->segmentation.filter_level[mb->segment]; if (!s->segmentation.absolute_vals) ...
0
63,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: __ip_vs_svc_fwm_find(struct net *net, int af, __u32 fwmark) { unsigned int hash; struct ip_vs_service *svc; /* Check for fwmark addressed entries */ hash = ip_vs_svc_fwm_hashkey(net, fwmark); list_for_each_entry(svc, &ip_vs_svc_fwm_table[hash], f_list) { if (svc->fwmark == fwmark && svc->af == af &...
0
34,179
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void timerfd_setup_cancel(struct timerfd_ctx *ctx, int flags) { if ((ctx->clockid == CLOCK_REALTIME || ctx->clockid == CLOCK_REALTIME_ALARM) && (flags & TFD_TIMER_ABSTIME) && (flags & TFD_TIMER_CANCEL_ON_SET)) { if (!ctx->might_cancel) { ctx->might_cancel = true; spin_lock(&cancel_...
1
168,068
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void TabStripGtk::OnMap(GtkWidget* widget) { ReStack(); } Commit Message: Remove TabContents from TabStripModelObserver::TabDetachedAt. BUG=107201 TEST=no visible change Review URL: https://chromiumcodereview.appspot.com/11293205 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167122 0039d316-1c4b-4281...
0
118,141