func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
EUnsignedCert CSteamNetworkConnectionlocalhostLoopback::AllowLocalUnsignedCert()
{
return k_EUnsignedCert_Allow;
} | 0 | [
"CWE-703"
] | GameNetworkingSockets | d944a10808891d202bb1d5e1998de6e0423af678 | 253,960,779,529,272,640,000,000,000,000,000,000,000 | 4 | Tweak pointer math to avoid possible integer overflow |
TEST(OverflowArithmetic, UnignedMultiplicationTests) {
using T = uint64_t;
static constexpr auto f = polyMul;
ASSERT(test<T>(f, 0, kMax<T>, 0));
ASSERT(test<T>(f, 1, kMax<T>, kMax<T>));
ASSERT(test<T>(f, 1000, 57, 57000));
ASSERT(test<T>(f, 0x3fffffffffffffff, 2, 0x7ffffffffffffffe));
ASSERT... | 0 | [
"CWE-190"
] | mongo | 21d8699ed6c517b45e1613e20231cd8eba894985 | 234,898,495,541,817,170,000,000,000,000,000,000,000 | 13 | SERVER-43699 $mod should not overflow for large negative values |
static int mb_mark_used(struct ext4_buddy *e4b, struct ext4_free_extent *ex)
{
int ord;
int mlen = 0;
int max = 0;
int cur;
int start = ex->fe_start;
int len = ex->fe_len;
unsigned ret = 0;
int len0 = len;
void *buddy;
BUG_ON(start + len > (e4b->bd_sb->s_blocksize << 3));
BUG_ON(e4b->bd_group != ex->fe_grou... | 0 | [
"CWE-703"
] | linux | ce9f24cccdc019229b70a5c15e2b09ad9c0ab5d1 | 129,423,125,775,901,100,000,000,000,000,000,000,000 | 75 | ext4: check journal inode extents more carefully
Currently, system zones just track ranges of block, that are "important"
fs metadata (bitmaps, group descriptors, journal blocks, etc.). This
however complicates how extent tree (or indirect blocks) can be checked
for inodes that actually track such metadata - currently... |
do_ldelem (VerifyContext *ctx, int opcode, int token)
{
#define IS_ONE_OF2(T, A, B) (T == A || T == B)
ILStackDesc *index, *array;
MonoType *type;
if (!check_underflow (ctx, 2))
return;
if (opcode == CEE_LDELEM) {
if (!(type = verifier_load_type (ctx, token, "ldelem.any"))) {
ADD_VERIFY_ERROR (ctx, g_strdup... | 0 | [
"CWE-20"
] | mono | 4905ef1130feb26c3150b28b97e4a96752e0d399 | 179,221,826,234,942,770,000,000,000,000,000,000,000 | 49 | 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 |
int create_event_filter(struct trace_array *tr,
struct trace_event_call *call,
char *filter_str, bool set_str,
struct event_filter **filterp)
{
return create_filter(tr, call, filter_str, set_str, filterp);
} | 0 | [
"CWE-400",
"CWE-284",
"CWE-401"
] | linux | 96c5c6e6a5b6db592acae039fed54b5c8844cd35 | 32,496,315,054,783,210,000,000,000,000,000,000,000 | 7 | tracing: Have error path in predicate_parse() free its allocated memory
In predicate_parse, there is an error path that is not going to
out_free instead it returns directly which leads to a memory leak.
Link: http://lkml.kernel.org/r/20190920225800.3870-1-navid.emamdoost@gmail.com
Signed-off-by: Navid Emamdoost <nav... |
static inline void flush_unauthorized_files(const struct cred *cred,
struct files_struct *files)
{
struct common_audit_data ad;
struct file *file, *devnull = NULL;
struct tty_struct *tty;
struct fdtable *fdt;
long j = -1;
int drop_tty = 0;
tty = get_current_tty();
if (tty) {
file_list_lock();
if (... | 0 | [] | linux-2.6 | ee18d64c1f632043a02e6f5ba5e045bb26a5465f | 269,953,775,923,610,460,000,000,000,000,000,000,000 | 93 | 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... |
DWORD FileIo::Impl::winNumberOfLinks() const
{
DWORD nlink = 1;
HANDLE hFd = (HANDLE)_get_osfhandle(fileno(fp_));
if (hFd != INVALID_HANDLE_VALUE) {
typedef BOOL (WINAPI * GetFileInformationByHandle_t)(HANDLE, LPBY_HANDLE_FILE_INFORMATION);
HMODULE hKernel = ::Ge... | 0 | [
"CWE-125"
] | exiv2 | bd0afe0390439b2c424d881c8c6eb0c5624e31d9 | 217,975,503,462,979,200,000,000,000,000,000,000,000 | 33 | Add bounds check to MemIo::seek(). (#944)
- Regression test for missing bounds check in MemIo::seek()
- Add bounds check to MemIo::seek(), this fixes CVE-2019-13504 |
do_getattr (app_t app, ctrl_t ctrl, const char *name)
{
static struct {
const char *name;
int tag;
int special;
} table[] = {
{ "DISP-NAME", 0x005B },
{ "LOGIN-DATA", 0x005E },
{ "DISP-LANG", 0x5F2D },
{ "DISP-SEX", 0x5F35 },
{ "PUBKEY-URL", 0x5F50 },
{ "KEY-FPR", ... | 0 | [
"CWE-20"
] | gnupg | 2183683bd633818dd031b090b5530951de76f392 | 155,038,346,750,492,460,000,000,000,000,000,000,000 | 149 | Use inline functions to convert buffer data to scalars.
* common/host2net.h (buf16_to_ulong, buf16_to_uint): New.
(buf16_to_ushort, buf16_to_u16): New.
(buf32_to_size_t, buf32_to_ulong, buf32_to_uint, buf32_to_u32): New.
--
Commit 91b826a38880fd8a989318585eb502582636ddd8 was not enough to
avoid all sign extension on ... |
SecureRandomDataProvider::getInstance()
{
return 0;
} | 0 | [
"CWE-787"
] | qpdf | d71f05ca07eb5c7cfa4d6d23e5c1f2a800f52e8e | 167,630,207,355,415,750,000,000,000,000,000,000,000 | 4 | 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 ... |
int cil_gen_policycap(struct cil_db *db, struct cil_tree_node *parse_current, struct cil_tree_node *ast_node)
{
enum cil_syntax syntax[] = {
CIL_SYN_STRING,
CIL_SYN_STRING,
CIL_SYN_END
};
int syntax_len = sizeof(syntax)/sizeof(*syntax);
char *key = NULL;
struct cil_policycap *polcap = NULL;
int rc = SEPOL_E... | 0 | [
"CWE-125"
] | selinux | 340f0eb7f3673e8aacaf0a96cbfcd4d12a405521 | 310,383,073,326,127,670,000,000,000,000,000,000,000 | 37 | libsepol/cil: Check for statements not allowed in optional blocks
While there are some checks for invalid statements in an optional
block when resolving the AST, there are no checks when building the
AST.
OSS-Fuzz found the following policy which caused a null dereference
in cil_tree_get_next_path().
(blockinherit ... |
pcxmono_print_page(gx_device_printer * pdev, gp_file * file)
{
pcx_header header;
header = pcx_header_prototype;
header.version = version_2_8_with_palette;
header.bpp = 1;
header.nplanes = 1;
assign_ushort(header.palinfo, palinfo_gray);
/* Set the first two entries of the short palette. */
... | 0 | [
"CWE-787"
] | ghostpdl | 2793769ff107d8d22dadd30c6e68cd781b569550 | 175,448,328,145,528,000,000,000,000,000,000,000,000 | 13 | Bug 701819: fixed ordering in if expression to avoid out-of-bounds access.
Fixes:
./sanbin/gs -dBATCH -dNOPAUSE -r965 -sOutputFile=tmp -sDEVICE=pcx16 ../bug-701819.pdf |
int ovs_nla_put_actions(const struct nlattr *attr, int len, struct sk_buff *skb)
{
const struct nlattr *a;
int rem, err;
nla_for_each_attr(a, attr, len, rem) {
int type = nla_type(a);
switch (type) {
case OVS_ACTION_ATTR_SET:
err = set_action_to_attr(a, skb);
if (err)
return err;
break;
case ... | 0 | [
"CWE-362",
"CWE-787"
] | linux | cefa91b2332d7009bc0be5d951d6cbbf349f90f8 | 12,014,578,462,279,946,000,000,000,000,000,000,000 | 60 | openvswitch: fix OOB access in reserve_sfa_size()
Given a sufficiently large number of actions, while copying and
reserving memory for a new action of a new flow, if next_offset is
greater than MAX_ACTIONS_BUFSIZE, the function reserve_sfa_size() does
not return -EMSGSIZE as expected, but it allocates MAX_ACTIONS_BUFS... |
DECLAREContigPutFunc(putagreytile)
{
int samplesperpixel = img->samplesperpixel;
uint32** BWmap = img->BWmap;
(void) y;
while (h-- > 0) {
for (x = w; x-- > 0;)
{
*cp++ = BWmap[*pp][0] & ((uint32)*(pp+1) << 24 | ~A1);
pp += samplesperpixel;
}
cp += toskew;
pp +... | 0 | [
"CWE-20"
] | libtiff | 48780b4fcc425cddc4ef8ffdf536f96a0d1b313b | 234,786,458,677,457,900,000,000,000,000,000,000,000 | 16 | * libtiff/tif_getimage.c: add explicit uint32 cast in putagreytile to
avoid UndefinedBehaviorSanitizer warning.
Patch by Nicolás Peña.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2658 |
ClientHttpRequest::mRangeCLen()
{
int64_t clen = 0;
MemBuf mb;
assert(memObject());
mb.init();
HttpHdrRange::iterator pos = request->range->begin();
while (pos != request->range->end()) {
/* account for headers for this range */
mb.reset();
clientPackRangeHdr(&storeEnt... | 1 | [
"CWE-116"
] | squid | 7024fb734a59409889e53df2257b3fc817809fb4 | 85,385,689,626,271,170,000,000,000,000,000,000,000 | 35 | Handle more Range requests (#790)
Also removed some effectively unused code. |
disk_fill_input_buffer (int in_des, off_t num_bytes)
{
in_buff = input_buffer;
num_bytes = (num_bytes < DISK_IO_BLOCK_SIZE) ? num_bytes : DISK_IO_BLOCK_SIZE;
input_size = read (in_des, input_buffer, num_bytes);
if (input_size == SAFE_READ_ERROR)
{
input_size = 0;
return (-1);
}
else if (in... | 0 | [
"CWE-190"
] | cpio | dd96882877721703e19272fe25034560b794061b | 262,674,549,138,501,500,000,000,000,000,000,000,000 | 15 | Rewrite dynamic string support.
* src/dstring.c (ds_init): Take a single argument.
(ds_free): New function.
(ds_resize): Take a single argument. Use x2nrealloc to expand
the storage.
(ds_reset,ds_append,ds_concat,ds_endswith): New function.
(ds_fgetstr): Rewrite. In particular, this fixes integer overflow.
* src/dst... |
static int mk_exit_code(struct libmnt_context *cxt, int rc)
{
int syserr;
const char *tgt = mnt_context_get_target(cxt);
if (mnt_context_helper_executed(cxt))
/*
* /sbin/umount.<type> called, return status
*/
return mnt_context_get_helper_status(cxt);
if (rc == 0 && mnt_context_get_status(cxt) == 1)
/... | 0 | [
"CWE-200"
] | util-linux | cc8cc8f32c863f3ae6a8a88e97b47bcd6a21825f | 137,903,181,630,441,380,000,000,000,000,000,000,000 | 75 | umount: sanitize paths from non-root users
Signed-off-by: Karel Zak <kzak@redhat.com> |
static int backtrack_insn(struct bpf_verifier_env *env, int idx,
u32 *reg_mask, u64 *stack_mask)
{
const struct bpf_insn_cbs cbs = {
.cb_call = disasm_kfunc_name,
.cb_print = verbose,
.private_data = env,
};
struct bpf_insn *insn = env->prog->insnsi + idx;
u8 class = BPF_CLASS(insn->code);
u8 opcode = B... | 0 | [
"CWE-125"
] | bpf | 049c4e13714ecbca567b4d5f6d563f05d431c80e | 185,465,519,099,076,200,000,000,000,000,000,000,000 | 136 | bpf: Fix alu32 const subreg bound tracking on bitwise operations
Fix a bug in the verifier's scalar32_min_max_*() functions which leads to
incorrect tracking of 32 bit bounds for the simulation of and/or/xor bitops.
When both the src & dst subreg is a known constant, then the assumption is
that scalar_min_max_*() will... |
R_API RBinJavaBootStrapArgument *r_bin_java_bootstrap_method_argument_new(ut8 *buffer, ut64 sz, ut64 buf_offset) {
ut64 offset = 0;
RBinJavaBootStrapArgument *bsm_arg = (RBinJavaBootStrapArgument *) malloc (sizeof (RBinJavaBootStrapArgument));
if (!bsm_arg) {
// TODO eprintf failed to allocate bytes for bootstrap_... | 0 | [
"CWE-119",
"CWE-788"
] | radare2 | 6c4428f018d385fc80a33ecddcb37becea685dd5 | 207,327,223,161,219,200,000,000,000,000,000,000,000 | 15 | Improve boundary checks to fix oobread segfaults ##crash
* Reported by Cen Zhang via huntr.dev
* Reproducer: bins/fuzzed/javaoob-havoc.class |
last_search_pat(void)
{
return spats[last_idx].pat;
} | 0 | [
"CWE-416"
] | vim | 409510c588b1eec1ae33511ae97a21eb8e110895 | 177,153,076,264,969,260,000,000,000,000,000,000,000 | 4 | patch 8.2.5050: using freed memory when searching for pattern in path
Problem: Using freed memory when searching for pattern in path.
Solution: Make a copy of the line. |
int LocateSample(cmsIT8* it8, const char* cSample)
{
int i;
const char *fld;
TABLE* t = GetTable(it8);
for (i=0; i < t->nSamples; i++) {
fld = GetDataFormat(it8, i);
if (cmsstrcasecmp(fld, cSample) == 0)
return i;
}
return -1;
} | 0 | [] | Little-CMS | 65e2f1df3495edc984f7e0d7b7b24e29d851e240 | 326,657,597,347,037,160,000,000,000,000,000,000,000 | 16 | Fix some warnings from static analysis |
int cgroup_can_fork(struct task_struct *child, struct kernel_clone_args *kargs)
{
struct cgroup_subsys *ss;
int i, j, ret;
ret = cgroup_css_set_fork(kargs);
if (ret)
return ret;
do_each_subsys_mask(ss, i, have_canfork_callback) {
ret = ss->can_fork(child, kargs->cset);
if (ret)
goto out_revert;
} while... | 0 | [
"CWE-416"
] | linux | a06247c6804f1a7c86a2e5398a4c1f1db1471848 | 118,525,836,050,515,970,000,000,000,000,000,000,000 | 29 | psi: Fix uaf issue when psi trigger is destroyed while being polled
With write operation on psi files replacing old trigger with a new one,
the lifetime of its waitqueue is totally arbitrary. Overwriting an
existing trigger causes its waitqueue to be freed and pending poll()
will stumble on trigger->event_wait which w... |
static inline bool avic_vcpu_is_running(struct kvm_vcpu *vcpu)
{
struct vcpu_svm *svm = to_svm(vcpu);
u64 *entry = svm->avic_physical_id_cache;
if (!entry)
return false;
return (READ_ONCE(*entry) & AVIC_PHYSICAL_ID_ENTRY_IS_RUNNING_MASK);
} | 0 | [
"CWE-401"
] | linux | d80b64ff297e40c2b6f7d7abc1b3eba70d22a068 | 180,718,785,648,433,400,000,000,000,000,000,000,000 | 10 | KVM: SVM: Fix potential memory leak in svm_cpu_init()
When kmalloc memory for sd->sev_vmcbs failed, we forget to free the page
held by sd->save_area. Also get rid of the var r as '-ENOMEM' is actually
the only possible outcome here.
Reviewed-by: Liran Alon <liran.alon@oracle.com>
Reviewed-by: Vitaly Kuznetsov <vkuzne... |
compat_copy_entries_to_user(unsigned int total_size, struct xt_table *table,
void __user *userptr)
{
struct xt_counters *counters;
const struct xt_table_info *private = table->private;
void __user *pos;
unsigned int size;
int ret = 0;
const void *loc_cpu_entry;
unsigned int i = 0;
struct ip6t_entry *iter... | 0 | [
"CWE-200"
] | linux-2.6 | 6a8ab060779779de8aea92ce3337ca348f973f54 | 160,782,406,929,499,240,000,000,000,000,000,000,000 | 33 | ipv6: netfilter: ip6_tables: fix infoleak to userspace
Structures ip6t_replace, compat_ip6t_replace, and xt_get_revision are
copied from userspace. Fields of these structs that are
zero-terminated strings are not checked. When they are used as argument
to a format string containing "%s" in request_module(), some sen... |
static void TIFFGetProfiles(TIFF *tiff,Image *image,MagickBooleanType ping,
ExceptionInfo *exception)
{
uint32
length;
unsigned char
*profile;
length=0;
if (ping == MagickFalse)
{
#if defined(TIFFTAG_ICCPROFILE)
if ((TIFFGetField(tiff,TIFFTAG_ICCPROFILE,&length,&profile) == 1) &&
... | 0 | [
"CWE-125"
] | ImageMagick | 803bc34ebe023f209f745baf8a112610ff77cc8c | 66,790,318,566,932,020,000,000,000,000,000,000,000 | 45 | Prevent possible buffer overflow when reading TIFF images (bug report from Shi Pu of MS509 Team) |
static int get_seat_from_display(const char *display, const char **seat, uint32_t *vtnr) {
union sockaddr_union sa = {};
_cleanup_free_ char *p = NULL, *tty = NULL;
_cleanup_close_ int fd = -1;
struct ucred ucred;
int v, r, salen;
assert(display);
assert(vtnr);
... | 0 | [
"CWE-863"
] | systemd | 83d4ab55336ff8a0643c6aa627b31e351a24040a | 122,728,922,492,605,320,000,000,000,000,000,000,000 | 50 | pam-systemd: use secure_getenv() rather than getenv()
And explain why in a comment. |
uefi_mem_attrs_to_shim_mem_attrs (uint64_t attrs)
{
uint64_t ret = MEM_ATTR_R |
MEM_ATTR_W |
MEM_ATTR_X;
if (attrs & EFI_MEMORY_RP)
ret &= ~MEM_ATTR_R;
if (attrs & EFI_MEMORY_RO)
ret &= ~MEM_ATTR_W;
if (attrs & EFI_MEMORY_XP)
ret &= ~MEM_ATTR_X;
return ret;
} | 0 | [
"CWE-787"
] | shim | 159151b6649008793d6204a34d7b9c41221fb4b0 | 200,504,246,270,418,970,000,000,000,000,000,000,000 | 17 | Also avoid CVE-2022-28737 in verify_image()
PR 446 ("Add verify_image") duplicates some of the code affected by
Chris Coulson's defense in depth patch against CVE-2022-28737 ("pe:
Perform image verification earlier when loading grub").
This patch makes the same change to the new function.
Signed-off-by: Peter Jones ... |
GF_Box *fdsa_box_new()
{
ISOM_DECL_BOX_ALLOC(GF_HintSample, GF_ISOM_BOX_TYPE_FDSA);
if (!tmp) return NULL;
tmp->packetTable = gf_list_new();
tmp->hint_subtype = GF_ISOM_BOX_TYPE_FDP_STSD;
return (GF_Box*)tmp; | 0 | [
"CWE-787"
] | gpac | 388ecce75d05e11fc8496aa4857b91245007d26e | 39,609,351,159,906,530,000,000,000,000,000,000,000 | 8 | fixed #1587 |
ZEND_METHOD(exception, __wakeup)
{
zval *value;
zval *object = getThis();
HashTable *intern_ht = zend_std_get_properties(getThis() TSRMLS_CC);
CHECK_EXC_TYPE("message", IS_STRING);
CHECK_EXC_TYPE("string", IS_STRING);
CHECK_EXC_TYPE("code", IS_LONG);
CHECK_EXC_TYPE("file", IS_STRING);
CHECK_EXC_TYPE("line", IS_... | 0 | [
"CWE-20"
] | php-src | 4d2278143a08b7522de9471d0f014d7357c28fea | 199,384,158,163,389,430,000,000,000,000,000,000,000 | 13 | Fix #69793 - limit what we accept when unserializing exception |
CImg<T>& dijkstra(const unsigned int starting_node, const unsigned int ending_node,
CImg<t>& previous_node) {
return get_dijkstra(starting_node,ending_node,previous_node).move_to(*this);
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 105,460,178,889,633,700,000,000,000,000,000,000,000 | 4 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
hash_key_compare(const void *a, const void *b)
{
uint64_t ia = (uint64_t)a;
uint64_t ib = (uint64_t)b;
return ia == ib;
} | 0 | [
"CWE-415"
] | 389-ds-base | a3c298f8140d3e4fa1bd5a670f1bb965a21a9b7b | 334,518,893,591,418,670,000,000,000,000,000,000,000 | 6 | Issue 5218 - double-free of the virtual attribute context in persistent search (#5219)
description:
A search is processed by a worker using a private pblock.
If the search is persistent, the worker spawn a thread
and kind of duplicate its private pblock so that the spawn
thread continue to process the p... |
ElectronBrowserClient::CreateLoginDelegate(
const net::AuthChallengeInfo& auth_info,
content::WebContents* web_contents,
const content::GlobalRequestID& request_id,
bool is_main_frame,
const GURL& url,
scoped_refptr<net::HttpResponseHeaders> response_headers,
bool first_auth_attempt,
Log... | 0 | [] | electron | e9fa834757f41c0b9fe44a4dffe3d7d437f52d34 | 236,410,879,586,388,800,000,000,000,000,000,000,000 | 13 | fix: ensure ElectronBrowser mojo service is only bound to appropriate render frames (#33344)
* fix: ensure ElectronBrowser mojo service is only bound to authorized render frames
Notes: no-notes
* refactor: extract electron API IPC to its own mojo interface
* fix: just check main frame not primary main frame
... |
static int collect_syscall(struct task_struct *target, struct syscall_info *info)
{
unsigned long args[6] = { };
struct pt_regs *regs;
if (!try_get_task_stack(target)) {
/* Task has no stack, so the task isn't in a syscall. */
memset(info, 0, sizeof(*info));
info->data.nr = -1;
return 0;
}
regs = task_pt... | 0 | [
"CWE-681"
] | linux | 4f134b89a24b965991e7c345b9a4591821f7c2a6 | 121,710,461,411,846,800,000,000,000,000,000,000,000 | 35 | lib/syscall: fix syscall registers retrieval on 32-bit platforms
Lilith >_> and Claudio Bozzato of Cisco Talos security team reported
that collect_syscall() improperly casts the syscall registers to 64-bit
values leaking the uninitialized last 24 bytes on 32-bit platforms, that
are visible in /proc/self/syscall.
The ... |
void opj_j2k_setup_encoding_validation (opj_j2k_t *p_j2k)
{
/* preconditions */
assert(p_j2k != 00);
opj_procedure_list_add_procedure(p_j2k->m_validation_list, (opj_procedure)opj_j2k_build_encoder);
opj_procedure_list_add_procedure(p_j2k->m_validation_list, (opj_procedure)opj_j2k_encodi... | 0 | [] | openjpeg | 0fa5a17c98c4b8f9ee2286f4f0a50cf52a5fccb0 | 221,671,633,905,989,020,000,000,000,000,000,000,000 | 11 | [trunk] Correct potential double free on malloc failure in opj_j2k_copy_default_tcp_and_create_tcp (fixes issue 492) |
find_script_var(char_u *name, size_t len, cctx_T *cctx)
{
scriptitem_T *si = SCRIPT_ITEM(current_sctx.sc_sid);
hashitem_T *hi;
int cc;
sallvar_T *sav;
sallvar_T *found_sav;
ufunc_T *ufunc;
// Find the list of all script variables with the right name.
if (len > 0)... | 0 | [
"CWE-416"
] | vim | 9c23f9bb5fe435b28245ba8ac65aa0ca6b902c04 | 129,272,734,974,364,350,000,000,000,000,000,000,000 | 58 | 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. |
void isa_cirrus_vga_init(DisplayState *ds, uint8_t *vga_ram_base,
unsigned long vga_ram_offset, int vga_ram_size)
{
CirrusVGAState *s;
s = qemu_mallocz(sizeof(CirrusVGAState));
vga_common_init((VGAState *)s,
ds, vga_ram_base, vga_ram_offset, vga_ram_size);
... | 0 | [
"CWE-787"
] | qemu | 65d35a09979e63541afc5bfc595b9f1b1b4ae069 | 39,670,308,120,443,437,000,000,000,000,000,000,000 | 14 | CVE-2008-4539: fix a heap overflow in Cirrus emulation
The code in hw/cirrus_vga.c has changed a lot between CVE-2007-1320 has
been announced and the patch has been applied. As a consequence it has
wrongly applied and QEMU is still vulnerable to this bug if using VNC.
(noticed by Jan Niehusmann)
Signed-off-by: Aurel... |
static int sctp_v6_is_ce(const struct sk_buff *skb)
{
return *((__u32 *)(ipv6_hdr(skb))) & htonl(1 << 20);
} | 0 | [
"CWE-310"
] | net | 95ee62083cb6453e056562d91f597552021e6ae7 | 144,804,304,037,264,900,000,000,000,000,000,000,000 | 4 | net: sctp: fix ipv6 ipsec encryption bug in sctp_v6_xmit
Alan Chester reported an issue with IPv6 on SCTP that IPsec traffic is not
being encrypted, whereas on IPv4 it is. Setting up an AH + ESP transport
does not seem to have the desired effect:
SCTP + IPv4:
22:14:20.809645 IP (tos 0x2,ECT(0), ttl 64, id 0, offse... |
int LibRaw::open_datastream(LibRaw_abstract_datastream *stream)
{
if(!stream)
return ENOENT;
if(!stream->valid())
return LIBRAW_IO_ERROR;
recycle();
try {
ID.input = stream;
SET_PROC_FLAG(LIBRAW_PROGRESS_OPEN);
identify();
if (!strcasecmp(imgdata.idata.make, "Canon") && (load_raw == &L... | 0 | [
"CWE-787"
] | LibRaw | 8682ad204392b914ab1cc6ebcca9c27c19c1a4b4 | 166,452,631,019,083,400,000,000,000,000,000,000,000 | 339 | 0.18.17 |
bool kvm_vcpu_apicv_activated(struct kvm_vcpu *vcpu)
{
ulong vm_reasons = READ_ONCE(vcpu->kvm->arch.apicv_inhibit_reasons);
ulong vcpu_reasons = static_call(kvm_x86_vcpu_get_apicv_inhibit_reasons)(vcpu);
return (vm_reasons | vcpu_reasons) == 0;
} | 0 | [
"CWE-476"
] | linux | fee060cd52d69c114b62d1a2948ea9648b5131f9 | 333,730,123,783,204,650,000,000,000,000,000,000,000 | 7 | KVM: x86: avoid calling x86 emulator without a decoded instruction
Whenever x86_decode_emulated_instruction() detects a breakpoint, it
returns the value that kvm_vcpu_check_breakpoint() writes into its
pass-by-reference second argument. Unfortunately this is completely
bogus because the expected outcome of x86_decode... |
SSLNetVConnection::clear()
{
if (ssl != nullptr) {
SSL_free(ssl);
ssl = nullptr;
}
sslHandShakeComplete = false;
sslHandshakeBeginTime = 0;
sslLastWriteTime = 0;
sslTotalBytesSent = 0;
sslClientRenegotiationAbort = false;
sslSessionCacheHit = false;
... | 0 | [
"CWE-284"
] | trafficserver | d3f36f79820ea10c26573c742b1bbc370c351716 | 207,413,133,880,699,770,000,000,000,000,000,000,000 | 24 | Bug fix in origin connection handling (#8731)
Co-authored-by: Takuya Kitano <tkitano@yahoo-corp.jp> |
create_admin_success_flag(void)
{
char flagfile[PATH_MAX];
int len, ret = -1;
debug_decl(create_admin_success_flag, SUDOERS_DEBUG_PLUGIN);
/* Check whether the user is in the sudo or admin group. */
if (!user_in_group(sudo_user.pw, "sudo") &&
!user_in_group(sudo_user.pw, "admin"))
debug_return_in... | 0 | [
"CWE-193"
] | sudo | 1f8638577d0c80a4ff864a2aad80a0d95488e9a8 | 102,565,205,795,088,320,000,000,000,000,000,000,000 | 28 | Fix potential buffer overflow when unescaping backslashes in user_args.
Also, do not try to unescaping backslashes unless in run mode *and*
we are running the command via a shell.
Found by Qualys, this fixes CVE-2021-3156. |
static inline int width_to_agaw(int width)
{
return DIV_ROUND_UP(width - 30, LEVEL_STRIDE);
} | 0 | [] | linux | d8b8591054575f33237556c32762d54e30774d28 | 227,102,846,055,790,400,000,000,000,000,000,000,000 | 4 | iommu/vt-d: Disable ATS support on untrusted devices
Commit fb58fdcd295b9 ("iommu/vt-d: Do not enable ATS for untrusted
devices") disables ATS support on the devices which have been marked
as untrusted. Unfortunately this is not enough to fix the DMA attack
vulnerabiltiies because IOMMU driver allows translated reques... |
static ssize_t ndp_to_end_store(struct device *d, struct device_attribute *attr, const char *buf, size_t len)
{
struct usbnet *dev = netdev_priv(to_net_dev(d));
struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0];
bool enable;
if (strtobool(buf, &enable))
return -EINVAL;
/* no change? */
if (enable ... | 0 | [
"CWE-703"
] | linux | 4d06dd537f95683aba3651098ae288b7cbff8274 | 11,625,503,606,930,492,000,000,000,000,000,000,000 | 32 | cdc_ncm: do not call usbnet_link_change from cdc_ncm_bind
usbnet_link_change will call schedule_work and should be
avoided if bind is failing. Otherwise we will end up with
scheduled work referring to a netdev which has gone away.
Instead of making the call conditional, we can just defer
it to usbnet_probe, using the... |
void CompactProtocolReader::readMessageEnd() {} | 0 | [
"CWE-703",
"CWE-770"
] | fbthrift | c9a903e5902834e95bbd4ab0e9fa53ba0189f351 | 86,562,523,812,019,680,000,000,000,000,000,000,000 | 1 | Better handling of truncated data when reading strings
Summary:
Currently we read string size and blindly pre-allocate it. This allows malicious attacker to send a few bytes message and cause server to allocate huge amount of memory (>1GB).
This diff changes the logic to check if we have enough data in the buffer bef... |
g_socket_client_get_socket_type (GSocketClient *client)
{
return client->priv->type;
} | 0 | [
"CWE-754"
] | glib | d553d92d6e9f53cbe5a34166fcb919ba652c6a8e | 100,747,831,136,034,600,000,000,000,000,000,000,000 | 4 | gsocketclient: Fix criticals
This ensures the parent GTask is kept alive as long as an enumeration
is running and trying to connect.
Closes #1646
Closes #1649 |
GF_Err video_sample_entry_box_dump(GF_Box *a, FILE * trace)
{
Bool full_dump=GF_FALSE;
GF_MPEGVisualSampleEntryBox *p = (GF_MPEGVisualSampleEntryBox *)a;
const char *name;
switch (p->type) {
case GF_ISOM_SUBTYPE_AVC_H264:
case GF_ISOM_SUBTYPE_AVC2_H264:
case GF_ISOM_SUBTYPE_AVC3_H264:
case GF_ISOM_SUBTYPE_AVC4... | 0 | [
"CWE-787"
] | gpac | ea1eca00fd92fa17f0e25ac25652622924a9a6a0 | 279,243,784,270,124,800,000,000,000,000,000,000,000 | 156 | fixed #2138 |
define_module(mrb_state *mrb, mrb_sym name, struct RClass *outer)
{
struct RClass *m;
if (mrb_const_defined_at(mrb, mrb_obj_value(outer), name)) {
return module_from_sym(mrb, outer, name);
}
m = mrb_module_new(mrb);
setup_class(mrb, outer, m, name);
return m;
} | 0 | [
"CWE-476",
"CWE-415"
] | mruby | faa4eaf6803bd11669bc324b4c34e7162286bfa3 | 73,864,411,146,109,030,000,000,000,000,000,000,000 | 12 | `mrb_class_real()` did not work for `BasicObject`; fix #4037 |
euckr_code_to_mbc(OnigCodePoint code, UChar *buf)
{
return onigenc_mb2_code_to_mbc(ONIG_ENCODING_EUC_KR, code, buf);
} | 0 | [
"CWE-125"
] | oniguruma | 65a9b1aa03c9bc2dc01b074295b9603232cb3b78 | 274,702,618,465,103,000,000,000,000,000,000,000,000 | 4 | onig-5.9.2 |
static void device_blocked_callback(uint16_t index, uint16_t length,
const void *param, void *user_data)
{
const struct mgmt_ev_device_blocked *ev = param;
struct btd_adapter *adapter = user_data;
struct btd_device *device;
char addr[18];
if (length < sizeof(*ev)) {
btd_error(adapter->dev_id, "Too small de... | 0 | [
"CWE-862",
"CWE-863"
] | bluez | b497b5942a8beb8f89ca1c359c54ad67ec843055 | 183,384,537,378,160,130,000,000,000,000,000,000,000 | 21 | 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. |
StreamBufferHandle_t xStreamBufferGenericCreateStatic( size_t xBufferSizeBytes,
size_t xTriggerLevelBytes,
BaseType_t xIsMessageBuffer,
... | 0 | [
"CWE-190"
] | FreeRTOS-Kernel | d05b9c123f2bf9090bce386a244fc934ae44db5b | 231,854,119,200,607,300,000,000,000,000,000,000,000 | 72 | Add addition overflow check for stream buffer (#226) |
join_der_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, str))
{
i = ossl_to_der_if_possible(i);
StringValue(i);
rb_str_append(str, i);
return Qnil;
} | 0 | [
"CWE-119"
] | openssl | 1648afef33c1d97fb203c82291b8a61269e85d3b | 223,957,845,105,075,100,000,000,000,000,000,000,000 | 7 | 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 GF_Node *lsr_read_data(GF_LASeRCodec *lsr, u32 node_tag)
{
GF_Node *elt = gf_node_new(lsr->sg, node_tag);
lsr_read_id(lsr, elt);
lsr_read_rare(lsr, elt);
lsr_read_any_attribute(lsr, elt, 1);
lsr_read_group_content(lsr, elt, 0);
return elt;
} | 0 | [
"CWE-190"
] | gpac | faa75edde3dfeba1e2cf6ffa48e45a50f1042096 | 111,660,035,933,444,950,000,000,000,000,000,000,000 | 9 | fixed #2213 |
int ssl_cert_lookup_by_nid(int nid, size_t *pidx)
{
size_t i;
for (i = 0; i < OSSL_NELEM(ssl_cert_info); i++) {
if (ssl_cert_info[i].nid == nid) {
*pidx = i;
return 1;
}
}
return 0;
} | 0 | [
"CWE-835"
] | openssl | 758754966791c537ea95241438454aa86f91f256 | 221,069,891,767,086,070,000,000,000,000,000,000,000 | 13 | Fix invalid handling of verify errors in libssl
In the event that X509_verify() returned an internal error result then
libssl would mishandle this and set rwstate to SSL_RETRY_VERIFY. This
subsequently causes SSL_get_error() to return SSL_ERROR_WANT_RETRY_VERIFY.
That return code is supposed to only ever be returned i... |
void JTL::send( Session* session, int resolution, int tile ){
Timer function_timer;
if( session->loglevel >= 3 ) (*session->logfile) << "JTL handler reached" << endl;
// Make sure we have set our image
this->session = session;
checkImage();
// Time this command
if( session->loglevel >= 2 ) command_t... | 1 | [
"CWE-190"
] | iipsrv | 4ed59265fbbd636dc2fbbf325f8ea37ed300a6d9 | 311,421,134,299,623,700,000,000,000,000,000,000,000 | 415 | Added verification that image has been set in SPECTRA.cc and check on the validity of the requested tile resolution in JTL.cc. Fixes a couple of the crash conditions reported in https://github.com/ruven/iipsrv/issues/223 |
boost::intrusive_ptr<Expression> parseExpression(BSONObj specification) {
const boost::intrusive_ptr<ExpressionContextForTest> expCtx(new ExpressionContextForTest());
VariablesParseState vps = expCtx->variablesParseState;
return Expression::parseExpression(expCtx, specification, vps);
} | 0 | [
"CWE-835"
] | mongo | 0a076417d1d7fba3632b73349a1fd29a83e68816 | 228,574,998,453,345,100,000,000,000,000,000,000,000 | 5 | SERVER-38070 fix infinite loop in agg expression |
gs_interpret(i_ctx_t **pi_ctx_p, ref * pref, int user_errors, int *pexit_code,
ref * perror_object)
{
i_ctx_t *i_ctx_p = *pi_ctx_p;
gs_gc_root_t error_root, *r = &error_root;
int code;
gs_register_ref_root(imemory_system, &r,
(void **)&perror_object, "gs_interpret"... | 0 | [] | ghostpdl | 13b0a36f8181db66a91bcc8cea139998b53a8996 | 66,777,482,794,756,980,000,000,000,000,000,000,000 | 17 | Sanitize op stack for error conditions
We save the stacks to an array and store the array for the error handler to
access.
For SAFER, we traverse the array, and deep copy any op arrays (procedures). As
we make these copies, we check for operators that do *not* exist in systemdict,
when we find one, we replace the ope... |
static int dr_interception(struct vcpu_svm *svm)
{
int reg, dr;
unsigned long val;
int err;
if (svm->vcpu.guest_debug == 0) {
/*
* No more DR vmexits; force a reload of the debug registers
* and reenter on this instruction. The next vmexit will
* retrieve the full state of the debug registers.
*/
... | 0 | [] | kvm | 854e8bb1aa06c578c2c9145fa6bfe3680ef63b23 | 3,379,329,268,840,478,000,000,000,000,000,000,000 | 36 | KVM: x86: Check non-canonical addresses upon WRMSR
Upon WRMSR, the CPU should inject #GP if a non-canonical value (address) is
written to certain MSRs. The behavior is "almost" identical for AMD and Intel
(ignoring MSRs that are not implemented in either architecture since they would
anyhow #GP). However, IA32_SYSENTE... |
char *bcf_hdr_fmt_text(const bcf_hdr_t *hdr, int is_bcf, int *len)
{
kstring_t txt = {0,0,0};
bcf_hdr_format(hdr, is_bcf, &txt);
if ( len ) *len = txt.l;
return txt.s;
} | 0 | [
"CWE-787"
] | htslib | dcd4b7304941a8832fba2d0fc4c1e716e7a4e72c | 296,618,685,472,939,340,000,000,000,000,000,000,000 | 7 | Fix check for VCF record size
The check for excessive record size in vcf_parse_format() only
looked at individual fields. It was therefore possible to
exceed the limit and overflow fmt_aux_t::offset by having
multiple fields with a combined size that went over INT_MAX.
Fix by including the amount of memory used so fa... |
static void ql_info(quicklist *ql) {
#if QL_TEST_VERBOSE
printf("Container length: %lu\n", ql->len);
printf("Container size: %lu\n", ql->count);
if (ql->head)
printf("\t(zsize head: %d)\n", ziplistLen(ql->head->zl));
if (ql->tail)
printf("\t(zsize tail: %d)\n", ziplistLen(ql->tail->zl));... | 0 | [
"CWE-190"
] | redis | f6a40570fa63d5afdd596c78083d754081d80ae3 | 147,818,350,921,605,200,000,000,000,000,000,000,000 | 13 | Fix ziplist and listpack overflows and truncations (CVE-2021-32627, CVE-2021-32628)
- fix possible heap corruption in ziplist and listpack resulting by trying to
allocate more than the maximum size of 4GB.
- prevent ziplist (hash and zset) from reaching size of above 1GB, will be
converted to HT encoding, that's n... |
static void do_pragma_preproc(Token *tline)
{
/* Skip to the real stuff */
tline = tline->next;
skip_white_(tline);
if (!tline)
return;
(void)tline; /* Nothing else to do at present */
} | 0 | [
"CWE-125"
] | nasm | 3144e84add8b152cc7a71e44617ce6f21daa4ba3 | 66,738,847,647,176,890,000,000,000,000,000,000,000 | 10 | preproc: Don't access offsting byte on unterminated strings
https://bugzilla.nasm.us/show_bug.cgi?id=3392446
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> |
static int generate_eph_rsa_key(SSL_CTX *ctx)
{
RSA *rsa;
rsa = RSA_generate_key(512, RSA_F4, NULL, NULL);
if (!SSL_CTX_set_tmp_rsa(ctx, rsa)) {
radlog(L_ERR, "rlm_eap_tls: Couldn't set ephemeral RSA key");
return -1;
}
RSA_free(rsa);
return 0;
} | 0 | [
"CWE-119"
] | freeradius-server | 78e5aed56c36a9231bc91ea5f55b3edf88a9d2a4 | 181,408,146,598,278,600,000,000,000,000,000,000,000 | 14 | Fix CVE-2012-3547. Found by Timo Warns |
static int reencrypt_assign_segments(struct crypt_device *cd,
struct luks2_hdr *hdr,
struct luks2_reencrypt *rh,
unsigned hot,
unsigned commit)
{
bool forward;
int rseg, scount, r = -EINVAL;
/* FIXME: validate in reencrypt context load */
if (rh->digest_new < 0 && rh->mode != CRYPT_REENCRYPT_DECRYPT)
ret... | 0 | [
"CWE-345"
] | cryptsetup | 0113ac2d889c5322659ad0596d4cfc6da53e356c | 299,263,824,541,880,070,000,000,000,000,000,000,000 | 72 | 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... |
//! Rotate volumetric image with arbitrary angle and axis \newinstance.
CImg<T> get_rotate(const float u, const float v, const float w, const float angle,
const unsigned int interpolation, const unsigned int boundary_conditions) const {
if (is_empty()) return *this;
CImg<T> re... | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 251,466,565,203,601,540,000,000,000,000,000,000,000 | 27 | Fix other issues in 'CImg<T>::load_bmp()'. |
int sctp_get_sctp_info(struct sock *sk, struct sctp_association *asoc,
struct sctp_info *info)
{
struct sctp_transport *prim;
struct list_head *pos;
int mask;
memset(info, 0, sizeof(*info));
if (!asoc) {
struct sctp_sock *sp = sctp_sk(sk);
info->sctpi_s_autoclose = sp->autoclose;
info->sctpi_s_ada... | 0 | [
"CWE-617",
"CWE-362"
] | linux | 2dcab598484185dea7ec22219c76dcdd59e3cb90 | 77,227,523,962,395,680,000,000,000,000,000,000,000 | 85 | sctp: avoid BUG_ON on sctp_wait_for_sndbuf
Alexander Popov reported that an application may trigger a BUG_ON in
sctp_wait_for_sndbuf if the socket tx buffer is full, a thread is
waiting on it to queue more data and meanwhile another thread peels off
the association being used by the first thread.
This patch replaces ... |
static int encode_lockt(struct xdr_stream *xdr, const struct nfs_lockt_args *args)
{
__be32 *p;
RESERVE_SPACE(52);
WRITE32(OP_LOCKT);
WRITE32(nfs4_lock_type(args->fl, 0));
WRITE64(args->fl->fl_start);
WRITE64(nfs4_lock_length(args->fl));
WRITE64(args->lock_owner.clientid);
WRITE32(16);
WRITEMEM("lock id:", 8)... | 0 | [
"CWE-703"
] | linux | dc0b027dfadfcb8a5504f7d8052754bf8d501ab9 | 324,662,301,197,604,600,000,000,000,000,000,000,000 | 16 | NFSv4: Convert the open and close ops to use fmode
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> |
l2tp_avp_print(netdissect_options *ndo, const u_char *dat, int length)
{
u_int len;
const uint16_t *ptr = (const uint16_t *)dat;
uint16_t attr_type;
int hidden = FALSE;
if (length <= 0) {
return;
}
ND_PRINT((ndo, " "));
ND_TCHECK(*ptr); /* Flags & Length */
len = EXTRACT_16BITS(ptr) & L2TP_AVP_HDR_LEN_MAS... | 0 | [
"CWE-125",
"CWE-787"
] | tcpdump | cc4a7391c616be7a64ed65742ef9ed3f106eb165 | 303,336,886,937,438,650,000,000,000,000,000,000,000 | 172 | CVE-2017-13006/L2TP: Check whether an AVP's content exceeds the AVP length.
It's not good enough to check whether all the data specified by the AVP
length was captured - you also have to check whether that length is
large enough for all the required data in the AVP.
This fixes a buffer over-read discovered by Yannick... |
_equalTargetEntry(const TargetEntry *a, const TargetEntry *b)
{
COMPARE_NODE_FIELD(expr);
COMPARE_SCALAR_FIELD(resno);
COMPARE_STRING_FIELD(resname);
COMPARE_SCALAR_FIELD(ressortgroupref);
COMPARE_SCALAR_FIELD(resorigtbl);
COMPARE_SCALAR_FIELD(resorigcol);
COMPARE_SCALAR_FIELD(resjunk);
return true;
} | 0 | [
"CWE-362"
] | postgres | 5f173040e324f6c2eebb90d86cf1b0cdb5890f0a | 307,699,843,790,760,860,000,000,000,000,000,000,000 | 12 | Avoid repeated name lookups during table and index DDL.
If the name lookups come to different conclusions due to concurrent
activity, we might perform some parts of the DDL on a different table
than other parts. At least in the case of CREATE INDEX, this can be
used to cause the permissions checks to be performed aga... |
uint16_t get_rows() const { return m_rows; } | 0 | [
"CWE-125"
] | libheif | f7399b62d7fbc596f1b2871578c1d2053bedf1dd | 231,636,855,705,690,380,000,000,000,000,000,000,000 | 1 | Handle case where referenced "iref" box doesn't exist (fixes #138). |
dump_realloc_oid_to_inetaddress(const int addr_type, const oid * objid, size_t objidlen,
u_char ** buf, size_t * buf_len,
size_t * out_len, int allow_realloc,
char quotechar)
{
int i, len;
char ... | 0 | [
"CWE-59",
"CWE-61"
] | net-snmp | 4fd9a450444a434a993bc72f7c3486ccce41f602 | 218,589,989,570,472,240,000,000,000,000,000,000,000 | 95 | CHANGES: snmpd: Stop reading and writing the mib_indexes/* files
Caching directory contents is something the operating system should do
and is not something Net-SNMP should do. Instead of storing a copy of
the directory contents in ${tmp_dir}/mib_indexes/${n}, always scan a
MIB directory. |
static void bpf_map_show_fdinfo(struct seq_file *m, struct file *filp)
{
const struct bpf_map *map = filp->private_data;
const struct bpf_array *array;
u32 type = 0, jited = 0;
if (map->map_type == BPF_MAP_TYPE_PROG_ARRAY) {
array = container_of(map, struct bpf_array, map);
type = array->aux->type;
jited = ... | 0 | [
"CWE-307"
] | linux | 350a5c4dd2452ea999cc5e1d4a8dbf12de2f97ef | 158,845,251,825,377,870,000,000,000,000,000,000,000 | 34 | bpf: Dont allow vmlinux BTF to be used in map_create and prog_load.
The syzbot got FD of vmlinux BTF and passed it into map_create which caused
crash in btf_type_id_size() when it tried to access resolved_ids. The vmlinux
BTF doesn't have 'resolved_ids' and 'resolved_sizes' initialized to save
memory. To avoid such is... |
Panic(const char *fmtstr, ...)
{
va_list args;
char *tmp = Util_SafeMalloc(MAXSTRING);
va_start(args, fmtstr);
vsprintf(tmp, fmtstr, args);
sLog(log_error, "Panic callback invoked: %s\n", tmp);
free(tmp);
exit(1);
} | 0 | [
"CWE-362"
] | open-vm-tools | c1304ce8bfd9c0c33999e496bf7049d5c3d45821 | 184,358,671,490,670,900,000,000,000,000,000,000,000 | 15 | randomly generate tmp directory name, and add StrUtil_ReplaceAll() function. |
static int asf_set_metadata(AVFormatContext *s, const uint8_t *name,
int type, AVDictionary **met)
{
AVIOContext *pb = s->pb;
uint64_t value;
char buf[32];
int ret;
ret = asf_read_generic_value(pb, type, &value);
if (ret < 0)
return ret;
snprintf(buf, si... | 0 | [
"CWE-119",
"CWE-787"
] | FFmpeg | 2b46ebdbff1d8dec7a3d8ea280a612b91a582869 | 223,501,904,128,339,900,000,000,000,000,000,000,000 | 18 | avformat/asfdec_o: Check size_bmp more fully
Fixes: integer overflow and out of array access
Fixes: asfo-crash-46080c4341572a7137a162331af77f6ded45cbd7
Found-by: Paul Ch <paulcher@icloud.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> |
static void cmd_parse_status(struct ImapData *idata, char *s)
{
char *value = NULL;
struct Buffy *inc = NULL;
struct ImapMbox mx;
struct ImapStatus *status = NULL;
unsigned int olduv, oldun;
unsigned int litlen;
short new = 0;
short new_msg_count = 0;
char *mailbox = imap_next_word(s);
/* We need ... | 0 | [
"CWE-20"
] | neomutt | 3c49c44be9b459d9c616bcaef6eb5d51298c1741 | 205,029,616,943,812,800,000,000,000,000,000,000,000 | 169 | Ensure litlen isn't larger than our mailbox |
int main(int argc, char** argv)
{
yr_initialize();
test_boolean_operators();
test_comparison_operators();
test_arithmetic_operators();
test_bitwise_operators();
test_matches_operator();
test_syntax();
test_anonymous_strings();
test_strings();
test_wildcard_strings();
test_hex_strings();
test_co... | 0 | [
"CWE-416"
] | yara | 053e67e3ec81cc9268ce30eaf0d6663d8639ed1e | 190,013,859,694,954,060,000,000,000,000,000,000,000 | 46 | Fix issue #658 |
static av_cold int decode_init(AVCodecContext *avctx)
{
FFV1Context *f = avctx->priv_data;
int ret;
if ((ret = ffv1_common_init(avctx)) < 0)
return ret;
if (avctx->extradata && (ret = read_extra_header(f)) < 0)
return ret;
if ((ret = ffv1_init_slice_contexts(f)) < 0)
retur... | 0 | [
"CWE-119",
"CWE-787"
] | FFmpeg | 547d690d676064069d44703a1917e0dab7e33445 | 309,853,468,192,643,060,000,000,000,000,000,000,000 | 18 | 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> |
static void set_indicator_in_key_fields(KEY *key_info)
{
KEY_PART_INFO *key_part;
uint key_parts= key_info->key_parts, i;
for (i= 0, key_part=key_info->key_part; i < key_parts; i++, key_part++)
key_part->field->flags|= GET_FIXED_FIELDS_FLAG;
} | 0 | [] | mysql-server | be901b60ae59c93848c829d1b0b2cb523ab8692e | 267,543,459,211,211,800,000,000,000,000,000,000,000 | 7 | Bug#26390632: CREATE TABLE CAN CAUSE MYSQL TO EXIT.
Analysis
========
CREATE TABLE of InnoDB table with a partition name
which exceeds the path limit can cause the server
to exit.
During the preparation of the partition name,
there was no check to identify whether the complete
path name for partition exceeds the max ... |
xmlBufferCreateSize(size_t size) {
xmlBufferPtr ret;
ret = (xmlBufferPtr) xmlMalloc(sizeof(xmlBuffer));
if (ret == NULL) {
xmlTreeErrMemory("creating buffer");
return(NULL);
}
ret->use = 0;
ret->alloc = xmlBufferAllocScheme;
ret->size = (size ? size+2 : 0); /* +1 for ending... | 1 | [
"CWE-190"
] | libxml2 | 6c283d83eccd940bcde15634ac8c7f100e3caefd | 331,717,781,983,889,540,000,000,000,000,000,000,000 | 24 | [CVE-2022-29824] Fix integer overflows in xmlBuf and xmlBuffer
In several places, the code handling string buffers didn't check for
integer overflow or used wrong types for buffer sizes. This could
result in out-of-bounds writes or other memory errors when working on
large, multi-gigabyte buffers.
Thanks to Felix Wil... |
xmlOutputBufferGetSize(xmlOutputBufferPtr out) {
if ((out == NULL) || (out->buffer == NULL))
return(0);
return(xmlBufUse(out->buffer));
} | 0 | [
"CWE-134"
] | libxml2 | 4472c3a5a5b516aaf59b89be602fbce52756c3e9 | 104,521,042,562,243,240,000,000,000,000,000,000,000 | 6 | Fix some format string warnings with possible format string vulnerability
For https://bugzilla.gnome.org/show_bug.cgi?id=761029
Decorate every method in libxml2 with the appropriate
LIBXML_ATTR_FORMAT(fmt,args) macro and add some cleanups
following the reports. |
process_zlib_error(struct Curl_easy *data, z_stream *z)
{
if(z->msg)
failf(data, "Error while processing content unencoding: %s",
z->msg);
else
failf(data, "Error while processing content unencoding: "
"Unknown failure within decompression software.");
return CURLE_BAD_CONTENT_ENCODIN... | 0 | [] | curl | 3a09fbb7f264c67c438d01a30669ce325aa508e2 | 249,335,759,104,207,340,000,000,000,000,000,000,000 | 11 | content_encoding: return error on too many compression steps
The max allowed steps is arbitrarily set to 5.
Bug: https://curl.se/docs/CVE-2022-32206.html
CVE-2022-32206
Reported-by: Harry Sintonen
Closes #9049 |
void synchronizeWithFetchPhase() {
while (otherUpdateInFetchPhase())
wait();
fassert(17192, !_authzManager->_isFetchPhaseBusy);
_isThisGuardInFetchPhase = true;
_authzManager->_isFetchPhaseBusy = true;
} | 0 | [
"CWE-613"
] | mongo | 6dfb92b1299de04677d0bd2230e89a52eb01003c | 224,998,628,996,497,700,000,000,000,000,000,000,000 | 7 | SERVER-38984 Validate unique User ID on UserCache hit
(cherry picked from commit e55d6e2292e5dbe2f97153251d8193d1cc89f5d7) |
GC_API GC_ATTR_MALLOC void * GC_CALL GC_gcj_malloc(size_t lb,
void * ptr_to_struct_containing_descr)
#endif
{
ptr_t op;
word lg;
DCL_LOCK_STATE;
GC_DBG_COLLECT_AT_MALLOC(lb);
if(SMALL_OBJ(lb)) {
lg = GC_size_map[lb];
LOCK();
op = GC_gc... | 0 | [
"CWE-119"
] | bdwgc | 7292c02fac2066d39dd1bcc37d1a7054fd1e32ee | 10,602,070,637,949,817,000,000,000,000,000,000,000 | 42 | Fix malloc routines to prevent size value wrap-around
See issue #135 on Github.
* allchblk.c (GC_allochblk, GC_allochblk_nth): Use
OBJ_SZ_TO_BLOCKS_CHECKED instead of OBJ_SZ_TO_BLOCKS.
* malloc.c (GC_alloc_large): Likewise.
* alloc.c (GC_expand_hp_inner): Type of "bytes" local variable changed
from word to size_t; ca... |
int TS_TST_INFO_set_accuracy(TS_TST_INFO *a, TS_ACCURACY *accuracy)
{
TS_ACCURACY *new_accuracy;
if (a->accuracy == accuracy)
return 1;
new_accuracy = TS_ACCURACY_dup(accuracy);
if (new_accuracy == NULL)
{
TSerr(TS_F_TS_TST_INFO_SET_ACCURACY, ERR_R_MALLOC_FAILURE);
return 0;
}
TS_ACCURACY_free(a->accur... | 0 | [] | openssl | c7235be6e36c4bef84594aa3b2f0561db84b63d8 | 110,594,339,904,327,500,000,000,000,000,000,000,000 | 16 | RFC 3161 compliant time stamp request creation, response generation
and response verification.
Submitted by: Zoltan Glozik <zglozik@opentsa.org>
Reviewed by: Ulf Moeller |
static double mp_tan(_cimg_math_parser& mp) {
return std::tan(_mp_arg(2));
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 237,541,906,904,011,600,000,000,000,000,000,000,000 | 3 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
static void iucv_sock_cleanup_listen(struct sock *parent)
{
struct sock *sk;
/* Close non-accepted connections */
while ((sk = iucv_accept_dequeue(parent, NULL))) {
iucv_sock_close(sk);
iucv_sock_kill(sk);
}
parent->sk_state = IUCV_CLOSED;
} | 0 | [
"CWE-20",
"CWE-269"
] | linux | f3d3342602f8bcbf37d7c46641cb9bca7618eb1c | 209,196,991,836,674,400,000,000,000,000,000,000,000 | 12 | net: rework recvmsg handler msg_name and msg_namelen logic
This patch now always passes msg->msg_namelen as 0. recvmsg handlers must
set msg_namelen to the proper size <= sizeof(struct sockaddr_storage)
to return msg_name to the user.
This prevents numerous uninitialized memory leaks we had in the
recvmsg handlers an... |
static int kvm_s390_set_cmma_bits(struct kvm *kvm,
const struct kvm_s390_cmma_log *args)
{
unsigned long hva, mask, pgstev, i;
uint8_t *bits;
int srcu_idx, r = 0;
mask = args->mask;
if (!kvm->arch.use_cmma)
return -ENXIO;
/* invalid/unsupported flags */
if (args->flags != 0)
return -EINVAL;
/* Enfor... | 0 | [
"CWE-416"
] | linux | 0774a964ef561b7170d8d1b1bfe6f88002b6d219 | 280,265,359,180,130,700,000,000,000,000,000,000,000 | 57 | KVM: Fix out of range accesses to memslots
Reset the LRU slot if it becomes invalid when deleting a memslot to fix
an out-of-bounds/use-after-free access when searching through memslots.
Explicitly check for there being no used slots in search_memslots(), and
in the caller of s390's approximation variant.
Fixes: 369... |
static unsigned int task_scan_start(struct task_struct *p)
{
unsigned long smin = task_scan_min(p);
unsigned long period = smin;
/* Scale the maximum scan period with the amount of shared memory. */
if (p->numa_group) {
struct numa_group *ng = p->numa_group;
unsigned long shared = group_faults_shared(ng);
un... | 0 | [
"CWE-400",
"CWE-703",
"CWE-835"
] | linux | c40f7d74c741a907cfaeb73a7697081881c497d0 | 18,688,119,828,980,502,000,000,000,000,000,000,000 | 18 | 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... |
ldbm_config_mode_set(void *arg, void *value, char *errorbuf __attribute__((unused)), int phase __attribute__((unused)), int apply)
{
struct ldbminfo *li = (struct ldbminfo *)arg;
int retval = LDAP_SUCCESS;
int val = (int)((uintptr_t)value);
/* Do whatever we can to make sure the data is ok. */
if ... | 0 | [
"CWE-399",
"CWE-203"
] | 389-ds-base | cc0f69283abc082488824702dae485b8eae938bc | 78,777,545,031,159,690,000,000,000,000,000,000,000 | 14 | Issue 4480 - Unexpected info returned to ldap request (#4491)
Bug description:
If the bind entry does not exist, the bind result info
reports that 'No such entry'. It should not give any
information if the target entry exists or not
Fix description:
Does not return any additional information d... |
TEST_F(HttpHealthCheckerImplTest, StreamReachesWatermarkDuringCheck) {
setupNoServiceValidationHC();
EXPECT_CALL(*this, onHostStatus(_, HealthTransition::Unchanged));
cluster_->prioritySet().getMockHostSet(0)->hosts_ = {
makeTestHost(cluster_->info_, "tcp://127.0.0.1:80", simTime())};
expectSessionCreate... | 0 | [
"CWE-476"
] | envoy | 9b1c3962172a972bc0359398af6daa3790bb59db | 273,179,695,457,296,100,000,000,000,000,000,000,000 | 20 | healthcheck: fix grpc inline removal crashes (#749)
Signed-off-by: Matt Klein <mklein@lyft.com>
Signed-off-by: Pradeep Rao <pcrao@google.com> |
inline void Relu1(const float* input_data, const Dims<4>& input_dims,
float* output_data, const Dims<4>& output_dims) {
Relu1(DimsToShape(input_dims), input_data, DimsToShape(output_dims),
output_data);
} | 0 | [
"CWE-703",
"CWE-835"
] | tensorflow | dfa22b348b70bb89d6d6ec0ff53973bacb4f4695 | 39,671,021,899,134,195,000,000,000,000,000,000,000 | 5 | Prevent a division by 0 in average ops.
PiperOrigin-RevId: 385184660
Change-Id: I7affd4554f9b336fca29ac68f633232c094d0bd3 |
static void coroutine_fn bdrv_aio_discard_co_entry(void *opaque)
{
BlockDriverAIOCBCoroutine *acb = opaque;
BlockDriverState *bs = acb->common.bs;
acb->req.error = bdrv_co_discard(bs, acb->req.sector, acb->req.nb_sectors);
acb->bh = qemu_bh_new(bdrv_co_em_bh, acb);
qemu_bh_schedule(acb->bh);
} | 0 | [
"CWE-190"
] | qemu | 8f4754ede56e3f9ea3fd7207f4a7c4453e59285b | 99,626,896,434,355,820,000,000,000,000,000,000,000 | 9 | block: Limit request size (CVE-2014-0143)
Limiting the size of a single request to INT_MAX not only fixes a
direct integer overflow in bdrv_check_request() (which would only
trigger bad behaviour with ridiculously huge images, as in close to
2^64 bytes), but can also prevent overflows in all block drivers.
Signed-off... |
static void put_ts_pktinfo(struct msghdr *msg, struct sk_buff *skb)
{
struct scm_ts_pktinfo ts_pktinfo;
struct net_device *orig_dev;
if (!skb_mac_header_was_set(skb))
return;
memset(&ts_pktinfo, 0, sizeof(ts_pktinfo));
rcu_read_lock();
orig_dev = dev_get_by_napi_id(skb_napi_id(skb));
if (orig_dev)
ts_pkti... | 0 | [
"CWE-362"
] | linux | 6d8c50dcb029872b298eea68cc6209c866fd3e14 | 69,913,496,108,450,495,000,000,000,000,000,000,000 | 20 | socket: close race condition between sock_close() and sockfs_setattr()
fchownat() doesn't even hold refcnt of fd until it figures out
fd is really needed (otherwise is ignored) and releases it after
it resolves the path. This means sock_close() could race with
sockfs_setattr(), which leads to a NULL pointer dereferenc... |
void svr_mailowner(
job *pjob, /* I */
int mailpoint, /* note, single character */
int force, /* if set to MAIL_FORCE, force mail delivery */
char *text) /* (optional) additional message text */
{
char *cmdbuf;
int i;
char *mailfrom;
char mailto[1024];
char *bodyfmt, *... | 1 | [
"CWE-94"
] | torque | 64da0af7ed27284f3397081313850bba270593db | 99,790,595,584,230,810,000,000,000,000,000,000,000 | 335 | Fix CVE 2013-4495. Note: this patch has been verified as fixing this security hole but has not received other regression testing. |
void wc_ecc_fp_free(void)
{
#ifndef WOLFSSL_SP_MATH
#ifndef HAVE_THREAD_LS
if (initMutex == 0) {
wc_InitMutex(&ecc_fp_lock);
initMutex = 1;
}
if (wc_LockMutex(&ecc_fp_lock) == 0) {
#endif /* HAVE_THREAD_LS */
wc_ecc_fp_free_cache();
#ifndef HAVE_THREAD_LS
wc_UnLockMutex(&ecc_fp... | 0 | [
"CWE-326",
"CWE-203"
] | wolfssl | 1de07da61f0c8e9926dcbd68119f73230dae283f | 238,553,332,218,422,600,000,000,000,000,000,000 | 22 | Constant time EC map to affine for private operations
For fast math, use a constant time modular inverse when mapping to
affine when operation involves a private key - key gen, calc shared
secret, sign. |
EIGEN_STRONG_INLINE QInt32 operator*(const double a, const QInt32 b) {
return static_cast<int32_t>(lrint(a * static_cast<double>(b.value)));
} | 0 | [
"CWE-908",
"CWE-787"
] | tensorflow | ace0c15a22f7f054abcc1f53eabbcb0a1239a9e2 | 245,935,823,167,854,100,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... |
struct sk_buff *qeth_core_get_next_skb(struct qeth_card *card,
struct qeth_qdio_buffer *qethbuffer,
struct qdio_buffer_element **__element, int *__offset,
struct qeth_hdr **hdr)
{
struct qdio_buffer_element *element = *__element;
struct qdio_buffer *buffer = qethbuffer->buffer;
int offset = *__offset;
struct ... | 0 | [
"CWE-200",
"CWE-119"
] | linux | 6fb392b1a63ae36c31f62bc3fc8630b49d602b62 | 99,082,214,473,370,840,000,000,000,000,000,000,000 | 103 | qeth: avoid buffer overflow in snmp ioctl
Check user-defined length in snmp ioctl request and allow request
only if it fits into a qeth command buffer.
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Reviewed-by: Heiko Carstens <heicars2@linux.vnet.ibm.c... |
PG *OSD::_create_lock_pg(
OSDMapRef createmap,
spg_t pgid,
bool hold_map_lock,
bool backfill,
int role,
vector<int>& up, int up_primary,
vector<int>& acting, int acting_primary,
pg_history_t history,
const PastIntervals& pi,
ObjectStore::Transaction& t)
{
assert(osd_lock.is_locked());
dout(20) <... | 0 | [
"CWE-287",
"CWE-284"
] | ceph | 5ead97120e07054d80623dada90a5cc764c28468 | 49,367,877,478,479,690,000,000,000,000,000,000,000 | 33 | 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 *v4l2l_vzalloc(unsigned long size)
{
void *data = vmalloc(size);
memset(data, 0, size);
return data;
} | 0 | [
"CWE-787"
] | v4l2loopback | 64a216af4c09c9ba9326057d7e78994271827eff | 226,207,368,588,953,900,000,000,000,000,000,000,000 | 7 | add explicit format specifier to printf() invocations
CWE-134 |
static inline void __ipv6_addr_set_half(__be32 *addr,
__be32 wh, __be32 wl)
{
#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64
#if defined(__BIG_ENDIAN)
if (__builtin_constant_p(wh) && __builtin_constant_p(wl)) {
*(__force u64 *)addr = ((__force u64)(wh) << 32 | (__force u64)(wl));
r... | 0 | [
"CWE-416",
"CWE-284",
"CWE-264"
] | linux | 45f6fad84cc305103b28d73482b344d7f5b76f39 | 194,735,725,936,734,420,000,000,000,000,000,000,000 | 19 | ipv6: add complete rcu protection around np->opt
This patch addresses multiple problems :
UDP/RAW sendmsg() need to get a stable struct ipv6_txoptions
while socket is not locked : Other threads can change np->opt
concurrently. Dmitry posted a syzkaller
(http://github.com/google/syzkaller) program desmonstrating
use-a... |
static int mov_parse_uuid_spherical(MOVStreamContext *sc, AVIOContext *pb, size_t len)
{
int ret = 0;
uint8_t *buffer = av_malloc(len + 1);
const char *val;
if (!buffer)
return AVERROR(ENOMEM);
buffer[len] = '\0';
ret = ffio_read_size(pb, buffer, len);
if (ret < 0)
goto out... | 0 | [
"CWE-399",
"CWE-834"
] | FFmpeg | 9cb4eb772839c5e1de2855d126bf74ff16d13382 | 49,094,450,895,315,660,000,000,000,000,000,000,000 | 61 | avformat/mov: Fix DoS in read_tfra()
Fixes: Missing EOF check in loop
No testcase
Found-by: Xiaohei and Wangchu from Alibaba Security Team
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> |
static inline int ipv6_addr_any(const struct in6_addr *a)
{
return (a->s6_addr32[0] | a->s6_addr32[1] |
a->s6_addr32[2] | a->s6_addr32[3]) == 0;
} | 0 | [
"CWE-703"
] | linux | 87c48fa3b4630905f98268dde838ee43626a060c | 223,391,303,959,533,550,000,000,000,000,000,000,000 | 5 | ipv6: make fragment identifications less predictable
IPv6 fragment identification generation is way beyond what we use for
IPv4 : It uses a single generator. Its not scalable and allows DOS
attacks.
Now inetpeer is IPv6 aware, we can use it to provide a more secure and
scalable frag ident generator (per destination, ... |
static void os_desc_attr_release(struct config_item *item)
{
struct os_desc *os_desc = to_os_desc(item);
kfree(os_desc);
} | 0 | [
"CWE-125"
] | linux | 15753588bcd4bbffae1cca33c8ced5722477fe1f | 17,534,764,153,840,849,000,000,000,000,000,000,000 | 5 | USB: gadget: fix illegal array access in binding with UDC
FuzzUSB (a variant of syzkaller) found an illegal array access
using an incorrect index while binding a gadget with UDC.
Reference: https://www.spinics.net/lists/linux-usb/msg194331.html
This bug occurs when a size variable used for a buffer
is misused to acc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.