func
string
target
int64
cwe
list
project
string
commit_id
string
hash
float64
size
int64
message
string
is_not_included(Node* x, Node* y, regex_t* reg) { int i, len; OnigCodePoint code; UChar *p; int ytype; retry: ytype = NTYPE(y); switch (NTYPE(x)) { case NT_CTYPE: { switch (ytype) { case NT_CTYPE: if (NCTYPE(y)->ctype == NCTYPE(x)->ctype && NCTYPE(y)->not != NCTYPE(x)->not) re...
0
[ "CWE-125" ]
php-src
c6e34d91b88638966662caac62c4d0e90538e317
189,321,554,873,260,830,000,000,000,000,000,000,000
173
Fix bug #77371 (heap buffer overflow in mb regex functions - compile_string_node)
calc_binsize(char *bytes, int nbytes) { unsigned char *s = (unsigned char *)bytes; int i; size_t x = 0; if (nbytes > (int)sizeof(size_t)) { /* Check for integer overflow. BINBYTES8 and BINUNICODE8 opcodes * have 64-bit size that can't be represented on 32-bit platform. */ ...
0
[ "CWE-190", "CWE-369" ]
cpython
a4ae828ee416a66d8c7bf5ee71d653c2cc6a26dd
321,488,360,011,959,400,000,000,000,000,000,000,000
25
closes bpo-34656: Avoid relying on signed overflow in _pickle memos. (GH-9261)
setup_boot_information(struct archive_write *a) { struct iso9660 *iso9660 = a->format_data; struct isoent *np; int64_t size; uint32_t sum; unsigned char buff[4096]; np = iso9660->el_torito.boot; lseek(iso9660->temp_fd, np->file->content.offset_of_temp + 64, SEEK_SET); size = archive_entry_size(np->file->e...
0
[ "CWE-190" ]
libarchive
3014e19820ea53c15c90f9d447ca3e668a0b76c6
328,916,899,365,834,530,000,000,000,000,000,000,000
57
Issue 711: Be more careful about verifying filename lengths when writing ISO9660 archives * Don't cast size_t to int, since this can lead to overflow on machines where sizeof(int) < sizeof(size_t) * Check a + b > limit by writing it as a > limit || b > limit || a + b > limit to avoid problems when a + b wraps...
add_one_setting (GHashTable *settings, NMConnection *connection, NMSetting *setting, GError **error) { GHashTable *secrets; g_return_val_if_fail (settings != NULL, FALSE); g_return_val_if_fail (connection != NULL, FALSE); g_return_val_if_fail (setting != NULL, FAL...
1
[ "CWE-310" ]
network-manager-applet
4020594dfbf566f1852f0acb36ad631a9e73a82b
283,746,707,249,343,980,000,000,000,000,000,000,000
27
core: fix CA cert mishandling after cert file deletion (deb #560067) (rh #546793) If a connection was created with a CA certificate, but the user later moved or deleted that CA certificate, the applet would simply provide the connection to NetworkManager without any CA certificate. This could cause NM to connect to t...
static void fuse_lk_fill(struct fuse_args *args, struct file *file, const struct file_lock *fl, int opcode, pid_t pid, int flock, struct fuse_lk_in *inarg) { struct inode *inode = file_inode(file); struct fuse_conn *fc = get_fuse_conn(inode); struct fuse_file *ff = file->private_data; memset(inarg, 0, size...
0
[ "CWE-459" ]
linux
5d069dbe8aaf2a197142558b6fb2978189ba3454
282,920,405,418,443,240,000,000,000,000,000,000,000
23
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 emmh32_setseed(emmh32_context *context, u8 *pkey, int keylen, struct crypto_cipher *tfm) { /* take the keying material, expand if necessary, truncate at 16-bytes */ /* run through AES counter mode to generate context->coeff[] */ int i,j; u32 counter; u8 *cipher, plain[16]; crypto_cipher_se...
0
[ "CWE-703", "CWE-264" ]
linux
550fd08c2cebad61c548def135f67aba284c6162
115,319,632,923,636,880,000,000,000,000,000,000,000
27
net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared After the last patch, We are left in a state in which only drivers calling ether_setup have IFF_TX_SKB_SHARING set (we assume that drivers touching real hardware call ether_setup for their net_devices and don't hold any state in their skbs. There...
do_close_reader (ccid_driver_t handle) { int rc; unsigned char msg[100]; size_t msglen; unsigned char seqno; if (!handle->powered_off) { msg[0] = PC_to_RDR_IccPowerOff; msg[5] = 0; /* slot */ msg[6] = seqno = handle->seqno++; msg[7] = 0; /* RFU */ msg[8] = 0; /* RFU */ ...
0
[ "CWE-20" ]
gnupg
2183683bd633818dd031b090b5530951de76f392
336,538,761,872,231,300,000,000,000,000,000,000,000
36
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 ...
CImg<T>& XYZtoLab(const bool use_D65=true) { #define _cimg_Labf(x) (24389*(x)>216?cimg::cbrt(x):(24389*(x)/27 + 16)/116) if (_spectrum!=3) throw CImgInstanceException(_cimg_instance "XYZtoLab(): Instance is not a XYZ image.", cim...
0
[ "CWE-770" ]
cimg
619cb58dd90b4e03ac68286c70ed98acbefd1c90
226,713,726,486,446,030,000,000,000,000,000,000,000
25
CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size.
gdm_session_set_ignore_wayland (GdmSession *self, gboolean ignore_wayland) { self->priv->ignore_wayland = ignore_wayland; }
0
[]
gdm
5ac224602f1d603aac5eaa72e1760d3e33a26f0a
91,664,150,573,442,870,000,000,000,000,000,000,000
5
session: disconnect signals from worker proxy when conversation is freed We don't want an outstanding reference on the worker proxy to lead to signal handlers getting dispatched after the conversation is freed. https://bugzilla.gnome.org/show_bug.cgi?id=758032
JVM_ClassLoaderDepth(JNIEnv *env) { jint result; Trc_SC_ClassLoaderDepth_Entry(env); result = (*env)->CallStaticIntMethod(env, jlClass, classLoaderDepthMID); /* CMVC 95169: ensure that the result is a well defined error value if an exception occurred */ if ((*env)->ExceptionCheck(env)) { result = -1; } Trc...
0
[ "CWE-119" ]
openj9
0971f22d88f42cf7332364ad7430e9bd8681c970
162,925,155,109,306,830,000,000,000,000,000,000,000
17
Clean up jio_snprintf and jio_vfprintf Fixes https://bugs.eclipse.org/bugs/show_bug.cgi?id=543659 Signed-off-by: Peter Bain <peter_bain@ca.ibm.com>
static inline struct f_hid_opts *to_f_hid_opts(struct config_item *item) { return container_of(to_config_group(item), struct f_hid_opts, func_inst.group); }
0
[ "CWE-703", "CWE-667", "CWE-189" ]
linux
072684e8c58d17e853f8e8b9f6d9ce2e58d2b036
182,265,452,067,518,400,000,000,000,000,000,000,000
5
USB: gadget: f_hid: fix deadlock in f_hidg_write() In f_hidg_write() the write_spinlock is acquired before calling usb_ep_queue() which causes a deadlock when dummy_hcd is being used. This is because dummy_queue() callbacks into f_hidg_req_complete() which tries to acquire the same spinlock. This is (part of) the back...
void* hashbin_find_next( hashbin_t* hashbin, long hashv, const char* name, void ** pnext) { unsigned long flags = 0; irda_queue_t* entry; /* Synchronize */ spin_lock_irqsave(&hashbin->hb_spinlock, flags); /* * Search for current entry * This allow to check if the current item is still in the * hashbin ...
0
[ "CWE-200" ]
linux
4c03b862b12f980456f9de92db6d508a4999b788
253,860,891,337,969,600,000,000,000,000,000,000,000
30
irda: Fix lockdep annotations in hashbin_delete(). A nested lock depth was added to the hasbin_delete() code but it doesn't actually work some well and results in tons of lockdep splats. Fix the code instead to properly drop the lock around the operation and just keep peeking the head of the hashbin queue. Reported-...
static int __videobuf_mmap_mapper(struct videobuf_queue *q, struct vm_area_struct *vma) { struct videbuf_vmalloc_memory *mem; struct videobuf_mapping *map; unsigned int first; int retval; unsigned long offset = vma->vm_pgoff << PAGE_SHIFT; if (! (vma->vm_flags & VM_WRITE) || ! (vma->vm_flags & VM_SHARED)) ...
0
[ "CWE-119", "CWE-787" ]
linux
0b29669c065f60501e7289e1950fa2a618962358
178,666,625,546,657,220,000,000,000,000,000,000,000
70
V4L/DVB (6751): V4L: Memory leak! Fix count in videobuf-vmalloc mmap This is pretty serious bug. map->count is never initialized after the call to kmalloc making the count start at some random trash value. The end result is leaking videobufs. Also, fix up the debug statements to print unsigned values. Pushed to h...
static int proc_oom_score(struct task_struct *task, char *buffer) { unsigned long points; struct timespec uptime; do_posix_clock_monotonic_gettime(&uptime); read_lock(&tasklist_lock); points = badness(task->group_leader, uptime.tv_sec); read_unlock(&tasklist_lock); return sprintf(buffer, "%lu\n", points); }
0
[ "CWE-20", "CWE-362", "CWE-416" ]
linux
86acdca1b63e6890540fa19495cfc708beff3d8b
275,270,032,062,381,670,000,000,000,000,000,000,000
11
fix autofs/afs/etc. magic mountpoint breakage We end up trying to kfree() nd.last.name on open("/mnt/tmp", O_CREAT) if /mnt/tmp is an autofs direct mount. The reason is that nd.last_type is bogus here; we want LAST_BIND for everything of that kind and we get LAST_NORM left over from finding parent directory. So make...
static RList *r_bin_wasm_get_global_entries (RBinWasmObj *bin, RBinWasmSection *sec) { RList *ret = NULL; RBinWasmGlobalEntry *ptr = NULL; if (!(ret = r_list_newf ((RListFree)free))) { return NULL; } ut8* buf = bin->buf->buf + (ut32)sec->payload_data; int buflen = bin->buf->length - (ut32)sec->payload_data; ...
0
[ "CWE-125", "CWE-787" ]
radare2
d2632f6483a3ceb5d8e0a5fb11142c51c43978b4
67,515,894,569,830,750,000,000,000,000,000,000,000
36
Fix crash in fuzzed wasm r2_hoobr_consume_init_expr
static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, char *offset_base, size_t IFDlength, size_t displacement, int section_index, int ReadNextIFD, tag_table_type tag_table TSRMLS_DC) { size_t length; int tag, format, components; char *value_ptr, tagname[64], cbuf[32], *outside=NULL; size_t b...
1
[ "CWE-119" ]
php-src
eebcbd5de38a0f1c2876035402cb770e37476519
61,488,113,965,942,070,000,000,000,000,000,000,000
315
Fix bug #72603: Out of bound read in exif_process_IFD_in_MAKERNOTE
void drain_workqueue(struct workqueue_struct *wq) { unsigned int flush_cnt = 0; struct pool_workqueue *pwq; /* * __queue_work() needs to test whether there are drainers, is much * hotter than drain_workqueue() and already looks at @wq->flags. * Use __WQ_DRAINING so that queue doesn't have to check nr_drainers...
0
[ "CWE-200" ]
tip
dfb4357da6ddbdf57d583ba64361c9d792b0e0b1
145,875,007,821,095,580,000,000,000,000,000,000,000
42
time: Remove CONFIG_TIMER_STATS Currently CONFIG_TIMER_STATS exposes process information across namespaces: kernel/time/timer_list.c print_timer(): SEQ_printf(m, ", %s/%d", tmp, timer->start_pid); /proc/timer_list: #11: <0000000000000000>, hrtimer_wakeup, S:01, do_nanosleep, cron/2570 Given that the trac...
static php_stream_filter *php_iconv_stream_filter_factory_create(const char *name, zval *params, int persistent) { php_stream_filter *retval = NULL; php_iconv_stream_filter *inst; char *from_charset = NULL, *to_charset = NULL; size_t from_charset_len, to_charset_len; if ((from_charset = strchr(name, '.')) == NULL...
0
[ "CWE-125" ]
php-src
7cf7148a8f8f4f55fb04de2a517d740bb6253eac
33,829,975,899,843,067,000,000,000,000,000,000,000
42
Fix bug #78069 - Out-of-bounds read in iconv.c:_php_iconv_mime_decode() due to integer overflow
static void p54u_tx_dummy_cb(struct urb *urb) { }
0
[ "CWE-416" ]
linux
6e41e2257f1094acc37618bf6c856115374c6922
152,709,871,014,619,130,000,000,000,000,000,000,000
1
p54usb: Fix race between disconnect and firmware loading The syzbot fuzzer found a bug in the p54 USB wireless driver. The issue involves a race between disconnect and the firmware-loader callback routine, and it has several aspects. One big problem is that when the firmware can't be loaded, the callback routine tri...
// Conversion functions to get more precision when trying to store unsigned ints values as floats. inline unsigned int float2uint(const float f) { int tmp = 0; std::memcpy(&tmp,&f,sizeof(float)); if (tmp>=0) return (unsigned int)f; unsigned int u; // use memcpy instead of assignmen...
0
[ "CWE-119", "CWE-787" ]
CImg
ac8003393569aba51048c9d67e1491559877b1d1
22,041,873,545,760,883,000,000,000,000,000,000,000
9
.
REF_GetTaiOffset(struct timespec *ts) { int tai_offset; get_tz_leap(ts->tv_sec, &tai_offset); return tai_offset; }
0
[ "CWE-59" ]
chrony
e18903a6b56341481a2e08469c0602010bf7bfe3
101,129,753,951,399,440,000,000,000,000,000,000,000
8
switch to new util file functions Replace all fopen(), rename(), and unlink() calls with the new util functions.
static void tipc_aead_encrypt_done(struct crypto_async_request *base, int err) { struct sk_buff *skb = base->data; struct tipc_crypto_tx_ctx *tx_ctx = TIPC_SKB_CB(skb)->crypto_ctx; struct tipc_bearer *b = tx_ctx->bearer; struct tipc_aead *aead = tx_ctx->aead; struct tipc_crypto *tx = aead->crypto; struct net *net...
0
[ "CWE-20" ]
linux
fa40d9734a57bcbfa79a280189799f76c88f7bb0
175,044,904,763,259,200,000,000,000,000,000,000,000
31
tipc: fix size validations for the MSG_CRYPTO type The function tipc_crypto_key_rcv is used to parse MSG_CRYPTO messages to receive keys from other nodes in the cluster in order to decrypt any further messages from them. This patch verifies that any supplied sizes in the message body are valid for the received message...
static bool ide_bmdma_status_needed(void *opaque) { BMDMAState *bm = opaque; /* Older versions abused some bits in the status register for internal * error state. If any of these bits are set, we must add a subsection to * transfer the real status register */ uint8_t abused_bits = BM_MIGRATION_CO...
0
[ "CWE-399" ]
qemu
3251bdcf1c67427d964517053c3d185b46e618e8
162,215,665,565,727,930,000,000,000,000,000,000,000
11
ide: Correct handling of malformed/short PRDTs This impacts both BMDMA and AHCI HBA interfaces for IDE. Currently, we confuse the difference between a PRDT having "0 bytes" and a PRDT having "0 complete sectors." When we receive an incomplete sector, inconsistent error checking leads to an infinite loop wherein the c...
void __ext4_error(struct super_block *sb, const char *function, unsigned int line, const char *fmt, ...) { struct va_format vaf; va_list args; va_start(args, fmt); vaf.fmt = fmt; vaf.va = &args; printk(KERN_CRIT "EXT4-fs error (device %s): %s:%d: comm %s: %pV\n", sb->s_id, function, line, current->co...
0
[ "CWE-703", "CWE-189" ]
linux
d50f2ab6f050311dbf7b8f5501b25f0bf64a439b
194,761,498,606,843,180,000,000,000,000,000,000,000
15
ext4: fix undefined behavior in ext4_fill_flex_info() Commit 503358ae01b70ce6909d19dd01287093f6b6271c ("ext4: avoid divide by zero when trying to mount a corrupted file system") fixes CVE-2009-4307 by performing a sanity check on s_log_groups_per_flex, since it can be set to a bogus value by an attacker. sbi->s_log_...
unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *buf, unsigned char *limit) { int extdatalen = 0; unsigned char *orig = buf; unsigned char *ret = buf; /* don't add extensions for SSLv3 unless doing secure renegotiation */ if (s->client_versi...
0
[ "CWE-190" ]
openssl
6f35f6deb5ca7daebe289f86477e061ce3ee5f46
157,490,665,764,784,720,000,000,000,000,000,000,000
335
Avoid some undefined pointer arithmetic A common idiom in the codebase is: if (p + len > limit) { return; /* Too long */ } Where "p" points to some malloc'd data of SIZE bytes and limit == p + SIZE "len" here could be from some externally supplied data (e.g. from a TLS message). The rules of C pointer arithmet...
smb2_writev_callback(struct mid_q_entry *mid) { struct cifs_writedata *wdata = mid->callback_data; struct cifs_tcon *tcon = tlink_tcon(wdata->cfile->tlink); struct TCP_Server_Info *server = tcon->ses->server; unsigned int written; struct smb2_write_rsp *rsp = (struct smb2_write_rsp *)mid->resp_buf; unsigned int c...
0
[ "CWE-476" ]
linux
cabfb3680f78981d26c078a26e5c748531257ebb
131,456,722,440,913,880,000,000,000,000,000,000,000
49
CIFS: Enable encryption during session setup phase In order to allow encryption on SMB connection we need to exchange a session key and generate encryption and decryption keys. Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
png_write_complete_chunk(png_structrp png_ptr, png_uint_32 chunk_name, png_const_bytep data, png_size_t length) { if (png_ptr == NULL) return; /* On 64-bit architectures 'length' may not fit in a png_uint_32. */ if (length > PNG_UINT_31_MAX) png_error(png_ptr, "length exceeds PNG maximum"); ...
0
[ "CWE-120" ]
libpng
81f44665cce4cb1373f049a76f3904e981b7a766
275,239,196,856,767,470,000,000,000,000,000,000,000
14
[libpng16] Reject attempt to write over-length PLTE chunk
SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages, const void __user * __user *, pages, const int __user *, nodes, int __user *, status, int, flags) { struct task_struct *task; struct mm_struct *mm; int err; nodemask_t task_nodes; /* Check flags */ if (flags & ~(MPOL_MF_MOVE|MPOL_MF_MOVE_ALL)...
0
[ "CWE-200" ]
linux
197e7e521384a23b9e585178f3f11c9fa08274b9
176,520,029,621,864,580,000,000,000,000,000,000,000
61
Sanitize 'move_pages()' permission checks The 'move_paghes()' system call was introduced long long ago with the same permission checks as for sending a signal (except using CAP_SYS_NICE instead of CAP_SYS_KILL for the overriding capability). That turns out to not be a great choice - while the system call really only ...
Item *st_select_lex::pushdown_from_having_into_where(THD *thd, Item *having) { if (!having || !group_list.first) return having; if (!cond_pushdown_is_allowed()) return having; st_select_lex *save_curr_select= thd->lex->current_select; thd->lex->current_select= this; /* 1. Collect fields used in ...
0
[ "CWE-703" ]
server
39feab3cd31b5414aa9b428eaba915c251ac34a2
169,556,635,746,159,570,000,000,000,000,000,000,000
102
MDEV-26412 Server crash in Item_field::fix_outer_field for INSERT SELECT IF an INSERT/REPLACE SELECT statement contained an ON expression in the top level select and this expression used a subquery with a column reference that could not be resolved then an attempt to resolve this reference as an outer reference caused...
void xenvif_idx_unmap(struct xenvif *vif, u16 pending_idx) { int ret; struct gnttab_unmap_grant_ref tx_unmap_op; gnttab_set_unmap_op(&tx_unmap_op, idx_to_kaddr(vif, pending_idx), GNTMAP_host_map, vif->grant_tx_handle[pending_idx]); xenvif_grant_handle_reset(vif, pending_idx); ret = gnttab_un...
0
[ "CWE-399" ]
net-next
e9d8b2c2968499c1f96563e6522c56958d5a1d0d
111,965,781,255,945,300,000,000,000,000,000,000,000
26
xen-netback: disable rogue vif in kthread context When netback discovers frontend is sending malformed packet it will disables the interface which serves that frontend. However disabling a network interface involving taking a mutex which cannot be done in softirq context, so we need to defer this process to kthread c...
struct fib6_info *fib6_info_alloc(gfp_t gfp_flags, bool with_fib6_nh) { struct fib6_info *f6i; size_t sz = sizeof(*f6i); if (with_fib6_nh) sz += sizeof(struct fib6_nh); f6i = kzalloc(sz, gfp_flags); if (!f6i) return NULL; /* fib6_siblings is a union with nh_list, so this initializes both */ INIT_LIST_HEAD...
0
[ "CWE-755" ]
linux
7b09c2d052db4b4ad0b27b97918b46a7746966fa
256,126,384,948,669,200,000,000,000,000,000,000,000
18
ipv6: fix a typo in fib6_rule_lookup() Yi Ren reported an issue discovered by syzkaller, and bisected to the cited commit. Many thanks to Yi, this trivial patch does not reflect the patient work that has been done. Fixes: d64a1f574a29 ("ipv6: honor RT6_LOOKUP_F_DST_NOREF in rule lookup logic") Signed-off-by: Eric Du...
STATIC word GC_parse_mem_size_arg(const char *str) { char *endptr; word result = 0; /* bad value */ char ch; if (*str != '\0') { result = (word)STRTOULL(str, &endptr, 10); ch = *endptr; if (ch != '\0') { if (*(endptr + 1) != '\0') return 0; /* Allow k, M or G suffix. */ sw...
0
[ "CWE-119" ]
bdwgc
7292c02fac2066d39dd1bcc37d1a7054fd1e32ee
244,377,051,437,062,670,000,000,000,000,000,000,000
33
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...
TEST_F(RouterTest, Http1Upstream) { EXPECT_CALL(cm_.thread_local_cluster_, httpConnPool(_, absl::optional<Http::Protocol>(), _)); EXPECT_CALL(cm_.thread_local_cluster_.conn_pool_, newStream(_, _)) .WillOnce(Return(&cancellable_)); expectResponseTimerCreate(); Http::TestRequestHeaderMapImpl headers; Htt...
0
[ "CWE-703" ]
envoy
18871dbfb168d3512a10c78dd267ff7c03f564c6
330,049,577,766,239,500,000,000,000,000,000,000,000
20
[1.18] CVE-2022-21655 Crash with direct_response Signed-off-by: Otto van der Schaaf <ovanders@redhat.com>
ex_fixup_addr(const struct exception_table_entry *x) { return (unsigned long)&x->fixup + x->fixup; }
0
[ "CWE-264" ]
linux
548acf19234dbda5a52d5a8e7e205af46e9da840
2,217,674,993,916,287,400,000,000,000,000,000,000
4
x86/mm: Expand the exception table logic to allow new handling options Huge amounts of help from Andy Lutomirski and Borislav Petkov to produce this. Andy provided the inspiration to add classes to the exception table with a clever bit-squeezing trick, Boris pointed out how much cleaner it would all be if we just had...
rb_str_upto(beg, end, excl) VALUE beg, end; int excl; { VALUE current, after_end; ID succ = rb_intern("succ"); int n; StringValue(end); n = rb_str_cmp(beg, end); if (n > 0 || (excl && n == 0)) return beg; after_end = rb_funcall(end, succ, 0, 0); current = beg; while (!rb_str...
0
[ "CWE-20" ]
ruby
e926ef5233cc9f1035d3d51068abe9df8b5429da
257,349,509,929,389,600,000,000,000,000,000,000,000
26
* 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 int check_newline(const char *progname, const char *name) { const char *s; for (s = "\n"; *s; s++) { if (strchr(name, *s)) { fprintf(stderr, "%s: illegal character 0x%02x in mount entry\n", progname, *s); return EX_USAGE; } } return 0; }
0
[ "CWE-20" ]
cifs-utils
f6eae44a3d05b6515a59651e6bed8b6dde689aec
25,595,386,687,961,840,000,000,000,000,000,000,000
13
mtab: handle ENOSPC/EFBIG condition properly when altering mtab It's possible that when mount.cifs goes to append the mtab that there won't be enough space to do so, and the mntent won't be appended to the file in its entirety. Add a my_endmntent routine that will fflush and then fsync the FILE if that succeeds. If e...
Section* Binary::get_section(const std::string& name) { return const_cast<Section*>(static_cast<const Binary*>(this)->get_section(name)); }
0
[ "CWE-703" ]
LIEF
7acf0bc4224081d4f425fcc8b2e361b95291d878
99,379,912,079,919,020,000,000,000,000,000,000,000
3
Resolve #764
static void negotiate_ContextFree(NEGOTIATE_CONTEXT* context) { WINPR_ASSERT(context); if (context->mechTypes.pvBuffer) free(context->mechTypes.pvBuffer); free(context); }
0
[]
FreeRDP
479e891545473f01c187daffdfa05fc752b54b72
236,814,369,345,794,400,000,000,000,000,000,000,000
8
check return values for SetCredentialsAttributes, throw warnings for unsupported attributes
static int vrend_renderer_transfer_write_iov(struct vrend_context *ctx, struct vrend_resource *res, const struct iovec *iov, int num_iovs, const struct vrend_transfer_info *info) { v...
1
[ "CWE-787" ]
virglrenderer
95e581fd181b213c2ed7cdc63f2abc03eaaa77ec
140,511,337,496,817,300,000,000,000,000,000,000,000
266
vrend: Add test to resource OOB write and fix it v2: Also check that no depth != 1 has been send when none is due Closes: #250 Signed-off-by: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
TEST_F(NgramKernelTest, ShapeFn) { ShapeInferenceTestOp op("StringNGrams"); INFER_OK(op, "?;?", "[?];[?]"); INFER_OK(op, "[1];?", "[?];[?]"); INFER_OK(op, "[1];[2]", "[?];in1"); INFER_ERROR("Shape must be rank 1 but is rank 0", op, "[];?"); INFER_ERROR("Shape must be rank 1 but is rank 0", op, "?;[]"); }
0
[ "CWE-703", "CWE-787" ]
tensorflow
ba424dd8f16f7110eea526a8086f1a155f14f22b
174,400,838,422,448,320,000,000,000,000,000,000,000
8
Enhance validation of ngram op and handle case of 0 tokens. PiperOrigin-RevId: 369940178 Change-Id: Ia82f42c09d14efe76e7dc013505b832a42282f0b
static void write_png_palette(int idx, uint32_t pix, void *opaque) { struct palette_cb_priv *priv = opaque; VncState *vs = priv->vs; png_colorp color = &priv->png_palette[idx]; if (vs->tight.pixel24) { color->red = (pix >> vs->client_pf.rshift) & vs->client_pf.rmax; color->green = (...
1
[ "CWE-401" ]
qemu
6bf21f3d83e95bcc4ba35a7a07cc6655e8b010b0
321,087,664,626,072,800,000,000,000,000,000,000,000
27
vnc: fix memory leak when vnc disconnect Currently when qemu receives a vnc connect, it creates a 'VncState' to represent this connection. In 'vnc_worker_thread_loop' it creates a local 'VncState'. The connection 'VcnState' and local 'VncState' exchange data in 'vnc_async_encoding_start' and 'vnc_async_encoding_end'. ...
static int snd_rawmidi_dev_free(struct snd_device *device) { struct snd_rawmidi *rmidi = device->device_data; return snd_rawmidi_free(rmidi); }
0
[ "CWE-416" ]
linux
c1f6e3c818dd734c30f6a7eeebf232ba2cf3181d
288,253,063,045,586,470,000,000,000,000,000,000,000
6
ALSA: rawmidi: Fix racy buffer resize under concurrent accesses The rawmidi core allows user to resize the runtime buffer via ioctl, and this may lead to UAF when performed during concurrent reads or writes: the read/write functions unlock the runtime lock temporarily during copying form/to user-space, and that's the ...
e_ews_connection_download_oal_file_finish (EEwsConnection *cnc, GAsyncResult *result, GError **error) { GSimpleAsyncResult *simple; g_return_val_if_fail (cnc != NULL, FALSE); g_return_val_if_fail ( g_simple_async_result_is_valid...
0
[ "CWE-295" ]
evolution-ews
915226eca9454b8b3e5adb6f2fff9698451778de
267,866,410,861,692,600,000,000,000,000,000,000,000
17
I#27 - SSL Certificates are not validated This depends on https://gitlab.gnome.org/GNOME/evolution-data-server/commit/6672b8236139bd6ef41ecb915f4c72e2a052dba5 too. Closes https://gitlab.gnome.org/GNOME/evolution-ews/issues/27
static VALUE cState_generate(VALUE self, VALUE obj) { VALUE result = cState_partial_generate(self, obj); GET_STATE(self); (void)state; return result; }
0
[ "CWE-119", "CWE-787" ]
json
8f782fd8e181d9cfe9387ded43a5ca9692266b85
122,711,901,025,837,380,000,000,000,000,000,000,000
7
Fix arbitrary heap exposure problem
apr_byte_t oidc_cache_set(request_rec *r, const char *section, const char *key, const char *value, apr_time_t expiry) { oidc_cfg *cfg = ap_get_module_config(r->server->module_config, &auth_openidc_module); int encrypted = oidc_cfg_cache_encrypt(r); char *encoded = NULL; apr_byte_t rc = FALSE; char *msg = NUL...
0
[ "CWE-330" ]
mod_auth_openidc
375407c16c61a70b56fdbe13b0d2c8f11398e92c
87,449,017,958,523,180,000,000,000,000,000,000,000
45
use encrypted JWTs for storing encrypted cache contents - avoid using static AAD/IV; thanks @niebardzo - bump to 2.4.9-dev Signed-off-by: Hans Zandbelt <hans.zandbelt@zmartzone.eu>
static int get_descriptor_addr(struct edgeport_serial *serial, int desc_type, struct ti_i2c_desc *rom_desc) { int start_address; int status; /* Search for requested descriptor in I2C */ start_address = 2; do { status = read_rom(serial, start_address, sizeof(struct ti_i2c_desc), (__u8 *)...
0
[ "CWE-284", "CWE-264" ]
linux
1ee0a224bc9aad1de496c795f96bc6ba2c394811
237,540,548,365,450,270,000,000,000,000,000,000,000
26
USB: io_ti: Fix NULL dereference in chase_port() The tty is NULL when the port is hanging up. chase_port() needs to check for this. This patch is intended for stable series. The behavior was observed and tested in Linux 3.2 and 3.7.1. Johan Hovold submitted a more elaborate patch for the mainline kernel. [ 56.277...
MagickExport const char *GetMagickQuantumDepth(size_t *depth) { if (depth != (size_t *) NULL) *depth=(size_t) MAGICKCORE_QUANTUM_DEPTH; return(MagickQuantumDepth); }
0
[ "CWE-190", "CWE-189", "CWE-703" ]
ImageMagick
0f6fc2d5bf8f500820c3dbcf0d23ee14f2d9f734
129,417,225,913,390,620,000,000,000,000,000,000,000
6
TEST_P(ProtocolIntegrationTest, ComputedHealthCheck) { config_helper_.addFilter(R"EOF( name: health_check typed_config: "@type": type.googleapis.com/envoy.config.filter.http.health_check.v2.HealthCheck pass_through_mode: false cluster_min_healthy_percentages: example_cluster_name: { value: 75 } )E...
0
[ "CWE-770" ]
envoy
7ca28ff7d46454ae930e193d97b7d08156b1ba59
235,908,473,082,026,280,000,000,000,000,000,000,000
19
[http1] Include request URL in request header size computation, and reject partial headers that exceed configured limits (#145) Signed-off-by: antonio <avd@google.com>
TEST_F(QueryPlannerTest, MultikeySharedPrefixNoIntersectOutsideElemMatch) { // true means multikey addIndex(BSON("a.b" << 1 << "a.c" << 1), true); runQuery(fromjson("{'a.b': 1, a: {$elemMatch: {b: {$gt: 0}, c: 1}}}")); assertNumSolutions(3U); assertSolutionExists("{cscan: {dir: 1}}"); assertSol...
0
[ "CWE-834" ]
mongo
94d0e046baa64d1aa1a6af97e2d19bb466cc1ff5
198,376,235,245,739,270,000,000,000,000,000,000,000
16
SERVER-38164 $or pushdown optimization does not correctly handle $not within an $elemMatch
static void free_user(struct kref *ref) { struct ipmi_user *user = container_of(ref, struct ipmi_user, refcount); /* SRCU cleanup must happen in task context. */ schedule_work(&user->remove_work); }
0
[ "CWE-400", "CWE-401" ]
linux
4aa7afb0ee20a97fbf0c5bab3df028d5fb85fdab
279,790,738,804,706,640,000,000,000,000,000,000,000
7
ipmi: Fix memory leak in __ipmi_bmc_register In the impelementation of __ipmi_bmc_register() the allocated memory for bmc should be released in case ida_simple_get() fails. Fixes: 68e7e50f195f ("ipmi: Don't use BMC product/dev ids in the BMC name") Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com> Message-Id...
void bigint_add3(word z[], const word x[], size_t x_size, const word y[], size_t y_size) { z[(x_size > y_size ? x_size : y_size)] += bigint_add3_nc(z, x, x_size, y, y_size); }
0
[ "CWE-200" ]
botan
bcf13fa153a11b3e0ad54e2af6962441cea3adf1
273,108,477,830,458,900,000,000,000,000,000,000,000
6
Fixes for CVE-2015-7827 and CVE-2016-2849
authentic_write_binary(struct sc_card *card, unsigned int idx, const unsigned char *buf, size_t count, unsigned long flags) { struct sc_context *ctx = card->ctx; struct sc_apdu apdu; size_t sz, rest; int rv = SC_SUCCESS; LOG_FUNC_CALLED(ctx); sc_log(ctx, "offs:%i,count:%"SC_FORMAT_LEN_SIZE_T"u,max_send...
0
[ "CWE-125" ]
OpenSC
8fe377e93b4b56060e5bbfb6f3142ceaeca744fa
249,827,336,115,244,970,000,000,000,000,000,000,000
40
fixed out of bounds reads Thanks to Eric Sesterhenn from X41 D-SEC GmbH for reporting and suggesting security fixes.
pjmedia_sdp_bandw_clone (pj_pool_t *pool, const pjmedia_sdp_bandw *rhs) { pjmedia_sdp_bandw *b = PJ_POOL_ALLOC_T(pool, pjmedia_sdp_bandw); if (!b) return NULL; if (!pj_strdup (pool, &b->modifier, &rhs->modifier)) return NULL; b->value = rhs->value; return b; }
0
[ "CWE-121", "CWE-120", "CWE-787" ]
pjproject
560a1346f87aabe126509bb24930106dea292b00
253,342,315,874,342,400,000,000,000,000,000,000,000
11
Merge pull request from GHSA-f5qg-pqcg-765m
void setGenericCommand(client *c, int flags, robj *key, robj *val, robj *expire, int unit, robj *ok_reply, robj *abort_reply) { long long milliseconds = 0, when = 0; /* initialized to avoid any harmness warning */ if (expire) { if (getLongLongFromObjectOrReply(c, expire, &milliseconds, NULL) != C_OK) ...
0
[ "CWE-190" ]
redis
92e3b1802f72ca0c5b0bde97f01d9b57a758d85c
303,786,546,363,084,870,000,000,000,000,000,000,000
77
Fix integer overflow in STRALGO LCS (CVE-2021-29477) An integer overflow bug in Redis version 6.0 or newer could be exploited using the STRALGO LCS command to corrupt the heap and potentially result with remote code execution. (cherry picked from commit f0c5f920d0f88bd8aa376a2c05af4902789d1ef9)
HBasicBlock* block() { return block_; }
0
[]
node
fd80a31e0697d6317ce8c2d289575399f4e06d21
7,977,499,245,432,839,000,000,000,000,000,000,000
1
deps: backport 5f836c from v8 upstream Original commit message: Fix Hydrogen bounds check elimination When combining bounds checks, they must all be moved before the first load/store that they are guarding. BUG=chromium:344186 LOG=y R=svenpanne@chromium.org Review URL: https://coderevie...
static inline bool shuffle_freelist(struct kmem_cache *s, struct page *page) { return false; }
0
[]
linux
fd4d9c7d0c71866ec0c2825189ebd2ce35bd95b8
145,345,279,651,930,370,000,000,000,000,000,000,000
4
mm: slub: add missing TID bump in kmem_cache_alloc_bulk() When kmem_cache_alloc_bulk() attempts to allocate N objects from a percpu freelist of length M, and N > M > 0, it will first remove the M elements from the percpu freelist, then call ___slab_alloc() to allocate the next element and repopulate the percpu freelis...
RSA *get_public_key() { return m_public_key; }
0
[]
mysql-server
25d1b7e03b9b375a243fabdf0556c063c7282361
29,242,172,329,355,115,000,000,000,000,000,000,000
4
Bug #22722946: integer overflow may lead to wrong results in get_56_lenc_string
GF_Err gf_node_list_append_child(GF_ChildNodeItem **list, GF_ChildNodeItem **last_child, GF_Node *n) { GF_ChildNodeItem *child, *cur; child = *list; cur = (GF_ChildNodeItem*) gf_malloc(sizeof(GF_ChildNodeItem)); if (!cur) return GF_OUT_OF_MEM; cur->node = n; cur->next = NULL; if (!child) { *list = cur; *l...
0
[ "CWE-416" ]
gpac
9723dd0955894f2cb7be13b94cf7a47f2754b893
229,698,429,539,205,600,000,000,000,000,000,000,000
26
fixed #2109
parser_abort_parsing_after_assignment_expression (parser_context_t *context_p) { return (context_p->token.type != LEXER_RIGHT_PAREN && context_p->token.type != LEXER_COMMA); } /* parser_abort_parsing_after_assignment_expression */
0
[ "CWE-416" ]
jerryscript
3bcd48f72d4af01d1304b754ef19fe1a02c96049
198,969,334,690,569,460,000,000,000,000,000,000,000
5
Improve parse_identifier (#4691) Ascii string length is no longer computed during string allocation. JerryScript-DCO-1.0-Signed-off-by: Daniel Batiz batizjob@gmail.com
int security_setprocattr(struct task_struct *p, char *name, void *value, size_t size) { return security_ops->setprocattr(p, name, value, size); }
0
[]
linux-2.6
ee18d64c1f632043a02e6f5ba5e045bb26a5465f
5,910,057,653,966,755,000,000,000,000,000,000,000
4
KEYS: Add a keyctl to install a process's session keyring on its parent [try #6] Add a keyctl to install a process's session keyring onto its parent. This replaces the parent's session keyring. Because the COW credential code does not permit one process to change another process's credentials directly, the change is...
static void slice_range_to_mask(unsigned long start, unsigned long len, struct slice_mask *ret) { unsigned long end = start + len - 1; ret->low_slices = 0; bitmap_zero(ret->high_slices, SLICE_NUM_HIGH); if (start < SLICE_LOW_TOP) { unsigned long mend = min(end, (SLICE_LOW_TOP - 1)); ret->low_slices = (1u...
0
[ "CWE-119" ]
linux
1be7107fbe18eed3e319a6c3e83c78254b693acb
29,875,639,044,537,550,000,000,000,000,000,000,000
23
mm: larger stack guard gap, between vmas Stack guard page is a useful feature to reduce a risk of stack smashing into a different mapping. We have been using a single page gap which is sufficient to prevent having stack adjacent to a different mapping. But this seems to be insufficient in the light of the stack usage ...
*/ static int io_cqring_wait(struct io_ring_ctx *ctx, int min_events, const sigset_t __user *sig, size_t sigsz, struct __kernel_timespec __user *uts) { struct io_wait_queue iowq = { .wq = { .private = current, .func = io_wake_function, .entry = LIST_HEAD_INIT(iowq.wq.entry), }, .ctx = ctx,...
0
[ "CWE-667" ]
linux
3ebba796fa251d042be42b929a2d916ee5c34a49
267,993,340,130,126,500,000,000,000,000,000,000,000
60
io_uring: ensure that SQPOLL thread is started for exit If we create it in a disabled state because IORING_SETUP_R_DISABLED is set on ring creation, we need to ensure that we've kicked the thread if we're exiting before it's been explicitly disabled. Otherwise we can run into a deadlock where exit is waiting go park t...
static int exitcode_proc_show(struct seq_file *m, void *v) { int val; /* * Save uml_exitcode in a local so that we don't need to guarantee * that sprintf accesses it atomically. */ val = uml_exitcode; seq_printf(m, "%d\n", val); return 0; }
0
[ "CWE-399", "CWE-119" ]
linux
201f99f170df14ba52ea4c52847779042b7a623b
260,659,395,187,092,940,000,000,000,000,000,000,000
12
uml: check length in exitcode_proc_write() We don't cap the size of buffer from the user so we could write past the end of the array here. Only root can write to this file. Reported-by: Nico Golde <nico@ngolde.de> Reported-by: Fabian Yamaguchi <fabs@goesec.de> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> ...
flatpak_dir_current_ref (FlatpakDir *self, const char *name, GCancellable *cancellable) { g_autoptr(GFile) base = NULL; g_autoptr(GFile) dir = NULL; g_autoptr(GFile) current_link = NULL; g_autoptr(GFileInfo) file_info = NULL; FlatpakDecomposed *decomposed;...
0
[ "CWE-74" ]
flatpak
fb473cad801c6b61706353256cab32330557374a
106,131,547,419,389,710,000,000,000,000,000,000,000
29
dir: Pass environment via bwrap --setenv when running apply_extra This means we can systematically pass the environment variables through bwrap(1), even if it is setuid and thus is filtering out security-sensitive environment variables. bwrap ends up being run with an empty environment instead. As with the previous c...
decodeJsonInternal(void *dst, const UA_DataType *type, CtxJson *ctx, ParseCtx *parseCtx, UA_Boolean moveToken) { return decodeJsonJumpTable[type->typeKind](dst, type, ctx, parseCtx, moveToken); }
0
[ "CWE-703", "CWE-787" ]
open62541
c800e2987b10bb3af6ef644b515b5d6392f8861d
215,255,117,178,334,600,000,000,000,000,000,000,000
5
fix(json): Check max recursion depth in more places
int ssl_session_reset( ssl_context *ssl ) { int ret; ssl->state = SSL_HELLO_REQUEST; ssl->renegotiation = SSL_INITIAL_HANDSHAKE; ssl->secure_renegotiation = SSL_LEGACY_RENEGOTIATION; ssl->verify_data_len = 0; memset( ssl->own_verify_data, 0, 36 ); memset( ssl->peer_verify_data, 0, 36 ); ...
0
[ "CWE-310" ]
polarssl
4582999be608c9794d4518ae336b265084db9f93
265,904,175,311,205,050,000,000,000,000,000,000,000
55
Fixed timing difference resulting from badly formatted padding.
static void ssl_cipher_get_disabled(unsigned long *mkey, unsigned long *auth, unsigned long *enc, unsigned long *mac, unsigned long *ssl) { *mkey = 0; *auth = 0; *enc = 0; *mac = 0; *ssl = 0; #ifdef OPENSSL_NO_RSA *mkey |= SSL_kRSA; *auth |= SSL_aRSA; #endif #ifdef OPENSSL_NO_DSA *auth |= SSL_aDSS; #endif #if...
0
[]
openssl
0ffa49970b9f8ea66b43ce2eb7f8fd523b65bc2c
322,039,947,913,276,800,000,000,000,000,000,000,000
77
Backport support for fixed DH ciphersuites (from HEAD)
void Commissioner::HandleJoinerFinalize(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo) { static_cast<Commissioner *>(aContext)->HandleJoinerFinalize(*static_cast<Coap::Message *>(aMessage), *static_cast<const Ip6::MessageInfo *...
0
[ "CWE-787" ]
openthread
c3a3a0c424322009fec3ab735fb20ce8f6e19e70
290,246,663,017,674,340,000,000,000,000,000,000,000
5
[commissioner] use strnlen instead of strlen (#4404)
bgp_attr_cluster_list (struct bgp_attr_parser_args *args) { struct peer *const peer = args->peer; struct attr *const attr = args->attr; const bgp_size_t length = args->length; /* Check length. */ if (length % 4) { zlog (peer->log, LOG_ERR, "Bad cluster list length %d", length); return bgp...
0
[]
quagga
8794e8d229dc9fe29ea31424883433d4880ef408
314,388,165,890,506,500,000,000,000,000,000,000,000
25
bgpd: Fix regression in args consolidation, total should be inited from args * bgp_attr.c: (bgp_attr_unknown) total should be initialised from the args.
TEST(InMatchExpression, MatchesArrayValue) { BSONObj operand = BSON_ARRAY(5); InMatchExpression in("a"); std::vector<BSONElement> equalities{operand.firstElement()}; ASSERT_OK(in.setEqualities(std::move(equalities))); ASSERT(in.matchesBSON(BSON("a" << BSON_ARRAY(5.0 << 6)), NULL)); ASSERT(!in.m...
0
[]
mongo
64095239f41e9f3841d8be9088347db56d35c891
226,300,102,127,799,700,000,000,000,000,000,000,000
10
SERVER-51083 Reject invalid UTF-8 from $regex match expressions
int unit_name_path_escape(const char *f, char **ret) { char *p, *s; assert(f); assert(ret); p = strdupa(f); if (!p) return -ENOMEM; path_simplify(p, false); if (empty_or_root(p)) s = strdup("-"); else { i...
1
[ "CWE-703" ]
systemd-stable
b00674347337b7531c92fdb65590ab253bb57538
185,422,117,112,056,270,000,000,000,000,000,000,000
32
basic/unit-name: do not use strdupa() on a path The path may have unbounded length, for example through a fuse mount. CVE-2021-33910: attacked controlled alloca() leads to crash in systemd and ultimately a kernel panic. Systemd parses the content of /proc/self/mountinfo and each mountpoint is passed to mount_setup_un...
xmlBufferFree(xmlBufferPtr buf) { if (buf == NULL) { #ifdef DEBUG_BUFFER xmlGenericError(xmlGenericErrorContext, "xmlBufferFree: buf == NULL\n"); #endif return; } if ((buf->alloc == XML_BUFFER_ALLOC_IO) && (buf->contentIO != NULL)) { xmlFree(buf->contentIO); } else if ((buf->...
0
[ "CWE-20" ]
libxml2
bdd66182ef53fe1f7209ab6535fda56366bd7ac9
212,122,579,222,974,420,000,000,000,000,000,000,000
18
Avoid building recursive entities For https://bugzilla.gnome.org/show_bug.cgi?id=762100 When we detect a recusive entity we should really not build the associated data, moreover if someone bypass libxml2 fatal errors and still tries to serialize a broken entity make sure we don't risk to get ito a recursion * parser...
static int ipv4ll_recv_arp_packet(GDHCPClient *dhcp_client) { int bytes; struct ether_arp arp; uint32_t ip_requested; int source_conflict; int target_conflict; guint timeout_ms; memset(&arp, 0, sizeof(arp)); bytes = read(dhcp_client->listener_sockfd, &arp, sizeof(arp)); if (bytes < 0) return bytes; if (ar...
0
[]
connman
a74524b3e3fad81b0fd1084ffdf9f2ea469cd9b1
295,286,129,642,750,700,000,000,000,000,000,000,000
73
gdhcp: Avoid leaking stack data via unitiialized variable Fixes: CVE-2021-26676
CAMLprim value caml_string_compare(value s1, value s2) { mlsize_t len1, len2; int res; if (s1 == s2) return Val_int(0); len1 = caml_string_length(s1); len2 = caml_string_length(s2); res = memcmp(String_val(s1), String_val(s2), len1 <= len2 ? len1 : len2); if (res < 0) return Val_int(-1); if (res > 0) r...
0
[ "CWE-200" ]
ocaml
659615c7b100a89eafe6253e7a5b9d84d0e8df74
127,077,138,175,294,840,000,000,000,000,000,000,000
15
fix PR#7003 and a few other bugs caused by misuse of Int_val git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16525 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
static int server_ssl_init(gnutls_session_t *session, int client_fd) { int res; if (*session != NULL) { gnutls_deinit(*session); *session = NULL; } if ((res = gnutls_init(session, GNUTLS_SERVER)) != GNUTLS_E_SUCCESS) goto fail; if ((res = gnutls_set_default_priority(*session)) != GNUTLS_E_SUCCESS) goto ...
0
[ "CWE-310" ]
libgadu
d882b15661ee94949919ebbbc43edf0db5f619cb
285,380,973,411,845,800,000,000,000,000,000,000,000
30
Odkąd biblioteka weryfikuje certyfikaty ciężko testować z self-signed.
gst_mpegts_section_get_pat (GstMpegtsSection * section) { g_return_val_if_fail (section->section_type == GST_MPEGTS_SECTION_PAT, NULL); g_return_val_if_fail (section->cached_parsed || section->data, NULL); if (!section->cached_parsed) section->cached_parsed = __common_section_checks (section, 12, _pa...
0
[ "CWE-125" ]
gst-plugins-bad
d58f668ece8795bddb3316832e1848c7b7cf38ac
307,314,909,412,198,600,000,000,000,000,000,000,000
14
mpegtssection: Add more section size checks The smallest section ever needs to be at least 3 bytes (i.e. just the short header). Non-short headers need to be at least 11 bytes long (3 for the minimum header, 5 for the non-short header, and 4 for the CRC). https://bugzilla.gnome.org/show_bug.cgi?id=775048
int platform_dma_configure(struct device *dev) { enum dev_dma_attr attr; int ret = 0; if (dev->of_node) { ret = of_dma_configure(dev, dev->of_node, true); } else if (has_acpi_companion(dev)) { attr = acpi_get_dma_attr(to_acpi_device_node(dev->fwnode)); ret = acpi_dma_configure(dev, attr); } return ret; }
0
[ "CWE-787" ]
linux
aa838896d87af561a33ecefea1caa4c15a68bc47
54,450,961,306,357,280,000,000,000,000,000,000,000
14
drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions Convert the various sprintf fmaily calls in sysfs device show functions to sysfs_emit and sysfs_emit_at for PAGE_SIZE buffer safety. Done with: $ spatch -sp-file sysfs_emit_dev.cocci --in-place --max-width=80 . And cocci script: $ cat s...
static s32 brcmf_configure_opensecurity(struct brcmf_if *ifp) { struct wiphy *wiphy = ifp->drvr->wiphy; s32 err; s32 wpa_val; /* set auth */ err = brcmf_fil_bsscfg_int_set(ifp, "auth", 0); if (err < 0) { bphy_err(wiphy, "auth error %d\n", err); return err; } /* set wsec */ err = brcmf_fil_bsscfg_int_set(i...
0
[ "CWE-787" ]
linux
1b5e2423164b3670e8bc9174e4762d297990deff
237,200,440,780,748,960,000,000,000,000,000,000,000
31
brcmfmac: assure SSID length from firmware is limited The SSID length as received from firmware should not exceed IEEE80211_MAX_SSID_LEN as that would result in heap overflow. Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com> Reviewed-by:...
int wc_ecc_sig_size(ecc_key* key) { int sz = wc_ecc_size(key); if (sz <= 0) return sz; return wc_ecc_sig_size_calc(sz); }
0
[ "CWE-200" ]
wolfssl
9b9568d500f31f964af26ba8d01e542e1f27e5ca
81,148,150,198,152,080,000,000,000,000,000,000,000
8
Change ECDSA signing to use blinding.
fill_tiff_error (GError **error, const gchar *image_uri) { if (_tiff_error) { g_set_error (error, GXPS_ERROR, GXPS_ERROR_IMAGE, "Error loading TIFF image %s: %s", image_uri, _tiff_error); g_free (_tiff_error); _tiff_error = NULL; } else { g_set_error (error, GXPS...
0
[]
libgxps
123dd99c6a1ae2ef6fcb5547e51fa58e8c954b51
92,294,876,489,611,000,000,000,000,000,000,000,000
19
gxps-images: fix integer overflow in png decoder
XMLRPC_SERVER XMLRPC_GetGlobalServer() { static XMLRPC_SERVER xsServer = 0; if(!xsServer) { xsServer = XMLRPC_ServerCreate(); } return xsServer; }
0
[ "CWE-119" ]
php-src
88412772d295ebf7dd34409534507dc9bcac726e
322,743,425,730,233,670,000,000,000,000,000,000,000
7
Fix bug #68027 - fix date parsing in XMLRPC lib
void addDbAdminDbPrivileges(PrivilegeVector* privileges, StringData dbName) { Privilege::addPrivilegeToPrivilegeVector( privileges, Privilege(ResourcePattern::forDatabaseName(dbName), dbAdminRoleActions)); Privilege::addPrivilegeToPrivilegeVector( privileges, Privilege(ResourcePattern::f...
0
[ "CWE-20" ]
mongo
cbec187266a9f902b3906ae8ccef2bbda0c5b27b
148,807,825,249,490,220,000,000,000,000,000,000,000
21
SERVER-36263 Bypassing operation validation in applyOps should require special privilege
xrdp_mm_create(struct xrdp_wm* owner) { struct xrdp_mm* self; self = (struct xrdp_mm*)g_malloc(sizeof(struct xrdp_mm), 1); self->wm = owner; self->login_names = list_create(); self->login_names->auto_free = 1; self->login_values = list_create(); self->login_values->auto_free = 1; return self; }
0
[]
xrdp
d8f9e8310dac362bb9578763d1024178f94f4ecc
155,162,622,250,379,570,000,000,000,000,000,000,000
12
move temp files from /tmp to /tmp/.xrdp
xmlRelaxNGSchemaTypeCheck(void *data ATTRIBUTE_UNUSED, const xmlChar * type, const xmlChar * value, void **result, xmlNodePtr node) { xmlSchemaTypePtr typ; int ret; if ((type == NULL) || (value == NULL)) return (-1); ...
0
[ "CWE-134" ]
libxml2
502f6a6d08b08c04b3ddfb1cd21b2f699c1b7f5b
56,690,887,081,353,840,000,000,000,000,000,000,000
25
More format string warnings with possible format string vulnerability For https://bugzilla.gnome.org/show_bug.cgi?id=761029 adds a new xmlEscapeFormatString() function to escape composed format strings
static void pretty_print_dev(blkid_dev dev) { blkid_tag_iterate iter; const char *type, *value, *devname; const char *uuid = "", *fs_type = "", *label = ""; int len, mount_flags; char mtpt[80]; int retval; if (dev == NULL) { pretty_print_line("device", "fs_type", "label", "mount point", "UUID");...
0
[ "CWE-77" ]
util-linux
89e90ae7b2826110ea28c1c0eb8e7c56c3907bdc
23,866,017,956,084,620,000,000,000,000,000,000,000
49
libblkid: care about unsafe chars in cache The high-level libblkid API uses /run/blkid/blkid.tab cache to store probing results. The cache format is <device NAME="value" ...>devname</device> and unfortunately the cache code does not escape quotation marks: # mkfs.ext4 -L 'AAA"BBB' # cat /run/blkid/blkid.t...
read_line (FILE *fp, guchar *row, guchar *buffer, tga_info *info, GimpDrawable *drawable, const guchar *convert_cmap) { if (info->imageCompression == TGA_COMP_RLE) { rle_read (fp, buffer, info); } else { fread (bu...
0
[ "CWE-125" ]
GIMP
22e2571c25425f225abdb11a566cc281fca6f366
313,686,127,169,760,400,000,000,000,000,000,000,000
50
plug-ins: TGA 16-bit RGB (without alpha bit) is also valid. According to some spec on the web, 16-bit RGB is also valid. In this case, the last bit is simply ignored (at least that's how it is implemented right now). (cherry picked from commit 8ea316667c8a3296bce2832b3986b58d0fdfc077)
static int am_start_disco(request_rec *r, const char *return_to) { am_dir_cfg_rec *cfg = am_get_dir_cfg(r); const char *endpoint = am_get_endpoint_url(r); LassoServer *server; const char *sp_entity_id; const char *sep; const char *login_url; const char *discovery_url; server = am_get_la...
0
[]
mod_auth_mellon
6bdda9170a8f1757dabc5b109958657417728018
24,379,882,558,544,594,000,000,000,000,000,000,000
37
Fix segmentation fault when receiving badly formed logout message. If the logout message is badly formed, we won't get the entityID in `logout->parent.remote_providerID`. If we call `apr_hash_get()` with a null pointer, it will cause a segmentation fault. Add a check to validate that the entityID is correctly set.
napi_status napi_get_value_string_utf8(napi_env env, napi_value value, char* buf, size_t bufsize, size_t* result) { CHECK_ENV(env); CHECK_ARG(env, value); v8...
0
[ "CWE-191" ]
node
656260b4b65fec3b10f6da3fdc9f11fb941aafb5
245,882,288,908,241,340,000,000,000,000,000,000,000
32
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...
char const *PackLinuxElf64::get_str_name(unsigned st_name, unsigned symnum) const { if (strtab_end <= st_name) { char msg[70]; snprintf(msg, sizeof(msg), "bad .st_name %#x in DT_SYMTAB[%d]", st_name, symnum); throwCantPack(msg); } return &dynstr[st_name]; }
0
[ "CWE-476", "CWE-190" ]
upx
8be9da8280dfa69d5df4417d4d81bda1cab78010
20,651,355,337,498,487,000,000,000,000,000,000,000
9
Avoid bogus values in PT_DYNAMIC segment. Detect duplicate DT_*. Detect out-of-bounds hashtab and gashtab. Detect missing DT_REL, DT_RELA. Detect out-of-bounds d_val. https://github.com/upx/upx/issues/317 modified: p_lx_elf.cpp
int pm_qos_sysfs_add_latency_tolerance(struct device *dev) { return sysfs_merge_group(&dev->kobj, &pm_qos_latency_tolerance_attr_group); }
0
[ "CWE-787" ]
linux
aa838896d87af561a33ecefea1caa4c15a68bc47
288,193,653,710,720,180,000,000,000,000,000,000,000
5
drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions Convert the various sprintf fmaily calls in sysfs device show functions to sysfs_emit and sysfs_emit_at for PAGE_SIZE buffer safety. Done with: $ spatch -sp-file sysfs_emit_dev.cocci --in-place --max-width=80 . And cocci script: $ cat s...
OPJ_BOOL opj_tcd_copy_tile_data(opj_tcd_t *p_tcd, OPJ_BYTE * p_src, OPJ_SIZE_T p_src_length) { OPJ_UINT32 i; OPJ_SIZE_T j; OPJ_SIZE_T l_data_size = 0; opj_image_comp_t * l_img_comp = 00; opj_tcd_tilecomp_t * l_tilec = 00; OPJ_UINT32...
0
[ "CWE-122" ]
openjpeg
15cf3d95814dc931ca0ecb132f81cb152e051bae
97,034,839,869,858,600,000,000,000,000,000,000,000
87
Encoder: grow again buffer size in opj_tcd_code_block_enc_allocate_data() (fixes #1283)
proxy_C_Finalize (CK_X_FUNCTION_LIST *self, CK_VOID_PTR reserved) { Proxy *py = NULL; State *state = (State *)self; CK_RV rv = CKR_OK; p11_debug ("in"); /* WARNING: This function must be reentrant */ if (reserved) { rv = CKR_ARGUMENTS_BAD; } else { p11_lock (); if (!PROXY_VALID (sta...
0
[ "CWE-190" ]
p11-kit
5307a1d21a50cacd06f471a873a018d23ba4b963
69,907,720,068,071,660,000,000,000,000,000,000,000
34
Check for arithmetic overflows before allocating
inline void HardSwish(const RuntimeShape& input_shape, const float* input_data, const RuntimeShape& output_shape, float* output_data) { ruy::profiler::ScopeLabel label("HardSwish/Float"); auto size = MatchingFlatSize(input_shape, output_shape); int i = 0; #ifdef USE_NEON const float32x4_t ...
0
[ "CWE-476", "CWE-369" ]
tensorflow
15691e456c7dc9bd6be203b09765b063bf4a380c
228,687,529,750,778,030,000,000,000,000,000,000,000
59
Prevent dereferencing of null pointers in TFLite's `add.cc`. PiperOrigin-RevId: 387244946 Change-Id: I56094233327fbd8439b92e1dbb1262176e00eeb9
void tcp_shutdown(struct sock *sk, int how) { /* We need to grab some memory, and put together a FIN, * and then put it into the queue to be sent. * Tim MacKenzie(tym@dibbler.cs.monash.edu.au) 4 Dec '92. */ if (!(how & SEND_SHUTDOWN)) return; /* If we've already sent a FIN, or it's a closed state, skip thi...
0
[ "CWE-399", "CWE-835" ]
linux
ccf7abb93af09ad0868ae9033d1ca8108bdaec82
34,754,029,866,484,210,000,000,000,000,000,000,000
18
tcp: avoid infinite loop in tcp_splice_read() Splicing from TCP socket is vulnerable when a packet with URG flag is received and stored into receive queue. __tcp_splice_read() returns 0, and sk_wait_data() immediately returns since there is the problematic skb in queue. This is a nice way to burn cpu (aka infinite l...
CImg<T>& fill(const T& val0, const T& val1, const T& val2, const T& val3, const T& val4, const T& val5, const T& val6, const T& val7, const T& val8, const T& val9, const T& val10) { if (is_empty()) return *this; T *ptrd, *ptre = end() - 10; for (ptrd = _data; ptrd<ptre; ) { ...
0
[ "CWE-770" ]
cimg
619cb58dd90b4e03ac68286c70ed98acbefd1c90
276,048,834,792,678,920,000,000,000,000,000,000,000
24
CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size.
static int v9fs_statfs(struct dentry *dentry, struct kstatfs *buf) { struct v9fs_session_info *v9ses; struct p9_fid *fid; struct p9_rstatfs rs; int res; fid = v9fs_fid_lookup(dentry); if (IS_ERR(fid)) { res = PTR_ERR(fid); goto done; } v9ses = v9fs_dentry2v9ses(dentry); if (v9fs_proto_dotl(v9ses)) { re...
0
[ "CWE-835" ]
linux
5e3cc1ee1405a7eb3487ed24f786dec01b4cbe1f
266,726,739,925,621,870,000,000,000,000,000,000,000
35
9p: use inode->i_lock to protect i_size_write() under 32-bit Use inode->i_lock to protect i_size_write(), else i_size_read() in generic_fillattr() may loop infinitely in read_seqcount_begin() when multiple processes invoke v9fs_vfs_getattr() or v9fs_vfs_getattr_dotl() simultaneously under 32-bit SMP environment, and a...
static void check_me(char *name) { SPRTF("Have node %s\n", name); }
0
[ "CWE-119" ]
tidy-html5
c18f27a58792f7fbd0b30a0ff50d6b40a82f940d
311,413,174,278,985,440,000,000,000,000,000,000,000
4
Issue #217 - avoid len going negative, ever...
TIFFjpeg_write_tables(JPEGState* sp) { return CALLVJPEG(sp, jpeg_write_tables(&sp->cinfo.c)); }
0
[ "CWE-369" ]
libtiff
47f2fb61a3a64667bce1a8398a8fcb1b348ff122
103,217,923,811,171,760,000,000,000,000,000,000,000
4
* libtiff/tif_jpeg.c: avoid integer division by zero in JPEGSetupEncode() when horizontal or vertical sampling is set to 0. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2653
proto_tree_add_bitmask_text(proto_tree *parent_tree, tvbuff_t *tvb, const guint offset, const guint len, const char *name, const char *fallback, const gint ett, int * const *fields, const guint encoding, const int flags) { proto_item *item = NULL; guint64 value; if (parent_tree) { ...
0
[ "CWE-401" ]
wireshark
a9fc769d7bb4b491efb61c699d57c9f35269d871
124,131,542,734,241,540,000,000,000,000,000,000,000
21
epan: Fix a memory leak. Make sure _proto_tree_add_bits_ret_val allocates a bits array using the packet scope, otherwise we leak memory. Fixes #17032.
static int nf_tables_set_alloc_name(struct nft_ctx *ctx, struct nft_set *set, const char *name) { const struct nft_set *i; const char *p; unsigned long *inuse; unsigned int n = 0, min = 0; p = strnchr(name, IFNAMSIZ, '%'); if (p != NULL) { if (p[1] != 'd' || strchr(p + 2, '%')) return -EINVAL; in...
0
[ "CWE-19" ]
nf
a2f18db0c68fec96631c10cad9384c196e9008ac
287,590,163,921,717,940,000,000,000,000,000,000,000
44
netfilter: nf_tables: fix flush ruleset chain dependencies Jumping between chains doesn't mix well with flush ruleset. Rules from a different chain and set elements may still refer to us. [ 353.373791] ------------[ cut here ]------------ [ 353.373845] kernel BUG at net/netfilter/nf_tables_api.c:1159! [ 353.373896...