func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
tdbio_read_nextcheck ()
{
TRUSTREC vr;
int rc;
rc = tdbio_read_record( 0, &vr, RECTYPE_VER );
if( rc )
log_fatal( _("%s: error reading version record: %s\n"),
db_name, gpg_strerror (rc));
return vr.r.ver.nextcheck;
} | 0 | [
"CWE-20"
] | gnupg | 2183683bd633818dd031b090b5530951de76f392 | 100,387,863,341,143,810,000,000,000,000,000,000,000 | 11 | Use inline functions to convert buffer data to scalars.
* common/host2net.h (buf16_to_ulong, buf16_to_uint): New.
(buf16_to_ushort, buf16_to_u16): New.
(buf32_to_size_t, buf32_to_ulong, buf32_to_uint, buf32_to_u32): New.
--
Commit 91b826a38880fd8a989318585eb502582636ddd8 was not enough to
avoid all sign extension on ... |
int quicklistTest(int argc, char *argv[]) {
UNUSED(argc);
UNUSED(argv);
unsigned int err = 0;
int optimize_start =
-(int)(sizeof(optimization_level) / sizeof(*optimization_level));
printf("Starting optimization offset at: %d\n", optimize_start);
int options[] = {0, 1, 2, 3, 4, 5, 6, 1... | 0 | [
"CWE-190"
] | redis | f6a40570fa63d5afdd596c78083d754081d80ae3 | 292,474,991,459,786,500,000,000,000,000,000,000,000 | 1,087 | Fix ziplist and listpack overflows and truncations (CVE-2021-32627, CVE-2021-32628)
- fix possible heap corruption in ziplist and listpack resulting by trying to
allocate more than the maximum size of 4GB.
- prevent ziplist (hash and zset) from reaching size of above 1GB, will be
converted to HT encoding, that's n... |
void visit(LiteralString &ope) override {
found_ope = ope.shared_from_this();
} | 0 | [
"CWE-125"
] | cpp-peglib | b3b29ce8f3acf3a32733d930105a17d7b0ba347e | 300,317,921,426,042,730,000,000,000,000,000,000,000 | 3 | Fix #122 |
static void tulip_instance_init(Object *obj)
{
PCIDevice *pci_dev = PCI_DEVICE(obj);
TULIPState *d = DO_UPCAST(TULIPState, dev, pci_dev);
device_add_bootindex_property(obj, &d->c.bootindex,
"bootindex", "/ethernet-phy@0",
&pci_dev->qdev);
... | 0 | [] | qemu | 36a894aeb64a2e02871016da1c37d4a4ca109182 | 161,777,258,206,659,470,000,000,000,000,000,000,000 | 9 | net: tulip: Restrict DMA engine to memories
The DMA engine is started by I/O access and then itself accesses the
I/O registers, triggering a reentrancy bug.
The following log can reveal it:
==5637==ERROR: AddressSanitizer: stack-overflow
#0 0x5595435f6078 in tulip_xmit_list_update qemu/hw/net/tulip.c:673
#1 0... |
SYSCALL_DEFINE5(rt_sigaction, int, sig, const struct sigaction __user *, act,
struct sigaction __user *, oact, void __user *, restorer,
size_t, sigsetsize)
{
struct k_sigaction new_ka, old_ka;
int ret;
/* XXX: Don't preclude handling different sized sigset_t's. */
if (sigsetsize != sizeof(sigset_t))
return ... | 0 | [] | linux | 5a0efea09f42f7c92bd98a38d66b4dff9589266b | 330,472,938,267,890,350,000,000,000,000,000,000,000 | 26 | sparc64: Sharpen address space randomization calculations.
A recent patch to the x86 randomization code caused me to take
a quick look at what we do on sparc64, and in doing so I noticed
that we sometimes calculate a non-page-aligned randomization value
and stick it into mmap_base.
I also noticed that since I copied ... |
get_ofp14_async_config_prop_by_oam(enum ofputil_async_msg_type oam,
bool master)
{
FOR_EACH_ASYNC_PROP (ap) {
if (ap->oam == oam && ap->master == master) {
return ap;
}
}
return NULL;
} | 0 | [
"CWE-772"
] | ovs | 77ad4225d125030420d897c873e4734ac708c66b | 283,685,610,323,721,800,000,000,000,000,000,000,000 | 10 | ofp-util: Fix memory leaks on error cases in ofputil_decode_group_mod().
Found by libFuzzer.
Reported-by: Bhargava Shastry <bshastry@sec.t-labs.tu-berlin.de>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org> |
rpc_C_VerifyInit (CK_X_FUNCTION_LIST *self,
p11_rpc_message *msg)
{
CK_SESSION_HANDLE session;
CK_MECHANISM mechanism;
CK_OBJECT_HANDLE key;
BEGIN_CALL (VerifyInit);
IN_ULONG (session);
IN_MECHANISM (mechanism);
IN_ULONG (key);
PROCESS_CALL ((self, session, &mechanism, key));
END_CALL;
} | 0 | [
"CWE-190"
] | p11-kit | 5307a1d21a50cacd06f471a873a018d23ba4b963 | 59,200,243,262,277,260,000,000,000,000,000,000,000 | 14 | Check for arithmetic overflows before allocating |
static int __start_delalloc_inodes(struct btrfs_root *root, int delay_iput,
int nr)
{
struct btrfs_inode *binode;
struct inode *inode;
struct btrfs_delalloc_work *work, *next;
struct list_head works;
struct list_head splice;
int ret = 0;
INIT_LIST_HEAD(&works);
INIT_LIST_HEAD(&splice);
mutex_lock(&roo... | 0 | [
"CWE-200"
] | linux | 0305cd5f7fca85dae392b9ba85b116896eb7c1c7 | 334,574,174,687,967,100,000,000,000,000,000,000,000 | 63 | Btrfs: fix truncation of compressed and inlined extents
When truncating a file to a smaller size which consists of an inline
extent that is compressed, we did not discard (or made unusable) the
data between the new file size and the old file size, wasting metadata
space and allowing for the truncated data to be leaked... |
static int i40e_add_vsi(struct i40e_vsi *vsi)
{
int ret = -ENODEV;
struct i40e_pf *pf = vsi->back;
struct i40e_hw *hw = &pf->hw;
struct i40e_vsi_context ctxt;
struct i40e_mac_filter *f;
struct hlist_node *h;
int bkt;
u8 enabled_tc = 0x1; /* TC0 enabled */
int f_count = 0;
memset(&ctxt, 0, sizeof(ctxt));
sw... | 0 | [
"CWE-400",
"CWE-401"
] | linux | 27d461333459d282ffa4a2bdb6b215a59d493a8f | 55,130,506,900,400,800,000,000,000,000,000,000,000 | 239 | i40e: prevent memory leak in i40e_setup_macvlans
In i40e_setup_macvlans if i40e_setup_channel fails the allocated memory
for ch should be released.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> |
GF_Err mfra_AddBox(GF_Box *s, GF_Box *a)
{
GF_MovieFragmentRandomAccessBox *ptr = (GF_MovieFragmentRandomAccessBox *)s;
switch(a->type) {
case GF_ISOM_BOX_TYPE_TFRA:
return gf_list_add(ptr->tfra_list, a);
case GF_ISOM_BOX_TYPE_MFRO:
if (ptr->mfro) ERROR_ON_DUPLICATED_BOX(a, ptr)
ptr->mfro = (GF_MovieFragmentR... | 0 | [
"CWE-400",
"CWE-401"
] | gpac | d2371b4b204f0a3c0af51ad4e9b491144dd1225c | 82,700,206,143,284,050,000,000,000,000,000,000,000 | 15 | prevent dref memleak on invalid input (#1183) |
mrb_mod_to_s(mrb_state *mrb, mrb_value klass)
{
mrb_value str;
if (mrb_type(klass) == MRB_TT_SCLASS) {
mrb_value v = mrb_iv_get(mrb, klass, mrb_intern_lit(mrb, "__attached__"));
str = mrb_str_new_lit(mrb, "#<Class:");
if (class_ptr_p(v)) {
mrb_str_cat_str(mrb, str, mrb_inspect(mrb, v));
}
... | 0 | [
"CWE-476",
"CWE-415"
] | mruby | faa4eaf6803bd11669bc324b4c34e7162286bfa3 | 232,639,101,101,424,740,000,000,000,000,000,000,000 | 48 | `mrb_class_real()` did not work for `BasicObject`; fix #4037 |
clear_node_opt_info(NodeOptInfo* opt)
{
clear_mml(&opt->len);
clear_opt_anc_info(&opt->anc);
clear_opt_exact_info(&opt->exb);
clear_opt_exact_info(&opt->exm);
clear_opt_exact_info(&opt->expr);
clear_opt_map_info(&opt->map);
} | 0 | [
"CWE-125"
] | php-src | c6e34d91b88638966662caac62c4d0e90538e317 | 33,113,021,204,792,606,000,000,000,000,000,000,000 | 9 | Fix bug #77371 (heap buffer overflow in mb regex functions - compile_string_node) |
client *createClient(connection *conn) {
client *c = zmalloc(sizeof(client));
/* passing NULL as conn it is possible to create a non connected client.
* This is useful since all the commands needs to be executed
* in the context of a client. When commands are executed in other
* contexts (for in... | 0 | [
"CWE-770"
] | redis | 5674b0057ff2903d43eaff802017eddf37c360f8 | 141,139,844,127,664,300,000,000,000,000,000,000,000 | 85 | Prevent unauthenticated client from easily consuming lots of memory (CVE-2021-32675)
This change sets a low limit for multibulk and bulk length in the
protocol for unauthenticated connections, so that they can't easily
cause redis to allocate massive amounts of memory by sending just a few
characters on the network.
T... |
void updateScanners(struct single_flow_info **scanners, u_int32_t saddr,
u_int8_t version, u_int32_t dport) {
struct single_flow_info *f;
struct port_flow_info *p;
HASH_FIND_INT(*scanners, (int *)&saddr, f);
if(f == NULL) {
f = (struct single_flow_info*)malloc(sizeof(struct single_flow... | 0 | [
"CWE-125"
] | nDPI | b7e666e465f138ae48ab81976726e67deed12701 | 277,926,132,659,242,300,000,000,000,000,000,000,000 | 41 | Added fix to avoid potential heap buffer overflow in H.323 dissector
Modified HTTP report information to make it closer to the HTTP field names |
static int intr_interception(struct vcpu_svm *svm)
{
++svm->vcpu.stat.irq_exits;
return 1;
} | 0 | [
"CWE-400"
] | linux-2.6 | 9581d442b9058d3699b4be568b6e5eae38a41493 | 255,094,049,662,014,430,000,000,000,000,000,000,000 | 5 | KVM: Fix fs/gs reload oops with invalid ldt
kvm reloads the host's fs and gs blindly, however the underlying segment
descriptors may be invalid due to the user modifying the ldt after loading
them.
Fix by using the safe accessors (loadsegment() and load_gs_index()) instead
of home grown unsafe versions.
This is CVE-... |
static void cmd_anal_aav(RCore *core, const char *input) {
#define seti(x,y) r_config_set_i(core->config, x, y);
#define geti(x) r_config_get_i(core->config, x);
r_return_if_fail (*input == 'v');
ut64 o_align = geti ("search.align");
const char *analin = r_config_get (core->config, "anal.in");
char *tmp = strdup (... | 0 | [
"CWE-703",
"CWE-908"
] | radare2 | 4d3811681a80f92a53e795f6a64c4b0fc2c8dd22 | 120,855,573,881,095,930,000,000,000,000,000,000,000 | 85 | Fix segfault in adf (#16230) |
static int ethtool_set_tx_csum(struct net_device *dev, char __user *useraddr)
{
struct ethtool_value edata;
int err;
if (!dev->ethtool_ops->set_tx_csum)
return -EOPNOTSUPP;
if (copy_from_user(&edata, useraddr, sizeof(edata)))
return -EFAULT;
if (!edata.data && dev->ethtool_ops->set_sg) {
err = __ethtool_s... | 0 | [
"CWE-190"
] | linux-2.6 | db048b69037e7fa6a7d9e95a1271a50dc08ae233 | 182,809,878,198,548,640,000,000,000,000,000,000,000 | 19 | ethtool: Fix potential kernel buffer overflow in ETHTOOL_GRXCLSRLALL
On a 32-bit machine, info.rule_cnt >= 0x40000000 leads to integer
overflow and the buffer may be smaller than needed. Since
ETHTOOL_GRXCLSRLALL is unprivileged, this can presumably be used for at
least denial of service.
Signed-off-by: Ben Hutching... |
static inline ut64 dwarf_read_initial_length(RZ_OUT bool *is_64bit, bool big_endian, const ut8 **buf, const ut8 *buf_end) {
ut64 r = READ32(*buf);
if (r == DWARF_INIT_LEN_64) {
r = READ64(*buf);
*is_64bit = true;
} else {
*is_64bit = false;
}
return r;
} | 0 | [
"CWE-787"
] | rizin | aa6917772d2f32e5a7daab25a46c72df0b5ea406 | 170,885,400,424,357,200,000,000,000,000,000,000,000 | 10 | Fix oob write for dwarf with abbrev with count 0 (Fix #2083) (#2086) |
Status AuthorizationSessionImpl::checkAuthForInsert(OperationContext* opCtx,
const NamespaceString& ns,
const BSONObj& document) {
if (ns.coll() == "system.indexes"_sd) {
BSONElement nsElement = document[... | 0 | [
"CWE-613"
] | mongo | 6dfb92b1299de04677d0bd2230e89a52eb01003c | 130,785,128,896,981,900,000,000,000,000,000,000,000 | 29 | SERVER-38984 Validate unique User ID on UserCache hit
(cherry picked from commit e55d6e2292e5dbe2f97153251d8193d1cc89f5d7) |
int get_rock_ridge_filename(struct iso_directory_record *de,
char *retname, struct inode *inode)
{
struct rock_state rs;
struct rock_ridge *rr;
int sig;
int retnamlen = 0;
int truncate = 0;
int ret = 0;
if (!ISOFS_SB(inode->i_sb)->s_rock)
return 0;
*retname = 0;
init_rock_state(&rs, inode);
setup_r... | 1 | [
"CWE-200"
] | linux | 99d825822eade8d827a1817357cbf3f889a552d6 | 41,909,521,124,446,550,000,000,000,000,000,000,000 | 99 | get_rock_ridge_filename(): handle malformed NM entries
Payloads of NM entries are not supposed to contain NUL. When we run
into such, only the part prior to the first NUL goes into the
concatenation (i.e. the directory entry name being encoded by a bunch
of NM entries). We do stop when the amount collected so far + ... |
zone_notify(dns_zone_t *zone, isc_time_t *now) {
dns_dbnode_t *node = NULL;
dns_db_t *zonedb = NULL;
dns_dbversion_t *version = NULL;
dns_name_t *origin = NULL;
dns_name_t master;
dns_rdata_ns_t ns;
dns_rdata_soa_t soa;
uint32_t serial;
dns_rdata_t rdata = DNS_RDATA_INIT;
dns_rdataset_t nsrdset;
dns_rdataset... | 0 | [
"CWE-327"
] | bind9 | f09352d20a9d360e50683cd1d2fc52ccedcd77a0 | 251,658,023,728,617,980,000,000,000,000,000,000,000 | 219 | Update keyfetch_done compute_tag check
If in keyfetch_done the compute_tag fails (because for example the
algorithm is not supported), don't crash, but instead ignore the
key. |
int __weak set_swbp(struct arch_uprobe *auprobe, struct mm_struct *mm, unsigned long vaddr)
{
return uprobe_write_opcode(mm, vaddr, UPROBE_SWBP_INSN);
} | 0 | [
"CWE-416"
] | linux | 355627f518978b5167256d27492fe0b343aaf2f2 | 189,379,822,922,992,150,000,000,000,000,000,000,000 | 4 | mm, uprobes: fix multiple free of ->uprobes_state.xol_area
Commit 7c051267931a ("mm, fork: make dup_mmap wait for mmap_sem for
write killable") made it possible to kill a forking task while it is
waiting to acquire its ->mmap_sem for write, in dup_mmap().
However, it was overlooked that this introduced an new error p... |
__mptctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
mpt_ioctl_header __user *uhdr = (void __user *) arg;
mpt_ioctl_header khdr;
int iocnum;
unsigned iocnumX;
int nonblock = (file->f_flags & O_NONBLOCK);
int ret;
MPT_ADAPTER *iocp = NULL;
if (copy_from_user(&khdr, uhdr, sizeof(khdr))) {
... | 1 | [
"CWE-362",
"CWE-369"
] | linux | 28d76df18f0ad5bcf5fa48510b225f0ed262a99b | 92,115,157,596,537,200,000,000,000,000,000,000,000 | 76 | scsi: mptfusion: Fix double fetch bug in ioctl
Tom Hatskevich reported that we look up "iocp" then, in the called
functions we do a second copy_from_user() and look it up again.
The problem that could cause is:
drivers/message/fusion/mptctl.c
674 /* All of these commands require an interrupt or
675 ... |
intorel_receive(TupleTableSlot *slot, DestReceiver *self)
{
DR_intorel *myState = (DR_intorel *) self;
HeapTuple tuple;
/*
* get the heap tuple out of the tuple table slot, making sure we have a
* writable copy
*/
tuple = ExecMaterializeSlot(slot);
/*
* force assignment of new OID (see comments in ExecIn... | 0 | [
"CWE-94"
] | postgres | f52d2fbd8c62f667191b61228acf9d8aa53607b9 | 247,750,931,960,878,320,000,000,000,000,000,000,000 | 27 | In extensions, don't replace objects not belonging to the extension.
Previously, if an extension script did CREATE OR REPLACE and there was
an existing object not belonging to the extension, it would overwrite
the object and adopt it into the extension. This is problematic, first
because the overwrite is probably uni... |
static bool winsdb_check_or_add_module_list(struct tevent_context *ev_ctx,
struct loadparm_context *lp_ctx, struct winsdb_handle *h,
const char *wins_path)
{
int trans;
int ret;
struct ldb_dn *dn;
struct ldb_result *res = NULL;
struct ldb_message *msg = NULL;
TALLOC_CTX *tmp_ctx = talloc_new(h)... | 0 | [
"CWE-200"
] | samba | 0a3aa5f908e351201dc9c4d4807b09ed9eedff77 | 211,868,681,374,709,670,000,000,000,000,000,000,000 | 65 | 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 int calculateColumnPosition(UChar32* buf32, int len) {
int width = mk_wcswidth(reinterpret_cast<const int*>(buf32), len);
if (width == -1)
return len;
else
return width;
} | 0 | [
"CWE-200"
] | mongo | 035cf2afc04988b22cb67f4ebfd77e9b344cb6e0 | 29,069,331,371,580,710,000,000,000,000,000,000,000 | 7 | SERVER-25335 avoid group and other permissions when creating .dbshell history file |
static int redisHandledPushReply(redisContext *c, void *reply) {
if (reply && c->push_cb && redisIsPushReply(reply)) {
c->push_cb(c->privdata, reply);
return 1;
}
return 0;
} | 0 | [
"CWE-190",
"CWE-680"
] | redis | 0215324a66af949be39b34be2d55143232c1cb71 | 17,949,616,800,183,380,000,000,000,000,000,000,000 | 8 | Fix redis-cli / redis-sential overflow on some platforms (CVE-2021-32762) (#9587)
The redis-cli command line tool and redis-sentinel service may be vulnerable
to integer overflow when parsing specially crafted large multi-bulk network
replies. This is a result of a vulnerability in the underlying hiredis
library wh... |
static void l2tp_eth_get_stats64(struct net_device *dev,
struct rtnl_link_stats64 *stats)
{
struct l2tp_eth *priv = netdev_priv(dev);
stats->tx_bytes = (unsigned long) atomic_long_read(&priv->tx_bytes);
stats->tx_packets = (unsigned long) atomic_long_read(&priv->tx_packets);
stats->tx_dropped = (unsigned lo... | 0 | [
"CWE-416"
] | linux | f026bc29a8e093edfbb2a77700454b285c97e8ad | 319,031,033,811,328,930,000,000,000,000,000,000,000 | 13 | l2tp: pass tunnel pointer to ->session_create()
Using l2tp_tunnel_find() in pppol2tp_session_create() and
l2tp_eth_create() is racy, because no reference is held on the
returned session. These functions are only used to implement the
->session_create callback which is run by l2tp_nl_cmd_session_create().
Therefore sea... |
void btrfs_describe_block_groups(u64 bg_flags, char *buf, u32 size_buf)
{
int i;
int ret;
char *bp = buf;
u64 flags = bg_flags;
u32 size_bp = size_buf;
if (!flags) {
strcpy(bp, "NONE");
return;
}
#define DESCRIBE_FLAG(flag, desc) \
do { \
if (flags & (flag)) { \
ret = snprintf(bp, siz... | 0 | [
"CWE-476",
"CWE-284"
] | linux | 09ba3bc9dd150457c506e4661380a6183af651c1 | 239,503,615,544,301,700,000,000,000,000,000,000,000 | 49 | btrfs: merge btrfs_find_device and find_device
Both btrfs_find_device() and find_device() does the same thing except
that the latter does not take the seed device onto account in the device
scanning context. We can merge them.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.c... |
_copyCreateTableSpaceStmt(const CreateTableSpaceStmt *from)
{
CreateTableSpaceStmt *newnode = makeNode(CreateTableSpaceStmt);
COPY_STRING_FIELD(tablespacename);
COPY_STRING_FIELD(owner);
COPY_STRING_FIELD(location);
COPY_NODE_FIELD(options);
return newnode;
} | 0 | [
"CWE-362"
] | postgres | 5f173040e324f6c2eebb90d86cf1b0cdb5890f0a | 120,046,043,921,083,070,000,000,000,000,000,000,000 | 11 | Avoid repeated name lookups during table and index DDL.
If the name lookups come to different conclusions due to concurrent
activity, we might perform some parts of the DDL on a different table
than other parts. At least in the case of CREATE INDEX, this can be
used to cause the permissions checks to be performed aga... |
void i40e_do_reset_safe(struct i40e_pf *pf, u32 reset_flags)
{
rtnl_lock();
i40e_do_reset(pf, reset_flags, true);
rtnl_unlock();
} | 0 | [
"CWE-400",
"CWE-401"
] | linux | 27d461333459d282ffa4a2bdb6b215a59d493a8f | 222,342,340,466,394,300,000,000,000,000,000,000,000 | 6 | i40e: prevent memory leak in i40e_setup_macvlans
In i40e_setup_macvlans if i40e_setup_channel fails the allocated memory
for ch should be released.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> |
StrUtil_SafeStrcatFV(char **prefix, // IN/OUT
const char *fmt, // IN
va_list args) // IN
{
char *str = Str_SafeVasprintf(NULL, fmt, args);
StrUtil_SafeStrcat(prefix, str);
free(str);
} | 0 | [
"CWE-362"
] | open-vm-tools | c1304ce8bfd9c0c33999e496bf7049d5c3d45821 | 141,165,110,673,743,250,000,000,000,000,000,000,000 | 8 | randomly generate tmp directory name, and add StrUtil_ReplaceAll() function. |
write_keyblock( IOBUF out, KBNODE node )
{
for( ; node ; node = node->next )
{
if(!is_deleted_kbnode(node))
{
int rc = build_packet( out, node->pkt );
if( rc )
{
log_error("build_packet(%d) failed: %s\n",
node->pkt->pkttype, gpg_strerror (rc) );
return rc;
}
}
}
ret... | 0 | [
"CWE-20"
] | gnupg | 2183683bd633818dd031b090b5530951de76f392 | 209,981,448,445,545,330,000,000,000,000,000,000,000 | 18 | Use inline functions to convert buffer data to scalars.
* common/host2net.h (buf16_to_ulong, buf16_to_uint): New.
(buf16_to_ushort, buf16_to_u16): New.
(buf32_to_size_t, buf32_to_ulong, buf32_to_uint, buf32_to_u32): New.
--
Commit 91b826a38880fd8a989318585eb502582636ddd8 was not enough to
avoid all sign extension on ... |
static int snd_pcm_oss_make_ready(struct snd_pcm_substream *substream)
{
struct snd_pcm_runtime *runtime;
int err;
runtime = substream->runtime;
if (runtime->oss.params) {
err = snd_pcm_oss_change_params(substream, false);
if (err < 0)
return err;
}
if (runtime->oss.prepare) {
if (mutex_lock_interruptib... | 0 | [
"CWE-362"
] | linux | 8423f0b6d513b259fdab9c9bf4aaa6188d054c2d | 97,111,665,086,173,120,000,000,000,000,000,000,000 | 21 | ALSA: pcm: oss: Fix race at SNDCTL_DSP_SYNC
There is a small race window at snd_pcm_oss_sync() that is called from
OSS PCM SNDCTL_DSP_SYNC ioctl; namely the function calls
snd_pcm_oss_make_ready() at first, then takes the params_lock mutex
for the rest. When the stream is set up again by another thread
between them, ... |
static int mod_i2c_mem(struct cmd_tbl *cmdtp, int incrflag, int flag, int argc,
char *const argv[])
{
uint chip;
ulong addr;
int alen;
ulong data;
int size = 1;
int nbytes;
int ret;
#if CONFIG_IS_ENABLED(DM_I2C)
struct udevice *dev;
#endif
if (argc != 3)
return CMD_RET_USAGE;
bootretry_reset_cmd_... | 0 | [
"CWE-787"
] | u-boot | 8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409 | 245,573,572,715,500,840,000,000,000,000,000,000,000 | 133 | i2c: fix stack buffer overflow vulnerability in i2c md command
When running "i2c md 0 0 80000100", the function do_i2c_md parses the
length into an unsigned int variable named length. The value is then
moved to a signed variable:
int nbytes = length;
#define DISP_LINE_LEN 16
int linebytes = (nbytes > DISP... |
char *gf_seng_get_base64_iod(GF_SceneEngine *seng)
{
u32 size, size64;
u8 *buffer, *buf64;
u32 i=0;
GF_StreamContext*sc = NULL;
if (!seng->ctx->root_od) return NULL;
while ((sc = (GF_StreamContext*)gf_list_enum(seng->ctx->streams, &i))) {
if ((sc->streamType == GF_STREAM_SCENE) && (sc->codec_id != GF_CODECID_... | 1 | [
"CWE-787"
] | gpac | ea1eca00fd92fa17f0e25ac25652622924a9a6a0 | 37,420,333,800,989,740,000,000,000,000,000,000,000 | 23 | fixed #2138 |
int ha_maria::restart_rnd_next(uchar *buf)
{
int error;
register_handler(file);
if ((error= (*file->s->scan_restore_pos)(file, remember_pos)))
return error;
return rnd_next(buf);
} | 0 | [
"CWE-400"
] | server | 9e39d0ae44595dbd1570805d97c9c874778a6be8 | 122,943,761,819,597,190,000,000,000,000,000,000,000 | 8 | MDEV-25787 Bug report: crash on SELECT DISTINCT thousands_blob_fields
fix a debug assert to account for not opened temp tables |
uchar* rsCStrGetSzStrNoNULL(cstr_t *pThis)
{
rsCHECKVALIDOBJECT(pThis, OIDrsCStr);
if(pThis->pBuf == NULL)
return (uchar*) "";
else
return rsCStrGetSzStr(pThis);
} | 0 | [
"CWE-189"
] | rsyslog | 6bad782f154b7f838c7371bf99c13f6dc4ec4101 | 282,650,749,620,990,160,000,000,000,000,000,000,000 | 8 | bugfix: abort if imfile reads file line of more than 64KiB
Thanks to Peter Eisentraut for reporting and analysing this problem.
bug tracker: http://bugzilla.adiscon.com/show_bug.cgi?id=221 |
GC_API void GC_CALL GC_init(void)
{
/* LOCK(); -- no longer does anything this early. */
word initial_heap_sz;
IF_CANCEL(int cancel_state;)
if (EXPECT(GC_is_initialized, TRUE)) return;
# ifdef REDIRECT_MALLOC
{
static GC_bool init_started = FALSE;
if (init_started)
ABO... | 0 | [
"CWE-119"
] | bdwgc | 7292c02fac2066d39dd1bcc37d1a7054fd1e32ee | 112,896,858,500,178,030,000,000,000,000,000,000,000 | 457 | 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... |
static PHP_FUNCTION(xmlwriter_start_dtd_attlist)
{
php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterStartDTDAttlist, "Invalid Element Name");
} | 0 | [
"CWE-20"
] | php-src | 52b93f0cfd3cba7ff98cc5198df6ca4f23865f80 | 330,284,592,748,744,340,000,000,000,000,000,000,000 | 4 | Fixed bug #69353 (Missing null byte checks for paths in various PHP extensions) |
GF_Err gnrv_dump(GF_Box *a, FILE * trace)
{
GF_GenericVisualSampleEntryBox *p = (GF_GenericVisualSampleEntryBox *)a;
if (p->EntryType)
a->type = p->EntryType;
gf_isom_box_dump_start(a, "VisualSampleDescriptionBox", trace);
fprintf(trace, "DataReferenceIndex=\"%d\" Version=\"%d\" Revision=\"%d\" Vendor=\"%d\" Tem... | 0 | [
"CWE-125"
] | gpac | bceb03fd2be95097a7b409ea59914f332fb6bc86 | 227,525,430,641,661,080,000,000,000,000,000,000,000 | 13 | fixed 2 possible heap overflows (inc. #1088) |
HTTPSession::describe(std::ostream& os) const {
os << "proto=" << getCodecProtocolString(codec_->getProtocol());
if (isDownstream()) {
os << ", UA=" << codec_->getUserAgent()
<< ", downstream=" << getPeerAddress() << ", " << getLocalAddress()
<< "=local";
} else {
os << ", local=" << getLoca... | 0 | [
"CWE-20"
] | proxygen | 0600ebe59c3e82cd012def77ca9ca1918da74a71 | 331,401,664,761,687,150,000,000,000,000,000,000,000 | 11 | Check that a secondary auth manager is set before dereferencing.
Summary: CVE-2018-6343
Reviewed By: mingtaoy
Differential Revision: D12994423
fbshipit-source-id: 9229ec11da8085f1fa153595e8e5353e19d06fb7 |
Http::FilterFactoryCb createFilter(const std::string&,
Server::Configuration::FactoryContext&) override {
return [](Http::FilterChainFactoryCallbacks& callbacks) -> void {
callbacks.addStreamDecoderFilter(
std::make_shared<HeaderToFilterStateFilter>("jwt_select... | 0 | [
"CWE-476",
"CWE-703"
] | envoy | 9371333230b1a6e1be2eccf4868771e11af6253a | 14,273,994,742,787,603,000,000,000,000,000,000,000 | 7 | CVE-2021-43824
jwt_atuhn: fixed the crash when a CONNECT request is sent to JWT filter
configured with regex match.
Signed-off-by: Yan Avlasov <yavlasov@google.com> |
int lg4ff_deinit(struct hid_device *hid)
{
struct lg4ff_device_entry *entry;
struct lg_drv_data *drv_data;
drv_data = hid_get_drvdata(hid);
if (!drv_data) {
hid_err(hid, "Error while deinitializing device, no private driver data.\n");
return -1;
}
entry = drv_data->device_props;
if (!entry)
goto out; /* N... | 0 | [
"CWE-787"
] | linux | d9d4b1e46d9543a82c23f6df03f4ad697dab361b | 102,277,876,439,328,200,000,000,000,000,000,000,000 | 46 | HID: Fix assumption that devices have inputs
The syzbot fuzzer found a slab-out-of-bounds write bug in the hid-gaff
driver. The problem is caused by the driver's assumption that the
device must have an input report. While this will be true for all
normal HID input devices, a suitably malicious device can violate the... |
static void bio_dirty_fn(struct work_struct *work)
{
unsigned long flags;
struct bio *bio;
spin_lock_irqsave(&bio_dirty_lock, flags);
bio = bio_dirty_list;
bio_dirty_list = NULL;
spin_unlock_irqrestore(&bio_dirty_lock, flags);
while (bio) {
struct bio *next = bio->bi_private;
bio_set_pages_dirty(bio);
b... | 0 | [
"CWE-772",
"CWE-787"
] | linux | 95d78c28b5a85bacbc29b8dba7c04babb9b0d467 | 339,366,643,743,423,450,000,000,000,000,000,000,000 | 19 | fix unbalanced page refcounting in bio_map_user_iov
bio_map_user_iov and bio_unmap_user do unbalanced pages refcounting if
IO vector has small consecutive buffers belonging to the same page.
bio_add_pc_page merges them into one, but the page reference is never
dropped.
Cc: stable@vger.kernel.org
Signed-off-by: Vitaly... |
ip_restart(self)
VALUE self;
{
struct tcltkip *ptr = get_ip(self);
tcl_stubs_check();
/* ip is deleted? */
if (deleted_ip(ptr)) {
rb_raise(rb_eRuntimeError, "interpreter is deleted");
}
if (Tcl_GetMaster(ptr->ip) != (Tcl_Interp*)NULL) {
/* slave IP */
return Qnil;... | 0 | [] | tk | ebd0fc80d62eeb7b8556522256f8d035e013eb65 | 183,576,514,103,009,930,000,000,000,000,000,000,000 | 19 | tcltklib.c: check argument
* ext/tk/tcltklib.c (ip_cancel_eval_core): check argument type and
length.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
static int uas_pre_reset(struct usb_interface *intf)
{
struct Scsi_Host *shost = usb_get_intfdata(intf);
struct uas_dev_info *devinfo = (struct uas_dev_info *)shost->hostdata;
unsigned long flags;
if (devinfo->shutdown)
return 0;
/* Block new requests */
spin_lock_irqsave(shost->host_lock, flags);
scsi_block... | 0 | [
"CWE-125"
] | linux | 786de92b3cb26012d3d0f00ee37adf14527f35c4 | 153,505,440,247,354,300,000,000,000,000,000,000,000 | 24 | USB: uas: fix bug in handling of alternate settings
The uas driver has a subtle bug in the way it handles alternate
settings. The uas_find_uas_alt_setting() routine returns an
altsetting value (the bAlternateSetting number in the descriptor), but
uas_use_uas_driver() then treats that value as an index to the
intf->al... |
int luaV_equalobj (lua_State *L, const TValue *t1, const TValue *t2) {
const TValue *tm;
if (ttypetag(t1) != ttypetag(t2)) { /* not the same variant? */
if (ttype(t1) != ttype(t2) || ttype(t1) != LUA_TNUMBER)
return 0; /* only numbers can be equal with different variants */
else { /* two numbers wi... | 0 | [
"CWE-787"
] | lua | 42d40581dd919fb134c07027ca1ce0844c670daf | 277,674,981,690,721,270,000,000,000,000,000,000,000 | 50 | Save stack space while handling errors
Because error handling (luaG_errormsg) uses slots from EXTRA_STACK,
and some errors can recur (e.g., string overflow while creating an
error message in 'luaG_runerror', or a C-stack overflow before calling
the message handler), the code should use stack slots with parsimony.
Thi... |
void ConnectionManagerImpl::ActiveStream::encode1xxHeaders(ResponseHeaderMap& response_headers) {
// Strip the T-E headers etc. Defer other header additions as well as drain-close logic to the
// continuation headers.
ConnectionManagerUtility::mutateResponseHeaders(
response_headers, request_headers_.get(),... | 0 | [
"CWE-416"
] | envoy | 148de954ed3585d8b4298b424aa24916d0de6136 | 170,488,872,920,953,820,000,000,000,000,000,000,000 | 16 | CVE-2021-43825
Response filter manager crash
Signed-off-by: Yan Avlasov <yavlasov@google.com> |
cli_file_t cli_get_container(cli_ctx *ctx, int index)
{
if (index < 0)
index = ctx->recursion + index + 1;
while (index >= 0 && index <= ctx->recursion) {
if (ctx->containers[index].flag & CONTAINER_FLAG_VALID)
return ctx->containers[index].type;
index--;
}
return CL_TYPE_AN... | 0 | [] | clamav-devel | 167c0079292814ec5523d0b97a9e1b002bf8819b | 52,397,214,044,034,490,000,000,000,000,000,000,000 | 11 | fix 0.99.3 false negative of virus Pdf.Exploit.CVE_2016_1046-1. |
STBIDEF void stbi_ldr_to_hdr_scale(float scale) { stbi__l2h_scale = scale; } | 0 | [
"CWE-787"
] | stb | 5ba0baaa269b3fd681828e0e3b3ac0f1472eaf40 | 211,930,133,152,697,270,000,000,000,000,000,000,000 | 1 | 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. |
item_copy(
typval_T *from,
typval_T *to,
int deep,
int copyID)
{
static int recurse = 0;
int ret = OK;
if (recurse >= DICT_MAXNEST)
{
emsg(_("E698: variable nested too deep for making a copy"));
return FAIL;
}
++recurse;
switch (from->v_type)
{
case VAR_NUMBER:
c... | 0 | [
"CWE-122",
"CWE-787"
] | vim | 605ec91e5a7330d61be313637e495fa02a6dc264 | 97,971,921,029,349,840,000,000,000,000,000,000,000 | 74 | patch 8.2.3847: illegal memory access when using a lambda with an error
Problem: Illegal memory access when using a lambda with an error.
Solution: Avoid skipping over the NUL after a string. |
static inline int GetSliceShape(const int slice_index, const int split_size,
const int residual) {
DCHECK_GT(split_size, 0);
DCHECK_GE(slice_index, 0);
if (residual == 0) return split_size;
if (slice_index < residual) {
return split_size + 1;
} else {
... | 0 | [
"CWE-703",
"CWE-787"
] | tensorflow | 8ba6fa29cd8bf9cef9b718dc31c78c73081f5b31 | 328,740,743,439,105,120,000,000,000,000,000,000,000 | 11 | Fix heap-buffer-overflow issue with `tf.raw_ops.SparseSplit`.
PiperOrigin-RevId: 371242872
Change-Id: I482bb3d12602c7c3cc9446f97fb9f584bb98e9a4 |
static MagickBooleanType WriteBMPImage(const ImageInfo *image_info,Image *image)
{
BMPInfo
bmp_info;
BMPSubtype
bmp_subtype;
const char
*option;
const StringInfo
*profile;
MagickBooleanType
have_color_info,
status;
MemoryInfo
*pixel_info;
MagickOffsetType
scene;
re... | 1 | [
"CWE-787"
] | ImageMagick6 | 081f518eb9cb38e683b8b9ccb9e4ab5c52f82c2f | 299,334,131,309,493,400,000,000,000,000,000,000,000 | 768 | https://github.com/ImageMagick/ImageMagick/issues/1177 |
main (int argc, char **argv)
{
char *keys;
size_t keycc, oldcc, keyalloc;
int with_filenames;
size_t cc;
int opt, status, prepended;
int prev_optind, last_recursive;
intmax_t default_context;
FILE *fp;
exit_failure = EXIT_TROUBLE;
initialize_main (&argc, &argv);
set_program_name (argv[0]);
progr... | 0 | [
"CWE-189"
] | grep | 8fcf61523644df42e1905c81bed26838e0b04f91 | 123,783,434,567,238,600,000,000,000,000,000,000,000 | 459 | grep: fix integer-overflow issues in main program
* NEWS: Document this.
* bootstrap.conf (gnulib_modules): Add inttypes, xstrtoimax.
Remove xstrtoumax.
* src/main.c: Include <inttypes.h>, for INTMAX_MAX, PRIdMAX.
(context_length_arg, prtext, grepbuf, grep, grepfile)
(get_nondigit_option, main):
Use intmax_t, not int,... |
static bool reg_scratched(const struct bpf_verifier_env *env, u32 regno)
{
return (env->scratched_regs >> regno) & 1;
} | 0 | [
"CWE-787"
] | linux | 64620e0a1e712a778095bd35cbb277dc2259281f | 135,576,542,719,146,000,000,000,000,000,000,000,000 | 4 | bpf: Fix out of bounds access for ringbuf helpers
Both bpf_ringbuf_submit() and bpf_ringbuf_discard() have ARG_PTR_TO_ALLOC_MEM
in their bpf_func_proto definition as their first argument. They both expect
the result from a prior bpf_ringbuf_reserve() call which has a return type of
RET_PTR_TO_ALLOC_MEM_OR_NULL.
Meani... |
void SNC_io_parser<EW>::print_volume(Volume_handle c) const
{ // syntax: index { shlist } mark
out << index(c) << " { ";
Shell_entry_iterator it;
CGAL_forall_shells_of(it,c)
if(!reduce || Infi_box::is_standard(SFace_handle(it)->center_vertex()->point()))
out << index(SFace_handle(it)) << ' ';
out << "... | 0 | [
"CWE-125"
] | cgal | 5a1ab45058112f8647c14c02f58905ecc597ec76 | 318,944,369,263,817,780,000,000,000,000,000,000,000 | 9 | Fix Nef_3 |
LJ_NOINLINE void lj_err_msg(lua_State *L, ErrMsg em)
{
err_msgv(L, em);
} | 0 | [
"CWE-125"
] | LuaJIT | 53f82e6e2e858a0a62fd1a2ff47e9866693382e6 | 234,166,330,564,622,250,000,000,000,000,000,000,000 | 4 | Fix frame traversal for __gc handler frames.
Reported by Changochen. |
enum store_item_type do_store_item(item *it, int comm, conn *c, const uint32_t hv) {
char *key = ITEM_key(it);
item *old_it = do_item_get(key, it->nkey, hv, c);
enum store_item_type stored = NOT_STORED;
item *new_it = NULL;
uint32_t flags;
if (old_it != NULL && comm == NREAD_ADD) {
/* ... | 0 | [
"CWE-190"
] | memcached | bd578fc34b96abe0f8d99c1409814a09f51ee71c | 88,475,716,453,986,090,000,000,000,000,000,000,000 | 108 | CVE reported by cisco talos |
static struct bsg_device *__bsg_get_device(int minor, struct request_queue *q)
{
struct bsg_device *bd;
mutex_lock(&bsg_mutex);
hlist_for_each_entry(bd, bsg_dev_idx_hash(minor), dev_list) {
if (bd->queue == q) {
atomic_inc(&bd->ref_count);
goto found;
}
}
bd = NULL;
found:
mutex_unlock(&bsg_mutex);
r... | 0 | [
"CWE-416",
"CWE-787"
] | linux | 128394eff343fc6d2f32172f03e24829539c5835 | 263,313,868,351,322,450,000,000,000,000,000,000,000 | 17 | sg_write()/bsg_write() is not fit to be called under KERNEL_DS
Both damn things interpret userland pointers embedded into the payload;
worse, they are actually traversing those. Leaving aside the bad
API design, this is very much _not_ safe to call with KERNEL_DS.
Bail out early if that happens.
Cc: stable@vger.kern... |
bool stmt_create_routine_start(const DDL_options_st &options)
{
create_info.set(options);
return main_select_push() || check_create_options(options);
} | 0 | [
"CWE-703"
] | server | 39feab3cd31b5414aa9b428eaba915c251ac34a2 | 154,428,893,404,248,870,000,000,000,000,000,000,000 | 5 | MDEV-26412 Server crash in Item_field::fix_outer_field for INSERT SELECT
IF an INSERT/REPLACE SELECT statement contained an ON expression in the top
level select and this expression used a subquery with a column reference
that could not be resolved then an attempt to resolve this reference as
an outer reference caused... |
int ext4_update_disksize_before_punch(struct inode *inode, loff_t offset,
loff_t len)
{
handle_t *handle;
loff_t size = i_size_read(inode);
WARN_ON(!mutex_is_locked(&inode->i_mutex));
if (offset > size || offset + len < size)
return 0;
if (EXT4_I(inode)->i_disksize >= size)
return 0;
handle = ext... | 0 | [
"CWE-362"
] | linux | 011278485ecc3cd2a3954b5d4c73101d919bf1fa | 94,171,545,374,768,970,000,000,000,000,000,000,000 | 22 | ext4: fix races of writeback with punch hole and zero range
When doing delayed allocation, update of on-disk inode size is postponed
until IO submission time. However hole punch or zero range fallocate
calls can end up discarding the tail page cache page and thus on-disk
inode size would never be properly updated.
Ma... |
static OPJ_BOOL opj_j2k_write_all_qcc(opj_j2k_t *p_j2k,
struct opj_stream_private *p_stream,
struct opj_event_mgr * p_manager )
{
OPJ_UINT32 compno;
/* precond... | 0 | [
"CWE-416"
] | openjpeg | 940100c28ae28931722290794889cf84a92c5f6f | 313,310,761,172,877,260,000,000,000,000,000,000,000 | 20 | Fix potential use-after-free in opj_j2k_write_mco function
Fixes #563 |
static int i8042_enable_mux_ports(void)
{
unsigned char param;
int i;
for (i = 0; i < I8042_NUM_MUX_PORTS; i++) {
i8042_command(¶m, I8042_CMD_MUX_PFX + i);
i8042_command(¶m, I8042_CMD_AUX_ENABLE);
}
return i8042_enable_aux_port();
} | 0 | [
"CWE-476"
] | linux | 340d394a789518018f834ff70f7534fc463d3226 | 151,670,411,448,687,340,000,000,000,000,000,000,000 | 12 | Input: i8042 - fix crash at boot time
The driver checks port->exists twice in i8042_interrupt(), first when
trying to assign temporary "serio" variable, and second time when deciding
whether it should call serio_interrupt(). The value of port->exists may
change between the 2 checks, and we may end up calling serio_int... |
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 | [] | linux | 196d67593439b03088913227093e374235596e33 | 283,202,647,923,532,750,000,000,000,000,000,000,000 | 71 | sctp: Add support to per-association statistics via a new SCTP_GET_ASSOC_STATS call
The current SCTP stack is lacking a mechanism to have per association
statistics. This is an implementation modeled after OpenSolaris'
SCTP_GET_ASSOC_STATS.
Userspace part will follow on lksctp if/when there is a general ACK on
this.
... |
TEST(AsyncSSLSocketTest, LoadCertFromMemory) {
using folly::ssl::OpenSSLUtils;
auto cert = getFileAsBuf(kTestCert);
auto key = getFileAsBuf(kTestKey);
ssl::BioUniquePtr certBio(BIO_new(BIO_s_mem()));
BIO_write(certBio.get(), cert.data(), cert.size());
ssl::BioUniquePtr keyBio(BIO_new(BIO_s_mem()));
BIO_w... | 0 | [
"CWE-125"
] | folly | c321eb588909646c15aefde035fd3133ba32cdee | 257,005,083,110,972,300,000,000,000,000,000,000,000 | 41 | Handle close_notify as standard writeErr in AsyncSSLSocket.
Summary: Fixes CVE-2019-11934
Reviewed By: mingtaoy
Differential Revision: D18020613
fbshipit-source-id: db82bb250e53f0d225f1280bd67bc74abd417836 |
static int idr_get_empty_slot(struct idr *idp, int starting_id,
struct idr_layer **pa)
{
struct idr_layer *p, *new;
int layers, v, id;
unsigned long flags;
id = starting_id;
build_up:
p = idp->top;
layers = idp->layers;
if (unlikely(!p)) {
if (!(p = get_from_free_list(idp)))
return -1;
p->layer ... | 0 | [] | linux | 2dcb22b346be7b7b7e630a8970d69cf3f1111ec1 | 182,013,297,615,363,720,000,000,000,000,000,000,000 | 60 | idr: fix backtrack logic in idr_remove_all
Currently idr_remove_all will fail with a use after free error if
idr::layers is bigger than 2, which on 32 bit systems corresponds to items
more than 1024. This is due to stepping back too many levels during
backtracking. For simplicity let's assume that IDR_BITS=1 -> we h... |
cmsBool IsDegenerated(const cmsToneCurve* g)
{
int i, Zeros = 0, Poles = 0;
int nEntries = g ->nEntries;
for (i=0; i < nEntries; i++) {
if (g ->Table16[i] == 0x0000) Zeros++;
if (g ->Table16[i] == 0xffff) Poles++;
}
if (Zeros == 1 && Poles == 1) return FALSE; // For linear tables... | 0 | [] | Little-CMS | 41d222df1bc6188131a8f46c32eab0a4d4cdf1b6 | 132,724,784,189,618,610,000,000,000,000,000,000,000 | 17 | 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... |
static inline unsigned int FNAME(golomb_code)(const BYTE n, const unsigned int l)
{
return VNAME(family).golomb_code[n][l];
} | 0 | [] | spice-common | b24fe6b66b86e601c725d30f00c37e684b6395b6 | 193,956,023,172,271,700,000,000,000,000,000,000,000 | 4 | quic: Avoid possible buffer overflow in find_bucket
Proved by fuzzing the code.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <uril@redhat.com> |
MasteringMetadata()
: r(NULL),
g(NULL),
b(NULL),
white_point(NULL),
luminance_max(kValueNotPresent),
luminance_min(kValueNotPresent) {} | 0 | [
"CWE-20"
] | libvpx | f00890eecdf8365ea125ac16769a83aa6b68792d | 195,513,684,069,109,300,000,000,000,000,000,000,000 | 7 | update libwebm to libwebm-1.0.0.27-352-g6ab9fcf
https://chromium.googlesource.com/webm/libwebm/+log/af81f26..6ab9fcf
Change-Id: I9d56e1fbaba9b96404b4fbabefddc1a85b79c25d |
bool is_item_tree_change_register_required()
{
return !stmt_arena->is_conventional();
} | 0 | [
"CWE-416"
] | server | 4681b6f2d8c82b4ec5cf115e83698251963d80d5 | 218,862,704,646,218,320,000,000,000,000,000,000,000 | 4 | MDEV-26281 ASAN use-after-poison when complex conversion is involved in blob
the bug was that in_vector array in Item_func_in was allocated in the
statement arena, not in the table->expr_arena.
revert part of the 5acd391e8b2d. Instead, change the arena correctly
in fix_all_session_vcol_exprs().
Remove TABLE_ARENA, t... |
static void my_caldav_auth(const char *userid)
{
char *mailboxname;
int r;
/* Generate mailboxname of calendar-home-set */
mailboxname = caldav_mboxname(userid, NULL);
if (httpd_userisadmin ||
global_authisa(httpd_authstate, IMAPOPT_PROXYSERVERS)) {
/* admin or proxy from frontend - won't have D... | 0 | [
"CWE-787"
] | cyrus-imapd | a5779db8163b99463e25e7c476f9cbba438b65f3 | 215,948,126,469,409,000,000,000,000,000,000,000,000 | 99 | HTTP: don't overrun buffer when parsing strings with sscanf() |
static int des1_set_key(struct ssh_cipher_struct *cipher, void *key, void *IV){
if(!cipher->key){
if (alloc_key(cipher) < 0) {
return -1;
}
DES_set_odd_parity(key);
DES_set_key_unchecked(key,cipher->key);
}
cipher->IV=IV;
return 0;
} | 0 | [
"CWE-310"
] | libssh | e99246246b4061f7e71463f8806b9dcad65affa0 | 10,066,577,575,919,927,000,000,000,000,000,000,000 | 11 | security: fix for vulnerability CVE-2014-0017
When accepting a new connection, a forking server based on libssh forks
and the child process handles the request. The RAND_bytes() function of
openssl doesn't reset its state after the fork, but simply adds the
current process id (getpid) to the PRNG state, which is not g... |
static void stack_map_free(struct bpf_map *map)
{
struct bpf_stack_map *smap = container_of(map, struct bpf_stack_map, map);
bpf_map_area_free(smap->elems);
pcpu_freelist_destroy(&smap->freelist);
bpf_map_area_free(smap);
put_callchain_buffers();
} | 0 | [
"CWE-190",
"CWE-787"
] | linux | 30e29a9a2bc6a4888335a6ede968b75cd329657a | 183,861,260,883,085,230,000,000,000,000,000,000,000 | 9 | bpf: Fix integer overflow in prealloc_elems_and_freelist()
In prealloc_elems_and_freelist(), the multiplication to calculate the
size passed to bpf_map_area_alloc() could lead to an integer overflow.
As a result, out-of-bounds write could occur in pcpu_freelist_populate()
as reported by KASAN:
[...]
[ 16.968613] BU... |
des_decrypt_cbc(const unsigned char *key, int keysize, unsigned char iv[EVP_MAX_IV_LENGTH],
const unsigned char *input, size_t length, unsigned char *output)
{
return openssl_dec(EVP_des_cbc(), key, iv, input, length, output);
} | 0 | [
"CWE-415",
"CWE-119"
] | OpenSC | 360e95d45ac4123255a4c796db96337f332160ad | 291,746,675,333,189,450,000,000,000,000,000,000,000 | 5 | fixed out of bounds writes
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting the problems. |
parameter_brace_expand_word (name, var_is_special, quoted, pflags, indp)
char *name;
int var_is_special, quoted, pflags;
arrayind_t *indp;
{
WORD_DESC *ret;
char *temp, *tt;
intmax_t arg_index;
SHELL_VAR *var;
int atype, rflags;
arrayind_t ind;
ret = 0;
temp = 0;
rflags = 0;
if (ind... | 1 | [] | bash | 955543877583837c85470f7fb8a97b7aa8d45e6c | 181,732,031,569,977,050,000,000,000,000,000,000,000 | 131 | bash-4.4-rc2 release |
int ssl_parse_change_cipher_spec( ssl_context *ssl )
{
int ret;
SSL_DEBUG_MSG( 2, ( "=> parse change cipher spec" ) );
if( ( ret = ssl_read_record( ssl ) ) != 0 )
{
SSL_DEBUG_RET( 1, "ssl_read_record", ret );
return( ret );
}
if( ssl->in_msgtype != SSL_MSG_CHANGE_CIPHER_SPEC )... | 0 | [
"CWE-310"
] | polarssl | 4582999be608c9794d4518ae336b265084db9f93 | 206,024,436,291,142,300,000,000,000,000,000,000,000 | 30 | Fixed timing difference resulting from badly formatted padding. |
void SplashOutputDev::updateLineCap(GfxState *state) {
splash->setLineCap(state->getLineCap());
} | 0 | [
"CWE-369"
] | poppler | b224e2f5739fe61de9fa69955d016725b2a4b78d | 122,223,181,275,910,160,000,000,000,000,000,000,000 | 3 | SplashOutputDev::tilingPatternFill: Fix crash on broken file
Issue #802 |
static ulong find_set(TYPELIB *lib, const char *x, size_t length,
char **err_pos, uint *err_len)
{
const char *end= x + length;
ulong found= 0;
uint find;
char buff[255];
*err_pos= 0; /* No error yet */
while (end > x && my_isspace(charset_info, end[-1]))
end--;
... | 0 | [
"CWE-319"
] | mysql-server | 0002e1380d5f8c113b6bce91f2cf3f75136fd7c7 | 149,723,859,886,822,600,000,000,000,000,000,000,000 | 39 | BUG#25575605: SETTING --SSL-MODE=REQUIRED SENDS CREDENTIALS BEFORE VERIFYING SSL CONNECTION
MYSQL_OPT_SSL_MODE option introduced.
It is set in case of --ssl-mode=REQUIRED and permits only SSL connection.
(cherry picked from commit f91b941842d240b8a62645e507f5554e8be76aec) |
add_selected_fd (GtkTreeModel *model,
GtkTreePath *path,
GtkTreeIter *iter,
gpointer data)
{
GList **list = data;
FileData *fdata;
gtk_tree_model_get (model, iter,
COLUMN_FILE_DATA, &fdata,
-1);
if (! fdata->list_dir)
*list = g_list_prepend (*list, fdata);
} | 0 | [
"CWE-22"
] | file-roller | b147281293a8307808475e102a14857055f81631 | 246,476,367,680,256,600,000,000,000,000,000,000,000 | 14 | libarchive: sanitize filenames before extracting |
xmlParseEntityDecl(xmlParserCtxtPtr ctxt) {
const xmlChar *name = NULL;
xmlChar *value = NULL;
xmlChar *URI = NULL, *literal = NULL;
const xmlChar *ndata = NULL;
int isParameter = 0;
xmlChar *orig = NULL;
/* GROW; done in the caller */
if (CMP8(CUR_PTR, '<', '!', 'E', 'N', 'T', 'I', 'T'... | 0 | [
"CWE-703",
"CWE-835"
] | libxml2 | 899a5d9f0ed13b8e32449a08a361e0de127dd961 | 167,093,547,860,771,680,000,000,000,000,000,000,000 | 242 | Detect infinite recursion in parameter entities
When expanding a parameter entity in a DTD, infinite recursion could
lead to an infinite loop or memory exhaustion.
Thanks to Wei Lei for the first of many reports.
Fixes bug 759579. |
empe_app_smime_parse (EMailParserExtension *extension,
EMailParser *parser,
CamelMimePart *part,
GString *part_id,
GCancellable *cancellable,
GQueue *out_mail_parts)
{
CamelCipherContext *context;
CamelMimePa... | 1 | [
"CWE-347"
] | evolution | f66cd3e1db301d264563b4222a3574e2e58e2b85 | 49,931,067,823,291,520,000,000,000,000,000,000,000 | 96 | eds-I#3 - [GPG] Mails that are not encrypted look encrypted
Related to https://gitlab.gnome.org/GNOME/evolution-data-server/issues/3 |
static void test_json_append_escaped_data(void)
{
static const unsigned char test_input[] =
"\b\f\r\n\t\"\\\000\001\002-\xC3\xA4\xf0\x90\x90\xb7\xff";
string_t *str = t_str_new(32);
test_begin("json_append_escaped()");
json_append_escaped_data(str, test_input, sizeof(test_input)-1);
test_assert(strcmp(str_c(str... | 0 | [] | core | 973769d74433de3c56c4ffdf4f343cb35d98e4f7 | 9,920,790,476,156,647,000,000,000,000,000,000,000 | 11 | lib: json - Escape invalid UTF-8 as unicode bytes
This prevents dovecot from crashing if invalid UTF-8 input
is given. |
static int f2fs_drop_inode(struct inode *inode)
{
/*
* This is to avoid a deadlock condition like below.
* writeback_single_inode(inode)
* - f2fs_write_data_page
* - f2fs_gc -> iput -> evict
* - inode_wait_for_writeback(inode)
*/
if (!inode_unhashed(inode) && inode->i_state & I_SYNC) {
if (!in... | 0 | [
"CWE-787"
] | linux | 9a59b62fd88196844cee5fff851bee2cfd7afb6e | 327,154,618,265,904,570,000,000,000,000,000,000,000 | 42 | f2fs: do more integrity verification for superblock
Do more sanity check for superblock during ->mount.
Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> |
sph_enc16be(void *dst, unsigned val)
{
((unsigned char *)dst)[0] = (val >> 8);
((unsigned char *)dst)[1] = val;
} | 1 | [
"CWE-787"
] | qpdf | d71f05ca07eb5c7cfa4d6d23e5c1f2a800f52e8e | 214,818,763,764,738,500,000,000,000,000,000,000,000 | 5 | Fix sign and conversion warnings (major)
This makes all integer type conversions that have potential data loss
explicit with calls that do range checks and raise an exception. After
this commit, qpdf builds with no warnings when -Wsign-conversion
-Wconversion is used with gcc or clang or when -W3 -Wd4800 is used
with ... |
PHP_FUNCTION(sys_get_temp_dir)
{
if (zend_parse_parameters_none() == FAILURE) {
return;
}
RETURN_STRING((char *)php_get_temporary_directory(), 1);
} | 0 | [
"CWE-19"
] | php-src | be9b2a95adb504abd5acdc092d770444ad6f6854 | 60,151,861,740,663,500,000,000,000,000,000,000,000 | 7 | Fixed bug #69418 - more s->p fixes for filenames |
handle_cmddeny(CMD_Request *rx_message, CMD_Reply *tx_message)
{
IPAddr ip;
int subnet_bits;
UTI_IPNetworkToHost(&rx_message->data.allow_deny.ip, &ip);
subnet_bits = ntohl(rx_message->data.allow_deny.subnet_bits);
if (CAM_AddAccessRestriction(&ip, subnet_bits, 0, 0)) {
tx_message->status = htons(STT_SUCCE... | 0 | [
"CWE-189"
] | chrony | 7712455d9aa33d0db0945effaa07e900b85987b1 | 96,275,274,664,561,670,000,000,000,000,000,000,000 | 12 | Fix buffer overflow when processing crafted command packets
When the length of the REQ_SUBNETS_ACCESSED, REQ_CLIENT_ACCESSES
command requests and the RPY_SUBNETS_ACCESSED, RPY_CLIENT_ACCESSES,
RPY_CLIENT_ACCESSES_BY_INDEX, RPY_MANUAL_LIST command replies is
calculated, the number of items stored in the packet is not v... |
f_argv(typval_T *argvars, typval_T *rettv)
{
int idx;
aentry_T *arglist = NULL;
int argcount = -1;
if (in_vim9script()
&& (check_for_opt_number_arg(argvars, 0) == FAIL
|| (argvars[0].v_type != VAR_UNKNOWN
&& check_for_opt_number_arg(argvars, 1) == FAIL)))
return;
if (argvars[0].v_t... | 0 | [
"CWE-416",
"CWE-125"
] | vim | 6f98371532fcff911b462d51bc64f2ce8a6ae682 | 254,738,881,497,779,120,000,000,000,000,000,000,000 | 48 | patch 8.2.3884: crash when clearing the argument list while using it
Problem: Crash when clearing the argument list while using it.
Solution: Lock the argument list for ":all". |
static int crypto_reportstat_one(struct crypto_alg *alg,
struct crypto_user_alg *ualg,
struct sk_buff *skb)
{
memset(ualg, 0, sizeof(*ualg));
strscpy(ualg->cru_name, alg->cra_name, sizeof(ualg->cru_name));
strscpy(ualg->cru_driver_name, alg->cra_driver_name,
sizeof(ualg->cru_driver_name));
strscpy(ualg... | 0 | [
"CWE-400",
"CWE-284",
"CWE-401"
] | linux | c03b04dcdba1da39903e23cc4d072abf8f68f2dd | 61,702,080,449,094,180,000,000,000,000,000,000,000 | 90 | crypto: user - fix memory leak in crypto_reportstat
In crypto_reportstat, a new skb is created by nlmsg_new(). This skb is
leaked if crypto_reportstat_alg() fails. Required release for skb is
added.
Fixes: cac5818c25d0 ("crypto: user - Implement a generic crypto statistics")
Cc: <stable@vger.kernel.org>
Signed-off-by... |
CImg<T>& draw_image(const int x0, const int y0,
const CImg<t>& sprite, const float opacity=1) {
return draw_image(x0,y0,0,sprite,opacity);
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 33,321,315,321,978,380,000,000,000,000,000,000,000 | 4 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
int Lex_input_stream::scan_ident_delimited(THD *thd,
Lex_ident_cli_st *str,
uchar quote_char)
{
CHARSET_INFO *const cs= thd->charset();
uint double_quotes= 0;
uchar c;
DBUG_ASSERT(m_ptr == m_tok_start + 1);
for ( ; ; )
{
... | 0 | [
"CWE-703"
] | server | 39feab3cd31b5414aa9b428eaba915c251ac34a2 | 84,822,793,225,673,850,000,000,000,000,000,000,000 | 54 | MDEV-26412 Server crash in Item_field::fix_outer_field for INSERT SELECT
IF an INSERT/REPLACE SELECT statement contained an ON expression in the top
level select and this expression used a subquery with a column reference
that could not be resolved then an attempt to resolve this reference as
an outer reference caused... |
int kvm_task_switch(struct kvm_vcpu *vcpu, u16 tss_selector, int reason)
{
struct kvm_segment tr_seg;
struct desc_struct cseg_desc;
struct desc_struct nseg_desc;
int ret = 0;
u32 old_tss_base = get_segment_base(vcpu, VCPU_SREG_TR);
u16 old_tss_sel = get_segment_selector(vcpu, VCPU_SREG_TR);
old_tss_base = vcpu-... | 0 | [
"CWE-476"
] | linux-2.6 | 59839dfff5eabca01cc4e20b45797a60a80af8cb | 314,689,356,713,679,630,000,000,000,000,000,000,000 | 80 | KVM: x86: check for cr3 validity in ioctl_set_sregs
Matt T. Yourst notes that kvm_arch_vcpu_ioctl_set_sregs lacks validity
checking for the new cr3 value:
"Userspace callers of KVM_SET_SREGS can pass a bogus value of cr3 to
the kernel. This will trigger a NULL pointer access in gfn_to_rmap()
when userspace next tries... |
endElementDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
{
callbacks++;
if (noout)
return;
fprintf(stdout, "SAX.endElement(%s)\n", (char *) name);
} | 0 | [
"CWE-416"
] | libxml2 | 1358d157d0bd83be1dfe356a69213df9fac0b539 | 17,012,095,445,646,544,000,000,000,000,000,000,000 | 7 | Fix use-after-free with `xmllint --html --push`
Call htmlCtxtUseOptions to make sure that names aren't stored in
dictionaries.
Note that this issue only affects xmllint using the HTML push parser.
Fixes #230. |
find_cmdline_var(char_u *src, int *usedlen)
{
int len;
int i;
static char *(spec_str[]) = {
"%",
#define SPEC_PERC 0
"#",
#define SPEC_HASH (SPEC_PERC + 1)
"<cword>", // cursor word
#define SPEC_CWORD (SPEC_HASH + 1)
"<cWORD>", // cursor WORD
#define SPEC_CCWORD (SPEC_CWORD ... | 0 | [
"CWE-122"
] | vim | 35a319b77f897744eec1155b736e9372c9c5575f | 67,002,610,242,804,180,000,000,000,000,000,000,000 | 50 | 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. |
R_API char *r_core_op_str(RCore *core, ut64 addr) {
RAsmOp op = {0};
ut8 buf[64];
r_asm_set_pc (core->assembler, addr);
r_io_read_at (core->io, addr, buf, sizeof (buf));
int ret = r_asm_disassemble (core->assembler, &op, buf, sizeof (buf));
char *str = (ret > 0)? strdup (r_strbuf_get (&op.buf_asm)): NULL;
r_asm_... | 0 | [
"CWE-415",
"CWE-703"
] | radare2 | cb8b683758edddae2d2f62e8e63a738c39f92683 | 192,047,301,078,085,470,000,000,000,000,000,000,000 | 10 | Fix #16303 - c->table_query double free (#16318) |
R_API bool r_io_bank_map_add_top(RIO *io, const ut32 bankid, const ut32 mapid) {
RIOBank *bank = r_io_bank_get (io, bankid);
RIOMap *map = r_io_map_get (io, mapid);
r_return_val_if_fail (io && bank && map, false);
RIOMapRef *mapref = _mapref_from_map (map);
if (!mapref) {
return false;
}
RIOSubMap *sm = r_io_s... | 0 | [
"CWE-416"
] | radare2 | 3345147916b9bb3da225248d571cdbac690c0c4d | 71,837,364,530,758,220,000,000,000,000,000,000,000 | 98 | Properly fix the UAF in r_io_bank_map_add_top ##crash
* Associated with the CVE-2022-0559
* Reported by alkyne Choi via huntr.dev |
static php_iconv_err_t _php_iconv_appendl(smart_str *d, const char *s, size_t l, iconv_t cd)
{
const char *in_p = s;
size_t in_left = l;
char *out_p;
size_t out_left = 0;
size_t buf_growth = 128;
#if !ICONV_SUPPORTS_ERRNO
size_t prev_in_left = in_left;
#endif
if (in_p != NULL) {
while (in_left > 0) {
out_l... | 0 | [
"CWE-125"
] | php-src | 7cf7148a8f8f4f55fb04de2a517d740bb6253eac | 58,367,635,545,508,460,000,000,000,000,000,000,000 | 72 | Fix bug #78069 - Out-of-bounds read in iconv.c:_php_iconv_mime_decode() due to integer overflow |
static int64_t MakeInt(PyObject* integer) {
#if PY_MAJOR_VERSION >= 3
return PyLong_AsLong(integer);
#else
return PyInt_AsLong(integer);
#endif
} | 0 | [
"CWE-476",
"CWE-908"
] | tensorflow | 237822b59fc504dda2c564787f5d3ad9c4aa62d9 | 339,563,706,878,738,700,000,000,000,000,000,000,000 | 7 | Fix tf.compat.v1.placeholder_with_default vulnerability with quantized types.
When iterating through the tensor to extract shape values, an underlying missing kernel
(`StridedSlice` for quantized types) causes an error, which then results in a `nullptr`
being passed to `ParseDimensionValue()`, causing a segfault.
The... |
void OSD::handle_pg_query(OpRequestRef op)
{
assert(osd_lock.is_locked());
const MOSDPGQuery *m = static_cast<const MOSDPGQuery*>(op->get_req());
assert(m->get_type() == MSG_OSD_PG_QUERY);
if (!require_osd_peer(op->get_req()))
return;
dout(7) << "handle_pg_query from " << m->get_source() << " epoch " <... | 0 | [
"CWE-287",
"CWE-284"
] | ceph | 5ead97120e07054d80623dada90a5cc764c28468 | 262,224,090,638,904,860,000,000,000,000,000,000,000 | 109 | 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 ... |
int read_escaped_char(
yyscan_t yyscanner,
uint8_t* escaped_char)
{
char text[4] = {0, 0, 0, 0};
text[0] = '\\';
text[1] = RE_YY_INPUT(yyscanner);
if (text[1] == EOF || text[1] == 0)
return 0;
if (text[1] == 'x')
{
text[2] = RE_YY_INPUT(yyscanner);
if (!isxdigit(text[2]))
retu... | 0 | [
"CWE-476",
"CWE-703",
"CWE-125"
] | yara | 3119b232c9c453c98d8fa8b6ae4e37ba18117cd4 | 317,823,541,475,304,230,000,000,000,000,000,000,000 | 29 | re_lexer: Make reading escape sequences more robust (#586)
* Add test for issue #503
* re_lexer: Make reading escape sequences more robust
This commit fixes parsing incomplete escape sequences at the end of a
regular expression and parsing things like \xxy (invalid hex digits)
which before were silently turned... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.