func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
ex_copymove(exarg_T *eap)
{
long n;
n = get_address(eap, &eap->arg, eap->addr_type, FALSE, FALSE, FALSE, 1);
if (eap->arg == NULL) /* error detected */
{
eap->nextcmd = NULL;
return;
}
get_flags(eap);
/*
* move or copy lines from 'eap->line1'-'eap->line2' to below line 'n'
... | 0 | [
"CWE-78"
] | vim | 8c62a08faf89663e5633dc5036cd8695c80f1075 | 208,058,506,371,070,370,000,000,000,000,000,000,000 | 32 | patch 8.1.0881: can execute shell commands in rvim through interfaces
Problem: Can execute shell commands in rvim through interfaces.
Solution: Disable using interfaces in restricted mode. Allow for writing
file with writefile(), histadd() and a few others. |
int dm_persistent_snapshot_init(void)
{
int r;
r = dm_exception_store_type_register(&_persistent_type);
if (r) {
DMERR("Unable to register persistent exception store type");
return r;
}
r = dm_exception_store_type_register(&_persistent_compat_type);
if (r) {
DMERR("Unable to register old-style persistent ... | 0 | [
"CWE-200",
"CWE-264"
] | linux | e9c6a182649f4259db704ae15a91ac820e63b0ca | 82,986,400,929,692,140,000,000,000,000,000,000,000 | 20 | dm snapshot: fix data corruption
This patch fixes a particular type of data corruption that has been
encountered when loading a snapshot's metadata from disk.
When we allocate a new chunk in persistent_prepare, we increment
ps->next_free and we make sure that it doesn't point to a metadata area
by further incrementin... |
static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh,
struct nlattr **attrs)
{
return -ENOPROTOOPT;
} | 0 | [
"CWE-264"
] | net | 90f62cf30a78721641e08737bda787552428061e | 181,206,357,605,625,000,000,000,000,000,000,000,000 | 5 | 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.
... |
serialize_message (GstRTSPConnection * conn, GstRTSPMessage * message,
GstRTSPSerializedMessage * serialized_message)
{
GString *str = NULL;
memset (serialized_message, 0, sizeof (*serialized_message));
/* Initially we borrow the body_data / body_buffer fields from
* the message */
serialized_message->... | 0 | [] | gst-plugins-base | f672277509705c4034bc92a141eefee4524d15aa | 143,831,146,970,938,440,000,000,000,000,000,000,000 | 131 | gstrtspconnection: Security loophole making heap overflow
The former code allowed an attacker to create a heap overflow by
sending a longer than allowed session id in a response and including a
semicolon to change the maximum length. With this change, the parser
will never go beyond 512 bytes. |
static void v4l_print_edid(const void *arg, bool write_only)
{
const struct v4l2_edid *p = arg;
pr_cont("pad=%u, start_block=%u, blocks=%u\n",
p->pad, p->start_block, p->blocks);
} | 0 | [
"CWE-401"
] | linux | fb18802a338b36f675a388fc03d2aa504a0d0899 | 338,852,082,746,367,900,000,000,000,000,000,000,000 | 7 | 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... |
int OSD::get_num_op_shards()
{
if (cct->_conf->osd_op_num_shards)
return cct->_conf->osd_op_num_shards;
if (store_is_rotational)
return cct->_conf->osd_op_num_shards_hdd;
else
return cct->_conf->osd_op_num_shards_ssd;
} | 0 | [
"CWE-287",
"CWE-284"
] | ceph | 5ead97120e07054d80623dada90a5cc764c28468 | 42,246,614,258,642,017,000,000,000,000,000,000,000 | 9 | auth/cephx: add authorizer challenge
Allow the accepting side of a connection to reject an initial authorizer
with a random challenge. The connecting side then has to respond with an
updated authorizer proving they are able to decrypt the service's challenge
and that the new authorizer was produced for this specific ... |
static inline uint32_t _ring_remain_contrib(pmixp_coll_ring_ctx_t *coll_ctx)
{
return coll_ctx->coll->peers_cnt -
(coll_ctx->contrib_prev + coll_ctx->contrib_local);
} | 0 | [
"CWE-120"
] | slurm | c3142dd87e06621ff148791c3d2f298b5c0b3a81 | 255,145,371,967,181,870,000,000,000,000,000,000,000 | 5 | PMIx - fix potential buffer overflows from use of unpackmem().
CVE-2020-27745. |
static void stbi__out_gif_code(stbi__gif *g, stbi__uint16 code)
{
stbi_uc *p, *c;
int idx;
// recurse to decode the prefixes, since the linked-list is backwards,
// and working backwards through an interleaved image would be nasty
if (g->codes[code].prefix >= 0)
stbi__out_gif_code(g, g->codes[code... | 0 | [
"CWE-787"
] | stb | 5ba0baaa269b3fd681828e0e3b3ac0f1472eaf40 | 28,882,458,600,625,334,000,000,000,000,000,000,000 | 36 | stb_image: Reject fractional JPEG component subsampling ratios
The component resamplers are not written to support this and I've
never seen it happen in a real (non-crafted) JPEG file so I'm
fine rejecting this as outright corrupt.
Fixes issue #1178. |
main (int argc, char **argv)
{
g_test_init (&argc, &argv, NULL);
g_test_add_data_func_full ("/errors/non_svg_element",
"335-non-svg-element.svg",
test_loading_error,
NULL);
g_test_add_data_func_full ("/errors/inst... | 0 | [
"CWE-400"
] | librsvg | 572f95f739529b865e2717664d6fefcef9493135 | 141,692,109,201,656,470,000,000,000,000,000,000,000 | 27 | (#515) - Add a limit for the number of loaded elements
This fixes the last part of #515, an enormous SVG file with millions
of elements, which causes out-of-memory.
To avoid unbounded memory consumption, we'll set a hard limit on the
number of loaded elements. The largest legitimate file I have is a
map rendering wi... |
static bool anal_fcn_del_bb(RCore *core, const char *input) {
ut64 addr = r_num_math (core->num, input);
if (!addr) {
addr = core->offset;
}
RAnalFunction *fcn = r_anal_get_fcn_in (core->anal, addr, -1);
if (fcn) {
if (!strcmp (input, "*")) {
r_list_free (fcn->bbs);
fcn->bbs = NULL;
} else {
RAnalBl... | 0 | [
"CWE-125",
"CWE-787"
] | radare2 | a1bc65c3db593530775823d6d7506a457ed95267 | 219,175,630,209,262,200,000,000,000,000,000,000,000 | 26 | Fix #12375 - Crash in bd+ao (#12382) |
bool agg_item_collations(DTCollation &c, const char *fname,
Item **av, uint count, uint flags, int item_sep)
{
uint i;
Item **arg;
bool unknown_cs= 0;
c.set(av[0]->collation);
for (i= 1, arg= &av[item_sep]; i < count; i++, arg+= item_sep)
{
if (c.aggregate((*arg)->collation, fl... | 0 | [] | server | b000e169562697aa072600695d4f0c0412f94f4f | 114,854,473,713,247,940,000,000,000,000,000,000,000 | 44 | Bug#26361149 MYSQL SERVER CRASHES AT: COL IN(IFNULL(CONST, COL), NAME_CONST('NAME', NULL))
based on:
commit f7316aa0c9a
Author: Ajo Robert <ajo.robert@oracle.com>
Date: Thu Aug 24 17:03:21 2017 +0530
Bug#26361149 MYSQL SERVER CRASHES AT: COL IN(IFNULL(CONST,
COL), NAME_CONST('NAME'... |
static void rb_wake_up_waiters(struct irq_work *work)
{
struct rb_irq_work *rbwork = container_of(work, struct rb_irq_work, work);
wake_up_all(&rbwork->waiters);
if (rbwork->wakeup_full) {
rbwork->wakeup_full = false;
wake_up_all(&rbwork->full_waiters);
}
} | 0 | [
"CWE-190"
] | linux-stable | 59643d1535eb220668692a5359de22545af579f6 | 251,006,290,945,147,200,000,000,000,000,000,000,000 | 10 | ring-buffer: Prevent overflow of size in ring_buffer_resize()
If the size passed to ring_buffer_resize() is greater than MAX_LONG - BUF_PAGE_SIZE
then the DIV_ROUND_UP() will return zero.
Here's the details:
# echo 18014398509481980 > /sys/kernel/debug/tracing/buffer_size_kb
tracing_entries_write() processes this... |
void WebContents::AttachToIframe(content::WebContents* embedder_web_contents,
int embedder_frame_id) {
if (guest_delegate_)
guest_delegate_->AttachToIframe(embedder_web_contents, embedder_frame_id);
} | 0 | [
"CWE-284",
"CWE-693"
] | electron | 18613925610ba319da7f497b6deed85ad712c59b | 256,894,562,082,183,840,000,000,000,000,000,000,000 | 5 | refactor: wire will-navigate up to a navigation throttle instead of OpenURL (#25108)
* refactor: wire will-navigate up to a navigation throttle instead of OpenURL (#25065)
* refactor: wire will-navigate up to a navigation throttle instead of OpenURL
* spec: add test for x-site _top navigation
* chore: old cod... |
xfs_seek_data(
struct file *file,
loff_t start)
{
struct inode *inode = file->f_mapping->host;
struct xfs_inode *ip = XFS_I(inode);
struct xfs_mount *mp = ip->i_mount;
loff_t uninitialized_var(offset);
xfs_fsize_t isize;
xfs_fileoff_t fsbno;
xfs_filblks_t end;
uint lock;
int error;
lock = xfs_... | 0 | [
"CWE-284",
"CWE-264"
] | linux | 8d0207652cbe27d1f962050737848e5ad4671958 | 156,671,606,395,669,340,000,000,000,000,000,000,000 | 99 | ->splice_write() via ->write_iter()
iter_file_splice_write() - a ->splice_write() instance that gathers the
pipe buffers, builds a bio_vec-based iov_iter covering those and feeds
it to ->write_iter(). A bunch of simple cases coverted to that...
[AV: fixed the braino spotted by Cyrill]
Signed-off-by: Al Viro <viro@z... |
void TinyGLTF::SetFsCallbacks(FsCallbacks callbacks) { fs = callbacks; } | 0 | [
"CWE-20"
] | tinygltf | 52ff00a38447f06a17eab1caa2cf0730a119c751 | 67,586,847,429,033,400,000,000,000,000,000,000,000 | 1 | Do not expand file path since its not necessary for glTF asset path(URI) and for security reason(`wordexp`). |
unsigned int clean_fname(char *name, int flags)
{
char *limit = name - 1, *t = name, *f = name;
int anchored;
if (!name)
return 0;
if ((anchored = *f == '/') != 0) {
*t++ = *f++;
#ifdef __CYGWIN__
/* If there are exactly 2 slashes at the start, preserve
* them. Would break daemon excludes unless the pat... | 1 | [
"CWE-59"
] | rsync | 4cad402ea8a91031f86c53961d78bb7f4f174790 | 4,711,104,640,039,367,000,000,000,000,000,000,000 | 63 | Receiver now rejects invalid filenames in filelist.
If the receiver gets a filename with a leading slash (w/o --relative)
and/or a filename with an embedded ".." dir in the path, it dies with
an error (rather than continuing). Those invalid paths should never
happen in reality, so just reject someone trying to pull a ... |
static void pdf_parseobj(struct pdf_struct *pdf, struct pdf_obj *obj)
{
/* enough to hold common pdf names, we don't need all the names */
char pdfname[64];
const char *q2, *q3;
const char *q = obj->start + pdf->map;
const char *dict, *start;
off_t dict_length;
off_t bytesleft = obj_size(pdf... | 1 | [
"CWE-119",
"CWE-189",
"CWE-79"
] | clamav-devel | 24ff855c82d3f5c62bc5788a5776cefbffce2971 | 269,085,714,966,241,480,000,000,000,000,000,000,000 | 142 | pdf: bb #7053 |
static int kvm_get_stat_per_vcpu(struct kvm *kvm, size_t offset, u64 *val)
{
unsigned long i;
struct kvm_vcpu *vcpu;
*val = 0;
kvm_for_each_vcpu(i, vcpu, kvm)
*val += *(u64 *)((void *)(&vcpu->stat) + offset);
return 0; | 0 | [
"CWE-459"
] | linux | 683412ccf61294d727ead4a73d97397396e69a6b | 7,958,271,538,531,108,000,000,000,000,000,000,000 | 12 | 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 unsigned int x25_new_lci(struct x25_neigh *nb)
{
unsigned int lci = 1;
struct sock *sk;
while ((sk = x25_find_socket(lci, nb)) != NULL) {
sock_put(sk);
if (++lci == 4096) {
lci = 0;
break;
}
cond_resched();
}
return lci;
} | 0 | [] | net | 7781607938c8371d4c2b243527430241c62e39c2 | 119,827,092,404,316,320,000,000,000,000,000,000,000 | 16 | net/x25: Fix null-ptr-deref caused by x25_disconnect
When the link layer is terminating, x25->neighbour will be set to NULL
in x25_disconnect(). As a result, it could cause null-ptr-deref bugs in
x25_sendmsg(),x25_recvmsg() and x25_connect(). One of the bugs is
shown below.
(Thread 1) | (Thread 2... |
int imap_sync_message_for_copy (IMAP_DATA *idata, HEADER *hdr, BUFFER *cmd,
int *err_continue)
{
char flags[LONG_STRING];
char uid[11];
if (!compare_flags_for_copy (hdr))
{
if (hdr->deleted == HEADER_DATA(hdr)->deleted)
hdr->changed = 0;
return 0;
}
snprintf (... | 0 | [
"CWE-200",
"CWE-319"
] | mutt | 3e88866dc60b5fa6aaba6fd7c1710c12c1c3cd01 | 227,784,161,352,878,000,000,000,000,000,000,000,000 | 74 | Prevent possible IMAP MITM via PREAUTH response.
This is similar to CVE-2014-2567 and CVE-2020-12398. STARTTLS is not
allowed in the Authenticated state, so previously Mutt would
implicitly mark the connection as authenticated and skip any
encryption checking/enabling.
No credentials are exposed, but it does allow m... |
template<typename t>
CImg<T>& correlate(const CImg<t>& kernel, const bool boundary_conditions=true,
const bool is_normalized=false) {
if (is_empty() || !kernel) return *this;
return get_correlate(kernel,boundary_conditions,is_normalized).move_to(*this); | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 22,120,118,745,550,683,000,000,000,000,000,000,000 | 5 | Fix other issues in 'CImg<T>::load_bmp()'. |
parse_command_modifiers(
exarg_T *eap,
char **errormsg,
cmdmod_T *cmod,
int skip_only)
{
char_u *p;
int starts_with_colon = FALSE;
CLEAR_POINTER(cmod);
// Repeat until no more command modifiers are found.
for (;;)
{
while (*eap->cmd == ' ' || *eap->cmd == '\t' || *eap-... | 0 | [
"CWE-122"
] | vim | 35a319b77f897744eec1155b736e9372c9c5575f | 316,093,868,286,259,660,000,000,000,000,000,000,000 | 292 | patch 8.2.3489: ml_get error after search with range
Problem: ml_get error after search with range.
Solution: Limit the line number to the buffer line count. |
read_pbm_integer (j_compress_ptr cinfo, FILE * infile, int maxval)
/* Read an unsigned decimal integer from the PPM file */
/* Swallows one trailing character after the integer */
/* Note that on a 16-bit-int machine, only values up to 64k can be read. */
/* This should not be a problem in practice. */
{
register int... | 0 | [] | libjpeg-turbo | 6709e4a0cfa44d4f54ee8ad05753d4aa9260cb91 | 90,108,032,712,533,670,000,000,000,000,000,000,000 | 30 | Check range of integer values in PPM text file
Add checks to ensure values are within the specified range.
Fixes mozilla/mozjpeg#141, closes #8 |
void CIRCNetwork::IRCConnected() {
const SCString& ssCaps = m_pIRCSock->GetAcceptedCaps();
for (CClient* pClient : m_vClients) {
pClient->NotifyServerDependentCaps(ssCaps);
}
if (m_uJoinDelay > 0) {
m_pJoinTimer->Delay(m_uJoinDelay);
} else {
JoinChans();
}
} | 0 | [
"CWE-20"
] | znc | 64613bc8b6b4adf1e32231f9844d99cd512b8973 | 282,217,946,065,039,330,000,000,000,000,000,000,000 | 11 | Don't crash if user specified invalid encoding.
This is CVE-2019-9917 |
static int wait_for_discard(void *word)
{
schedule();
return 0;
} | 0 | [
"CWE-264"
] | linux-2.6 | 1a5a9906d4e8d1976b701f889d8f35d54b928f25 | 227,079,549,082,471,730,000,000,000,000,000,000,000 | 5 | mm: thp: fix pmd_bad() triggering in code paths holding mmap_sem read mode
In some cases it may happen that pmd_none_or_clear_bad() is called with
the mmap_sem hold in read mode. In those cases the huge page faults can
allocate hugepmds under pmd_none_or_clear_bad() and that can trigger a
false positive from pmd_bad(... |
void FilterManager::addStreamDecoderFilterWorker(StreamDecoderFilterSharedPtr filter,
FilterMatchStateSharedPtr match_state,
bool dual_filter) {
ActiveStreamDecoderFilterPtr wrapper(
new ActiveStreamDecoderFilter(*... | 0 | [
"CWE-416"
] | envoy | 148de954ed3585d8b4298b424aa24916d0de6136 | 40,690,717,713,057,616,000,000,000,000,000,000,000 | 23 | CVE-2021-43825
Response filter manager crash
Signed-off-by: Yan Avlasov <yavlasov@google.com> |
msg_make(char_u *arg)
{
int i;
static char_u *str = (char_u *)"eeffoc", *rs = (char_u *)"Plon#dqg#vxjduB";
arg = skipwhite(arg);
for (i = 5; *arg && i >= 0; --i)
if (*arg++ != str[i])
break;
if (i < 0)
{
msg_putchar('\n');
for (i = 0; rs[i]; ++i)
msg_putchar(rs[i] - 3);
}
} | 0 | [
"CWE-416"
] | vim | 9f1a39a5d1cd7989ada2d1cb32f97d84360e050f | 175,454,217,054,490,820,000,000,000,000,000,000,000 | 16 | patch 8.2.4040: keeping track of allocated lines is too complicated
Problem: Keeping track of allocated lines in user functions is too
complicated.
Solution: Instead of freeing individual lines keep them all until the end. |
static void sg_clean(struct usb_sg_request *io)
{
if (io->urbs) {
while (io->entries--)
usb_free_urb(io->urbs[io->entries]);
kfree(io->urbs);
io->urbs = NULL;
}
io->dev = NULL;
} | 0 | [
"CWE-119",
"CWE-787"
] | linux | 2e1c42391ff2556387b3cb6308b24f6f65619feb | 44,058,436,911,142,370,000,000,000,000,000,000,000 | 10 | 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... |
PHP_FUNCTION(rename)
{
char *old_name, *new_name;
int old_name_len, new_name_len;
zval *zcontext = NULL;
php_stream_wrapper *wrapper;
php_stream_context *context;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp|r", &old_name, &old_name_len, &new_name, &new_name_len, &zcontext) == FAILURE) {
RETURN_FAL... | 0 | [
"CWE-19"
] | php-src | be9b2a95adb504abd5acdc092d770444ad6f6854 | 256,118,738,159,710,740,000,000,000,000,000,000,000 | 33 | Fixed bug #69418 - more s->p fixes for filenames |
static void tun_poll_controller(struct net_device *dev)
{
/*
* Tun only receives frames when:
* 1) the char device endpoint gets data from user space
* 2) the tun socket gets a sendmsg call from user space
* Since both of those are syncronous operations, we are guaranteed
* never to have pending data when we... | 0 | [
"CWE-703",
"CWE-264"
] | linux | 550fd08c2cebad61c548def135f67aba284c6162 | 62,434,171,949,456,990,000,000,000,000,000,000,000 | 15 | net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared
After the last patch, We are left in a state in which only drivers calling
ether_setup have IFF_TX_SKB_SHARING set (we assume that drivers touching real
hardware call ether_setup for their net_devices and don't hold any state in
their skbs. There... |
char *FS_BuildOSPath( const char *base, const char *game, const char *qpath ) {
char temp[MAX_OSPATH];
static char ospath[2][MAX_OSPATH];
static int toggle;
toggle ^= 1; // flip-flop to allow two returns without clash
if( !game || !game[0] ) {
game = fs_gamedir;
}
Com_sprintf( temp, sizeof(temp), "/%s/%s"... | 0 | [
"CWE-269"
] | ioq3 | 376267d534476a875d8b9228149c4ee18b74a4fd | 109,906,846,088,019,200,000,000,000,000,000,000,000 | 17 | Don't load .pk3s as .dlls, and don't load user config files from .pk3s. |
nfs_access_calc_mask(u32 access_result, umode_t umode)
{
int mask = 0;
if (access_result & NFS_MAY_READ)
mask |= MAY_READ;
if (S_ISDIR(umode)) {
if ((access_result & NFS_DIR_MAY_WRITE) == NFS_DIR_MAY_WRITE)
mask |= MAY_WRITE;
if ((access_result & NFS_MAY_LOOKUP) == NFS_MAY_LOOKUP)
mask |= MAY_EXEC;
} e... | 0 | [
"CWE-909"
] | linux | ac795161c93699d600db16c1a8cc23a65a1eceaf | 243,372,133,820,074,430,000,000,000,000,000,000,000 | 20 | NFSv4: Handle case where the lookup of a directory fails
If the application sets the O_DIRECTORY flag, and tries to open a
regular file, nfs_atomic_open() will punt to doing a regular lookup.
If the server then returns a regular file, we will happily return a
file descriptor with uninitialised open state.
The fix is ... |
static int getDbSize(void) {
redisReply *reply;
int size;
reply = redisCommand(context, "DBSIZE");
if(reply == NULL || reply->type != REDIS_REPLY_INTEGER) {
fprintf(stderr, "Couldn't determine DBSIZE!\n");
exit(1);
}
/* Grab the number of keys and free our reply */
size = ... | 0 | [
"CWE-119",
"CWE-787"
] | redis | 9fdcc15962f9ff4baebe6fdd947816f43f730d50 | 39,011,630,314,257,030,000,000,000,000,000,000,000 | 17 | Security: fix redis-cli buffer overflow.
Thanks to Fakhri Zulkifli for reporting it.
The fix switched to dynamic allocation, copying the final prompt in the
static buffer only at the end. |
GC_INNER GC_bool GC_gww_dirty_init(void)
{
detect_GetWriteWatch();
return GC_GWW_AVAILABLE();
} | 0 | [
"CWE-119"
] | bdwgc | 7292c02fac2066d39dd1bcc37d1a7054fd1e32ee | 64,259,189,295,706,690,000,000,000,000,000,000,000 | 5 | Fix malloc routines to prevent size value wrap-around
See issue #135 on Github.
* allchblk.c (GC_allochblk, GC_allochblk_nth): Use
OBJ_SZ_TO_BLOCKS_CHECKED instead of OBJ_SZ_TO_BLOCKS.
* malloc.c (GC_alloc_large): Likewise.
* alloc.c (GC_expand_hp_inner): Type of "bytes" local variable changed
from word to size_t; ca... |
TEST(IndexBoundsBuilderTest,
TranslateElemMatchValueNotEqualToNullShouldBuildInexactBoundsIfIndexIsMultiKey) {
BSONObj indexPattern = BSON("a" << 1);
auto testIndex = buildSimpleIndexEntry(indexPattern);
testIndex.multikey = true;
BSONObj obj = BSON("a" << BSON("$elemMatch" << BSON("$ne" << BSONNU... | 0 | [
"CWE-754"
] | mongo | f8f55e1825ee5c7bdb3208fc7c5b54321d172732 | 21,908,765,666,017,690,000,000,000,000,000,000,000 | 18 | SERVER-44377 generate correct plan for indexed inequalities to null |
void uwsgi_heartbeat() {
if (!uwsgi.has_emperor)
return;
time_t now = uwsgi_now();
if (uwsgi.next_heartbeat <= now) {
char byte = 26;
if (write(uwsgi.emperor_fd, &byte, 1) != 1) {
uwsgi_error("write()");
}
uwsgi.next_heartbeat = now + uwsgi.heartbeat;
}
} | 0 | [
"CWE-119",
"CWE-703",
"CWE-787"
] | uwsgi | cb4636f7c0af2e97a4eef7a3cdcbd85a71247bfe | 274,603,956,512,155,500,000,000,000,000,000,000,000 | 15 | improve uwsgi_expand_path() to sanitize input, avoiding stack corruption and potential security issue |
TRIO_PUBLIC_STRING int trio_xstring_append TRIO_ARGS2((self, other), trio_string_t* self,
TRIO_CONST char* other)
{
size_t length;
assert(self);
assert(other);
length = self->length + trio_length(other);
if (!internal_string_grow_to(self, length))
goto erro... | 0 | [
"CWE-190",
"CWE-125"
] | FreeRDP | 05cd9ea2290d23931f615c1b004d4b2e69074e27 | 202,098,875,672,176,370,000,000,000,000,000,000,000 | 18 | Fixed TrioParse and trio_length limts.
CVE-2020-4030 thanks to @antonio-morales for finding this. |
void CL_RequestMotd( void ) {
#ifdef UPDATE_SERVER_NAME
char info[MAX_INFO_STRING];
if ( !cl_motd->integer ) {
return;
}
Com_Printf( "Resolving %s\n", UPDATE_SERVER_NAME );
if ( !NET_StringToAdr( UPDATE_SERVER_NAME, &cls.updateServer, NA_IP ) ) {
Com_Printf( "Couldn't resolve address\n" );
return;
}
cls.... | 0 | [
"CWE-269"
] | ioq3 | 376267d534476a875d8b9228149c4ee18b74a4fd | 164,781,613,612,624,600,000,000,000,000,000,000,000 | 29 | Don't load .pk3s as .dlls, and don't load user config files from .pk3s. |
void IOBuf::releaseStorage(HeapStorage* storage, uint16_t freeFlags) noexcept {
CHECK_EQ(storage->prefix.magic, static_cast<uint16_t>(kHeapMagic));
// Use relaxed memory order here. If we are unlucky and happen to get
// out-of-date data the compare_exchange_weak() call below will catch
// it and load new dat... | 0 | [
"CWE-787"
] | folly | 4f304af1411e68851bdd00ef6140e9de4616f7d3 | 214,192,382,157,775,400,000,000,000,000,000,000,000 | 41 | [folly] Add additional overflow checks to IOBuf - CVE-2021-24036
Summary:
As per title
CVE-2021-24036
Reviewed By: jan
Differential Revision: D27938605
fbshipit-source-id: 7481c54ae6fbb7b67b15b3631d5357c2f7043f9c |
void isis_notif_area_mismatch(const struct isis_circuit *circuit,
const char *raw_pdu, size_t raw_pdu_len)
{
const char *xpath = "/frr-isisd:area-mismatch";
struct list *arguments = yang_data_list_new();
char xpath_arg[XPATH_MAXLEN];
struct yang_data *data;
struct isis_area *area = circuit->area;
notif_... | 1 | [
"CWE-119",
"CWE-787"
] | frr | ac3133450de12ba86c051265fc0f1b12bc57b40c | 88,553,527,372,022,140,000,000,000,000,000,000,000 | 19 | isisd: fix #10505 using base64 encoding
Using base64 instead of the raw string to encode
the binary data.
Signed-off-by: whichbug <whichbug@github.com> |
register_supported_control2(const char *controloid,
slap_mask_t controlmask,
char **controlexops,
SLAP_CTRL_PARSE_FN *controlparsefn,
unsigned flags,
int *controlcid)
{
struct slap_control *sc = NULL;
int i;
BerVarray extendedopsbv = NULL;
if ( num_known_controls >= SLAP_MAX_CIDS ) {
Debug( LDAP_DEBUG_ANY, ... | 0 | [
"CWE-125"
] | openldap | 21981053a1195ae1555e23df4d9ac68d34ede9dd | 215,566,825,690,794,140,000,000,000,000,000,000,000 | 101 | ITS#9408 fix vrfilter double-free |
_hex_decode_digit(char c)
{
switch (c) {
case '0': return 0;
case '1': return 1;
case '2': return 2;
case '3': return 3;
case '4': return 4;
case '5': return 5;
case '6': return 6;
case '7': return 7;
case '8': return 8;
case '9': return 9;
case 'A': case 'a': return 10;
... | 0 | [] | tor | 973c18bf0e84d14d8006a9ae97fde7f7fb97e404 | 15,942,340,898,760,807,000,000,000,000,000,000,000 | 23 | Fix assertion failure in tor_timegm.
Fixes bug 6811. |
PHP_FUNCTION(curl_unescape)
{
char *str = NULL, *out = NULL;
int str_len = 0, out_len;
zval *zid;
php_curl *ch;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &zid, &str, &str_len) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(ch, php_curl *, zid, -1, le_curl_name, le_curl);
if ((out =... | 0 | [] | php-src | 124fb22a13fafa3648e4e15b4f207c7096d8155e | 289,380,486,307,292,500,000,000,000,000,000,000,000 | 20 | Fixed bug #68739 #68740 #68741 |
static int hash_recvmsg(struct kiocb *unused, struct socket *sock,
struct msghdr *msg, size_t len, int flags)
{
struct sock *sk = sock->sk;
struct alg_sock *ask = alg_sk(sk);
struct hash_ctx *ctx = ask->private;
unsigned ds = crypto_ahash_digestsize(crypto_ahash_reqtfm(&ctx->req));
int err;
if (len > ds)
le... | 1 | [
"CWE-200"
] | linux | 72a763d805a48ac8c0bf48fdb510e84c12de51fe | 158,403,857,166,012,600,000,000,000,000,000,000 | 31 | crypto: algif - suppress sending source address information in recvmsg
The current code does not set the msg_namelen member to 0 and therefore
makes net/socket.c leak the local sockaddr_storage variable to userland
-- 128 bytes of kernel stack memory. Fix that.
Cc: <stable@vger.kernel.org> # 2.6.38
Signed-off-by: Mat... |
static ssize_t rx_queue_attr_store(struct kobject *kobj, struct attribute *attr,
const char *buf, size_t count)
{
const struct rx_queue_attribute *attribute = to_rx_queue_attr(attr);
struct netdev_rx_queue *queue = to_rx_queue(kobj);
if (!attribute->store)
return -EIO;
return attribute->store(queue, buf... | 0 | [
"CWE-401"
] | linux | 895a5e96dbd6386c8e78e5b78e067dcc67b7f0ab | 202,689,996,856,805,900,000,000,000,000,000,000,000 | 11 | net-sysfs: Fix mem leak in netdev_register_kobject
syzkaller report this:
BUG: memory leak
unreferenced object 0xffff88837a71a500 (size 256):
comm "syz-executor.2", pid 9770, jiffies 4297825125 (age 17.843s)
hex dump (first 32 bytes):
00 00 00 00 ad 4e ad de ff ff ff ff 00 00 00 00 .....N..........
ff ff ... |
backsql_init_search(
backsql_srch_info *bsi,
struct berval *nbase,
int scope,
time_t stoptime,
Filter *filter,
SQLHDBC dbh,
Operation *op,
SlapReply *rs,
AttributeName *attrs,
unsigned flags )
{
backsql_info *bi = (backsql_info *)op->o_bd->be_private;
int rc = LDAP_SUCCESS;
bsi-... | 0 | [
"CWE-89"
] | openldap | 40f3ae4f5c9a8baf75b237220f62c436a571d66e | 242,211,139,976,414,300,000,000,000,000,000,000,000 | 239 | ITS#9815 slapd-sql: escape filter values
Escape filter values to slapd-sql (CVE-2022-29155) |
nfp_flower_non_repr_priv_put(struct nfp_app *app, struct net_device *netdev)
{
struct nfp_flower_non_repr_priv *entry;
entry = nfp_flower_non_repr_priv_lookup(app, netdev);
if (!entry)
return;
__nfp_flower_non_repr_priv_put(entry);
} | 0 | [
"CWE-400",
"CWE-401"
] | linux | 8572cea1461a006bce1d06c0c4b0575869125fa4 | 71,746,193,617,098,300,000,000,000,000,000,000,000 | 10 | nfp: flower: prevent memory leak in nfp_flower_spawn_phy_reprs
In nfp_flower_spawn_phy_reprs, in the for loop over eth_tbl if any of
intermediate allocations or initializations fail memory is leaked.
requiered releases are added.
Fixes: b94524529741 ("nfp: flower: add per repr private data for LAG offload")
Signed-of... |
X509_ALGOR *TS_MSG_IMPRINT_get_algo(TS_MSG_IMPRINT *a)
{
return a->hash_algo;
} | 0 | [] | openssl | c7235be6e36c4bef84594aa3b2f0561db84b63d8 | 210,136,846,469,781,820,000,000,000,000,000,000,000 | 4 | RFC 3161 compliant time stamp request creation, response generation
and response verification.
Submitted by: Zoltan Glozik <zglozik@opentsa.org>
Reviewed by: Ulf Moeller |
static void __receive_buf(struct tty_struct *tty, const unsigned char *cp,
char *fp, int count)
{
struct n_tty_data *ldata = tty->disc_data;
bool preops = I_ISTRIP(tty) || (I_IUCLC(tty) && L_IEXTEN(tty));
if (ldata->real_raw)
n_tty_receive_buf_real_raw(tty, cp, fp, count);
else if (ldata->raw || (L_EXTPROC(... | 0 | [
"CWE-362"
] | tty | 4291086b1f081b869c6d79e5b7441633dc3ace00 | 269,188,642,635,148,220,000,000,000,000,000,000,000 | 39 | n_tty: Fix n_tty_write crash when echoing in raw mode
The tty atomic_write_lock does not provide an exclusion guarantee for
the tty driver if the termios settings are LECHO & !OPOST. And since
it is unexpected and not allowed to call TTY buffer helpers like
tty_insert_flip_string concurrently, this may lead to crashe... |
PrintTextTimeStamp (session *sess, char *text, time_t timestamp)
{
if (!sess)
{
if (!sess_list)
return;
sess = (session *) sess_list->data;
}
/* make sure it's valid utf8 */
if (text[0] == '\0')
{
text = g_strdup ("\n");
}
else
{
text = text_fixup_invalid_utf8 (text, -1, NULL);
}
log_write (sess... | 0 | [
"CWE-22"
] | hexchat | 15600f405f2d5bda6ccf0dd73957395716e0d4d3 | 292,401,913,398,601,570,000,000,000,000,000,000,000 | 24 | Sanitize network name for scrollback files
This prevents using invalid chars on Windows or creating directories |
xmlValidateAttributeValue2(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
const xmlChar *name, xmlAttributeType type, const xmlChar *value) {
int ret = 1;
switch (type) {
case XML_ATTRIBUTE_IDREFS:
case XML_ATTRIBUTE_IDREF:
case XML_ATTRIBUTE_ID:
case XML_ATTRIBUTE_NMTOKENS:
case XML_ATTRIBUTE_ENUMERATION:
ca... | 0 | [] | libxml2 | 932cc9896ab41475d4aa429c27d9afd175959d74 | 236,104,823,062,404,270,000,000,000,000,000,000,000 | 90 | Fix buffer size checks in xmlSnprintfElementContent
xmlSnprintfElementContent failed to correctly check the available
buffer space in two locations.
Fixes bug 781333 (CVE-2017-9047) and bug 781701 (CVE-2017-9048).
Thanks to Marcel Böhme and Thuan Pham for the report. |
catch(...)
{
cerr<<"Receiver function died with unknown exception"<<endl;
exit(1);
} | 0 | [
"CWE-787"
] | pdns | f9c57c98da1b1007a51680629b667d57d9b702b8 | 187,414,737,130,194,400,000,000,000,000,000,000,000 | 5 | dnsreplay: Bail out on a too small outgoing buffer |
set_acl(struct archive *a, int fd, const char *name,
struct archive_acl *abstract_acl,
int ae_requested_type, const char *tname)
{
int acl_type = 0;
int ae_type, ae_permset, ae_tag, ae_id;
uid_t ae_uid;
gid_t ae_gid;
const char *ae_name;
int entries;
int i;
int ret;
acl_t acl = NULL;
a... | 1 | [
"CWE-59",
"CWE-61"
] | libarchive | fba4f123cc456d2b2538f811bb831483bf336bad | 134,648,871,224,442,260,000,000,000,000,000,000,000 | 135 | Fix handling of symbolic link ACLs
On Linux ACLs on symbolic links are not supported.
We must avoid calling acl_set_file() on symbolic links as their
targets are modified instead.
While here, do not try to set default ACLs on non-directories.
Fixes #1565 |
Return an array containing the names of all clsses and interfaces defined in SPL */
PHP_FUNCTION(spl_classes)
{
array_init(return_value);
SPL_LIST_CLASSES(return_value, 0, 0, 0) | 0 | [] | php-src | b584b513983319be170f02828bc7c12850b40320 | 340,215,239,177,949,300,000,000,000,000,000,000,000 | 6 | Fixed bug #70290 (Null pointer deref (segfault) in spl_autoload via ob_start) |
Item_field::Item_field(Name_resolution_context *context_arg,
const char *db_arg,const char *table_name_arg,
const char *field_name_arg)
:Item_ident(context_arg, db_arg,table_name_arg,field_name_arg),
field(0), result_field(0), item_equal(0), no_const_subst(0),
have_... | 0 | [] | server | b000e169562697aa072600695d4f0c0412f94f4f | 167,887,356,299,727,300,000,000,000,000,000,000,000 | 13 | Bug#26361149 MYSQL SERVER CRASHES AT: COL IN(IFNULL(CONST, COL), NAME_CONST('NAME', NULL))
based on:
commit f7316aa0c9a
Author: Ajo Robert <ajo.robert@oracle.com>
Date: Thu Aug 24 17:03:21 2017 +0530
Bug#26361149 MYSQL SERVER CRASHES AT: COL IN(IFNULL(CONST,
COL), NAME_CONST('NAME'... |
bool Item_param::set_longdata(const char *str, ulong length)
{
DBUG_ENTER("Item_param::set_longdata");
/*
If client character set is multibyte, end of long data packet
may hit at the middle of a multibyte character. Additionally,
if binary log is open we must write long data value to the
binary lo... | 0 | [] | server | b000e169562697aa072600695d4f0c0412f94f4f | 6,192,151,767,234,315,000,000,000,000,000,000,000 | 30 | Bug#26361149 MYSQL SERVER CRASHES AT: COL IN(IFNULL(CONST, COL), NAME_CONST('NAME', NULL))
based on:
commit f7316aa0c9a
Author: Ajo Robert <ajo.robert@oracle.com>
Date: Thu Aug 24 17:03:21 2017 +0530
Bug#26361149 MYSQL SERVER CRASHES AT: COL IN(IFNULL(CONST,
COL), NAME_CONST('NAME'... |
static void progress_meter(int flag)
{
int notty;
if (option_mask32 & WGET_OPT_QUIET)
return;
/* Don't save progress to log file */
if (G.log_fd >= 0)
return;
if (flag == PROGRESS_START)
bb_progress_init(&G.pmt, G.curfile);
notty = bb_progress_update(&G.pmt,
G.beg_range,
G.transferred,
(G.chunk... | 0 | [
"CWE-295"
] | busybox | 45fa3f18adf57ef9d743038743d9c90573aeeb91 | 16,880,470,744,798,141,000,000,000,000,000,000,000 | 27 | wget: implement TLS verification with ENABLE_FEATURE_WGET_OPENSSL
When ENABLE_FEATURE_WGET_OPENSSL is enabled, correctly implement TLS
verification by default. And only ignore verification errors, if
--no-check-certificate was passed.
Also note, that previously OPENSSL implementation did not implement
TLS verificatio... |
void enc_untrusted_destroy_wait_queue(int32_t *const queue) {
// This is a no op on purpose. Wait queue pointers are now
// registered to be freed on enclave exit.
} | 0 | [
"CWE-787"
] | asylo | a37fb6a0e7daf30134dbbf357c9a518a1026aa02 | 337,014,115,457,301,530,000,000,000,000,000,000,000 | 4 | Check untrusted queue is in outside enclave
PiperOrigin-RevId: 333370935
Change-Id: Ic3f15d5db1302d95c7cb199b44172474fecb81ca |
cmsBool ReadPositionTable(struct _cms_typehandler_struct* self,
cmsIOHANDLER* io,
cmsUInt32Number Count,
cmsUInt32Number BaseOffset,
void *Cargo,
PositionTableEntryFn Ele... | 0 | [] | Little-CMS | 41d222df1bc6188131a8f46c32eab0a4d4cdf1b6 | 45,943,760,347,922,080,000,000,000,000,000,000,000 | 44 | Memory squeezing fix: lcms2 cmsPipeline construction
When creating a new pipeline, lcms would often try to allocate a stage
and pass it to cmsPipelineInsertStage without checking whether the
allocation succeeded. cmsPipelineInsertStage would then assert (or crash)
if it had not.
The fix here is to change cmsPipelineI... |
void Magick::Image::composite(const Image &compositeImage_,
const GravityType gravity_,const CompositeOperator compose_)
{
RectangleInfo
geometry;
modifyImage();
SetGeometry(compositeImage_.constImage(),&geometry);
GravityAdjustGeometry(columns(),rows(),gravity_,&geometry);
GetPPException;
Composite... | 0 | [
"CWE-416"
] | ImageMagick | 8c35502217c1879cb8257c617007282eee3fe1cc | 56,994,254,389,090,260,000,000,000,000,000,000,000 | 15 | Added missing return to avoid use after free. |
CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)
{
CRYPTO_RWLOCK *lock;
if ((lock = OPENSSL_zalloc(sizeof(CRITICAL_SECTION))) == NULL) {
/* Don't set error, to avoid recursion blowup. */
return NULL;
}
#if !defined(_WIN32_WCE)
/* 0x400 is the spin count value suggested in the documentation ... | 0 | [
"CWE-330"
] | openssl | 1b0fe00e2704b5e20334a16d3c9099d1ba2ef1be | 282,657,080,074,773,500,000,000,000,000,000,000,000 | 21 | drbg: ensure fork-safety without using a pthread_atfork handler
When the new OpenSSL CSPRNG was introduced in version 1.1.1,
it was announced in the release notes that it would be fork-safe,
which the old CSPRNG hadn't been.
The fork-safety was implemented using a fork count, which was
incremented by a pthread_atfork... |
static int itacns_add_prkey(sc_pkcs15_card_t *p15card,
const sc_pkcs15_id_t *id,
const char *label,
int type, unsigned int modulus_length, int usage,
const sc_path_t *path, int ref,
const sc_pkcs15_id_t *auth_id, int obj_flags)
{
sc_pkcs15_prkey_info_t ... | 0 | [
"CWE-125"
] | OpenSC | 8fe377e93b4b56060e5bbfb6f3142ceaeca744fa | 234,050,928,925,973,160,000,000,000,000,000,000,000 | 37 | fixed out of bounds reads
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting and suggesting security fixes. |
bool __eval(const char *const expression, t &res) const {
if (!expression || !*expression) { res = (t)0; return true; }
const char c = *expression;
bool is_success = false;
char sep, end;
double val,val2;
int err;
if ((c>='0' && c<='9') || c=='.') { // Possible value
... | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 301,624,895,586,817,660,000,000,000,000,000,000,000 | 63 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
set_func_read_only (name)
const char *name;
{
SHELL_VAR *entry;
entry = find_function (name);
if (entry)
VSETATTR (entry, att_readonly);
} | 0 | [] | bash | 863d31ae775d56b785dc5b0105b6d251515d81d5 | 332,402,135,048,501,700,000,000,000,000,000,000,000 | 9 | commit bash-20120224 snapshot |
SoundTouch::~SoundTouch()
{
delete pRateTransposer;
delete pTDStretch;
}
| 0 | [
"CWE-617"
] | soundtouch | 107f2c5d201a4dfea1b7f15c5957ff2ac9e5f260 | 37,954,115,121,663,436,000,000,000,000,000,000,000 | 5 | Replaced illegal-number-of-channel assertions with run-time exception |
char* LZ4_slideInputBuffer (void* LZ4_Data)
{
LZ4_stream_t_internal* lz4ds = (LZ4_stream_t_internal*)LZ4_Data;
LZ4_saveDict((LZ4_stream_t*)LZ4_Data, (char*)lz4ds->bufferStart, 64 KB);
return (char*)(lz4ds->bufferStart + 64 KB);
} | 0 | [
"CWE-20"
] | lz4 | da5373197e84ee49d75b8334d4510689731d6e90 | 326,588,112,264,985,020,000,000,000,000,000,000,000 | 8 | Fixed : issue 52 (reported by Ludwig Strigeus) |
static int selinux_socket_bind(struct socket *sock, struct sockaddr *address, int addrlen)
{
struct sock *sk = sock->sk;
struct sk_security_struct *sksec = sk->sk_security;
u16 family;
int err;
err = sock_has_perm(sk, SOCKET__BIND);
if (err)
goto out;
/* If PF_INET or PF_INET6, check name_bind permission for... | 0 | [
"CWE-349"
] | linux | fb73974172ffaaf57a7c42f35424d9aece1a5af6 | 176,671,040,644,310,630,000,000,000,000,000,000,000 | 130 | selinux: properly handle multiple messages in selinux_netlink_send()
Fix the SELinux netlink_send hook to properly handle multiple netlink
messages in a single sk_buff; each message is parsed and subject to
SELinux access control. Prior to this patch, SELinux only inspected
the first message in the sk_buff.
Cc: stab... |
static int pipe_do_rcv(struct sock *sk, struct sk_buff *skb)
{
struct pep_sock *pn = pep_sk(sk);
struct pnpipehdr *hdr = pnp_hdr(skb);
struct sk_buff_head *queue;
int err = 0;
BUG_ON(sk->sk_state == TCP_CLOSE_WAIT);
switch (hdr->message_id) {
case PNS_PEP_CONNECT_REQ:
pep_reject_conn(sk, skb, PN_PIPE_ERR_PEP... | 0 | [
"CWE-200"
] | net | bcd0f93353326954817a4f9fa55ec57fb38acbb0 | 5,739,826,000,196,975,000,000,000,000,000,000,000 | 125 | phonet: refcount leak in pep_sock_accep
sock_hold(sk) is invoked in pep_sock_accept(), but __sock_put(sk) is not
invoked in subsequent failure branches(pep_accept_conn() != 0).
Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
Link: https://lore.kernel.org/r/20211209082839.33985-1-hbh25y@gmail.com
Signed-off-by: Jakub Kic... |
nautilus_xds_dnd_is_valid_xds_context (GdkDragContext *context)
{
char *tmp;
gboolean ret;
g_return_val_if_fail (context != NULL, FALSE);
tmp = NULL;
if (context_offers_target (context, XDS_ATOM)) {
tmp = get_xds_atom_value (context);
}
ret = (tmp != NULL);
g_free (tmp);
return ret;
} | 0 | [
"CWE-22"
] | file-roller | b147281293a8307808475e102a14857055f81631 | 9,041,596,225,600,408,000,000,000,000,000,000,000 | 17 | libarchive: sanitize filenames before extracting |
is_leap_second_day(time_t when)
{
struct tm *stm;
stm = gmtime(&when);
if (!stm)
return 0;
/* Allow leap second only on the last day of June and December */
return (stm->tm_mon == 5 && stm->tm_mday == 30) ||
(stm->tm_mon == 11 && stm->tm_mday == 31);
} | 0 | [
"CWE-59"
] | chrony | e18903a6b56341481a2e08469c0602010bf7bfe3 | 82,006,868,376,166,000,000,000,000,000,000,000,000 | 12 | switch to new util file functions
Replace all fopen(), rename(), and unlink() calls with the new util
functions. |
_proto_tree_add_bits_format_value(proto_tree *tree, const int hfindex,
tvbuff_t *tvb, const guint bit_offset,
const gint no_of_bits, void *value_ptr,
gchar *value_str)
{
gint offset;
guint length;
guint8 tot_no_bits;
char *str;
guint64 value = 0;
header_field_info *hf_field;
/* We do... | 0 | [
"CWE-401"
] | wireshark | a9fc769d7bb4b491efb61c699d57c9f35269d871 | 318,765,568,275,073,200,000,000,000,000,000,000,000 | 112 | epan: Fix a memory leak.
Make sure _proto_tree_add_bits_ret_val allocates a bits array using the
packet scope, otherwise we leak memory. Fixes #17032. |
Register given function as __autoload() implementation */
PHP_FUNCTION(spl_autoload_register)
{
char *func_name, *error = NULL;
int func_name_len;
char *lc_name = NULL;
zval *zcallable = NULL;
zend_bool do_throw = 1;
zend_bool prepend = 0;
zend_function *spl_func_ptr;
autoload_func_info alfi;
zval *obj_ptr;... | 0 | [] | php-src | b584b513983319be170f02828bc7c12850b40320 | 46,010,335,834,994,150,000,000,000,000,000,000,000 | 158 | Fixed bug #70290 (Null pointer deref (segfault) in spl_autoload via ob_start) |
TPMI_SH_POLICY_Unmarshal(TPMI_SH_POLICY *target, BYTE **buffer, INT32 *size)
{
TPM_RC rc = TPM_RC_SUCCESS;
if (rc == TPM_RC_SUCCESS) {
rc = TPM_HANDLE_Unmarshal(target, buffer, size);
}
if (rc == TPM_RC_SUCCESS) {
BOOL isNotPolicySession = (*target < POLICY_SESSION_FIRST) || (*target > POLICY_S... | 1 | [
"CWE-787"
] | libtpms | 5cc98a62dc6f204dcf5b87c2ee83ac742a6a319b | 154,725,849,755,636,670,000,000,000,000,000,000,000 | 15 | tpm2: Restore original value if unmarshalled value was illegal
Restore the original value of the memory location where data from
a stream was unmarshalled and the unmarshalled value was found to
be illegal. The goal is to not keep illegal values in memory.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> |
put_callback(callback_T *cb, typval_T *tv)
{
if (cb->cb_partial != NULL)
{
tv->v_type = VAR_PARTIAL;
tv->vval.v_partial = cb->cb_partial;
++tv->vval.v_partial->pt_refcount;
}
else
{
tv->v_type = VAR_FUNC;
tv->vval.v_string = vim_strsave(cb->cb_name);
func_ref(cb->cb_name);
}
} | 0 | [
"CWE-476"
] | vim | 0f6e28f686dbb59ab3b562408ab9b2234797b9b1 | 90,944,892,498,515,210,000,000,000,000,000,000,000 | 15 | patch 8.2.4428: crash when switching tabpage while in the cmdline window
Problem: Crash when switching tabpage while in the cmdline window.
Solution: Disallow switching tabpage when in the cmdline window. |
static void output_itemized_counts(const char *prefix, int *counts)
{
static char *labels[] = { "reg", "dir", "link", "dev", "special" };
char buf[1024], *pre = " (";
int j, len = 0;
int total = counts[0];
if (total) {
counts[0] -= counts[1] + counts[2] + counts[3] + counts[4];
for (j = 0; j < 5; j++) {
if ... | 0 | [
"CWE-59"
] | rsync | 962f8b90045ab331fc04c9e65f80f1a53e68243b | 119,207,889,550,696,500,000,000,000,000,000,000,000 | 21 | Complain if an inc-recursive path is not right for its dir.
This ensures that a malicious sender can't use a just-sent
symlink as a trasnfer path. |
void kern_unmount_array(struct vfsmount *mnt[], unsigned int num)
{
unsigned int i;
for (i = 0; i < num; i++)
if (mnt[i])
real_mount(mnt[i])->mnt_ns = NULL;
synchronize_rcu_expedited();
for (i = 0; i < num; i++)
mntput(mnt[i]);
} | 0 | [
"CWE-200"
] | linux | 427215d85e8d1476da1a86b8d67aceb485eb3631 | 221,129,878,664,542,500,000,000,000,000,000,000,000 | 11 | 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: ... |
color256to88(jj)
int jj;
{
int r, g, b;
if (jj >= 232)
return (jj - 232) / 3 + 80;
if (jj >= 16)
{
jj -= 16;
r = jj / 36;
g = (jj / 6) % 6;
b = jj % 6;
return ((r + 1) / 2) * 16 + ((g + 1) / 2) * 4 + ((b + 1) / 2) + 16;
}
return jj;
} | 0 | [] | screen | c5db181b6e017cfccb8d7842ce140e59294d9f62 | 145,420,358,178,801,040,000,000,000,000,000,000,000 | 17 | ansi: add support for xterm OSC 11
It allows for getting and setting the background color. Notably, Vim uses
OSC 11 to learn whether it's running on a light or dark colored terminal
and choose a color scheme accordingly.
Tested with gnome-terminal and xterm. When called with "?" argument the
current background color ... |
_string_tailmatch(PyStringObject *self, PyObject *substr, Py_ssize_t start,
Py_ssize_t end, int direction)
{
Py_ssize_t len = PyString_GET_SIZE(self);
Py_ssize_t slen;
const char* sub;
const char* str;
if (PyString_Check(substr)) {
sub = PyString_AS_STRING(substr);
... | 0 | [
"CWE-190"
] | cpython | c3c9db89273fabc62ea1b48389d9a3000c1c03ae | 52,090,364,832,702,730,000,000,000,000,000,000,000 | 39 | [2.7] bpo-30657: Check & prevent integer overflow in PyString_DecodeEscape (#2174) |
int ipmi_si_mem_setup(struct si_sm_io *io)
{
unsigned long addr = io->addr_data;
int mapsize, idx;
if (!addr)
return -ENODEV;
io->io_cleanup = mem_cleanup;
/*
* Figure out the actual readb/readw/readl/etc routine to use based
* upon the register size.
*/
switch (io->regsize) {
case 1:
io->... | 1 | [
"CWE-416"
] | linux | 401e7e88d4ef80188ffa07095ac00456f901b8c4 | 202,451,546,649,132,730,000,000,000,000,000,000,000 | 70 | ipmi_si: fix use-after-free of resource->name
When we excute the following commands, we got oops
rmmod ipmi_si
cat /proc/ioports
[ 1623.482380] Unable to handle kernel paging request at virtual address ffff00000901d478
[ 1623.482382] Mem abort info:
[ 1623.482383] ESR = 0x96000007
[ 1623.482385] Exception class =... |
static double mp_asin(_cimg_math_parser& mp) {
return std::asin(_mp_arg(2));
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 153,520,395,473,480,000,000,000,000,000,000,000,000 | 3 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
dp_packet_get_rss_hash(struct dp_packet *p)
{
return p->rss_hash;
} | 0 | [
"CWE-400"
] | ovs | abd7a457652e6734902720fe6a5dddb3fc0d1e3b | 280,176,116,378,624,750,000,000,000,000,000,000,000 | 4 | 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... |
void ssl3_send_alert(SSL *s, int level, int desc)
{
/* Map tls/ssl alert value to correct one */
desc=s->method->ssl3_enc->alert_value(desc);
if (s->version == SSL3_VERSION && desc == SSL_AD_PROTOCOL_VERSION)
desc = SSL_AD_HANDSHAKE_FAILURE; /* SSL 3.0 does not have protocol_version alerts */
if (desc < 0) retur... | 0 | [] | openssl | 8671b898609777c95aedf33743419a523874e6e8 | 55,994,555,865,575,850,000,000,000,000,000,000,000 | 19 | Memory saving patch. |
R_API ut64 r_bin_java_calc_class_size(ut8 *bytes, ut64 size) {
RBinJavaObj *bin = R_NEW0 (RBinJavaObj);
if (!bin) {
return false;
}
RBinJavaObj *cur_bin = R_BIN_JAVA_GLOBAL_BIN;
ut64 bin_size = UT64_MAX;
if (bin) {
if (r_bin_java_load_bin (bin, bytes, size)) {
bin_size = bin->calc_size;
}
r_bin_java_fr... | 0 | [
"CWE-119",
"CWE-788"
] | radare2 | 6c4428f018d385fc80a33ecddcb37becea685dd5 | 181,776,504,353,342,970,000,000,000,000,000,000,000 | 16 | Improve boundary checks to fix oobread segfaults ##crash
* Reported by Cen Zhang via huntr.dev
* Reproducer: bins/fuzzed/javaoob-havoc.class |
isoent_find_entry(struct isoent *rootent, const char *fn)
{
#if defined(_WIN32) && !defined(__CYGWIN__)
char name[_MAX_FNAME];/* Included null terminator size. */
#elif defined(NAME_MAX) && NAME_MAX >= 255
char name[NAME_MAX+1];
#else
char name[256];
#endif
struct isoent *isoent, *np;
int l;
isoent = rootent;
n... | 0 | [
"CWE-190"
] | libarchive | 3014e19820ea53c15c90f9d447ca3e668a0b76c6 | 15,172,397,867,709,554,000,000,000,000,000,000,000 | 37 | Issue 711: Be more careful about verifying filename lengths when writing ISO9660 archives
* Don't cast size_t to int, since this can lead to overflow
on machines where sizeof(int) < sizeof(size_t)
* Check a + b > limit by writing it as
a > limit || b > limit || a + b > limit
to avoid problems when a + b wraps... |
static int airspy_set_lna_gain(struct airspy *s)
{
int ret;
u8 u8tmp;
dev_dbg(s->dev, "lna auto=%d->%d val=%d->%d\n",
s->lna_gain_auto->cur.val, s->lna_gain_auto->val,
s->lna_gain->cur.val, s->lna_gain->val);
ret = airspy_ctrl_msg(s, CMD_SET_LNA_AGC, 0, s->lna_gain_auto->val,
&u8tmp, 1);
if (ret)
goto... | 0 | [
"CWE-119"
] | media_tree | aa93d1fee85c890a34f2510a310e55ee76a27848 | 194,495,011,052,842,250,000,000,000,000,000,000,000 | 26 | media: fix airspy usb probe error path
Fix a memory leak on probe error of the airspy usb device driver.
The problem is triggered when more than 64 usb devices register with
v4l2 of type VFL_TYPE_SDR or VFL_TYPE_SUBDEV.
The memory leak is caused by the probe function of the airspy driver
mishandeling errors and not ... |
Variant f_simplexml_load_file(const String& filename,
const String& class_name /* = "SimpleXMLElement" */,
int64_t options /* = 0 */, const String& ns /* = "" */,
bool is_prefix /* = false */) {
String str = f_file_get_contents(... | 0 | [
"CWE-94"
] | hhvm | 95f96e7287effe2fcdfb9a5338d1a7e4f55b083b | 191,071,509,789,625,050,000,000,000,000,000,000,000 | 7 | Fix libxml_disable_entity_loader()
This wasn't calling requestInit and setting the libxml handler no null.
So the first time an error came along it would reset the handler from
no-op to reading again.
This is a much better fix, we set our custom handler in requestInit and
when libxml_disable_entity_loader we store th... |
TEST(IndexBoundsBuilderTest, TranslateInArray) {
auto testIndex = buildSimpleIndexEntry();
BSONObj obj = fromjson("{a: {$in: [[1], 2]}}");
auto expr = parseMatchExpression(obj);
BSONElement elt = obj.firstElement();
OrderedIntervalList oil;
IndexBoundsBuilder::BoundsTightness tightness;
Inde... | 0 | [
"CWE-754"
] | mongo | f8f55e1825ee5c7bdb3208fc7c5b54321d172732 | 3,938,890,895,108,579,000,000,000,000,000,000,000 | 18 | SERVER-44377 generate correct plan for indexed inequalities to null |
GF_Err trpy_Read(GF_Box *s, GF_BitStream *bs)
{
GF_TRPYBox *ptr = (GF_TRPYBox *)s;
ptr->nbBytes = gf_bs_read_u64(bs);
return GF_OK;
} | 0 | [
"CWE-400",
"CWE-401"
] | gpac | d2371b4b204f0a3c0af51ad4e9b491144dd1225c | 122,699,260,013,728,920,000,000,000,000,000,000,000 | 6 | prevent dref memleak on invalid input (#1183) |
static void icpt_operexc_on_all_vcpus(struct kvm *kvm)
{
unsigned int i;
struct kvm_vcpu *vcpu;
kvm_for_each_vcpu(i, vcpu, kvm) {
kvm_s390_sync_request(KVM_REQ_ICPT_OPEREXC, vcpu);
}
} | 0 | [
"CWE-416"
] | linux | 0774a964ef561b7170d8d1b1bfe6f88002b6d219 | 304,554,216,738,853,480,000,000,000,000,000,000,000 | 9 | KVM: Fix out of range accesses to memslots
Reset the LRU slot if it becomes invalid when deleting a memslot to fix
an out-of-bounds/use-after-free access when searching through memslots.
Explicitly check for there being no used slots in search_memslots(), and
in the caller of s390's approximation variant.
Fixes: 369... |
ConnStateData::fakeAConnectRequest(const char *reason, const SBuf &payload)
{
debugs(33, 2, "fake a CONNECT request to force connState to tunnel for " << reason);
SBuf connectHost;
assert(transparent());
const unsigned short connectPort = clientConnection->local.port();
#if USE_OPENSSL
if (!tlsCli... | 0 | [
"CWE-444"
] | squid | fd68382860633aca92065e6c343cfd1b12b126e7 | 37,941,181,277,180,195,000,000,000,000,000,000,000 | 27 | Improve Transfer-Encoding handling (#702)
Reject messages containing Transfer-Encoding header with coding other
than chunked or identity. Squid does not support other codings.
For simplicity and security sake, also reject messages where
Transfer-Encoding contains unnecessary complex values that are
technically equiva... |
//! Wait for any event occuring either on the display \c disp1, \c disp2 or \c disp3.
static void wait(CImgDisplay& disp1, CImgDisplay& disp2, CImgDisplay& disp3) {
disp1._is_event = disp2._is_event = disp3._is_event = false;
while ((!disp1._is_closed || !disp2._is_closed || !disp3._is_closed) &&
... | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 50,631,264,096,020,880,000,000,000,000,000,000,000 | 5 | Fix other issues in 'CImg<T>::load_bmp()'. |
static void free_chmap(struct snd_pcm_str *pstr)
{
if (pstr->chmap_kctl) {
snd_ctl_remove(pstr->pcm->card, pstr->chmap_kctl);
pstr->chmap_kctl = NULL;
}
} | 0 | [
"CWE-416"
] | linux | 362bca57f5d78220f8b5907b875961af9436e229 | 189,448,880,213,832,150,000,000,000,000,000,000,000 | 7 | ALSA: pcm: prevent UAF in snd_pcm_info
When the device descriptor is closed, the `substream->runtime` pointer
is freed. But another thread may be in the ioctl handler, case
SNDRV_CTL_IOCTL_PCM_INFO. This case calls snd_pcm_info_user() which
calls snd_pcm_info() which accesses the now freed `substream->runtime`.
Note:... |
compat_do_ip6t_set_ctl(struct sock *sk, int cmd, void __user *user,
unsigned int len)
{
int ret;
if (!capable(CAP_NET_ADMIN))
return -EPERM;
switch (cmd) {
case IP6T_SO_SET_REPLACE:
ret = compat_do_replace(sock_net(sk), user, len);
break;
case IP6T_SO_SET_ADD_COUNTERS:
ret = do_add_counters(soc... | 0 | [
"CWE-200"
] | linux-2.6 | 6a8ab060779779de8aea92ce3337ca348f973f54 | 198,001,297,170,412,270,000,000,000,000,000,000,000 | 24 | ipv6: netfilter: ip6_tables: fix infoleak to userspace
Structures ip6t_replace, compat_ip6t_replace, and xt_get_revision are
copied from userspace. Fields of these structs that are
zero-terminated strings are not checked. When they are used as argument
to a format string containing "%s" in request_module(), some sen... |
GF_Err stsg_Write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
u32 i;
GF_SubTrackSampleGroupBox *ptr = (GF_SubTrackSampleGroupBox *)s;
e = gf_isom_full_box_write(s, bs);
if (e) return e;
gf_bs_write_u32(bs, ptr->grouping_type);
gf_bs_write_u16(bs, ptr->nb_groups);
for (i = 0; i < ptr->nb_groups; i++) {
gf_bs_wri... | 0 | [
"CWE-125"
] | gpac | bceb03fd2be95097a7b409ea59914f332fb6bc86 | 1,193,630,634,723,646,500,000,000,000,000,000,000 | 15 | fixed 2 possible heap overflows (inc. #1088) |
eval_to_string_safe(
char_u *arg,
int use_sandbox,
int keep_script_version)
{
char_u *retval;
funccal_entry_T funccal_entry;
int save_sc_version = current_sctx.sc_version;
int save_garbage = may_garbage_collect;
if (!keep_script_version)
current_sctx.sc_version = 1;
save_funcca... | 0 | [
"CWE-786",
"CWE-119",
"CWE-787"
] | vim | fe6fb267e6ee5c5da2f41889e4e0e0ac5bf4b89d | 155,432,448,606,752,100,000,000,000,000,000,000,000 | 26 | patch 8.2.4206: condition with many "(" causes a crash
Problem: Condition with many "(" causes a crash.
Solution: Limit recursion to 1000. |
autoar_extractor_start_async_thread (GTask *task,
gpointer source_object,
gpointer task_data,
GCancellable *cancellable)
{
AutoarExtractor *self = source_object;
autoar_extractor_run (self... | 0 | [
"CWE-22"
] | gnome-autoar | adb067e645732fdbe7103516e506d09eb6a54429 | 199,545,645,644,078,300,000,000,000,000,000,000,000 | 11 | AutoarExtractor: Do not extract files outside the destination dir
Currently, a malicious archive can cause that the files are extracted
outside of the destination dir. This can happen if the archive contains
a file whose parent is a symbolic link, which points outside of the
destination dir. This is potentially a secu... |
void __netif_schedule(struct Qdisc *q)
{
if (!test_and_set_bit(__QDISC_STATE_SCHED, &q->state))
__netif_reschedule(q); | 0 | [
"CWE-400",
"CWE-703"
] | linux | fac8e0f579695a3ecbc4d3cac369139d7f819971 | 7,087,094,019,609,642,000,000,000,000,000,000,000 | 5 | tunnels: Don't apply GRO to multiple layers of encapsulation.
When drivers express support for TSO of encapsulated packets, they
only mean that they can do it for one layer of encapsulation.
Supporting additional levels would mean updating, at a minimum,
more IP length fields and they are unaware of this.
No encapsul... |
TF_EXCLUSIVE_LOCKS_REQUIRED(mu_) {
if (tuple[index].has_value()) {
return errors::InvalidArgument(
"The tensor for index '", index, "' for key '", key.scalar<int64>()(),
"' was already initialized '", dtypes_.size(), "'.");
}
return Status::OK();
} | 0 | [
"CWE-125",
"CWE-824"
] | tensorflow | 532f5c5a547126c634fefd43bbad1dc6417678ac | 234,425,147,531,034,500,000,000,000,000,000,000,000 | 9 | Prevent nullptr deref in validation of indexes in map ops.
PiperOrigin-RevId: 387738023
Change-Id: I83d18d36a7b82ffd2a40b5124a4e5b4c72238f27 |
static int vop_sync_dma(struct vop_vdev *vdev, dma_addr_t dst, dma_addr_t src,
size_t len)
{
int err = 0;
struct dma_device *ddev;
struct dma_async_tx_descriptor *tx;
struct vop_info *vi = dev_get_drvdata(&vdev->vpdev->dev);
struct dma_chan *vop_ch = vi->dma_ch;
if (!vop_ch) {
err = -EBUSY;
goto error;
}... | 0 | [
"CWE-119",
"CWE-787"
] | linux | 9bf292bfca94694a721449e3fd752493856710f6 | 136,575,399,635,916,540,000,000,000,000,000,000,000 | 36 | misc: mic: Fix for double fetch security bug in VOP driver
The MIC VOP driver does two successive reads from user space to read a
variable length data structure. Kernel memory corruption can result if
the data structure changes between the two reads. This patch disallows
the chance of this happening.
Bugzilla: https:... |
inline void Tanh(const uint8* input_data, const Dims<4>& input_dims,
int32 input_zero_point, int32 input_range_radius,
int32 input_multiplier, int input_left_shift,
uint8* output_data, const Dims<4>& output_dims) {
Tanh(input_data, DimsToShape(input_dims), input_zero... | 0 | [
"CWE-703",
"CWE-835"
] | tensorflow | dfa22b348b70bb89d6d6ec0ff53973bacb4f4695 | 281,553,356,925,026,400,000,000,000,000,000,000,000 | 8 | Prevent a division by 0 in average ops.
PiperOrigin-RevId: 385184660
Change-Id: I7affd4554f9b336fca29ac68f633232c094d0bd3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.