func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
int wc_FreeRsaKey(RsaKey* key)
{
int ret = 0;
if (key == NULL) {
return BAD_FUNC_ARG;
}
wc_RsaCleanup(key);
#if defined(WOLFSSL_ASYNC_CRYPT) && defined(WC_ASYNC_ENABLE_RSA)
wolfAsync_DevCtxFree(&key->asyncDev, WOLFSSL_ASYNC_MARKER_RSA);
#endif
#ifndef WOLFSSL_RSA_PUBLIC_ONLY
if (key-... | 0 | [
"CWE-310",
"CWE-787"
] | wolfssl | fb2288c46dd4c864b78f00a47a364b96a09a5c0f | 166,857,216,960,042,520,000,000,000,000,000,000,000 | 59 | RSA-PSS: Handle edge case with encoding message to hash
When the key is small relative to the digest (1024-bit key, 64-byte
hash, 61-byte salt length), the internal message to hash is larger than
the output size.
Allocate a buffer for the message when this happens. |
static int psk_key2bn(const char *pskkey, unsigned char *psk,
unsigned int max_psk_len)
{
int ret;
BIGNUM *bn = NULL;
ret = BN_hex2bn(&bn, pskkey);
if (!ret)
{
BIO_printf(bio_err,"Could not convert PSK key '%s' to BIGNUM\n", pskkey);
if (bn)
BN_free(bn);
return 0;
}
if (BN_num_bytes(bn) > (int)max... | 0 | [] | openssl | edc032b5e3f3ebb1006a9c89e0ae00504f47966f | 78,527,240,827,746,460,000,000,000,000,000,000,000 | 25 | Add SRP support. |
int SSL_CTX_use_PrivateKey_ASN1(int type, SSL_CTX *ctx, const unsigned char *d,
long len)
{
int ret;
const unsigned char *p;
EVP_PKEY *pkey;
p=d;
if ((pkey=d2i_PrivateKey(type,NULL,&p,(long)len)) == NULL)
{
SSLerr(SSL_F_SSL_CTX_USE_PRIVATEKEY_ASN1,ERR_R_ASN1_LIB);
return(0);
}
ret=SSL_CTX_use_Pri... | 0 | [] | openssl | 0ffa49970b9f8ea66b43ce2eb7f8fd523b65bc2c | 300,801,404,002,348,900,000,000,000,000,000,000,000 | 18 | Backport support for fixed DH ciphersuites (from HEAD) |
server_cleanup (server * serv)
{
fe_set_lag (serv, 0);
if (serv->iotag)
{
fe_input_remove (serv->iotag);
serv->iotag = 0;
}
if (serv->joindelay_tag)
{
fe_timeout_remove (serv->joindelay_tag);
serv->joindelay_tag = 0;
}
#ifdef USE_OPENSSL
if (serv->ssl)
{
SSL_shutdown (serv->ssl);
SSL_free (serv-... | 0 | [
"CWE-310"
] | hexchat | c9b63f7f9be01692b03fa15275135a4910a7e02d | 332,734,900,585,323,040,000,000,000,000,000,000,000 | 58 | ssl: Validate hostnames
Closes #524 |
mii_getbit (struct net_device *dev)
{
long ioaddr = dev->base_addr + PhyCtrl;
u8 data;
data = (readb (ioaddr) & 0xf8) | MII_READ;
writeb (data, ioaddr);
mii_delay ();
writeb (data | MII_CLK, ioaddr);
mii_delay ();
return ((readb (ioaddr) >> 1) & 1);
} | 0 | [
"CWE-284",
"CWE-264"
] | linux | 1bb57e940e1958e40d51f2078f50c3a96a9b2d75 | 178,976,063,159,636,300,000,000,000,000,000,000,000 | 12 | dl2k: Clean up rio_ioctl
The dl2k driver's rio_ioctl call has a few issues:
- No permissions checking
- Implements SIOCGMIIREG and SIOCGMIIREG using the SIOCDEVPRIVATE numbers
- Has a few ioctls that may have been used for debugging at one point
but have no place in the kernel proper.
This patch removes all but the... |
safe_atod(const char *str, double *val)
{
char *endptr;
double v;
#ifdef HAVE_LOCALE_H
locale_t c_locale;
#endif
size_t slen = strlen(str);
/* We don't have a use-case where we want to accept hex for a double
* or any of the other values strtod can parse */
for (size_t i = 0; i < slen; i++) {
char c = str[i]... | 0 | [
"CWE-134"
] | libinput | a423d7d3269dc32a87384f79e29bb5ac021c83d1 | 333,016,585,358,399,300,000,000,000,000,000,000,000 | 52 | evdev: strip the device name of format directives
This fixes a format string vulnerabilty.
evdev_log_message() composes a format string consisting of a fixed
prefix (including the rendered device name) and the passed-in format
buffer. This format string is then passed with the arguments to the
actual log handler, whi... |
_TIFFmemset(tdata_t p, int v, tsize_t c)
{
memset(p, v, (size_t) c);
} | 0 | [
"CWE-369"
] | libtiff | 3c5eb8b1be544e41d2c336191bc4936300ad7543 | 286,117,377,201,972,380,000,000,000,000,000,000,000 | 4 | * libtiff/tif_{unix,vms,win32}.c (_TIFFmalloc): ANSI C does not
require malloc() to return NULL pointer if requested allocation
size is zero. Assure that _TIFFmalloc does. |
static void evtchn_fifo_resume(void)
{
unsigned cpu;
for_each_possible_cpu(cpu) {
void *control_block = per_cpu(cpu_control_block, cpu);
int ret;
if (!control_block)
continue;
/*
* If this CPU is offline, take the opportunity to
* free the control block while it is not being
* used.
*/
if ... | 0 | [
"CWE-400",
"CWE-703"
] | linux | e99502f76271d6bc4e374fe368c50c67a1fd3070 | 5,638,249,791,188,994,000,000,000,000,000,000,000 | 33 | xen/events: defer eoi in case of excessive number of events
In case rogue guests are sending events at high frequency it might
happen that xen_evtchn_do_upcall() won't stop processing events in
dom0. As this is done in irq handling a crash might be the result.
In order to avoid that, delay further inter-domain events... |
robj *createHLLObject(void) {
robj *o;
struct hllhdr *hdr;
sds s;
uint8_t *p;
int sparselen = HLL_HDR_SIZE +
(((HLL_REGISTERS+(HLL_SPARSE_XZERO_MAX_LEN-1)) /
HLL_SPARSE_XZERO_MAX_LEN)*2);
int aux;
/* Populate the sparse representation with as many XZ... | 0 | [
"CWE-787"
] | redis | e216ceaf0e099536fe3658a29dcb725d812364e0 | 229,071,251,462,971,500,000,000,000,000,000,000,000 | 31 | HyperLogLog: handle wrong offset in the base case. |
NTSTATUS smb_vfs_call_get_nt_acl(struct vfs_handle_struct *handle,
const char *name,
uint32 security_info,
struct security_descriptor **ppdesc)
{
VFS_FIND(get_nt_acl);
return handle->fns->get_nt_acl(handle, name, security_info, ppdesc);
} | 0 | [
"CWE-22"
] | samba | bd269443e311d96ef495a9db47d1b95eb83bb8f4 | 155,673,605,210,286,140,000,000,000,000,000,000,000 | 8 | Fix bug 7104 - "wide links" and "unix extensions" are incompatible.
Change parameter "wide links" to default to "no".
Ensure "wide links = no" if "unix extensions = yes" on a share.
Fix man pages to refect this.
Remove "within share" checks for a UNIX symlink set - even if
widelinks = no. The server will not follow t... |
int read_packet(void *buf, size_t count, struct rx_info *ri)
{
struct wif *wi = _wi_in; /* XXX */
int rc;
rc = wi_read(wi, buf, count, ri);
if (rc == -1) {
switch (errno) {
case EAGAIN:
return 0;
}
perror("wi_read()");
r... | 0 | [
"CWE-787"
] | aircrack-ng | 091b153f294b9b695b0b2831e65936438b550d7b | 92,724,513,950,845,610,000,000,000,000,000,000,000 | 18 | Aireplay-ng: Fixed tcp_test stack overflow (Closes #14 on GitHub).
git-svn-id: http://svn.aircrack-ng.org/trunk@2417 28c6078b-6c39-48e3-add9-af49d547ecab |
int snd_sof_debugfs_buf_item(struct snd_sof_dev *sdev,
void *base, size_t size,
const char *name, mode_t mode)
{
struct snd_sof_dfsentry *dfse;
if (!sdev)
return -EINVAL;
dfse = devm_kzalloc(sdev->dev, sizeof(*dfse), GFP_KERNEL);
if (!dfse)
return -ENOMEM;
dfse->type = SOF_DFSENTRY_TYPE_BUF;... | 0 | [
"CWE-400",
"CWE-401"
] | linux | c0a333d842ef67ac04adc72ff79dc1ccc3dca4ed | 234,453,745,582,831,180,000,000,000,000,000,000,000 | 36 | ASoC: SOF: Fix memory leak in sof_dfsentry_write
In the implementation of sof_dfsentry_write() memory allocated for
string is leaked in case of an error. Go to error handling path if the
d_name.name is not valid.
Fixes: 091c12e1f50c ("ASoC: SOF: debug: add new debugfs entries for IPC flood test")
Signed-off-by: Navid... |
s32 i2c_smbus_write_byte(const struct i2c_client *client, u8 value)
{
return i2c_smbus_xfer(client->adapter, client->addr, client->flags,
I2C_SMBUS_WRITE, value, I2C_SMBUS_BYTE, NULL);
} | 0 | [
"CWE-787"
] | linux | 89c6efa61f5709327ecfa24bff18e57a4e80c7fa | 122,369,542,149,557,430,000,000,000,000,000,000,000 | 5 | i2c: core-smbus: prevent stack corruption on read I2C_BLOCK_DATA
On a I2C_SMBUS_I2C_BLOCK_DATA read request, if data->block[0] is
greater than I2C_SMBUS_BLOCK_MAX + 1, the underlying I2C driver writes
data out of the msgbuf1 array boundary.
It is possible from a user application to run into that issue by
calling the ... |
static struct module *layout_and_allocate(struct load_info *info, int flags)
{
struct module *mod;
unsigned int ndx;
int err;
err = check_modinfo(info->mod, info, flags);
if (err)
return ERR_PTR(err);
/* Allow arches to frob section contents and sizes. */
err = module_frob_arch_sections(info->hdr, info->sec... | 0 | [
"CWE-362",
"CWE-347"
] | linux | 0c18f29aae7ce3dadd26d8ee3505d07cc982df75 | 247,748,096,412,985,840,000,000,000,000,000,000,000 | 60 | module: limit enabling module.sig_enforce
Irrespective as to whether CONFIG_MODULE_SIG is configured, specifying
"module.sig_enforce=1" on the boot command line sets "sig_enforce".
Only allow "sig_enforce" to be set when CONFIG_MODULE_SIG is configured.
This patch makes the presence of /sys/module/module/parameters/s... |
void close_log_table(THD *thd, Open_tables_backup *backup)
{
close_system_tables(thd, backup);
} | 0 | [] | server | 0168d1eda30dad4b517659422e347175eb89e923 | 80,522,465,084,334,725,000,000,000,000,000,000,000 | 4 | MDEV-25766 Unused CTE lead to a crash in find_field_in_tables/find_order_in_list
Do not assume that subquery Item always present. |
static inline int is_file_epoll(struct file *f)
{
return f->f_op == &eventpoll_fops;
} | 1 | [] | linux-2.6 | 28d82dc1c4edbc352129f97f4ca22624d1fe61de | 168,358,310,087,812,680,000,000,000,000,000,000,000 | 4 | epoll: limit paths
The current epoll code can be tickled to run basically indefinitely in
both loop detection path check (on ep_insert()), and in the wakeup paths.
The programs that tickle this behavior set up deeply linked networks of
epoll file descriptors that cause the epoll algorithms to traverse them
indefinitel... |
struct mempolicy *__mpol_dup(struct mempolicy *old)
{
struct mempolicy *new = kmem_cache_alloc(policy_cache, GFP_KERNEL);
if (!new)
return ERR_PTR(-ENOMEM);
/* task's mempolicy is protected by alloc_lock */
if (old == current->mempolicy) {
task_lock(current);
*new = *old;
task_unlock(current);
} else
*... | 0 | [
"CWE-264"
] | linux-2.6 | 1a5a9906d4e8d1976b701f889d8f35d54b928f25 | 312,213,178,364,091,020,000,000,000,000,000,000,000 | 27 | mm: thp: fix pmd_bad() triggering in code paths holding mmap_sem read mode
In some cases it may happen that pmd_none_or_clear_bad() is called with
the mmap_sem hold in read mode. In those cases the huge page faults can
allocate hugepmds under pmd_none_or_clear_bad() and that can trigger a
false positive from pmd_bad(... |
int send_message(Message *m) override {
assert(!"send_message on anonymous connection");
} | 0 | [
"CWE-287",
"CWE-284"
] | ceph | 5ead97120e07054d80623dada90a5cc764c28468 | 268,118,873,690,909,600,000,000,000,000,000,000,000 | 3 | 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 ... |
Config::SharedConfig::SharedConfig(
const envoy::extensions::filters::network::tcp_proxy::v3::TcpProxy& config,
Server::Configuration::FactoryContext& context)
: stats_scope_(context.scope().createScope(fmt::format("tcp.{}", config.stat_prefix()))),
stats_(generateStats(*stats_scope_)) {
if (config.... | 0 | [
"CWE-416"
] | envoy | ce0ae309057a216aba031aff81c445c90c6ef145 | 324,971,191,353,955,550,000,000,000,000,000,000,000 | 23 | CVE-2021-43826
Signed-off-by: Yan Avlasov <yavlasov@google.com> |
static void decode_plane(FFV1Context *s, uint8_t *src,
int w, int h, int stride, int plane_index)
{
int x, y;
int16_t *sample[2];
sample[0] = s->sample_buffer + 3;
sample[1] = s->sample_buffer + w + 6 + 3;
s->run_index = 0;
memset(s->sample_buffer, 0, 2 * (w + 6) * siz... | 0 | [
"CWE-119",
"CWE-787"
] | FFmpeg | 547d690d676064069d44703a1917e0dab7e33445 | 100,175,485,593,975,370,000,000,000,000,000,000,000 | 41 | ffv1dec: check that global parameters dont change in version 0/1
Such changes are not allowed nor supported
Fixes Ticket2906
Found-by: ami_stuff
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> |
__move_group_shares(struct task_group *tg, struct sched_domain *sd,
int scpu, int dcpu)
{
unsigned long shares;
shares = tg->cfs_rq[scpu]->shares + tg->cfs_rq[dcpu]->shares;
__update_group_shares_cpu(tg, sd, scpu);
__update_group_shares_cpu(tg, sd, dcpu);
/*
* ensure we never loose shares due to roundin... | 0 | [] | linux-2.6 | 8f1bc385cfbab474db6c27b5af1e439614f3025c | 189,937,755,279,518,020,000,000,000,000,000,000,000 | 18 | sched: fair: weight calculations
In order to level the hierarchy, we need to calculate load based on the
root view. That is, each task's load is in the same unit.
A
/ \
B 1
/ \
2 3
To compute 1's load we do:
weight(1)
--------------
rq_weight(A)
To ... |
virtual ~XMLEmitter() {} | 0 | [
"CWE-787"
] | opencv | f42d5399aac80d371b17d689851406669c9b9111 | 96,594,494,099,911,480,000,000,000,000,000,000,000 | 1 | core(persistence): add more checks for implementation limitations |
void *MACH0_(mach0_free)(struct MACH0_(obj_t) *mo) {
if (!mo) {
return NULL;
}
size_t i;
if (mo->symbols) {
for (i = 0; !mo->symbols[i].last; i++) {
free (mo->symbols[i].name);
}
free (mo->symbols);
}
free (mo->segs);
free (mo->sects);
free (mo->symtab);
free (mo->symstr);
free (mo->indirectsyms);... | 0 | [
"CWE-125",
"CWE-787"
] | radare2 | 0052500c1ed5bf8263b26b9fd7773dbdc6f170c4 | 250,332,922,826,876,680,000,000,000,000,000,000,000 | 40 | Fix heap OOB read in macho.iterate_chained_fixups ##crash
* Reported by peacock-doris via huntr.dev
* Reproducer 'tests_65305'
mrmacete:
* Return early if segs_count is 0
* Initialize segs_count also for reconstructed fixups
Co-authored-by: pancake <pancake@nopcode.org>
Co-authored-by: Francesco Tamagni <mrm... |
int RGWSetBucketWebsite_ObjStore_S3::get_params()
{
const auto max_size = s->cct->_conf->rgw_max_put_param_size;
int r = 0;
bufferlist data;
std::tie(r, data) = rgw_rest_read_all_input(s, max_size, false);
if (r < 0) {
return r;
}
r = do_aws4_auth_completion();
if (r < 0) {
return r;
}
i... | 0 | [
"CWE-79"
] | ceph | 8f90658c731499722d5f4393c8ad70b971d05f77 | 170,325,046,424,667,800,000,000,000,000,000,000,000 | 73 | rgw: reject unauthenticated response-header actions
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Reviewed-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit d8dd5e513c0c62bbd7d3044d7e2eddcd897bd400) |
static void ccid3_hc_tx_get_info(struct sock *sk, struct tcp_info *info)
{
info->tcpi_rto = ccid3_hc_tx_sk(sk)->tx_t_rto;
info->tcpi_rtt = ccid3_hc_tx_sk(sk)->tx_rtt;
} | 0 | [
"CWE-200"
] | linux | 7b07f8eb75aa3097cdfd4f6eac3da49db787381d | 103,925,566,066,887,340,000,000,000,000,000,000,000 | 5 | dccp: fix info leak via getsockopt(DCCP_SOCKOPT_CCID_TX_INFO)
The CCID3 code fails to initialize the trailing padding bytes of struct
tfrc_tx_info added for alignment on 64 bit architectures. It that for
potentially leaks four bytes kernel stack via the getsockopt() syscall.
Add an explicit memset(0) before filling th... |
option_device_cb (const gchar *option_name,
const gchar *value,
gpointer data,
GError **error)
{
FlatpakContext *context = data;
FlatpakContextDevices device;
device = flatpak_context_device_from_string (value, error);
if (device == 0)
return FA... | 0 | [
"CWE-20"
] | flatpak | 902fb713990a8f968ea4350c7c2a27ff46f1a6c4 | 109,210,845,079,722,190,000,000,000,000,000,000,000 | 16 | Use seccomp to filter out TIOCSTI ioctl
This would otherwise let the sandbox add input to the controlling tty. |
copy_to_fd (const char *from, int tofd)
{
int from_flags = O_RDONLY | O_BINARY;
int fromfd;
ssize_t i;
if (! follow_symlinks)
from_flags |= O_NOFOLLOW;
if ((fromfd = safe_open (from, from_flags, 0)) < 0)
pfatal ("Can't reopen file %s", quotearg (from));
while ((i = read (fromfd, buf, bufsize)) != 0... | 0 | [
"CWE-59"
] | patch | dce4683cbbe107a95f1f0d45fabc304acfb5d71a | 14,893,670,967,008,692,000,000,000,000,000,000,000 | 20 | 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... |
void EvalQuantized(TfLiteContext* context, TfLiteNode* node,
TfLiteConvParams* params, OpData* data,
const TfLiteTensor* input, const TfLiteTensor* filter,
const TfLiteTensor* bias, TfLiteTensor* im2col,
TfLiteTensor* output) {
auto input_off... | 0 | [
"CWE-125",
"CWE-787"
] | tensorflow | 1970c2158b1ffa416d159d03c3370b9a462aee35 | 265,213,073,772,156,450,000,000,000,000,000,000,000 | 62 | [tflite]: Insert `nullptr` checks when obtaining tensors.
As part of ongoing refactoring, `tflite::GetInput`, `tflite::GetOutput`, `tflite::GetTemporary` and `tflite::GetIntermediates` will return `nullptr` in some cases. Hence, we insert the `nullptr` checks on all usages.
We also insert `nullptr` checks on usages o... |
static void php_sqlite3_func_final_callback(sqlite3_context *context)
{
struct pdo_sqlite_func *func = (struct pdo_sqlite_func*)sqlite3_user_data(context);
TSRMLS_FETCH();
do_callback(&func->afini, func->fini, 0, NULL, context, 1 TSRMLS_CC);
} | 0 | [
"CWE-264"
] | php-src | 055ecbc62878e86287d742c7246c21606cee8183 | 29,609,921,108,140,927,000,000,000,000,000,000,000 | 7 | Improve check for :memory: pseudo-filename in SQlite |
static int smack_audit_rule_init(u32 field, u32 op, char *rulestr, void **vrule)
{
struct smack_known *skp;
char **rule = (char **)vrule;
*rule = NULL;
if (field != AUDIT_SUBJ_USER && field != AUDIT_OBJ_USER)
return -EINVAL;
if (op != Audit_equal && op != Audit_not_equal)
return -EINVAL;
skp = smk_import_e... | 0 | [
"CWE-416"
] | linux | a3727a8bac0a9e77c70820655fd8715523ba3db7 | 63,678,102,811,181,310,000,000,000,000,000,000,000 | 20 | selinux,smack: fix subjective/objective credential use mixups
Jann Horn reported a problem with commit eb1231f73c4d ("selinux:
clarify task subjective and objective credentials") where some LSM
hooks were attempting to access the subjective credentials of a task
other than the current task. Generally speaking, it is ... |
expandrow(UINT8 *dest, UINT8 *src, int n, int z, int xsize) {
UINT8 pixel, count;
int x = 0;
for (; n > 0; n--) {
pixel = *src++;
if (n == 1 && pixel != 0) {
return n;
}
count = pixel & RLE_MAX_RUN;
if (!count) {
return count;
}
... | 1 | [
"CWE-125"
] | Pillow | 4853e522bddbec66022c0915b9a56255d0188bf9 | 241,888,909,501,386,070,000,000,000,000,000,000,000 | 33 | Fix OOB read in SgiRleDecode.c
* From Pillow 4.3.0->8.1.0
* CVE-2021-25293 |
static inline u32 open_file_to_av(struct file *file)
{
u32 av = file_to_av(file);
if (selinux_policycap_openperm) {
mode_t mode = file->f_path.dentry->d_inode->i_mode;
/*
* lnk files and socks do not really have an 'open'
*/
if (S_ISREG(mode))
av |= FILE__OPEN;
else if (S_ISCHR(mode))
av |= CHR_F... | 0 | [] | linux-2.6 | ee18d64c1f632043a02e6f5ba5e045bb26a5465f | 140,008,982,011,518,780,000,000,000,000,000,000,000 | 27 | 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... |
static void worker_thread(void *arg)
{
worker_t *me = (worker_t *)arg;
int band_start;
do
{
DEBUG_THREADS(("Worker %d waiting\n", me->num));
mu_wait_semaphore(&me->start);
band_start = me->band_start;
DEBUG_THREADS(("Worker %d woken for band_start %d\n", me->num, me->band_start));
me->status = RENDER_OK;... | 0 | [
"CWE-369",
"CWE-22"
] | mupdf | 22c47acbd52949421f8c7cb46ea1556827d0fcbf | 18,542,198,597,253,014,000,000,000,000,000,000,000 | 19 | Bug 704834: Fix division by zero for zero width pages in muraster. |
u_clearall(buf_T *buf)
{
buf->b_u_newhead = buf->b_u_oldhead = buf->b_u_curhead = NULL;
buf->b_u_synced = TRUE;
buf->b_u_numhead = 0;
buf->b_u_line_ptr.ul_line = NULL;
buf->b_u_line_ptr.ul_len = 0;
buf->b_u_line_lnum = 0;
} | 0 | [
"CWE-125",
"CWE-787"
] | vim | 8d02ce1ed75d008c34a5c9aaa51b67cbb9d33baa | 105,025,383,499,310,960,000,000,000,000,000,000,000 | 9 | patch 8.2.4217: illegal memory access when undo makes Visual area invalid
Problem: Illegal memory access when undo makes Visual area invalid.
Solution: Correct the Visual area after undo. |
static void construct_client(void *obj)
{
PgSocket *client = obj;
memset(client, 0, sizeof(PgSocket));
list_init(&client->head);
sbuf_init(&client->sbuf, client_proto);
client->state = CL_FREE;
} | 0 | [] | pgbouncer | 4b92112b820830b30cd7bc91bef3dd8f35305525 | 130,369,185,886,125,170,000,000,000,000,000,000,000 | 9 | add_database: fail gracefully if too long db name
Truncating & adding can lead to fatal() later.
It was not an issue before, but with audodb (* in [databases] section)
the database name can some from network, thus allowing remote shutdown.. |
const bdaddr_t *btd_adapter_get_address(struct btd_adapter *adapter)
{
return &adapter->bdaddr;
} | 0 | [
"CWE-862",
"CWE-863"
] | bluez | b497b5942a8beb8f89ca1c359c54ad67ec843055 | 264,947,760,852,815,370,000,000,000,000,000,000,000 | 4 | adapter: Fix storing discoverable setting
discoverable setting shall only be store when changed via Discoverable
property and not when discovery client set it as that be considered
temporary just for the lifetime of the discovery. |
TfLiteStatus ResizeOutput(TfLiteContext* context, TfLiteNode* node) {
const TfLiteTensor* input;
TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, kInputTensor, &input));
TfLiteTensor* output;
TF_LITE_ENSURE_OK(context,
GetOutputSafe(context, node, kOutputTensor, &output));
const TfLi... | 0 | [
"CWE-125",
"CWE-787"
] | tensorflow | 1970c2158b1ffa416d159d03c3370b9a462aee35 | 25,180,722,395,608,080,000,000,000,000,000,000,000 | 31 | [tflite]: Insert `nullptr` checks when obtaining tensors.
As part of ongoing refactoring, `tflite::GetInput`, `tflite::GetOutput`, `tflite::GetTemporary` and `tflite::GetIntermediates` will return `nullptr` in some cases. Hence, we insert the `nullptr` checks on all usages.
We also insert `nullptr` checks on usages o... |
static int qp_decode_triple (char *s, char *d)
{
/* soft line break */
if (*s == '=' && !(*(s+1)))
return 1;
/* quoted-printable triple */
if (*s == '=' &&
isxdigit ((unsigned char) *(s+1)) &&
isxdigit ((unsigned char) *(s+2)))
{
*d = (hexval (*(s+1)) << 4) | hexval (*(s+2));
return 0... | 0 | [
"CWE-120"
] | mutt | e5ed080c00e59701ca62ef9b2a6d2612ebf765a5 | 131,344,243,527,163,670,000,000,000,000,000,000,000 | 18 | Fix uudecode buffer overflow.
mutt_decode_uuencoded() used each line's initial "length character"
without any validation. It would happily read past the end of the
input line, and with a suitable value even past the length of the
input buffer.
As I noted in ticket 404, there are several other changes that could
be a... |
static void nft_setelem_data_deactivate(const struct net *net,
const struct nft_set *set,
struct nft_set_elem *elem)
{
const struct nft_set_ext *ext = nft_set_elem_ext(set, elem->priv);
if (nft_set_ext_exists(ext, NFT_SET_EXT_DATA))
nft_data_release(nft_set_ext_data(ext), set->dtype);
if (nft_set_ext_ex... | 0 | [
"CWE-665"
] | linux | ad9f151e560b016b6ad3280b48e42fa11e1a5440 | 203,846,512,796,800,100,000,000,000,000,000,000,000 | 11 | netfilter: nf_tables: initialize set before expression setup
nft_set_elem_expr_alloc() needs an initialized set if expression sets on
the NFT_EXPR_GC flag. Move set fields initialization before expression
setup.
[4512935.019450] ==================================================================
[4512935.019456] BUG: ... |
makeOperatorDependencies(HeapTuple tuple,
bool makeExtensionDep,
bool isUpdate)
{
Form_pg_operator oper = (Form_pg_operator) GETSTRUCT(tuple);
ObjectAddress myself,
referenced;
myself.classId = OperatorRelationId;
myself.objectId = oper->oid;
myself.objectSubId = 0;
/*
* If we are updating t... | 1 | [
"CWE-94"
] | postgres | 7e92f78abe80e4b30e648a40073abb59057e21f8 | 44,117,702,207,193,310,000,000,000,000,000,000,000 | 104 | 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... |
SCTP_STATIC int sctp_stream_listen(struct sock *sk, int backlog)
{
struct sctp_sock *sp = sctp_sk(sk);
struct sctp_endpoint *ep = sp->ep;
/* If backlog is zero, disable listening. */
if (!backlog) {
if (sctp_sstate(sk, CLOSED))
return 0;
sctp_unhash_endpoint(ep);
sk->sk_state = SCTP_SS_CLOSED;
return 0... | 0 | [] | linux-2.6 | 5e739d1752aca4e8f3e794d431503bfca3162df4 | 302,050,545,838,509,130,000,000,000,000,000,000,000 | 39 | sctp: fix potential panics in the SCTP-AUTH API.
All of the SCTP-AUTH socket options could cause a panic
if the extension is disabled and the API is envoked.
Additionally, there were some additional assumptions that
certain pointers would always be valid which may not
always be the case.
This patch hardens the API a... |
static int read_conflict_names(git_index *index, const char *buffer, size_t size)
{
size_t len;
/* This gets called multiple times, the vector might already be initialized */
if (index->names._alloc_size == 0 &&
git_vector_init(&index->names, 16, conflict_name_cmp) < 0)
return -1;
#define read_conflict_name(pt... | 0 | [
"CWE-415",
"CWE-190"
] | libgit2 | 3db1af1f370295ad5355b8f64b865a2a357bcac0 | 38,613,793,390,220,250,000,000,000,000,000,000,000 | 54 | index: error out on unreasonable prefix-compressed path lengths
When computing the complete path length from the encoded
prefix-compressed path, we end up just allocating the complete path
without ever checking what the encoded path length actually is. This can
easily lead to a denial of service by just encoding an un... |
static bool update_nohz_stats(struct rq *rq, bool force)
{
#ifdef CONFIG_NO_HZ_COMMON
unsigned int cpu = rq->cpu;
if (!rq->has_blocked_load)
return false;
if (!cpumask_test_cpu(cpu, nohz.idle_cpus_mask))
return false;
if (!force && !time_after(jiffies, rq->last_blocked_load_update_tick))
return true;
upd... | 0 | [
"CWE-400",
"CWE-703",
"CWE-835"
] | linux | c40f7d74c741a907cfaeb73a7697081881c497d0 | 174,984,951,488,189,750,000,000,000,000,000,000,000 | 21 | sched/fair: Fix infinite loop in update_blocked_averages() by reverting a9e7f6544b9c
Zhipeng Xie, Xie XiuQi and Sargun Dhillon reported lockups in the
scheduler under high loads, starting at around the v4.18 time frame,
and Zhipeng Xie tracked it down to bugs in the rq->leaf_cfs_rq_list
manipulation.
Do a (manual) re... |
void MainWindow::dropEvent(QDropEvent *event)
{
const QMimeData *mimeData = event->mimeData();
if (mimeData->hasFormat("application/x-qabstractitemmodeldatalist")) {
QByteArray encoded = mimeData->data("application/x-qabstractitemmodeldatalist");
QDataStream stream(&encoded, QIODevice::ReadOnly)... | 0 | [
"CWE-89",
"CWE-327",
"CWE-295"
] | shotcut | f008adc039642307f6ee3378d378cdb842e52c1d | 28,907,270,457,863,600,000,000,000,000,000,000,000 | 26 | fix upgrade check is not using TLS correctly |
Item_string(THD *thd, const char *str, uint length, CHARSET_INFO *cs,
Derivation dv, uint repertoire)
:Item_literal(thd)
{
str_value.set_or_copy_aligned(str, length, cs);
fix_and_set_name_from_value(thd, dv, Metadata(&str_value, repertoire));
} | 0 | [
"CWE-617"
] | server | 807945f2eb5fa22e6f233cc17b85a2e141efe2c8 | 251,352,545,089,131,170,000,000,000,000,000,000,000 | 7 | MDEV-26402: A SEGV in Item_field::used_tables/update_depend_map_for_order...
When doing condition pushdown from HAVING into WHERE,
Item_equal::create_pushable_equalities() calls
item->set_extraction_flag(IMMUTABLE_FL) for constant items.
Then, Item::cleanup_excluding_immutables_processor() checks for this flag
to see ... |
static void clear_page_hwpoison_huge_page(struct page *hpage)
{
int i;
int nr_pages = 1 << compound_order(hpage);
for (i = 0; i < nr_pages; i++)
ClearPageHWPoison(hpage + i);
} | 0 | [] | linux | c3901e722b2975666f42748340df798114742d6d | 205,817,688,890,313,240,000,000,000,000,000,000,000 | 7 | mm: hwpoison: fix thp split handling in memory_failure()
When memory_failure() runs on a thp tail page after pmd is split, we
trigger the following VM_BUG_ON_PAGE():
page:ffffd7cd819b0040 count:0 mapcount:0 mapping: (null) index:0x1
flags: 0x1fffc000400000(hwpoison)
page dumped because: VM_BUG_ON_PAG... |
njs_string_prototype_pad(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs,
njs_index_t pad_start)
{
u_char *p, *start;
size_t padding, trunc, new_size;
int64_t length, new_length;
uint32_t n, pad_length;
njs_int_t ret;
njs_value_t ... | 0 | [] | njs | 36f04a3178fcb6da8513cc3dbf35215c2a581b3f | 194,381,186,592,804,900,000,000,000,000,000,000,000 | 121 | Fixed String.prototype.replace() with byte strings.
This closes #522 issue on Github. |
TEST(MatchHeadersTest, HeaderRegexMatch) {
TestRequestHeaderMapImpl matching_headers{{"match-header", "123"}};
TestRequestHeaderMapImpl unmatching_headers{{"match-header", "1234"},
{"match-header", "123.456"}};
const std::string yaml = R"EOF(
name: match-header
regex_... | 0 | [] | envoy | 2c60632d41555ec8b3d9ef5246242be637a2db0f | 328,179,377,128,586,070,000,000,000,000,000,000,000 | 15 | http: header map security fixes for duplicate headers (#197)
Previously header matching did not match on all headers for
non-inline headers. This patch changes the default behavior to
always logically match on all headers. Multiple individual
headers will be logically concatenated with ',' similar to what
is done with... |
void DispatcherThread::Run()
{
this->LockQueue();
while (!this->GetExitFlag())
{
if (!Parent->qq.empty())
{
QQueueItem i = Parent->qq.front();
i.c->lock.Lock();
this->UnlockQueue();
MySQLresult* res = i.c->DoBlockingQuery(i.query);
i.c->lock.Unlock();
/*
* At this point, the main thread co... | 0 | [
"CWE-476"
] | inspircd | 8745660fcdac7c1b80c94cfc0ff60928cd4dd4b7 | 40,203,355,641,671,824,000,000,000,000,000,000,000 | 42 | Initialise and deallocate the MySQL library correctly. |
static int __grow_ple_window(int val)
{
if (ple_window_grow < 1)
return ple_window;
val = min(val, ple_window_actual_max);
if (ple_window_grow < ple_window)
val *= ple_window_grow;
else
val += ple_window_grow;
return val;
} | 0 | [] | kvm | a642fc305053cc1c6e47e4f4df327895747ab485 | 88,407,468,797,932,520,000,000,000,000,000,000,000 | 14 | kvm: vmx: handle invvpid vm exit gracefully
On systems with invvpid instruction support (corresponding bit in
IA32_VMX_EPT_VPID_CAP MSR is set) guest invocation of invvpid
causes vm exit, which is currently not handled and results in
propagation of unknown exit to userspace.
Fix this by installing an invvpid vm exit ... |
fix_indent(void)
{
if (p_paste)
return;
if (curbuf->b_p_lisp && curbuf->b_p_ai)
fixthisline(get_lisp_indent);
else
if (cindent_on())
do_c_expr_indent();
} | 0 | [
"CWE-122",
"CWE-787"
] | vim | 0e8e938d497260dd57be67b4966cb27a5f72376f | 122,665,694,673,800,750,000,000,000,000,000,000,000 | 10 | patch 8.2.5122: lisp indenting my run over the end of the line
Problem: Lisp indenting my run over the end of the line.
Solution: Check for NUL earlier. |
xsltScanLiteral(xsltParserContextPtr ctxt) {
const xmlChar *q, *cur;
xmlChar *ret = NULL;
int val, len;
SKIP_BLANKS;
if (CUR == '"') {
NEXT;
cur = q = CUR_PTR;
val = xmlStringCurrentChar(NULL, cur, &len);
while ((IS_CHAR(val)) && (val != '"')) {
cur += len;
val = xmlStringCurre... | 0 | [
"CWE-125"
] | libxslt | fe5a4fa33eb85bce3253ed3742b1ea6c4b59b41b | 320,956,797,385,375,100,000,000,000,000,000,000,000 | 45 | Fix some case of pattern parsing errors
We could accidentally hit an off by one string array access
due to improper loop exit when parsing patterns |
numbered_function(char_u *name)
{
return isdigit(*name)
|| (name[0] == 'g' && name[1] == ':' && isdigit(name[2]));
} | 0 | [
"CWE-416"
] | vim | 9c23f9bb5fe435b28245ba8ac65aa0ca6b902c04 | 275,756,600,588,481,840,000,000,000,000,000,000,000 | 5 | patch 8.2.3902: Vim9: double free with nested :def function
Problem: Vim9: double free with nested :def function.
Solution: Pass "line_to_free" from compile_def_function() and make sure
cmdlinep is valid. |
static int snd_microii_spdif_default_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct usb_mixer_elem_list *list = snd_kcontrol_chip(kcontrol);
struct snd_usb_audio *chip = list->mixer->chip;
int err;
struct usb_interface *iface;
struct usb_host_interface *alts;
unsigned int ep;
u... | 0 | [] | sound | 447d6275f0c21f6cc97a88b3a0c601436a4cdf2a | 881,354,448,518,349,100,000,000,000,000,000,000 | 49 | ALSA: usb-audio: Add sanity checks for endpoint accesses
Add some sanity check codes before actually accessing the endpoint via
get_endpoint() in order to avoid the invalid access through a
malformed USB descriptor. Mostly just checking bNumEndpoints, but in
one place (snd_microii_spdif_default_get()), the validity o... |
static bool check_pai_ok(char *pai_buf, size_t pai_buf_data_size)
{
uint16 num_entries;
uint16 num_def_entries;
if (pai_buf_data_size < PAI_ENTRIES_BASE) {
/* Corrupted - too small. */
return False;
}
if (CVAL(pai_buf,PAI_VERSION_OFFSET) != PAI_VERSION)
return False;
num_entries = SVAL(pai_buf,PAI_NUM_EN... | 0 | [
"CWE-264"
] | samba | d6c28913f3109d1327a3d1369b6eafd3874b2dca | 55,678,353,458,081,040,000,000,000,000,000,000,000 | 24 | Bug 6488: acl_group_override() call in posix acls references an uninitialized variable.
(cherry picked from commit f92195e3a1baaddda47a5d496f9488c8445b41ad) |
int gnutls_x509_crt_get_issuer_dn_by_oid(gnutls_x509_crt_t cert,
const char *oid, int indx,
unsigned int raw_flag, void *buf,
size_t * sizeof_buf)
{
if (cert == NULL) {
gnutls_assert();
return GNUTLS_E_INVALID_REQUEST;
}
return _gnutls_x509_parse_dn_oid(cert->cert,
"tbsCertific... | 0 | [] | gnutls | 112d537da5f3500f14316db26d18c37d678a5e0e | 100,220,097,706,368,150,000,000,000,000,000,000,000 | 14 | some changes for 64bit machines. |
static void do_json_pages(QPDF& pdf, Options& o, JSON& j)
{
JSON j_pages = j.addDictionaryMember("pages", JSON::makeArray());
QPDFPageDocumentHelper pdh(pdf);
QPDFPageLabelDocumentHelper pldh(pdf);
QPDFOutlineDocumentHelper odh(pdf);
pdh.pushInheritedAttributesToPage();
std::vector<QPDFPageObjec... | 0 | [
"CWE-787"
] | qpdf | d71f05ca07eb5c7cfa4d6d23e5c1f2a800f52e8e | 45,794,284,869,487,050,000,000,000,000,000,000,000 | 91 | 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 ... |
static void writeJPEG(unsigned char *jpegBuf, unsigned long jpegSize,
char *filename)
{
FILE *file = fopen(filename, "wb");
if (!file || fwrite(jpegBuf, jpegSize, 1, file) != 1) {
printf("ERROR: Could not write to %s.\n%s\n", filename, strerror(errno));
BAILOUT()
}
bailout:
if (f... | 0 | [
"CWE-787"
] | libjpeg-turbo | 2a9e3bd7430cfda1bc812d139e0609c6aca0b884 | 92,666,069,873,461,930,000,000,000,000,000,000,000 | 13 | TurboJPEG: Properly handle gigapixel images
Prevent several integer overflow issues and subsequent segfaults that
occurred when attempting to compress or decompress gigapixel images with
the TurboJPEG API:
- Modify tjBufSize(), tjBufSizeYUV2(), and tjPlaneSizeYUV() to avoid
integer overflow when computing the retur... |
xfs_da3_node_rebalance(
struct xfs_da_state *state,
struct xfs_da_state_blk *blk1,
struct xfs_da_state_blk *blk2)
{
struct xfs_da_intnode *node1;
struct xfs_da_intnode *node2;
struct xfs_da_intnode *tmpnode;
struct xfs_da_node_entry *btree1;
struct xfs_da_node_entry *btree2;
struct xfs_da_node_entry *btree_s;
... | 0 | [
"CWE-399"
] | linux | c88547a8119e3b581318ab65e9b72f27f23e641d | 321,335,272,221,776,900,000,000,000,000,000,000,000 | 138 | xfs: fix directory hash ordering bug
Commit f5ea1100 ("xfs: add CRCs to dir2/da node blocks") introduced
in 3.10 incorrectly converted the btree hash index array pointer in
xfs_da3_fixhashpath(). It resulted in the the current hash always
being compared against the first entry in the btree rather than the
current bloc... |
static int _db_tree_add(struct db_arg_chain_tree **existing,
struct db_arg_chain_tree *new,
struct db_iter_state *state)
{
int rc;
struct db_arg_chain_tree *x_iter = *existing;
struct db_arg_chain_tree *n_iter = new;
/* TODO: when we add sub-trees to the current level (see the lt/gt
* branches below) we ne... | 1 | [] | libseccomp | c5bf78de480b32b324e0f511c88ce533ed280b37 | 280,517,711,732,531,400,000,000,000,000,000,000,000 | 116 | db: fix 64-bit argument comparisons
Our approach to doing 64-bit comparisons using 32-bit operators was
just plain wrong, leading to a number of potential problems with
filters that used the LT, GT, LE, or GE operators. This patch fixes
this problem and a few other related issues that came to light in
the course of f... |
PHP_FUNCTION(locale_lookup)
{
char* fallback_loc = NULL;
int fallback_loc_len = 0;
const char* loc_range = NULL;
int loc_range_len = 0;
zval* arr = NULL;
HashTable* hash_arr = NULL;
zend_bool boolCanonical = 0;
char* result =NULL;
intl_error_reset( NULL TSRMLS_... | 1 | [
"CWE-125"
] | php-src | 97eff7eb57fc2320c267a949cffd622c38712484 | 118,639,155,469,329,250,000,000,000,000,000,000,000 | 41 | Fix bug #72241: get_icu_value_internal out-of-bounds read |
nfs4_acl_get_whotype(char *p, u32 len)
{
int i;
for (i = 0; i < ARRAY_SIZE(s2t_map); i++) {
if (s2t_map[i].stringlen == len &&
0 == memcmp(s2t_map[i].string, p, len))
return s2t_map[i].type;
}
return NFS4_ACL_WHO_NAMED;
} | 0 | [
"CWE-119"
] | linux-2.6 | 91b80969ba466ba4b915a4a1d03add8c297add3f | 102,859,505,322,045,980,000,000,000,000,000,000,000 | 11 | nfsd: fix buffer overrun decoding NFSv4 acl
The array we kmalloc() here is not large enough.
Thanks to Johann Dahm and David Richter for bug report and testing.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Cc: David Richter <richterd@citi.umich.edu>
Tested-by: Johann Dahm <jdahm@umich.edu> |
TEST_F(QueryPlannerTest, NegationAndIndexOnInequality) {
addIndex(BSON("b" << 1));
runQuerySortProj(fromjson("{$and: [{a: 1}, {b: {$ne: 1}}]}"), BSONObj(), BSONObj());
assertNumSolutions(2U);
assertSolutionExists("{cscan: {dir: 1}}");
assertSolutionExists(
"{fetch: {filter: {a:1}, node: {ix... | 0 | [] | mongo | ee97c0699fd55b498310996ee002328e533681a3 | 104,707,670,049,001,260,000,000,000,000,000,000,000 | 11 | SERVER-36993 Fix crash due to incorrect $or pushdown for indexed $expr. |
webSocketsDecodeHixie(rfbClientPtr cl, char *dst, int len)
{
int retlen = 0, n, i, avail, modlen, needlen;
char *buf, *end = NULL;
ws_ctx_t *wsctx = (ws_ctx_t *)cl->wsctx;
buf = wsctx->codeBufDecode;
n = ws_peek(cl, buf, len*2+2);
if (n <= 0) {
/* save errno because rfbErr() will tamp... | 0 | [
"CWE-787"
] | libvncserver | aac95a9dcf4bbba87b76c72706c3221a842ca433 | 99,715,686,909,218,560,000,000,000,000,000,000,000 | 93 | fix overflow and refactor websockets decode (Hybi)
fix critical heap-based buffer overflow which allowed easy modification
of a return address via an overwritten function pointer
fix bug causing connections to fail due a "one websocket frame = one
ws_read" assumption, which failed with LibVNCServer-0.9.11
refactor w... |
static void process_stat(conn *c, token_t *tokens, const size_t ntokens) {
const char *subcommand = tokens[SUBCOMMAND_TOKEN].value;
assert(c != NULL);
if (ntokens < 2) {
out_string(c, "CLIENT_ERROR bad command line");
return;
}
if (ntokens == 2) {
server_stats(&append_stats... | 0 | [
"CWE-190"
] | memcached | bd578fc34b96abe0f8d99c1409814a09f51ee71c | 42,600,301,275,581,230,000,000,000,000,000,000,000 | 77 | CVE reported by cisco talos |
static inline void free_gigantic_page(struct page *page, unsigned int order) { } | 0 | [
"CWE-703"
] | linux | 5af10dfd0afc559bb4b0f7e3e8227a1578333995 | 9,216,740,014,113,334,000,000,000,000,000,000,000 | 1 | userfaultfd: hugetlbfs: remove superfluous page unlock in VM_SHARED case
huge_add_to_page_cache->add_to_page_cache implicitly unlocks the page
before returning in case of errors.
The error returned was -EEXIST by running UFFDIO_COPY on a non-hole
offset of a VM_SHARED hugetlbfs mapping. It was an userland bug that
t... |
DestroyJNG(unsigned char *chunk,Image **color_image,
ImageInfo **color_image_info,Image **alpha_image,
ImageInfo **alpha_image_info)
{
(void) RelinquishMagickMemory(chunk);
if (color_image_info && *color_image_info)
{
DestroyImageInfo(*color_image_info);
*color_image_info = (ImageInfo *)NULL;
}
if... | 0 | [
"CWE-772"
] | ImageMagick | 4d6accd355119d54429a86a1859b8329f0130f30 | 54,824,085,383,616,260,000,000,000,000,000,000,000 | 26 | https://github.com/ImageMagick/ImageMagick/issues/902 |
static void image_ctx_free(ImageContext *img)
{
int i, j;
av_free(img->color_cache);
if (img->role != IMAGE_ROLE_ARGB && !img->is_alpha_primary)
av_frame_free(&img->frame);
if (img->huffman_groups) {
for (i = 0; i < img->nb_huffman_groups; i++) {
for (j = 0; j < HUFFMAN_CODE... | 0 | [
"CWE-119",
"CWE-787"
] | FFmpeg | 6b5d3fb26fb4be48e4966e4b1d97c2165538d4ef | 1,978,888,271,330,927,000,000,000,000,000,000,000 | 16 | avcodec/webp: Always set pix_fmt
Fixes: out of array access
Fixes: 1434/clusterfuzz-testcase-minimized-6314998085189632
Fixes: 1435/clusterfuzz-testcase-minimized-6483783723253760
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Reviewed-by: "Ronald S. Bultje" <rsbult... |
sd_show_provisioning_mode(struct device *dev, struct device_attribute *attr,
char *buf)
{
struct scsi_disk *sdkp = to_scsi_disk(dev);
return snprintf(buf, 20, "%s\n", lbp_mode[sdkp->provisioning_mode]);
} | 0 | [
"CWE-284",
"CWE-264"
] | linux | 0bfc96cb77224736dfa35c3c555d37b3646ef35e | 21,499,202,498,432,753,000,000,000,000,000,000,000 | 7 | block: fail SCSI passthrough ioctls on partition devices
Linux allows executing the SG_IO ioctl on a partition or LVM volume, and
will pass the command to the underlying block device. This is
well-known, but it is also a large security problem when (via Unix
permissions, ACLs, SELinux or a combination thereof) a prog... |
flatpak_bwrap_add_args (FlatpakBwrap *bwrap, ...)
{
va_list args;
const gchar *arg;
va_start (args, bwrap);
while ((arg = va_arg (args, const gchar *)))
flatpak_bwrap_add_arg (bwrap, arg);
va_end (args);
} | 0 | [
"CWE-94",
"CWE-74"
] | flatpak | 6d1773d2a54dde9b099043f07a2094a4f1c2f486 | 136,143,218,960,949,640,000,000,000,000,000,000,000 | 10 | run: Convert all environment variables into bwrap arguments
This avoids some of them being filtered out by a setuid bwrap. It also
means that if they came from an untrusted source, they cannot be used
to inject arbitrary code into a non-setuid bwrap via mechanisms like
LD_PRELOAD.
Because they get bundled into a memf... |
cql_server::connection::process_batch(uint16_t stream, request_reader in, service::client_state& client_state, service_permit permit,
tracing::trace_state_ptr trace_state) {
++_server._stats.batch_requests;
return process(stream, in, client_state, permit, std::move(trace_state), process_batch_internal);... | 0 | [] | scylladb | 1c2eef384da439b0457b6d71c7e37d7268e471cb | 214,191,200,307,052,100,000,000,000,000,000,000,000 | 5 | transport/server.cc: Return correct size of decompressed lz4 buffer
An incorrect size is returned from the function, which could lead to
crashes or undefined behavior. Fix by erroring out in these cases.
Fixes #11476 |
NOEXPORT int parse_socket_error(CLI *c, const char *text) {
switch(get_last_socket_error()) {
/* http://tangentsoft.net/wskfaq/articles/bsd-compatibility.html */
case 0: /* close on read, or close on write on WIN32 */
#ifndef USE_WIN32
case EPIPE: /* close on write on Unix */
#endif
case S_ECONN... | 1 | [
"CWE-295"
] | stunnel | ebad9ddc4efb2635f37174c9d800d06206f1edf9 | 166,207,902,582,657,290,000,000,000,000,000,000,000 | 38 | stunnel-5.57 |
Error Box_pixi::write(StreamWriter& writer) const
{
size_t box_start = reserve_box_header_space(writer);
if (m_bits_per_channel.size() > 255 ||
m_bits_per_channel.empty()) {
// TODO: error
assert(false);
}
writer.write8((uint8_t)(m_bits_per_channel.size()));
for (size_t i=0;i<m_bits_per_channe... | 0 | [
"CWE-703"
] | libheif | 2710c930918609caaf0a664e9c7bc3dce05d5b58 | 209,358,200,388,202,820,000,000,000,000,000,000,000 | 19 | force fraction to a limited resolution to finally solve those pesky numerical edge cases |
static int ISO8859_11ToUTF8 (unsigned char* out, int *outlen,
const unsigned char* in, int *inlen) {
return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_11);
} | 0 | [
"CWE-189"
] | libxml2 | 69f04562f75212bfcabecd190ea8b06ace28ece2 | 38,376,945,619,217,270,000,000,000,000,000,000,000 | 4 | Fix an off by one error in encoding
this off by one error doesn't seems to reproduce on linux
but the error is real. |
EIGEN_STRONG_INLINE QInt32 operator+(const QInt16 a, const QInt32 b) {
return QInt32(static_cast<int32_t>(a.value) + b.value);
} | 0 | [
"CWE-908",
"CWE-787"
] | tensorflow | ace0c15a22f7f054abcc1f53eabbcb0a1239a9e2 | 160,067,280,059,136,950,000,000,000,000,000,000,000 | 3 | Default initialize fixed point Eigen types.
In certain cases, tensors are filled with default values of the type. But, for these fixed point types, these values were uninitialized. Thus, we would have uninitialized memory access bugs, some of which were caught by MSAN.
PiperOrigin-RevId: 344101137
Change-Id: I14555fd... |
static inline struct kmem_cache *virt_to_cache(const void *obj)
{
struct page *page = virt_to_head_page(obj);
return page->slab_cache;
} | 0 | [
"CWE-703"
] | linux | c4e490cf148e85ead0d1b1c2caaba833f1d5b29f | 42,896,164,886,375,510,000,000,000,000,000,000,000 | 5 | mm/slab.c: fix SLAB freelist randomization duplicate entries
This patch fixes a bug in the freelist randomization code. When a high
random number is used, the freelist will contain duplicate entries. It
will result in different allocations sharing the same chunk.
It will result in odd behaviours and crashes. It sh... |
tidyRelease(doc);
}
static char *php_tidy_file_to_mem(char *filename, zend_bool use_include_path, int *len TSRMLS_DC)
{
php_stream *stream;
char *data = NULL;
if (!(stream = php_stream_open_wrapper(filename, "rb", (use_include_path ? USE_PATH : 0) | ENFORCE_SAFE_MODE, NULL))) {
return NULL;
}
if ((*len = (int... | 0 | [] | php-src | ce96fd6b0761d98353761bf78d5bfb55291179fd | 189,268,161,436,490,150,000,000,000,000,000,000,000 | 16 | - fix #39863, do not accept paths with NULL in them. See http://news.php.net/php.internals/50191, trunk will have the patch later (adding a macro and/or changing (some) APIs. Patch by Rasmus |
static void hextile_enc_cord(uint8_t *ptr, int x, int y, int w, int h)
{
ptr[0] = ((x & 0x0F) << 4) | (y & 0x0F);
ptr[1] = (((w - 1) & 0x0F) << 4) | ((h - 1) & 0x0F);
} | 0 | [
"CWE-125"
] | qemu | 9f64916da20eea67121d544698676295bbb105a7 | 155,169,810,367,085,850,000,000,000,000,000,000,000 | 5 | pixman/vnc: use pixman images in vnc.
The vnc code uses *three* DisplaySurfaces:
First is the surface of the actual QemuConsole, usually the guest
screen, but could also be a text console (monitor/serial reachable via
Ctrl-Alt-<nr> keys). This is left as-is.
Second is the current server's view of the screen content... |
S3BootScriptSaveMemWrite (
IN S3_BOOT_SCRIPT_LIB_WIDTH Width,
IN UINT64 Address,
IN UINTN Count,
IN VOID *Buffer
)
{
UINT8 Length;
UINT8 *Script;
UINT8 ... | 1 | [
"CWE-787"
] | edk2 | 322ac05f8bbc1bce066af1dabd1b70ccdbe28891 | 86,068,894,357,324,420,000,000,000,000,000,000,000 | 35 | MdeModulePkg/PiDxeS3BootScriptLib: Fix potential numeric truncation (CVE-2019-14563)
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2001
For S3BootScriptLib APIs:
S3BootScriptSaveIoWrite
S3BootScriptSaveMemWrite
S3BootScriptSavePciCfgWrite
S3BootScriptSavePciCfg2Write
S3BootScriptSaveSmbusExecute
S3BootScriptSav... |
bool Context::isSsl() { return decoder_callbacks_->connection()->ssl() != nullptr; } | 0 | [
"CWE-476"
] | envoy | 8788a3cf255b647fd14e6b5e2585abaaedb28153 | 106,508,541,794,389,920,000,000,000,000,000,000,000 | 1 | 1.4 - Do not call into the VM unless the VM Context has been created. (#24)
* Ensure that the in VM Context is created before onDone is called.
Signed-off-by: John Plevyak <jplevyak@gmail.com>
* Update as per offline discussion.
Signed-off-by: John Plevyak <jplevyak@gmail.com>
* Set in_vm_context_created_ in onNet... |
static int kvm_read_guest_virt_system(gva_t addr, void *val, unsigned int bytes,
struct kvm_vcpu *vcpu,
struct x86_exception *exception)
{
return kvm_read_guest_virt_helper(addr, val, bytes, vcpu, 0, exception);
} | 0 | [
"CWE-362",
"CWE-401"
] | linux | fc3a9157d3148ab91039c75423da8ef97be3e105 | 258,053,945,293,761,640,000,000,000,000,000,000,000 | 6 | KVM: X86: Don't report L2 emulation failures to user-space
This patch prevents that emulation failures which result
from emulating an instruction for an L2-Guest results in
being reported to userspace.
Without this patch a malicious L2-Guest would be able to
kill the L1 by triggering a race-condition between an vmexit... |
static int lag_decode_frame(AVCodecContext *avctx,
void *data, int *got_frame, AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
LagarithContext *l = avctx->priv_data;
ThreadFrame frame = { .f = data };
AVFrame *const p = data;
uint8_t ... | 1 | [
"CWE-787"
] | FFmpeg | 4c3e1956ee35fdcc5ffdb28782050164b4623c0b | 296,662,118,809,891,400,000,000,000,000,000,000,000 | 166 | lagarith: reallocate rgb_planes when needed
Fixes invalid writes on pixel format changes.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org |
static void adv_enable_complete(struct hci_dev *hdev, u8 status, u16 opcode)
{
bt_dev_dbg(hdev, "status %u", status);
} | 0 | [
"CWE-362"
] | linux | e2cb6b891ad2b8caa9131e3be70f45243df82a80 | 75,909,067,875,679,270,000,000,000,000,000,000,000 | 4 | bluetooth: eliminate the potential race condition when removing the HCI controller
There is a possible race condition vulnerability between issuing a HCI
command and removing the cont. Specifically, functions hci_req_sync()
and hci_dev_do_close() can race each other like below:
thread-A in hci_req_sync() | th... |
mono_type_is_enum_type (MonoType *type)
{
if (type->type == MONO_TYPE_VALUETYPE && type->data.klass->enumtype)
return TRUE;
if (type->type == MONO_TYPE_GENERICINST && type->data.generic_class->container_class->enumtype)
return TRUE;
return FALSE;
} | 0 | [
"CWE-20"
] | mono | 4905ef1130feb26c3150b28b97e4a96752e0d399 | 17,802,244,385,932,772,000,000,000,000,000,000,000 | 8 | Handle invalid instantiation of generic methods.
* verify.c: Add new function to internal verifier API to check
method instantiations.
* reflection.c (mono_reflection_bind_generic_method_parameters):
Check the instantiation before returning it.
Fixes #655847 |
word bigint_add2_nc(word x[], size_t x_size, const word y[], size_t y_size)
{
word carry = 0;
const size_t blocks = y_size - (y_size % 8);
for(size_t i = 0; i != blocks; i += 8)
carry = word8_add2(x + i, y + i, carry);
for(size_t i = blocks; i != y_size; ++i)
x[i] = word_add(x[i], y[i], &c... | 0 | [
"CWE-200"
] | botan | bcf13fa153a11b3e0ad54e2af6962441cea3adf1 | 315,702,134,053,193,650,000,000,000,000,000,000,000 | 17 | Fixes for CVE-2015-7827 and CVE-2016-2849 |
HEnvironment* HEnvironment::CopyWithoutHistory() const {
HEnvironment* result = Copy();
result->ClearHistory();
return result;
} | 0 | [] | node | fd80a31e0697d6317ce8c2d289575399f4e06d21 | 327,782,380,572,373,860,000,000,000,000,000,000,000 | 5 | deps: backport 5f836c from v8 upstream
Original commit message:
Fix Hydrogen bounds check elimination
When combining bounds checks, they must all be moved before the first load/store
that they are guarding.
BUG=chromium:344186
LOG=y
R=svenpanne@chromium.org
Review URL: https://coderevie... |
PJ_DEF(pj_status_t) pj_ssl_sock_renegotiate(pj_ssl_sock_t *ssock)
{
pj_status_t status;
PJ_ASSERT_RETURN(ssock, PJ_EINVAL);
if (ssock->ssl_state != SSL_STATE_ESTABLISHED)
return PJ_EINVALIDOP;
status = ssl_renegotiate(ssock);
if (status == PJ_SUCCESS) {
status = ssl_do_handshake(ssock);
}
... | 0 | [
"CWE-362",
"CWE-703"
] | pjproject | d5f95aa066f878b0aef6a64e60b61e8626e664cd | 268,291,305,106,739,930,000,000,000,000,000,000,000 | 16 | Merge pull request from GHSA-cv8x-p47p-99wr
* - Avoid SSL socket parent/listener getting destroyed during handshake by increasing parent's reference count.
- Add missing SSL socket close when the newly accepted SSL socket is discarded in SIP TLS transport.
* - Fix silly mistake: accepted active socket created without... |
copy_char(
char_u *from,
char_u *to,
int lowercase) // make character lower case
{
int len;
int c;
if (has_mbyte)
{
if (lowercase)
{
c = MB_TOLOWER((*mb_ptr2char)(from));
return (*mb_char2bytes)(c, to);
}
else
{
len = (*mb_ptr2len)(from);
mch_memmove(to, from, (s... | 0 | [
"CWE-416"
] | vim | 9f1a39a5d1cd7989ada2d1cb32f97d84360e050f | 191,769,996,648,531,400,000,000,000,000,000,000,000 | 31 | 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. |
GF_Err void_Size(GF_Box *s)
{
s->size = 4;
return GF_OK;
} | 0 | [
"CWE-125"
] | gpac | bceb03fd2be95097a7b409ea59914f332fb6bc86 | 21,028,541,732,341,373,000,000,000,000,000,000,000 | 5 | fixed 2 possible heap overflows (inc. #1088) |
struct razer_report razer_chroma_misc_get_polling_rate2(void)
{
return get_razer_report(0x00, 0xC0, 0x01);
} | 0 | [
"CWE-787"
] | openrazer | 7e8a04feb378a679f1bcdcae079a5100cc45663b | 125,877,462,710,354,820,000,000,000,000,000,000,000 | 4 | Fix oob memcpy in matrix_custom_frame methods
Adjust row_length if it exeeds the arguments array |
TEST_CASE("WHITESPACE test", "[general]")
{
parser parser(R"(
# Rules
ROOT <- ITEM (',' ITEM)*
ITEM <- WORD / PHRASE
# Tokens
WORD <- < [a-zA-Z0-9_]+ >
PHRASE <- < '"' (!'"' .)* '"' >
%whitespace <- [ \t\r\n]*
)");
... | 1 | [
"CWE-125"
] | cpp-peglib | b3b29ce8f3acf3a32733d930105a17d7b0ba347e | 219,293,098,114,409,900,000,000,000,000,000,000,000 | 590 | Fix #122 |
static int decode_open(struct xdr_stream *xdr, struct nfs_openres *res)
{
__be32 *p;
uint32_t savewords, bmlen, i;
int status;
status = decode_op_hdr(xdr, OP_OPEN);
if (status != -EIO)
nfs_increment_open_seqid(status, res->seqid);
if (status)
return status;
R... | 0 | [
"CWE-703"
] | linux | dc0b027dfadfcb8a5504f7d8052754bf8d501ab9 | 187,901,618,513,409,250,000,000,000,000,000,000,000 | 34 | NFSv4: Convert the open and close ops to use fmode
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> |
static int jp2_pclr_putdata(jp2_box_t *box, jas_stream_t *out)
{
#if 0
jp2_pclr_t *pclr = &box->data.pclr;
#endif
/* Eliminate warning about unused variable. */
box = 0;
out = 0;
return -1;
} | 0 | [
"CWE-476"
] | jasper | e96fc4fdd525fa0ede28074a7e2b1caf94b58b0d | 162,771,422,049,999,670,000,000,000,000,000,000,000 | 10 | Fixed bugs due to uninitialized data in the JP2 decoder.
Also, added some comments marking I/O stream interfaces that probably
need to be changed (in the long term) to fix integer overflow problems. |
static int tw5864_subscribe_event(struct v4l2_fh *fh,
const struct v4l2_event_subscription *sub)
{
switch (sub->type) {
case V4L2_EVENT_MOTION_DET:
/*
* Allow for up to 30 events (1 second for NTSC) to be stored.
*/
return v4l2_event_subscribe(fh, sub, 30, NULL);
default:
return v4l2_ctrl_subscribe... | 0 | [
"CWE-476"
] | linux | 2e7682ebfc750177a4944eeb56e97a3f05734528 | 75,258,736,464,677,200,000,000,000,000,000,000,000 | 13 | media: tw5864: Fix possible NULL pointer dereference in tw5864_handle_frame
'vb' null check should be done before dereferencing it in
tw5864_handle_frame, otherwise a NULL pointer dereference
may occur.
Fixes: 34d1324edd31 ("[media] pci: Add tw5864 driver")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-of... |
int placeholder_keyslot_alloc(struct crypt_device *cd,
int keyslot,
uint64_t area_offset,
uint64_t area_length,
size_t volume_key_len __attribute__((unused)))
{
struct luks2_hdr *hdr;
json_object *jobj_keyslots, *jobj_keyslot, *jobj_area;
log_dbg(cd, "Allocating placeholder keyslot %d for LUKS1 down conversion.... | 0 | [
"CWE-345"
] | cryptsetup | 0113ac2d889c5322659ad0596d4cfc6da53e356c | 334,027,355,760,511,650,000,000,000,000,000,000,000 | 42 | Fix CVE-2021-4122 - LUKS2 reencryption crash recovery attack
Fix possible attacks against data confidentiality through LUKS2 online
reencryption extension crash recovery.
An attacker can modify on-disk metadata to simulate decryption in
progress with crashed (unfinished) reencryption step and persistently
decrypt par... |
decode_int(unsigned char* der, long length)
{
ASN1_INTEGER *ai;
const unsigned char *p;
VALUE ret;
int status = 0;
p = der;
if(!(ai = d2i_ASN1_INTEGER(NULL, &p, length)))
ossl_raise(eASN1Error, NULL);
ret = rb_protect((VALUE (*)(VALUE))asn1integer_to_num,
(VALUE)ai, &status);
AS... | 0 | [
"CWE-119"
] | openssl | 1648afef33c1d97fb203c82291b8a61269e85d3b | 246,353,912,096,718,840,000,000,000,000,000,000,000 | 17 | asn1: fix out-of-bounds read in decoding constructed objects
OpenSSL::ASN1.{decode,decode_all,traverse} have a bug of out-of-bounds
read. int_ossl_asn1_decode0_cons() does not give the correct available
length to ossl_asn1_decode() when decoding the inner components of a
constructed object. This can cause out-of-bound... |
static __exit void veth_exit(void)
{
rtnl_link_unregister(&veth_link_ops);
} | 0 | [
"CWE-399"
] | linux | 6ec82562ffc6f297d0de36d65776cff8e5704867 | 250,343,524,435,512,700,000,000,000,000,000,000,000 | 4 | veth: Dont kfree_skb() after dev_forward_skb()
In case of congestion, netif_rx() frees the skb, so we must assume
dev_forward_skb() also consume skb.
Bug introduced by commit 445409602c092
(veth: move loopback logic to common location)
We must change dev_forward_skb() to always consume skb, and veth to not
double fr... |
zimage3x(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
gs_image3x_t image;
ref *pDataDict;
image_params ip_data;
int num_components =
gs_color_space_num_components(gs_currentcolorspace(igs));
int ignored;
int code;
check_type(*op, t_dictionary);
check_dict_read(*op);
memset(&imag... | 1 | [
"CWE-704"
] | ghostpdl | 548bb434e81dadcc9f71adf891a3ef5bea8e2b4e | 119,716,412,625,102,740,000,000,000,000,000,000,000 | 39 | PS interpreter - add some type checking
These were 'probably' safe anyway, since they mostly treat the objects
as integers without checking, which at least can't result in a crash.
Nevertheless, we ought to check.
The return from comparedictkeys could be wrong if one of the keys had
a value which was not an array, i... |
static int __snd_ctl_elem_info(struct snd_card *card,
struct snd_kcontrol *kctl,
struct snd_ctl_elem_info *info,
struct snd_ctl_file *ctl)
{
struct snd_kcontrol_volatile *vd;
unsigned int index_offset;
int result;
#ifdef CONFIG_SND_DEBUG
info->access = 0;
#endif
result = snd_power_re... | 0 | [
"CWE-416",
"CWE-125"
] | linux | 6ab55ec0a938c7f943a4edba3d6514f775983887 | 150,609,737,166,764,620,000,000,000,000,000,000,000 | 36 | ALSA: control: Fix an out-of-bounds bug in get_ctl_id_hash()
Since the user can control the arguments provided to the kernel by the
ioctl() system call, an out-of-bounds bug occurs when the 'id->name'
provided by the user does not end with '\0'.
The following log can reveal it:
[ 10.002313] BUG: KASAN: stack-out-... |
void phys_mem_set_alloc(void *(*alloc)(size_t, uint64_t *align))
{
phys_mem_alloc = alloc;
} | 0 | [] | qemu | c3c1bb99d1c11978d9ce94d1bdcf0705378c1459 | 185,771,858,718,608,840,000,000,000,000,000,000,000 | 4 | exec: Respect as_tranlsate_internal length clamp
address_space_translate_internal will clamp the *plen length argument
based on the size of the memory region being queried. The iommu walker
logic in addresss_space_translate was ignoring this by discarding the
post fn call value of *plen. Fix by just always using *plen... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.