func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
BSONObj spec() {
return BSON("$or" << BSON_ARRAY("$a" << 0));
} | 0 | [
"CWE-835"
] | mongo | 0a076417d1d7fba3632b73349a1fd29a83e68816 | 58,220,247,858,860,980,000,000,000,000,000,000,000 | 3 | SERVER-38070 fix infinite loop in agg expression |
void OSD::ShardedOpWQ::clear_pg_slots()
{
for (auto sdata : shard_list) {
Mutex::Locker l(sdata->sdata_op_ordering_lock);
sdata->pg_slots.clear();
sdata->waiting_for_pg_osdmap.reset();
// don't bother with reserved pushes; we are shutting down
}
} | 0 | [
"CWE-287",
"CWE-284"
] | ceph | 5ead97120e07054d80623dada90a5cc764c28468 | 131,088,122,679,161,580,000,000,000,000,000,000,000 | 9 | auth/cephx: add authorizer challenge
Allow the accepting side of a connection to reject an initial authorizer
with a random challenge. The connecting side then has to respond with an
updated authorizer proving they are able to decrypt the service's challenge
and that the new authorizer was produced for this specific ... |
void qmp_guest_file_close(int64_t handle, Error **err)
{
GuestFileHandle *gfh = guest_file_handle_find(handle, err);
int ret;
slog("guest-file-close called, handle: %ld", handle);
if (!gfh) {
return;
}
ret = fclose(gfh->fh);
if (ret == EOF) {
error_setg_errno(err, errno, "f... | 0 | [
"CWE-264"
] | qemu | c689b4f1bac352dcfd6ecb9a1d45337de0f1de67 | 90,374,933,928,670,970,000,000,000,000,000,000,000 | 19 | qga: set umask 0077 when daemonizing (CVE-2013-2007)
The qemu guest agent creates a bunch of files with insecure permissions
when started in daemon mode. For example:
-rw-rw-rw- 1 root root /var/log/qemu-ga.log
-rw-rw-rw- 1 root root /var/run/qga.state
-rw-rw-rw- 1 root root /var/log/qga-fsfreeze-hook.log
In a... |
int ttm_sg_tt_init(struct ttm_dma_tt *ttm_dma, struct ttm_buffer_object *bo,
uint32_t page_flags)
{
struct ttm_tt *ttm = &ttm_dma->ttm;
int ret;
ttm_tt_init_fields(ttm, bo, page_flags);
INIT_LIST_HEAD(&ttm_dma->pages_list);
if (page_flags & TTM_PAGE_FLAG_SG)
ret = ttm_sg_tt_alloc_page_directory(ttm_dma);
... | 0 | [] | linux | 5de5b6ecf97a021f29403aa272cb4e03318ef586 | 202,393,183,251,415,700,000,000,000,000,000,000,000 | 19 | drm/ttm/nouveau: don't call tt destroy callback on alloc failure.
This is confusing, and from my reading of all the drivers only
nouveau got this right.
Just make the API act under driver control of it's own allocation
failing, and don't call destroy, if the page table fails to
create there is nothing to cleanup here... |
int test_mod_exp(BIO *bp, BN_CTX *ctx)
{
BIGNUM *a,*b,*c,*d,*e;
int i;
a=BN_new();
b=BN_new();
c=BN_new();
d=BN_new();
e=BN_new();
BN_bntest_rand(c,30,0,1); /* must be odd for montgomery */
for (i=0; i<num2; i++)
{
BN_bntest_rand(a,20+i*5,0,0); /**/
BN_bntest_rand(b,2+i,0,0); /**/
if (!BN_mod_exp(d... | 0 | [
"CWE-310"
] | openssl | a7a44ba55cb4f884c6bc9ceac90072dea38e66d0 | 312,218,988,257,970,840,000,000,000,000,000,000,000 | 50 | Fix for CVE-2014-3570 (with minor bn_asm.c revamp).
Reviewed-by: Emilia Kasper <emilia@openssl.org> |
onigenc_step_back(OnigEncoding enc, const UChar* start, const UChar* s, int n)
{
while (ONIG_IS_NOT_NULL(s) && n-- > 0) {
if (s <= start)
return (UChar* )NULL;
s = ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc, start, s - 1);
}
return (UChar* )s;
} | 0 | [
"CWE-125"
] | oniguruma | 65a9b1aa03c9bc2dc01b074295b9603232cb3b78 | 285,447,076,757,462,900,000,000,000,000,000,000,000 | 10 | onig-5.9.2 |
gs_listener_set_active (GSListener *listener,
gboolean active)
{
gboolean res;
g_return_val_if_fail (GS_IS_LISTENER (listener), FALSE);
if (listener->priv->active == active) {
gs_debug ("Trying to set active state when already: %s",
... | 0 | [] | gnome-screensaver | 284c9924969a49dbf2d5fae1d680d3310c4df4a3 | 22,088,446,237,240,414,000,000,000,000,000,000,000 | 31 | Remove session inhibitors if the originator falls of the bus
This fixes a problem where totem leaves inhibitors behind, see
bug 600488. |
AP4_AtomSampleTable::AP4_AtomSampleTable(AP4_ContainerAtom* stbl,
AP4_ByteStream& sample_stream) :
m_SampleStream(sample_stream)
{
m_StscAtom = AP4_DYNAMIC_CAST(AP4_StscAtom, stbl->GetChild(AP4_ATOM_TYPE_STSC));
m_StcoAtom = AP4_DYNAMIC_CAST(AP4_StcoAtom, stbl->G... | 0 | [
"CWE-476",
"CWE-703"
] | Bento4 | 4d3f0bebd5f8518fd775f671c12bea58c68e814e | 63,283,983,569,460,985,000,000,000,000,000,000,000 | 17 | fixed possible crashes on malformed inputs. |
static llparse_state_t llhttp__internal__run(
llhttp__internal_t* state,
const unsigned char* p,
const unsigned char* endp) {
int match;
switch ((llparse_state_t) (intptr_t) state->_current) {
case s_n_llhttp__internal__n_invoke_llhttp__after_message_complete:
s_n_llhttp__internal__n_invoke_llht... | 0 | [
"CWE-444"
] | node | da0fda0fe81d372e24c0cb11aec37534985708dd | 307,535,924,346,628,660,000,000,000,000,000,000,000 | 5,836 | http: stricter Transfer-Encoding and header separator parsing
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
PR-URL: #315
Backport-PR-URL: #327
CVE-ID: CVE-2022-3221... |
static bool prep_compound_gigantic_page_for_demote(struct page *page,
unsigned int order)
{
return __prep_compound_gigantic_page(page, order, true);
} | 0 | [] | linux | a4a118f2eead1d6c49e00765de89878288d4b890 | 200,118,372,791,878,140,000,000,000,000,000,000,000 | 5 | hugetlbfs: flush TLBs correctly after huge_pmd_unshare
When __unmap_hugepage_range() calls to huge_pmd_unshare() succeed, a TLB
flush is missing. This TLB flush must be performed before releasing the
i_mmap_rwsem, in order to prevent an unshared PMDs page from being
released and reused before the TLB flush took place... |
static struct mm_struct *mm_init(struct mm_struct *mm, struct task_struct *p,
struct user_namespace *user_ns)
{
mm->mmap = NULL;
mm->mm_rb = RB_ROOT;
mm->vmacache_seqnum = 0;
atomic_set(&mm->mm_users, 1);
atomic_set(&mm->mm_count, 1);
init_rwsem(&mm->mmap_sem);
INIT_LIST_HEAD(&mm->mmlist);
mm->core_state = NUL... | 0 | [
"CWE-362"
] | linux | 7b55851367136b1efd84d98fea81ba57a98304cf | 205,194,662,975,824,030,000,000,000,000,000,000,000 | 53 | fork: record start_time late
This changes the fork(2) syscall to record the process start_time after
initializing the basic task structure but still before making the new
process visible to user-space.
Technically, we could record the start_time anytime during fork(2). But
this might lead to scenarios where a start_... |
static Image *ReadTXTImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
char
colorspace[MagickPathExtent],
text[MagickPathExtent];
Image
*image;
long
x_offset,
y_offset;
PixelInfo
pixel;
MagickBooleanType
status;
QuantumAny
range;
register ssize_t
i,
... | 1 | [
"CWE-190",
"CWE-835"
] | ImageMagick | 50f54462076648ac2e36c3f58f4dadd4babbf1c9 | 8,987,714,138,896,337,000,000,000,000,000,000,000 | 218 | https://github.com/ImageMagick/ImageMagick/issues/713 |
template<typename t1, typename t2, typename t3>
CImgList<T>& assign(const CImg<t1>& img1, const CImg<t2>& img2, const CImg<t3>& img3, const bool is_shared=false) {
assign(3);
_data[0].assign(img1,is_shared); _data[1].assign(img2,is_shared); _data[2].assign(img3,is_shared);
return *this; | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 288,619,665,454,516,000,000,000,000,000,000,000,000 | 5 | Fix other issues in 'CImg<T>::load_bmp()'. |
lyd_wd_update_parents(struct lyd_node *node)
{
struct lyd_node *parent = node->parent, *iter;
for (parent = node->parent; parent; parent = node->parent) {
if (parent->dflt || parent->schema->nodetype != LYS_CONTAINER ||
((struct lys_node_container *)parent->schema)->presence) {
... | 0 | [
"CWE-119"
] | libyang | 32fb4993bc8bb49e93e84016af3c10ea53964be5 | 76,589,870,978,340,160,000,000,000,000,000,000,000 | 28 | schema tree BUGFIX do not check features while still resolving schema
Fixes #723 |
static bool __apic_update_ppr(struct kvm_lapic *apic, u32 *new_ppr)
{
u32 tpr, isrv, ppr, old_ppr;
int isr;
old_ppr = kvm_lapic_get_reg(apic, APIC_PROCPRI);
tpr = kvm_lapic_get_reg(apic, APIC_TASKPRI);
isr = apic_find_highest_isr(apic);
isrv = (isr != -1) ? isr : 0;
if ((tpr & 0xf0) >= (isrv & 0xf0))
ppr = t... | 0 | [
"CWE-703",
"CWE-459"
] | linux | f7d8a19f9a056a05c5c509fa65af472a322abfee | 21,926,742,682,813,746,000,000,000,000,000,000,000 | 21 | Revert "KVM: x86: Open code necessary bits of kvm_lapic_set_base() at vCPU RESET"
Revert a change to open code bits of kvm_lapic_set_base() when emulating
APIC RESET to fix an apic_hw_disabled underflow bug due to arch.apic_base
and apic_hw_disabled being unsyncrhonized when the APIC is created. If
kvm_arch_vcpu_crea... |
static int compat_copy_entries(unsigned char *data, unsigned int size_user,
struct ebt_entries_buf_state *state)
{
unsigned int size_remaining = size_user;
int ret;
ret = EBT_ENTRY_ITERATE(data, size_user, size_entry_mwt, data,
&size_remaining, state);
if (ret < 0)
return ret;
WARN_ON(size_remaining);... | 0 | [
"CWE-787"
] | linux | b71812168571fa55e44cdd0254471331b9c4c4c6 | 230,570,422,055,143,460,000,000,000,000,000,000,000 | 14 | netfilter: ebtables: CONFIG_COMPAT: don't trust userland offsets
We need to make sure the offsets are not out of range of the
total size.
Also check that they are in ascending order.
The WARN_ON triggered by syzkaller (it sets panic_on_warn) is
changed to also bail out, no point in continuing parsing.
Briefly tested... |
resolve_applies_when(const struct lys_node *schema, int mode, const struct lys_node *stop)
{
const struct lys_node *parent;
assert(schema);
if (!(schema->nodetype & (LYS_NOTIF | LYS_RPC)) && snode_get_when(schema)) {
return 1;
}
parent = schema;
goto check_augment;
while (parent)... | 0 | [
"CWE-119"
] | libyang | 32fb4993bc8bb49e93e84016af3c10ea53964be5 | 236,354,301,484,166,200,000,000,000,000,000,000,000 | 40 | schema tree BUGFIX do not check features while still resolving schema
Fixes #723 |
static SQInteger array_reduce(HSQUIRRELVM v)
{
SQObject &o = stack_get(v,1);
SQArray *a = _array(o);
SQInteger size = a->Size();
SQObjectPtr res;
SQInteger iterStart;
if (sq_gettop(v)>2) {
res = stack_get(v,3);
iterStart = 0;
} else if (size==0) {
return 0;
} else... | 0 | [
"CWE-703",
"CWE-787"
] | squirrel | a6413aa690e0bdfef648c68693349a7b878fe60d | 305,935,973,956,870,600,000,000,000,000,000,000,000 | 35 | fix in thread.call |
mk_remount_opts(const char *old, const char *instead)
{
char *new;
size_t sz;
if (old == NULL && instead == NULL)
return NULL;
if (!old)
return xstrdup(instead);
/* max size of new options is:
* old + new + '\0' + separator (for each copied option)
*/
sz = strlen(old) + (instead ? strlen(instead) : 0) +... | 0 | [
"CWE-399"
] | util-linux | 4b39b6aefd5dd8ac68a92adc650dc13d5d54d704 | 167,680,543,580,987,930,000,000,000,000,000,000,000 | 24 | mount: use fflush() and temporary file for mtab updates (CVE-2011-1089)
http://thread.gmane.org/gmane.comp.security.oss.general/4374
Changes:
- force mount(8) to use /etc/mtab.tmp file every time. The original
code used the tmp file for remount/move operations only.
- call and check fflush() return code for... |
srs_init(srs_t *srs)
{
memset(srs, 0, sizeof(srs_t));
srs->secrets = NULL;
srs->numsecrets = 0;
srs->separator = '=';
srs->maxage = 21;
srs->hashlength = 4;
srs->hashmin = srs->hashlength;
srs->alwaysrewrite = FALSE;
} | 0 | [
"CWE-400",
"CWE-703",
"CWE-834"
] | postsrsd | 4733fb11f6bec6524bb8518c5e1a699288c26bac | 221,553,813,414,770,240,000,000,000,000,000,000,000 | 11 | SECURITY: Fix potential denial of service attack against PostSRSd
I discovered that PostSRSd could be tricked into consuming a lot of CPU
time with an SRS address that has an excessively long time stamp tag,
e.g.
SRS0=HHHH=TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT=0@example.com |
static int vnc_update_client(VncState *vs, int has_dirty, bool sync)
{
vs->has_dirty += has_dirty;
if (vs->need_update && vs->csock != -1) {
VncDisplay *vd = vs->vd;
VncJob *job;
int y;
int height, width;
int n = 0;
if (vs->output.offset && !vs->audio_cap && !vs-... | 0 | [] | qemu | 4c65fed8bdf96780735dbdb92a8bd0d6b6526cc3 | 298,625,636,939,208,100,000,000,000,000,000,000,000 | 75 | ui: vnc: avoid floating point exception
While sending 'SetPixelFormat' messages to a VNC server,
the client could set the 'red-max', 'green-max' and 'blue-max'
values to be zero. This leads to a floating point exception in
write_png_palette while doing frame buffer updates.
Reported-by: Lian Yihan <lianyihan@360.cn>
... |
m4_mkstemp (struct obstack *obs, int argc, token_data **argv)
{
if (bad_argc (argv[0], argc, 2, 2))
return;
mkstemp_helper (obs, ARG (1));
} | 1 | [] | m4 | 5345bb49077bfda9fabd048e563f9e7077fe335d | 318,397,935,641,703,000,000,000,000,000,000,000,000 | 6 | Minor security fix: Quote output of mkstemp.
* src/builtin.c (mkstemp_helper): Produce quoted output.
* doc/m4.texinfo (Mkstemp): Update the documentation and tests.
* NEWS: Document this change.
Signed-off-by: Eric Blake <ebb9@byu.net>
(cherry picked from commit bd9900d65eb9cd5add0f107e94b513fa267495ba) |
psutil_pids(PyObject *self, PyObject *args) {
kinfo_proc *proclist = NULL;
kinfo_proc *orig_address = NULL;
size_t num_processes;
size_t idx;
PyObject *py_retlist = PyList_New(0);
PyObject *py_pid = NULL;
if (py_retlist == NULL)
return NULL;
// TODO: RuntimeError is inappropria... | 1 | [
"CWE-415"
] | psutil | 7d512c8e4442a896d56505be3e78f1156f443465 | 199,541,314,211,088,750,000,000,000,000,000,000,000 | 51 | Use Py_CLEAR instead of Py_DECREF to also set the variable to NULL (#1616)
These files contain loops that convert system data into python objects
and during the process they create objects and dereference their
refcounts after they have been added to the resulting list.
However, in case of errors during the creat... |
void CRYPTO_lock(int mode, int type, const char *file, int line)
{
#ifdef LOCK_DEBUG
{
char *rw_text,*operation_text;
if (mode & CRYPTO_LOCK)
operation_text="lock ";
else if (mode & CRYPTO_UNLOCK)
operation_text="unlock";
else
operation_text="ERROR ";
if (mode & CRYPTO_READ)
rw_text="r";
e... | 0 | [
"CWE-310"
] | openssl | 270881316664396326c461ec7a124aec2c6cc081 | 155,874,151,957,653,130,000,000,000,000,000,000,000 | 34 | Add and use a constant-time memcmp.
This change adds CRYPTO_memcmp, which compares two vectors of bytes in
an amount of time that's independent of their contents. It also changes
several MAC compares in the code to use this over the standard memcmp,
which may leak information about the size of a matching prefix.
(cher... |
static int picolcd_init_keys(struct picolcd_data *data,
struct hid_report *report)
{
struct hid_device *hdev = data->hdev;
struct input_dev *idev;
int error, i;
if (!report)
return -ENODEV;
if (report->maxfield != 1 || report->field[0]->report_count != 2 ||
report->field[0]->report_size != 8) {
hid_err(h... | 0 | [
"CWE-119",
"CWE-787"
] | linux | 844817e47eef14141cf59b8d5ac08dd11c0a9189 | 63,423,532,301,605,570,000,000,000,000,000,000,000 | 46 | HID: picolcd: sanity check report size in raw_event() callback
The report passed to us from transport driver could potentially be
arbitrarily large, therefore we better sanity-check it so that raw_data
that we hold in picolcd_pending structure are always kept within proper
bounds.
Cc: stable@vger.kernel.org
Reported-... |
SplashBitmap *getBitmap() { return bitmap; } | 0 | [] | poppler | abf167af8b15e5f3b510275ce619e6fdb42edd40 | 219,656,273,236,155,640,000,000,000,000,000,000,000 | 1 | Implement tiling/patterns in SplashOutputDev
Fixes bug 13518 |
void hci_req_prepare_suspend(struct hci_dev *hdev, enum suspended_state next)
{
int old_state;
struct hci_conn *conn;
struct hci_request req;
u8 page_scan;
int disconnect_counter;
if (next == hdev->suspend_state) {
bt_dev_dbg(hdev, "Same state before and after: %d", next);
goto done;
}
hdev->suspend_state... | 0 | [
"CWE-362"
] | linux | e2cb6b891ad2b8caa9131e3be70f45243df82a80 | 271,821,916,206,173,400,000,000,000,000,000,000,000 | 134 | 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... |
void flush()
{
if (m_file && m_file != stdout)
{
if (fflush(m_file))
die("Failed to flush '%s', errno: %d", m_file_name, errno);
}
} | 0 | [
"CWE-284",
"CWE-295"
] | mysql-server | 3bd5589e1a5a93f9c224badf983cd65c45215390 | 164,290,031,933,019,100,000,000,000,000,000,000,000 | 8 | WL#6791 : Redefine client --ssl option to imply enforced encryption
# Changed the meaning of the --ssl=1 option of all client binaries
to mean force ssl, not try ssl and fail over to eunecrypted
# Added a new MYSQL_OPT_SSL_ENFORCE mysql_options()
option to specify that an ssl connection is required.
# Added a new macr... |
int hugetlb_overcommit_handler(struct ctl_table *table, int write,
void __user *buffer,
size_t *length, loff_t *ppos)
{
struct hstate *h = &default_hstate;
unsigned long tmp;
int ret;
tmp = h->nr_overcommit_huge_pages;
if (write && h->order >= MAX_ORDER)
return -EINVAL;
table->data = &tmp;
table->maxl... | 0 | [
"CWE-399"
] | linux | 90481622d75715bfcb68501280a917dbfe516029 | 309,380,638,440,554,700,000,000,000,000,000,000,000 | 27 | hugepages: fix use after free bug in "quota" handling
hugetlbfs_{get,put}_quota() are badly named. They don't interact with the
general quota handling code, and they don't much resemble its behaviour.
Rather than being about maintaining limits on on-disk block usage by
particular users, they are instead about maintai... |
static void test_stmt_close()
{
MYSQL *lmysql;
MYSQL_STMT *stmt1, *stmt2, *stmt3, *stmt_x;
MYSQL_BIND my_bind[1];
MYSQL_RES *result;
unsigned int count;
int rc;
char query[MAX_TEST_QUERY_LENGTH];
myheader("test_stmt_close");
if (!opt_silent)
fprintf(stdout, "\n Establishing a test connecti... | 0 | [
"CWE-284",
"CWE-295"
] | mysql-server | 3bd5589e1a5a93f9c224badf983cd65c45215390 | 257,791,885,248,506,480,000,000,000,000,000,000,000 | 117 | WL#6791 : Redefine client --ssl option to imply enforced encryption
# Changed the meaning of the --ssl=1 option of all client binaries
to mean force ssl, not try ssl and fail over to eunecrypted
# Added a new MYSQL_OPT_SSL_ENFORCE mysql_options()
option to specify that an ssl connection is required.
# Added a new macr... |
static void *htab_of_map_lookup_elem(struct bpf_map *map, void *key)
{
struct bpf_map **inner_map = htab_map_lookup_elem(map, key);
if (!inner_map)
return NULL;
return READ_ONCE(*inner_map);
} | 0 | [
"CWE-787"
] | bpf | c4eb1f403243fc7bbb7de644db8587c03de36da6 | 217,501,801,449,489,070,000,000,000,000,000,000,000 | 9 | bpf: Fix integer overflow involving bucket_size
In __htab_map_lookup_and_delete_batch(), hash buckets are iterated
over to count the number of elements in each bucket (bucket_size).
If bucket_size is large enough, the multiplication to calculate
kvmalloc() size could overflow, resulting in out-of-bounds write
as repor... |
static void vmx_enable_tdp(void)
{
kvm_mmu_set_mask_ptes(VMX_EPT_READABLE_MASK,
enable_ept_ad_bits ? VMX_EPT_ACCESS_BIT : 0ull,
enable_ept_ad_bits ? VMX_EPT_DIRTY_BIT : 0ull,
0ull, VMX_EPT_EXECUTABLE_MASK,
cpu_has_vmx_ept_execute_only() ? 0ull : VMX_EPT_READABLE_MASK,
VMX_EPT_RWX_MASK, 0ull);
ept_set_mmio_... | 0 | [
"CWE-284"
] | linux | 727ba748e110b4de50d142edca9d6a9b7e6111d8 | 202,689,741,697,217,100,000,000,000,000,000,000,000 | 12 | kvm: nVMX: Enforce cpl=0 for VMX instructions
VMX instructions executed inside a L1 VM will always trigger a VM exit
even when executed with cpl 3. This means we must perform the
privilege check in software.
Fixes: 70f3aac964ae("kvm: nVMX: Remove superfluous VMX instruction fault checks")
Cc: stable@vger.kernel.org
S... |
bool BufferView::operator==(const BufferView &other) const {
return this->buffer == other.buffer && this->byteLength == other.byteLength &&
this->byteOffset == other.byteOffset &&
this->byteStride == other.byteStride && this->name == other.name &&
this->target == other.target && this->exten... | 0 | [
"CWE-20"
] | tinygltf | 52ff00a38447f06a17eab1caa2cf0730a119c751 | 161,419,661,904,961,620,000,000,000,000,000,000,000 | 8 | Do not expand file path since its not necessary for glTF asset path(URI) and for security reason(`wordexp`). |
static inline unsigned long pud_index(unsigned long address)
{
return (address >> PUD_SHIFT) & (PTRS_PER_PUD - 1);
} | 0 | [
"CWE-119",
"CWE-787"
] | linux | 027ef6c87853b0a9df53175063028edb4950d476 | 170,033,447,454,137,740,000,000,000,000,000,000,000 | 4 | mm: thp: fix pmd_present for split_huge_page and PROT_NONE with THP
In many places !pmd_present has been converted to pmd_none. For pmds
that's equivalent and pmd_none is quicker so using pmd_none is better.
However (unless we delete pmd_present) we should provide an accurate
pmd_present too. This will avoid the ri... |
virtual ~LossyDctDecoderCsc () {} | 0 | [
"CWE-125"
] | openexr | e79d2296496a50826a15c667bf92bdc5a05518b4 | 66,614,858,655,426,525,000,000,000,000,000,000,000 | 1 | fix memory leaks and invalid memory accesses
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz> |
void udscs_server_listen_to_address(struct udscs_server *server,
const gchar *addr,
GError **err)
{
GSocketAddress *sock_addr;
sock_addr = g_unix_socket_address_new(addr);
g_socket_listener_add_address(G_SOCKET_LIST... | 0 | [
"CWE-770"
] | spice-vd_agent | 91caa9223857708475d29df1768208fed1675340 | 199,411,495,854,130,970,000,000,000,000,000,000,000 | 14 | Avoids unlimited agent connections
Limit the number of agents that can be connected.
Avoids reaching the maximum number of files in a process.
Beside one file descriptor per agent the daemon open just some
other fixed number of files.
This issue was reported by SUSE security team.
Signed-off-by: Frediano Ziglio <fre... |
static int snd_pcm_hw_rule_muldivk(struct snd_pcm_hw_params *params,
struct snd_pcm_hw_rule *rule)
{
struct snd_interval t;
snd_interval_muldivk(hw_param_interval_c(params, rule->deps[0]),
hw_param_interval_c(params, rule->deps[1]),
(unsigned long) rule->private, &t);
return snd_interval_refine(hw_par... | 0 | [
"CWE-125"
] | linux | 92ee3c60ec9fe64404dc035e7c41277d74aa26cb | 149,278,539,339,448,780,000,000,000,000,000,000,000 | 9 | ALSA: pcm: Fix races among concurrent hw_params and hw_free calls
Currently we have neither proper check nor protection against the
concurrent calls of PCM hw_params and hw_free ioctls, which may result
in a UAF. Since the existing PCM stream lock can't be used for
protecting the whole ioctl operations, we need a new... |
static void test_subqueries_ref()
{
MYSQL_STMT *stmt;
int rc, i;
const char *query= "SELECT a as ccc from t1 outr where a+1=(SELECT 1+outr.a from t1 where outr.a+1=a+1 and a=1)";
myheader("test_subqueries_ref");
rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1");
myquery(rc);
rc= mysql_query(mysql, "CRE... | 0 | [
"CWE-284",
"CWE-295"
] | mysql-server | 3bd5589e1a5a93f9c224badf983cd65c45215390 | 28,894,031,227,137,976,000,000,000,000,000,000,000 | 32 | WL#6791 : Redefine client --ssl option to imply enforced encryption
# Changed the meaning of the --ssl=1 option of all client binaries
to mean force ssl, not try ssl and fail over to eunecrypted
# Added a new MYSQL_OPT_SSL_ENFORCE mysql_options()
option to specify that an ssl connection is required.
# Added a new macr... |
static int ax25_shutdown(struct socket *sk, int how)
{
/* FIXME - generate DM and RNR states */
return -EOPNOTSUPP;
} | 0 | [] | net | 79462ad02e861803b3840cc782248c7359451cd9 | 204,405,118,920,048,880,000,000,000,000,000,000,000 | 5 | net: add validation for the socket syscall protocol argument
郭永刚 reported that one could simply crash the kernel as root by
using a simple program:
int socket_fd;
struct sockaddr_in addr;
addr.sin_port = 0;
addr.sin_addr.s_addr = INADDR_ANY;
addr.sin_family = 10;
socket_fd = socket(10,3,0x40000000);
connect(s... |
EC_KEY *d2i_ECPrivateKey(EC_KEY **a, const unsigned char **in, long len)
{
int ok = 0;
EC_KEY *ret = NULL;
EC_PRIVATEKEY *priv_key = NULL;
if ((priv_key = EC_PRIVATEKEY_new()) == NULL) {
ECerr(EC_F_D2I_ECPRIVATEKEY, ERR_R_MALLOC_FAILURE);
return NULL;
}
if ((priv_key = d2i_EC_P... | 0 | [] | openssl | 1b4a8df38fc9ab3c089ca5765075ee53ec5bd66a | 151,924,996,815,891,460,000,000,000,000,000,000,000 | 88 | Fix a failure to NULL a pointer freed on error.
Inspired by BoringSSL commit 517073cd4b by Eric Roman <eroman@chromium.org>
CVE-2015-0209
Reviewed-by: Emilia Käsper <emilia@openssl.org> |
LIEF::Binary::relocations_t Binary::get_abstract_relocations() {
LIEF::Binary::relocations_t relocations;
it_relocations macho_relocations = this->relocations();
relocations.reserve(macho_relocations.size());
for (Relocation& r : macho_relocations) {
relocations.push_back(&r);
}
return relocations;
} | 0 | [
"CWE-703"
] | LIEF | 7acf0bc4224081d4f425fcc8b2e361b95291d878 | 49,164,296,274,074,830,000,000,000,000,000,000,000 | 11 | Resolve #764 |
static int perf_config_from_file(config_fn_t fn, const char *filename, void *data)
{
int ret;
FILE *f = fopen(filename, "r");
ret = -1;
if (f) {
config_file = f;
config_file_name = filename;
config_linenr = 1;
config_file_eof = 0;
ret = perf_parse_file(fn, data);
fclose(f);
config_file_name = NULL;
... | 0 | [
"CWE-94"
] | linux | aba8d056078e47350d85b06a9cabd5afcc4b72ea | 122,321,023,760,359,240,000,000,000,000,000,000,000 | 17 | perf tools: do not look at ./config for configuration
In addition to /etc/perfconfig and $HOME/.perfconfig, perf looks for
configuration in the file ./config, imitating git which looks at
$GIT_DIR/config. If ./config is not a perf configuration file, it
fails, or worse, treats it as a configuration file and changes b... |
intrusive_ptr<Expression> ExpressionCompare::parse(ExpressionContext* const expCtx,
BSONElement bsonExpr,
const VariablesParseState& vps,
CmpOp op) {
intrusive_ptr... | 0 | [] | mongo | 1772b9a0393b55e6a280a35e8f0a1f75c014f301 | 162,909,720,851,883,700,000,000,000,000,000,000,000 | 10 | SERVER-49404 Enforce additional checks in $arrayToObject |
ruby_brace_expand(const char *str, int flags, ruby_glob_func *func, VALUE arg,
rb_encoding *enc, VALUE var)
{
const int escape = !(flags & FNM_NOESCAPE);
const char *p = str;
const char *pend = p + strlen(p);
const char *s = p;
const char *lbrace = 0, *rbrace = 0;
int nest = 0, status = 0;
... | 0 | [
"CWE-22"
] | ruby | bd5661a3cbb38a8c3a3ea10cd76c88bbef7871b8 | 217,244,624,330,698,160,000,000,000,000,000,000,000 | 58 | dir.c: check NUL bytes
* dir.c (GlobPathValue): should be used in rb_push_glob only.
other methods should use FilePathValue.
https://hackerone.com/reports/302338
* dir.c (rb_push_glob): expand GlobPathValue
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
g_tls_connection_base_set_missing_requested_client_certificate (GTlsConnectionBase *tls)
{
GTlsConnectionBasePrivate *priv = g_tls_connection_base_get_instance_private (tls);
/* FIXME: Assert this is only used on the handshake thread. */
priv->missing_requested_client_certificate = TRUE;
} | 0 | [
"CWE-295"
] | glib-networking | 29513946809590c4912550f6f8620468f9836d94 | 300,713,591,108,377,360,000,000,000,000,000,000,000 | 8 | Return bad identity error if identity is unset
When the server-identity property of GTlsClientConnection is unset, the
documentation sasy we need to fail the certificate verification with
G_TLS_CERTIFICATE_BAD_IDENTITY. This is important because otherwise,
it's easy for applications to fail to specify server identity.... |
static void __reschedule_timeout(int drive, const char *message)
{
unsigned long delay;
if (drive < 0 || drive >= N_DRIVE) {
delay = 20UL * HZ;
drive = 0;
} else
delay = drive_params[drive].timeout;
mod_delayed_work(floppy_wq, &fd_timeout, delay);
if (drive_params[drive].flags & FD_DEBUG)
DPRINT("resched... | 0 | [
"CWE-416"
] | linux | 233087ca063686964a53c829d547c7571e3f67bf | 254,531,487,818,224,870,000,000,000,000,000,000,000 | 15 | floppy: disable FDRAWCMD by default
Minh Yuan reported a concurrency use-after-free issue in the floppy code
between raw_cmd_ioctl and seek_interrupt.
[ It turns out this has been around, and that others have reported the
KASAN splats over the years, but Minh Yuan had a reproducer for it and
so gets primary credi... |
bool Lex_ident_sys_st::to_size_number(ulonglong *to) const
{
ulonglong number;
uint text_shift_number= 0;
longlong prefix_number;
const char *start_ptr= str;
size_t str_len= length;
const char *end_ptr= start_ptr + str_len;
int error;
prefix_number= my_strtoll10(start_ptr, (char**) &end_ptr, &error);
... | 0 | [
"CWE-703"
] | server | 39feab3cd31b5414aa9b428eaba915c251ac34a2 | 320,038,984,936,205,380,000,000,000,000,000,000,000 | 39 | 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... |
jbig2_sd_release(Jbig2Ctx *ctx, Jbig2SymbolDict *dict)
{
uint32_t i;
if (dict == NULL)
return;
for (i = 0; i < dict->n_symbols; i++)
if (dict->glyphs[i])
jbig2_image_release(ctx, dict->glyphs[i]);
jbig2_free(ctx->allocator, dict->glyphs);
jbig2_free(ctx->allocator, dict)... | 0 | [] | ghostpdl | b184e783702246e154294326d03d9abda669fcfa | 136,946,192,592,979,490,000,000,000,000,000,000,000 | 12 | Bug 697703: Prevent integer overflow vulnerability.
Add extra check for the offset being greater than the size
of the image and hence reading off the end of the buffer.
Thank you to Dai Ge for finding this issue and suggesting a patch. |
static int gnutls_system_mutex_unlock(void **priv)
{
LeaveCriticalSection((CRITICAL_SECTION *) * priv);
return 0;
} | 0 | [
"CWE-20"
] | gnutls | b0a3048e56611a2deee4976aeba3b8c0740655a6 | 74,995,297,835,463,175,000,000,000,000,000,000,000 | 5 | env: use secure_getenv when reading environment variables |
g_vfs_daemon_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
switch (prop_id)
{
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
} | 0 | [
"CWE-276"
] | gvfs | e3808a1b4042761055b1d975333a8243d67b8bfe | 128,736,692,215,341,500,000,000,000,000,000,000,000 | 12 | gvfsdaemon: Check that the connecting client is the same user
Otherwise, an attacker who learns the abstract socket address from
netstat(8) or similar could connect to it and issue D-Bus method
calls.
Signed-off-by: Simon McVittie <smcv@collabora.com> |
psf_close_rsrc (SF_PRIVATE *psf)
{ psf_close_fd (psf->rsrc.filedes) ;
psf->rsrc.filedes = -1 ;
return 0 ;
} /* psf_close_rsrc */ | 0 | [
"CWE-369",
"CWE-189"
] | libsndfile | 725c7dbb95bfaf8b4bb7b04820e3a00cceea9ce6 | 184,638,793,622,110,800,000,000,000,000,000,000,000 | 5 | src/file_io.c : Prevent potential divide-by-zero.
Closes: https://github.com/erikd/libsndfile/issues/92 |
static int __ipv6_try_regen_rndid(struct inet6_dev *idev, struct in6_addr *tmpaddr) {
int ret = 0;
if (tmpaddr && memcmp(idev->rndid, &tmpaddr->s6_addr[8], 8) == 0)
ret = __ipv6_regen_rndid(idev);
return ret;
} | 0 | [
"CWE-200"
] | linux-2.6 | 8a47077a0b5aa2649751c46e7a27884e6686ccbf | 167,588,642,396,541,270,000,000,000,000,000,000,000 | 7 | [NETLINK]: Missing padding fields in dumped structures
Plug holes with padding fields and initialized them to zero.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net> |
R_API const char *r_anal_function_get_var_reg_at(RAnalFunction *fcn, st64 delta, ut64 addr) {
st64 offset = addr - fcn->addr;
RPVector *inst_accesses = ht_up_find (fcn->inst_vars, offset, NULL);
if (!inst_accesses) {
return NULL;
}
RAnalVar *var = NULL;
void **it;
r_pvector_foreach (inst_accesses, it) {
RAna... | 0 | [
"CWE-416"
] | radare2 | a7ce29647fcb38386d7439696375e16e093d6acb | 335,760,905,102,980,000,000,000,000,000,000,000,000 | 29 | Fix UAF in aaaa on arm/thumb switching ##crash
* Reported by @peacock-doris via huntr.dev
* Reproducer tests_65185
* This is a logic fix, but not the fully safe as changes in the code
can result on UAF again, to properly protect r2 from crashing we
need to break the ABI and add refcounting to RRegItem, which can't... |
vmxnet3_init_msi(VMXNET3State *s)
{
PCIDevice *d = PCI_DEVICE(s);
int res;
res = msi_init(d, VMXNET3_MSI_OFFSET, VMXNET3_MAX_NMSIX_INTRS,
VMXNET3_USE_64BIT, VMXNET3_PER_VECTOR_MASK);
if (0 > res) {
VMW_WRPRN("Failed to initialize MSI, error %d", res);
s->msi_used = fa... | 0 | [
"CWE-20"
] | qemu | a7278b36fcab9af469563bd7b9dadebe2ae25e48 | 24,759,217,750,542,430,000,000,000,000,000,000,000 | 16 | net/vmxnet3: Refine l2 header validation
Validation of l2 header length assumed minimal packet size as
eth_header + 2 * vlan_header regardless of the actual protocol.
This caused crash for valid non-IP packets shorter than 22 bytes, as
'tx_pkt->packet_type' hasn't been assigned for such packets, and
'vmxnet3_on_tx_do... |
TABLE_CATEGORY get_table_category(const LEX_CSTRING *db,
const LEX_CSTRING *name)
{
DBUG_ASSERT(db != NULL);
DBUG_ASSERT(name != NULL);
if (is_infoschema_db(db))
return TABLE_CATEGORY_INFORMATION;
if (lex_string_eq(&PERFORMANCE_SCHEMA_DB_NAME, db))
return TABLE_CATEGO... | 0 | [
"CWE-416"
] | server | c02ebf3510850ba78a106be9974c94c3b97d8585 | 53,487,218,077,233,160,000,000,000,000,000,000,000 | 29 | MDEV-24176 Preparations
1. moved fix_vcol_exprs() call to open_table()
mysql_alter_table() doesn't do lock_tables() so it cannot win from
fix_vcol_exprs() from there. Tests affected: main.default_session
2. Vanilla cleanups and comments. |
suggest_trie_walk(
suginfo_T *su,
langp_T *lp,
char_u *fword,
int soundfold)
{
char_u tword[MAXWLEN]; // good word collected so far
trystate_T stack[MAXWLEN];
char_u preword[MAXWLEN * 3]; // word found with proper case;
// concatenation of prefix compound
// words an... | 1 | [
"CWE-121",
"CWE-787"
] | vim | 06f15416bb8d5636200a10776f1752c4d6e49f31 | 263,153,337,685,614,000,000,000,000,000,000,000,000 | 1,414 | patch 8.2.4247: stack corruption when looking for spell suggestions
Problem: Stack corruption when looking for spell suggestions.
Solution: Prevent the depth increased too much. Add a five second time
limit to finding suggestions. |
GetCellArrayFieldBufSize(matvar_t *matvar, size_t *size)
{
int err;
size_t nBytes = 0, type_buf_size;
size_t tag_size = 8, array_flags_size = 8;
*size = 0;
if ( matvar == NULL )
return MATIO_E_BAD_ARGUMENT;
/* Add the Array Flags tag and space to the number of bytes */
nBytes += t... | 0 | [
"CWE-200",
"CWE-401"
] | matio | b53b62b756920f4c1509f4ee06427f66c3b5c9c4 | 149,907,176,050,574,530,000,000,000,000,000,000,000 | 27 | Fix memory leak
As reported by https://github.com/tbeu/matio/issues/186 |
asmlinkage long compat_sys_fstatfs64(unsigned int fd, compat_size_t sz, struct compat_statfs64 __user *buf)
{
struct file * file;
struct kstatfs tmp;
int error;
if (sz != sizeof(*buf))
return -EINVAL;
error = -EBADF;
file = fget(fd);
if (!file)
goto out;
error = vfs_statfs(file->f_dentry, &tmp);
if (!err... | 0 | [] | linux-2.6 | 822191a2fa1584a29c3224ab328507adcaeac1ab | 18,460,150,219,690,913,000,000,000,000,000,000,000 | 20 | [PATCH] skip data conversion in compat_sys_mount when data_page is NULL
OpenVZ Linux kernel team has found a problem with mounting in compat mode.
Simple command "mount -t smbfs ..." on Fedora Core 5 distro in 32-bit mode
leads to oops:
Unable to handle kernel NULL pointer dereference at 0000000000000000 RIP: comp... |
static int mt_touch_input_configured(struct hid_device *hdev,
struct hid_input *hi,
struct mt_application *app)
{
struct mt_device *td = hid_get_drvdata(hdev);
struct mt_class *cls = &td->mtclass;
struct input_dev *input = hi->input;
int ret;
if (!td->maxcontacts)
td->maxcontacts = MT_DEFAULT_... | 0 | [
"CWE-787"
] | linux | 35556bed836f8dc07ac55f69c8d17dce3e7f0e25 | 283,822,497,685,535,100,000,000,000,000,000,000,000 | 44 | HID: core: Sanitize event code and type when mapping input
When calling into hid_map_usage(), the passed event code is
blindly stored as is, even if it doesn't fit in the associated bitmap.
This event code can come from a variety of sources, including devices
masquerading as input devices, only a bit more "programmab... |
long FS_ReadFileDir(const char *qpath, void *searchPath, qboolean unpure, void **buffer)
{
fileHandle_t h;
searchpath_t *search;
byte* buf;
qboolean isConfig;
long len;
if ( !fs_searchpaths ) {
Com_Error( ERR_FATAL, "Filesystem call made without initialization" );
}
if ( !qpath || !qpath[0] ) {
Com_... | 0 | [
"CWE-269"
] | ioq3 | 376267d534476a875d8b9228149c4ee18b74a4fd | 161,558,861,315,668,360,000,000,000,000,000,000,000 | 121 | Don't load .pk3s as .dlls, and don't load user config files from .pk3s. |
int bind_virq_to_irqhandler(unsigned int virq, unsigned int cpu,
irq_handler_t handler,
unsigned long irqflags, const char *devname, void *dev_id)
{
int irq, retval;
irq = bind_virq_to_irq(virq, cpu, irqflags & IRQF_PERCPU);
if (irq < 0)
return irq;
retval = request_irq(irq, handler, irqflags, devn... | 0 | [
"CWE-400",
"CWE-703"
] | linux | e99502f76271d6bc4e374fe368c50c67a1fd3070 | 75,168,539,621,885,200,000,000,000,000,000,000,000 | 17 | 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... |
static struct mountpoint *lock_mount(struct path *path)
{
struct vfsmount *mnt;
struct dentry *dentry = path->dentry;
retry:
mutex_lock(&dentry->d_inode->i_mutex);
if (unlikely(cant_mount(dentry))) {
mutex_unlock(&dentry->d_inode->i_mutex);
return ERR_PTR(-ENOENT);
}
namespace_lock();
mnt = lookup_mnt(path);... | 0 | [
"CWE-703"
] | linux | cd4a40174b71acd021877341684d8bb1dc8ea4ae | 151,415,992,336,137,170,000,000,000,000,000,000,000 | 30 | mnt: Fail collect_mounts when applied to unmounted mounts
The only users of collect_mounts are in audit_tree.c
In audit_trim_trees and audit_add_tree_rule the path passed into
collect_mounts is generated from kern_path passed an audit_tree
pathname which is guaranteed to be an absolute path. In those cases
collect_... |
static int hdr_validate_crypt_segment(struct crypt_device *cd,
json_object *jobj, const char *key, json_object *jobj_digests,
uint64_t offset, uint64_t size)
{
json_object *jobj_ivoffset, *jobj_sector_size, *jobj_integrity;
uint32_t sector_size;
uint64_t ivoffset;
if (!(jobj_ivoffset = json_contains(cd,... | 0 | [
"CWE-787"
] | cryptsetup | 52f5cb8cedf22fb3e14c744814ec8af7614146c7 | 13,655,747,655,189,392,000,000,000,000,000,000,000 | 48 | Check segment gaps regardless of heap space.
Segments are validated in hdr_validate_segments. Gaps in segment keys
are detected when collecting offsets. But if an invalid segment is very
large, larger than count, it could happen that cryptsetup is unable to
allocate enough memory, not giving a clue about what actually... |
static int em_lgdt_lidt(struct x86_emulate_ctxt *ctxt, bool lgdt)
{
struct desc_ptr desc_ptr;
int rc;
if (ctxt->mode == X86EMUL_MODE_PROT64)
ctxt->op_bytes = 8;
rc = read_descriptor(ctxt, ctxt->src.addr.mem,
&desc_ptr.size, &desc_ptr.address,
ctxt->op_bytes);
if (rc != X86EMUL_CONTINUE)
return... | 0 | [
"CWE-362",
"CWE-269"
] | linux | f3747379accba8e95d70cec0eae0582c8c182050 | 166,929,625,572,024,090,000,000,000,000,000,000,000 | 23 | KVM: x86: SYSENTER emulation is broken
SYSENTER emulation is broken in several ways:
1. It misses the case of 16-bit code segments completely (CVE-2015-0239).
2. MSR_IA32_SYSENTER_CS is checked in 64-bit mode incorrectly (bits 0 and 1 can
still be set without causing #GP).
3. MSR_IA32_SYSENTER_EIP and MSR_IA32_SYSE... |
void uverbs_user_mmap_disassociate(struct ib_uverbs_file *ufile)
{
struct rdma_umap_priv *priv, *next_priv;
lockdep_assert_held(&ufile->hw_destroy_rwsem);
while (1) {
struct mm_struct *mm = NULL;
/* Get an arbitrary mm pointer that hasn't been cleaned yet */
mutex_lock(&ufile->umap_lock);
while (!list_emp... | 0 | [
"CWE-362",
"CWE-703",
"CWE-667"
] | linux | 04f5866e41fb70690e28397487d8bd8eea7d712a | 47,227,682,601,623,260,000,000,000,000,000,000,000 | 57 | coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping
The core dumping code has always run without holding the mmap_sem for
writing, despite that is the only way to ensure that the entire vma
layout will not change from under it. Only using some signal
serialization on the processes bel... |
static void gen_nonce_hash(char *hash, const char *timestr, const char *opaque,
const server_rec *server,
const digest_config_rec *conf)
{
unsigned char sha1[APR_SHA1_DIGESTSIZE];
apr_sha1_ctx_t ctx;
memcpy(&ctx, &conf->nonce_ctx, sizeof(ctx));
/*
... | 0 | [
"CWE-787"
] | httpd | 3b6431eb9c9dba603385f70a2131ab4a01bf0d3b | 301,864,299,033,944,840,000,000,000,000,000,000,000 | 23 | Merge r1885659 from trunk:
mod_auth_digest: Fast validation of the nonce's base64 to fail early if
the format can't match anyway.
Submitted by: ylavic
Reviewed by: ylavic, covener, jailletc36
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1885666 13f79535-47bb-0310-9956-ffa... |
static void fdct_clamp(float *buf, JCOEFPTR coef, UINT16 *quantval) {
int x, y, n = DCTSIZE;
(void)x; (void)y;
fdct_float(buf, buf);
#if 1 && defined(USE_NEON)
if (sizeof(quantval[0]) == 2 && sizeof(quantval[0]) == sizeof(coef[0]))
for (y = 0; y < n; y++) {
int16x8_t v0, v1, v2, v3; float32x4_t f0, f1, f2, f3, ... | 0 | [] | jpeg-quantsmooth | 3ab3838e610d361b71d937738edf156505c59c58 | 123,361,333,106,584,930,000,000,000,000,000,000,000 | 126 | avoid divide-by-zero on damaged JPEG files
Also fixed misleading indentation warnings from GCC. |
void wsrep_sst_auth_free()
{
if (wsrep_sst_auth) { my_free ((void*)wsrep_sst_auth); }
if (sst_auth_real) { free (const_cast<char*>(sst_auth_real)); }
wsrep_sst_auth= NULL;
sst_auth_real= NULL;
} | 0 | [
"CWE-77"
] | mysql-wsrep | 4ea4b0c6a318209ac09b15aaa906c7b4a13b988c | 68,345,818,993,140,300,000,000,000,000,000,000,000 | 7 | codership/mysql-wsrep-bugs#758 Donor uses invalid SST methods |
static bool sci_exists(struct net_device *dev, sci_t sci)
{
struct macsec_rxh_data *rxd = macsec_data_rtnl(dev);
struct macsec_dev *macsec;
list_for_each_entry(macsec, &rxd->secys, secys) {
if (macsec->secy.sci == sci)
return true;
}
return false;
} | 0 | [
"CWE-119"
] | net | 5294b83086cc1c35b4efeca03644cf9d12282e5b | 223,174,645,102,521,000,000,000,000,000,000,000,000 | 12 | macsec: dynamically allocate space for sglist
We call skb_cow_data, which is good anyway to ensure we can actually
modify the skb as such (another error from prior). Now that we have the
number of fragments required, we can safely allocate exactly that amount
of memory.
Fixes: c09440f7dcb3 ("macsec: introduce IEEE 80... |
void Curl_conncache_destroy(struct conncache *connc)
{
if(connc)
Curl_hash_destroy(&connc->hash);
} | 0 | [] | curl | 058f98dc3fe595f21dc26a5b9b1699e519ba5705 | 190,706,735,393,087,100,000,000,000,000,000,000,000 | 5 | conncache: include the zone id in the "bundle" hashkey
Make connections to two separate IPv6 zone ids create separate
connections.
Reported-by: Harry Sintonen
Bug: https://curl.se/docs/CVE-2022-27775.html
Closes #8747 |
TEST_F(HttpConnectionManagerImplTest, FooUpgradeDrainClose) {
setup(false, "envoy-custom-server", false);
// Store the basic request encoder during filter chain setup.
auto* filter = new MockStreamFilter();
EXPECT_CALL(drain_close_, drainClose()).WillOnce(Return(true));
EXPECT_CALL(*filter, decodeHeaders(_,... | 0 | [
"CWE-22"
] | envoy | 5333b928d8bcffa26ab19bf018369a835f697585 | 87,963,645,026,056,570,000,000,000,000,000,000,000 | 62 | Implement handling of escaped slash characters in URL path
Fixes: CVE-2021-29492
Signed-off-by: Yan Avlasov <yavlasov@google.com> |
static void vm_unlock_anon_vma(struct anon_vma *anon_vma)
{
if (test_bit(0, (unsigned long *) &anon_vma->root->rb_root.rb_root.rb_node)) {
/*
* The LSB of head.next can't change to 0 from under
* us because we hold the mm_all_locks_mutex.
*
* We must however clear the bitflag before unlocking
* the vm... | 0 | [
"CWE-476"
] | linux | 27ae357fa82be5ab73b2ef8d39dcb8ca2563483a | 328,031,667,069,423,650,000,000,000,000,000,000,000 | 21 | mm, oom: fix concurrent munlock and oom reaper unmap, v3
Since exit_mmap() is done without the protection of mm->mmap_sem, it is
possible for the oom reaper to concurrently operate on an mm until
MMF_OOM_SKIP is set.
This allows munlock_vma_pages_all() to concurrently run while the oom
reaper is operating on a vma. ... |
drawing_path(gx_path_type_t path_type, xps_brush_t brush_type)
{
return ((path_type & gx_path_type_stroke) || (path_type & gx_path_type_fill) ||
image_brush_fill(path_type, brush_type));
} | 0 | [] | ghostpdl | 94d8955cb7725eb5f3557ddc02310c76124fdd1a | 186,575,197,222,317,270,000,000,000,000,000,000,000 | 5 | Bug 701818: better handling of error during PS/PDF image
In the xps device, if an error occurred after xps_begin_image() but before
xps_image_end_image(), *if* the Postscript had called 'restore' as part of the
error handling, the image enumerator would have been freed (by the restore)
despite the xps device still hol... |
formatStrlen(char *target, char *source, int freeit)
{
if (source != 0) {
sprintf(target, "%u", (unsigned) strlen(source));
if (freeit) {
free(source);
}
} else {
strcpy(target, "0");
}
return target;
} | 0 | [
"CWE-399"
] | xterm-snapshots | 82ba55b8f994ab30ff561a347b82ea340ba7075c | 273,722,190,744,764,140,000,000,000,000,000,000,000 | 12 | snapshot of project "xterm", label xterm-365d |
unsigned long arch_align_stack(unsigned long sp)
{
if (!(current->personality & ADDR_NO_RANDOMIZE) && randomize_va_space)
sp -= get_random_int() & ~PAGE_MASK;
return sp & ~0xf;
} | 0 | [
"CWE-20"
] | linux | 621b5060e823301d0cba4cb52a7ee3491922d291 | 170,483,797,035,780,100,000,000,000,000,000,000,000 | 6 | powerpc/tm: Fix crash when forking inside a transaction
When we fork/clone we currently don't copy any of the TM state to the new
thread. This results in a TM bad thing (program check) when the new process is
switched in as the kernel does a tmrechkpt with TEXASR FS not set. Also, since
R1 is from userspace, we trig... |
void PlayerGeneric::resetChannels()
{
if (player)
player->resetChannelsFull();
} | 0 | [
"CWE-416"
] | MilkyTracker | 7afd55c42ad80d01a339197a2d8b5461d214edaf | 113,377,271,829,050,600,000,000,000,000,000,000,000 | 5 | Fix use-after-free in PlayerGeneric destructor |
f2l(UINT8 *out, const UINT8 *in_, int xsize) {
int x;
for (x = 0; x < xsize; x++, out++, in_ += 4) {
FLOAT32 v;
memcpy(&v, in_, sizeof(v));
if (v <= 0.0) {
*out = 0;
} else if (v >= 255.0) {
*out = 255;
} else {
*out = (UINT8)v;
... | 0 | [
"CWE-120"
] | Pillow | 518ee3722a99d7f7d890db82a20bd81c1c0327fb | 97,716,191,135,537,040,000,000,000,000,000,000,000 | 14 | Use snprintf instead of sprintf |
void qemu_spice_add_memslot(SimpleSpiceDisplay *ssd, QXLDevMemSlot *memslot)
{
ssd->worker->add_memslot(ssd->worker, memslot);
} | 1 | [] | qemu-kvm | 5ff4e36c804157bd84af43c139f8cd3a59722db9 | 123,412,887,527,221,970,000,000,000,000,000,000,000 | 4 | qxl: async io support using new spice api
Some of the QXL port i/o commands are waiting for the spice server to
complete certain actions. Add async versions for these commands, so we
don't block the vcpu while the spice server processses the command.
Instead the qxl device will raise an IRQ when done.
The async comm... |
void crypto_reverse(BYTE* data, int length)
{
int i, j;
BYTE temp;
for (i = 0, j = length - 1; i < j; i++, j--)
{
temp = data[i];
data[i] = data[j];
data[j] = temp;
}
} | 0 | [
"CWE-787"
] | FreeRDP | 8305349a943c68b1bc8c158f431dc607655aadea | 278,414,437,650,542,830,000,000,000,000,000,000,000 | 12 | Fixed GHSL-2020-102 heap overflow
(cherry picked from commit 197b16cc15a12813c2e4fa2d6ae9cd9c4a57e581) |
static CURLcode ossl_connect_step2(struct Curl_easy *data,
struct connectdata *conn, int sockindex)
{
int err;
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
struct ssl_backend_data *backend = connssl->backend;
DEBUGASSERT(ssl_connect_2 == connssl->connecting_state
... | 0 | [
"CWE-416",
"CWE-295"
] | curl | 7f4a9a9b2a49547eae24d2e19bc5c346e9026479 | 278,847,018,356,584,560,000,000,000,000,000,000,000 | 165 | openssl: associate/detach the transfer from connection
CVE-2021-22901
Bug: https://curl.se/docs/CVE-2021-22901.html |
longlong Item_func_ceiling::int_op()
{
longlong result;
switch (args[0]->result_type()) {
case INT_RESULT:
result= args[0]->val_int();
null_value= args[0]->null_value;
break;
case DECIMAL_RESULT:
{
my_decimal dec_buf, *dec;
if ((dec= Item_func_ceiling::decimal_op(&dec_buf)))
my_decim... | 0 | [
"CWE-120"
] | server | eca207c46293bc72dd8d0d5622153fab4d3fccf1 | 144,567,240,627,618,430,000,000,000,000,000,000,000 | 22 | MDEV-25317 Assertion `scale <= precision' failed in decimal_bin_size And Assertion `scale >= 0 && precision > 0 && scale <= precision' failed in decimal_bin_size_inline/decimal_bin_size.
Precision should be kept below DECIMAL_MAX_SCALE for computations.
It can be bigger in Item_decimal. I'd fix this too but it changes... |
do_arg_all(
int count,
int forceit, // hide buffers in current windows
int keep_tabs) // keep current tabs, for ":tab drop file"
{
int i;
win_T *wp, *wpnext;
char_u *opened; // Array of weight for which args are open:
// 0: not opened
// 1: opened in other tab
// 2: opened in c... | 1 | [
"CWE-416",
"CWE-125"
] | vim | 6f98371532fcff911b462d51bc64f2ce8a6ae682 | 330,220,089,447,816,500,000,000,000,000,000,000,000 | 291 | 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 inline unsigned long zap_pud_range(struct mmu_gather *tlb,
struct vm_area_struct *vma, p4d_t *p4d,
unsigned long addr, unsigned long end,
struct zap_details *details)
{
pud_t *pud;
unsigned long next;
pud = pud_offset(p4d, addr);
do {
next = pud_addr_end(addr, end);
if (pud_trans_huge(*pud) ... | 0 | [
"CWE-119"
] | linux | 1be7107fbe18eed3e319a6c3e83c78254b693acb | 279,573,088,725,994,200,000,000,000,000,000,000,000 | 28 | mm: larger stack guard gap, between vmas
Stack guard page is a useful feature to reduce a risk of stack smashing
into a different mapping. We have been using a single page gap which
is sufficient to prevent having stack adjacent to a different mapping.
But this seems to be insufficient in the light of the stack usage ... |
char Curl_raw_toupper(char in)
{
if(in >= 'a' && in <= 'z')
return (char)('A' + in - 'a');
return in;
} | 0 | [] | curl | 852aa5ad351ea53e5f01d2f44b5b4370c2bf5425 | 273,111,191,420,818,840,000,000,000,000,000,000,000 | 6 | url: check sasl additional parameters for connection reuse.
Also move static function safecmp() as non-static Curl_safecmp() since
its purpose is needed at several places.
Bug: https://curl.se/docs/CVE-2022-22576.html
CVE-2022-22576
Closes #8746 |
bool Image::isLittleEndianPlatform() { return !isBigEndianPlatform(); } | 0 | [
"CWE-125"
] | exiv2 | 6e3855aed7ba8bb4731fc4087ca7f9078b2f3d97 | 183,842,715,859,407,530,000,000,000,000,000,000,000 | 1 | Fix https://github.com/Exiv2/exiv2/issues/55 |
static int ext4_da_writepage(struct page *page,
struct writeback_control *wbc)
{
int ret = 0;
loff_t size;
unsigned int len;
struct buffer_head *page_bufs;
struct inode *inode = page->mapping->host;
trace_mark(ext4_da_writepage,
"dev %s ino %lu page_index %lu",
inode->i_sb->s_id, inode->i_ino, page... | 0 | [
"CWE-399"
] | linux-2.6 | 06a279d636734da32bb62dd2f7b0ade666f65d7c | 63,993,557,895,704,980,000,000,000,000,000,000,000 | 82 | ext4: only use i_size_high for regular files
Directories are not allowed to be bigger than 2GB, so don't use
i_size_high for anything other than regular files. E2fsck should
complain about these inodes, but the simplest thing to do for the
kernel is to only use i_size_high for regular files.
This prevents an intenti... |
TPMI_ECC_KEY_EXCHANGE_Unmarshal(TPMI_ECC_KEY_EXCHANGE *target, BYTE **buffer, INT32 *size, BOOL allowNull)
{
TPM_RC rc = TPM_RC_SUCCESS;
TPMI_ECC_KEY_EXCHANGE orig_target = *target; // libtpms added
if (rc == TPM_RC_SUCCESS) {
rc = TPM_ALG_ID_Unmarshal(target, buffer, size);
}
if (rc == TPM_RC_S... | 0 | [
"CWE-787"
] | libtpms | 5cc98a62dc6f204dcf5b87c2ee83ac742a6a319b | 65,499,689,142,166,280,000,000,000,000,000,000,000 | 31 | tpm2: Restore original value if unmarshalled value was illegal
Restore the original value of the memory location where data from
a stream was unmarshalled and the unmarshalled value was found to
be illegal. The goal is to not keep illegal values in memory.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> |
int unregister_tcf_proto_ops(struct tcf_proto_ops *ops)
{
struct tcf_proto_ops *t;
int rc = -ENOENT;
/* Wait for outstanding call_rcu()s, if any, from a
* tcf_proto_ops's destroy() handler.
*/
rcu_barrier();
flush_workqueue(tc_filter_wq);
write_lock(&cls_mod_lock);
list_for_each_entry(t, &tcf_proto_base, h... | 0 | [
"CWE-416"
] | linux | 04c2a47ffb13c29778e2a14e414ad4cb5a5db4b5 | 279,170,570,447,241,450,000,000,000,000,000,000,000 | 22 | net: sched: fix use-after-free in tc_new_tfilter()
Whenever tc_new_tfilter() jumps back to replay: label,
we need to make sure @q and @chain local variables are cleared again,
or risk use-after-free as in [1]
For consistency, apply the same fix in tc_ctl_chain()
BUG: KASAN: use-after-free in mini_qdisc_pair_swap+0x1... |
static int rtl8xxxu_iqk_path_a(struct rtl8xxxu_priv *priv)
{
u32 reg_eac, reg_e94, reg_e9c, reg_ea4, val32;
int result = 0;
/* path-A IQK setting */
rtl8xxxu_write32(priv, REG_TX_IQK_TONE_A, 0x10008c1f);
rtl8xxxu_write32(priv, REG_RX_IQK_TONE_A, 0x10008c1f);
rtl8xxxu_write32(priv, REG_TX_IQK_PI_A, 0x82140102);
... | 0 | [
"CWE-400",
"CWE-401"
] | linux | a2cdd07488e666aa93a49a3fc9c9b1299e27ef3c | 156,173,826,784,024,300,000,000,000,000,000,000,000 | 56 | rtl8xxxu: prevent leaking urb
In rtl8xxxu_submit_int_urb if usb_submit_urb fails the allocated urb
should be released.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Reviewed-by: Chris Chiu <chiu@endlessm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org> |
static HashTable *exif_make_tag_ht(tag_info_type *tag_table)
{
HashTable *ht = malloc(sizeof(HashTable));
zend_hash_init(ht, 0, NULL, NULL, 1);
while (tag_table->Tag != TAG_END_OF_LIST) {
if (!zend_hash_index_add_ptr(ht, tag_table->Tag, tag_table->Desc)) {
zend_error(E_CORE_ERROR, "Duplicate tag %x", tag_table-... | 0 | [
"CWE-125"
] | php-src | 0c77b4307df73217283a4aaf9313e1a33a0967ff | 69,445,544,528,196,750,000,000,000,000,000,000,000 | 12 | Fixed bug #79282 |
int mem_cgroup_prepare_migration(struct page *page,
struct page *newpage, struct mem_cgroup **memcgp, gfp_t gfp_mask)
{
struct mem_cgroup *memcg = NULL;
struct page_cgroup *pc;
enum charge_type ctype;
int ret = 0;
*memcgp = NULL;
VM_BUG_ON(PageTransHuge(page));
if (mem_cgroup_disabled())
return 0;
pc = lo... | 0 | [
"CWE-476",
"CWE-415"
] | linux | 371528caec553785c37f73fa3926ea0de84f986f | 321,550,994,788,230,570,000,000,000,000,000,000,000 | 91 | mm: memcg: Correct unregistring of events attached to the same eventfd
There is an issue when memcg unregisters events that were attached to
the same eventfd:
- On the first call mem_cgroup_usage_unregister_event() removes all
events attached to a given eventfd, and if there were no events left,
thresholds->prima... |
static int handle_invept(struct kvm_vcpu *vcpu)
{
u32 vmx_instruction_info, types;
unsigned long type;
gva_t gva;
struct x86_exception e;
struct {
u64 eptp, gpa;
} operand;
u64 eptp_mask = ((1ull << 51) - 1) & PAGE_MASK;
if (!(nested_vmx_secondary_ctls_high & SECONDARY_EXEC_ENABLE_EPT) ||
!(nested_vmx_e... | 0 | [
"CWE-20"
] | linux | bfd0a56b90005f8c8a004baf407ad90045c2b11e | 6,324,657,962,010,675,000,000,000,000,000,000,000 | 66 | nEPT: Nested INVEPT
If we let L1 use EPT, we should probably also support the INVEPT instruction.
In our current nested EPT implementation, when L1 changes its EPT table
for L2 (i.e., EPT12), L0 modifies the shadow EPT table (EPT02), and in
the course of this modification already calls INVEPT. But if last level
of sh... |
void Compute(OpKernelContext* ctx) override {
const Tensor& handle = ctx->input(0);
OP_REQUIRES(ctx, TensorShapeUtils::IsScalar(handle.shape()),
errors::InvalidArgument("`handle` must be scalar"));
const string& name = handle.scalar<tstring>()();
auto session_state = ctx->session_state... | 0 | [
"CWE-20",
"CWE-703"
] | tensorflow | cff267650c6a1b266e4b4500f69fbc49cdd773c5 | 135,356,496,032,736,990,000,000,000,000,000,000,000 | 11 | Fix tf.raw_ops.DeleteSessionTensor vulnerability with invalid `handle`.
Check that `handle` input is actually a scalar before treating it as such.
PiperOrigin-RevId: 445228994 |
int ssl3_shutdown(SSL *s)
{
int ret;
/* Don't do anything much if we have not done the handshake or
* we don't want to send messages :-) */
if ((s->quiet_shutdown) || (s->state == SSL_ST_BEFORE))
{
s->shutdown=(SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN);
return(1);
}
if (!(s->shutdown & SSL_SENT_SHUTDOWN... | 0 | [
"CWE-310"
] | openssl | ca989269a2876bae79393bd54c3e72d49975fc75 | 102,793,400,671,854,440,000,000,000,000,000,000,000 | 54 | Use version in SSL_METHOD not SSL structure.
When deciding whether to use TLS 1.2 PRF and record hash algorithms
use the version number in the corresponding SSL_METHOD structure
instead of the SSL structure. The SSL structure version is sometimes
inaccurate. Note: OpenSSL 1.0.2 and later effectively do this already.
(... |
explicit AESGCMDecipher() : ctx_(nullptr) {} | 0 | [
"CWE-78"
] | ssh2 | f763271f41320e71d5cbee02ea5bc6a2ded3ca21 | 75,868,810,721,231,290,000,000,000,000,000,000,000 | 1 | examples,lib,test: switch to code rewrite
For more information see: https://github.com/mscdex/ssh2/issues/935 |
static char *hidpp_unifying_get_name(struct hidpp_device *hidpp_dev)
{
struct hidpp_report response;
int ret;
u8 params[1] = { HIDPP_DEVICE_NAME };
char *name;
int len;
ret = hidpp_send_rap_command_sync(hidpp_dev,
REPORT_ID_HIDPP_SHORT,
HIDPP_GET_LONG_REGISTER,
HIDPP_REG_PAIRING_INFORMATION,
... | 0 | [
"CWE-787"
] | linux | d9d4b1e46d9543a82c23f6df03f4ad697dab361b | 53,474,914,203,705,640,000,000,000,000,000,000,000 | 35 | 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 double mp_norm1(_cimg_math_parser& mp) {
const unsigned int i_end = (unsigned int)mp.opcode[2];
switch (i_end - 3) {
case 1 : return cimg::abs(_mp_arg(3));
case 2 : return cimg::abs(_mp_arg(3)) + cimg::abs(_mp_arg(4));
}
double res = 0;
for (unsigned ... | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 24,006,858,425,136,310,000,000,000,000,000,000,000 | 11 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
**/
inline int strncasecmp(const char *const str1, const char *const str2, const int l) {
if (!l) return 0;
if (!str1) return str2?-1:0;
const char *nstr1 = str1, *nstr2 = str2;
int k, diff = 0; for (k = 0; k<l && !(diff = lowercase(*nstr1) - lowercase(*nstr2)); ++k) { ++nstr1; ++nstr2; ... | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 223,720,113,238,671,080,000,000,000,000,000,000,000 | 7 | Fix other issues in 'CImg<T>::load_bmp()'. |
void DL_Dxf::writeKnot(DL_WriterA& dw,
const DL_KnotData& data) {
dw.dxfReal(40, data.k);
} | 0 | [
"CWE-191"
] | qcad | 1eeffc5daf5a06cf6213ffc19e95923cdebb2eb8 | 143,119,451,699,303,750,000,000,000,000,000,000,000 | 5 | check vertexIndex which might be -1 for broken DXF |
static void ixgbe_rcv_ack_from_vf(struct ixgbe_adapter *adapter, u32 vf)
{
struct ixgbe_hw *hw = &adapter->hw;
u32 msg = IXGBE_VT_MSGTYPE_NACK;
/* if device isn't clear to send it shouldn't be reading either */
if (!adapter->vfinfo[vf].clear_to_send)
ixgbe_write_mbx(hw, &msg, 1, vf);
} | 0 | [
"CWE-20"
] | linux | 63e39d29b3da02e901349f6cd71159818a4737a6 | 173,325,108,392,516,730,000,000,000,000,000,000,000 | 9 | ixgbe: fix large MTU request from VF
Check that the MTU value requested by the VF is in the supported
range of MTUs before attempting to set the VF large packet enable,
otherwise reject the request. This also avoids unnecessary
register updates in the case of the 82599 controller.
Fixes: 872844ddb9e4 ("ixgbe: Enable ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.