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: static inline int ape_decode_value_3860(APEContext *ctx, GetBitContext *gb, APERice *rice) { unsigned int x, overflow; overflow = get_unary(gb, 1, get_bits_left(gb)); if (ctx->fileversion > 3880) { while (overflow >= 16) { overflow -= 16; ...
0
63,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: void SoundTriggerHwService::Module::setCaptureState_l(bool active) { ALOGV("Module::setCaptureState_l %d", active); sp<SoundTriggerHwService> service; sound_trigger_service_state_t state; Vector< sp<IMemory> > events; { AutoMutex lock(mLock); state = (active && !mDescriptor.properties.concurr...
0
158,089
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void tg3_read_bc_ver(struct tg3 *tp) { u32 val, offset, start, ver_offset; int i, dst_off; bool newver = false; if (tg3_nvram_read(tp, 0xc, &offset) || tg3_nvram_read(tp, 0x4, &start)) return; offset = tg3_nvram_logical_addr(tp, offset); if (tg3_nvram_read(tp, offset, &val)) return; if ...
0
32,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: static int decode_unit(SCPRContext *s, PixelModel *pixel, unsigned step, unsigned *rval) { GetByteContext *gb = &s->gb; RangeCoder *rc = &s->rc; unsigned totfr = pixel->total_freq; unsigned value, x = 0, cumfr = 0, cnt_x = 0; int i, j, ret, c, cnt_c; if ((ret = s->get_freq(rc, totfr, &val...
0
63,937
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void HTMLElement::setInnerText(const String& text, ExceptionCode& ec) { if (ieForbidsInsertHTML()) { ec = NO_MODIFICATION_ALLOWED_ERR; return; } if (hasLocalName(colTag) || hasLocalName(colgroupTag) || hasLocalName(framesetTag) || hasLocalName(headTag) || hasLocalName(htmlTag) ...
0
100,391
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gs_pop_real(gs_main_instance * minst, float *result) { i_ctx_t *i_ctx_p = minst->i_ctx_p; ref vref; int code = pop_value(i_ctx_p, &vref); if (code < 0) return code; switch (r_type(&vref)) { case t_real: *result = vref.value.realval; break; case ...
0
2,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 netsnmp_session_set_sec_level(struct snmp_session *s, char *level) { if (!strcasecmp(level, "noAuthNoPriv") || !strcasecmp(level, "nanp")) { s->securityLevel = SNMP_SEC_LEVEL_NOAUTH; } else if (!strcasecmp(level, "authNoPriv") || !strcasecmp(level, "anp")) { s->securityLevel = SNMP_SEC_LEVEL_AUTH...
0
9,548
Analyze the following 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 mptsas1068_class_init(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); PCIDeviceClass *pc = PCI_DEVICE_CLASS(oc); pc->realize = mptsas_scsi_init; pc->exit = mptsas_scsi_uninit; pc->romfile = 0; pc->vendor_id = PCI_VENDOR_ID_LSI_LOGIC; pc->device_id = PCI_...
0
8,352
Analyze the following 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 unregister_net_sysctl_table(struct ctl_table_header *header) { unregister_sysctl_table(header); } Commit Message: net: Update the sysctl permissions handler to test effective uid/gid Modify the code to use current_euid(), and in_egroup_p, as in done in fs/proc/proc_sysctl.c:test_perm() Cc: stable@vger.ke...
0
29,696
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: long ContentEncoding::ParseContentEncAESSettingsEntry( long long start, long long size, IMkvReader* pReader, ContentEncAESSettings* aes) { assert(pReader); assert(aes); long long pos = start; const long long stop = start + size; while (pos < stop) { long long id, size; const long status = ParseElemen...
1
173,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: static inline double GetFITSPixelRange(const size_t depth) { return((double) ((MagickOffsetType) GetQuantumRange(depth))); } Commit Message: CWE ID: CWE-119
0
71,542
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: slab_out_of_memory(struct kmem_cache *cachep, gfp_t gfpflags, int nodeid) { #if DEBUG struct kmem_cache_node *n; unsigned long flags; int node; static DEFINE_RATELIMIT_STATE(slab_oom_rs, DEFAULT_RATELIMIT_INTERVAL, DEFAULT_RATELIMIT_BURST); if ((gfpflags & __GFP_NOWARN) || !__ratelimit(&slab_oom_r...
0
68,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 n_tty_set_termios(struct tty_struct *tty, struct ktermios *old) { struct n_tty_data *ldata = tty->disc_data; if (!old || (old->c_lflag ^ tty->termios.c_lflag) & ICANON) { bitmap_zero(ldata->read_flags, N_TTY_BUF_SIZE); ldata->line_start = ldata->read_tail; if (!L_ICANON(tty) || !read_cnt(ldat...
0
39,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: bool PasswordAutofillAgent::FillSuggestion( const WebFormControlElement& control_element, const base::string16& username, const base::string16& password) { const WebInputElement* element = ToWebInputElement(&control_element); if (!element) return false; WebInputElement username_element; W...
0
137,612
Analyze the following 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 ResourceFetcher::StopFetching() { StopFetchingInternal(StopFetchingTarget::kExcludingKeepaliveLoaders); } Commit Message: DevTools: send proper resource type in Network.RequestWillBeSent This patch plumbs resoure type into the DispatchWillSendRequest instrumenation. This allows us to report accurate type...
0
138,907
Analyze the following 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 convert_samples_short(int buf_c, short **buffer, int b_offset, int data_c, float **data, int d_offset, int samples) { int i; if (buf_c != data_c && buf_c <= 2 && data_c <= 6) { static int channel_selector[3][2] = { {0}, {PLAYBACK_MONO}, {PLAYBACK_LEFT, PLAYBACK_RIGHT} }; for (i=0; i ...
0
75,250
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int do_output_char(unsigned char c, struct tty_struct *tty, int space) { struct n_tty_data *ldata = tty->disc_data; int spaces; if (!space) return -1; switch (c) { case '\n': if (O_ONLRET(tty)) ldata->column = 0; if (O_ONLCR(tty)) { if (space < 2) return -1; ldata->canon_column = ...
0
39,782
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void webkit_web_view_set_scroll_adjustments(WebKitWebView* webView, GtkAdjustment* horizontalAdjustment, GtkAdjustment* verticalAdjustment) { Page* page = core(webView); if (!page) return; WebKit::ChromeClient* client = static_cast<WebKit::ChromeClient*>(page->chrome()->client()); ...
0
100,639
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: megasas_dump_pending_frames(struct megasas_instance *instance) { struct megasas_cmd *cmd; int i,n; union megasas_sgl *mfi_sgl; struct megasas_io_frame *ldio; struct megasas_pthru_frame *pthru; u32 sgcount; u16 max_cmd = instance->max_fw_cmds; dev_err(&instance->pdev->dev, "[%d]: Dumping Frame Phys Addres...
0
90,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 int request_key_auth_instantiate(struct key *key, struct key_preparsed_payload *prep) { key->payload.data[0] = (struct request_key_auth *)prep->data; return 0; } Commit Message: KEYS: Fix race between updating and finding a negative key Consolidate KEY_FLAG_INSTANTIATED, KEY_FLAG_NEGATIVE and the ...
0
60,286
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static unsigned zlib_compress(unsigned char** out, size_t* outsize, const unsigned char* in, size_t insize, const LodePNGCompressSettings* settings) { if(settings->custom_zlib) { return settings->custom_zlib(out, outsize, in, insize, settings); } else { return lodep...
0
87,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: bool IsNull(base::DictionaryValue* value, const std::string& key) { base::Value* child = NULL; if (!value->Get(key, &child)) { ADD_FAILURE(); return false; } return child->GetType() == base::Value::TYPE_NULL; } Commit Message: V8ValueConverter::ToV8Value should not trigger sett...
0
156,536
Analyze the following 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 set_on_found_plugin_process_host_called() { on_found_plugin_process_host_called_ = true; } Commit Message: Follow-on fixes and naming changes for https://codereview.chromium.org/12086077/ BUG=172573 Review URL: https://codereview.chromium.org/12177018 git-svn-id: svn://svn.chromium.org/chrome/trun...
0
116,827
Analyze the following 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 WebRuntimeFeatures::EnableGamepadExtensions(bool enable) { RuntimeEnabledFeatures::SetGamepadExtensionsEnabled(enable); } Commit Message: Remove RequireCSSExtensionForFile runtime enabled flag. The feature has long since been stable (since M64) and doesn't seem to be a need for this flag. BUG=788936 Ch...
0
154,616
Analyze the following 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 __hwahc_op_set_gtk(struct wusbhc *wusbhc, u32 tkid, const void *key, size_t key_size) { u8 key_idx = wusb_key_index(0, WUSB_KEY_INDEX_TYPE_GTK, WUSB_KEY_INDEX_ORIGINATOR_HOST); return __hwahc_dev_set_key(wusbhc, 0, tkid, key, key_size, key_idx); } Commit Message: USB: check usb_get...
0
75,575
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: nfssvc_encode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy) { return xdr_ressize_check(rqstp, p); } Commit Message: Merge tag 'nfsd-4.12' of git://linux-nfs.org/~bfields/linux Pull nfsd updates from Bruce Fields: "Another RDMA update from Chuck Lever, and a bunch of miscellaneous bugfixes" * tag 'nf...
0
65,869
Analyze the following 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::WillCommitNavigation() { if (GetFrameLoader().StateMachine()->CreatingInitialEmptyDocument()) return; probe::willCommitLoad(frame_, this); frame_->GetIdlenessDetector()->WillCommitLoad(); } Commit Message: Fix detach with open()ed document leaving parent loading indefinitely Chang...
0
125,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: XMP_Uns32 VP8XChunk::width() { return GetLE24(&this->data[4]) + 1; } Commit Message: CWE ID: CWE-20
0
15,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: nvmet_fc_alloc_ls_iodlist(struct nvmet_fc_tgtport *tgtport) { struct nvmet_fc_ls_iod *iod; int i; iod = kcalloc(NVMET_LS_CTX_COUNT, sizeof(struct nvmet_fc_ls_iod), GFP_KERNEL); if (!iod) return -ENOMEM; tgtport->iod = iod; for (i = 0; i < NVMET_LS_CTX_COUNT; iod++, i++) { INIT_WORK(&iod->work, nvm...
0
93,593
Analyze the following 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 setup_new_exec(struct linux_binprm * bprm) { arch_pick_mmap_layout(current->mm); /* This is the point of no return */ current->sas_ss_sp = current->sas_ss_size = 0; if (uid_eq(current_euid(), current_uid()) && gid_eq(current_egid(), current_gid())) set_dumpable(current->mm, SUID_DUMPABLE_ENABLED); e...
0
34,538
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SECURITY_STATUS SEC_ENTRY ImpersonateSecurityContext(PCtxtHandle phContext) { return SEC_E_OK; } Commit Message: nla: invalidate sec handle after creation If sec pointer isn't invalidated after creation it is not possible to check if the upper and lower pointers are valid. This fixes a segfault in the server ...
0
58,583
Analyze the following 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 lh_table_length(struct lh_table *t) { return t->count; } Commit Message: Patch to address the following issues: * CVE-2013-6371: hash collision denial of service * CVE-2013-6370: buffer overflow if size_t is larger than int CWE ID: CWE-310
0
40,964
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: nautilus_file_operations_new_file (GtkWidget *parent_view, GdkPoint *target_point, const char *parent_dir, const char *target_filename, ...
0
61,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: void PacketFree(Packet *p) { PACKET_DESTRUCTOR(p); SCFree(p); } Commit Message: teredo: be stricter on what to consider valid teredo Invalid Teredo can lead to valid DNS traffic (or other UDP traffic) being misdetected as Teredo. This leads to false negatives in the UDP payload inspection. Make the ter...
0
87,039
Analyze the following 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<SharedBitmap> ClientSharedBitmapManager::AllocateSharedBitmap( const gfx::Size& size) { TRACE_EVENT2("renderer", "ClientSharedBitmapManager::AllocateSharedBitmap", "width", size.width(), "height", size.height()); size_t memory_size; if (!SharedBitmap::SizeInBytes(size, &me...
0
149,182
Analyze the following 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 methodWithEnforceRangeUInt32Method(const v8::FunctionCallbackInfo<v8::Value>& info) { ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithEnforceRangeUInt32", "TestObject", info.Holder(), info.GetIsolate()); if (UNLIKELY(info.Length() < 1)) { exceptionState.throw...
0
121,785
Analyze the following 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::useGraphicBuffer2_l( OMX_U32 portIndex, const sp<GraphicBuffer>& graphicBuffer, OMX::buffer_id *buffer) { if (graphicBuffer == NULL || buffer == NULL) { ALOGE("b/25884056"); return BAD_VALUE; } OMX_PARAM_PORTDEFINITIONTYPE def; InitOMXParams(&def); de...
0
157,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: GF_Err reftype_AddRefTrack(GF_TrackReferenceTypeBox *ref, u32 trackID, u16 *outRefIndex) { u32 i; if (!ref || !trackID) return GF_BAD_PARAM; if (outRefIndex) *outRefIndex = 0; for (i = 0; i < ref->trackIDCount; i++) { if (ref->trackIDs[i] == trackID) { if (outRefIndex) *outRefIndex = i+1; return GF_O...
0
80,342
Analyze the following 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 anubis_mod_fini(void) { crypto_unregister_alg(&anubis_alg); } Commit Message: crypto: prefix module autoloading with "crypto-" This prefixes all crypto module loading with "crypto-" so we never run the risk of exposing module auto-loading to userspace via a crypto API, as demonstrated by Mat...
0
47,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: void PostClosure(MessageLoop* message_loop, const tracked_objects::Location& from_here, const base::Closure& callback) { message_loop->PostTask(from_here, callback); } Commit Message: [Sync] Cleanup all tab sync enabling logic now that its on by default. BUG=none TEST= Revi...
0
104,886
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Compositor* Compositor::Create(CompositorClient* client, gfx::NativeWindow root_window) { return client ? new CompositorImpl(client, root_window) : NULL; } Commit Message: gpu/android : Add support for partial swap with surface control. Add support for PostSubBuffer to GLSurface...
0
130,803
Analyze the following 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 Unpack<WebGLImageConversion::kDataFormatRGBA2_10_10_10, uint32_t, float>( const uint32_t* source, float* destination, unsigned pixels_per_row) { static const float kRgbScaleFactor = 1.0f / 1023.0f; static const float kAlphaScaleFactor = 1.0f / 3.0f; for (unsigned i = 0; i < pixels_per_row; ...
0
146,739
Analyze the following 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 DatabaseImpl::Put( int64_t transaction_id, int64_t object_store_id, ::indexed_db::mojom::ValuePtr value, const IndexedDBKey& key, blink::WebIDBPutMode mode, const std::vector<IndexedDBIndexKeys>& index_keys, ::indexed_db::mojom::CallbacksAssociatedPtrInfo callbacks_info) { Child...
0
136,633
Analyze the following 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 SkiaOutputSurfaceImpl::RemoveRenderPassResource( std::vector<RenderPassId> ids) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); DCHECK(!ids.empty()); std::vector<std::unique_ptr<ImageContextImpl>> image_contexts; image_contexts.reserve(ids.size()); for (const auto id : ids) { auto it = r...
0
135,982
Analyze the following 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_ip6t_get_ctl(struct sock *sk, int cmd, void __user *user, int *len) { int ret; if (!ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN)) return -EPERM; switch (cmd) { case IP6T_SO_GET_INFO: ret = get_info(sock_net(sk), user, len, 0); break; case IP6T_SO_GET_ENTRIES: ret = get_entries(sock_net(sk),...
0
52,345
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int xt_table_open(struct inode *inode, struct file *file) { int ret; struct xt_names_priv *priv; ret = seq_open_net(inode, file, &xt_table_seq_ops, sizeof(struct xt_names_priv)); if (!ret) { priv = ((struct seq_file *)file->private_data)->private; priv->af = (unsigned long)PDE_DATA(inode); ...
0
52,438
Analyze the following 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 Handle<FixedArray> DirectCollectElementIndicesImpl( Isolate* isolate, Handle<JSObject> object, Handle<FixedArrayBase> backing_store, GetKeysConversion convert, PropertyFilter filter, Handle<FixedArray> list, uint32_t* nof_indices, uint32_t insertion_index = 0) { if (filter & SKIP_STRINGS) return list...
0
163,074
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void BrowserWindowGtk::ShowAppMenu() { toolbar_->ShowAppMenu(); } 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-1...
0
118,012
Analyze the following 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 u64 do_task_delta_exec(struct task_struct *p, struct rq *rq) { u64 ns = 0; if (task_current(rq, p)) { update_rq_clock(rq); ns = rq->clock_task - p->se.exec_start; if ((s64)ns < 0) ns = 0; } return ns; } Commit Message: Sched: fix skip_clock_update optimization idle_balance() drops/retakes ...
0
22,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: void kvm_set_lapic_tscdeadline_msr(struct kvm_vcpu *vcpu, u64 data) { struct kvm_lapic *apic = vcpu->arch.apic; if (!kvm_vcpu_has_lapic(vcpu) || apic_lvtt_oneshot(apic) || apic_lvtt_period(apic)) return; hrtimer_cancel(&apic->lapic_timer.timer); apic->lapic_timer.tscdeadline = data; start_apic_timer(a...
0
28,785
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gfx::Size RenderWidgetHostViewAura::GetRequestedRendererSize() const { return delegated_frame_host_ ? delegated_frame_host_->GetRequestedRendererSize() : RenderWidgetHostViewBase::GetRequestedRendererSize(); } Commit Message: Allocate a FrameSinkId for RenderWidgetHostViewAura in mus+...
0
132,236
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void HTMLInputElement::setValueAsNumber(double newValue, ExceptionState& exceptionState, TextFieldEventBehavior eventBehavior) { if (!std::isfinite(newValue)) { exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::notAFiniteNumber(newValue)); return; } m_inputType->se...
0
114,014
Analyze the following 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 blk_start_request(struct request *req) { lockdep_assert_held(req->q->queue_lock); WARN_ON_ONCE(req->q->mq_ops); blk_dequeue_request(req); if (test_bit(QUEUE_FLAG_STATS, &req->q->queue_flags)) { req->io_start_time_ns = ktime_get_ns(); #ifdef CONFIG_BLK_DEV_THROTTLING_LOW req->throtl_size = blk_rq_se...
0
92,035
Analyze the following 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 save_pid(const pid_t pid, const char *pid_file) { FILE *fp; if (pid_file == NULL) return; if ((fp = fopen(pid_file, "w")) == NULL) { fprintf(stderr, "Could not open the pid file %s for writing\n", pid_file); return; } fprintf(fp,"%ld\n", (long)pid); if...
0
18,283
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void OfflinePageModelImpl::OnDeleteArchiveFilesDone( const std::vector<int64_t>& offline_ids, const DeletePageCallback& callback, bool success) { if (!success) { InformDeletePageDone(callback, DeletePageResult::DEVICE_FAILURE); return; } store_->RemoveOfflinePages( offline_ids, ba...
0
155,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 dnxhd_decode_dct_block_10(const DNXHDContext *ctx, RowContext *row, int n) { return dnxhd_decode_dct_block(ctx, row, n, 6, 8, 4, 0); } Commit Message: avcodec/dnxhddec: Move mb height check out of non hr branch Fixes: out of array access Fixes: poc.dnxhd Foun...
0
63,181
Analyze the following 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 u64 compute_guest_tsc(struct kvm_vcpu *vcpu, s64 kernel_ns) { u64 tsc = pvclock_scale_delta(kernel_ns-vcpu->arch.last_tsc_nsec, vcpu->kvm->arch.virtual_tsc_mult, vcpu->kvm->arch.virtual_tsc_shift); tsc += vcpu->arch.last_tsc_write; return tsc; } Commit Message: KVM: X86: Don't repor...
0
41,317
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: mrb_gc_free_mt(mrb_state *mrb, struct RClass *c) { kh_destroy(mt, mrb, c->mt); } Commit Message: `mrb_class_real()` did not work for `BasicObject`; fix #4037 CWE ID: CWE-476
0
82,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: static inline void put_ioctx(struct kioctx *kioctx) { BUG_ON(atomic_read(&kioctx->users) <= 0); if (unlikely(atomic_dec_and_test(&kioctx->users))) __put_ioctx(kioctx); } Commit Message: Unused iocbs in a batch should not be accounted as active. commit 69e4747ee9727d660b88d7e1efe0f4afcb35db1b upstream. Sinc...
0
21,695
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: cmsBool ReadPositionTable(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, cmsUInt32Number Count, cmsUInt32Number BaseOffset, void *Cargo, PositionTableEntry...
0
70,957
Analyze the following 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 reclaim_dma_bufs(void) { unsigned long flags; struct port_buffer *buf, *tmp; LIST_HEAD(tmp_list); if (list_empty(&pending_free_dma_bufs)) return; /* Create a copy of the pending_free_dma_bufs while holding the lock */ spin_lock_irqsave(&dma_bufs_lock, flags); list_cut_position(&tmp_list, &p...
0
66,612
Analyze the following 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 mbedtls_x509_crt_parse_path( mbedtls_x509_crt *chain, const char *path ) { int ret = 0; #if defined(_WIN32) && !defined(EFIX64) && !defined(EFI32) int w_ret; WCHAR szDir[MAX_PATH]; char filename[MAX_PATH]; char *p; size_t len = strlen( path ); WIN32_FIND_DATAW file_data; HANDL...
0
61,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: nfs4_set_lock_task_retry(unsigned long timeout) { freezable_schedule_timeout_killable(timeout); timeout <<= 1; if (timeout > NFS4_LOCK_MAXTIMEOUT) return NFS4_LOCK_MAXTIMEOUT; return timeout; } Commit Message: Fix length of buffer copied in __nfs4_get_acl_uncached _copy_from_pages() used to copy data from...
0
20,028
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: rend_service_get_by_service_id(const char *id) { tor_assert(strlen(id) == REND_SERVICE_ID_LEN_BASE32); SMARTLIST_FOREACH(rend_service_list, rend_service_t*, s, { if (tor_memeq(s->service_id, id, REND_SERVICE_ID_LEN_BASE32)) return s; }); return NULL; } Commit Message: Fix log-uninitialized-stac...
0
69,618
Analyze the following 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 anotherStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); TestObjectPythonV8Internal::anotherStringAttributeAttributeGetter(info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Exe...
0
122,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: static u8 *check_bytes(u8 *start, unsigned int value, unsigned int bytes) { while (bytes) { if (*start != (u8)value) return start; start++; bytes--; } return NULL; } Commit Message: remove div_long_long_rem x86 is the only arch right now, which provides an optimized for div_long_long_rem and it has ...
0
24,768
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static MagickBooleanType ReadDXT1(Image *image, DDSInfo *dds_info, ExceptionInfo *exception) { DDSColors colors; PixelPacket *q; register ssize_t i, x; size_t bits; ssize_t j, y; unsigned char code; unsigned short c0, c1; for (y = 0; y < (ssize_t) d...
0
74,002
Analyze the following 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 limitedWithInvalidMissingDefaultAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) { TestObject* imp = V8TestObject::toNative(info.Holder()); V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); CustomElementCallbackDi...
0
121,737
Analyze the following 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 security_context_to_sid_core(const char *scontext, u32 scontext_len, u32 *sid, u32 def_sid, gfp_t gfp_flags, int force) { char *scontext2, *str = NULL; struct context context; int rc = 0; if (!ss_initialized) { int i; for (i = 1; i < SECINITSID_NUM; i++) { if (!strcmp(initi...
1
166,432
Analyze the following 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 FetchContext::DispatchDidReceiveEncodedData(unsigned long, int) {} Commit Message: DevTools: send proper resource type in Network.RequestWillBeSent This patch plumbs resoure type into the DispatchWillSendRequest instrumenation. This allows us to report accurate type in Network.RequestWillBeSent event, inst...
0
138,857
Analyze the following 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 lookup_index_alloc( void **out, unsigned long *out_len, size_t entries, size_t hash_count) { size_t entries_len, hash_len, index_len; GITERR_CHECK_ALLOC_MULTIPLY(&entries_len, entries, sizeof(struct index_entry)); GITERR_CHECK_ALLOC_MULTIPLY(&hash_len, hash_count, sizeof(struct index_entry *)); ...
0
83,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 Gfx::opCurveTo2(Object args[], int numArgs) { double x1, y1, x2, y2, x3, y3; if (!state->isCurPt()) { error(getPos(), "No current point in curveto2"); return; } x1 = args[0].getNum(); y1 = args[1].getNum(); x2 = args[2].getNum(); y2 = args[3].getNum(); x3 = x2; y3 = y2; state->cu...
0
8,117
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bitne(PG_FUNCTION_ARGS) { VarBit *arg1 = PG_GETARG_VARBIT_P(0); VarBit *arg2 = PG_GETARG_VARBIT_P(1); bool result; int bitlen1, bitlen2; bitlen1 = VARBITLEN(arg1); bitlen2 = VARBITLEN(arg2); /* fast path for different-length inputs */ if (bitlen1 != bitlen2) result = true; else result ...
0
39,086
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void GaiaCookieManagerService::RemoveObserver(Observer* observer) { observer_list_.RemoveObserver(observer); } Commit Message: Add data usage tracking for chrome services Add data usage tracking for captive portal, web resource and signin services BUG=655749 Review-Url: https://codereview.chromium.org/26430...
0
129,009
Analyze the following 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 GLES2DecoderImpl::RestoreCurrentFramebufferBindings() { state_dirty_ = true; if (!feature_info_->feature_flags().chromium_framebuffer_multisample) { RebindCurrentFramebuffer( GL_FRAMEBUFFER, bound_draw_framebuffer_.get(), GetBackbufferServiceId()); } else { RebindCurren...
0
103,678
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ossl_cipher_free(void *ptr) { EVP_CIPHER_CTX_free(ptr); } Commit Message: cipher: don't set dummy encryption key in Cipher#initialize Remove the encryption key initialization from Cipher#initialize. This is effectively a revert of r32723 ("Avoid possible SEGV from AES encryption/decryption", 2011-07-28). r...
0
73,412
Analyze the following 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_layoutget_release(void *calldata) { struct nfs4_layoutget *lgp = calldata; dprintk("--> %s\n", __func__); put_nfs_open_context(lgp->args.ctx); kfree(calldata); dprintk("<-- %s\n", __func__); } Commit Message: Fix length of buffer copied in __nfs4_get_acl_uncached _copy_from_pages() used t...
0
19,925
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void ext4_print_free_blocks(struct inode *inode) { struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb); printk(KERN_CRIT "Total free blocks count %lld\n", ext4_count_free_blocks(inode->i_sb)); printk(KERN_CRIT "Free/Dirty block details\n"); printk(KERN_CRIT "free_blocks=%lld\n", (long long)...
0
57,535
Analyze the following 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 poll_timeout_store(struct bus_type *bus, const char *buf, size_t count) { unsigned long long time; ktime_t hr_time; /* 120 seconds = maximum poll interval */ if (sscanf(buf, "%llu\n", &time) != 1 || time < 1 || time > 120000000000ULL) return -EINVAL; poll_timeout = time; hr_time...
0
47,642
Analyze the following 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_cache_node(struct kmem_cache *cachep, int node, gfp_t gfp) { struct kmem_cache_node *n; /* * Set up the kmem_cache_node for cpu before we can * begin anything. Make sure some other cpu on this * node has not already allocated this */ n = get_node(cachep, node); if (n) { spin_lock_ir...
0
68,890
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ConstructSystemRequestContext(IOThread::Globals* globals, net::NetLog* net_log) { net::URLRequestContext* context = new SystemURLRequestContext; context->set_net_log(net_log); context->set_host_resolver(globals->host_resolver.get()); context->set_cert_verifier(globals->cert_v...
0
113,503
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Ins_JMPR( INS_ARG ) { DO_JMPR } Commit Message: CWE ID: CWE-119
0
10,120
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: RendererSchedulerImpl::~RendererSchedulerImpl() { TRACE_EVENT_OBJECT_DELETED_WITH_ID( TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"), "RendererScheduler", this); for (auto& pair : task_runners_) { TaskCostEstimator* observer = nullptr; switch (pair.first->queue_class()) { case Main...
0
143,502
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ftc_sbit_copy_bitmap( FTC_SBit sbit, FT_Bitmap* bitmap, FT_Memory memory ) { FT_Error error; FT_Int pitch = bitmap->pitch; FT_ULong size; if ( pitch < 0 ) pitch = -pitch; size = (FT_ULong)( pitch * bitmap->rows ); if ...
0
7,010
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool Document::execCommand(const String& commandName, bool userInterface, const String& value) { return command(this, commandName, userInterface).execute(value); } Commit Message: Refactoring: Move m_mayDisplaySeamlesslyWithParent down to Document The member is used only in Document, thus no reason to stay ...
0
102,724
Analyze the following 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 xen_blk_drain_io(struct xen_blkif *blkif) { atomic_set(&blkif->drain, 1); do { /* The initial value is one, and one refcnt taken at the * start of the xen_blkif_schedule thread. */ if (atomic_read(&blkif->refcnt) <= 2) break; wait_for_completion_interruptible_timeout( &blkif->drain_c...
0
31,840
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void cipso_v4_doi_free_rcu(struct rcu_head *entry) { struct cipso_v4_doi *doi_def; doi_def = container_of(entry, struct cipso_v4_doi, rcu); cipso_v4_doi_free(doi_def); } Commit Message: inet: add RCU protection to inet->opt We lack proper synchronization to manipulate inet->opt ip_options Problem is...
0
18,816
Analyze the following 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 GetCSI(const v8::FunctionCallbackInfo<v8::Value>& args) { WebLocalFrame* frame = WebLocalFrame::frameForCurrentContext(); if (frame) { WebDataSource* data_source = frame->dataSource(); if (data_source) { DocumentState* document_state = DocumentState::FromData...
0
124,979
Analyze the following 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 ucvector_init(ucvector* p) { p->data = NULL; p->size = p->allocsize = 0; } Commit Message: Fixed #5645: realloc return handling CWE ID: CWE-772
0
87,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: unsigned char *ssl_add_serverhello_tlsext(SSL *s, unsigned char *buf, unsigned char *limit) { int extdatalen = 0; unsigned char *orig = buf; unsigned char *ret = buf; # ifndef OPENSSL_NO_NEXTPROTONEG int next_proto_neg_seen; # endif /* * don't ad...
0
9,394
Analyze the following 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 ndp_msg_payload_len_set(struct ndp_msg *msg, size_t len) { if (len > sizeof(msg->buf)) len = sizeof(msg->buf); msg->len = len; } Commit Message: libndp: validate the IPv6 hop limit None of the NDP messages should ever come from a non-local network; as stated in RFC4861's 6.1.1 (RS), 6.1.2 (RA), 7.1.1 (...
0
53,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: void SystemKeyEventListener::OnVolumeUp() { AudioHandler* audio_handler = GetAudioHandler(); if (!audio_handler) return; if (audio_handler->IsMuted()) { audio_handler->SetMuted(false); if (audio_handler->GetVolumePercent() <= 0.1) // float comparison audio_handler->SetVolumePercent(kVolu...
0
109,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: bitgetbit(PG_FUNCTION_ARGS) { VarBit *arg1 = PG_GETARG_VARBIT_P(0); int32 n = PG_GETARG_INT32(1); int bitlen; bits8 *p; int byteNo, bitNo; bitlen = VARBITLEN(arg1); if (n < 0 || n >= bitlen) ereport(ERROR, (errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR), errmsg("bit index %d out of valid...
0
39,081
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int __init init_elf_binfmt(void) { register_binfmt(&elf_format); return 0; } Commit Message: x86, mm/ASLR: Fix stack randomization on 64-bit systems The issue is that the stack for processes is not properly randomized on 64 bit architectures due to an integer overflow. The affected function is randomi...
0
44,293
Analyze the following 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 CheckOtherHTTPHeaders( /*! [in] HTTP Request message. */ http_message_t *Req, /*! [out] Send Instruction object to data for the response. */ struct SendInstruction *RespInstr, /*! Size of the file containing the request document. */ off_t FileSize) { http_header_t *header; ListNode *node; /*NN...
0
73,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: WebGLRenderingContextBase* WebGLRenderingContextBase::OldestContext() { if (ActiveContexts().IsEmpty()) return nullptr; WebGLRenderingContextBase* candidate = *(ActiveContexts().begin()); DCHECK(!candidate->isContextLost()); for (WebGLRenderingContextBase* context : ActiveContexts()) { DCHECK(!co...
0
133,658
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PassRefPtrWillBeRawPtr<Node> Document::cloneNode(bool deep) { RefPtrWillBeRawPtr<Document> clone = cloneDocumentWithoutChildren(); clone->cloneDataFromDocument(*this); if (deep) cloneChildNodes(clone.get()); return clone.release(); } Commit Message: Change Document::detach() to RELEASE_AS...
0
124,299
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: virtual status_t requestBuffer(int bufferIdx, sp<GraphicBuffer>* buf) { Parcel data, reply; data.writeInterfaceToken(IGraphicBufferProducer::getInterfaceDescriptor()); data.writeInt32(bufferIdx); status_t result =remote()->transact(REQUEST_BUFFER, data, &reply); if (result != NO_ERROR) { retu...
0
161,618
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: scoped_refptr<VideoFrame> CloneVideoFrameWithLayout( const VideoFrame* const src_frame, const VideoFrameLayout& dst_layout) { LOG_ASSERT(src_frame->IsMappable()); LOG_ASSERT(src_frame->format() == dst_layout.format()); auto dst_frame = VideoFrame::CreateFrameWithLayout( dst_layout, src_frame->...
1
172,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: NTSTATUS smbXcli_conn_samba_suicide(struct smbXcli_conn *conn, uint8_t exitcode) { TALLOC_CTX *frame = talloc_stackframe(); struct tevent_context *ev; struct tevent_req *req; NTSTATUS status = NT_STATUS_NO_MEMORY; bool ok; if (smbXcli_conn_has_async_calls(conn)) { /* * Can't use sync call whil...
0
2,467