func
string
target
int64
cwe
list
project
string
commit_id
string
hash
float64
size
int64
message
string
static int v4l_s_frequency(const struct v4l2_ioctl_ops *ops, struct file *file, void *fh, void *arg) { struct video_device *vfd = video_devdata(file); const struct v4l2_frequency *p = arg; enum v4l2_tuner_type type; int ret; ret = v4l_enable_media_source(vfd); if (ret) return ret; if (vfd->vfl_type == VFL...
0
[ "CWE-401" ]
linux
fb18802a338b36f675a388fc03d2aa504a0d0899
187,590,015,516,876,000,000,000,000,000,000,000,000
22
media: v4l: ioctl: Fix memory leak in video_usercopy When an IOCTL with argument size larger than 128 that also used array arguments were handled, two memory allocations were made but alas, only the latter one of them was released. This happened because there was only a single local variable to hold such a temporary a...
input_enter_rename(struct input_ctx *ictx) { log_debug("%s", __func__); input_clear(ictx); input_start_timer(ictx); ictx->last = -1; }
0
[]
src
b32e1d34e10a0da806823f57f02a4ae6e93d756e
130,044,714,838,844,560,000,000,000,000,000,000,000
8
evbuffer_new and bufferevent_new can both fail (when malloc fails) and return NULL. GitHub issue 1547.
static void *proc_key_users_next(struct seq_file *p, void *v, loff_t *_pos) { (*_pos)++; return key_user_next(seq_user_ns(p), (struct rb_node *)v); }
0
[ "CWE-20" ]
linux
363b02dab09b3226f3bd1420dad9c72b79a42a76
221,508,483,762,831,950,000,000,000,000,000,000,000
5
KEYS: Fix race between updating and finding a negative key Consolidate KEY_FLAG_INSTANTIATED, KEY_FLAG_NEGATIVE and the rejection error into one field such that: (1) The instantiation state can be modified/read atomically. (2) The error can be accessed atomically with the state. (3) The error isn't stored unione...
DLLIMPORT char *cfg_tilde_expand(const char *filename) { char *expanded = NULL; #ifndef _WIN32 /* Do tilde expansion */ if (filename[0] == '~') { struct passwd *passwd = NULL; const char *file = NULL; if (filename[1] == '/' || filename[1] == 0) { /* ~ or ~/path */ passwd = getpwuid(geteuid()); file ...
0
[]
libconfuse
d73777c2c3566fb2647727bb56d9a2295b81669b
162,635,473,207,093,300,000,000,000,000,000,000,000
48
Fix #163: unterminated username used with getpwnam() Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
content::WebContents* WebContents::CreateCustomWebContents( content::RenderFrameHost* opener, content::SiteInstance* source_site_instance, bool is_new_browsing_instance, const GURL& opener_url, const std::string& frame_name, const GURL& target_url, const content::StoragePartitionConfig& part...
0
[]
electron
e9fa834757f41c0b9fe44a4dffe3d7d437f52d34
108,052,611,277,391,240,000,000,000,000,000,000,000
11
fix: ensure ElectronBrowser mojo service is only bound to appropriate render frames (#33344) * fix: ensure ElectronBrowser mojo service is only bound to authorized render frames Notes: no-notes * refactor: extract electron API IPC to its own mojo interface * fix: just check main frame not primary main frame ...
send_newstyle_option_reply_meta_context (struct connection *conn, uint32_t option, uint32_t reply, uint32_t context_id, const char *name) { struct fixed_new_option_reply fixed_new_option_reply; ...
0
[ "CWE-406" ]
nbdkit
22b30adb796bb6dca264a38598f80b8a234ff978
126,459,504,311,768,450,000,000,000,000,000,000,000
28
server: Wait until handshake complete before calling .open callback Currently we call the plugin .open callback as soon as we receive a TCP connection: $ nbdkit -fv --tls=require --tls-certificates=tests/pki null \ --run "telnet localhost 10809" [...] Trying ::1... Connected to localhost. Escape ...
int hid_keyboard_poll(HIDState *hs, uint8_t *buf, int len) { hs->idle_pending = false; if (len < 2) { return 0; } hid_keyboard_process_keycode(hs); buf[0] = hs->kbd.modifiers & 0xff; buf[1] = 0; if (hs->kbd.keys > 6) { memset(buf + 2, HID_USAGE_ERROR_ROLLOVER, MIN(8, len) ...
0
[ "CWE-772" ]
qemu
51dbea77a29ea46173373a6dad4ebd95d4661f42
113,547,461,198,156,730,000,000,000,000,000,000,000
20
hid: Reset kbd modifiers on reset When resetting the keyboard, we need to reset not just the pending keystrokes, but also any pending modifiers. Otherwise there's a race when we're getting reset while running an escape sequence (modifier 0x100). Cc: qemu-stable@nongnu.org Signed-off-by: Alexander Graf <agraf@suse.de>...
perf_event_groups_delete(struct perf_event_groups *groups, struct perf_event *event) { WARN_ON_ONCE(RB_EMPTY_NODE(&event->group_node) || RB_EMPTY_ROOT(&groups->tree)); rb_erase(&event->group_node, &groups->tree); init_event_group(event); }
0
[ "CWE-401" ]
tip
7bdb157cdebbf95a1cd94ed2e01b338714075d00
263,442,393,271,770,780,000,000,000,000,000,000,000
9
perf/core: Fix a memory leak in perf_event_parse_addr_filter() As shown through runtime testing, the "filename" allocation is not always freed in perf_event_parse_addr_filter(). There are three possible ways that this could happen: - It could be allocated twice on subsequent iterations through the loop, - or leake...
static int jpc_dec_process_qcc(jpc_dec_t *dec, jpc_ms_t *ms) { jpc_qcc_t *qcc = &ms->parms.qcc; jpc_dec_tile_t *tile; if (JAS_CAST(int, qcc->compno) >= dec->numcomps) { jas_eprintf("invalid component number in QCC marker segment\n"); return -1; } switch (dec->state) { case JPC_MH: jpc_dec_cp_setfromqcc(dec...
0
[ "CWE-189" ]
jasper
3c55b399c36ef46befcb21e4ebc4799367f89684
333,834,574,755,421,350,000,000,000,000,000,000,000
25
At many places in the code, jas_malloc or jas_recalloc was being invoked with the size argument being computed in a manner that would not allow integer overflow to be detected. Now, these places in the code have been modified to use special-purpose memory allocation functions (e.g., jas_alloc2, jas_alloc3, jas_realloc...
SpoolssRFFPCNEX_q(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep _U_) { guint32 flags; static const int * hf_flags[] = { &hf_rffpcnex_flags_timeout, &hf_rffpcnex_flags_delete_driver, &hf_rffpcnex_flags_set_driver, &hf_rffpcnex_flags_add_driver, ...
0
[ "CWE-399" ]
wireshark
b4d16b4495b732888e12baf5b8a7e9bf2665e22b
161,954,525,660,283,780,000,000,000,000,000,000,000
57
SPOOLSS: Try to avoid an infinite loop. Use tvb_reported_length_remaining in dissect_spoolss_uint16uni. Make sure our offset always increments in dissect_spoolss_keybuffer. Change-Id: I7017c9685bb2fa27161d80a03b8fca4ef630e793 Reviewed-on: https://code.wireshark.org/review/14687 Reviewed-by: Gerald Combs <gerald@wires...
static long long mstime(void) { return ustime() / 1000; }
0
[ "CWE-190" ]
redis
f6a40570fa63d5afdd596c78083d754081d80ae3
86,714,119,603,228,890,000,000,000,000,000,000,000
1
Fix ziplist and listpack overflows and truncations (CVE-2021-32627, CVE-2021-32628) - fix possible heap corruption in ziplist and listpack resulting by trying to allocate more than the maximum size of 4GB. - prevent ziplist (hash and zset) from reaching size of above 1GB, will be converted to HT encoding, that's n...
int StreamTcpInlineMode(void) { return (stream_config.flags & STREAMTCP_INIT_FLAG_INLINE) ? 1 : 0; }
0
[]
suricata
50e2b973eeec7172991bf8f544ab06fb782b97df
45,364,188,023,667,830,000,000,000,000,000,000,000
4
stream/tcp: handle RST with MD5 or AO header Special handling for RST packets if they have an TCP MD5 or AO header option. The options hash can't be validated. The end host might be able to validate it, as it can have a key/password that was communicated out of band. The sender could use this to move the TCP state to...
void _gdImageFillTiled(gdImagePtr im, int x, int y, int nc) { int i,l, x1, x2, dy; int oc; /* old pixel value */ int tiled; int wx2,wy2; /* stack of filled segments */ struct seg *stack; struct seg *sp; int **pts; if(!im->tile){ return; } wx2=im->sx;wy2=im->sy; tiled = nc==gdTiled; nc = gdImageTile...
0
[ "CWE-190" ]
libgd
cfee163a5e848fc3e3fb1d05a30d7557cdd36457
38,482,756,217,915,630,000,000,000,000,000,000,000
80
- #18, Removed invalid gdFree call when overflow2 fails - #17, Free im->pixels as well on error
static unsigned int unix_dgram_poll(struct file *file, struct socket *sock, poll_table *wait) { struct sock *sk = sock->sk, *other; unsigned int mask, writable; sock_poll_wait(file, sk_sleep(sk), wait); mask = 0; /* exceptional events? */ if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue)) mask |...
0
[]
net
7d267278a9ece963d77eefec61630223fce08c6c
222,397,657,706,178,430,000,000,000,000,000,000,000
56
unix: avoid use-after-free in ep_remove_wait_queue Rainer Weikusat <rweikusat@mobileactivedefense.com> writes: An AF_UNIX datagram socket being the client in an n:1 association with some server socket is only allowed to send messages to the server if the receive queue of this socket contains at most sk_max_ack_backlog...
static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pte) { if (pte_valid_user(pte)) { if (!pte_special(pte) && pte_exec(pte)) __sync_icache_dcache(pte, addr); if (pte_dirty(pte) && pte_write(pte)) pte_val(pte) &= ~PTE_RDONLY; else pte_val(pte) |= PTE_RDONL...
0
[ "CWE-241", "CWE-19" ]
linux
5a0fdfada3a2aa50d7b947a2e958bf00cbe0d830
142,873,971,914,631,550,000,000,000,000,000,000,000
14
Revert "arm64: Introduce execute-only page access permissions" This reverts commit bc07c2c6e9ed125d362af0214b6313dca180cb08. While the aim is increased security for --x memory maps, it does not protect against kernel level reads. Until SECCOMP is implemented for arm64, revert this patch to avoid giving a false idea o...
EvalPlanQualFetch(EState *estate, Relation relation, int lockmode, LockWaitPolicy wait_policy, ItemPointer tid, TransactionId priorXmax) { HeapTuple copyTuple = NULL; HeapTupleData tuple; SnapshotData SnapshotDirty; /* * fetch target tuple * * Loop here to deal with updated or busy tuples */ I...
0
[ "CWE-209" ]
postgres
804b6b6db4dcfc590a468e7be390738f9f7755fb
57,794,861,147,058,480,000,000,000,000,000,000,000
212
Fix column-privilege leak in error-message paths While building error messages to return to the user, BuildIndexValueDescription, ExecBuildSlotValueDescription and ri_ReportViolation would happily include the entire key or entire row in the result returned to the user, even if the user didn't have access to view all o...
void gitn_box_del(GF_Box *s) { u32 i; GroupIdToNameBox *ptr = (GroupIdToNameBox *)s; if (ptr == NULL) return; if (ptr->entries) { for (i=0; i<ptr->nb_entries; i++) { if (ptr->entries[i].name) gf_free(ptr->entries[i].name); } gf_free(ptr->entries); } gf_free(ptr); }
0
[ "CWE-787" ]
gpac
77510778516803b7f7402d7423c6d6bef50254c3
220,887,840,325,325,360,000,000,000,000,000,000,000
13
fixed #2255
perm_fmgr_info(Oid functionId, FmgrInfo *finfo) { fmgr_info_cxt(functionId, finfo, TopMemoryContext); }
0
[ "CWE-264" ]
postgres
537cbd35c893e67a63c59bc636c3e888bd228bc7
27,061,981,178,319,234,000,000,000,000,000,000,000
4
Prevent privilege escalation in explicit calls to PL validators. The primary role of PL validators is to be called implicitly during CREATE FUNCTION, but they are also normal functions that a user can call explicitly. Add a permissions check to each validator to ensure that a user cannot use explicit validator calls ...
TEST_F(HttpConnectionManagerImplTest, RouteOverride) { setup(false, ""); EXPECT_CALL(*codec_, dispatch(_)).WillOnce(Invoke([&](Buffer::Instance&) -> Http::Status { RequestDecoder* decoder = &conn_manager_->newStream(response_encoder_); RequestHeaderMapPtr headers{ new TestRequestHeaderMapImpl{{":au...
0
[ "CWE-400" ]
envoy
0e49a495826ea9e29134c1bd54fdeb31a034f40c
335,958,229,354,971,970,000,000,000,000,000,000,000
195
http/2: add stats and stream flush timeout (#139) This commit adds a new stream flush timeout to guard against a remote server that does not open window once an entire stream has been buffered for flushing. Additional stats have also been added to better understand the codecs view of active streams as well as amount o...
static int npf_interception(struct vcpu_svm *svm) { u64 fault_address = __sme_clr(svm->vmcb->control.exit_info_2); u64 error_code = svm->vmcb->control.exit_info_1; trace_kvm_page_fault(fault_address, error_code); return kvm_mmu_page_fault(&svm->vcpu, fault_address, error_code, static_cpu_has(X86_FEATURE_DECODEA...
0
[ "CWE-401" ]
linux
d80b64ff297e40c2b6f7d7abc1b3eba70d22a068
155,164,695,672,433,920,000,000,000,000,000,000,000
11
KVM: SVM: Fix potential memory leak in svm_cpu_init() When kmalloc memory for sd->sev_vmcbs failed, we forget to free the page held by sd->save_area. Also get rid of the var r as '-ENOMEM' is actually the only possible outcome here. Reviewed-by: Liran Alon <liran.alon@oracle.com> Reviewed-by: Vitaly Kuznetsov <vkuzne...
static int digest_decode(const char *src, int len, char *dst) { int i = 0, bits = 0, ac = 0; const char *p; char *cp = dst; while (i < len) { p = strchr(lookup_table, src[i]); if (p == NULL || src[i] == 0) return -2; ac += (p - lookup_table) << bits; bits += 6; if (bits >= 8) { *cp++ = ac & 0xff; ...
0
[ "CWE-416", "CWE-476" ]
linux
1b53cf9815bb4744958d41f3795d5d5a1d365e2d
197,020,982,052,606,060,000,000,000,000,000,000,000
23
fscrypt: remove broken support for detecting keyring key revocation Filesystem encryption ostensibly supported revoking a keyring key that had been used to "unlock" encrypted files, causing those files to become "locked" again. This was, however, buggy for several reasons, the most severe of which was that when key r...
njs_generate_code_map(njs_vm_t *vm, njs_generator_t *generator, njs_parser_node_t *node, u_char *code) { njs_arr_t *map; njs_vm_line_num_t *last; map = generator->lines; if (map != NULL && node != NULL) { last = (map->items != 0) ? njs_arr_last(map) : NULL; if (last == NU...
0
[ "CWE-703", "CWE-754" ]
njs
404553896792b8f5f429dc8852d15784a59d8d3e
8,598,313,274,068,244,000,000,000,000,000,000,000
23
Fixed break instruction in a try-catch block. Previously, JUMP offset for a break instruction inside a try-catch block was not set to a correct offset during code generation when a return instruction was present in inner try-catch block. The fix is to update the JUMP offset appropriately. This closes #553 issue on G...
int X509_cmp_time(const ASN1_TIME *ctm, time_t *cmp_time) { char *str; ASN1_TIME atm; long offset; char buff1[24],buff2[24],*p; int i,j; p=buff1; i=ctm->length; str=(char *)ctm->data; if (ctm->type == V_ASN1_UTCTIME) { if ((i < 11) || (i > 17)) return 0; memcpy(p,str,10); p+=10; str+=10; } else ...
0
[]
openssl
d65b8b2162f33ac0d53dace588a0847ed827626c
215,768,167,486,882,200,000,000,000,000,000,000,000
78
Backport OCSP fixes.
static int __send_signal(int sig, struct siginfo *info, struct task_struct *t, int group, int from_ancestor_ns) { struct sigpending *pending; struct sigqueue *q; int override_rlimit; trace_signal_generate(sig, info, t); assert_spin_locked(&t->sighand->siglock); if (!prepare_signal(sig, t, from_ancestor_ns))...
0
[]
linux-2.6
da48524eb20662618854bb3df2db01fc65f3070c
280,367,822,226,784,420,000,000,000,000,000,000,000
92
Prevent rt_sigqueueinfo and rt_tgsigqueueinfo from spoofing the signal code Userland should be able to trust the pid and uid of the sender of a signal if the si_code is SI_TKILL. Unfortunately, the kernel has historically allowed sigqueueinfo() to send any si_code at all (as long as it was negative - to distinguish i...
rb_str_concat(VALUE str1, VALUE str2) { if (FIXNUM_P(str2) || TYPE(str2) == T_BIGNUM) { rb_encoding *enc = STR_ENC_GET(str1); unsigned int c = NUM2UINT(str2); long pos = RSTRING_LEN(str1); int len = rb_enc_codelen(c, enc); int cr = ENC_CODERANGE(str1); rb_str_resize(str1, pos+len); rb_enc_mbcput(c, RSTRING_...
0
[ "CWE-119" ]
ruby
1c2ef610358af33f9ded3086aa2d70aac03dcac5
325,805,926,973,718,540,000,000,000,000,000,000,000
16
* string.c (rb_str_justify): CVE-2009-4124. Fixes a bug reported by Emmanouel Kellinis <Emmanouel.Kellinis AT kpmg.co.uk>, KPMG London; Patch by nobu. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
static int btrfs_read_disk_super(struct block_device *bdev, u64 bytenr, struct page **page, struct btrfs_super_block **disk_super) { void *p; pgoff_t index; /* make sure our super fits in the device */ if (bytenr + PAGE_SIZE >= i_size_read(bdev->bd_inode)) return 1; /* make sure our super fits in the...
0
[ "CWE-476", "CWE-284" ]
linux
09ba3bc9dd150457c506e4661380a6183af651c1
303,559,421,470,911,500,000,000,000,000,000,000,000
44
btrfs: merge btrfs_find_device and find_device Both btrfs_find_device() and find_device() does the same thing except that the latter does not take the seed device onto account in the device scanning context. We can merge them. Signed-off-by: Anand Jain <anand.jain@oracle.com> Reviewed-by: David Sterba <dsterba@suse.c...
void Phase2() final { Local<Context> context_handle = Deref(context); Context::Scope context_scope{context_handle}; Local<Object> object = Local<Object>::Cast(Deref(reference)); result = Unmaybe(object->Delete(context_handle, key->CopyInto())); }
1
[ "CWE-913" ]
isolated-vm
2646e6c1558bac66285daeab54c7d490ed332b15
52,447,627,060,591,690,000,000,000,000,000,000,000
6
Don't invoke accessors or proxies via Reference functions
struct vfsmount *vfs_create_mount(struct fs_context *fc) { struct mount *mnt; if (!fc->root) return ERR_PTR(-EINVAL); mnt = alloc_vfsmnt(fc->source ?: "none"); if (!mnt) return ERR_PTR(-ENOMEM); if (fc->sb_flags & SB_KERNMOUNT) mnt->mnt.mnt_flags = MNT_INTERNAL; atomic_inc(&fc->root->d_sb->s_active); m...
0
[ "CWE-200" ]
linux
427215d85e8d1476da1a86b8d67aceb485eb3631
174,836,800,147,214,200,000,000,000,000,000,000,000
25
ovl: prevent private clone if bind mount is not allowed Add the following checks from __do_loopback() to clone_private_mount() as well: - verify that the mount is in the current namespace - verify that there are no locked children Reported-by: Alois Wohlschlager <alois1@gmx-topmail.de> Fixes: c771d683a62e ("vfs: ...
static GF_Err hash_file(char *name, u32 dump_std) { u32 i; u8 hash[20]; GF_Err e = gf_media_get_file_hash(name, hash); if (e) return e; if (dump_std==2) { gf_fwrite(hash, 20, stdout); } else if (dump_std==1) { for (i=0; i<20; i++) fprintf(stdout, "%02X", hash[i]); } fprintf(stderr, "File hash (SHA-1): "); ...
0
[ "CWE-476" ]
gpac
87afe070cd6866df7fe80f11b26ef75161de85e0
175,894,215,974,446,750,000,000,000,000,000,000,000
17
fixed #1734
struct posix_acl *gfs2_get_acl(struct inode *inode, int type) { struct gfs2_inode *ip = GFS2_I(inode); struct gfs2_holder gh; bool need_unlock = false; struct posix_acl *acl; if (!gfs2_glock_is_locked_by_me(ip->i_gl)) { int ret = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, &gh); if (ret)...
0
[ "CWE-862", "CWE-285" ]
linux
073931017b49d9458aa351605b43a7e34598caef
77,055,061,587,527,350,000,000,000,000,000,000,000
19
posix_acl: Clear SGID bit when setting file permissions When file permissions are modified via chmod(2) and the user is not in the owning group or capable of CAP_FSETID, the setgid bit is cleared in inode_change_ok(). Setting a POSIX ACL via setxattr(2) sets the file permissions as well as the new ACL, but doesn't cl...
void CLASS lossy_dng_load_raw() { struct jpeg_decompress_struct cinfo; struct jpeg_error_mgr jerr; JSAMPARRAY buf; JSAMPLE (*pixel)[3]; unsigned sorder=order, ntags, opcode, deg, i, j, c; unsigned save=data_offset-4, trow=0, tcol=0, row, col; ushort t_curve[3][256]; double coeff[9], tot; fseek (ifp, ...
0
[]
LibRaw
9ae25d8c3a6bfb40c582538193264f74c9b93bc0
150,495,313,844,564,300,000,000,000,000,000,000,000
77
backported 0.15.4 datachecks
nfs4_wait_on_layoutreturn(struct inode *inode, struct rpc_task *task) { if (inode == NULL || !nfs_have_layout(inode)) return false; return pnfs_wait_on_layoutreturn(inode, task); }
0
[ "CWE-787" ]
linux
b4487b93545214a9db8cbf32e86411677b0cca21
170,783,308,406,400,950,000,000,000,000,000,000,000
7
nfs: Fix getxattr kernel panic and memory overflow Move the buffer size check to decode_attr_security_label() before memcpy() Only call memcpy() if the buffer is large enough Fixes: aa9c2669626c ("NFS: Client implementation of Labeled-NFS") Signed-off-by: Jeffrey Mitchell <jeffrey.mitchell@starlab.io> [Trond: clean u...
void *jas_calloc(size_t num_elements, size_t element_size) { void *ptr; size_t size; if (!jas_safe_size_mul(num_elements, element_size, &size)) { return 0; } if (!(ptr = jas_malloc(size))) { return 0; } memset(ptr, 0, size); return ptr; }
0
[ "CWE-189" ]
jasper
3c55b399c36ef46befcb21e4ebc4799367f89684
88,323,698,475,325,400,000,000,000,000,000,000,000
13
At many places in the code, jas_malloc or jas_recalloc was being invoked with the size argument being computed in a manner that would not allow integer overflow to be detected. Now, these places in the code have been modified to use special-purpose memory allocation functions (e.g., jas_alloc2, jas_alloc3, jas_realloc...
GF_Err gf_isom_remove_user_data_item(GF_ISOFile *movie, u32 trackNumber, u32 UserDataType, bin128 UUID, u32 UserDataIndex) { GF_UserDataMap *map; GF_Box *a; u32 i; bin128 t; GF_Err e; GF_TrackBox *trak; GF_UserDataBox *udta; e = CanAccessMovie(movie, GF_ISOM_OPEN_WRITE); if (e) return e; if (UserDataType ==...
0
[ "CWE-476" ]
gpac
ebfa346eff05049718f7b80041093b4c5581c24e
327,721,945,703,607,350,000,000,000,000,000,000,000
50
fixed #1706
SSL_CIPHER *ssl3_choose_cipher(SSL *s, STACK_OF(SSL_CIPHER) *clnt, STACK_OF(SSL_CIPHER) *srvr) { SSL_CIPHER *c,*ret=NULL; STACK_OF(SSL_CIPHER) *prio, *allow; int i,ii,ok; #if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_EC) unsigned int j; int ec_ok, ec_nid; unsigned char ec_search1 = 0, ec_search2 =...
0
[]
openssl
4817504d069b4c5082161b02a22116ad75f822b1
323,402,964,421,121,970,000,000,000,000,000,000,000
273
PR: 2658 Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de> Reviewed by: steve Support for TLS/DTLS heartbeats.
int wc_ecc_get_curve_id_from_dp_params(const ecc_set_type* dp) { int idx; if (dp == NULL #ifndef WOLFSSL_ECC_CURVE_STATIC || dp->prime == NULL || dp->Af == NULL || dp->Bf == NULL || dp->order == NULL || dp->Gx == NULL || dp->Gy == NULL #endif ) { return BAD_FUNC_ARG; }...
0
[ "CWE-326", "CWE-203" ]
wolfssl
1de07da61f0c8e9926dcbd68119f73230dae283f
106,487,626,298,940,970,000,000,000,000,000,000,000
38
Constant time EC map to affine for private operations For fast math, use a constant time modular inverse when mapping to affine when operation involves a private key - key gen, calc shared secret, sign.
MagickExport Image *InverseFourierTransformImage(const Image *magnitude_image, const Image *phase_image,const MagickBooleanType modulus, ExceptionInfo *exception) { Image *fourier_image; assert(magnitude_image != (Image *) NULL); assert(magnitude_image->signature == MagickCoreSignature); if (magnitude_...
0
[ "CWE-125" ]
ImageMagick
7c2c5ba5b8e3a0b2b82f56c71dfab74ed4006df7
184,569,330,665,658,360,000,000,000,000,000,000,000
123
https://github.com/ImageMagick/ImageMagick/issues/1588
lprn_bubble_gen(gx_device_printer * pdev, int x0, int x1, int y0, int y1) { gx_device_lprn *const lprn = (gx_device_lprn *) pdev; Bubble *bbl; int bx0, bx1, bx; assert(lprn->freeBubbleList != NULL); bbl = lprn->freeBubbleList; lprn->freeBubbleList = bbl->next; bbl->brect.p.x = x0; bb...
0
[ "CWE-787" ]
ghostpdl
450da26a76286a8342ec0864b3d113856709f8f6
10,470,110,335,982,341,000,000,000,000,000,000,000
25
Bug 701785: fixed sanitizer heap-buffer-overflow in lprn_is_black(). In contrib/lips4/gdevlprn.c:lprn_is_black(), it seems that bpl is not necessarily a multiple of lprn->nBw, so we need to explicitly avoid straying into the next line's data. This also avoids accessing beyond our buffer if we are already on the last ...
static int nfs4_xdr_dec_fsinfo(struct rpc_rqst *req, __be32 *p, struct nfs_fsinfo *fsinfo) { struct xdr_stream xdr; struct compound_hdr hdr; int status; xdr_init_decode(&xdr, &req->rq_rcv_buf, p); status = decode_compound_hdr(&xdr, &hdr); if (!status) status = decode_putfh(&xdr); if (!status) status = decod...
0
[ "CWE-703" ]
linux
dc0b027dfadfcb8a5504f7d8052754bf8d501ab9
24,162,788,674,572,143,000,000,000,000,000,000,000
16
NFSv4: Convert the open and close ops to use fmode Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
mono_custom_attrs_free (MonoCustomAttrInfo *ainfo) { if (!ainfo->cached) g_free (ainfo); }
0
[ "CWE-20" ]
mono
4905ef1130feb26c3150b28b97e4a96752e0d399
224,142,912,086,160,860,000,000,000,000,000,000,000
5
Handle invalid instantiation of generic methods. * verify.c: Add new function to internal verifier API to check method instantiations. * reflection.c (mono_reflection_bind_generic_method_parameters): Check the instantiation before returning it. Fixes #655847
int fdt_add_alias_regions(const void *fdt, struct fdt_region *region, int count, int max_regions, struct fdt_region_state *info) { int base = fdt_off_dt_struct(fdt); int node, node_end, offset; int did_alias_header; node = fdt_subnode_offset(fdt, 0, "aliases"); if (node < 0) return -FDT_ERR_NOTFOUND; /* ...
0
[]
u-boot
8a7d4cf9820ea16fabd25a6379351b4dc291204b
87,261,355,274,118,370,000,000,000,000,000,000,000
58
fdt_region: Check for a single root node of the correct name At present fdt_find_regions() assumes that the FIT is a valid devicetree. If the FIT has two root nodes this is currently not detected in this function, nor does libfdt's fdt_check_full() notice. Also it is possible for the root node to have a name even thou...
virDomainRNGDefValidate(const virDomainRNGDef *rng, const virDomainDef *def) { if (rng->backend == VIR_DOMAIN_RNG_BACKEND_EGD) return virDomainChrSourceDefValidate(rng->source.chardev, NULL, def); return 0; }
0
[ "CWE-212" ]
libvirt
a5b064bf4b17a9884d7d361733737fb614ad8979
59,029,554,184,177,400,000,000,000,000,000,000,000
8
conf: Don't format http cookies unless VIR_DOMAIN_DEF_FORMAT_SECURE is used Starting with 3b076391befc3fe72deb0c244ac6c2b4c100b410 (v6.1.0-122-g3b076391be) we support http cookies. Since they may contain somewhat sensitive information we should not format them into the XML unless VIR_DOMAIN_DEF_FORMAT_SECURE is assert...
dict_free(item* head) { item* iterator = head; while (iterator) { item* temp = iterator; iterator = iterator->next; Safefree(temp); } head = NULL; }
0
[ "CWE-125" ]
perl5
43b2f4ef399e2fd7240b4eeb0658686ad95f8e62
73,957,503,180,302,530,000,000,000,000,000,000,000
12
regcomp.c: Convert some strchr to memchr This allows things to work properly in the face of embedded NULs. See the branch merge message for more information.
void mlx5_fpga_conn_destroy(struct mlx5_fpga_conn *conn) { struct mlx5_fpga_device *fdev = conn->fdev; struct mlx5_core_dev *mdev = fdev->mdev; int err = 0; conn->qp.active = false; tasklet_disable(&conn->cq.tasklet); synchronize_irq(conn->cq.mcq.irqn); mlx5_fpga_destroy_qp(conn->fdev->mdev, conn->fpga_qpn); ...
0
[ "CWE-400", "CWE-401" ]
linux
c8c2a057fdc7de1cd16f4baa51425b932a42eb39
317,123,683,516,555,660,000,000,000,000,000,000,000
23
net/mlx5: prevent memory leak in mlx5_fpga_conn_create_cq In mlx5_fpga_conn_create_cq if mlx5_vector2eqn fails the allocated memory should be released. Fixes: 537a50574175 ("net/mlx5: FPGA, Add high-speed connection routines") Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com> Signed-off-by: Saeed Mahameed <s...
static inline size_t userpolicy_type_attrsize(void) { #ifdef CONFIG_XFRM_SUB_POLICY return nla_total_size(sizeof(struct xfrm_userpolicy_type)); #else return 0; #endif }
0
[ "CWE-264" ]
net
90f62cf30a78721641e08737bda787552428061e
6,977,640,145,539,684,000,000,000,000,000,000,000
8
net: Use netlink_ns_capable to verify the permisions of netlink messages It is possible by passing a netlink socket to a more privileged executable and then to fool that executable into writing to the socket data that happens to be valid netlink message to do something that privileged executable did not intend to do. ...
static int decode_atari_image_paletted(deark *c, struct atari_img_decode_data *adata) { i64 i, j; i64 plane; i64 rowspan; u8 b; u32 v; i64 planespan; i64 ncolors; planespan = 2*((adata->w+15)/16); rowspan = planespan*adata->bpp; if(adata->ncolors>0) ncolors = adata->ncolors; else ncolors = ((i64)1)<<ada...
0
[ "CWE-369" ]
deark
62acb7753b0e3c0d3ab3c15057b0a65222313334
244,611,881,122,380,960,000,000,000,000,000,000,000
62
pict,macrsrc: Fixed a bug that could cause division by 0 Found by F. Çelik.
static int wake_cap(struct task_struct *p, int cpu, int prev_cpu) { long min_cap, max_cap; if (!static_branch_unlikely(&sched_asym_cpucapacity)) return 0; min_cap = min(capacity_orig_of(prev_cpu), capacity_orig_of(cpu)); max_cap = cpu_rq(cpu)->rd->max_cpu_capacity; /* Minimum capacity is close to max, no need...
0
[ "CWE-400", "CWE-703", "CWE-835" ]
linux
c40f7d74c741a907cfaeb73a7697081881c497d0
211,347,519,195,213,150,000,000,000,000,000,000,000
19
sched/fair: Fix infinite loop in update_blocked_averages() by reverting a9e7f6544b9c Zhipeng Xie, Xie XiuQi and Sargun Dhillon reported lockups in the scheduler under high loads, starting at around the v4.18 time frame, and Zhipeng Xie tracked it down to bugs in the rq->leaf_cfs_rq_list manipulation. Do a (manual) re...
SCTP_STATIC int sctp_getsockopt(struct sock *sk, int level, int optname, char __user *optval, int __user *optlen) { int retval = 0; int len; SCTP_DEBUG_PRINTK("sctp_getsockopt(sk: %p... optname: %d)\n", sk, optname); /* I can hardly begin to describe how wrong this is. This is * so broken as to be wor...
0
[]
linux-2.6
5e739d1752aca4e8f3e794d431503bfca3162df4
239,534,037,075,657,030,000,000,000,000,000,000,000
150
sctp: fix potential panics in the SCTP-AUTH API. All of the SCTP-AUTH socket options could cause a panic if the extension is disabled and the API is envoked. Additionally, there were some additional assumptions that certain pointers would always be valid which may not always be the case. This patch hardens the API a...
int mnt_want_write(struct vfsmount *m) { int ret; sb_start_write(m->mnt_sb); ret = __mnt_want_write(m); if (ret) sb_end_write(m->mnt_sb); return ret; }
0
[ "CWE-269" ]
user-namespace
a6138db815df5ee542d848318e5dae681590fccd
129,910,221,313,945,610,000,000,000,000,000,000,000
10
mnt: Only change user settable mount flags in remount Kenton Varda <kenton@sandstorm.io> discovered that by remounting a read-only bind mount read-only in a user namespace the MNT_LOCK_READONLY bit would be cleared, allowing an unprivileged user to the remount a read-only mount read-write. Correct this by replacing t...
SPL_METHOD(Array, count) { long count; spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(getThis() TSRMLS_CC); if (zend_parse_parameters_none() == FAILURE) { return; } spl_array_object_count_elements_helper(intern, &count TSRMLS_CC); RETURN_LONG(count); } /* }}} */
1
[]
php-src
b7fa67742cd8d2b0ca0c0273b157f6ffee9ad6e2
333,236,671,286,674,120,000,000,000,000,000,000,000
13
Fix bug #70068 (Dangling pointer in the unserialization of ArrayObject items)
ebb_ews_store_original_vcard (EContact *contact) { gchar *vcard_str; g_return_if_fail (E_IS_CONTACT (contact)); /* This makes sure it's not saved also in the original vCard */ ebb_ews_remove_x_attribute (contact, X_EWS_ORIGINAL_VCARD); vcard_str = e_vcard_to_string (E_VCARD (contact), EVC_FORMAT_VCARD_30); eb...
0
[ "CWE-295" ]
evolution-ews
915226eca9454b8b3e5adb6f2fff9698451778de
200,345,699,648,464,030,000,000,000,000,000,000,000
15
I#27 - SSL Certificates are not validated This depends on https://gitlab.gnome.org/GNOME/evolution-data-server/commit/6672b8236139bd6ef41ecb915f4c72e2a052dba5 too. Closes https://gitlab.gnome.org/GNOME/evolution-ews/issues/27
static int guess_header_type(const char * message, size_t length, size_t indx) { int state; int r; state = HEADER_START; while (1) { if (indx >= length) return MAILIMF_FIELD_NONE; switch(state) { case HEADER_START: switch((char) toupper((unsigned char) message[indx])) { case ...
0
[ "CWE-476" ]
libetpan
1fe8fbc032ccda1db9af66d93016b49c16c1f22d
90,173,247,659,930,580,000,000,000,000,000,000,000
120
Fixed crash #274
void bdrv_set_guest_block_size(BlockDriverState *bs, int align) { bs->guest_block_size = align; }
0
[ "CWE-190" ]
qemu
8f4754ede56e3f9ea3fd7207f4a7c4453e59285b
56,722,374,408,245,340,000,000,000,000,000,000,000
4
block: Limit request size (CVE-2014-0143) Limiting the size of a single request to INT_MAX not only fixes a direct integer overflow in bdrv_check_request() (which would only trigger bad behaviour with ridiculously huge images, as in close to 2^64 bytes), but can also prevent overflows in all block drivers. Signed-off...
static void lsr_read_duration_ex(GF_LASeRCodec *lsr, GF_Node *n, u32 tag, SMIL_Duration *smil, const char *name, Bool skipable) { GF_FieldInfo info; u32 val = 1; if (skipable) { GF_LSR_READ_INT(lsr, val, 1, name); if (!val) return; } if (!smil) { lsr->last_error = gf_node_get_attribute_by_tag(n, tag, GF_TRU...
0
[ "CWE-190" ]
gpac
faa75edde3dfeba1e2cf6ffa48e45a50f1042096
116,310,138,087,872,120,000,000,000,000,000,000,000
31
fixed #2213
*/ static bool kvm_vcpu_eligible_for_directed_yield(struct kvm_vcpu *vcpu) { #ifdef CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT bool eligible; eligible = !vcpu->spin_loop.in_spin_loop || vcpu->spin_loop.dy_eligible; if (vcpu->spin_loop.in_spin_loop) kvm_vcpu_set_dy_eligible(vcpu, !vcpu->spin_loop.dy_eligible); ...
0
[ "CWE-459" ]
linux
683412ccf61294d727ead4a73d97397396e69a6b
12,994,326,775,694,580,000,000,000,000,000,000,000
16
KVM: SEV: add cache flush to solve SEV cache incoherency issues Flush the CPU caches when memory is reclaimed from an SEV guest (where reclaim also includes it being unmapped from KVM's memslots). Due to lack of coherency for SEV encrypted memory, failure to flush results in silent data corruption if userspace is mal...
static int has_rdrand() { // CPUID.01H:ECX.RDRAND[bit 30] == 1 int regs[4]; do_cpuid(regs, 1); return (regs[2] & (1 << 30)) != 0; }
0
[ "CWE-119", "CWE-310" ]
json-c
64e36901a0614bf64a19bc3396469c66dcd0b015
44,639,738,553,758,720,000,000,000,000,000,000,000
7
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
void __page_frag_cache_drain(struct page *page, unsigned int count) { VM_BUG_ON_PAGE(page_ref_count(page) == 0, page); if (page_ref_sub_and_test(page, count)) { unsigned int order = compound_order(page); if (order == 0) free_unref_page(page); else __free_pages_ok(page, order); } }
0
[]
linux
400e22499dd92613821374c8c6c88c7225359980
275,793,108,831,270,950,000,000,000,000,000,000,000
13
mm: don't warn about allocations which stall for too long Commit 63f53dea0c98 ("mm: warn about allocations which stall for too long") was a great step for reducing possibility of silent hang up problem caused by memory allocation stalls. But this commit reverts it, for it is possible to trigger OOM lockup and/or soft...
static void nvme_format_ns_cb(void *opaque, int ret) { NvmeFormatAIOCB *iocb = opaque; NvmeRequest *req = iocb->req; NvmeNamespace *ns = iocb->ns; int bytes; if (ret < 0) { iocb->ret = ret; goto done; } assert(ns); if (iocb->offset < ns->size) { bytes = MIN(BDR...
0
[]
qemu
736b01642d85be832385063f278fe7cd4ffb5221
303,475,144,895,962,200,000,000,000,000,000,000,000
34
hw/nvme: fix CVE-2021-3929 This fixes CVE-2021-3929 "locally" by denying DMA to the iomem of the device itself. This still allows DMA to MMIO regions of other devices (e.g. doing P2P DMA to the controller memory buffer of another NVMe device). Fixes: CVE-2021-3929 Reported-by: Qiuhao Li <Qiuhao.Li@outlook.com> Review...
static int ZEND_FASTCALL ZEND_SUB_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { zend_op *opline = EX(opline); zend_free_op free_op2; sub_function(&EX_T(opline->result.u.var).tmp_var, _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRML...
0
[]
php-src
ce96fd6b0761d98353761bf78d5bfb55291179fd
251,681,841,745,988,570,000,000,000,000,000,000,000
12
- fix #39863, do not accept paths with NULL in them. See http://news.php.net/php.internals/50191, trunk will have the patch later (adding a macro and/or changing (some) APIs. Patch by Rasmus
static int posix_get_realtime_coarse(clockid_t which_clock, struct timespec64 *tp) { ktime_get_coarse_real_ts64(tp); return 0; }
0
[ "CWE-190" ]
linux
78c9c4dfbf8c04883941445a195276bb4bb92c76
251,078,010,565,464,980,000,000,000,000,000,000,000
5
posix-timers: Sanitize overrun handling The posix timer overrun handling is broken because the forwarding functions can return a huge number of overruns which does not fit in an int. As a consequence timer_getoverrun(2) and siginfo::si_overrun can turn into random number generators. The k_clock::timer_forward() callb...
NOEXPORT void remote_start(CLI *c) { /* where to bind connecting socket */ if(c->opt->option.local) /* outgoing interface */ c->bind_addr=&c->opt->source_addr; #ifndef USE_WIN32 else if(c->opt->option.transparent_src) c->bind_addr=&c->peer_addr; #endif else c->bind_addr=NULL; /* ...
0
[ "CWE-295" ]
stunnel
ebad9ddc4efb2635f37174c9d800d06206f1edf9
140,147,345,709,189,470,000,000,000,000,000,000,000
30
stunnel-5.57
re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop) struct re_pattern_buffer *bufp; const char *string1, *string2; int size1, size2; int startpos; int range; struct re_registers *regs; int stop; { int val; register char *fastmap = bufp->fastmap; regis...
0
[ "CWE-190", "CWE-252" ]
glibc
2864e767053317538feafa815046fff89e5a16be
4,546,657,404,189,064,000,000,000,000,000,000,000
136
Update. 1999-11-09 Ulrich Drepper <drepper@cygnus.com> * elf/dl-load.c (_dl_dst_count): Allow $ORIGIN to point to directory with the reference since this is as secure as using the object with the dependency. (_dl_dst_substitute): Likewise. * elf/dl-load.c (_dl_dst_count): Change strings in first two strncmp ...
reverse_nat_packet(struct dp_packet *pkt, const struct conn *conn) { char *tail = dp_packet_tail(pkt); uint8_t pad = dp_packet_l2_pad_size(pkt); struct conn_key inner_key; const char *inner_l4 = NULL; uint16_t orig_l3_ofs = pkt->l3_ofs; uint16_t orig_l4_ofs = pkt->l4_ofs; if (conn->key.dl_t...
1
[ "CWE-400" ]
ovs
79349cbab0b2a755140eedb91833ad2760520a83
88,850,198,316,429,650,000,000,000,000,000,000,000
61
flow: Support extra padding length. Although not required, padding can be optionally added until the packet length is MTU bytes. A packet with extra padding currently fails sanity checks. Vulnerability: CVE-2020-35498 Fixes: fa8d9001a624 ("miniflow_extract: Properly handle small IP packets.") Reported-by: Joakim Hind...
ZEND_API char * zend_dtoa(double _d, int mode, int ndigits, int *decpt, int *sign, char **rve) { /* Arguments ndigits, decpt, sign are similar to those of ecvt and fcvt; trailing zeros are suppressed from the returned string. If not null, *rve is set to point to the end of the return value. If d is +-Inf...
0
[ "CWE-119" ]
php-src
37da90248deb2188e8ee50e4753ad6340679b425
74,063,508,987,544,590,000,000,000,000,000,000,000
596
Added missing allocation checks
int ssl3_get_server_hello(SSL *s) { STACK_OF(SSL_CIPHER) *sk; const SSL_CIPHER *c; unsigned char *p,*d; int i,al,ok; unsigned int j; long n; #ifndef OPENSSL_NO_COMP SSL_COMP *comp; #endif n=s->method->ssl_get_message(s, SSL3_ST_CR_SRVR_HELLO_A, SSL3_ST_CR_SRVR_HELLO_B, -1, 20000, /* ?? */ &ok); if...
0
[]
openssl
edc032b5e3f3ebb1006a9c89e0ae00504f47966f
245,052,087,357,911,200,000,000,000,000,000,000,000
242
Add SRP support.
inline double option(const char *const name, const int argc, const char *const *const argv, const double _default, const char *const usage=0) { const char *const s = cimg::option(name,argc,argv,(char*)0); const double res = s?cimg::atof(s):_default; char *const tmp = new c...
0
[ "CWE-770" ]
cimg
619cb58dd90b4e03ac68286c70ed98acbefd1c90
212,697,364,492,308,580,000,000,000,000,000,000,000
10
CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size.
prepend_args (char const *options, char *buf, char **argv) { char const *o = options; char *b = buf; int n = 0; for (;;) { while (c_isspace ((unsigned char) *o)) o++; if (!*o) return n; if (argv) argv[n] = b; n++; do if ((*b++ = *o++) == '\\' &...
1
[ "CWE-189" ]
grep
8fcf61523644df42e1905c81bed26838e0b04f91
100,583,226,242,648,780,000,000,000,000,000,000,000
24
grep: fix integer-overflow issues in main program * NEWS: Document this. * bootstrap.conf (gnulib_modules): Add inttypes, xstrtoimax. Remove xstrtoumax. * src/main.c: Include <inttypes.h>, for INTMAX_MAX, PRIdMAX. (context_length_arg, prtext, grepbuf, grep, grepfile) (get_nondigit_option, main): Use intmax_t, not int,...
void timerfd_clock_was_set(void) { ktime_t moffs = ktime_mono_to_real(0); struct timerfd_ctx *ctx; unsigned long flags; rcu_read_lock(); list_for_each_entry_rcu(ctx, &cancel_list, clist) { if (!ctx->might_cancel) continue; spin_lock_irqsave(&ctx->wqh.lock, flags); if (ctx->moffs != moffs) { ctx->moffs...
0
[ "CWE-416" ]
linux
1e38da300e1e395a15048b0af1e5305bd91402f6
50,525,593,246,487,140,000,000,000,000,000,000,000
20
timerfd: Protect the might cancel mechanism proper The handling of the might_cancel queueing is not properly protected, so parallel operations on the file descriptor can race with each other and lead to list corruptions or use after free. Protect the context for these operations with a seperate lock. The wait queue ...
static int32_t readvec_signed(const std::vector<uint8_t>& data,int& ptr,int len) { const uint32_t high_bit = 0x80<<((len-1)*8); uint32_t val=0; while (len--) { val <<= 8; val |= data[ptr++]; } bool negative = (val & high_bit) != 0; val &= ~high_bit; if (negative) { return -(high_bit-val); ...
0
[ "CWE-125" ]
libheif
f7399b62d7fbc596f1b2871578c1d2053bedf1dd
295,396,119,823,307,540,000,000,000,000,000,000,000
22
Handle case where referenced "iref" box doesn't exist (fixes #138).
static int ctrl_x_mode_eval(void) { return ctrl_x_mode == CTRL_X_EVAL; }
0
[ "CWE-125" ]
vim
f12129f1714f7d2301935bb21d896609bdac221c
28,746,209,342,529,170,000,000,000,000,000,000,000
1
patch 9.0.0020: with some completion reading past end of string Problem: With some completion reading past end of string. Solution: Check the length of the string.
router_get_by_hexdigest(const char *hexdigest) { char digest[DIGEST_LEN]; size_t len; routerinfo_t *ri; tor_assert(hexdigest); if (!routerlist) return NULL; if (hexdigest[0]=='$') ++hexdigest; len = strlen(hexdigest); if (hexdigest_to_digest(hexdigest, digest) < 0) return NULL; ri = rout...
0
[ "CWE-399" ]
tor
308f6dad20675c42b29862f4269ad1fbfb00dc9a
228,674,143,809,913,030,000,000,000,000,000,000,000
32
Mitigate a side-channel leak of which relays Tor chooses for a circuit Tor's and OpenSSL's current design guarantee that there are other leaks, but this one is likely to be more easily exploitable, and is easy to fix.
static int complete_walk(struct nameidata *nd) { struct dentry *dentry = nd->path.dentry; int status; if (nd->flags & LOOKUP_RCU) { nd->flags &= ~LOOKUP_RCU; if (!(nd->flags & LOOKUP_ROOT)) nd->root.mnt = NULL; if (!legitimize_mnt(nd->path.mnt, nd->m_seq)) { rcu_read_unlock(); return -ECHILD; } ...
0
[ "CWE-416" ]
linux
f15133df088ecadd141ea1907f2c96df67c729f0
180,191,820,759,241,600,000,000,000,000,000,000,000
44
path_openat(): fix double fput() path_openat() jumps to the wrong place after do_tmpfile() - it has already done path_cleanup() (as part of path_lookupat() called by do_tmpfile()), so doing that again can lead to double fput(). Cc: stable@vger.kernel.org # v3.11+ Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
pam_sm_acct_mgmt(pam_handle_t *pamh, int flags UNUSED, int argc, const char **argv) { const char *username; const char *database = NULL; const char *cryptmode = NULL; int retval = PAM_AUTH_ERR, ctrl; /* parse arguments */ ctrl = _pam_parse(pamh, argc, argv, &database, &cryptmode); /* Ge...
0
[]
linux-pam
57a1e2b274d0a6376d92ada9926e5c5741e7da20
87,056,403,522,661,680,000,000,000,000,000,000,000
43
pam_userdb: fix password hash comparison Starting with commit Linux-PAM-0-77-28-g0b3e583 that introduced hashed passwords support in pam_userdb, hashes are compared case-insensitively. This bug leads to accepting hashes for completely different passwords in addition to those that should be accepted. Additionally, com...
find_extend_vma(struct mm_struct *mm, unsigned long addr) { struct vm_area_struct *vma, *prev; addr &= PAGE_MASK; vma = find_vma_prev(mm, addr, &prev); if (vma && (vma->vm_start <= addr)) return vma; if (!prev || expand_stack(prev, addr)) return NULL; if (prev->vm_flags & VM_LOCKED) populate_vma_page_range...
1
[ "CWE-362", "CWE-703", "CWE-667" ]
linux
04f5866e41fb70690e28397487d8bd8eea7d712a
331,387,604,972,562,300,000,000,000,000,000,000,000
14
coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping The core dumping code has always run without holding the mmap_sem for writing, despite that is the only way to ensure that the entire vma layout will not change from under it. Only using some signal serialization on the processes bel...
TEST(QueryProjectionTest, ProjectionWithExpressionIsNotSimple) { auto proj = createProjection("{}", "{a: {$add: [3, 4]}}"); ASSERT_FALSE(proj.isSimple()); const auto& fields = proj.getRequiredFields(); ASSERT_EQ(fields.size(), 1); ASSERT_EQ(fields[0], "_id"); }
0
[ "CWE-732" ]
mongo
cd583b6c4d8aa2364f255992708b9bb54e110cf4
280,169,689,109,606,800,000,000,000,000,000,000,000
8
SERVER-53929 Add stricter parser checks around positional projection
inline double rand(const double val_min, const double val_max) { const double val = cimg::_rand()/16777215.; return val_min + (val_max - val_min)*val;
0
[ "CWE-125" ]
CImg
10af1e8c1ad2a58a0a3342a856bae63e8f257abb
97,880,951,980,869,000,000,000,000,000,000,000,000
4
Fix other issues in 'CImg<T>::load_bmp()'.
static void mcast_socket_event(AvahiWatch *w, int fd, AvahiWatchEvent events, void *userdata) { AvahiServer *s = userdata; AvahiAddress dest, src; AvahiDnsPacket *p = NULL; AvahiIfIndex iface; uint16_t port; uint8_t ttl; assert(w); assert(fd >= 0); assert(events & AVAHI_WATCH_IN); ...
0
[ "CWE-399" ]
avahi
3093047f1aa36bed8a37fa79004bf0ee287929f4
63,496,386,976,663,380,000,000,000,000,000,000,000
35
Don't get confused by UDP packets with a source port that is zero This is a fix for rhbz 475394. Problem identified by Hugo Dias.
int fsck_walk(struct object *obj, void *data, struct fsck_options *options) { if (!obj) return -1; if (obj->type == OBJ_NONE) parse_object(&obj->oid); switch (obj->type) { case OBJ_BLOB: return 0; case OBJ_TREE: return fsck_walk_tree((struct tree *)obj, data, options); case OBJ_COMMIT: return fsck_wal...
0
[ "CWE-20", "CWE-88", "CWE-522" ]
git
a124133e1e6ab5c7a9fef6d0e6bcb084e3455b46
198,000,055,355,389,040,000,000,000,000,000,000,000
22
fsck: detect submodule urls starting with dash Urls with leading dashes can cause mischief on older versions of Git. We should detect them so that they can be rejected by receive.fsckObjects, preventing modern versions of git from being a vector by which attacks can spread. Signed-off-by: Jeff King <peff@peff.net> Si...
void sctp_inq_push(struct sctp_inq *q, struct sctp_chunk *chunk) { /* Directly call the packet handling routine. */ if (chunk->rcvr->dead) { sctp_chunk_free(chunk); return; } /* We are now calling this either from the soft interrupt * or from the backlog processing. * Eventually, we should clean up inqueue...
0
[]
linux
196d67593439b03088913227093e374235596e33
193,860,460,773,610,140,000,000,000,000,000,000,000
18
sctp: Add support to per-association statistics via a new SCTP_GET_ASSOC_STATS call The current SCTP stack is lacking a mechanism to have per association statistics. This is an implementation modeled after OpenSolaris' SCTP_GET_ASSOC_STATS. Userspace part will follow on lksctp if/when there is a general ACK on this. ...
void ssh_buffer_set_secure(ssh_buffer buffer) { buffer->secure = true; }
0
[ "CWE-476" ]
libssh-mirror
10b3ebbe61a7031a3dae97f05834442220447181
151,314,475,209,311,170,000,000,000,000,000,000,000
4
buffer: Reformat ssh_buffer_add_data() Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
lexer_compare_identifier_to_string (const lexer_lit_location_t *left_p, /**< left literal */ const uint8_t *right_p, /**< right identifier string */ size_t size) /**< byte size of the right identifier */ { if (left_p->length != size) { retu...
1
[ "CWE-416" ]
jerryscript
3bcd48f72d4af01d1304b754ef19fe1a02c96049
230,030,200,814,139,270,000,000,000,000,000,000,000
16
Improve parse_identifier (#4691) Ascii string length is no longer computed during string allocation. JerryScript-DCO-1.0-Signed-off-by: Daniel Batiz batizjob@gmail.com
bool primality_test(const BigInt& n, RandomNumberGenerator& rng, size_t level) { const size_t PREF_NONCE_BITS = 128; if(n == 2) return true; if(n <= 1 || n.is_even()) return false; // Fast path testing for small numbers (<= 65521) if(n <= PRIMES[PR...
0
[ "CWE-200" ]
botan
bcf13fa153a11b3e0ad54e2af6962441cea3adf1
243,191,842,199,446,660,000,000,000,000,000,000,000
51
Fixes for CVE-2015-7827 and CVE-2016-2849
ParseMsg(smsg_t *pMsg) { rsRetVal localRet = RS_RET_ERR; parserList_t *pParserList; parser_t *pParser; sbool bIsSanitized; sbool bPRIisParsed; static int iErrMsgRateLimiter = 0; DEFiRet; if(pMsg->iLenRawMsg == 0) ABORT_FINALIZE(RS_RET_EMPTY_MSG); CHKiRet(uncompressMessage(pMsg)); /* we take the risk to p...
0
[]
rsyslog
20f8237870eb5e971fa068e4dd4d296f1dbef329
271,476,484,782,535,460,000,000,000,000,000,000,000
77
core: fix potential misadressing in parser message sanitizer misadressing could happen when an oversize message made it to the sanitizer AND contained a control character in the oversize part of the message. Note that it is an error in itself that such an oversize message enters the system, but we harden the sanitizer...
static void vmw_surface_dma_encode(struct vmw_surface *srf, void *cmd_space, const SVGAGuestPtr *ptr, bool to_surface) { uint32_t i; struct vmw_surface_dma *cmd = (struct vmw_surface_dma *)cmd_space; const struct svga3d_surface_desc *desc = svga3dsurface_get_desc(srf->format); for (i = 0; i ...
0
[ "CWE-20" ]
linux
ee9c4e681ec4f58e42a83cb0c22a0289ade1aacf
335,037,079,129,816,800,000,000,000,000,000,000,000
50
drm/vmwgfx: limit the number of mip levels in vmw_gb_surface_define_ioctl() The 'req->mip_levels' parameter in vmw_gb_surface_define_ioctl() is a user-controlled 'uint32_t' value which is used as a loop count limit. This can lead to a kernel lockup and DoS. Add check for 'req->mip_levels'. References: https://bugzill...
int r_jwe_set_full_header_json_str(jwe_t * jwe, const char * str_header) { int ret; json_t * j_header = json_loads(str_header, JSON_DECODE_ANY, NULL); ret = r_jwe_set_full_header_json_t(jwe, j_header); json_decref(j_header); return ret; }
0
[ "CWE-787" ]
rhonabwy
b4c2923a1ba4fabf9b55a89244127e153a3e549b
106,675,832,864,155,690,000,000,000,000,000,000,000
9
Fix buffer overflow on r_jwe_aesgcm_key_unwrap
static int qeth_setadpparms_change_macaddr_cb(struct qeth_card *card, struct qeth_reply *reply, unsigned long data) { struct qeth_ipa_cmd *cmd; QETH_CARD_TEXT(card, 4, "chgmaccb"); cmd = (struct qeth_ipa_cmd *) data; if (!card->options.layer2 || !(card->info.mac_bits & QETH_LAYER2_MAC_READ)) { memcpy(car...
0
[ "CWE-200", "CWE-119" ]
linux
6fb392b1a63ae36c31f62bc3fc8630b49d602b62
145,614,492,146,500,130,000,000,000,000,000,000,000
18
qeth: avoid buffer overflow in snmp ioctl Check user-defined length in snmp ioctl request and allow request only if it fits into a qeth command buffer. Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com> Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com> Reviewed-by: Heiko Carstens <heicars2@linux.vnet.ibm.c...
void btrfs_reclaim_bgs_work(struct work_struct *work) { struct btrfs_fs_info *fs_info = container_of(work, struct btrfs_fs_info, reclaim_bgs_work); struct btrfs_block_group *bg; struct btrfs_space_info *space_info; LIST_HEAD(again_list); if (!test_bit(BTRFS_FS_OPEN, &fs_info->flags)) return; if (!btrfs_excl...
0
[ "CWE-703", "CWE-667" ]
linux
1cb3db1cf383a3c7dbda1aa0ce748b0958759947
282,102,415,986,852,700,000,000,000,000,000,000,000
85
btrfs: fix deadlock with concurrent chunk allocations involving system chunks When a task attempting to allocate a new chunk verifies that there is not currently enough free space in the system space_info and there is another task that allocated a new system chunk but it did not finish yet the creation of the respecti...
int ConnectionImpl::onFrameReceived(const nghttp2_frame* frame) { ENVOY_CONN_LOG(trace, "recv frame type={}", connection_, static_cast<uint64_t>(frame->hd.type)); // onFrameReceived() is called with a complete HEADERS frame assembled from all the HEADERS // and CONTINUATION frames, but we track them separately: ...
1
[ "CWE-400", "CWE-703" ]
envoy
afc39bea36fd436e54262f150c009e8d72db5014
127,049,452,956,077,920,000,000,000,000,000,000,000
116
Track byteSize of HeaderMap internally. Introduces a cached byte size updated internally in HeaderMap. The value is stored as an optional, and is cleared whenever a non-const pointer or reference to a HeaderEntry is accessed. The cached value can be set with refreshByteSize() which performs an iteration over the Heade...
NOEXPORT int initialize_winsock() { static struct WSAData wsa_state; if(WSAStartup(MAKEWORD( 2, 2 ), &wsa_state)) { message_box(TEXT("Failed to initialize winsock"), MB_ICONERROR); return 1; /* error */ } resolver_init(); return 0; /* IPv4 detected -> OK */ }
0
[ "CWE-295" ]
stunnel
ebad9ddc4efb2635f37174c9d800d06206f1edf9
57,157,784,422,431,470,000,000,000,000,000,000,000
10
stunnel-5.57
code_to_mbc(OnigCodePoint code, UChar *buf) { UChar *p = buf; if ((code & 0xff00) != 0) *p++ = (UChar )(((code >> 8) & 0xff)); *p++ = (UChar )(code & 0xff); #if 0 if (enclen(ONIG_ENCODING_SJIS, buf) != (p - buf)) return REGERR_INVALID_CODE_POINT_VALUE; #endif return p - buf; }
0
[ "CWE-125" ]
oniguruma
65a9b1aa03c9bc2dc01b074295b9603232cb3b78
120,965,191,511,241,480,000,000,000,000,000,000,000
13
onig-5.9.2
resolve_instid_predicate(const struct lys_module *prev_mod, const char *pred, struct lyd_node **node, int cur_idx) { /* ... /node[key=value] ... */ struct lyd_node_leaf_list *key; struct lys_node_leaf **list_keys = NULL; struct lys_node_list *slist = NULL; const char *model, *name, *value; int m...
0
[ "CWE-119" ]
libyang
32fb4993bc8bb49e93e84016af3c10ea53964be5
125,101,658,005,859,830,000,000,000,000,000,000,000
154
schema tree BUGFIX do not check features while still resolving schema Fixes #723
extern "C" sig_handler end_thread_signal(int sig __attribute__((unused))) { THD *thd=current_thd; DBUG_ENTER("end_thread_signal"); if (thd && ! thd->bootstrap) { statistic_increment(killed_threads, &LOCK_status); MYSQL_CALLBACK(thread_scheduler, end_thread, (thd,0)); /* purecov: inspected */ } DBUG_...
0
[ "CWE-264" ]
mysql-server
48bd8b16fe382be302c6f0b45931be5aa6f29a0e
38,022,058,546,477,963,000,000,000,000,000,000,000
11
Bug#24388753: PRIVILEGE ESCALATION USING MYSQLD_SAFE [This is the 5.5/5.6 version of the bugfix]. The problem was that it was possible to write log files ending in .ini/.cnf that later could be parsed as an options file. This made it possible for users to specify startup options without the permissions to do so. Thi...
usm_lookup_alg_str(int value, usm_alg_type_t *types) { int i; for (i = 0; types[i].label; ++i) if (value == types[i].value) return types[i].label; return NULL; }
0
[ "CWE-415" ]
net-snmp
5f881d3bf24599b90d67a45cae7a3eb099cd71c9
43,762,285,361,545,640,000,000,000,000,000,000,000
9
libsnmp, USM: Introduce a reference count in struct usmStateReference This patch fixes https://sourceforge.net/p/net-snmp/bugs/2956/.
static int em_idiv_ex(struct x86_emulate_ctxt *ctxt) { u8 de = 0; emulate_1op_rax_rdx(ctxt, "idiv", de); if (de) return emulate_de(ctxt); return X86EMUL_CONTINUE; }
0
[]
kvm
e28ba7bb020f07193bc000453c8775e9d2c0dda7
63,968,346,289,400,930,000,000,000,000,000,000,000
9
KVM: x86: fix missing checks in syscall emulation On hosts without this patch, 32bit guests will crash (and 64bit guests may behave in a wrong way) for example by simply executing following nasm-demo-application: [bits 32] global _start SECTION .text _start: syscall (I tested it with winxp and linux ...
static int strict_allocate_ftruncate(vfs_handle_struct *handle, files_struct *fsp, off_t len) { off_t space_to_write; uint64_t space_avail; uint64_t bsize,dfree,dsize; int ret; NTSTATUS status; SMB_STRUCT_STAT *pst; status = vfs_stat_fsp(fsp); if (!NT_STATUS_IS_OK(status)) { return -1; } pst = &fsp->fsp_na...
0
[ "CWE-665" ]
samba
30e724cbff1ecd90e5a676831902d1e41ec1b347
116,711,211,623,514,040,000,000,000,000,000,000,000
66
FSCTL_GET_SHADOW_COPY_DATA: Initialize output array to zero Otherwise num_volumes and the end marker can return uninitialized data to the client. Signed-off-by: Christof Schmitt <christof.schmitt@us.ibm.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Simo Sorce <idra@samba.org>
PHP_FUNCTION(stream_context_get_options) { zval *zcontext; php_stream_context *context; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zcontext) == FAILURE) { RETURN_FALSE; } context = decode_context_param(zcontext TSRMLS_CC); if (!context) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid s...
0
[ "CWE-20" ]
php-src
52b93f0cfd3cba7ff98cc5198df6ca4f23865f80
35,756,793,941,464,753,000,000,000,000,000,000,000
16
Fixed bug #69353 (Missing null byte checks for paths in various PHP extensions)
handle_accheck(CMD_Request *rx_message, CMD_Reply *tx_message) { IPAddr ip; UTI_IPNetworkToHost(&rx_message->data.ac_check.ip, &ip); if (NCR_CheckAccessRestriction(&ip)) { tx_message->status = htons(STT_ACCESSALLOWED); } else { tx_message->status = htons(STT_ACCESSDENIED); } }
0
[ "CWE-189" ]
chrony
7712455d9aa33d0db0945effaa07e900b85987b1
327,857,134,028,951,640,000,000,000,000,000,000,000
10
Fix buffer overflow when processing crafted command packets When the length of the REQ_SUBNETS_ACCESSED, REQ_CLIENT_ACCESSES command requests and the RPY_SUBNETS_ACCESSED, RPY_CLIENT_ACCESSES, RPY_CLIENT_ACCESSES_BY_INDEX, RPY_MANUAL_LIST command replies is calculated, the number of items stored in the packet is not v...
RGWOp *RGWHandler_REST_Bucket_S3::op_get() { if (s->info.args.sub_resource_exists("logging")) return new RGWGetBucketLogging_ObjStore_S3; if (s->info.args.sub_resource_exists("location")) return new RGWGetBucketLocation_ObjStore_S3; if (s->info.args.sub_resource_exists("versioning")) return new RGWG...
0
[ "CWE-79" ]
ceph
8f90658c731499722d5f4393c8ad70b971d05f77
101,893,355,564,043,050,000,000,000,000,000,000,000
49
rgw: reject unauthenticated response-header actions Signed-off-by: Matt Benjamin <mbenjamin@redhat.com> Reviewed-by: Casey Bodley <cbodley@redhat.com> (cherry picked from commit d8dd5e513c0c62bbd7d3044d7e2eddcd897bd400)
static int nf_tables_dump_sets(struct sk_buff *skb, struct netlink_callback *cb) { const struct nft_set *set; unsigned int idx, s_idx = cb->args[0]; struct nft_table *table, *cur_table = (struct nft_table *)cb->args[2]; struct net *net = sock_net(skb->sk); struct nft_ctx *ctx = cb->data, ctx_set; struct nftables_...
0
[ "CWE-400", "CWE-703" ]
linux
e02f0d3970404bfea385b6edb86f2d936db0ea2b
230,316,621,107,782,740,000,000,000,000,000,000,000
60
netfilter: nf_tables: disallow binding to already bound chain Update nft_data_init() to report EINVAL if chain is already bound. Fixes: d0e2c7de92c7 ("netfilter: nf_tables: add NFT_CHAIN_BINDING") Reported-by: Gwangun Jung <exsociety@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
PHP_METHOD(Phar, loadPhar) { char *fname, *alias = NULL, *error; size_t fname_len, alias_len = 0; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s!", &fname, &fname_len, &alias, &alias_len) == FAILURE) { return; } phar_request_initialize(); RETVAL_BOOL(phar_open_from_filename(fname, fname_len, alias, alias_le...
1
[ "CWE-20" ]
php-src
1e9b175204e3286d64dfd6c9f09151c31b5e099a
286,863,146,132,107,120,000,000,000,000,000,000,000
18
Fix bug #71860: Require valid paths for phar filenames