func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
void nghttp2_header::MemoryInfo(MemoryTracker* tracker) const {
tracker->TrackFieldWithSize("name", nghttp2_rcbuf_get_buf(name).len);
tracker->TrackFieldWithSize("value", nghttp2_rcbuf_get_buf(value).len);
} | 0 | [
"CWE-416"
] | node | 7f178663ebffc82c9f8a5a1b6bf2da0c263a30ed | 72,223,796,609,695,720,000,000,000,000,000,000,000 | 4 | src: use unique_ptr for WriteWrap
This commit attempts to avoid a use-after-free error by using unqiue_ptr
and passing a reference to it.
CVE-ID: CVE-2020-8265
Fixes: https://github.com/nodejs-private/node-private/issues/227
PR-URL: https://github.com/nodejs-private/node-private/pull/238
Reviewed-By: Michael Dawson <... |
static void __ip_vs_unlink_dest(struct ip_vs_service *svc,
struct ip_vs_dest *dest,
int svcupd)
{
dest->flags &= ~IP_VS_DEST_F_AVAILABLE;
/*
* Remove it from the d-linked destination list.
*/
list_del(&dest->n_list);
svc->num_dests--;
/*
* Call the update_service function of its scheduler
*/
i... | 0 | [
"CWE-119",
"CWE-787"
] | linux | 04bcef2a83f40c6db24222b27a52892cba39dffb | 178,003,662,072,595,700,000,000,000,000,000,000,000 | 18 | ipvs: Add boundary check on ioctl arguments
The ipvs code has a nifty system for doing the size of ioctl command
copies; it defines an array with values into which it indexes the cmd
to find the right length.
Unfortunately, the ipvs code forgot to check if the cmd was in the
range that the array provides, allowing fo... |
static int mailbox_update_caldav(struct mailbox *mailbox,
const struct index_record *new)
{
struct caldav_db *caldavdb = NULL;
struct param *param;
struct body *body = NULL;
struct caldav_data *cdata = NULL;
const char *resource = NULL;
const char *sched_tag = NU... | 0 | [] | cyrus-imapd | 1d6d15ee74e11a9bd745e80be69869e5fb8d64d6 | 26,189,000,624,552,977,000,000,000,000,000,000,000 | 117 | mailbox.c/reconstruct.c: Add mailbox_mbentry_from_path() |
_g_str_shell_escape (const char *filename)
{
return _g_str_escape (filename, "$'`\"\\!?* ()[]&|:;<>#");
} | 0 | [
"CWE-22"
] | file-roller | b147281293a8307808475e102a14857055f81631 | 221,580,584,259,931,600,000,000,000,000,000,000,000 | 4 | libarchive: sanitize filenames before extracting |
int qemu_ram_resize(RAMBlock *block, ram_addr_t newsize, Error **errp)
{
const ram_addr_t unaligned_size = newsize;
assert(block);
newsize = HOST_PAGE_ALIGN(newsize);
if (block->used_length == newsize) {
/*
* We don't have to resize the ram block (which only knows aligned
* ... | 0 | [
"CWE-787"
] | qemu | 4bfb024bc76973d40a359476dc0291f46e435442 | 136,790,820,361,827,370,000,000,000,000,000,000,000 | 48 | memory: clamp cached translation in case it points to an MMIO region
In using the address_space_translate_internal API, address_space_cache_init
forgot one piece of advice that can be found in the code for
address_space_translate_internal:
/* MMIO registers can be expected to perform full-width accesses based onl... |
nfs4_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr,
struct iattr *sattr)
{
struct inode *inode = dentry->d_inode;
struct rpc_cred *cred = NULL;
struct nfs4_state *state = NULL;
int status;
if (pnfs_ld_layoutret_on_setattr(inode))
pnfs_return_layout(inode);
nfs_fattr_init(fattr);
/* Search... | 0 | [
"CWE-703",
"CWE-189"
] | linux | bf118a342f10dafe44b14451a1392c3254629a1f | 201,808,618,729,108,380,000,000,000,000,000,000,000 | 29 | NFSv4: include bitmap in nfsv4 get acl data
The NFSv4 bitmap size is unbounded: a server can return an arbitrary
sized bitmap in an FATTR4_WORD0_ACL request. Replace using the
nfs4_fattr_bitmap_maxsz as a guess to the maximum bitmask returned by a server
with the inclusion of the bitmap (xdr length plus bitmasks) and... |
void ParticipantImpl::MyRTPSParticipantListener::onParticipantDiscovery(
RTPSParticipant*,
rtps::ParticipantDiscoveryInfo&& info)
{
if (this->mp_participantimpl->mp_listener != nullptr)
{
this->mp_participantimpl->mp_listener->onParticipantDiscovery(mp_participantimpl->mp_participant, st... | 0 | [
"CWE-284"
] | Fast-DDS | d2aeab37eb4fad4376b68ea4dfbbf285a2926384 | 147,227,975,809,027,910,000,000,000,000,000,000,000 | 10 | check remote permissions (#1387)
* Refs 5346. Blackbox test
Signed-off-by: Iker Luengo <ikerluengo@eprosima.com>
* Refs 5346. one-way string compare
Signed-off-by: Iker Luengo <ikerluengo@eprosima.com>
* Refs 5346. Do not add partition separator on last partition
Signed-off-by: Iker Luengo <ikerluengo@e... |
static void pvarlist(int d, js_Ast *list)
{
while (list) {
assert(list->type == AST_LIST);
pvar(d, list->a);
list = list->b;
if (list)
comma();
}
} | 0 | [
"CWE-476"
] | mujs | f5b3c703e18725e380b83427004632e744f85a6f | 209,232,238,160,032,400,000,000,000,000,000,000,000 | 10 | Issue #161: Cope with empty programs in mujs-pp. |
list_server_status_v1(smartlist_t *routers, char **router_status_out,
int for_controller)
{
/* List of entries in a router-status style: An optional !, then an optional
* equals-suffixed nickname, then a dollar-prefixed hexdigest. */
smartlist_t *rs_entries;
time_t now = time(NULL);
tim... | 0 | [] | tor | 02e05bd74dbec614397b696cfcda6525562a4675 | 130,506,690,795,478,200,000,000,000,000,000,000,000 | 44 | When examining descriptors as a dirserver, reject ones with bad versions
This is an extra fix for bug 21278: it ensures that these
descriptors and platforms will never be listed in a legit consensus. |
static void *sysvipc_proc_start(struct seq_file *s, loff_t *pos)
{
struct ipc_proc_iter *iter = s->private;
struct ipc_proc_iface *iface = iter->iface;
struct ipc_ids *ids;
ids = &iter->ns->ids[iface->ids];
/*
* Take the lock - this will be released by the corresponding
* call to stop().
*/
down_read(&ids... | 0 | [
"CWE-362",
"CWE-401"
] | linux | b9a532277938798b53178d5a66af6e2915cb27cf | 330,706,976,145,455,820,000,000,000,000,000,000,000 | 25 | Initialize msg/shm IPC objects before doing ipc_addid()
As reported by Dmitry Vyukov, we really shouldn't do ipc_addid() before
having initialized the IPC object state. Yes, we initialize the IPC
object in a locked state, but with all the lockless RCU lookup work,
that IPC object lock no longer means that the state c... |
TEST_F(QueryPlannerTest, ShardFilterCompoundProjCovered) {
params.options = QueryPlannerParams::INCLUDE_SHARD_FILTER;
params.shardKey = BSON("a" << 1 << "b" << 1);
addIndex(BSON("a" << 1 << "b" << 1));
runQuerySortProj(fromjson("{a: 1}"), BSONObj(), fromjson("{_id: 0, a: 1, b: 1}"));
assertNumSolu... | 0 | [] | mongo | ee97c0699fd55b498310996ee002328e533681a3 | 132,556,060,129,769,600,000,000,000,000,000,000,000 | 13 | SERVER-36993 Fix crash due to incorrect $or pushdown for indexed $expr. |
addentry(struct magic_set *ms, struct magic_entry *me,
struct magic_entry_set *mset)
{
size_t i = me->mp->type == FILE_NAME ? 1 : 0;
if (mset[i].count == mset[i].max) {
struct magic_entry *mp;
mset[i].max += ALLOC_INCR;
if ((mp = CAST(struct magic_entry *,
erealloc(mset[i].me, sizeof(*mp) * mset[i].ma... | 0 | [
"CWE-17"
] | php-src | a72cd07f2983dc43a6bb35209dc4687852e53c09 | 83,038,829,292,459,530,000,000,000,000,000,000,000 | 22 | Fixed bug #68665 (Invalid free) |
static void node_init_cache_dev(struct node *node)
{
struct device *dev;
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (!dev)
return;
dev->parent = &node->dev;
dev->release = node_cache_release;
if (dev_set_name(dev, "memory_side_cache"))
goto free_dev;
if (device_register(dev))
goto free_name;
pm_runti... | 0 | [
"CWE-787"
] | linux | aa838896d87af561a33ecefea1caa4c15a68bc47 | 221,493,045,107,092,530,000,000,000,000,000,000,000 | 24 | drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions
Convert the various sprintf fmaily calls in sysfs device show functions
to sysfs_emit and sysfs_emit_at for PAGE_SIZE buffer safety.
Done with:
$ spatch -sp-file sysfs_emit_dev.cocci --in-place --max-width=80 .
And cocci script:
$ cat s... |
TEST_F(QueryPlannerTest, ElemMatchEmbeddedRegexAnd) {
addIndex(BSON("a.b" << 1));
runQuery(fromjson("{a: {$elemMatch: {b: /foo/}}, z: 1}"));
assertNumSolutions(2U);
assertSolutionExists("{cscan: {dir: 1}}");
assertSolutionExists(
"{fetch: {filter: {a:{$elemMatch:{b:/foo/}}, z:1}, node: "
... | 0 | [
"CWE-834"
] | mongo | 94d0e046baa64d1aa1a6af97e2d19bb466cc1ff5 | 72,445,536,877,277,590,000,000,000,000,000,000,000 | 10 | SERVER-38164 $or pushdown optimization does not correctly handle $not within an $elemMatch |
BOOL SQLWriteFileDSN( LPCSTR pszFileName,
LPCSTR pszAppName,
LPCSTR pszKeyName,
LPCSTR pszString )
{
HINI hIni;
char szFileName[ODBC_FILENAME_MAX+1];
if ( pszFileName[0] == '/' )
{
strncpy( szFileName, pszFileName, sizeof(szFileName) - 5 );
}
else
{
char szPath[ODBC_FILENAME_MAX+1... | 0 | [
"CWE-119",
"CWE-369"
] | unixODBC | 45ef78e037f578b15fc58938a3a3251655e71d6f | 248,206,212,645,366,900,000,000,000,000,000,000,000 | 83 | New Pre Source |
static void print_channel_netjoins(char *channel, TEMP_PRINT_REC *rec,
NETJOIN_SERVER_REC *server)
{
if (rec->nicks->len > 0)
g_string_truncate(rec->nicks, rec->nicks->len-2);
printformat(server->server, channel, MSGLEVEL_JOINS,
rec->count > netjoin_max_nicks ?
IRCTXT_NETSPLIT_JOIN_MORE : IRCTXT... | 0 | [
"CWE-416"
] | irssi | a6cae91cecba2e8cf11ed779c5da5a229472575c | 307,287,275,202,890,100,000,000,000,000,000,000,000 | 15 | Merge pull request #812 from ailin-nemui/tape-netsplit
revert netsplit print optimisation
(cherry picked from commit 7de1378dab8081932d9096e19ae3d0921e560230) |
ops_expand(regex_t* reg, int n)
{
#define MIN_OPS_EXPAND_SIZE 4
#ifdef USE_DIRECT_THREADED_CODE
enum OpCode* cp;
#endif
Operation* p;
size_t size;
if (n <= 0) n = MIN_OPS_EXPAND_SIZE;
n += reg->ops_alloc;
size = sizeof(Operation) * n;
p = (Operation* )xrealloc(reg->ops, size);
CHECK_NULL_RETURN_ME... | 0 | [
"CWE-787"
] | oniguruma | cbe9f8bd9cfc6c3c87a60fbae58fa1a85db59df0 | 165,512,964,458,113,920,000,000,000,000,000,000,000 | 34 | #207: Out-of-bounds write |
static pj_status_t decode_binary_attr(pj_pool_t *pool,
const pj_uint8_t *buf,
const pj_stun_msg_hdr *msghdr,
void **p_attr)
{
pj_stun_binary_attr *attr;
PJ_UNUSED_ARG(msghdr);
/* Create the attribute */
attr = PJ_POOL_ZALLOC_T(pool, pj_stun_binary_attr);
GETATTRHDR(b... | 0 | [
"CWE-191"
] | pjproject | 15663e3f37091069b8c98a7fce680dc04bc8e865 | 262,802,060,455,878,560,000,000,000,000,000,000,000 | 24 | Merge pull request from GHSA-2qpg-f6wf-w984 |
void tsro_del(GF_Box *s)
{
GF_TimeOffHintEntryBox *tsro = (GF_TimeOffHintEntryBox *)s;
gf_free(tsro);
} | 0 | [
"CWE-125"
] | gpac | bceb03fd2be95097a7b409ea59914f332fb6bc86 | 92,954,851,246,184,410,000,000,000,000,000,000,000 | 5 | fixed 2 possible heap overflows (inc. #1088) |
int sqlite3_fts3_init(
sqlite3 *db,
char **pzErrMsg,
const sqlite3_api_routines *pApi
){
SQLITE_EXTENSION_INIT2(pApi)
return sqlite3Fts3Init(db);
} | 0 | [
"CWE-787"
] | sqlite | c72f2fb7feff582444b8ffdc6c900c69847ce8a9 | 80,368,821,620,234,260,000,000,000,000,000,000,000 | 8 | More improvements to shadow table corruption detection in FTS3.
FossilOrigin-Name: 51525f9c3235967bc00a090e84c70a6400698c897aa4742e817121c725b8c99d |
static av_cold int vc2_encode_init(AVCodecContext *avctx)
{
Plane *p;
SubBand *b;
int i, j, level, o, shift;
VC2EncContext *s = avctx->priv_data;
s->picture_number = 0;
/* Total allowed quantization range */
s->q_ceil = MAX_QUANT_INDEX;
s->ver.major = 2;
s->ver.minor = 0;
... | 1 | [
"CWE-125"
] | FFmpeg | 94e538aebbc9f9c529e8b1f2eda860cfb8c473b1 | 15,740,811,963,427,763,000,000,000,000,000,000,000 | 156 | vc2enc_dwt: pad the temporary buffer by the slice size
Since non-Haar wavelets need to look into pixels outside the frame, we
need to pad the buffer. The old factor of two seemed to be a workaround
that fact and only padded to the left and bottom. This correctly pads
by the slice size and as such reduces memory usage ... |
int bpf_prog_new_fd(struct bpf_prog *prog)
{
int ret;
ret = security_bpf_prog(prog);
if (ret < 0)
return ret;
return anon_inode_getfd("bpf-prog", &bpf_prog_fops, prog,
O_RDWR | O_CLOEXEC);
} | 0 | [
"CWE-307"
] | linux | 350a5c4dd2452ea999cc5e1d4a8dbf12de2f97ef | 268,569,867,720,407,870,000,000,000,000,000,000,000 | 11 | bpf: Dont allow vmlinux BTF to be used in map_create and prog_load.
The syzbot got FD of vmlinux BTF and passed it into map_create which caused
crash in btf_type_id_size() when it tried to access resolved_ids. The vmlinux
BTF doesn't have 'resolved_ids' and 'resolved_sizes' initialized to save
memory. To avoid such is... |
static int packet_diag_handler_dump(struct sk_buff *skb, struct nlmsghdr *h)
{
int hdrlen = sizeof(struct packet_diag_req);
struct net *net = sock_net(skb->sk);
struct packet_diag_req *req;
if (nlmsg_len(h) < hdrlen)
return -EINVAL;
req = nlmsg_data(h);
/* Make it possible to support protocol filtering later ... | 0 | [
"CWE-264"
] | net | 90f62cf30a78721641e08737bda787552428061e | 88,894,066,946,561,400,000,000,000,000,000,000,000 | 22 | 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.
... |
struct rtable *ip_route_output_key_hash(struct net *net, struct flowi4 *fl4,
const struct sk_buff *skb)
{
__u8 tos = RT_FL_TOS(fl4);
struct fib_result res;
struct rtable *rth;
res.tclassid = 0;
res.fi = NULL;
res.table = NULL;
fl4->flowi4_iif = LOOPBACK_IFINDEX;
fl4->flowi4_tos = tos & IPTOS_RT_MASK;
f... | 0 | [
"CWE-476"
] | linux | bc3aae2bbac46dd894c89db5d5e98f7f0ef9e205 | 173,411,705,512,343,680,000,000,000,000,000,000,000 | 22 | net: check and errout if res->fi is NULL when RTM_F_FIB_MATCH is set
Syzkaller hit 'general protection fault in fib_dump_info' bug on
commit 4.13-rc5..
Guilty file: net/ipv4/fib_semantics.c
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] SMP KASAN
Modules linked... |
MagickExport Image *SwirlImage(const Image *image,double degrees,
const PixelInterpolateMethod method,ExceptionInfo *exception)
{
#define SwirlImageTag "Swirl/Image"
CacheView
*image_view,
*interpolate_view,
*swirl_view;
Image
*swirl_image;
MagickBooleanType
status;
MagickOffsetType
... | 0 | [
"CWE-119",
"CWE-703"
] | ImageMagick | 3cbfb163cff9e5b8cdeace8312e9bfee810ed02b | 219,068,101,060,279,300,000,000,000,000,000,000,000 | 174 | https://github.com/ImageMagick/ImageMagick/issues/296 |
TEST_F(QueryPlannerTest, ContainedOrPredicatesAreLeadingFields) {
addIndex(BSON("a" << 1 << "b" << 1));
addIndex(BSON("a" << 1 << "c" << 1));
runQuery(fromjson("{$and: [{a: {$gte: 0}}, {a: {$lte: 10}}, {$or: [{b: 6}, {c: 7}]}]}"));
assertNumSolutions(4);
assertSolutionExists(
"{fetch: {filt... | 0 | [] | mongo | ee97c0699fd55b498310996ee002328e533681a3 | 314,772,004,902,643,900,000,000,000,000,000,000,000 | 25 | SERVER-36993 Fix crash due to incorrect $or pushdown for indexed $expr. |
xmlSchemaAddElement(xmlSchemaParserCtxtPtr ctxt,
const xmlChar * name, const xmlChar * nsName,
xmlNodePtr node, int topLevel)
{
xmlSchemaElementPtr ret = NULL;
if ((ctxt == NULL) || (name == NULL))
return (NULL);
ret = (xmlSchemaElementPtr) xmlMalloc(sizeof(xmlSchemaEleme... | 0 | [
"CWE-134"
] | libxml2 | 4472c3a5a5b516aaf59b89be602fbce52756c3e9 | 74,842,974,226,447,890,000,000,000,000,000,000,000 | 27 | Fix some format string warnings with possible format string vulnerability
For https://bugzilla.gnome.org/show_bug.cgi?id=761029
Decorate every method in libxml2 with the appropriate
LIBXML_ATTR_FORMAT(fmt,args) macro and add some cleanups
following the reports. |
iwl_trans_pci_dump_marbh_monitor(struct iwl_trans *trans,
struct iwl_fw_error_dump_fw_mon *fw_mon_data,
u32 monitor_len)
{
u32 buf_size_in_dwords = (monitor_len >> 2);
u32 *buffer = (u32 *)fw_mon_data->data;
unsigned long flags;
u32 i;
if (!iwl_trans_grab_nic_access(trans, &flags))
return 0;
iwl_wri... | 0 | [
"CWE-476"
] | linux | 8188a18ee2e48c9a7461139838048363bfce3fef | 185,448,352,310,176,560,000,000,000,000,000,000,000 | 22 | iwlwifi: pcie: fix rb_allocator workqueue allocation
We don't handle failures in the rb_allocator workqueue allocation
correctly. To fix that, move the code earlier so the cleanup is
easier and we don't have to undo all the interrupt allocations in
this case.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Sig... |
void qemu_chr_cleanup(void)
{
CharDriverState *chr, *tmp;
QTAILQ_FOREACH_SAFE(chr, &chardevs, next, tmp) {
qemu_chr_delete(chr);
}
} | 0 | [
"CWE-416"
] | qemu | a4afa548fc6dd9842ed86639b4d37d4d1c4ad480 | 312,231,349,991,396,760,000,000,000,000,000,000,000 | 8 | char: move front end handlers in CharBackend
Since the hanlders are associated with a CharBackend, rather than the
CharDriverState, it is more appropriate to store in CharBackend. This
avoids the handler copy dance in qemu_chr_fe_set_handlers() then
mux_chr_update_read_handler(), by storing the CharBackend pointer
dir... |
free_Header(struct _7z_header_info *h)
{
free(h->emptyStreamBools);
free(h->emptyFileBools);
free(h->antiBools);
free(h->attrBools);
} | 0 | [
"CWE-190",
"CWE-125"
] | libarchive | e79ef306afe332faf22e9b442a2c6b59cb175573 | 308,996,409,623,548,370,000,000,000,000,000,000,000 | 7 | Issue #718: Fix TALOS-CAN-152
If a 7-Zip archive declares a rediculously large number of substreams,
it can overflow an internal counter, leading a subsequent memory
allocation to be too small for the substream data.
Thanks to the Open Source and Threat Intelligence project at Cisco
for reporting this issue. |
static int ldb_msg_partition(struct ldb_module *module, enum ldb_request_type optype, struct ldb_message *local, struct ldb_message *remote, const struct ldb_message *msg)
{
/* const char * const names[]; */
struct ldb_context *ldb;
unsigned int i;
int ret;
ldb = ldb_module_get_ctx(module);
for (i = 0; i < msg-... | 0 | [
"CWE-200"
] | samba | 0a3aa5f908e351201dc9c4d4807b09ed9eedff77 | 261,376,087,299,021,100,000,000,000,000,000,000,000 | 26 | CVE-2022-32746 ldb: Make use of functions for appending to an ldb_message
This aims to minimise usage of the error-prone pattern of searching for
a just-added message element in order to make modifications to it (and
potentially finding the wrong element).
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15009
Signed... |
nghttp2_stream *nghttp2_session_get_root_stream(nghttp2_session *session) {
return &session->root;
} | 0 | [] | nghttp2 | 0a6ce87c22c69438ecbffe52a2859c3a32f1620f | 305,577,120,836,818,060,000,000,000,000,000,000,000 | 3 | Add nghttp2_option_set_max_outbound_ack |
bool fix_fields(THD *thd, Item **it)
{
if ((!(*ref)->fixed && (*ref)->fix_fields(thd, ref)) ||
(*ref)->check_cols(1))
return TRUE;
return Item_ref::fix_fields(thd, it);
} | 0 | [
"CWE-617"
] | server | 2e7891080667c59ac80f788eef4d59d447595772 | 59,808,732,217,342,890,000,000,000,000,000,000,000 | 7 | MDEV-25635 Assertion failure when pushing from HAVING into WHERE of view
This bug could manifest itself after pushing a where condition over a
mergeable derived table / view / CTE DT into a grouping view / derived
table / CTE V whose item list contained set functions with constant
arguments such as MIN(2), SUM(1) etc.... |
page_objects_create(fz_context *ctx)
{
int initial_cap = 8;
page_objects *po = fz_calloc(ctx, 1, sizeof(*po) + (initial_cap-1) * sizeof(int));
po->cap = initial_cap;
po->len = 0;
return po;
} | 0 | [
"CWE-119"
] | mupdf | 520cc26d18c9ee245b56e9e91f9d4fcae02be5f0 | 258,457,390,403,722,800,000,000,000,000,000,000,000 | 9 | Bug 689699: Avoid buffer overrun.
When cleaning a pdf file, various lists (of pdf_xref_len length) are
defined early on.
If we trigger a repair during the clean, this can cause pdf_xref_len
to increase causing an overrun.
Fix this by watching for changes in the length, and checking accesses
to the list for validity.... |
static int local_chmod(FsContext *fs_ctx, V9fsPath *fs_path, FsCred *credp)
{
char *dirpath = g_path_get_dirname(fs_path->data);
char *name = g_path_get_basename(fs_path->data);
int ret = -1;
int dirfd;
dirfd = local_opendir_nofollow(fs_ctx, dirpath);
if (dirfd == -1) {
goto out;
}
... | 0 | [
"CWE-732"
] | qemu | 9c6b899f7a46893ab3b671e341a2234e9c0c060e | 246,736,702,675,256,430,000,000,000,000,000,000,000 | 27 | 9pfs: local: set the path of the export root to "."
The local backend was recently converted to using "at*()" syscalls in order
to ensure all accesses happen below the shared directory. This requires that
we only pass relative paths, otherwise the dirfd argument to the "at*()"
syscalls is ignored and the path is treat... |
nameNsPush(xmlParserCtxtPtr ctxt, const xmlChar * value,
const xmlChar *prefix, const xmlChar *URI, int nsNr)
{
if (ctxt->nameNr >= ctxt->nameMax) {
const xmlChar * *tmp;
void **tmp2;
ctxt->nameMax *= 2;
tmp = (const xmlChar * *) xmlRealloc((xmlChar * *)ctxt->nameTab,
... | 0 | [] | libxml2 | 0e1a49c8907645d2e155f0d89d4d9895ac5112b5 | 298,576,829,941,873,040,000,000,000,000,000,000,000 | 39 | Fix infinite loop in xmlStringLenDecodeEntities
When ctxt->instate == XML_PARSER_EOF,xmlParseStringEntityRef
return NULL which cause a infinite loop in xmlStringLenDecodeEntities
Found with libFuzzer.
Signed-off-by: Zhipeng Xie <xiezhipeng1@huawei.com> |
win_enter(win_T *wp, int undo_sync)
{
win_enter_ext(wp, undo_sync, FALSE, FALSE, TRUE, TRUE);
} | 0 | [
"CWE-416"
] | vim | ec66c41d84e574baf8009dbc0bd088d2bc5b2421 | 88,918,854,924,247,060,000,000,000,000,000,000,000 | 4 | patch 8.1.2136: using freed memory with autocmd from fuzzer
Problem: using freed memory with autocmd from fuzzer. (Dhiraj Mishra,
Dominique Pelle)
Solution: Avoid using "wp" after autocommands. (closes #5041) |
static int selinux_perf_event_write(struct perf_event *event)
{
struct perf_event_security_struct *perfsec = event->security;
u32 sid = current_sid();
return avc_has_perm(&selinux_state, sid, perfsec->sid,
SECCLASS_PERF_EVENT, PERF_EVENT__WRITE, NULL);
} | 0 | [
"CWE-349"
] | linux | fb73974172ffaaf57a7c42f35424d9aece1a5af6 | 168,692,656,746,770,500,000,000,000,000,000,000,000 | 8 | 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... |
int stat_file (char const *filename, struct stat *st)
{
int (*xstat)(char const *, struct stat *) =
follow_symlinks ? safe_stat : safe_lstat;
return xstat (filename, st) == 0 ? 0 : errno;
} | 0 | [
"CWE-59"
] | patch | dce4683cbbe107a95f1f0d45fabc304acfb5d71a | 295,559,184,095,980,640,000,000,000,000,000,000,000 | 7 | Don't follow symlinks unless --follow-symlinks is given
* src/inp.c (plan_a, plan_b), src/util.c (copy_to_fd, copy_file,
append_to_file): Unless the --follow-symlinks option is given, open files with
the O_NOFOLLOW flag to avoid following symlinks. So far, we were only doing
that consistently for input files.
* src/u... |
static void update_free_window_state(WINDOW_STATE_ORDER* window_state)
{
if (!window_state)
return;
free(window_state->titleInfo.string);
window_state->titleInfo.string = NULL;
free(window_state->windowRects);
window_state->windowRects = NULL;
free(window_state->visibilityRects);
window_state->visibilityRects... | 0 | [
"CWE-119",
"CWE-787"
] | FreeRDP | 445a5a42c500ceb80f8fa7f2c11f3682538033f3 | 236,067,766,267,310,970,000,000,000,000,000,000,000 | 12 | Fixed CVE-2018-8786
Thanks to Eyal Itkin from Check Point Software Technologies. |
ctrl_x_mode_not_default(void)
{
return ctrl_x_mode != CTRL_X_NORMAL;
} | 0 | [
"CWE-125"
] | vim | f12129f1714f7d2301935bb21d896609bdac221c | 202,099,326,392,583,060,000,000,000,000,000,000,000 | 4 | patch 9.0.0020: with some completion reading past end of string
Problem: With some completion reading past end of string.
Solution: Check the length of the string. |
static int tstream_tls_readv_recv(struct tevent_req *req,
int *perrno)
{
struct tstream_tls_readv_state *state =
tevent_req_data(req,
struct tstream_tls_readv_state);
struct tstream_tls *tlss =
tstream_context_data(state->stream,
struct tstream_tls);
int ret;
tlss->read.req = NULL;
ret = tsocket_si... | 0 | [] | samba | 22af043d2f20760f27150d7d469c7c7b944c6b55 | 157,324,135,715,679,150,000,000,000,000,000,000,000 | 21 | 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... |
shouldexp_replacement (s)
char *s;
{
register char *p;
for (p = s; p && *p; p++)
{
if (*p == '\\')
p++;
else if (*p == '&')
return 1;
}
return 0;
} | 0 | [] | bash | 955543877583837c85470f7fb8a97b7aa8d45e6c | 159,503,039,891,489,710,000,000,000,000,000,000,000 | 14 | bash-4.4-rc2 release |
ax88179_ethtool_get_eee(struct usbnet *dev, struct ethtool_eee *data)
{
int val;
/* Get Supported EEE */
val = ax88179_phy_read_mmd_indirect(dev, MDIO_PCS_EEE_ABLE,
MDIO_MMD_PCS);
if (val < 0)
return val;
data->supported = mmd_eee_cap_to_ethtool_sup_t(val);
/* Get advertisement EEE */
val = ax88179_... | 0 | [
"CWE-787"
] | linux | 57bc3d3ae8c14df3ceb4e17d26ddf9eeab304581 | 131,048,554,885,025,280,000,000,000,000,000,000,000 | 27 | net: usb: ax88179_178a: Fix out-of-bounds accesses in RX fixup
ax88179_rx_fixup() contains several out-of-bounds accesses that can be
triggered by a malicious (or defective) USB device, in particular:
- The metadata array (hdr_off..hdr_off+2*pkt_cnt) can be out of bounds,
causing OOB reads and (on big-endian syst... |
struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *asoc,
union sctp_addr *laddr,
struct sockaddr *addrs,
int addrcnt,
__be16 flags)
{
sctp_addip_param_t param;
struct sctp_chunk *retval;
union sctp_addr_param addr_param;
union... | 0 | [
"CWE-20",
"CWE-399"
] | linux | 9de7922bc709eee2f609cd01d98aaedc4cf5ea74 | 233,939,733,106,021,000,000,000,000,000,000,000,000 | 74 | net: sctp: fix skb_over_panic when receiving malformed ASCONF chunks
Commit 6f4c618ddb0 ("SCTP : Add paramters validity check for
ASCONF chunk") added basic verification of ASCONF chunks, however,
it is still possible to remotely crash a server by sending a
special crafted ASCONF chunk, even up to pre 2.6.12 kernels:
... |
PHPAPI int php_session_reset_id(void) /* {{{ */
{
int module_number = PS(module_number);
zval *sid, *data, *ppid;
zend_bool apply_trans_sid;
if (!PS(id)) {
php_error_docref(NULL, E_WARNING, "Cannot set session ID - session ID is not initialized");
return FAILURE;
}
if (PS(use_cookies) && PS(send_cookie)) {
... | 0 | [
"CWE-476"
] | php-src | d76f7c6c636b8240e06a1fa29eebb98ad005008a | 323,083,553,608,529,100,000,000,000,000,000,000,000 | 67 | Fix bug #79221 - Null Pointer Dereference in PHP Session Upload Progress |
template<typename t>
const CImg<T>& SVD(CImg<t>& U, CImg<t>& S, CImg<t>& V, const bool sorting=true,
const unsigned int max_iteration=40, const float lambda=0) const {
if (is_empty()) { U.assign(); S.assign(); V.assign(); }
else {
U = *this;
if (lambda!=0) {
const ... | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 72,962,033,495,698,990,000,000,000,000,000,000,000 | 141 | Fix other issues in 'CImg<T>::load_bmp()'. |
static void ext4_write_inline_data(struct inode *inode, struct ext4_iloc *iloc,
void *buffer, loff_t pos, unsigned int len)
{
struct ext4_xattr_entry *entry;
struct ext4_xattr_ibody_header *header;
struct ext4_inode *raw_inode;
int cp_len = 0;
if (unlikely(ext4_forced_shutdown(EXT4_SB(inode->i_sb))))
ret... | 0 | [
"CWE-416"
] | linux | 117166efb1ee8f13c38f9e96b258f16d4923f888 | 14,972,105,299,330,521,000,000,000,000,000,000,000 | 38 | ext4: do not allow external inodes for inline data
The inline data feature was implemented before we added support for
external inodes for xattrs. It makes no sense to support that
combination, but the problem is that there are a number of extended
attribute checks that are skipped if e_value_inum is non-zero.
Unfor... |
static GLenum translate_blend_func_advanced(enum gl_advanced_blend_mode blend)
{
switch(blend){
case BLEND_MULTIPLY: return GL_MULTIPLY_KHR;
case BLEND_SCREEN: return GL_SCREEN_KHR;
case BLEND_OVERLAY: return GL_OVERLAY_KHR;
case BLEND_DARKEN: return GL_DARKEN_KHR;
case BLEND_LIGHTEN: return GL_LIGHTE... | 0 | [
"CWE-787"
] | virglrenderer | 95e581fd181b213c2ed7cdc63f2abc03eaaa77ec | 224,578,649,548,264,200,000,000,000,000,000,000,000 | 23 | vrend: Add test to resource OOB write and fix it
v2: Also check that no depth != 1 has been send when none is due
Closes: #250
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com> |
static void hns_xgmac_get_regs(void *mac_drv, void *data)
{
u32 i = 0;
struct mac_driver *drv = (struct mac_driver *)mac_drv;
u32 *regs = data;
u64 qtmp;
/* base config registers */
regs[0] = dsaf_read_dev(drv, XGMAC_INT_STATUS_REG);
regs[1] = dsaf_read_dev(drv, XGMAC_INT_ENABLE_REG);
regs[2] = dsaf_read_dev(d... | 0 | [
"CWE-119",
"CWE-703"
] | linux | 412b65d15a7f8a93794653968308fc100f2aa87c | 330,337,152,459,619,260,000,000,000,000,000,000,000 | 237 | net: hns: fix ethtool_get_strings overflow in hns driver
hns_get_sset_count() returns HNS_NET_STATS_CNT and the data space allocated
is not enough for ethtool_get_strings(), which will cause random memory
corruption.
When SLAB and DEBUG_SLAB are both enabled, memory corruptions like the
the following can be observed ... |
int wm_SemUnlock(wm_Sem *s){
dispatch_semaphore_signal(*s);
return 0;
} | 0 | [
"CWE-787"
] | wolfMQTT | 84d4b53122e0fa0280c7872350b89d5777dabbb2 | 197,927,428,079,525,260,000,000,000,000,000,000,000 | 4 | Fix wolfmqtt-fuzzer: Null-dereference WRITE in MqttProps_Free |
char *repo_git_path(const struct repository *repo,
const char *fmt, ...)
{
struct strbuf path = STRBUF_INIT;
va_list args;
va_start(args, fmt);
do_git_path(repo, NULL, &path, fmt, args);
va_end(args);
return strbuf_detach(&path, NULL);
} | 0 | [
"CWE-20"
] | git | 7c3745fc6185495d5765628b4dfe1bd2c25a2981 | 85,650,151,209,561,680,000,000,000,000,000,000,000 | 10 | path: safeguard `.git` against NTFS Alternate Streams Accesses
Probably inspired by HFS' resource streams, NTFS supports "Alternate
Data Streams": by appending `:<stream-name>` to the file name,
information in addition to the file contents can be written and read,
information that is copied together with the file (unl... |
uint32_t readMessageEnd() {
T_VIRTUAL_CALL();
return readMessageEnd_virt();
} | 0 | [
"CWE-20"
] | thrift | cfaadcc4adcfde2a8232c62ec89870b73ef40df1 | 293,603,495,661,360,870,000,000,000,000,000,000,000 | 4 | THRIFT-3231 CPP: Limit recursion depth to 64
Client: cpp
Patch: Ben Craig <bencraig@apache.org> |
Field_medium(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg,
enum utype unireg_check_arg, const LEX_CSTRING *field_name_arg,
bool zero_arg, bool unsigned_arg)
:Field_int(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
unireg_check_arg, field_name_arg, zer... | 0 | [
"CWE-416",
"CWE-703"
] | server | 08c7ab404f69d9c4ca6ca7a9cf7eec74c804f917 | 231,194,258,878,135,460,000,000,000,000,000,000,000 | 7 | MDEV-24176 Server crashes after insert in the table with virtual
column generated using date_format() and if()
vcol_info->expr is allocated on expr_arena at parsing stage. Since
expr item is allocated on expr_arena all its containee items must be
allocated on expr_arena too. Otherwise fix_session_expr() will
encounter... |
static void vhost_disable_cross_endian(struct vhost_virtqueue *vq)
{
vq->user_be = !virtio_legacy_is_little_endian();
} | 0 | [
"CWE-120"
] | linux | 060423bfdee3f8bc6e2c1bac97de24d5415e2bc4 | 223,512,850,003,038,270,000,000,000,000,000,000,000 | 4 | vhost: make sure log_num < in_num
The code assumes log_num < in_num everywhere, and that is true as long as
in_num is incremented by descriptor iov count, and log_num by 1. However
this breaks if there's a zero sized descriptor.
As a result, if a malicious guest creates a vring desc with desc.len = 0,
it may cause th... |
GF_AVCConfig *gf_isom_avc_config_get(GF_ISOFile *the_file, u32 trackNumber, u32 DescriptionIndex)
{
GF_TrackBox *trak;
GF_MPEGVisualSampleEntryBox *entry;
trak = gf_isom_get_track_from_file(the_file, trackNumber);
if (!trak || !trak->Media || !DescriptionIndex) return NULL;
if (gf_isom_get_avc_svc_type(the_file, t... | 0 | [
"CWE-401"
] | gpac | 0a85029d694f992f3631e2f249e4999daee15cbf | 284,348,239,287,751,480,000,000,000,000,000,000,000 | 15 | fixed #1785 (fuzz) |
static ZIPARCHIVE_METHOD(unchangeArchive)
{
struct zip *intern;
zval *self = getThis();
if (!self) {
RETURN_FALSE;
}
ZIP_FROM_OBJECT(intern, self);
if (zip_unchange_archive(intern) != 0) {
RETURN_FALSE;
} else {
RETURN_TRUE;
}
} | 0 | [
"CWE-190"
] | php-src | 3b8d4de300854b3517c7acb239b84f7726c1353c | 205,532,929,334,984,900,000,000,000,000,000,000,000 | 17 | Fix bug #71923 - integer overflow in ZipArchive::getFrom* |
static void chip_thread_wake(unsigned long data)
{
struct CHIPSTATE *chip = (struct CHIPSTATE*)data;
wake_up_process(chip->thread);
} | 0 | [
"CWE-399"
] | linux-2.6 | 01a1a3cc1e3fbe718bd06a2a5d4d1a2d0fb4d7d9 | 87,005,177,452,447,570,000,000,000,000,000,000,000 | 5 | V4L/DVB (9624): CVE-2008-5033: fix OOPS on tvaudio when controlling bass/treble
This bug were supposed to be fixed by 5ba2f67afb02c5302b2898949ed6fc3b3d37dcf1,
where a call to NULL happens.
Not all tvaudio chips allow controlling bass/treble. So, the driver
has a table with a flag to indicate if the chip does support... |
ModuleExport size_t RegisterDOTImage(void)
{
MagickInfo
*entry;
entry=SetMagickInfo("DOT");
#if defined(MAGICKCORE_GVC_DELEGATE)
entry->decoder=(DecodeImageHandler *) ReadDOTImage;
#endif
entry->blob_support=MagickFalse;
entry->description=ConstantString("Graphviz");
entry->module=ConstantString("DOT")... | 0 | [
"CWE-401"
] | ImageMagick6 | 80deac0626d2d69e1da836d7d893db1e022b10fc | 196,729,419,295,769,230,000,000,000,000,000,000,000 | 26 | https://github.com/ImageMagick/ImageMagick/issues/1528 |
xrdp_mm_setup_mod1(struct xrdp_mm* self)
{
void* func;
char lib[256];
char text[256];
if (self == 0)
{
return 1;
}
lib[0] = 0;
if (xrdp_mm_get_value(self, "lib", lib, 255) != 0)
{
g_snprintf(text, 255, "no library name specified in xrdp.ini, please add "
"lib=libxrdp... | 0 | [] | xrdp | d8f9e8310dac362bb9578763d1024178f94f4ecc | 321,927,803,679,796,580,000,000,000,000,000,000,000 | 110 | move temp files from /tmp to /tmp/.xrdp |
set_field_parse__(char *arg, const struct ofpact_parse_params *pp)
{
char *value;
char *delim;
char *key;
const struct mf_field *mf;
union mf_value sf_value, sf_mask;
char *error;
error = set_field_split_str(arg, &key, &value, &delim);
if (error) {
return error;
}
mf = ... | 0 | [
"CWE-416"
] | ovs | 77cccc74deede443e8b9102299efc869a52b65b2 | 95,876,832,636,074,970,000,000,000,000,000,000,000 | 37 | ofp-actions: Fix use-after-free while decoding RAW_ENCAP.
While decoding RAW_ENCAP action, decode_ed_prop() might re-allocate
ofpbuf if there is no enough space left. However, function
'decode_NXAST_RAW_ENCAP' continues to use old pointer to 'encap'
structure leading to write-after-free and incorrect decoding.
==3... |
static bool is_section_symbol(RBinSymbol *s) {
/* workaround for some bin plugs (e.g. ELF) */
if (!s || *s->name) {
return false;
}
return (s->type && !strcmp (s->type, "SECTION"));
} | 0 | [
"CWE-125"
] | radare2 | 1f37c04f2a762500222dda2459e6a04646feeedf | 10,405,715,182,858,488,000,000,000,000,000,000,000 | 7 | Fix #9904 - crash in r2_hoobr_r_read_le32 (over 9000 entrypoints) and read_le oobread (#9923) |
MagickPrivate void DumpOpenCLProfileData()
{
#define OpenCLLog(message) \
fwrite(message,sizeof(char),strlen(message),log); \
fwrite("\n",sizeof(char),1,log);
char
buf[4096],
filename[MagickPathExtent],
indent[160];
FILE
*log;
MagickCLEnv
clEnv;
size_t
i,
j;
clEnv=GetCur... | 0 | [
"CWE-476"
] | ImageMagick | cca91aa1861818342e3d072bb0fad7dc4ffac24a | 86,651,978,400,580,640,000,000,000,000,000,000,000 | 73 | https://github.com/ImageMagick/ImageMagick/issues/790 |
void stsc_del(GF_Box *s)
{
GF_SampleToChunkBox *ptr = (GF_SampleToChunkBox *)s;
if (ptr == NULL) return;
if (ptr->entries) gf_free(ptr->entries);
gf_free(ptr);
} | 0 | [
"CWE-400",
"CWE-401"
] | gpac | d2371b4b204f0a3c0af51ad4e9b491144dd1225c | 160,538,589,602,765,370,000,000,000,000,000,000,000 | 7 | prevent dref memleak on invalid input (#1183) |
static int ntop_set_redis(lua_State* vm) {
char *key, *value;
Redis *redis = ntop->getRedis();
ntop->getTrace()->traceEvent(TRACE_INFO, "%s() called", __FUNCTION__);
if(ntop_lua_check(vm, __FUNCTION__, 1, LUA_TSTRING)) return(CONST_LUA_ERROR);
if((key = (char*)lua_tostring(vm, 1)) == NULL) return(CONS... | 0 | [
"CWE-254"
] | ntopng | 2e0620be3410f5e22c9aa47e261bc5a12be692c6 | 279,873,098,110,435,740,000,000,000,000,000,000,000 | 17 | Added security fix to avoid escalating privileges to non-privileged users
Many thanks to Dolev Farhi for reporting it |
static int io_files_update(struct io_kiocb *req, bool force_nonblock)
{
struct io_ring_ctx *ctx = req->ctx;
struct io_uring_files_update up;
int ret;
if (force_nonblock)
return -EAGAIN;
up.offset = req->files_update.offset;
up.fds = req->files_update.arg;
mutex_lock(&ctx->uring_lock);
ret = __io_sqe_files_... | 0 | [] | linux | ff002b30181d30cdfbca316dadd099c3ca0d739c | 196,010,788,731,399,680,000,000,000,000,000,000,000 | 22 | io_uring: grab ->fs as part of async preparation
This passes it in to io-wq, so it assumes the right fs_struct when
executing async work that may need to do lookups.
Cc: stable@vger.kernel.org # 5.3+
Signed-off-by: Jens Axboe <axboe@kernel.dk> |
static long btrfs_ioctl_dev_replace(struct btrfs_root *root, void __user *arg)
{
struct btrfs_ioctl_dev_replace_args *p;
int ret;
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
p = memdup_user(arg, sizeof(*p));
if (IS_ERR(p))
return PTR_ERR(p);
switch (p->cmd) {
case BTRFS_IOCTL_DEV_REPLACE_CMD_START:
if (... | 0 | [
"CWE-310"
] | linux-2.6 | 9c52057c698fb96f8f07e7a4bcf4801a092bda89 | 139,194,597,342,712,370,000,000,000,000,000,000,000 | 44 | Btrfs: fix hash overflow handling
The handling for directory crc hash overflows was fairly obscure,
split_leaf returns EOVERFLOW when we try to extend the item and that is
supposed to bubble up to userland. For a while it did so, but along the
way we added better handling of errors and forced the FS readonly if we
hi... |
int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
{
vcpu->arch.emulate_regs_need_sync_from_vcpu = true;
vcpu->arch.emulate_regs_need_sync_to_vcpu = false;
kvm_register_write(vcpu, VCPU_REGS_RAX, regs->rax);
kvm_register_write(vcpu, VCPU_REGS_RBX, regs->rbx);
kvm_register_write(vcpu, V... | 0 | [] | kvm | 0769c5de24621141c953fbe1f943582d37cb4244 | 307,430,012,998,238,430,000,000,000,000,000,000,000 | 33 | KVM: x86: extend "struct x86_emulate_ops" with "get_cpuid"
In order to be able to proceed checks on CPU-specific properties
within the emulator, function "get_cpuid" is introduced.
With "get_cpuid" it is possible to virtually call the guests
"cpuid"-opcode without changing the VM's context.
[mtosatti: cleanup/beautif... |
static void crypto_rng_show(struct seq_file *m, struct crypto_alg *alg)
{
seq_printf(m, "type : rng\n");
seq_printf(m, "seedsize : %u\n", alg->cra_rng.seedsize);
} | 0 | [
"CWE-310"
] | linux | 9a5467bf7b6e9e02ec9c3da4e23747c05faeaac6 | 23,579,655,528,545,770,000,000,000,000,000,000,000 | 5 | crypto: user - fix info leaks in report API
Three errors resulting in kernel memory disclosure:
1/ The structures used for the netlink based crypto algorithm report API
are located on the stack. As snprintf() does not fill the remainder of
the buffer with null bytes, those stack bytes will be disclosed to users
of th... |
static int iscsi_check_numerical_value(struct iscsi_param *param, char *value_ptr)
{
char *tmpptr;
int value = 0;
value = simple_strtoul(value_ptr, &tmpptr, 0);
if (IS_TYPERANGE_0_TO_2(param)) {
if ((value < 0) || (value > 2)) {
pr_err("Illegal value for \"%s\", must be"
" between 0 and 2.\n", param->nam... | 0 | [
"CWE-119"
] | target-pending | cea4dcfdad926a27a18e188720efe0f2c9403456 | 263,974,918,448,851,200,000,000,000,000,000,000,000 | 66 | iscsi-target: fix heap buffer overflow on error
If a key was larger than 64 bytes, as checked by iscsi_check_key(), the
error response packet, generated by iscsi_add_notunderstood_response(),
would still attempt to copy the entire key into the packet, overflowing
the structure on the heap.
Remote preauthentication ke... |
static int cirrus_bitblt_videotovideo_patterncopy(CirrusVGAState * s)
{
return cirrus_bitblt_common_patterncopy(s,
s->vram_ptr + ((s->cirrus_blt_srcaddr & ~7) &
s->cirrus_addr_mask));
} | 0 | [
"CWE-787"
] | qemu | b2eb849d4b1fdb6f35d5c46958c7f703cf64cfef | 251,978,001,653,811,100,000,000,000,000,000,000,000 | 6 | CVE-2007-1320 - Cirrus LGD-54XX "bitblt" heap overflow
I have just noticed that patch for CVE-2007-1320 has never been applied
to the QEMU CVS. Please find it below.
| Multiple heap-based buffer overflows in the cirrus_invalidate_region
| function in the Cirrus VGA extension in QEMU 0.8.2, as used in Xen and
| possib... |
static void nested_vmx_setup_ctls_msrs(struct vcpu_vmx *vmx)
{
/*
* Note that as a general rule, the high half of the MSRs (bits in
* the control fields which may be 1) should be initialized by the
* intersection of the underlying hardware's MSR (i.e., features which
* can be supported) and the list of feature... | 0 | [
"CWE-388"
] | linux | ef85b67385436ddc1998f45f1d6a210f935b3388 | 419,181,479,160,590,400,000,000,000,000,000,000 | 200 | kvm: nVMX: Allow L1 to intercept software exceptions (#BP and #OF)
When L2 exits to L0 due to "exception or NMI", software exceptions
(#BP and #OF) for which L1 has requested an intercept should be
handled by L1 rather than L0. Previously, only hardware exceptions
were forwarded to L1.
Signed-off-by: Jim Mattson <jma... |
static void filename_compute_type(struct policydb *p, struct context *newcontext,
u32 stype, u32 ttype, u16 tclass,
const char *objname)
{
struct filename_trans ft;
struct filename_trans_datum *otype;
/*
* Most filename trans rules are going to live in specific directories
* like /dev or /var/run. ... | 0 | [
"CWE-20"
] | linux | 2172fa709ab32ca60e86179dc67d0857be8e2c98 | 210,961,315,027,350,470,000,000,000,000,000,000,000 | 24 | SELinux: Fix kernel BUG on empty security contexts.
Setting an empty security context (length=0) on a file will
lead to incorrectly dereferencing the type and other fields
of the security context structure, yielding a kernel BUG.
As a zero-length security context is never valid, just reject
all such security contexts... |
void udta_box_del(GF_Box *s)
{
u32 i;
GF_UserDataMap *map;
GF_UserDataBox *ptr = (GF_UserDataBox *)s;
if (ptr == NULL) return;
i=0;
while ((map = (GF_UserDataMap *)gf_list_enum(ptr->recordList, &i))) {
gf_isom_box_array_del(map->boxes);
gf_free(map);
}
gf_list_del(ptr->recordList);
gf_free(ptr);
} | 0 | [
"CWE-787"
] | gpac | 77510778516803b7f7402d7423c6d6bef50254c3 | 184,764,563,307,203,000,000,000,000,000,000,000,000 | 14 | fixed #2255 |
fullpacket(LIBSSH2_SESSION * session, int encrypted /* 1 or 0 */ )
{
unsigned char macbuf[MAX_MACSIZE];
struct transportpacket *p = &session->packet;
int rc;
int compressed;
if(session->fullpacket_state == libssh2_NB_state_idle) {
session->fullpacket_macstate = LIBSSH2_MAC_CONFIRMED;
... | 0 | [
"CWE-787"
] | libssh2 | dc109a7f518757741590bb993c0c8412928ccec2 | 110,532,082,026,252,670,000,000,000,000,000,000,000 | 91 | Security fixes (#315)
* Bounds checks
Fixes for CVEs
https://www.libssh2.org/CVE-2019-3863.html
https://www.libssh2.org/CVE-2019-3856.html
* Packet length bounds check
CVE
https://www.libssh2.org/CVE-2019-3855.html
* Response length check
CVE
https://www.libssh2.org/CVE-2019-3859.html
* Bounds ch... |
void qdisc_get_default(char *name, size_t len)
{
read_lock(&qdisc_mod_lock);
strlcpy(name, default_qdisc_ops->id, len);
read_unlock(&qdisc_mod_lock);
} | 0 | [
"CWE-264"
] | net | 90f62cf30a78721641e08737bda787552428061e | 121,850,191,184,114,360,000,000,000,000,000,000,000 | 6 | 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.
... |
GF_Err fdsa_Write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
GF_HintSample *ptr = (GF_HintSample *) s;
if (!s) return GF_BAD_PARAM;
e = gf_isom_box_array_write(s, ptr->packetTable, bs);
if (e) return e;
if (ptr->extra_data) {
e = gf_isom_box_write((GF_Box *)ptr->extra_data, bs);
if (e) return e;
}
return GF... | 0 | [
"CWE-400",
"CWE-401"
] | gpac | d2371b4b204f0a3c0af51ad4e9b491144dd1225c | 149,577,919,695,645,440,000,000,000,000,000,000,000 | 14 | prevent dref memleak on invalid input (#1183) |
void expectHealthchecks(HealthTransition host_changed_state, size_t num_healthchecks) {
for (size_t i = 0; i < num_healthchecks; i++) {
cluster_->info_->stats().upstream_cx_total_.inc();
expectSessionCreate();
expectHealthcheckStart(i);
}
health_checker_->start();
EXPECT_CALL(runtim... | 0 | [
"CWE-476"
] | envoy | 9b1c3962172a972bc0359398af6daa3790bb59db | 86,034,538,647,618,760,000,000,000,000,000,000,000 | 18 | healthcheck: fix grpc inline removal crashes (#749)
Signed-off-by: Matt Klein <mklein@lyft.com>
Signed-off-by: Pradeep Rao <pcrao@google.com> |
void gfs2_wake_up_statfs(struct gfs2_sbd *sdp) {
if (!sdp->sd_statfs_force_sync) {
sdp->sd_statfs_force_sync = 1;
wake_up(&sdp->sd_quota_wait);
}
} | 0 | [
"CWE-399"
] | linux-2.6 | 7e619bc3e6252dc746f64ac3b486e784822e9533 | 48,869,539,868,686,890,000,000,000,000,000,000,000 | 6 | GFS2: Fix writing to non-page aligned gfs2_quota structures
This is the upstream fix for this bug. This patch differs
from the RHEL5 fix (Red Hat bz #555754) which simply writes to the 8-byte
value field of the quota. In upstream quota code, we're
required to write the entire quota (88 bytes) which can be split
across... |
static int open_dev_autofs(Manager *m) {
struct autofs_dev_ioctl param;
assert(m);
if (m->dev_autofs_fd >= 0)
return m->dev_autofs_fd;
label_fix("/dev/autofs", false, false);
m->dev_autofs_fd = open("/dev/autofs", O_CLOEXEC|O_RDONLY);
if (m->dev_autofs... | 0 | [
"CWE-362"
] | systemd | e7d54bf58789545a9eb0b3964233defa0b007318 | 8,838,515,165,006,595,000,000,000,000,000,000,000 | 24 | automount: ack automount requests even when already mounted (#5916)
If a process accesses an autofs filesystem while systemd is in the
middle of starting the mount unit on top of it, it is possible for the
autofs_ptype_missing_direct request from the kernel to be received after
the mount unit has been fully started... |
static int cap_socket_shutdown(struct socket *sock, int how)
{
return 0;
} | 0 | [] | linux-2.6 | ee18d64c1f632043a02e6f5ba5e045bb26a5465f | 283,552,990,096,264,100,000,000,000,000,000,000,000 | 4 | KEYS: Add a keyctl to install a process's session keyring on its parent [try #6]
Add a keyctl to install a process's session keyring onto its parent. This
replaces the parent's session keyring. Because the COW credential code does
not permit one process to change another process's credentials directly, the
change is... |
pgtable_bad(struct pt_regs *regs, unsigned long error_code,
unsigned long address)
{
struct task_struct *tsk;
unsigned long flags;
int sig;
flags = oops_begin();
tsk = current;
sig = SIGKILL;
printk(KERN_ALERT "%s: Corrupted page table at address %lx\n",
tsk->comm, address);
dump_pagetable(addres... | 0 | [
"CWE-264"
] | linux | 548acf19234dbda5a52d5a8e7e205af46e9da840 | 298,677,922,437,435,130,000,000,000,000,000,000,000 | 24 | x86/mm: Expand the exception table logic to allow new handling options
Huge amounts of help from Andy Lutomirski and Borislav Petkov to
produce this. Andy provided the inspiration to add classes to the
exception table with a clever bit-squeezing trick, Boris pointed
out how much cleaner it would all be if we just had... |
ExprResolveBoolean(struct xkb_context *ctx, const ExprDef *expr,
bool *set_rtrn)
{
bool ok = false;
const char *ident;
switch (expr->expr.op) {
case EXPR_VALUE:
if (expr->expr.value_type != EXPR_TYPE_BOOLEAN) {
log_err(ctx,
"Found constant of t... | 0 | [
"CWE-400",
"CWE-703"
] | libxkbcommon | 1f9d1248c07cda8aaff762429c0dce146de8632a | 116,423,993,232,181,930,000,000,000,000,000,000,000 | 67 | xkbcomp: fix stack overflow when evaluating boolean negation
The expression evaluator would go into an infinite recursion when
evaluating something like this as a boolean: `!True`. Instead of
recursing to just `True` and negating, it recursed to `!True` itself
again.
Bug inherited from xkbcomp.
Caught with the afl f... |
CJSON_PUBLIC(void) cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newitem)
{
cJSON *after_inserted = NULL;
if (which < 0)
{
return;
}
after_inserted = get_array_item(array, (size_t)which);
if (after_inserted == NULL)
{
add_item_to_array(array, newitem);
ret... | 0 | [
"CWE-754",
"CWE-787"
] | cJSON | be749d7efa7c9021da746e685bd6dec79f9dd99b | 233,212,807,527,170,670,000,000,000,000,000,000,000 | 28 | Fix crash of cJSON_GetObjectItemCaseSensitive when calling it on arrays |
PrintChar(c)
int c;
{
if (curr->w_stringp >= curr->w_string + MAXSTR - 1)
PrintFlush();
*(curr->w_stringp)++ = c;
} | 0 | [] | screen | c5db181b6e017cfccb8d7842ce140e59294d9f62 | 98,363,222,521,864,100,000,000,000,000,000,000,000 | 7 | 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 ... |
wait_return(int redraw)
{
int c;
int oldState;
int tmpState;
int had_got_int;
int save_reg_recording;
FILE *save_scriptout;
if (redraw == TRUE)
must_redraw = CLEAR;
// If using ":silent cmd", don't wait for a return. Also don't set
// need_wait_return to do it later.
if ... | 0 | [
"CWE-416"
] | vim | 9f1a39a5d1cd7989ada2d1cb32f97d84360e050f | 121,727,730,980,779,600,000,000,000,000,000,000,000 | 237 | 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. |
/*@observer@*/ /*@null@*/const void *commonio_locate (struct commonio_db *db, const char *name)
{
struct commonio_entry *p;
if (!db->isopen) {
errno = EINVAL;
return NULL;
}
p = find_entry_by_name (db, name);
if (NULL == p) {
errno = ENOENT;
return NULL;
}
db->cursor = p;
return p->eptr;
} | 0 | [
"CWE-119",
"CWE-787"
] | shadow | 954e3d2e7113e9ac06632aee3c69b8d818cc8952 | 260,633,182,479,654,770,000,000,000,000,000,000,000 | 16 | Fix buffer overflow if NULL line is present in db.
If ptr->line == NULL for an entry, the first cycle will exit,
but the second one will happily write past entries buffer.
We actually do not want to exit the first cycle prematurely
on ptr->line == NULL.
Signed-off-by: Tomas Mraz <tmraz@fedoraproject.org> |
*/
static int __dev_queue_xmit(struct sk_buff *skb, void *accel_priv)
{
struct net_device *dev = skb->dev;
struct netdev_queue *txq;
struct Qdisc *q;
int rc = -ENOMEM;
skb_reset_mac_header(skb);
if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_SCHED_TSTAMP))
__skb_tstamp_tx(skb, NULL, skb->sk, SCM_TSTAMP_SCHED... | 0 | [
"CWE-400",
"CWE-703"
] | linux | fac8e0f579695a3ecbc4d3cac369139d7f819971 | 124,517,392,384,231,000,000,000,000,000,000,000,000 | 116 | 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... |
static struct ldb_result *lookup_user_pso(struct ldb_context *sam_ldb,
TALLOC_CTX *mem_ctx,
const struct ldb_message *user_msg,
const char * const *attrs)
{
struct ldb_result *res = NULL;
struct ldb_dn *pso_dn = NULL;
int ret;
/* if the user has a PSO that applies, then use the PSO's setting *... | 0 | [
"CWE-200"
] | samba | 0a3aa5f908e351201dc9c4d4807b09ed9eedff77 | 181,400,668,025,362,470,000,000,000,000,000,000,000 | 30 | CVE-2022-32746 ldb: Make use of functions for appending to an ldb_message
This aims to minimise usage of the error-prone pattern of searching for
a just-added message element in order to make modifications to it (and
potentially finding the wrong element).
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15009
Signed... |
static struct rt6_info *rt6_multipath_select(struct rt6_info *match,
struct flowi6 *fl6, int oif,
int strict)
{
struct rt6_info *sibling, *next_sibling;
int route_choosen;
route_choosen = rt6_info_hash_nhsfn(match->rt6i_nsiblings + 1, fl6);
/* Don't change the route, if route_choosen == 0
* (... | 0 | [
"CWE-119"
] | net | c88507fbad8055297c1d1e21e599f46960cbee39 | 301,732,495,238,966,100,000,000,000,000,000,000,000 | 24 | ipv6: don't set DST_NOCOUNT for remotely added routes
DST_NOCOUNT should only be used if an authorized user adds routes
locally. In case of routes which are added on behalf of router
advertisments this flag must not get used as it allows an unlimited
number of routes getting added remotely.
Signed-off-by: Sabrina Dub... |
vhost_reserve_avail_batch_packed(struct virtio_net *dev,
struct vhost_virtqueue *vq,
struct rte_mempool *mbuf_pool,
struct rte_mbuf **pkts,
uint16_t avail_idx,
uintptr_t *desc_addrs,
uint16_t *ids)
{
bool wrap = vq->avail_wrap_counter;
struct vring_packed_desc *descs = vq->desc_packed;
... | 0 | [
"CWE-665"
] | dpdk | 97ecc1c85c95c13bc66a87435758e93406c35c48 | 138,353,916,795,722,720,000,000,000,000,000,000,000 | 82 | vhost: fix translated address not checked
Malicious guest can construct desc with invalid address and zero buffer
length. That will request vhost to check both translated address and
translated data length. This patch will add missed address check.
CVE-2020-10725
Fixes: 75ed51697820 ("vhost: add packed ring batch deq... |
const std::string& via() const override { return EMPTY_STRING; } | 0 | [
"CWE-400",
"CWE-703"
] | envoy | afc39bea36fd436e54262f150c009e8d72db5014 | 26,714,758,388,105,444,000,000,000,000,000,000,000 | 1 | Track byteSize of HeaderMap internally.
Introduces a cached byte size updated internally in HeaderMap. The value
is stored as an optional, and is cleared whenever a non-const pointer or
reference to a HeaderEntry is accessed. The cached value can be set with
refreshByteSize() which performs an iteration over the Heade... |
static int ax25_ctl_ioctl(const unsigned int cmd, void __user *arg)
{
struct ax25_ctl_struct ax25_ctl;
ax25_digi digi;
ax25_dev *ax25_dev;
ax25_cb *ax25;
unsigned int k;
int ret = 0;
if (copy_from_user(&ax25_ctl, arg, sizeof(ax25_ctl)))
return -EFAULT;
if (ax25_ctl.digi_count > AX25_MAX_DIGIS)
return -EIN... | 0 | [
"CWE-476"
] | linux | 71171ac8eb34ce7fe6b3267dce27c313ab3cb3ac | 228,364,147,739,307,550,000,000,000,000,000,000,000 | 105 | ax25: Fix NULL pointer dereference in ax25_kill_by_device
When two ax25 devices attempted to establish connection, the requester use ax25_create(),
ax25_bind() and ax25_connect() to initiate connection. The receiver use ax25_rcv() to
accept connection and use ax25_create_cb() in ax25_rcv() to create ax25_cb, but the
a... |
Header::compression ()
{
return static_cast <CompressionAttribute &>
((*this)["compression"]).value();
} | 0 | [
"CWE-125"
] | openexr | e79d2296496a50826a15c667bf92bdc5a05518b4 | 16,609,933,426,803,881,000,000,000,000,000,000,000 | 5 | fix memory leaks and invalid memory accesses
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz> |
static void ignore_sigpipe()
{
signal(SIGPIPE, SIG_IGN);
} | 0 | [] | mariadb-connector-c | 27b2f3d1f1550dfaee0f63a331a406ab31c1b37e | 4,824,496,341,742,885,500,000,000,000,000,000,000 | 4 | various checks for corrupted packets in the protocol
also: check the return value of unpack_fields() |
static ssize_t ocfs2_file_write_iter(struct kiocb *iocb,
struct iov_iter *from)
{
int direct_io, rw_level;
ssize_t written = 0;
ssize_t ret;
size_t count = iov_iter_count(from);
struct file *file = iocb->ki_filp;
struct inode *inode = file_inode(file);
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
in... | 0 | [
"CWE-401"
] | linux | 28f5a8a7c033cbf3e32277f4cc9c6afd74f05300 | 12,754,896,538,438,776,000,000,000,000,000,000,000 | 140 | ocfs2: should wait dio before inode lock in ocfs2_setattr()
we should wait dio requests to finish before inode lock in
ocfs2_setattr(), otherwise the following deadlock will happen:
process 1 process 2 process 3
truncate file 'A' end_io of writing file 'A' receiving the ... |
urlAppendDomain(char *host)
{
/* For IPv4 addresses check for a dot */
/* For IPv6 addresses also check for a colon */
if (Config.appendDomain && !strchr(host, '.') && !strchr(host, ':')) {
const uint64_t dlen = strlen(host);
const uint64_t want = dlen + Config.appendDomainLen;
if (w... | 0 | [
"CWE-20"
] | squid | dfd818595b54942cb1adc45f6aed95c9b706e3a8 | 42,059,318,954,675,570,000,000,000,000,000,000,000 | 15 | Merge pull request from GHSA-jvf6-h9gj-pmj6
* Add slash prefix to path-rootless or path-noscheme URLs
* Update src/anyp/Uri.cc
Co-authored-by: Alex Rousskov <rousskov@measurement-factory.com>
* restore file trailer GH auto-removes
* Remove redundant path-empty check
* Removed stale comment left behind by b2ab59a
... |
NO_INLINE JsVar *jspeAddNamedFunctionParameter(JsVar *funcVar, JsVar *name) {
if (!funcVar) funcVar = jsvNewWithFlags(JSV_FUNCTION);
char buf[JSLEX_MAX_TOKEN_LENGTH+1];
buf[0] = '\xFF';
jsvGetString(name, &buf[1], JSLEX_MAX_TOKEN_LENGTH);
JsVar *param = jsvAddNamedChild(funcVar, 0, buf);
jsvMakeFunctionPara... | 0 | [
"CWE-125",
"CWE-674"
] | Espruino | 51380baf17241728b6d48cdb84140b931e3e3cc5 | 234,119,124,413,363,000,000,000,000,000,000,000,000 | 10 | Fix stack overflow if interpreting a file full of '{' (fix #1448) |
static uint32_t ioport_read(void *opaque, uint32_t addr)
{
PCIQXLDevice *d = opaque;
dprint(d, 1, "%s: unexpected\n", __FUNCTION__);
return 0xff;
} | 0 | [] | qemu-kvm | 5ff4e36c804157bd84af43c139f8cd3a59722db9 | 160,613,061,844,472,690,000,000,000,000,000,000,000 | 7 | qxl: async io support using new spice api
Some of the QXL port i/o commands are waiting for the spice server to
complete certain actions. Add async versions for these commands, so we
don't block the vcpu while the spice server processses the command.
Instead the qxl device will raise an IRQ when done.
The async comm... |
GF_Box *udta_box_new()
{
ISOM_DECL_BOX_ALLOC(GF_UserDataBox, GF_ISOM_BOX_TYPE_UDTA);
tmp->recordList = gf_list_new();
if (!tmp->recordList) {
gf_free(tmp);
return NULL;
}
return (GF_Box *)tmp;
} | 0 | [
"CWE-787"
] | gpac | 77510778516803b7f7402d7423c6d6bef50254c3 | 326,742,803,903,001,020,000,000,000,000,000,000,000 | 10 | fixed #2255 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.