func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
**/
Tfloat linear_atXY(const float fx, const float fy, const int z=0, const int c=0) const {
if (is_empty())
throw CImgInstanceException(_cimg_instance
"linear_atXY(): Empty instance.",
cimg_instance);
return _linear_at... | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 130,523,629,342,364,540,000,000,000,000,000,000,000 | 8 | Fix other issues in 'CImg<T>::load_bmp()'. |
static int vsock_dgram_recvmsg(struct kiocb *kiocb, struct socket *sock,
struct msghdr *msg, size_t len, int flags)
{
return transport->dgram_dequeue(kiocb, vsock_sk(sock->sk), msg, len,
flags);
} | 0 | [
"CWE-20",
"CWE-269"
] | linux | f3d3342602f8bcbf37d7c46641cb9bca7618eb1c | 163,319,492,540,851,040,000,000,000,000,000,000,000 | 6 | net: rework recvmsg handler msg_name and msg_namelen logic
This patch now always passes msg->msg_namelen as 0. recvmsg handlers must
set msg_namelen to the proper size <= sizeof(struct sockaddr_storage)
to return msg_name to the user.
This prevents numerous uninitialized memory leaks we had in the
recvmsg handlers an... |
GF_Err styl_dump(GF_Box *a, FILE * trace)
{
u32 i;
GF_TextStyleBox*p = (GF_TextStyleBox*)a;
gf_isom_box_dump_start(a, "TextStyleBox", trace);
fprintf(trace, ">\n");
for (i=0; i<p->entry_count; i++) tx3g_dump_style(trace, &p->styles[i]);
if (!p->size) {
fprintf(trace, "<StyleRecord startChar=\"\" endChar=\"\" fo... | 0 | [
"CWE-125"
] | gpac | bceb03fd2be95097a7b409ea59914f332fb6bc86 | 198,907,773,239,060,070,000,000,000,000,000,000,000 | 13 | fixed 2 possible heap overflows (inc. #1088) |
static struct io_buffer *io_buffer_select(struct io_kiocb *req, size_t *len,
int bgid, struct io_buffer *kbuf,
bool needs_lock)
{
struct io_buffer *head;
if (req->flags & REQ_F_BUFFER_SELECTED)
return kbuf;
io_ring_submit_lock(req->ctx, needs_lock);
lockdep_assert_held(&req->ctx->uring_lock);
h... | 0 | [] | linux | 0f2122045b946241a9e549c2a76cea54fa58a7ff | 214,766,790,776,496,280,000,000,000,000,000,000,000 | 33 | io_uring: don't rely on weak ->files references
Grab actual references to the files_struct. To avoid circular references
issues due to this, we add a per-task note that keeps track of what
io_uring contexts a task has used. When the tasks execs or exits its
assigned files, we cancel requests based on this tracking.
W... |
static int lru_pull_tail(const int orig_id, const int cur_lru,
const uint64_t total_bytes, uint8_t flags) {
item *it = NULL;
int id = orig_id;
int removed = 0;
if (id == 0)
return 0;
int tries = 5;
item *search;
item *next_it;
void *hold_lock = NULL;
unsigned int mov... | 0 | [
"CWE-190"
] | memcached | bd578fc34b96abe0f8d99c1409814a09f51ee71c | 205,124,052,305,799,020,000,000,000,000,000,000,000 | 148 | CVE reported by cisco talos |
static int __init bpf_lwt_init(void)
{
return lwtunnel_encap_add_ops(&bpf_encap_ops, LWTUNNEL_ENCAP_BPF);
} | 0 | [] | net | 6c8991f41546c3c472503dff1ea9daaddf9331c2 | 219,951,558,046,515,940,000,000,000,000,000,000,000 | 4 | net: ipv6_stub: use ip6_dst_lookup_flow instead of ip6_dst_lookup
ipv6_stub uses the ip6_dst_lookup function to allow other modules to
perform IPv6 lookups. However, this function skips the XFRM layer
entirely.
All users of ipv6_stub->ip6_dst_lookup use ip_route_output_flow (via the
ip_route_output_key and ip_route_o... |
onig_get_callout_start_func(regex_t* reg, int callout_num)
{
/* If used for callouts of contents, return 0. */
CalloutListEntry* e;
e = onig_reg_callout_list_at(reg, callout_num);
return e->start_func;
} | 0 | [
"CWE-476"
] | oniguruma | 850bd9b0d8186eb1637722b46b12656814ab4ad2 | 227,118,708,053,105,080,000,000,000,000,000,000,000 | 8 | fix #87: Read unknown address in onig_error_code_to_str() |
copy_class(mrb_state *mrb, mrb_value dst, mrb_value src)
{
struct RClass *dc = mrb_class_ptr(dst);
struct RClass *sc = mrb_class_ptr(src);
/* if the origin is not the same as the class, then the origin and
the current class need to be copied */
if (sc->flags & MRB_FLAG_IS_PREPENDED) {
struct RClass *c0... | 0 | [
"CWE-824"
] | mruby | b64ce17852b180dfeea81cf458660be41a78974d | 196,737,554,629,942,780,000,000,000,000,000,000,000 | 28 | Should not call `initialize_copy` for `TT_ICLASS`; fix #4027
Since `TT_ICLASS` is a internal object that should never be revealed
to Ruby world. |
const x509_cert *ssl_get_peer_cert( const ssl_context *ssl )
{
if( ssl == NULL || ssl->session == NULL )
return NULL;
return ssl->session->peer_cert;
} | 0 | [
"CWE-310"
] | polarssl | 4582999be608c9794d4518ae336b265084db9f93 | 184,586,653,148,011,730,000,000,000,000,000,000,000 | 7 | Fixed timing difference resulting from badly formatted padding. |
finish_newstyle_options (uint64_t *exportsize,
const char *exportname_in, uint32_t exportnamelen)
{
GET_CONN;
/* Since the exportname string passed here comes directly out of the
* NBD protocol make a temporary copy of the exportname into a
* \0-terminated buffer.
*/
CLEANUP_FRE... | 0 | [
"CWE-924"
] | nbdkit | 09a13dafb7bb3a38ab52eb5501cba786365ba7fd | 93,355,634,710,270,430,000,000,000,000,000,000,000 | 34 | server: CVE-2021-3716 reset structured replies on starttls
https://nostarttls.secvuln.info/ pointed out a series of CVEs in
common implementation flaw in various SMTP and IMAP clients and
servers, all with a common thread of improperly caching plaintext
state across the STARTTLS encryption boundary; and recommended th... |
ins_need_undo_get(void)
{
return ins_need_undo;
} | 0 | [] | vim | 98a336dd497d3422e7efeef9f24cc9e25aeb8a49 | 289,189,782,547,178,900,000,000,000,000,000,000,000 | 4 | patch 8.2.0133: invalid memory access with search command
Problem: Invalid memory access with search command.
Solution: When :normal runs out of characters in bracketed paste mode break
out of the loop.(closes #5511) |
sctp_xmit_t sctp_packet_transmit_chunk(struct sctp_packet *packet,
struct sctp_chunk *chunk,
int one_packet)
{
sctp_xmit_t retval;
int error = 0;
SCTP_DEBUG_PRINTK("%s: packet:%p chunk:%p\n", __func__,
packet, chunk);
switch ((retval = (sctp_packet_append_chunk(packet, chunk)))) {
case... | 0 | [] | linux | 196d67593439b03088913227093e374235596e33 | 295,660,278,013,436,550,000,000,000,000,000,000,000 | 34 | 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.
... |
find_book_view (EBookBackendLDAP *bl)
{
EDataBookView *view = NULL;
GList *list;
list = e_book_backend_list_views (E_BOOK_BACKEND (bl));
if (list != NULL) {
/* FIXME Drop the EDataBookView reference for backward-
* compatibility, but at some point the LDAP backend
* should learn to expect a ne... | 0 | [] | evolution-data-server | 34bad61738e2127736947ac50e0c7969cc944972 | 169,197,335,249,554,210,000,000,000,000,000,000,000 | 19 | Bug 796174 - strcat() considered unsafe for buffer overflow |
rsvg_acquire_base64_resource (const char *data, GError ** error)
{
GByteArray *array = NULL;
gsize data_len, written_len;
int state = 0;
guint save = 0;
rsvg_return_val_if_fail (data != NULL, NULL, error);
while (*data)
if (*data++ == ',')
break;
data_len = strlen (dat... | 0 | [] | librsvg | 34c95743ca692ea0e44778e41a7c0a129363de84 | 78,517,402,200,713,660,000,000,000,000,000,000,000 | 21 | Store node type separately in RsvgNode
The node name (formerly RsvgNode:type) cannot be used to infer
the sub-type of RsvgNode that we're dealing with, since for unknown
elements we put type = node-name. This lead to a (potentially exploitable)
crash e.g. when the element name started with "fe" which tricked
the old c... |
PHP_FUNCTION(openssl_pkcs12_export)
{
X509 * cert = NULL;
BIO * bio_out;
PKCS12 * p12 = NULL;
zval * zcert = NULL, *zout = NULL, *zpkey, *args = NULL;
EVP_PKEY *priv_key = NULL;
long certresource, keyresource;
char * pass;
int pass_len;
char * friendly_name = NULL;
zval ** item;
STACK_OF(X509) *ca = NULL;
... | 0 | [
"CWE-20"
] | php-src | 2874696a5a8d46639d261571f915c493cd875897 | 117,887,529,027,971,220,000,000,000,000,000,000,000 | 68 | Fix CVE-2013-4073 - handling of certs with null bytes |
void arch_cpu_idle_exit(void)
{
ledtrig_cpu(CPU_LED_IDLE_END);
} | 0 | [
"CWE-284",
"CWE-264"
] | linux | a4780adeefd042482f624f5e0d577bf9cdcbb760 | 91,124,645,195,973,960,000,000,000,000,000,000,000 | 4 | ARM: 7735/2: Preserve the user r/w register TPIDRURW on context switch and fork
Since commit 6a1c53124aa1 the user writeable TLS register was zeroed to
prevent it from being used as a covert channel between two tasks.
There are more and more applications coming to Windows RT,
Wine could support them, but mostly they ... |
INST_HANDLER (las) { // LAS Z, Rd
int d = ((buf[0] >> 4) & 0xf) | ((buf[1] & 0x1) << 4);
// read memory from RAMPZ:Z
__generic_ld_st (op, "ram", 'z', 1, 0, 0, 0); // 0: Read (RAMPZ:Z)
ESIL_A ("r%d,|,", d); // 0: (Z) | Rd
ESIL_A ("DUP,r%d,=,", d); // Rd = [0]
__generic_ld_st (op, "ram", 'z', 1, 0, 0, 1); // ... | 0 | [
"CWE-125"
] | radare2 | 041e53cab7ca33481ae45ecd65ad596976d78e68 | 236,611,070,086,723,800,000,000,000,000,000,000,000 | 9 | Fix crash in anal.avr |
TEST(UriSuite, TestUriUserInfoHostPort1) {
// User info with ":", no port
UriParserStateA stateA;
UriUriA uriA;
stateA.uri = &uriA;
// 0 4 0 3 0 7 01 0 9
const char * const input = "http" "://" "abc:def" "@" "localhost";
ASSERT_TRUE(0 == uriParseUriA(&stateA, in... | 0 | [
"CWE-125"
] | uriparser | cef25028de5ff872c2e1f0a6c562eb3ea9ecbce4 | 184,202,791,516,172,350,000,000,000,000,000,000,000 | 17 | Fix uriParse*Ex* out-of-bounds read |
static void flush_entryatt(annotate_state_t *state)
{
if (!state->attvalues)
return; /* nothing to flush */
state->callback(state->lastname,
state->lastuid,
state->lastentry,
state->attvalues,
state->callback_rock);
... | 0 | [
"CWE-732"
] | cyrus-imapd | 621f9e41465b521399f691c241181300fab55995 | 76,021,451,074,969,630,000,000,000,000,000,000,000 | 13 | annotate: don't allow everyone to write shared server entries |
__must_hold(wqe->lock)
{
struct io_wqe_acct *acct = io_wqe_get_acct(worker);
struct io_wqe *wqe = worker->wqe;
if (!(worker->flags & IO_WORKER_F_UP))
return;
if (atomic_dec_and_test(&acct->nr_running) && io_acct_run_queue(acct)) {
atomic_inc(&acct->nr_running);
atomic_inc(&wqe->wq->worker_refs);
io_queue... | 0 | [
"CWE-200"
] | linux | 713b9825a4c47897f66ad69409581e7734a8728e | 339,090,009,910,580,630,000,000,000,000,000,000,000 | 14 | io-wq: fix cancellation on create-worker failure
WARNING: CPU: 0 PID: 10392 at fs/io_uring.c:1151 req_ref_put_and_test
fs/io_uring.c:1151 [inline]
WARNING: CPU: 0 PID: 10392 at fs/io_uring.c:1151 req_ref_put_and_test
fs/io_uring.c:1146 [inline]
WARNING: CPU: 0 PID: 10392 at fs/io_uring.c:1151
io_req_complete_post+0xf5... |
int cpia2_usb_stream_start(struct camera_data *cam, unsigned int alternate)
{
int ret;
int old_alt;
if(cam->streaming)
return 0;
if (cam->flush) {
int i;
DBG("Flushing buffers\n");
for(i=0; i<cam->num_frames; ++i) {
cam->buffers[i].status = FRAME_EMPTY;
cam->buffers[i].length = 0;
}
cam->curbuff... | 0 | [
"CWE-416"
] | linux | eff73de2b1600ad8230692f00bc0ab49b166512a | 26,507,993,111,895,484,000,000,000,000,000,000,000 | 39 | media: cpia2_usb: first wake up, then free in disconnect
Kasan reported a use after free in cpia2_usb_disconnect()
It first freed everything and then woke up those waiting.
The reverse order is correct.
Fixes: 6c493f8b28c67 ("[media] cpia2: major overhaul to get it in a working state again")
Signed-off-by: Oliver Ne... |
GF_ISOMAVCType gf_isom_get_avc_svc_type(GF_ISOFile *the_file, u32 trackNumber, u32 DescriptionIndex)
{
u32 type;
GF_TrackBox *trak;
GF_MPEGVisualSampleEntryBox *entry;
trak = gf_isom_get_track_from_file(the_file, trackNumber);
if (!trak || !trak->Media || !trak->Media->handler || !DescriptionIndex) return GF_ISOM_... | 0 | [
"CWE-401"
] | gpac | 0a85029d694f992f3631e2f249e4999daee15cbf | 227,435,620,295,001,650,000,000,000,000,000,000,000 | 41 | fixed #1785 (fuzz) |
void dm_put(struct mapped_device *md)
{
atomic_dec(&md->holders);
} | 0 | [
"CWE-362"
] | linux | b9a41d21dceadf8104812626ef85dc56ee8a60ed | 139,779,970,552,504,610,000,000,000,000,000,000,000 | 4 | dm: fix race between dm_get_from_kobject() and __dm_destroy()
The following BUG_ON was hit when testing repeat creation and removal of
DM devices:
kernel BUG at drivers/md/dm.c:2919!
CPU: 7 PID: 750 Comm: systemd-udevd Not tainted 4.1.44
Call Trace:
[<ffffffff81649e8b>] dm_get_from_kobject+0x34/0x3a
... |
mlx5_tx_packet_multi_tso(struct mlx5_txq_data *restrict txq,
struct mlx5_txq_local *restrict loc,
unsigned int olx)
{
struct mlx5_wqe *restrict wqe;
unsigned int ds, dlen, inlen, ntcp, vlan = 0;
/*
* Calculate data length to be inlined to estimate
* the required space in WQE ring buffer.
*/
dlen = rte_... | 0 | [] | dpdk-stable | 8b090f2664e9d014cd8fa0fde90597aaf4349e7e | 263,781,570,603,793,120,000,000,000,000,000,000,000 | 65 | net/mlx5: fix Rx queue recovery mechanism
The local variables are getting inconsistent in data receiving routines
after queue error recovery.
Receive queue consumer index is getting wrong, need to reset one to the
size of the queue (as RQ was fully replenished in recovery procedure).
In MPRQ case, also the local cons... |
coolkey_get_access(sc_card_t *card, sc_cardctl_coolkey_object_t *obj, unsigned int *access_ptr)
{
return coolkey_set_bool_flags(card, obj, access_ptr, access_table, access_table_size);
} | 0 | [] | OpenSC | 7114fb71b54ddfe06ce5dfdab013f4c38f129d14 | 169,866,823,288,793,870,000,000,000,000,000,000,000 | 4 | coolkey: Initialize potentially uninitialized memory
Thanks oss-fuzz
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=28855 |
ms_escher_read_AlignRule (MSEscherState *state, MSEscherHeader *h)
{
return FALSE;
} | 0 | [
"CWE-119"
] | gnumeric | b5480b69345b3c6d56ee0ed9c9e9880bb2a08cdc | 333,249,964,401,524,820,000,000,000,000,000,000,000 | 4 | xls: fuzzed file crash. |
xfs_inode_item_format(
struct xfs_log_item *lip,
struct xfs_log_vec *lv)
{
struct xfs_inode_log_item *iip = INODE_ITEM(lip);
struct xfs_inode *ip = iip->ili_inode;
struct xfs_inode_log_format *ilf;
struct xfs_log_iovec *vecp = NULL;
ASSERT(ip->i_d.di_version > 1);
ilf = xlog_prepare_iovec(lv, &vecp, XLOG_REG_... | 0 | [
"CWE-19"
] | linux | fc0561cefc04e7803c0f6501ca4f310a502f65b8 | 191,247,298,810,818,800,000,000,000,000,000,000,000 | 36 | xfs: optimise away log forces on timestamp updates for fdatasync
xfs: timestamp updates cause excessive fdatasync log traffic
Sage Weil reported that a ceph test workload was writing to the
log on every fdatasync during an overwrite workload. Event tracing
showed that the only metadata modification being made was the... |
void CLASS scale_colors()
{
unsigned bottom, right, size, row, col, ur, uc, i, x, y, c, sum[8];
int val, dark, sat;
double dsum[8], dmin, dmax;
float scale_mul[4], fr, fc;
ushort *img=0, *pix;
#ifdef LIBRAW_LIBRARY_BUILD
RUN_CALLBACK(LIBRAW_PROGRESS_SCALE_COLORS,0,2);
#endif
if (user_mul[0])
memcpy ... | 0 | [
"CWE-129"
] | LibRaw | 89d065424f09b788f443734d44857289489ca9e2 | 83,545,931,530,672,515,000,000,000,000,000,000,000 | 154 | fixed two more problems found by fuzzer |
static void tcf_chain_tp_delete_empty(struct tcf_chain *chain,
struct tcf_proto *tp, bool rtnl_held,
struct netlink_ext_ack *extack)
{
struct tcf_chain_info chain_info;
struct tcf_proto *tp_iter;
struct tcf_proto **pprev;
struct tcf_proto *next;
mutex_lock(&chain->filter_chain_lock);
/* Atom... | 0 | [
"CWE-416"
] | linux | 04c2a47ffb13c29778e2a14e414ad4cb5a5db4b5 | 26,229,935,356,934,977,000,000,000,000,000,000,000 | 40 | net: sched: fix use-after-free in tc_new_tfilter()
Whenever tc_new_tfilter() jumps back to replay: label,
we need to make sure @q and @chain local variables are cleared again,
or risk use-after-free as in [1]
For consistency, apply the same fix in tc_ctl_chain()
BUG: KASAN: use-after-free in mini_qdisc_pair_swap+0x1... |
static bool open_match_attributes(connection_struct *conn,
uint32 old_dos_attr,
uint32 new_dos_attr,
mode_t existing_unx_mode,
mode_t new_unx_mode,
mode_t *returned_unx_mode)
{
uint32 noarch_old_dos_attr, noarch_new_dos_attr;
noarch_old_dos_attr = (old_dos_attr & ~FILE_ATTRIBUTE_ARCHIVE... | 0 | [] | samba | 60f922bf1bd8816eacbb32c24793ad1f97a1d9f2 | 68,120,035,305,596,030,000,000,000,000,000,000,000 | 42 | Fix bug #10229 - No access check verification on stream files.
https://bugzilla.samba.org/show_bug.cgi?id=10229
We need to check if the requested access mask
could be used to open the underlying file (if
it existed), as we're passing in zero for the
access mask to the base filename.
Signed-off-by: Jeremy Allison <jr... |
callbacks_window_key_release_event (GtkWidget *widget, GdkEventKey *event)
{
return TRUE;
} /* key_release_event */ | 0 | [
"CWE-200"
] | gerbv | 319a8af890e4d0a5c38e6d08f510da8eefc42537 | 296,627,458,584,073,940,000,000,000,000,000,000,000 | 4 | Remove local alias to parameter array
Normalizing access to `gerbv_simplified_amacro_t::parameter` as a step to fix CVE-2021-40402 |
njs_string_prop(njs_string_prop_t *string, const njs_value_t *value)
{
size_t size;
uintptr_t length;
size = value->short_string.size;
if (size != NJS_STRING_LONG) {
string->start = (u_char *) value->short_string.start;
length = value->short_string.length;
} else {
st... | 0 | [] | njs | 36f04a3178fcb6da8513cc3dbf35215c2a581b3f | 15,578,226,211,660,293,000,000,000,000,000,000,000 | 22 | Fixed String.prototype.replace() with byte strings.
This closes #522 issue on Github. |
Header headerNew(void)
{
return headerCreate(NULL, 0);
} | 0 | [
"CWE-125"
] | rpm | 8f4b3c3cab8922a2022b9e47c71f1ecf906077ef | 193,586,421,570,709,830,000,000,000,000,000,000,000 | 4 | hdrblobInit() needs bounds checks too
Users can pass untrusted data to hdrblobInit() and it must be robust
against this. |
static void fill_extnum_info(struct elfhdr *elf, struct elf_shdr *shdr4extnum,
elf_addr_t e_shoff, int segs)
{
elf->e_shoff = e_shoff;
elf->e_shentsize = sizeof(*shdr4extnum);
elf->e_shnum = 1;
elf->e_shstrndx = SHN_UNDEF;
memset(shdr4extnum, 0, sizeof(*shdr4extnum));
shdr4extnum->sh_type = SHT_NULL;
s... | 0 | [
"CWE-284",
"CWE-264"
] | linux | 4e7c22d447bb6d7e37bfe39ff658486ae78e8d77 | 129,585,599,442,379,780,000,000,000,000,000,000,000 | 15 | 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 randomize_stack_top() in file
"fs/binfmt_elf.c":
static unsigned long randomize_stack_top(unsigned long stack_top... |
flatpak_dir_install_bundle (FlatpakDir *self,
GFile *file,
const char *remote,
char **out_ref,
GCancellable *cancellable,
GError **error)
{
g_autofree char... | 0 | [
"CWE-668"
] | flatpak | cd2142888fc4c199723a0dfca1f15ea8788a5483 | 231,235,025,522,643,140,000,000,000,000,000,000,000 | 133 | Don't expose /proc when running apply_extra
As shown by CVE-2019-5736, it is sometimes possible for the sandbox
app to access outside files using /proc/self/exe. This is not
typically an issue for flatpak as the sandbox runs as the user which
has no permissions to e.g. modify the host files.
However, when installing ... |
daemon_msg_findallif_req(uint8 ver, struct daemon_slpars *pars, uint32 plen)
{
char errbuf[PCAP_ERRBUF_SIZE]; // buffer for network errors
char errmsgbuf[PCAP_ERRBUF_SIZE]; // buffer for errors to send to the client
char sendbuf[RPCAP_NETBUF_SIZE]; // temporary buffer in which data to be sent is buffered
int sendb... | 1 | [
"CWE-20",
"CWE-703",
"CWE-131"
] | libpcap | 617b12c0339db4891d117b661982126c495439ea | 229,055,541,511,022,480,000,000,000,000,000,000,000 | 198 | Calculate the reply payload length in a local variable.
Using the same variable for the remaining request length and the reply
length is confusing at best and can cause errors at worst (if the
request had extra stuff at the end, so that the variable is non-zero).
This addresses Include Security issue I8: [libpcap] Re... |
int kvm_arch_vcpu_ioctl_get_mpstate(struct kvm_vcpu *vcpu,
struct kvm_mp_state *mp_state)
{
mp_state->mp_state = vcpu->arch.mp_state;
return 0;
} | 0 | [
"CWE-200"
] | kvm | 831d9d02f9522e739825a51a11e3bc5aa531a905 | 245,799,063,339,270,950,000,000,000,000,000,000,000 | 6 | KVM: x86: fix information leak to userland
Structures kvm_vcpu_events, kvm_debugregs, kvm_pit_state2 and
kvm_clock_data are copied to userland with some padding and reserved
fields unitialized. It leads to leaking of contents of kernel stack
memory. We have to initialize them to zero.
In patch v1 Jan Kiszka suggest... |
bool load_grammar(const char *s, const Rules &rules) {
auto n = strlen(s);
return load_grammar(s, n, rules);
} | 0 | [
"CWE-125"
] | cpp-peglib | b3b29ce8f3acf3a32733d930105a17d7b0ba347e | 71,628,514,496,487,480,000,000,000,000,000,000,000 | 4 | Fix #122 |
void visit(Repetition &ope) override { ope.ope_->accept(*this); } | 0 | [
"CWE-125"
] | cpp-peglib | b3b29ce8f3acf3a32733d930105a17d7b0ba347e | 271,048,409,733,802,160,000,000,000,000,000,000,000 | 1 | Fix #122 |
static int on_body_fill_buffer(http_parser *parser, const char *str, size_t len)
{
parser_context *ctx = (parser_context *) parser->data;
http_subtransport *t = ctx->t;
/* If our goal is to replay the request (either an auth failure or
* a redirect) then don't bother buffering since we're ignoring the
* content... | 0 | [
"CWE-284"
] | libgit2 | b5c6a1b407b7f8b952bded2789593b68b1876211 | 252,983,347,752,547,800,000,000,000,000,000,000,000 | 24 | http: check certificate validity before clobbering the error variable |
bgp_attr_local_pref (struct bgp_attr_parser_args *args)
{
struct peer *const peer = args->peer;
struct attr *const attr = args->attr;
const bgp_size_t length = args->length;
/* Length check. */
if (length != 4)
{
zlog (peer->log, LOG_ERR, "LOCAL_PREF attribute length isn't 4 [%u]",
length)... | 0 | [] | quagga | 8794e8d229dc9fe29ea31424883433d4880ef408 | 140,668,250,212,576,840,000,000,000,000,000,000,000 | 32 | bgpd: Fix regression in args consolidation, total should be inited from args
* bgp_attr.c: (bgp_attr_unknown) total should be initialised from the args. |
static CURLcode imap_perform_upgrade_tls(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
struct imap_conn *imapc = &conn->proto.imapc;
/* Start the SSL connection */
result = Curl_ssl_connect_nonblocking(conn, FIRSTSOCKET, &imapc->ssldone);
if(!result) {
if(imapc->state != IMAP_UPGRADETLS)
... | 0 | [
"CWE-119"
] | curl | 13c9a9ded3ae744a1e11cbc14e9146d9fa427040 | 41,529,053,053,674,602,000,000,000,000,000,000,000 | 20 | imap: if a FETCH response has no size, don't call write callback
CVE-2017-1000257
Reported-by: Brian Carpenter and 0xd34db347
Also detected by OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3586 |
QByteArray CtcpParser::xdelimDequote(const QByteArray &message)
{
QByteArray dequotedMessage;
QByteArray messagepart;
QHash<QByteArray, QByteArray>::iterator xdelimquote;
for (int i = 0; i < message.size(); i++) {
messagepart = message.mid(i, 1);
if (i+1 < message.size()) {
... | 0 | [
"CWE-399"
] | quassel | b5e38970ffd55e2dd9f706ce75af9a8d7730b1b8 | 312,324,195,978,356,800,000,000,000,000,000,000,000 | 21 | Improve the message-splitting algorithm for PRIVMSG and CTCP
This introduces a new message splitting algorithm based on
QTextBoundaryFinder. It works by first starting with the entire
message to be sent, encoding it, and checking to see if it is over
the maximum message length. If it is, it uses QTBF to find the
wor... |
int usb_sg_init(struct usb_sg_request *io, struct usb_device *dev,
unsigned pipe, unsigned period, struct scatterlist *sg,
int nents, size_t length, gfp_t mem_flags)
{
int i;
int urb_flags;
int use_sg;
if (!io || !dev || !sg
|| usb_pipecontrol(pipe)
|| usb_pipeisoc(pipe)
|| nents <= 0)
return -EINVA... | 0 | [
"CWE-119",
"CWE-787"
] | linux | 2e1c42391ff2556387b3cb6308b24f6f65619feb | 202,969,078,627,402,240,000,000,000,000,000,000,000 | 102 | USB: core: harden cdc_parse_cdc_header
Andrey Konovalov reported a possible out-of-bounds problem for the
cdc_parse_cdc_header function. He writes:
It looks like cdc_parse_cdc_header() doesn't validate buflen
before accessing buffer[1], buffer[2] and so on. The only check
present is while (buflen > 0).
So fix thi... |
static void test_field_misc()
{
MYSQL_STMT *stmt;
MYSQL_RES *result;
int rc;
myheader("test_field_misc");
rc= mysql_query(mysql, "SELECT @@autocommit");
myquery(rc);
result= mysql_store_result(mysql);
mytest(result);
rc= my_process_result_set(result);
DIE_UNLESS(rc == 1);
verify_pr... | 0 | [
"CWE-284",
"CWE-295"
] | mysql-server | 3bd5589e1a5a93f9c224badf983cd65c45215390 | 312,084,438,890,626,860,000,000,000,000,000,000,000 | 110 | WL#6791 : Redefine client --ssl option to imply enforced encryption
# Changed the meaning of the --ssl=1 option of all client binaries
to mean force ssl, not try ssl and fail over to eunecrypted
# Added a new MYSQL_OPT_SSL_ENFORCE mysql_options()
option to specify that an ssl connection is required.
# Added a new macr... |
USBDevice *usbdevice_create(const char *cmdline)
{
USBBus *bus = usb_bus_find(-1 /* any */);
LegacyUSBFactory *f = NULL;
GSList *i;
char driver[32];
const char *params;
int len;
params = strchr(cmdline,':');
if (params) {
params++;
len = params - cmdline;
if (len... | 0 | [
"CWE-119"
] | qemu | 9f8e9895c504149d7048e9fc5eb5cbb34b16e49a | 165,420,604,364,330,230,000,000,000,000,000,000,000 | 51 | usb: sanity check setup_index+setup_len in post_load
CVE-2013-4541
s->setup_len and s->setup_index are fed into usb_packet_copy as
size/offset into s->data_buf, it's possible for invalid state to exploit
this to load arbitrary data.
setup_len and setup_index should be checked to make sure
they are not negative.
Cc:... |
static inline void queue_me(struct futex_q *q, struct futex_hash_bucket *hb)
{
int prio;
/*
* The priority used to register this element is
* - either the real thread-priority for the real-time threads
* (i.e. threads with a priority lower than MAX_RT_PRIO)
* - or MAX_RT_PRIO for non-RT threads.
* Thus, al... | 0 | [] | linux-2.6 | 5ecb01cfdf96c5f465192bdb2a4fd4a61a24c6cc | 198,218,879,814,111,000,000,000,000,000,000,000,000 | 22 | futex_lock_pi() key refcnt fix
This fixes a futex key reference count bug in futex_lock_pi(),
where a key's reference count is incremented twice but decremented
only once, causing the backing object to not be released.
If the futex is created in a temporary file in an ext3 file system,
this bug causes the file's inod... |
bool Item_field::rename_fields_processor(void *arg)
{
Item::func_processor_rename *rename= (Item::func_processor_rename*) arg;
List_iterator<Create_field> def_it(rename->fields);
Create_field *def;
while ((def=def_it++))
{
if (def->change.str &&
(!db_name || !db_name[0] ||
!my_strcasecmp... | 0 | [
"CWE-416"
] | server | c02ebf3510850ba78a106be9974c94c3b97d8585 | 18,018,232,562,621,477,000,000,000,000,000,000,000 | 21 | MDEV-24176 Preparations
1. moved fix_vcol_exprs() call to open_table()
mysql_alter_table() doesn't do lock_tables() so it cannot win from
fix_vcol_exprs() from there. Tests affected: main.default_session
2. Vanilla cleanups and comments. |
static void __exit loop_exit(void)
{
unsigned long range;
range = max_loop ? max_loop << part_shift : 1UL << MINORBITS;
idr_for_each(&loop_index_idr, &loop_exit_cb, NULL);
idr_destroy(&loop_index_idr);
blk_unregister_region(MKDEV(LOOP_MAJOR, 0), range);
unregister_blkdev(LOOP_MAJOR, "loop");
misc_deregister(... | 0 | [
"CWE-416",
"CWE-362"
] | linux | ae6650163c66a7eff1acd6eb8b0f752dcfa8eba5 | 290,229,853,801,819,900,000,000,000,000,000,000,000 | 14 | loop: fix concurrent lo_open/lo_release
范龙飞 reports that KASAN can report a use-after-free in __lock_acquire.
The reason is due to insufficient serialization in lo_release(), which
will continue to use the loop device even after it has decremented the
lo_refcnt to zero.
In the meantime, another process can come in, o... |
static void tstream_tls_pull_done(struct tevent_req *subreq)
{
struct tstream_context *stream =
tevent_req_callback_data(subreq,
struct tstream_context);
struct tstream_tls *tlss =
tstream_context_data(stream,
struct tstream_tls);
int ret;
int sys_errno;
tlss->pull.subreq = NULL;
ret = tstream_readv_rec... | 0 | [] | samba | 22af043d2f20760f27150d7d469c7c7b944c6b55 | 32,978,054,321,179,766,000,000,000,000,000,000,000 | 23 | CVE-2013-4476: s4:libtls: check for safe permissions of tls private key file (key.pem)
If the tls key is not owned by root or has not mode 0600 samba will not
start up.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10234
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Björn Baumbach <bb@s... |
static struct port *find_port_by_devt_in_portdev(struct ports_device *portdev,
dev_t dev)
{
struct port *port;
unsigned long flags;
spin_lock_irqsave(&portdev->ports_lock, flags);
list_for_each_entry(port, &portdev->ports, list) {
if (port->cdev->dev == dev) {
kref_get(&port->kref);
goto out;
}
}... | 0 | [
"CWE-119",
"CWE-787"
] | linux | c4baad50297d84bde1a7ad45e50c73adae4a2192 | 84,993,731,660,233,460,000,000,000,000,000,000,000 | 19 | virtio-console: avoid DMA from stack
put_chars() stuffs the buffer it gets into an sg, but that buffer may be
on the stack. This breaks with CONFIG_VMAP_STACK=y (for me, it
manifested as printks getting turned into NUL bytes).
Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat... |
static void
php_mysqlnd_chg_user_free_mem(void * _packet)
{
MYSQLND_PACKET_CHG_USER_RESPONSE * p = (MYSQLND_PACKET_CHG_USER_RESPONSE *) _packet;
if (p->new_auth_protocol) {
mnd_efree(p->new_auth_protocol);
p->new_auth_protocol = NULL;
}
p->new_auth_protocol_len = 0;
if (p->new_auth_protocol_data) {
mnd_efr... | 0 | [
"CWE-120"
] | php-src | 58006537fc5f133ae8549efe5118cde418b3ace9 | 271,441,196,774,582,980,000,000,000,000,000,000,000 | 16 | Fix bug #81719: mysqlnd/pdo password buffer overflow |
static int create_problem_dir(GHashTable *problem_info, unsigned pid)
{
/* Exit if free space is less than 1/4 of MaxCrashReportsSize */
if (g_settings_nMaxCrashReportsSize > 0)
{
if (low_free_space(g_settings_nMaxCrashReportsSize, g_settings_dump_location))
exit(1);
}
/* Create... | 0 | [
"CWE-59"
] | abrt | 3287aa12eb205cff95cdd00d6d6c5c9a4f8f0eca | 55,552,207,652,961,720,000,000,000,000,000,000,000 | 98 | daemon: allow only root user to trigger the post-create
There is no reason to allow non-root users to trigger this
functionality. Regular users can create abrt problems only through
abrtd or abrt-dbus and both triggers the post-create.
Other hooks run under root user (CCpp, Koops, VMCore, Xorg).
Related: #1212861
S... |
ruby_brace_glob(const char *str, int flags, ruby_glob_func *func, VALUE arg)
{
return ruby_brace_glob_with_enc(str, flags, func, arg, rb_ascii8bit_encoding());
} | 0 | [
"CWE-22"
] | ruby | bd5661a3cbb38a8c3a3ea10cd76c88bbef7871b8 | 38,980,868,164,645,204,000,000,000,000,000,000,000 | 4 | dir.c: check NUL bytes
* dir.c (GlobPathValue): should be used in rb_push_glob only.
other methods should use FilePathValue.
https://hackerone.com/reports/302338
* dir.c (rb_push_glob): expand GlobPathValue
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
static uint32_t pmac_ide_readb (void *opaque,hwaddr addr)
{
uint8_t retval;
MACIOIDEState *d = opaque;
addr = (addr & 0xFFF) >> 4;
switch (addr) {
case 1 ... 7:
retval = ide_ioport_read(&d->bus, addr);
break;
case 8:
case 22:
retval = ide_status_read(&d->bus, 0);
... | 0 | [
"CWE-399"
] | qemu | 3251bdcf1c67427d964517053c3d185b46e618e8 | 218,918,376,404,484,780,000,000,000,000,000,000,000 | 20 | ide: Correct handling of malformed/short PRDTs
This impacts both BMDMA and AHCI HBA interfaces for IDE.
Currently, we confuse the difference between a PRDT having
"0 bytes" and a PRDT having "0 complete sectors."
When we receive an incomplete sector, inconsistent error checking
leads to an infinite loop wherein the c... |
gpointer ves_icall_System_Threading_Interlocked_Exchange_IntPtr (gpointer *location, gpointer value)
{
return InterlockedExchangePointer(location, value);
} | 0 | [
"CWE-399",
"CWE-264"
] | mono | 722f9890f09aadfc37ae479e7d946d5fc5ef7b91 | 151,517,026,235,807,340,000,000,000,000,000,000,000 | 4 | Fix access to freed members of a dead thread
* threads.c: Fix access to freed members of a dead thread. Found
and fixed by Rodrigo Kumpera <rkumpera@novell.com>
Ref: CVE-2011-0992 |
XML_SetHashSalt(XML_Parser parser,
unsigned long hash_salt)
{
if (parser == NULL)
return 0;
if (parser->m_parentParser)
return XML_SetHashSalt(parser->m_parentParser, hash_salt);
/* block after XML_Parse()/XML_ParseBuffer() has been called */
if (ps_parsing == XML_PARSING || ps_parsing =... | 0 | [
"CWE-611"
] | libexpat | c4bf96bb51dd2a1b0e185374362ee136fe2c9d7f | 36,234,042,634,467,543,000,000,000,000,000,000,000 | 13 | xmlparse.c: Fix external entity infinite loop bug (CVE-2017-9233) |
/* {{{ PHP_MINFO_FUNCTION */
PHP_MINFO_FUNCTION(date)
{
const timelib_tzdb *tzdb = DATE_TIMEZONEDB;
php_info_print_table_start();
php_info_print_table_row(2, "date/time support", "enabled");
php_info_print_table_row(2, "\"Olson\" Timezone Database Version", tzdb->version);
php_info_print_table_row(2, "Timezone D... | 0 | [] | php-src | bb057498f7457e8b2eba98332a3bad434de4cf12 | 63,304,932,125,577,780,000,000,000,000,000,000,000 | 13 | Fix #70277: new DateTimeZone($foo) is ignoring text after null byte
The DateTimeZone constructors are not binary safe. They're parsing the timezone
as string, but discard the length when calling timezone_initialize(). This
patch adds a tz_len parameter and a respective check to timezone_initialize(). |
CImg<T>& operator-=(const t value) {
if (is_empty()) return *this;
cimg_openmp_for(*this,*ptr - value,524288);
return *this;
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 84,562,763,518,050,270,000,000,000,000,000,000,000 | 5 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
void addReplySubcommandSyntaxError(client *c) {
sds cmd = sdsnew((char*) c->argv[0]->ptr);
sdstoupper(cmd);
addReplyErrorFormat(c,
"Unknown subcommand or wrong number of arguments for '%s'. Try %s HELP.",
(char*)c->argv[1]->ptr,cmd);
sdsfree(cmd);
} | 0 | [
"CWE-770"
] | redis | 5674b0057ff2903d43eaff802017eddf37c360f8 | 290,784,718,142,523,050,000,000,000,000,000,000,000 | 8 | Prevent unauthenticated client from easily consuming lots of memory (CVE-2021-32675)
This change sets a low limit for multibulk and bulk length in the
protocol for unauthenticated connections, so that they can't easily
cause redis to allocate massive amounts of memory by sending just a few
characters on the network.
T... |
static int request_pre_handler(REQUEST *request)
{
int rcode;
rad_assert(request->magic == REQUEST_MAGIC);
rad_assert(request->packet != NULL);
request->child_state = REQUEST_RUNNING;
/*
* Don't decode the packet if it's an internal "fake"
* request. Instead, just return so that the caller can
* process ... | 0 | [
"CWE-399"
] | freeradius-server | ff94dd35673bba1476594299d31ce8293b8bd223 | 197,140,585,099,280,300,000,000,000,000,000,000,000 | 76 | Do not delete "old" requests until they are free.
If the request is in the queue for 30+ seconds, do NOT delete it.
Instead, mark it as "STOP PROCESSING", and do "wait_for_child_to_die",
which waits for a child thread to pick it up, and acknowledge that it's
done. Once it's marked done, we can finally clean it up.
T... |
static ZIPARCHIVE_METHOD(getCommentIndex)
{
struct zip *intern;
zval *self = getThis();
zend_long index, flags = 0;
const char * comment;
int comment_len = 0;
struct zip_stat sb;
if (!self) {
RETURN_FALSE;
}
ZIP_FROM_OBJECT(intern, self);
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l",
&index, &fla... | 0 | [
"CWE-190"
] | php-src | 3b8d4de300854b3517c7acb239b84f7726c1353c | 245,564,168,528,771,200,000,000,000,000,000,000,000 | 24 | Fix bug #71923 - integer overflow in ZipArchive::getFrom* |
static void dump_summary (WavpackContext *wpc, char *name, FILE *dst)
{
uint32_t channel_mask = (uint32_t) WavpackGetChannelMask (wpc);
int num_channels = WavpackGetNumChannels (wpc);
unsigned char md5_sum [16];
char modes [80];
fprintf (dst, "\n");
if (name && *name != '-') {
fprintf ... | 0 | [
"CWE-476",
"CWE-703"
] | WavPack | 25b4a2725d8568212e7cf89ca05ca29d128af7ac | 51,852,012,862,238,620,000,000,000,000,000,000,000 | 257 | issue #121: NULL pointer dereference in wvunpack.c
* check for NULL pointer before dereferencing in wvunpack.c
* sanitize custom extensions to be alphanumeric only |
dns_zone_setaltxfrsource6dscp(dns_zone_t *zone, isc_dscp_t dscp) {
REQUIRE(DNS_ZONE_VALID(zone));
LOCK_ZONE(zone);
zone->altxfrsource6dscp = dscp;
UNLOCK_ZONE(zone);
return (ISC_R_SUCCESS);
} | 0 | [
"CWE-327"
] | bind9 | f09352d20a9d360e50683cd1d2fc52ccedcd77a0 | 334,118,540,512,654,860,000,000,000,000,000,000,000 | 9 | Update keyfetch_done compute_tag check
If in keyfetch_done the compute_tag fails (because for example the
algorithm is not supported), don't crash, but instead ignore the
key. |
const char *get_slot_tokenlabel(pkcs11_handle_t *h)
{
return h->slots[h->current_slot].label;
} | 0 | [] | pam_pkcs11 | cc51b3e2720ea862d500cab2ea517518ff39a497 | 92,063,436,292,776,950,000,000,000,000,000,000,000 | 4 | verify using a nonce from the system, not the card
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting the problem. |
static void nf_tables_set_notify(const struct nft_ctx *ctx,
const struct nft_set *set, int event,
gfp_t gfp_flags)
{
struct nftables_pernet *nft_net = nft_pernet(ctx->net);
u32 portid = ctx->portid;
struct sk_buff *skb;
u16 flags = 0;
int err;
if (!ctx->report &&
!nfnetlink_has_listeners(ct... | 0 | [] | net | 520778042ccca019f3ffa136dd0ca565c486cedd | 170,830,293,280,602,250,000,000,000,000,000,000,000 | 32 | netfilter: nf_tables: disallow non-stateful expression in sets earlier
Since 3e135cd499bf ("netfilter: nft_dynset: dynamic stateful expression
instantiation"), it is possible to attach stateful expressions to set
elements.
cd5125d8f518 ("netfilter: nf_tables: split set destruction in deactivate
and destroy phase") in... |
ast_for_async_funcdef(struct compiling *c, const node *n, asdl_seq *decorator_seq)
{
/* async_funcdef: ASYNC funcdef */
REQ(n, async_funcdef);
REQ(CHILD(n, 0), ASYNC);
REQ(CHILD(n, 1), funcdef);
return ast_for_funcdef_impl(c, n, decorator_seq,
true /* is_async */);
} | 0 | [
"CWE-125"
] | cpython | a4d78362397fc3bced6ea80fbc7b5f4827aec55e | 243,200,966,982,781,500,000,000,000,000,000,000,000 | 10 | bpo-36495: Fix two out-of-bounds array reads (GH-12641)
Research and fix by @bradlarsen. |
int tls_parse_all_extensions(SSL *s, int context, RAW_EXTENSION *exts, X509 *x,
size_t chainidx, int fin)
{
size_t i, numexts = OSSL_NELEM(ext_defs);
const EXTENSION_DEFINITION *thisexd;
/* Calculate the number of extensions in the extensions list */
numexts += s->cert->cus... | 0 | [
"CWE-476"
] | openssl | fb9fa6b51defd48157eeb207f52181f735d96148 | 268,334,502,183,987,800,000,000,000,000,000,000,000 | 34 | ssl sigalg extension: fix NULL pointer dereference
As the variable peer_sigalgslen is not cleared on ssl rehandshake, it's
possible to crash an openssl tls secured server remotely by sending a
manipulated hello message in a rehandshake.
On such a manipulated rehandshake, tls1_set_shared_sigalgs() calls
tls12_shared_s... |
isodate7(const unsigned char *v)
{
struct tm tm;
int offset;
time_t t;
memset(&tm, 0, sizeof(tm));
tm.tm_year = v[0];
tm.tm_mon = v[1] - 1;
tm.tm_mday = v[2];
tm.tm_hour = v[3];
tm.tm_min = v[4];
tm.tm_sec = v[5];
/* v[6] is the signed timezone offset, in 1/4-hour increments. */
offset = ((const signed cha... | 0 | [
"CWE-125"
] | libarchive | f9569c086ff29259c73790db9cbf39fe8fb9d862 | 52,737,155,189,138,690,000,000,000,000,000,000,000 | 24 | iso9660: validate directory record length |
static int snd_pcm_action_group(const struct action_ops *ops,
struct snd_pcm_substream *substream,
snd_pcm_state_t state,
bool do_lock)
{
struct snd_pcm_substream *s = NULL;
struct snd_pcm_substream *s1;
int res = 0, depth = 1;
snd_pcm_group_for_each_entry(s, substream) {
if (do_lock && s != substrea... | 0 | [
"CWE-125"
] | linux | 92ee3c60ec9fe64404dc035e7c41277d74aa26cb | 257,905,684,544,547,800,000,000,000,000,000,000,000 | 54 | ALSA: pcm: Fix races among concurrent hw_params and hw_free calls
Currently we have neither proper check nor protection against the
concurrent calls of PCM hw_params and hw_free ioctls, which may result
in a UAF. Since the existing PCM stream lock can't be used for
protecting the whole ioctl operations, we need a new... |
SetHostIP(tcps_sess_t *pThis, prop_t *ip)
{
DEFiRet;
ISOBJ_TYPE_assert(pThis, tcps_sess);
if(pThis->fromHostIP != NULL) {
prop.Destruct(&pThis->fromHostIP);
}
pThis->fromHostIP = ip;
RETiRet;
} | 0 | [
"CWE-787"
] | rsyslog | 89955b0bcb1ff105e1374aad7e0e993faa6a038f | 190,912,179,000,014,220,000,000,000,000,000,000,000 | 11 | net bugfix: potential buffer overrun |
DEFUN (neighbor_attr_unchanged,
neighbor_attr_unchanged_cmd,
NEIGHBOR_CMD2 "attribute-unchanged",
NEIGHBOR_STR
NEIGHBOR_ADDR_STR2
"BGP attribute is propagated unchanged to this neighbor\n")
{
return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty),
bgp_node_safi (vty... | 0 | [
"CWE-125"
] | frr | 6d58272b4cf96f0daa846210dd2104877900f921 | 196,154,784,991,685,530,000,000,000,000,000,000,000 | 13 | [bgpd] cleanup, compact and consolidate capability parsing code
2007-07-26 Paul Jakma <paul.jakma@sun.com>
* (general) Clean up and compact capability parsing slightly.
Consolidate validation of length and logging of generic TLV, and
memcpy of capability data, thus removing such from cap specifc
code (not a... |
static noinline int hiddev_ioctl_usage(struct hiddev *hiddev, unsigned int cmd, void __user *user_arg)
{
struct hid_device *hid = hiddev->hid;
struct hiddev_report_info rinfo;
struct hiddev_usage_ref_multi *uref_multi = NULL;
struct hiddev_usage_ref *uref;
struct hid_report *report;
struct hid_field *field;
int ... | 0 | [
"CWE-119",
"CWE-787"
] | linux | 93a2001bdfd5376c3dc2158653034c20392d15c5 | 63,651,797,369,670,480,000,000,000,000,000,000,000 | 118 | HID: hiddev: validate num_values for HIDIOCGUSAGES, HIDIOCSUSAGES commands
This patch validates the num_values parameter from userland during the
HIDIOCGUSAGES and HIDIOCSUSAGES commands. Previously, if the report id was set
to HID_REPORT_ID_UNKNOWN, we would fail to validate the num_values parameter
leading to a heap... |
void gf_prompt_set_echo_off(Bool echo_off) {
return;
} | 0 | [
"CWE-787"
] | gpac | f3698bb1bce62402805c3fda96551a23101a32f9 | 48,939,106,452,969,245,000,000,000,000,000,000,000 | 3 | fix buffer overrun in gf_bin128_parse
closes #1204
closes #1205 |
set_option_sctx_idx(int opt_idx, int opt_flags, sctx_T script_ctx)
{
int both = (opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0;
int indir = (int)options[opt_idx].indir;
sctx_T new_script_ctx = script_ctx;
// Modeline already has the line number set.
if (!(opt_flags & OPT_MODELINE))
new_script_ctx.s... | 0 | [
"CWE-122",
"CWE-787"
] | vim | 652dee448618589de5528a9e9a36995803f5557a | 226,687,660,247,157,480,000,000,000,000,000,000,000 | 28 | patch 8.2.4245: ":retab 0" may cause illegal memory access
Problem: ":retab 0" may cause illegal memory access.
Solution: Limit the value of 'tabstop' to 10000. |
bgp_af_caps_cmp(const void *X, const void *Y)
{
const struct bgp_af_caps *x = X, *y = Y;
return (x->afi < y->afi) ? -1 : (x->afi > y->afi) ? 1 : 0;
} | 0 | [
"CWE-787"
] | bird | 8388f5a7e14108a1458fea35bfbb5a453e2c563c | 240,985,969,765,081,250,000,000,000,000,000,000,000 | 5 | BGP: Fix bugs in handling of shutdown messages
There is an improper check for valid message size, which may lead to
stack overflow and buffer leaks to log when a large message is received.
Thanks to Daniel McCarney for bugreport and analysis. |
bool InstanceKlass::is_shareable() const {
#if INCLUDE_CDS
ClassLoaderData* loader_data = class_loader_data();
if (!SystemDictionaryShared::is_sharing_possible(loader_data)) {
return false;
}
if (is_hidden()) {
return false;
}
if (module()->is_patched()) {
return false;
}
return true;
#el... | 0 | [] | jdk17u | f8eb9abe034f7c6bea4da05a9ea42017b3f80730 | 133,524,477,604,584,970,000,000,000,000,000,000,000 | 20 | 8270386: Better verification of scan methods
Reviewed-by: coleenp
Backport-of: ac329cef45979bd0159ecd1347e36f7129bb2ce4 |
static void k_shift(struct vc_data *vc, unsigned char value, char up_flag)
{
int old_state = shift_state;
if (rep)
return;
/*
* Mimic typewriter:
* a CapsShift key acts like Shift but undoes CapsLock
*/
if (value == KVAL(K_CAPSSHIFT)) {
value = KVAL(K_SHIFT);
if (!up_flag)
clr_vc_kbd_led(kbd, VC_CAP... | 0 | [
"CWE-416"
] | linux | 6ca03f90527e499dd5e32d6522909e2ad390896b | 201,935,807,462,165,700,000,000,000,000,000,000,000 | 40 | vt: keyboard, simplify vt_kdgkbsent
Use 'strlen' of the string, add one for NUL terminator and simply do
'copy_to_user' instead of the explicit 'for' loop. This makes the
KDGKBSENT case more compact.
The only thing we need to take care about is NULL 'func_table[i]'. Use
an empty string in that case.
The original che... |
inf_gtk_certificate_manager_get_property(GObject* object,
guint prop_id,
GValue* value,
GParamSpec* pspec)
{
InfGtkCertificateManager* manager;
InfGtkCertificateManagerPrivate* priv;
manager... | 0 | [
"CWE-295"
] | libinfinity | c97f870f5ae13112988d9f8ad464b4f679903706 | 122,859,806,732,077,510,000,000,000,000,000,000,000 | 27 | Fix expired certificate validation (gobby #61) |
static int brcmf_msgbuf_stats_read(struct seq_file *seq, void *data)
{
struct brcmf_bus *bus_if = dev_get_drvdata(seq->private);
struct brcmf_pub *drvr = bus_if->drvr;
struct brcmf_msgbuf *msgbuf = (struct brcmf_msgbuf *)drvr->proto->pd;
struct brcmf_commonring *commonring;
u16 i;
struct brcmf_flowring_ring *ring... | 0 | [
"CWE-20"
] | linux | a4176ec356c73a46c07c181c6d04039fafa34a9f | 135,758,406,844,348,100,000,000,000,000,000,000,000 | 47 | brcmfmac: add subtype check for event handling in data path
For USB there is no separate channel being used to pass events
from firmware to the host driver and as such are passed over the
data path. In order to detect mock event messages an additional
check is needed on event subtype. This check is added conditionally... |
GF_ISOMVVCType gf_isom_get_vvc_type(GF_ISOFile *the_file, u32 trackNumber, u32 DescriptionIndex)
{
u32 type;
GF_TrackBox *trak;
GF_MPEGVisualSampleEntryBox *entry;
trak = gf_isom_get_track_from_file(the_file, trackNumber);
if (!trak || !trak->Media || !DescriptionIndex) return GF_ISOM_VVCTYPE_NONE;
if (!gf_isom_i... | 0 | [
"CWE-617",
"CWE-703"
] | gpac | 9ea93a2ec8f555ceed1ee27294cf94822f14f10f | 31,267,079,412,536,456,000,000,000,000,000,000,000 | 35 | fixed #2165 |
filter_push(fz_context *ctx, pdf_filter_processor *p)
{
filter_gstate *gstate = p->gstate;
filter_gstate *new_gstate = fz_malloc_struct(ctx, filter_gstate);
*new_gstate = *gstate;
new_gstate->pushed = 0;
new_gstate->next = gstate;
p->gstate = new_gstate;
pdf_keep_font(ctx, new_gstate->pending.text.font);
pdf_k... | 0 | [
"CWE-125"
] | mupdf | 97096297d409ec6f206298444ba00719607e8ba8 | 212,652,825,254,749,500,000,000,000,000,000,000,000 | 12 | Bug 701292: Fix test for missing/empty string. |
static int vc_con_write_normal(struct vc_data *vc, int tc, int c,
struct vc_draw_region *draw)
{
int next_c;
unsigned char vc_attr = vc->vc_attr;
u16 himask = vc->vc_hi_font_mask, charmask = himask ? 0x1ff : 0xff;
u8 width = 1;
bool inverse = false;
if (vc->vc_utf && !vc->vc_disp_ctrl) {
if (is_double_width(... | 0 | [
"CWE-125"
] | linux | 3c4e0dff2095c579b142d5a0693257f1c58b4804 | 72,291,433,864,689,730,000,000,000,000,000,000,000 | 97 | vt: Disable KD_FONT_OP_COPY
It's buggy:
On Fri, Nov 06, 2020 at 10:30:08PM +0800, Minh Yuan wrote:
> We recently discovered a slab-out-of-bounds read in fbcon in the latest
> kernel ( v5.10-rc2 for now ). The root cause of this vulnerability is that
> "fbcon_do_set_font" did not handle "vc->vc_font.data" and
> "vc->... |
cssp_read_tsrequest(STREAM token, STREAM pubkey)
{
STREAM s;
int length;
int tagval;
struct stream packet;
s = tcp_recv(NULL, 4);
if (s == NULL)
return False;
// verify ASN.1 header
if (s->p[0] != (BER_TAG_SEQUENCE | BER_TAG_CONSTRUCTED))
{
error("Expected BER_TAG_SEQUENCE|BER_TAG_CONSTRUCTED, got %x", ... | 0 | [
"CWE-787"
] | rdesktop | 766ebcf6f23ccfe8323ac10242ae6e127d4505d2 | 142,788,657,982,244,910,000,000,000,000,000,000,000 | 105 | Malicious RDP server security fixes
This commit includes fixes for a set of 21 vulnerabilities in
rdesktop when a malicious RDP server is used.
All vulnerabilities was identified and reported by Eyal Itkin.
* Add rdp_protocol_error function that is used in several fixes
* Refactor of process_bitmap_updates
* Fix pos... |
static int prepend(char **buffer, int *buflen, const char *str, int namelen)
{
*buflen -= namelen;
if (*buflen < 0)
return -ENAMETOOLONG;
*buffer -= namelen;
memcpy(*buffer, str, namelen);
return 0;
} | 0 | [
"CWE-362",
"CWE-399"
] | linux | 49d31c2f389acfe83417083e1208422b4091cd9e | 325,674,698,219,276,800,000,000,000,000,000,000,000 | 9 | dentry name snapshots
take_dentry_name_snapshot() takes a safe snapshot of dentry name;
if the name is a short one, it gets copied into caller-supplied
structure, otherwise an extra reference to external name is grabbed
(those are never modified). In either case the pointer to stable
string is stored into the same st... |
static int compat_getdrvprm(int drive,
struct compat_floppy_drive_params __user *arg)
{
struct compat_floppy_drive_params v;
memset(&v, 0, sizeof(struct compat_floppy_drive_params));
mutex_lock(&floppy_mutex);
v.cmos = UDP->cmos;
v.max_dtr = UDP->max_dtr;
v.hlt = UDP->hlt;
v.hut = UDP->hut;
v.srt = UDP-... | 0 | [
"CWE-125"
] | linux | 2e90ca68b0d2f5548804f22f0dd61145516171e3 | 252,527,219,732,336,050,000,000,000,000,000,000,000 | 32 | floppy: check FDC index for errors before assigning it
Jordy Zomer reported a KASAN out-of-bounds read in the floppy driver in
wait_til_ready().
Which on the face of it can't happen, since as Willy Tarreau points out,
the function does no particular memory access. Except through the FDCS
macro, which just indexes a ... |
void incNumConnections() override { ++num_listener_connections_; } | 1 | [
"CWE-400"
] | envoy | dfddb529e914d794ac552e906b13d71233609bf7 | 138,043,373,633,916,600,000,000,000,000,000,000,000 | 1 | listener: Add configurable accepted connection limits (#153)
Add support for per-listener limits on accepted connections.
Signed-off-by: Tony Allen <tony@allen.gg> |
funcdepth_decrement(void)
{
--funcdepth;
} | 0 | [
"CWE-416"
] | vim | 9c23f9bb5fe435b28245ba8ac65aa0ca6b902c04 | 93,352,055,876,780,220,000,000,000,000,000,000,000 | 4 | patch 8.2.3902: Vim9: double free with nested :def function
Problem: Vim9: double free with nested :def function.
Solution: Pass "line_to_free" from compile_def_function() and make sure
cmdlinep is valid. |
CAMLexport value caml_alloc (mlsize_t wosize, tag_t tag)
{
value result;
mlsize_t i;
Assert (tag < 256);
Assert (tag != Infix_tag);
if (wosize == 0){
result = Atom (tag);
}else if (wosize <= Max_young_wosize){
Alloc_small (result, wosize, tag);
if (tag < No_scan_tag){
for (i = 0; i < wosi... | 0 | [
"CWE-200"
] | ocaml | 659615c7b100a89eafe6253e7a5b9d84d0e8df74 | 290,979,981,197,824,150,000,000,000,000,000,000,000 | 23 | fix PR#7003 and a few other bugs caused by misuse of Int_val
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16525 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 |
static void gf_dump_vrml_sffield(GF_SceneDumper *sdump, u32 type, void *ptr, Bool is_mf, GF_Node *node)
{
switch (type) {
case GF_SG_VRML_SFBOOL:
gf_fprintf(sdump->trace, "%s", * ((SFBool *)ptr) ? "true" : "false");
break;
case GF_SG_VRML_SFINT32:
gf_fprintf(sdump->trace, "%d", * ((SFInt32 *)ptr) );
break;
... | 0 | [
"CWE-476"
] | gpac | 0102c5d4db7fdbf08b5b591b2a6264de33867a07 | 114,250,990,107,172,660,000,000,000,000,000,000,000 | 218 | fixed #2232 |
number_format(int value)
{
const char *result = "%d";
if ((outform != F_TERMCAP) && (value > 255)) {
unsigned long lv = (unsigned long) value;
unsigned long mm;
int bits = sizeof(unsigned long) * 8;
int nn;
for (nn = 8; nn < bits; ++nn) {
mm = 1UL << nn;
if ((mm - 16) <= lv && (mm + 16) > lv) {
... | 0 | [
"CWE-125"
] | ncurses | b025434573f466efe27862656a6a9d41dd2bd609 | 85,666,894,564,340,300,000,000,000,000,000,000,000 | 18 | ncurses 6.1 - patch 20191012
+ amend recent changes to ncurses*-config and pc-files to filter out
Debian linker-flags (report by Sven Joachim, cf: 20150516).
+ clarify relationship between tic, infocmp and captoinfo in manpage.
+ check for invalid hashcode in _nc_find_type_entry and
_nc_find_name_entry.
> fix seve... |
static void free_all_urbs(pegasus_t *pegasus)
{
usb_free_urb(pegasus->intr_urb);
usb_free_urb(pegasus->tx_urb);
usb_free_urb(pegasus->rx_urb);
} | 0 | [
"CWE-119",
"CWE-284"
] | linux | 5593523f968bc86d42a035c6df47d5e0979b5ace | 100,068,339,774,553,920,000,000,000,000,000,000,000 | 6 | pegasus: Use heap buffers for all register access
Allocating USB buffers on the stack is not portable, and no longer
works on x86_64 (with VMAP_STACK enabled as per default).
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
References: https://bugs.debian.org/852556
Reported-by: Lisandro Damián Nicanor Pérez Meyer <lisandro@... |
TEST_F(ConnectionManagerUtilityTest, ExternalAddressExternalRequestDontUseRemote) {
connection_.stream_info_.downstream_address_provider_->setRemoteAddress(
std::make_shared<Network::Address::Ipv4Instance>("60.0.0.2"));
ON_CALL(config_, useRemoteAddress()).WillByDefault(Return(false));
TestRequestHeaderMapI... | 0 | [
"CWE-22"
] | envoy | 5333b928d8bcffa26ab19bf018369a835f697585 | 252,465,646,548,115,980,000,000,000,000,000,000,000 | 12 | Implement handling of escaped slash characters in URL path
Fixes: CVE-2021-29492
Signed-off-by: Yan Avlasov <yavlasov@google.com> |
static int avic_update_access_page(struct kvm *kvm, bool activate)
{
int ret = 0;
mutex_lock(&kvm->slots_lock);
/*
* During kvm_destroy_vm(), kvm_pit_set_reinject() could trigger
* APICv mode change, which update APIC_ACCESS_PAGE_PRIVATE_MEMSLOT
* memory region. So, we need to ensure that kvm->mm == current->... | 0 | [
"CWE-401"
] | linux | d80b64ff297e40c2b6f7d7abc1b3eba70d22a068 | 157,794,681,911,344,800,000,000,000,000,000,000,000 | 26 | 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... |
S3BootScriptSaveInformationAsciiString (
IN CONST CHAR8 *String
)
{
return S3BootScriptSaveInformation (
(UINT32) AsciiStrLen (String) + 1,
(VOID*) String
);
}
| 0 | [
"CWE-787"
] | edk2 | 322ac05f8bbc1bce066af1dabd1b70ccdbe28891 | 252,187,189,627,006,840,000,000,000,000,000,000,000 | 9 | MdeModulePkg/PiDxeS3BootScriptLib: Fix potential numeric truncation (CVE-2019-14563)
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2001
For S3BootScriptLib APIs:
S3BootScriptSaveIoWrite
S3BootScriptSaveMemWrite
S3BootScriptSavePciCfgWrite
S3BootScriptSavePciCfg2Write
S3BootScriptSaveSmbusExecute
S3BootScriptSav... |
authority_cert_dup(authority_cert_t *cert)
{
authority_cert_t *out = tor_malloc(sizeof(authority_cert_t));
tor_assert(cert);
memcpy(out, cert, sizeof(authority_cert_t));
/* Now copy pointed-to things. */
out->cache_info.signed_descriptor_body =
tor_strndup(cert->cache_info.signed_descriptor_body,
... | 0 | [] | tor | 973c18bf0e84d14d8006a9ae97fde7f7fb97e404 | 120,210,053,465,161,470,000,000,000,000,000,000,000 | 16 | Fix assertion failure in tor_timegm.
Fixes bug 6811. |
PrepareRowForJpeg24(rfbClientPtr cl,
uint8_t *dst,
int x,
int y,
int count)
{
uint32_t *fbptr;
uint32_t pix;
fbptr = (uint32_t *)
&cl->scaledScreen->frameBuffer[y * cl->scaledScreen->paddedWidthInBytes + x * 4];
wh... | 0 | [] | libvncserver | 804335f9d296440bb708ca844f5d89b58b50b0c6 | 243,152,270,095,818,230,000,000,000,000,000,000,000 | 19 | Thread safety for zrle, zlib, tight.
Proposed tight security type fix for debian bug 517422. |
static void *genlocaldata(void *_gt,int32 *len) {
GTextField *gt = _gt;
unichar_t *temp =u_copyn(gt->text+gt->sel_start,gt->sel_end-gt->sel_start);
char *ret = u2def_copy(temp);
free(temp);
*len = strlen(ret);
return( ret );
} | 0 | [
"CWE-119",
"CWE-787"
] | fontforge | 626f751752875a0ddd74b9e217b6f4828713573c | 38,723,697,737,586,907,000,000,000,000,000,000,000 | 8 | Warn users before discarding their unsaved scripts (#3852)
* Warn users before discarding their unsaved scripts
This closes #3846. |
static int compare_vavail(const void *v1, const void *v2)
{
struct vavailability *a = (struct vavailability *) v1;
struct vavailability *b = (struct vavailability *) v2;
int r = a->priority - b->priority;
if (r == 0) {
r = icaltime_compare(a->per.start, b->per.start);
if (r == 0) r = icaltime_compa... | 0 | [
"CWE-787"
] | cyrus-imapd | a5779db8163b99463e25e7c476f9cbba438b65f3 | 5,702,954,791,148,625,000,000,000,000,000,000,000 | 15 | HTTP: don't overrun buffer when parsing strings with sscanf() |
void cil_destroy_bounds(struct cil_bounds *bounds)
{
if (bounds == NULL) {
return;
}
free(bounds);
} | 0 | [
"CWE-125"
] | selinux | 340f0eb7f3673e8aacaf0a96cbfcd4d12a405521 | 268,863,753,618,851,320,000,000,000,000,000,000,000 | 8 | libsepol/cil: Check for statements not allowed in optional blocks
While there are some checks for invalid statements in an optional
block when resolving the AST, there are no checks when building the
AST.
OSS-Fuzz found the following policy which caused a null dereference
in cil_tree_get_next_path().
(blockinherit ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.