func
string
target
int64
cwe
list
project
string
commit_id
string
hash
float64
size
int64
message
string
static void jas_cmshapmatlut_cleanup(jas_cmshapmatlut_t *lut) { if (lut->data) { jas_free(lut->data); lut->data = 0; } lut->size = 0; }
0
[ "CWE-189" ]
jasper
3c55b399c36ef46befcb21e4ebc4799367f89684
284,728,348,612,752,850,000,000,000,000,000,000,000
8
At many places in the code, jas_malloc or jas_recalloc was being invoked with the size argument being computed in a manner that would not allow integer overflow to be detected. Now, these places in the code have been modified to use special-purpose memory allocation functions (e.g., jas_alloc2, jas_alloc3, jas_realloc...
String *Field_timestamp::val_str(String *val_buffer, String *val_ptr) { MYSQL_TIME ltime; uint32 temp, temp2; uint dec; char *to; val_buffer->alloc(field_length+1); to= (char*) val_buffer->ptr(); val_buffer->length(field_length); if (get_date(&ltime, TIME_NO_ZERO_DATE)) { /* Zero time is "0...
0
[ "CWE-416", "CWE-703" ]
server
08c7ab404f69d9c4ca6ca7a9cf7eec74c804f917
303,976,364,007,048,170,000,000,000,000,000,000,000
71
MDEV-24176 Server crashes after insert in the table with virtual column generated using date_format() and if() vcol_info->expr is allocated on expr_arena at parsing stage. Since expr item is allocated on expr_arena all its containee items must be allocated on expr_arena too. Otherwise fix_session_expr() will encounter...
TEST(BitTestMatchExpression, DoesNotMatchBinaryWithBitMask) { const char* bas = "\0\x03\x60\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xFF"; const char* bac = "\0\xFD\x9F\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xFF"; BSONObj match1 = fromjson("{a: {$binary: 'AANgAAAAAAAAAAAAAAAAAAAAAAAA', $type: '00'}}"); // Base64...
0
[]
mongo
b0ef26c639112b50648a02d969298650fbd402a4
112,050,354,552,042,680,000,000,000,000,000,000,000
26
SERVER-51083 Reject invalid UTF-8 from $regex match expressions
static int usbdev_notify(struct notifier_block *self, unsigned long action, void *dev) { switch (action) { case USB_DEVICE_ADD: break; case USB_DEVICE_REMOVE: usbdev_remove(dev); break; } return NOTIFY_OK; }
0
[ "CWE-200" ]
linux
681fef8380eb818c0b845fca5d2ab1dcbab114ee
113,202,899,891,278,640,000,000,000,000,000,000,000
12
USB: usbfs: fix potential infoleak in devio The stack object “ci” has a total size of 8 bytes. Its last 3 bytes are padding bytes which are not initialized and leaked to userland via “copy_to_user”. Signed-off-by: Kangjie Lu <kjlu@gatech.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
virDomainChrSourceDefValidate(const virDomainChrSourceDef *src_def, const virDomainChrDef *chr_def, const virDomainDef *def) { switch ((virDomainChrType) src_def->type) { case VIR_DOMAIN_CHR_TYPE_NULL: case VIR_DOMAIN_CHR_TYPE_PTY: case VIR_DOM...
0
[ "CWE-212" ]
libvirt
a5b064bf4b17a9884d7d361733737fb614ad8979
164,479,397,614,549,900,000,000,000,000,000,000,000
109
conf: Don't format http cookies unless VIR_DOMAIN_DEF_FORMAT_SECURE is used Starting with 3b076391befc3fe72deb0c244ac6c2b4c100b410 (v6.1.0-122-g3b076391be) we support http cookies. Since they may contain somewhat sensitive information we should not format them into the XML unless VIR_DOMAIN_DEF_FORMAT_SECURE is assert...
compare_records(gconstpointer a, gconstpointer b) { LrYumRepoMdRecord* yum_record = (LrYumRepoMdRecord*) a; char *type1 = (char *) yum_record->type; char *type2 = (char *) b; return g_strcmp0(type1, type2); }
0
[ "CWE-22" ]
librepo
7daea2a2429a54dad68b1de9b37a5f65c5cf2600
330,536,803,527,342,470,000,000,000,000,000,000,000
7
Validate path read from repomd.xml (RhBug:1868639) = changelog = msg: Validate path read from repomd.xml type: security resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1868639
bool Field::save_in_field_default_value(bool view_error_processing) { THD *thd= table->in_use; if (flags & NO_DEFAULT_VALUE_FLAG && real_type() != MYSQL_TYPE_ENUM) { if (reset()) { my_message(ER_CANT_CREATE_GEOMETRY_OBJECT, ER_THD(thd, ER_CANT_CREATE_GEOMETRY_OBJECT), MYF(0))...
0
[ "CWE-120" ]
server
eca207c46293bc72dd8d0d5622153fab4d3fccf1
90,452,061,038,800,100,000,000,000,000,000,000,000
38
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...
static int mce_device_create(unsigned int cpu) { struct device *dev; int err; int i, j; if (!mce_available(&boot_cpu_data)) return -EIO; dev = per_cpu(mce_device, cpu); if (dev) return 0; dev = kzalloc(sizeof *dev, GFP_KERNEL); if (!dev) return -ENOMEM; dev->id = cpu; dev->bus = &mce_subsys; dev->r...
0
[ "CWE-362" ]
linux
b3b7c4795ccab5be71f080774c45bbbcc75c2aaf
118,352,672,182,360,280,000,000,000,000,000,000,000
51
x86/MCE: Serialize sysfs changes The check_interval file in /sys/devices/system/machinecheck/machinecheck<cpu number> directory is a global timer value for MCE polling. If it is changed by one CPU, mce_restart() broadcasts the event to other CPUs to delete and restart the MCE polling timer and __mcheck_cpu_init_ti...
iscsi_set_events(IscsiLun *iscsilun) { struct iscsi_context *iscsi = iscsilun->iscsi; int ev = iscsi_which_events(iscsi); if (ev != iscsilun->events) { aio_set_fd_handler(iscsilun->aio_context, iscsi_get_fd(iscsi), false, (ev & POLLIN) ? iscsi_p...
0
[ "CWE-125" ]
qemu
ff0507c239a246fd7215b31c5658fc6a3ee1e4c5
178,899,534,707,095,630,000,000,000,000,000,000,000
15
block/iscsi:fix heap-buffer-overflow in iscsi_aio_ioctl_cb There is an overflow, the source 'datain.data[2]' is 100 bytes, but the 'ss' is 252 bytes.This may cause a security issue because we can access a lot of unrelated memory data. The len for sbp copy data should take the minimum of mx_sb_len and sb_len_wr, no...
static int init_percpu_info(struct f2fs_sb_info *sbi) { int err; err = percpu_counter_init(&sbi->alloc_valid_block_count, 0, GFP_KERNEL); if (err) return err; return percpu_counter_init(&sbi->total_valid_inode_count, 0, GFP_KERNEL); }
0
[ "CWE-284" ]
linux
b9dd46188edc2f0d1f37328637860bb65a771124
159,928,582,520,136,470,000,000,000,000,000,000,000
11
f2fs: sanity check segment count F2FS uses 4 bytes to represent block address. As a result, supported size of disk is 16 TB and it equals to 16 * 1024 * 1024 / 2 segments. Signed-off-by: Jin Qian <jinqian@google.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
PHP_FUNCTION(xsl_xsltprocessor_transform_to_uri) { zval *id, *docp = NULL; xmlDoc *newdocp; xsltStylesheetPtr sheetp; int ret, uri_len; char *uri; xsl_object *intern; id = getThis(); intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC); sheetp = (xsltStylesheetPtr) intern->ptr; if (zend_parse_...
0
[]
php-src
ce96fd6b0761d98353761bf78d5bfb55291179fd
233,504,088,649,805,000,000,000,000,000,000,000,000
30
- fix #39863, do not accept paths with NULL in them. See http://news.php.net/php.internals/50191, trunk will have the patch later (adding a macro and/or changing (some) APIs. Patch by Rasmus
static int sev_send_update_data(struct kvm *kvm, struct kvm_sev_cmd *argp) { struct kvm_sev_info *sev = &to_kvm_svm(kvm)->sev_info; struct sev_data_send_update_data data; struct kvm_sev_send_update_data params; void *hdr, *trans_data; struct page **guest_page; unsigned long n; int ret, offset; if (!sev_guest(k...
0
[ "CWE-459" ]
linux
683412ccf61294d727ead4a73d97397396e69a6b
58,237,168,647,324,440,000,000,000,000,000,000,000
84
KVM: SEV: add cache flush to solve SEV cache incoherency issues Flush the CPU caches when memory is reclaimed from an SEV guest (where reclaim also includes it being unmapped from KVM's memslots). Due to lack of coherency for SEV encrypted memory, failure to flush results in silent data corruption if userspace is mal...
static int pio_in_emulated(struct x86_emulate_ctxt *ctxt, unsigned int size, unsigned short port, void *dest) { struct read_cache *rc = &ctxt->io_read; if (rc->pos == rc->end) { /* refill pio read ahead */ unsigned int in_page, n; unsigned int count = ctxt->rep_prefix ? address_mask(ctxt, reg_read...
0
[ "CWE-284" ]
linux
33ab91103b3415e12457e3104f0e4517ce12d0f3
183,443,392,016,704,870,000,000,000,000,000,000,000
34
KVM: x86: fix emulation of "MOV SS, null selector" This is CVE-2017-2583. On Intel this causes a failed vmentry because SS's type is neither 3 nor 7 (even though the manual says this check is only done for usable SS, and the dmesg splat says that SS is unusable!). On AMD it's worse: svm.c is confused and sets CPL to ...
void ConfigHelper::setLds(absl::string_view version_info) { applyConfigModifiers(); envoy::service::discovery::v3::DiscoveryResponse lds; lds.set_version_info(std::string(version_info)); for (auto& listener : bootstrap_.static_resources().listeners()) { ProtobufWkt::Any* resource = lds.add_resources(); ...
0
[ "CWE-703", "CWE-674" ]
envoy
4b6dd3b53cd5c6d4d4df378a2fc62c1707522b31
223,122,478,200,474,050,000,000,000,000,000,000,000
16
CVE-2022-23606 Avoid closing other connections to prevent deep recursion when a large number of idle connections are closed at the start of a pool drain, when a connection is closed. Signed-off-by: Yan Avlasov <yavlasov@google.com>
ignore_error_for_testing(char_u *error) { if (ignore_error_list.ga_itemsize == 0) ga_init2(&ignore_error_list, sizeof(char_u *), 1); if (STRCMP("RESET", error) == 0) ga_clear_strings(&ignore_error_list); else ga_copy_string(&ignore_error_list, error); }
0
[ "CWE-416" ]
vim
9f1a39a5d1cd7989ada2d1cb32f97d84360e050f
72,957,923,911,541,100,000,000,000,000,000,000,000
10
patch 8.2.4040: keeping track of allocated lines is too complicated Problem: Keeping track of allocated lines in user functions is too complicated. Solution: Instead of freeing individual lines keep them all until the end.
static int inotify_release(struct inode *ignored, struct file *file) { struct inotify_device *dev = file->private_data; inotify_destroy(dev->ih); /* destroy all of the events on this device */ mutex_lock(&dev->ev_mutex); while (!list_empty(&dev->events)) inotify_dev_event_dequeue(dev); mutex_unlock(&dev->ev_m...
0
[ "CWE-399" ]
linux-2.6
3632dee2f8b8a9720329f29eeaa4ec4669a3aff8
209,446,307,428,206,530,000,000,000,000,000,000,000
17
inotify: clean up inotify_read and fix locking problems If userspace supplies an invalid pointer to a read() of an inotify instance, the inotify device's event list mutex is unlocked twice. This causes an unbalance which effectively leaves the data structure unprotected, and we can trigger oopses by accessing the inot...
static int check_chain_extensions(X509_STORE_CTX *ctx) { int i, must_be_ca, plen = 0; X509 *x; int proxy_path_length = 0; int purpose; int allow_proxy_certs; int num = sk_X509_num(ctx->chain); /*- * must_be_ca can have 1 of 3 values: * -1: we accept both CA and non-CA certificate...
0
[]
openssl
33cc5dde478ba5ad79f8fd4acd8737f0e60e236e
120,197,340,422,087,470,000,000,000,000,000,000,000
124
Compat self-signed trust with reject-only aux data When auxiliary data contains only reject entries, continue to trust self-signed objects just as when no auxiliary data is present. This makes it possible to reject specific uses without changing what's accepted (and thus overring the underlying EKU). Added new suppo...
void SetErrorString(YasslError error, char* buffer) { using namespace TaoCrypt; const int max = MAX_ERROR_SZ; // shorthand int localError = error; // errors from a few enums switch (localError) { // yaSSL proper errors case range_error : strncpy(buffer, "buffer index error...
0
[]
mysql-server
b9768521bdeb1a8069c7b871f4536792b65fd79b
338,231,096,438,786,730,000,000,000,000,000,000,000
227
Updated yassl to yassl-2.3.8 (cherry picked from commit 7f9941eab55ed672bfcccd382dafbdbcfdc75aaa)
static void alg_sock_destruct(struct sock *sk) { struct alg_sock *ask = alg_sk(sk); alg_do_release(ask->type, ask->private); }
0
[ "CWE-416" ]
linux
9060cb719e61b685ec0102574e10337fa5f445ea
36,023,220,355,916,720,000,000,000,000,000,000,000
6
net: crypto set sk to NULL when af_alg_release. KASAN has found use-after-free in sockfs_setattr. The existed commit 6d8c50dcb029 ("socket: close race condition between sock_close() and sockfs_setattr()") is to fix this simillar issue, but it seems to ignore that crypto module forgets to set the sk to NULL after af_al...
const char *string_of_NPPVariable(int variable) { const char *str; switch (variable) { #define _(VAL) case VAL: str = #VAL; break; _(NPPVpluginNameString); _(NPPVpluginDescriptionString); _(NPPVpluginWindowBool); _(NPPVpluginTransparentBool); _(NPPVjavaClass); _(NPPVpluginWindowSize); _(NPPVpluginTimerInter...
0
[ "CWE-264" ]
nspluginwrapper
7e4ab8e1189846041f955e6c83f72bc1624e7a98
218,118,503,185,636,800,000,000,000,000,000,000,000
40
Support all the new variables added
void shutdownListener() override { udp_listener_.reset(); }
0
[ "CWE-400" ]
envoy
dfddb529e914d794ac552e906b13d71233609bf7
72,473,967,102,671,580,000,000,000,000,000,000,000
1
listener: Add configurable accepted connection limits (#153) Add support for per-listener limits on accepted connections. Signed-off-by: Tony Allen <tony@allen.gg>
static MngBox mng_read_box(MngBox previous_box,char delta_type,unsigned char *p) { MngBox box; /* Read clipping boundaries from DEFI, CLIP, FRAM, or PAST chunk. */ box.left=mng_get_long(p); box.right=mng_get_long(&p[4]); box.top=mng_get_long(&p[8]); box.bottom=mng_get_long(&p[12]); if (delta...
0
[ "CWE-835" ]
ImageMagick6
9eda4b36a8695e4a0cd27bea28b9c173c68a01ec
61,100,723,985,090,580,000,000,000,000,000,000,000
22
Fixed infinite loop (#1095).
stack_copy (ILCodeDesc *to, ILCodeDesc *from) { ensure_stack_size (to, from->size); to->size = from->size; /*stack copy happens at merge points, which have small stacks*/ if (from->size) memcpy (to->stack, from->stack, sizeof (ILStackDesc) * from->size); }
0
[ "CWE-20" ]
mono
65292a69c837b8a5f7a392d34db63de592153358
311,529,322,858,962,200,000,000,000,000,000,000,000
9
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
static struct page **fuse_pages_alloc(unsigned int npages, gfp_t flags, struct fuse_page_desc **desc) { struct page **pages; pages = kzalloc(npages * (sizeof(struct page *) + sizeof(struct fuse_page_desc)), flags); *desc = (void *) (pages + npages); return pages; }
0
[ "CWE-459" ]
linux
5d069dbe8aaf2a197142558b6fb2978189ba3454
163,630,660,102,341,430,000,000,000,000,000,000,000
11
fuse: fix bad inode Jan Kara's analysis of the syzbot report (edited): The reproducer opens a directory on FUSE filesystem, it then attaches dnotify mark to the open directory. After that a fuse_do_getattr() call finds that attributes returned by the server are inconsistent, and calls make_bad_inode() which,...
static void reds_cleanup(RedsState *reds) { #ifdef RED_STATISTICS stat_file_unlink(reds->stat_file); #endif }
0
[]
spice
ca5bbc5692e052159bce1a75f55dc60b36078749
319,217,427,416,294,680,000,000,000,000,000,000,000
6
With OpenSSL 1.1: Disable client-initiated renegotiation. Fixes issue #49 Fixes BZ#1904459 Signed-off-by: Julien Ropé <jrope@redhat.com> Reported-by: BlackKD Acked-by: Frediano Ziglio <fziglio@redhat.com>
static inline struct page * __pure pgv_to_page(void *addr) { if (is_vmalloc_addr(addr)) return vmalloc_to_page(addr); return virt_to_page(addr); }
0
[ "CWE-416", "CWE-362" ]
linux
84ac7260236a49c79eede91617700174c2c19b0c
186,089,496,753,362,970,000,000,000,000,000,000,000
6
packet: fix race condition in packet_set_ring When packet_set_ring creates a ring buffer it will initialize a struct timer_list if the packet version is TPACKET_V3. This value can then be raced by a different thread calling setsockopt to set the version to TPACKET_V1 before packet_set_ring has finished. This leads to...
EC_Group::EC_Group() { }
0
[ "CWE-200" ]
botan
48fc8df51d99f9d8ba251219367b3d629cc848e3
68,227,226,428,914,100,000,000,000,000,000,000,000
3
Address DSA/ECDSA side channel
static void test_memslot_invalid_group_id(void) { RedMemSlotInfo mem_info; init_meminfo(&mem_info); memslot_get_virt(&mem_info, 0, 16, 1); }
0
[ "CWE-193" ]
spice
a4a16ac42d2f19a17e36556546aa94d5cd83745f
233,529,775,521,465,000,000,000,000,000,000,000,000
7
memslot: Fix off-by-one error in group/slot boundary check RedMemSlotInfo keeps an array of groups, and each group contains an array of slots. Unfortunately, these checks are off by 1, they check that the index is greater or equal to the number of elements in the array, while these arrays are 0 based. The check should...
ErrorType init(const char* name, unsigned char* key, size_t key_len, unsigned char* iv, size_t iv_len, const char* hmac_name, unsigned char* hmac_key, size_t hmac_key_len, int is_etm...
0
[ "CWE-78" ]
ssh2
f763271f41320e71d5cbee02ea5bc6a2ded3ca21
128,085,268,979,097,100,000,000,000,000,000,000,000
89
examples,lib,test: switch to code rewrite For more information see: https://github.com/mscdex/ssh2/issues/935
static void PNGLong(png_bytep p,png_uint_32 value) { *p++=(png_byte) ((value >> 24) & 0xff); *p++=(png_byte) ((value >> 16) & 0xff); *p++=(png_byte) ((value >> 8) & 0xff); *p++=(png_byte) (value & 0xff); }
0
[ "CWE-476" ]
ImageMagick
816ecab6c532ae086ff4186b3eaf4aa7092d536f
198,125,456,858,691,200,000,000,000,000,000,000,000
7
https://github.com/ImageMagick/ImageMagick/issues/58
static int SkipInt(const byte* input, word32* inOutIdx, word32 maxIdx) { word32 idx = *inOutIdx; int ret; int length; ret = GetASNInt(input, &idx, &length, maxIdx); if (ret != 0) return ret; *inOutIdx = idx + length; return 0; }
0
[ "CWE-125", "CWE-345" ]
wolfssl
f93083be72a3b3d956b52a7ec13f307a27b6e093
192,658,197,935,356,180,000,000,000,000,000,000,000
14
OCSP: improve handling of OCSP no check extension
COMP_METHOD *COMP_zlib(void) { COMP_METHOD *meth = &zlib_method_nozlib; #ifdef ZLIB_SHARED if (!zlib_loaded) { #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) zlib_dso = DSO_load(NULL, "ZLIB1", NULL, 0); #else zlib_dso = DSO_load(NULL, "z", NULL, 0); #endif if (zlib_dso != NULL) { p_com...
1
[ "CWE-399" ]
openssl
1b31b5ad560b16e2fe1cad54a755e3e6b5e778a3
198,073,764,009,354,100,000,000,000,000,000,000,000
74
Modify compression code so it avoids using ex_data free functions. This stops applications that call CRYPTO_free_all_ex_data() prematurely leaking memory.
GC_debug_generic_or_special_malloc(size_t lb, int knd, GC_EXTRA_PARAMS) { switch (knd) { # ifdef STUBBORN_ALLOC case STUBBORN: return GC_debug_malloc_stubborn(lb, OPT_RA s, i); # endif case PTRFREE: return GC_debug_malloc_atomic(lb, OPT_RA s, i); case NORM...
0
[ "CWE-119" ]
bdwgc
7292c02fac2066d39dd1bcc37d1a7054fd1e32ee
285,221,489,937,479,070,000,000,000,000,000,000,000
21
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...
ves_icall_System_Enum_get_hashcode (MonoObject *this) { gpointer data = (char *)this + sizeof (MonoObject); MonoType *basetype = mono_class_enum_basetype (this->vtable->klass); g_assert (basetype); switch (basetype->type) { case MONO_TYPE_I1: return *((gint8*)data); case MONO_TYPE_U1: return *((guint8*)...
0
[ "CWE-264" ]
mono
035c8587c0d8d307e45f1b7171a0d337bb451f1e
224,527,972,366,093,900,000,000,000,000,000,000,000
31
Allow only primitive types/enums in RuntimeHelpers.InitializeArray ().
last_status_rec(frame_T *fr, int statusline) { frame_T *fp; win_T *wp; if (fr->fr_layout == FR_LEAF) { wp = fr->fr_win; if (wp->w_status_height != 0 && !statusline) { // remove status line win_new_height(wp, wp->w_height + 1); wp->w_status_height = 0; comp_col(); } else if (wp-...
0
[ "CWE-476" ]
vim
0f6e28f686dbb59ab3b562408ab9b2234797b9b1
248,848,610,213,763,260,000,000,000,000,000,000,000
60
patch 8.2.4428: crash when switching tabpage while in the cmdline window Problem: Crash when switching tabpage while in the cmdline window. Solution: Disallow switching tabpage when in the cmdline window.
static int cpuset_cpu_inactive(struct notifier_block *nfb, unsigned long action, void *hcpu) { unsigned long flags; long cpu = (long)hcpu; struct dl_bw *dl_b; bool overflow; int cpus; switch (action) { case CPU_DOWN_PREPARE: rcu_read_lock_sched(); dl_b = dl_bw_of(cpu); raw_spin_lock_irqsave(&dl...
0
[ "CWE-119" ]
linux
29d6455178a09e1dc340380c582b13356227e8df
24,815,127,622,727,436,000,000,000,000,000,000,000
34
sched: panic on corrupted stack end Until now, hitting this BUG_ON caused a recursive oops (because oops handling involves do_exit(), which calls into the scheduler, which in turn raises an oops), which caused stuff below the stack to be overwritten until a panic happened (e.g. via an oops in interrupt context, cause...
xmlSchemaFreeFacet(xmlSchemaFacetPtr facet) { if (facet == NULL) return; if (facet->val != NULL) xmlSchemaFreeValue(facet->val); if (facet->regexp != NULL) xmlRegFreeRegexp(facet->regexp); if (facet->annot != NULL) xmlSchemaFreeAnnot(facet->annot); xmlFree(facet); }
0
[ "CWE-134" ]
libxml2
4472c3a5a5b516aaf59b89be602fbce52756c3e9
268,517,474,834,431,660,000,000,000,000,000,000,000
12
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.
u32 hugetlb_fault_mutex_hash(struct hstate *h, struct mm_struct *mm, struct vm_area_struct *vma, struct address_space *mapping, pgoff_t idx, unsigned long address) { return 0; }
0
[ "CWE-703" ]
linux
5af10dfd0afc559bb4b0f7e3e8227a1578333995
327,181,469,427,512,400,000,000,000,000,000,000,000
7
userfaultfd: hugetlbfs: remove superfluous page unlock in VM_SHARED case huge_add_to_page_cache->add_to_page_cache implicitly unlocks the page before returning in case of errors. The error returned was -EEXIST by running UFFDIO_COPY on a non-hole offset of a VM_SHARED hugetlbfs mapping. It was an userland bug that t...
static inline struct dma_chan *dma_find_channel(enum dma_transaction_type tx_type) { return NULL; }
0
[]
linux
7bced397510ab569d31de4c70b39e13355046387
158,877,217,052,145,000,000,000,000,000,000,000,000
4
net_dma: simple removal Per commit "77873803363c net_dma: mark broken" net_dma is no longer used and there is no plan to fix it. This is the mechanical removal of bits in CONFIG_NET_DMA ifdef guards. Reverting the remainder of the net_dma induced changes is deferred to subsequent patches. Marked for stable due to Ro...
eval_method( char_u **arg, typval_T *rettv, evalarg_T *evalarg, int verbose) // give error messages { char_u *name; long len; char_u *alias; char_u *tofree = NULL; typval_T base = *rettv; int ret = OK; int evaluate = evalarg != NULL && (evalarg->eval_flags & EVAL...
0
[ "CWE-476" ]
vim
69082916c8b5d321545d60b9f5facad0a2dd5a4e
58,436,484,229,330,540,000,000,000,000,000,000,000
88
patch 9.0.0552: crash when using NUL in buffer that uses :source Problem: Crash when using NUL in buffer that uses :source. Solution: Don't get a next line when skipping over NL.
void ConnPoolImplBase::closeIdleConnectionsForDrainingPool() { Common::AutoDebugRecursionChecker assert_not_in(recursion_checker_); // Create a separate list of elements to close to avoid mutate-while-iterating problems. std::list<ActiveClient*> to_close; for (auto& client : ready_clients_) { if (client->...
0
[ "CWE-703", "CWE-674" ]
envoy
4b6dd3b53cd5c6d4d4df378a2fc62c1707522b31
234,112,812,373,194,760,000,000,000,000,000,000,000
24
CVE-2022-23606 Avoid closing other connections to prevent deep recursion when a large number of idle connections are closed at the start of a pool drain, when a connection is closed. Signed-off-by: Yan Avlasov <yavlasov@google.com>
static gfn_t kvm_mmu_page_get_gfn(struct kvm_mmu_page *sp, int index) { if (!sp->role.direct) return sp->gfns[index]; return sp->gfn + (index << ((sp->role.level - 1) * PT64_LEVEL_BITS)); }
0
[ "CWE-476" ]
linux
9f46c187e2e680ecd9de7983e4d081c3391acc76
123,721,517,800,805,350,000,000,000,000,000,000,000
7
KVM: x86/mmu: fix NULL pointer dereference on guest INVPCID With shadow paging enabled, the INVPCID instruction results in a call to kvm_mmu_invpcid_gva. If INVPCID is executed with CR0.PG=0, the invlpg callback is not set and the result is a NULL pointer dereference. Fix it trivially by checking for mmu->invlpg befo...
static inline unsigned int vstatus_to_ocsp_status(unsigned int status) { unsigned int ostatus; if (status & GNUTLS_CERT_INSECURE_ALGORITHM) ostatus = GNUTLS_OCSP_VERIFY_INSECURE_ALGORITHM; else if (status & GNUTLS_CERT_NOT_ACTIVATED) ostatus = GNUTLS_OCSP_VERIFY_CERT_NOT_ACTIVATED; else if (status & GNUTLS_CER...
0
[ "CWE-264" ]
gnutls
964632f37dfdfb914ebc5e49db4fa29af35b1de9
326,204,522,611,078,040,000,000,000,000,000,000,000
15
ocsp: corrected the comparison of the serial size in OCSP response Previously the OCSP certificate check wouldn't verify the serial length and could succeed in cases it shouldn't. Reported by Stefan Buehler.
do_search( oparg_T *oap, // can be NULL int dirc, // '/' or '?' int search_delim, // the delimiter for the search, e.g. '%' in // s%regex%replacement% char_u *pat, long count, int options, searchit_arg_T *sia) // optional arguments or NULL { pos_T po...
0
[ "CWE-416" ]
vim
409510c588b1eec1ae33511ae97a21eb8e110895
288,972,973,970,902,040,000,000,000,000,000,000,000
460
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.
static int check_reg_type(struct bpf_verifier_env *env, u32 regno, enum bpf_arg_type arg_type, const u32 *arg_btf_id) { struct bpf_reg_state *regs = cur_regs(env), *reg = &regs[regno]; enum bpf_reg_type expected, type = reg->type; const struct bpf_reg_types *compatible; int i, j; compatible = compatible...
0
[ "CWE-787" ]
linux
64620e0a1e712a778095bd35cbb277dc2259281f
55,061,576,902,769,550,000,000,000,000,000,000,000
66
bpf: Fix out of bounds access for ringbuf helpers Both bpf_ringbuf_submit() and bpf_ringbuf_discard() have ARG_PTR_TO_ALLOC_MEM in their bpf_func_proto definition as their first argument. They both expect the result from a prior bpf_ringbuf_reserve() call which has a return type of RET_PTR_TO_ALLOC_MEM_OR_NULL. Meani...
TEST(RegexMatchExpression, Equality1) { RegexMatchExpression r1; RegexMatchExpression r2; RegexMatchExpression r3; RegexMatchExpression r4; ASSERT(r1.init("a", "b", "").isOK()); ASSERT(r2.init("a", "b", "x").isOK()); ASSERT(r3.init("a", "c", "").isOK()); ASSERT(r4.init("b", "b", "").isOK...
0
[]
mongo
b0ef26c639112b50648a02d969298650fbd402a4
13,155,740,429,358,980,000,000,000,000,000,000,000
15
SERVER-51083 Reject invalid UTF-8 from $regex match expressions
static void convert_32s1u_C1R(const OPJ_INT32* pSrc, OPJ_BYTE* pDst, OPJ_SIZE_T length) { OPJ_SIZE_T i; for (i = 0; i < (length & ~(OPJ_SIZE_T)7U); i += 8U) { OPJ_UINT32 src0 = (OPJ_UINT32)pSrc[i + 0]; OPJ_UINT32 src1 = (OPJ_UINT32)pSrc[i + 1]; OPJ_UINT32 sr...
0
[ "CWE-787" ]
openjpeg
e5285319229a5d77bf316bb0d3a6cbd3cb8666d9
193,982,131,892,015,800,000,000,000,000,000,000,000
50
pgxtoimage(): fix write stack buffer overflow (#997)
ZEND_VM_HOT_OBJ_HANDLER(82, ZEND_FETCH_OBJ_R, CONST|TMPVAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, CACHE_SLOT) { USE_OPLINE zend_free_op free_op1; zval *container; zend_free_op free_op2; zval *offset; void **cache_slot = NULL; SAVE_OPLINE(); container = GET_OP1_OBJ_ZVAL_PTR_UNDEF(BP_VAR_R); if (OP1_TYPE == IS_UNUSE...
0
[ "CWE-787" ]
php-src
f1ce8d5f5839cb2069ea37ff424fb96b8cd6932d
301,217,449,300,384,820,000,000,000,000,000,000,000
114
Fix #73122: Integer Overflow when concatenating strings We must avoid integer overflows in memory allocations, so we introduce an additional check in the VM, and bail out in the rare case of an overflow. Since the recent fix for bug #74960 still doesn't catch all possible overflows, we fix that right away.
const char* language() const { return language_; }
0
[ "CWE-20" ]
libvpx
f00890eecdf8365ea125ac16769a83aa6b68792d
130,189,200,924,502,800,000,000,000,000,000,000,000
1
update libwebm to libwebm-1.0.0.27-352-g6ab9fcf https://chromium.googlesource.com/webm/libwebm/+log/af81f26..6ab9fcf Change-Id: I9d56e1fbaba9b96404b4fbabefddc1a85b79c25d
struct timespec64 current_time(struct inode *inode) { struct timespec64 now; ktime_get_coarse_real_ts64(&now); if (unlikely(!inode->i_sb)) { WARN(1, "current_time() called with uninitialized super_block in the inode"); return now; } return timestamp_truncate(now, inode); }
0
[ "CWE-416" ]
tip
8019ad13ef7f64be44d4f892af9c840179009254
333,561,895,071,974,440,000,000,000,000,000,000,000
13
futex: Fix inode life-time issue As reported by Jann, ihold() does not in fact guarantee inode persistence. And instead of making it so, replace the usage of inode pointers with a per boot, machine wide, unique inode identifier. This sequence number is global, but shared (file backed) futexes are rare enough that thi...
ia64_patch_imm60 (u64 insn_addr, u64 val) { /* The assembler may generate offset pointing to either slot 1 or slot 2 for a long (2-slot) instruction, occupying slots 1 and 2. */ insn_addr &= -16UL; ia64_patch(insn_addr + 2, 0x011ffffe000UL, ( ((val & 0x0800000000000000UL) >> 23) /* bit 59 -> 36 */ ...
0
[ "CWE-119", "CWE-787" ]
linux
4dcc29e1574d88f4465ba865ed82800032f76418
199,944,983,779,125,100,000,000,000,000,000,000,000
11
[IA64] Workaround for RSE issue Problem: An application violating the architectural rules regarding operation dependencies and having specific Register Stack Engine (RSE) state at the time of the violation, may result in an illegal operation fault and invalid RSE state. Such faults may initiate a cascade of repeated ...
static QEMUCursor *qxl_cursor(PCIQXLDevice *qxl, QXLCursor *cursor) { QEMUCursor *c; uint8_t *image, *mask; int size; c = cursor_alloc(cursor->header.width, cursor->header.height); c->hot_x = cursor->header.hot_spot_x; c->hot_y = cursor->header.hot_spot_y; switch (cursor->header.type) { ...
0
[]
qemu-kvm
5ff4e36c804157bd84af43c139f8cd3a59722db9
196,857,143,310,394,130,000,000,000,000,000,000,000
36
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...
rsvg_new_filter_primitive_colour_matrix (void) { RsvgFilterPrimitiveColourMatrix *filter; filter = g_new (RsvgFilterPrimitiveColourMatrix, 1); _rsvg_node_init (&filter->super.super); filter->super.in = g_string_new ("none"); filter->super.result = g_string_new ("none"); filter->super.x.factor = ...
1
[]
librsvg
34c95743ca692ea0e44778e41a7c0a129363de84
46,697,148,430,766,580,000,000,000,000,000,000,000
16
Store node type separately in RsvgNode The node name (formerly RsvgNode:type) cannot be used to infer the sub-type of RsvgNode that we're dealing with, since for unknown elements we put type = node-name. This lead to a (potentially exploitable) crash e.g. when the element name started with "fe" which tricked the old c...
R_API const char * r_str_tok(const char *str1, const char b, size_t len) { const char *p = str1; size_t i = 0; if (!p || !*p) { return p; } if (len == -1) { len = strlen (str1); } for ( ; i < len; i++,p++) { if (*p == b) { break; } } if (i == len) { p = NULL; } return p; }
0
[ "CWE-78" ]
radare2
04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9
149,672,279,624,310,750,000,000,000,000,000,000,000
19
Fix command injection on PDB download (#16966) * Fix r_sys_mkdirp with absolute path on Windows * Fix build with --with-openssl * Use RBuffer in r_socket_http_answer() * r_socket_http_answer: Fix read for big responses * Implement r_str_escape_sh() * Cleanup r_socket_connect() on Windows * Fix socket being creat...
AP_DECLARE(char *) ap_construct_url(apr_pool_t *p, const char *uri, request_rec *r) { unsigned port = ap_get_server_port(r); const char *host = ap_get_server_name_for_url(r); if (ap_is_default_port(port, r)) { return apr_pstrcat(p, ap_http_scheme(r), "://", host,...
0
[ "CWE-416", "CWE-284" ]
httpd
4cc27823899e070268b906ca677ee838d07cf67a
38,809,464,103,585,860,000,000,000,000,000,000,000
12
core: Disallow Methods' registration at run time (.htaccess), they may be used only if registered at init time (httpd.conf). Calling ap_method_register() in children processes is not the right scope since it won't be shared for all requests. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1807655 13f7...
bjc_put_raster_skip(gp_file *file, int skip) { bjc_put_command(file, 'e', 2); bjc_put_hi_lo(file, skip); }
0
[ "CWE-787" ]
ghostpdl
bf72f1a3dd5392ee8291e3b1518a0c2c5dc6ba39
93,986,350,396,184,970,000,000,000,000,000,000,000
5
Fix valgrind problems with gdevbjca.c 2 problems here. Firstly, we could access off the end of a row while looking for runs. Change the indexing to fix this. Secondly, we could overrun our gamma tables due to unexpectedly large values. Add some clamping.
xmlParseInNodeContext(xmlNodePtr node, const char *data, int datalen, int options, xmlNodePtr *lst) { #ifdef SAX2 xmlParserCtxtPtr ctxt; xmlDocPtr doc = NULL; xmlNodePtr fake, cur; int nsnr = 0; xmlParserErrors ret = XML_ERR_OK; /* * check all input parameters, grab ...
0
[]
libxml2
9cd1c3cfbd32655d60572c0a413e017260c854df
132,782,665,226,748,280,000,000,000,000,000,000,000
206
Do not fetch external parameter entities Unless explicitely asked for when validating or replacing entities with their value. Problem pointed out by Daniel Berrange <berrange@redhat.com>
int vfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev) { int error = may_create(dir, dentry, NULL); if (error) return error; if ((S_ISCHR(mode) || S_ISBLK(mode)) && !capable(CAP_MKNOD)) return -EPERM; if (!dir->i_op || !dir->i_op->mknod) return -EPERM; error = devcgroup_inode_mknod(...
0
[ "CWE-120" ]
linux-2.6
d70b67c8bc72ee23b55381bd6a884f4796692f77
4,537,324,146,957,767,500,000,000,000,000,000,000
27
[patch] vfs: fix lookup on deleted directory Lookup can install a child dentry for a deleted directory. This keeps the directory dentry alive, and the inode pinned in the cache and on disk, even after all external references have gone away. This isn't a big problem normally, since memory pressure or umount will clea...
void efi_thunk_runtime_setup(void) { efi.get_time = efi_thunk_get_time; efi.set_time = efi_thunk_set_time; efi.get_wakeup_time = efi_thunk_get_wakeup_time; efi.set_wakeup_time = efi_thunk_set_wakeup_time; efi.get_variable = efi_thunk_get_variable; efi.get_next_variable = efi_thunk_get_next_variable; efi.set_vari...
0
[ "CWE-388" ]
tip
4e78921ba4dd0aca1cc89168f45039add4183f8e
90,406,829,632,458,780,000,000,000,000,000,000,000
17
efi/x86/Add missing error handling to old_memmap 1:1 mapping code The old_memmap flow in efi_call_phys_prolog() performs numerous memory allocations, and either does not check for failure at all, or it does but fails to propagate it back to the caller, which may end up calling into the firmware with an incomplete 1:1 ...
void mg_mqtt_publish(struct mg_connection *nc, const char *topic, uint16_t message_id, int flags, const void *data, size_t len) { uint16_t netbytes; uint16_t topic_len = strlen(topic); size_t total_len = 2 + topic_len + len; if (MG_MQTT_GET_QOS(flags) > 0) { total_...
0
[ "CWE-119", "CWE-284", "CWE-787" ]
mongoose
b3e0f780c34cea88f057a62213c012aa88fe2deb
182,638,501,276,772,100,000,000,000,000,000,000,000
24
Fix heap-based overflow in parse_mqtt PUBLISHED_FROM=3306592896298597fff5269634df0c1a1555113b
static inline void shift_key(php_http_buffer_t *buf, char *key_str, size_t key_len, const char *ass, size_t asl, unsigned flags TSRMLS_DC) { char *str; size_t len; if (buf->used) { php_http_buffer_append(buf, ass, asl); } prepare_key(flags, key_str, key_len, &str, &len TSRMLS_CC); php_http_buffer_append(buf, ...
0
[ "CWE-399", "CWE-704" ]
ext-http
17137d4ab1ce81a2cee0fae842340a344ef3da83
155,997,311,542,771,000,000,000,000,000,000,000,000
13
fix bug #73055
int vnc_init_func(void *opaque, QemuOpts *opts, Error **errp) { Error *local_err = NULL; char *id = (char *)qemu_opts_id(opts); assert(id); vnc_display_init(id); vnc_display_open(id, &local_err); if (local_err != NULL) { error_reportf_err(local_err, "Failed to start VNC server: "); ...
0
[ "CWE-772" ]
qemu
d3b0db6dfea6b3a9ee0d96aceb796bdcafa84314
140,635,879,434,312,630,000,000,000,000,000,000,000
14
vnc: Set default kbd delay to 10ms The current VNC default keyboard delay is 1ms. With that we're constantly typing faster than the guest receives keyboard events from an XHCI attached USB HID device. The default keyboard delay time in the input layer however is 10ms. I don't know how that number came to be, but empi...
int group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p) { int ret; rcu_read_lock(); ret = check_kill_permission(sig, info, p); rcu_read_unlock(); if (!ret && sig) ret = do_send_sig_info(sig, info, p, true); return ret; }
0
[]
linux-2.6
da48524eb20662618854bb3df2db01fc65f3070c
136,427,409,584,974,870,000,000,000,000,000,000,000
13
Prevent rt_sigqueueinfo and rt_tgsigqueueinfo from spoofing the signal code Userland should be able to trust the pid and uid of the sender of a signal if the si_code is SI_TKILL. Unfortunately, the kernel has historically allowed sigqueueinfo() to send any si_code at all (as long as it was negative - to distinguish i...
rb_str_hash(str) VALUE str; { register long len = RSTRING(str)->len; register char *p = RSTRING(str)->ptr; register int key = 0; #if defined(HASH_ELFHASH) register unsigned int g; while (len--) { key = (key << 4) + *p++; if (g = key & 0xF0000000) key ^= g >> 24; key &= ~g; } #elif ...
0
[ "CWE-20" ]
ruby
e926ef5233cc9f1035d3d51068abe9df8b5429da
100,194,857,409,877,440,000,000,000,000,000,000,000
34
* random.c (rb_genrand_int32, rb_genrand_real), intern.h: Export. * string.c (rb_str_tmp_new), intern.h: New function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
static char *file2memory(FILE *file, long *size) { char buffer[1024]; char *string=NULL; char *newstring=NULL; size_t len=0; long stringlen=0; if(file) { while((len = fread(buffer, 1, sizeof(buffer), file))) { if(string) { newstring = realloc(string, len+stringlen+1); if(newstring...
0
[ "CWE-125" ]
curl
70b1900dd13d16f2e83f571407a614541d5ac9ba
266,320,637,641,137,080,000,000,000,000,000,000,000
32
'mytx' in bug report #1723194 (http://curl.haxx.se/bug/view.cgi?id=1723194) pointed out that the warnf() function in the curl tool didn't properly deal with the cases when excessively long words were used in the string to chop up.
struct sk_buff *__skb_recv_udp(struct sock *sk, unsigned int flags, int noblock, int *peeked, int *off, int *err) { struct sk_buff_head *sk_queue = &sk->sk_receive_queue; struct sk_buff_head *queue; struct sk_buff *last; long timeo; int error; queue = &udp_sk(sk)->reader_queue; flags |= noblock ? MSG_...
0
[ "CWE-362" ]
net
85f1bd9a7b5a79d5baa8bf44af19658f7bf77bfa
330,900,144,293,105,900,000,000,000,000,000,000,000
69
udp: consistently apply ufo or fragmentation When iteratively building a UDP datagram with MSG_MORE and that datagram exceeds MTU, consistently choose UFO or fragmentation. Once skb_is_gso, always apply ufo. Conversely, once a datagram is split across multiple skbs, do not consider ufo. Sendpage already maintains th...
static void do_pf_write(void) { ps_set_intr(do_pf_write_start, NULL, 0, nice); }
0
[ "CWE-476", "CWE-125" ]
linux
58ccd2d31e502c37e108b285bf3d343eb00c235b
210,901,277,445,544,750,000,000,000,000,000,000,000
4
paride/pf: Fix potential NULL pointer dereference Syzkaller report this: pf: pf version 1.04, major 47, cluster 64, nice 0 pf: No ATAPI disk detected kasan: CONFIG_KASAN_INLINE enabled kasan: GPF could be caused by NULL-ptr deref or user memory access general protection fault: 0000 [#1] SMP KASAN PTI CPU: 0 PID: 9887...
static napi_value TestUtf8Insufficient(napi_env env, napi_callback_info info) { size_t argc = 1; napi_value args[1]; NAPI_CALL(env, napi_get_cb_info(env, info, &argc, args, NULL, NULL)); NAPI_ASSERT(env, argc >= 1, "Wrong number of arguments"); napi_valuetype valuetype; NAPI_CALL(env, napi_typeof(env, arg...
0
[ "CWE-191" ]
node
656260b4b65fec3b10f6da3fdc9f11fb941aafb5
78,266,922,439,910,630,000,000,000,000,000,000,000
25
napi: fix memory corruption vulnerability Fixes: https://hackerone.com/reports/784186 CVE-ID: CVE-2020-8174 PR-URL: https://github.com/nodejs-private/node-private/pull/195 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Michael Dawson <michael_da...
static int cypress_generic_port_probe(struct usb_serial_port *port) { struct usb_serial *serial = port->serial; struct cypress_private *priv; if (!port->interrupt_out_urb || !port->interrupt_in_urb) { dev_err(&port->dev, "required endpoint is missing\n"); return -ENODEV; } priv = kzalloc(sizeof(struct cypres...
0
[ "CWE-703" ]
linux
c55aee1bf0e6b6feec8b2927b43f7a09a6d5f754
326,775,968,413,477,820,000,000,000,000,000,000,000
60
USB: cypress_m8: add endpoint sanity check An attack using missing endpoints exists. CVE-2016-3137 Signed-off-by: Oliver Neukum <ONeukum@suse.com> CC: stable@vger.kernel.org Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
explicit DataFormatDimMapOp(OpKernelConstruction* context) : OpKernel(context) { string src_format; OP_REQUIRES_OK(context, context->GetAttr("src_format", &src_format)); string dst_format; OP_REQUIRES_OK(context, context->GetAttr("dst_format", &dst_format)); OP_REQUIRES(context, src_format.s...
0
[ "CWE-125" ]
tensorflow
ebc70b7a592420d3d2f359e4b1694c236b82c7ae
201,899,874,413,108,450,000,000,000,000,000,000,000
30
Validate that `DataFormat*` attributes form a permutation. The `src_format` and `dst_format` attributes for the `DataFormatDimMap` and `DataFormatVecPermute` raw ops are supposed to determine a permutation. However, this was not validated and could result in unitialized memory accesses as well as writes outside of bou...
exit_check(dns_zone_t *zone) { REQUIRE(LOCKED_ZONE(zone)); if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_SHUTDOWN) && zone->irefs == 0) { /* * DNS_ZONEFLG_SHUTDOWN can only be set if erefs == 0. */ INSIST(isc_refcount_current(&zone->erefs) == 0); return (true); } return (false); }
0
[ "CWE-327" ]
bind9
f09352d20a9d360e50683cd1d2fc52ccedcd77a0
271,418,528,299,513,070,000,000,000,000,000,000,000
12
Update keyfetch_done compute_tag check If in keyfetch_done the compute_tag fails (because for example the algorithm is not supported), don't crash, but instead ignore the key.
evbuffer_copyout(struct evbuffer *buf, void *data_out, size_t datlen) { /*XXX fails badly on sendfile case. */ struct evbuffer_chain *chain; char *data = data_out; size_t nread; ev_ssize_t result = 0; EVBUFFER_LOCK(buf); chain = buf->first; if (datlen >= buf->total_len) datlen = buf->total_len; if (datle...
0
[ "CWE-189" ]
libevent
20d6d4458bee5d88bda1511c225c25b2d3198d6c
210,928,365,001,492,370,000,000,000,000,000,000,000
45
Fix CVE-2014-6272 in Libevent 2.0 For this fix, we need to make sure that passing too-large inputs to the evbuffer functions can't make us do bad things with the heap. Also, lower the maximum chunk size to the lower of off_t, size_t maximum. This is necessary since otherwise we could get into an infinite loop if we ...
static unsigned int fuse_req_hash(u64 unique) { return hash_long(unique & ~FUSE_INT_REQ_BIT, FUSE_PQ_HASH_BITS); }
0
[ "CWE-416" ]
linux
15fab63e1e57be9fdb5eec1bbc5916e9825e9acb
211,656,283,545,603,400,000,000,000,000,000,000,000
4
fs: prevent page refcount overflow in pipe_buf_get Change pipe_buf_get() to return a bool indicating whether it succeeded in raising the refcount of the page (if the thing in the pipe is a page). This removes another mechanism for overflowing the page refcount. All callers converted to handle a failure. Reported-by:...
static void opj_applyLUT8u_8u32s_C1P3R( OPJ_UINT8 const* pSrc, OPJ_INT32 srcStride, OPJ_INT32* const* pDst, OPJ_INT32 const* pDstStride, OPJ_UINT8 const* const* pLUT, OPJ_UINT32 width, OPJ_UINT32 height) { OPJ_UINT32 y; OPJ_INT32* pR = pDst[0]; OPJ_INT32* pG = pDst[1]; OPJ_INT32* pB = pD...
0
[ "CWE-119", "CWE-787" ]
openjpeg
baf0c1ad4572daa89caa3b12985bdd93530f0dd7
132,971,686,511,160,080,000,000,000,000,000,000,000
29
bmp_read_info_header(): reject bmp files with biBitCount == 0 (#983)
static void* zlib_zalloc(void* opaque, unsigned int no, unsigned int size) { void *p; p=OPENSSL_malloc(no*size); if (p) memset(p, 0, no*size); return p; }
0
[ "CWE-399" ]
openssl
1b31b5ad560b16e2fe1cad54a755e3e6b5e778a3
234,501,463,553,659,350,000,000,000,000,000,000,000
9
Modify compression code so it avoids using ex_data free functions. This stops applications that call CRYPTO_free_all_ex_data() prematurely leaking memory.
bool CNBL::ParseOffloads() { if (IsLSO()) { if(!ParseLSO()) { return false; } } else if (IsIP4CSO()) { if(!ParseCSO([this] () -> bool { return IsIP4CSO(); }, [this] () -> bool { return m_CsoInfo.Transmit.TcpChecksum; }, ...
0
[ "CWE-20" ]
kvm-guest-drivers-windows
723416fa4210b7464b28eab89cc76252e6193ac1
214,046,895,675,368,100,000,000,000,000,000,000,000
54
NetKVM: BZ#1169718: Checking the length only on read Signed-off-by: Joseph Hindin <yhindin@rehat.com>
static void dmaengine_unmap(struct kref *kref) { struct dmaengine_unmap_data *unmap = container_of(kref, typeof(*unmap), kref); struct device *dev = unmap->dev; int cnt, i; cnt = unmap->to_cnt; for (i = 0; i < cnt; i++) dma_unmap_page(dev, unmap->addr[i], unmap->len, DMA_TO_DEVICE); cnt += unmap->fro...
0
[]
linux
7bced397510ab569d31de4c70b39e13355046387
174,468,417,498,310,600,000,000,000,000,000,000,000
23
net_dma: simple removal Per commit "77873803363c net_dma: mark broken" net_dma is no longer used and there is no plan to fix it. This is the mechanical removal of bits in CONFIG_NET_DMA ifdef guards. Reverting the remainder of the net_dma induced changes is deferred to subsequent patches. Marked for stable due to Ro...
get_fn_expr_arg_stable(FmgrInfo *flinfo, int argnum) { /* * can't return anything useful if we have no FmgrInfo or if its fn_expr * node has not been initialized */ if (!flinfo || !flinfo->fn_expr) return false; return get_call_expr_arg_stable(flinfo->fn_expr, argnum); }
0
[ "CWE-264" ]
postgres
537cbd35c893e67a63c59bc636c3e888bd228bc7
31,977,576,327,658,206,000,000,000,000,000,000,000
11
Prevent privilege escalation in explicit calls to PL validators. The primary role of PL validators is to be called implicitly during CREATE FUNCTION, but they are also normal functions that a user can call explicitly. Add a permissions check to each validator to ensure that a user cannot use explicit validator calls ...
DocumentSource::GetModPathsReturn DocumentSourceGraphLookUp::getModifiedPaths() const { std::set<std::string> modifiedPaths{_as.fullPath()}; if (_unwind) { auto pathsModifiedByUnwind = _unwind.get()->getModifiedPaths(); invariant(pathsModifiedByUnwind.type == GetModPathsReturn::Type::kFiniteSet)...
0
[ "CWE-416" ]
mongo
d6133a3a5464fac202f512b0310dfeb200c126f9
5,390,390,525,492,441,000,000,000,000,000,000,000
10
SERVER-43350 $lookup with no local default or user-specified collation should explicitly set the simple collation on the foreign expression context
static json_t *json_string_copy(const json_t *string) { return json_string_nocheck(json_string_value(string)); }
0
[ "CWE-310" ]
jansson
8f80c2d83808150724d31793e6ade92749b1faa4
274,722,846,065,831,830,000,000,000,000,000,000,000
4
CVE-2013-6401: Change hash function, randomize hashes Thanks to Florian Weimer and Eric Sesterhenn for reporting, reviewing and testing.
static void nl80211_send_remain_on_chan_event( int cmd, struct cfg80211_registered_device *rdev, struct wireless_dev *wdev, u64 cookie, struct ieee80211_channel *chan, unsigned int duration, gfp_t gfp) { struct sk_buff *msg; void *hdr; msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); if (!msg) return; hdr = nl802...
0
[ "CWE-120" ]
linux
f88eb7c0d002a67ef31aeb7850b42ff69abc46dc
304,253,026,939,630,820,000,000,000,000,000,000,000
44
nl80211: validate beacon head We currently don't validate the beacon head, i.e. the header, fixed part and elements that are to go in front of the TIM element. This means that the variable elements there can be malformed, e.g. have a length exceeding the buffer size, but most downstream code from this assumes that thi...
static void *smm_stub_place_stacks(char *base, size_t size, struct smm_loader_params *params) { size_t total_stack_size; char *stacks_top; /* If stack space is requested assume the space lives in the lower * half of SMRAM. */ total_stack_size = params->per_cpu_stack_size * params->num_concurrent_sta...
0
[ "CWE-269" ]
coreboot
afb7a814783cda12f5b72167163b9109ee1d15a7
232,299,812,830,949,820,000,000,000,000,000,000,000
30
cpu/x86/smm: Introduce SMM module loader version 2 Xeon-SP Skylake Scalable Processor can have 36 CPU threads (18 cores). Current coreboot SMM is unable to handle more than ~32 CPU threads. This patch introduces a version 2 of the SMM module loader which addresses this problem. Having two versions of the SMM module lo...
static int em_clflush(struct x86_emulate_ctxt *ctxt) { /* emulating clflush regardless of cpuid */ return X86EMUL_CONTINUE; }
0
[ "CWE-399" ]
kvm
13e457e0eebf0a0c82c38ceb890d93eb826d62a6
314,002,896,382,145,600,000,000,000,000,000,000,000
5
KVM: x86: Emulator does not decode clflush well Currently, all group15 instructions are decoded as clflush (e.g., mfence, xsave). In addition, the clflush instruction requires no prefix (66/f2/f3) would exist. If prefix exists it may encode a different instruction (e.g., clflushopt). Creating a group for clflush, an...
eap_state_name(esc) enum eap_state_code esc; { static const char *state_names[] = { EAP_STATES }; return (state_names[(int)esc]); }
0
[ "CWE-120", "CWE-787" ]
ppp
8d7970b8f3db727fe798b65f3377fe6787575426
121,434,689,840,082,130,000,000,000,000,000,000,000
7
pppd: Fix bounds check in EAP code Given that we have just checked vallen < len, it can never be the case that vallen >= len + sizeof(rhostname). This fixes the check so we actually avoid overflowing the rhostname array. Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com> Signed-off-by: Paul Mackerras <paulus...
int __page_symlink(struct inode *inode, const char *symname, int len, int nofs) { struct address_space *mapping = inode->i_mapping; struct page *page; void *fsdata; int err; unsigned int flags = 0; if (nofs) flags |= AOP_FLAG_NOFS; retry: err = pagecache_write_begin(NULL, mapping, 0, len-1, flags, &page, ...
0
[ "CWE-362", "CWE-399" ]
linux
49d31c2f389acfe83417083e1208422b4091cd9e
231,777,920,900,805,700,000,000,000,000,000,000,000
30
dentry name snapshots take_dentry_name_snapshot() takes a safe snapshot of dentry name; if the name is a short one, it gets copied into caller-supplied structure, otherwise an extra reference to external name is grabbed (those are never modified). In either case the pointer to stable string is stored into the same st...
GF_Err gf_isom_apple_set_tag(GF_ISOFile *mov, GF_ISOiTunesTag tag, const u8 *data, u32 data_len, u64 int_val, u32 int_val2) { GF_Err e; GF_ItemListBox *ilst; GF_MetaBox *meta; GF_ListItemBox *info; u32 btype, i, itype; s32 tag_idx; u32 n=0, d=0; u8 loc_data[10]; u32 int_flags = 0x15; GF_DataBox *dbox; e = C...
0
[ "CWE-476" ]
gpac
586e817dcd531bb3e75438390f1f753cfe6e940a
20,507,884,695,163,890,000,000,000,000,000,000,000
208
fixed #2046
void qemu_ram_remap(ram_addr_t addr, ram_addr_t length) { RAMBlock *block; ram_addr_t offset; int flags; void *area, *vaddr; RAMBLOCK_FOREACH(block) { offset = addr - block->offset; if (offset < block->max_length) { vaddr = ramblock_ptr(block, offset); if (bl...
0
[ "CWE-908" ]
qemu
418ade7849ce7641c0f7333718caf5091a02fd4c
301,538,658,485,872,520,000,000,000,000,000,000,000
40
softmmu: Always initialize xlat in address_space_translate_for_iotlb The bug is an uninitialized memory read, along the translate_fail path, which results in garbage being read from iotlb_to_section, which can lead to a crash in io_readx/io_writex. The bug may be fixed by writing any value with zero in ~TARGET_PAGE_M...
void SSL_CTX_sess_set_remove_cb(SSL_CTX *ctx, void (*cb) (SSL_CTX *ctx, SSL_SESSION *sess)) { ctx->remove_session_cb = cb; }
0
[ "CWE-362" ]
openssl
939b4960276b040fc0ed52232238fcc9e2e9ec21
335,138,268,749,486,480,000,000,000,000,000,000,000
5
Fix race condition in NewSessionTicket If a NewSessionTicket is received by a multi-threaded client when attempting to reuse a previous ticket then a race condition can occur potentially leading to a double free of the ticket data. CVE-2015-1791 This also fixes RT#3808 where a session ID is changed for a session alr...
static void ipc_schedule_free(struct rcu_head *head) { struct ipc_rcu_grace *grace; struct ipc_rcu_sched *sched; grace = container_of(head, struct ipc_rcu_grace, rcu); sched = container_of(&(grace->data[0]), struct ipc_rcu_sched, data[0]); INIT_WORK(&sched->work, ipc_do_vfree); schedule_work(&sched->work); ...
0
[ "CWE-703", "CWE-189" ]
linux
6062a8dc0517bce23e3c2f7d2fea5e22411269a3
220,212,391,969,663,050,000,000,000,000,000,000,000
12
ipc,sem: fine grained locking for semtimedop Introduce finer grained locking for semtimedop, to handle the common case of a program wanting to manipulate one semaphore from an array with multiple semaphores. If the call is a semop manipulating just one semaphore in an array with multiple semaphores, only take the loc...
static inline int ipv6_addr_equal(const struct in6_addr *a1, const struct in6_addr *a2) { return ((a1->s6_addr32[0] ^ a2->s6_addr32[0]) | (a1->s6_addr32[1] ^ a2->s6_addr32[1]) | (a1->s6_addr32[2] ^ a2->s6_addr32[2]) | (a1->s6_addr32[3] ^ a2->s6_addr32[3])) == 0; }
0
[ "CWE-703" ]
linux
87c48fa3b4630905f98268dde838ee43626a060c
47,513,273,508,976,070,000,000,000,000,000,000,000
8
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, ...
int fstatat_harder(int dfd, const char *filename, struct stat *ret, int fstatat_flags, RemoveFlags remove_flags) { mode_t old_mode; int r; /* Like unlink_harder() but does the same for fstatat() */ if (fstatat(dfd, filena...
0
[ "CWE-674" ]
systemd
5b1cf7a9be37e20133c0208005274ce4a5b5c6a1
218,574,784,186,882,400,000,000,000,000,000,000,000
31
shared/rm-rf: loop over nested directories instead of instead of recursing To remove directory structures, we need to remove the innermost items first, and then recursively remove higher-level directories. We would recursively descend into directories and invoke rm_rf_children and rm_rm_children_inner. This is problem...
static inline struct task_group *css_tg(struct cgroup_subsys_state *css) { return css ? container_of(css, struct task_group, css) : NULL; }
0
[ "CWE-119" ]
linux
29d6455178a09e1dc340380c582b13356227e8df
228,252,575,886,707,060,000,000,000,000,000,000,000
4
sched: panic on corrupted stack end Until now, hitting this BUG_ON caused a recursive oops (because oops handling involves do_exit(), which calls into the scheduler, which in turn raises an oops), which caused stuff below the stack to be overwritten until a panic happened (e.g. via an oops in interrupt context, cause...
static size_t __copy_page_to_iter(struct page *page, size_t offset, size_t bytes, struct iov_iter *i) { if (likely(iter_is_iovec(i))) return copy_page_to_iter_iovec(page, offset, bytes, i); if (iov_iter_is_bvec(i) || iov_iter_is_kvec(i) || iov_iter_is_xarray(i)) { void *kaddr = kmap_local_page(page); size_t...
0
[ "CWE-665", "CWE-284" ]
linux
9d2231c5d74e13b2a0546fee6737ee4446017903
211,577,595,348,579,600,000,000,000,000,000,000,000
22
lib/iov_iter: initialize "flags" in new pipe_buffer The functions copy_page_to_iter_pipe() and push_pipe() can both allocate a new pipe_buffer, but the "flags" member initializer is missing. Fixes: 241699cd72a8 ("new iov_iter flavour: pipe-backed") To: Alexander Viro <viro@zeniv.linux.org.uk> To: linux-fsdevel@vger.k...
inline SegmentWordCount SegmentReader::getSize() { return assumeBits<SEGMENT_WORD_COUNT_BITS>(ptr.size()) * WORDS; }
0
[ "CWE-20" ]
capnproto
52bc956459a5e83d7c31be95763ff6399e064ae4
144,602,104,263,520,740,000,000,000,000,000,000,000
3
SECURITY: Prevent compiler from eliding bounds checks. Details: https://github.com/sandstorm-io/capnproto/blob/master/security-advisories/2017-04-17-0-apple-32bit-elides-bounds-check.md
static int samldb_fill_foreignSecurityPrincipal_object(struct samldb_ctx *ac) { struct ldb_context *ldb = NULL; const struct ldb_val *rdn_value = NULL; struct ldb_message_element *sid_el = NULL; struct dom_sid *sid = NULL; struct ldb_control *as_system = NULL; struct ldb_control *provision = NULL; bool allowed =...
0
[ "CWE-200" ]
samba
0a3aa5f908e351201dc9c4d4807b09ed9eedff77
20,908,477,183,364,849,000,000,000,000,000,000,000
71
CVE-2022-32746 ldb: Make use of functions for appending to an ldb_message This aims to minimise usage of the error-prone pattern of searching for a just-added message element in order to make modifications to it (and potentially finding the wrong element). BUG: https://bugzilla.samba.org/show_bug.cgi?id=15009 Signed...
static void _slurm_rpc_composite_msg(slurm_msg_t *msg) { static time_t config_update = 0; static bool defer_sched = false; static int sched_timeout = 0; static int active_rpc_cnt = 0; struct timeval start_tv; bool run_scheduler = false; composite_msg_t *comp_msg, comp_resp_msg; /* Locks: Read configuration, wr...
0
[ "CWE-20" ]
slurm
033dc0d1d28b8d2ba1a5187f564a01c15187eb4e
84,828,715,847,941,580,000,000,000,000,000,000,000
89
Fix insecure handling of job requested gid. Only trust MUNGE signed values, unless the RPC was signed by SlurmUser or root. CVE-2018-10995.
int server_unref(SERVER_REC *server) { g_return_val_if_fail(IS_SERVER(server), FALSE); if (--server->refcount > 0) return TRUE; if (g_slist_find(servers, server) != NULL) { g_warning("Non-referenced server wasn't disconnected"); server_disconnect(server); return TRUE; } MODULE_DATA_DEINIT(server)...
0
[ "CWE-20" ]
irssi-proxy
85bbc05b21678e80423815d2ef1dfe26208491ab
37,307,882,505,687,157,000,000,000,000,000,000,000
25
Check if an SSL certificate matches the hostname of the server we are connecting to git-svn-id: http://svn.irssi.org/repos/irssi/trunk@5104 dbcabf3a-b0e7-0310-adc4-f8d773084564
void tipc_node_apply_property(struct net *net, struct tipc_bearer *b, int prop) { struct tipc_net *tn = tipc_net(net); int bearer_id = b->identity; struct sk_buff_head xmitq; struct tipc_link_entry *e; struct tipc_node *n; __skb_queue_head_init(&xmitq); rcu_read_lock(); list_for_each_entry_rcu(n, &t...
0
[]
linux
0217ed2848e8538bcf9172d97ed2eeb4a26041bb
183,488,716,847,796,260,000,000,000,000,000,000,000
33
tipc: better validate user input in tipc_nl_retrieve_key() Before calling tipc_aead_key_size(ptr), we need to ensure we have enough data to dereference ptr->keylen. We probably also want to make sure tipc_aead_key_size() wont overflow with malicious ptr->keylen values. Syzbot reported: BUG: KMSAN: uninit-value in _...
static int init_die(RzBinDwarfDie *die, ut64 abbr_code, ut64 attr_count) { if (!die) { return -1; } if (attr_count) { die->attr_values = calloc(sizeof(RzBinDwarfAttrValue), attr_count); if (!die->attr_values) { return -1; } } else { die->attr_values = NULL; } die->abbrev_code = abbr_code; die->capac...
0
[ "CWE-787" ]
rizin
aa6917772d2f32e5a7daab25a46c72df0b5ea406
336,275,182,042,911,140,000,000,000,000,000,000,000
17
Fix oob write for dwarf with abbrev with count 0 (Fix #2083) (#2086)
static int check_unshare_flags(unsigned long unshare_flags) { if (unshare_flags & ~(CLONE_THREAD|CLONE_FS|CLONE_NEWNS|CLONE_SIGHAND| CLONE_VM|CLONE_FILES|CLONE_SYSVSEM| CLONE_NEWUTS|CLONE_NEWIPC|CLONE_NEWNET| CLONE_NEWUSER|CLONE_NEWPID|CLONE_NEWCGROUP| CLONE_NEWTIME)) return -EINVAL; /* * Not impl...
0
[ "CWE-665", "CWE-362" ]
linux
b4e00444cab4c3f3fec876dc0cccc8cbb0d1a948
103,346,445,032,320,140,000,000,000,000,000,000,000
29
fork: fix copy_process(CLONE_PARENT) race with the exiting ->real_parent current->group_leader->exit_signal may change during copy_process() if current->real_parent exits. Move the assignment inside tasklist_lock to avoid the race. Signed-off-by: Eddy Wu <eddy_wu@trendmicro.com> Acked-by: Oleg Nesterov <oleg@redhat....