func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
handle_probe_request(netdissect_options *ndo,
const u_char *p, u_int length)
{
struct mgmt_body_t pbody;
int offset = 0;
int ret;
memset(&pbody, 0, sizeof(pbody));
ret = parse_elements(ndo, &pbody, p, offset, length);
PRINT_SSID(pbody);
PRINT_RATES(pbody);
return ret;
} | 0 | [
"CWE-125"
] | tcpdump | 4846b3c5d0a850e860baf4f07340495d29837d09 | 144,742,865,716,356,720,000,000,000,000,000,000,000 | 16 | (for 4.9.3) CVE-2018-16227/IEEE 802.11: add a missing bounds check
ieee802_11_print() tried to access the Mesh Flags subfield of the Mesh
Control field to find the size of the latter and increment the expected
802.11 header length before checking it is fully present in the input
buffer. Add an intermediate bounds chec... |
int X509_check_ip_asc(X509 *x, const char *ipasc, unsigned int flags)
{
unsigned char ipout[16];
size_t iplen;
if (ipasc == NULL)
return -2;
iplen = (size_t)a2i_ipadd(ipout, ipasc);
if (iplen == 0)
return -2;
return do_x509_check(x, (char *)ipout, iplen, flags, GEN_IPADD, NULL);... | 0 | [
"CWE-125"
] | openssl | bb4d2ed4091408404e18b3326e3df67848ef63d0 | 63,079,226,548,972,530,000,000,000,000,000,000,000 | 12 | Fix append_ia5 function to not assume NUL terminated strings
ASN.1 strings may not be NUL terminated. Don't assume they are.
CVE-2021-3712
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org> |
SPL_METHOD(SplObjectStorage, valid)
{
spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC);
if (zend_parse_parameters_none() == FAILURE) {
return;
}
RETURN_BOOL(zend_hash_has_more_elements_ex(&intern->storage, &intern->pos) == SUCCESS);
} /* }}} */ | 1 | [
"CWE-416"
] | php-src | c2e197e4efc663ca55f393bf0e799848842286f3 | 281,303,591,559,559,870,000,000,000,000,000,000,000 | 10 | Fix bug #70168 - Use After Free Vulnerability in unserialize() with SplObjectStorage |
uipbuf_add_ext_hdr(int16_t len)
{
if(len + uip_len <= UIP_LINK_MTU && len + uip_len >= 0 && len + uip_ext_len >= 0) {
uip_ext_len += len;
uip_len += len;
return true;
} else {
return false;
}
} | 0 | [
"CWE-787"
] | contiki-ng | 9cdec6e19865d7b0d8caf61f1a34001f64d565b0 | 50,361,954,536,238,290,000,000,000,000,000,000,000 | 10 | Prevent a possible read out of bounds in the processing of IPv6 extension headers. |
char *recv_line(struct pool *pool)
{
char *tok, *sret = NULL;
ssize_t len, buflen;
int waited = 0;
if (!strstr(pool->sockbuf, "\n")) {
struct timeval rstart, now;
cgtime(&rstart);
if (!socket_full(pool, DEFAULT_SOCKWAIT)) {
applog(LOG_DEBUG, "Timed out waiting for data on socket_full");
goto out;
}
... | 0 | [
"CWE-20",
"CWE-703"
] | sgminer | 910c36089940e81fb85c65b8e63dcd2fac71470c | 88,844,168,225,468,930,000,000,000,000,000,000,000 | 69 | stratum: parse_notify(): Don't die on malformed bbversion/prev_hash/nbit/ntime.
Might have introduced a memory leak, don't have time to check. :(
Should the other hex2bin()'s be checked?
Thanks to Mick Ayzenberg <mick.dejavusecurity.com> for finding this. |
add_fifo_list (fd)
int fd;
{
if (dev_fd_list == 0 || fd >= totfds)
{
int ofds;
ofds = totfds;
totfds = getdtablesize ();
if (totfds < 0 || totfds > 256)
totfds = 256;
if (fd >= totfds)
totfds = fd + 2;
dev_fd_list = (char *)xrealloc (dev_fd_list, totfds);
memset ... | 0 | [] | bash | 955543877583837c85470f7fb8a97b7aa8d45e6c | 282,617,353,237,864,840,000,000,000,000,000,000,000 | 21 | bash-4.4-rc2 release |
parse_ENQUEUE(char *arg, const struct ofpact_parse_params *pp)
{
char *sp = NULL;
char *port = strtok_r(arg, ":q,", &sp);
char *queue = strtok_r(NULL, "", &sp);
struct ofpact_enqueue *enqueue;
if (port == NULL || queue == NULL) {
return xstrdup("\"enqueue\" syntax is \"enqueue:PORT:QUEUE\" ... | 0 | [
"CWE-416"
] | ovs | 77cccc74deede443e8b9102299efc869a52b65b2 | 328,637,456,473,218,080,000,000,000,000,000,000,000 | 18 | ofp-actions: Fix use-after-free while decoding RAW_ENCAP.
While decoding RAW_ENCAP action, decode_ed_prop() might re-allocate
ofpbuf if there is no enough space left. However, function
'decode_NXAST_RAW_ENCAP' continues to use old pointer to 'encap'
structure leading to write-after-free and incorrect decoding.
==3... |
static noinline int cow_file_range_inline(struct btrfs_root *root,
struct inode *inode, u64 start,
u64 end, size_t compressed_size,
int compress_type,
struct page **compressed_pages)
{
struct btrfs_trans_handle *trans;
u64 isize = i_size_read(inode);
u64 actual_end = min(end + 1, isize);
... | 0 | [
"CWE-200"
] | linux | 0305cd5f7fca85dae392b9ba85b116896eb7c1c7 | 172,193,253,358,959,470,000,000,000,000,000,000,000 | 78 | Btrfs: fix truncation of compressed and inlined extents
When truncating a file to a smaller size which consists of an inline
extent that is compressed, we did not discard (or made unusable) the
data between the new file size and the old file size, wasting metadata
space and allowing for the truncated data to be leaked... |
static int smtcfb_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
struct smtcfb_info *sfb;
struct fb_info *info;
u_long smem_size;
int err;
unsigned long mmio_base;
dev_info(&pdev->dev, "Silicon Motion display driver.\n");
err = pci_enable_device(pdev); /* enable SMTC chip */
if (err... | 0 | [
"CWE-787"
] | linux-fbdev | bd771cf5c4254511cc4abb88f3dab3bd58bdf8e8 | 315,084,663,595,095,340,000,000,000,000,000,000,000 | 159 | video: fbdev: sm712fb: Fix crash in smtcfb_read()
Zheyu Ma reported this crash in the sm712fb driver when reading
three bytes from the framebuffer:
BUG: unable to handle page fault for address: ffffc90001ffffff
RIP: 0010:smtcfb_read+0x230/0x3e0
Call Trace:
vfs_read+0x198/0xa00
? do_sys_openat2+0x27d/0x350
? ... |
DwaCompressor::LossyDctDecoderBase::~LossyDctDecoderBase () {} | 0 | [
"CWE-125"
] | openexr | e79d2296496a50826a15c667bf92bdc5a05518b4 | 149,425,723,629,390,050,000,000,000,000,000,000,000 | 1 | fix memory leaks and invalid memory accesses
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz> |
static bool upgrade_lock_if_not_exists(THD *thd,
const DDL_options_st &create_info,
TABLE_LIST *create_table,
ulong lock_wait_timeout)
{
DBUG_ENTER("upgrade_lock_if_not_exists");
if (thd->lex->sql_c... | 0 | [
"CWE-416"
] | server | 0beed9b5e933f0ff79b3bb346524f7a451d14e38 | 99,575,035,472,737,430,000,000,000,000,000,000,000 | 32 | MDEV-28097 use-after-free when WHERE has subquery with an outer reference in HAVING
when resolving WHERE and ON clauses, do not look in
SELECT list/aliases. |
void ReadValue(int64 batch, int64 n, tstring* out) const override {
CopyToString(values_(row_splits_(batch) + n), out);
} | 0 | [
"CWE-125",
"CWE-369"
] | tensorflow | 44b7f486c0143f68b56c34e2d01e146ee445134a | 55,788,464,238,448,600,000,000,000,000,000,000,000 | 3 | Fix out of bounds read in `ragged_cross_op.cc`.
PiperOrigin-RevId: 369757702
Change-Id: Ie6e5d2c21513a8d56bf41fcf35960caf76e890f9 |
static void check_pointer_type_change(Notifier *notifier, void *data)
{
VncState *vs = container_of(notifier, VncState, mouse_mode_notifier);
int absolute = qemu_input_is_absolute();
if (vnc_has_feature(vs, VNC_FEATURE_POINTER_TYPE_CHANGE) && vs->absolute != absolute) {
vnc_lock_output(vs);
... | 1 | [
"CWE-125"
] | qemu | bea60dd7679364493a0d7f5b54316c767cf894ef | 321,851,019,701,869,430,000,000,000,000,000,000,000 | 19 | ui/vnc: fix potential memory corruption issues
this patch makes the VNC server work correctly if the
server surface and the guest surface have different sizes.
Basically the server surface is adjusted to not exceed VNC_MAX_WIDTH
x VNC_MAX_HEIGHT and additionally the width is rounded up to multiple of
VNC_DIRTY_PIXELS... |
static inline unsigned int shash_align_buffer_size(unsigned len,
unsigned long mask)
{
return len + (mask & ~(__alignof__(u8 __attribute__ ((aligned))) - 1));
} | 0 | [
"CWE-310"
] | linux | 9a5467bf7b6e9e02ec9c3da4e23747c05faeaac6 | 143,344,531,418,105,960,000,000,000,000,000,000,000 | 5 | crypto: user - fix info leaks in report API
Three errors resulting in kernel memory disclosure:
1/ The structures used for the netlink based crypto algorithm report API
are located on the stack. As snprintf() does not fill the remainder of
the buffer with null bytes, those stack bytes will be disclosed to users
of th... |
Sessions *Http2Handler::get_sessions() const { return sessions_; } | 0 | [] | nghttp2 | 95efb3e19d174354ca50c65d5d7227d92bcd60e1 | 70,411,028,869,333,920,000,000,000,000,000,000,000 | 1 | Don't read too greedily |
static int send_mono_rect(VncState *vs, int x, int y,
int w, int h, uint32_t bg, uint32_t fg)
{
ssize_t bytes;
int stream = 1;
int level = tight_conf[vs->tight.compression].mono_zlib_level;
#ifdef CONFIG_VNC_PNG
if (tight_can_send_png_rect(vs, w, h)) {
int ret;
... | 1 | [
"CWE-125"
] | qemu | 9f64916da20eea67121d544698676295bbb105a7 | 211,770,257,943,546,100,000,000,000,000,000,000,000 | 57 | pixman/vnc: use pixman images in vnc.
The vnc code uses *three* DisplaySurfaces:
First is the surface of the actual QemuConsole, usually the guest
screen, but could also be a text console (monitor/serial reachable via
Ctrl-Alt-<nr> keys). This is left as-is.
Second is the current server's view of the screen content... |
static inline void set_ldt(const void *addr, unsigned entries)
{
PVOP_VCALL2(cpu.set_ldt, addr, entries);
} | 0 | [
"CWE-276"
] | linux | cadfad870154e14f745ec845708bc17d166065f2 | 282,161,702,142,408,600,000,000,000,000,000,000,000 | 4 | x86/ioperm: Fix io bitmap invalidation on Xen PV
tss_invalidate_io_bitmap() wasn't wired up properly through the pvop
machinery, so the TSS and Xen's io bitmap would get out of sync
whenever disabling a valid io bitmap.
Add a new pvop for tss_invalidate_io_bitmap() to fix it.
This is XSA-329.
Fixes: 22fe5b0439dd ("... |
static int read_filesystem_tables()
{
long long table_start;
/* Read uid and gid lookup tables */
/* Sanity check super block contents */
if(sBlk.no_guids) {
if(sBlk.guid_start >= sBlk.s.bytes_used) {
ERROR("read_filesystem_tables: gid start too large in super block\n");
goto corrupted;
}
/* In 1.x f... | 0 | [
"CWE-200",
"CWE-59",
"CWE-22"
] | squashfs-tools | e0485802ec72996c20026da320650d8362f555bd | 161,106,350,628,587,380,000,000,000,000,000,000,000 | 72 | Unsquashfs: additional write outside destination directory exploit fix
An issue on github (https://github.com/plougher/squashfs-tools/issues/72)
showed how some specially crafted Squashfs filesystems containing
invalid file names (with '/' and '..') can cause Unsquashfs to write
files outside of the destination direct... |
~StoreContext() {} | 0 | [
"CWE-264"
] | dcmtk | beaf5a5c24101daeeafa48c375120b16197c9e95 | 124,599,519,897,685,700,000,000,000,000,000,000,000 | 1 | Make sure to handle setuid() return code properly.
In some tools the return value of setuid() is not checked. In the worst
case this could lead to privilege escalation since the process does not
give up its root privileges and continue as root. |
static long exact_copy_from_user(void *to, const void __user * from,
unsigned long n)
{
char *t = to;
const char __user *f = from;
char c;
if (!access_ok(VERIFY_READ, from, n))
return n;
while (n) {
if (__get_user(c, f)) {
memset(t, 0, n);
break;
}
*t++ = c;
f++;
n--;
}
return n;
} | 0 | [
"CWE-269"
] | linux-2.6 | ee6f958291e2a768fd727e7a67badfff0b67711a | 321,190,969,020,322,660,000,000,000,000,000,000,000 | 21 | check privileges before setting mount propagation
There's a missing check for CAP_SYS_ADMIN in do_change_type().
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torva... |
static int printiplist(char *buf, int bufsize, struct iplist* ipl, char * delim){
int printed = 0;
for(; ipl; ipl = ipl->next){
if(printed > (bufsize - 128)) break;
printed += printiple(buf+printed, ipl);
if(printed > (bufsize - 128)) {
printed += sprintf(buf+printed, "...");
break;
}
}
return printed... | 0 | [
"CWE-20",
"CWE-787"
] | 3proxy | 3b67dc844789dc0f00e934270c7b349bcb547865 | 27,991,821,521,422,852,000,000,000,000,000,000,000 | 12 | Fix: out-of-bounds write and few more bugs in 'admin' configuration upload |
invoke_NPN_NewStream(PluginInstance *plugin, NPMIMEType type, const char *target, NPStream **pstream)
{
npw_return_val_if_fail(rpc_method_invoke_possible(g_rpc_connection),
NPERR_GENERIC_ERROR);
int error = rpc_method_invoke(g_rpc_connection,
RPC_METHOD_NPN_NEW_STREAM,
RPC_TYPE_NPW_PLUGIN_IN... | 0 | [
"CWE-264"
] | nspluginwrapper | 7e4ab8e1189846041f955e6c83f72bc1624e7a98 | 157,437,512,136,415,920,000,000,000,000,000,000,000 | 72 | Support all the new variables added |
static struct tevent_req *cli_sesssetup_blob_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct cli_state *cli,
DATA_BLOB blob)
{
struct tevent_req *req, *subreq;
struct cli_sesssetup_blob_state *state;
uint32_t usable_space;
req = tevent_req_create(mem_ctx, &state,
struct cli_... | 0 | [
"CWE-94"
] | samba | 94295b7aa22d2544af5323bca70d3dcb97fd7c64 | 138,451,975,712,161,650,000,000,000,000,000,000,000 | 41 | CVE-2016-2019: s3:libsmb: add comment regarding smbXcli_session_is_guest() with mandatory signing
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11860
Signed-off-by: Stefan Metzmacher <metze@samba.org> |
bgp_create_open(struct bgp_conn *conn, byte *buf)
{
struct bgp_proto *p = conn->bgp;
BGP_TRACE(D_PACKETS, "Sending OPEN(ver=%d,as=%d,hold=%d,id=%08x)",
BGP_VERSION, p->public_as, p->cf->hold_time, p->local_id);
buf[0] = BGP_VERSION;
put_u16(buf+1, (p->public_as < 0xFFFF) ? p->public_as : AS_TRANS);
put... | 0 | [
"CWE-787"
] | bird | 8388f5a7e14108a1458fea35bfbb5a453e2c563c | 271,363,407,801,357,260,000,000,000,000,000,000,000 | 49 | BGP: Fix bugs in handling of shutdown messages
There is an improper check for valid message size, which may lead to
stack overflow and buffer leaks to log when a large message is received.
Thanks to Daniel McCarney for bugreport and analysis. |
import_release_stats_handle (void *p)
{
xfree (p);
} | 0 | [
"CWE-20"
] | gnupg | f0b33b6fb8e0586e9584a7a409dcc31263776a67 | 321,724,013,409,184,570,000,000,000,000,000,000,000 | 4 | gpg: Import only packets which are allowed in a keyblock.
* g10/import.c (valid_keyblock_packet): New.
(read_block): Store only valid packets.
--
A corrupted key, which for example included a mangled public key
encrypted packet, used to corrupt the keyring. This change skips all
packets which are not allowed in a ke... |
string t_go_generator::go_imports_end() {
return string(
")\n\n"
"// (needed to ensure safety because of naive import list construction.)\n"
"var _ = thrift.ZERO\n"
"var _ = fmt.Printf\n"
"var _ = bytes.Equal\n\n");
} | 0 | [
"CWE-77"
] | thrift | 2007783e874d524a46b818598a45078448ecc53e | 174,256,916,809,448,500,000,000,000,000,000,000,000 | 8 | THRIFT-3893 Command injection in format_go_output
Client: Go
Patch: Jens Geyer |
static void intel_vgpu_release_msi_eventfd_ctx(struct intel_vgpu *vgpu)
{
struct eventfd_ctx *trigger;
trigger = vgpu->vdev.msi_trigger;
if (trigger) {
eventfd_ctx_put(trigger);
vgpu->vdev.msi_trigger = NULL;
}
} | 0 | [
"CWE-20"
] | linux | 51b00d8509dc69c98740da2ad07308b630d3eb7d | 194,813,566,388,412,080,000,000,000,000,000,000,000 | 10 | drm/i915/gvt: Fix mmap range check
This is to fix missed mmap range check on vGPU bar2 region
and only allow to map vGPU allocated GMADDR range, which means
user space should support sparse mmap to get proper offset for
mmap vGPU aperture. And this takes care of actual pgoff in mmap
request as original code always doe... |
char *rose2asc(char *buf, const rose_address *addr)
{
if (addr->rose_addr[0] == 0x00 && addr->rose_addr[1] == 0x00 &&
addr->rose_addr[2] == 0x00 && addr->rose_addr[3] == 0x00 &&
addr->rose_addr[4] == 0x00) {
strcpy(buf, "*");
} else {
sprintf(buf, "%02X%02X%02X%02X%02X", addr->rose_addr[0] & 0xFF,
... | 0 | [
"CWE-200"
] | linux-2.6 | 17ac2e9c58b69a1e25460a568eae1b0dc0188c25 | 202,077,102,979,419,640,000,000,000,000,000,000,000 | 16 | rose: Fix rose_getname() leak
rose_getname() can leak kernel memory to user.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net> |
static void smaps_account(struct mem_size_stats *mss, struct page *page,
bool compound, bool young, bool dirty, bool locked)
{
int i, nr = compound ? 1 << compound_order(page) : 1;
unsigned long size = nr * PAGE_SIZE;
if (PageAnon(page)) {
mss->anonymous += size;
if (!PageSwapBacked(page) && !dirty && !PageDi... | 0 | [
"CWE-362",
"CWE-703",
"CWE-667"
] | linux | 04f5866e41fb70690e28397487d8bd8eea7d712a | 89,767,090,158,087,110,000,000,000,000,000,000,000 | 56 | coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping
The core dumping code has always run without holding the mmap_sem for
writing, despite that is the only way to ensure that the entire vma
layout will not change from under it. Only using some signal
serialization on the processes bel... |
inode_info_init_once(void *vptr)
{
struct ecryptfs_inode_info *ei = (struct ecryptfs_inode_info *)vptr;
inode_init_once(&ei->vfs_inode);
} | 0 | [
"CWE-284",
"CWE-264"
] | linux | 69c433ed2ecd2d3264efd7afec4439524b319121 | 113,228,462,953,503,860,000,000,000,000,000,000,000 | 6 | fs: limit filesystem stacking depth
Add a simple read-only counter to super_block that indicates how deep this
is in the stack of filesystems. Previously ecryptfs was the only stackable
filesystem and it explicitly disallowed multiple layers of itself.
Overlayfs, however, can be stacked recursively and also may be s... |
void HandleExternalProtocolInUI(
const GURL& url,
content::WebContents::OnceGetter web_contents_getter,
bool has_user_gesture) {
content::WebContents* web_contents = std::move(web_contents_getter).Run();
if (!web_contents)
return;
auto* permission_helper =
WebContentsPermissionHelper::FromW... | 0 | [] | electron | e9fa834757f41c0b9fe44a4dffe3d7d437f52d34 | 294,437,997,446,620,400,000,000,000,000,000,000,000 | 18 | fix: ensure ElectronBrowser mojo service is only bound to appropriate render frames (#33344)
* fix: ensure ElectronBrowser mojo service is only bound to authorized render frames
Notes: no-notes
* refactor: extract electron API IPC to its own mojo interface
* fix: just check main frame not primary main frame
... |
static int ok_inflater_decode_literal(ok_inflater *inflater, const uint16_t *tree_lookup_table,
unsigned int tree_bits) {
if (!ok_inflater_load_bits(inflater, tree_bits)) {
return -1;
}
uint32_t p = ok_inflater_peek_bits(inflater, tree_bits);
uint16_t value ... | 0 | [
"CWE-787"
] | ok-file-formats | e49cdfb84fb5eca2a6261f3c51a3c793fab9f62e | 53,368,045,717,909,310,000,000,000,000,000,000,000 | 10 | ok_png: Disallow multiple IHDR chunks (#15) |
static bool bin_strings(RCore *r, int mode, int va) {
RList *list;
RBinFile *binfile = r_bin_cur (r->bin);
RBinPlugin *plugin = r_bin_file_cur_plugin (binfile);
int rawstr = r_config_get_i (r->config, "bin.rawstr");
if (!binfile) {
return false;
}
if (!r_config_get_i (r->config, "bin.strings")) {
return fals... | 0 | [
"CWE-78"
] | radare2 | 5411543a310a470b1257fb93273cdd6e8dfcb3af | 111,127,326,321,047,200,000,000,000,000,000,000,000 | 29 | More fixes for the CVE-2019-14745 |
set_multi_byte_cclass(BBuf* mbuf, regex_t* reg)
{
size_t len;
void* p;
len = (size_t )mbuf->used;
p = xmalloc(len);
if (IS_NULL(p)) return NULL;
xmemcpy(p, mbuf->p, len);
return p;
} | 0 | [
"CWE-476",
"CWE-125"
] | oniguruma | c509265c5f6ae7264f7b8a8aae1cfa5fc59d108c | 153,779,614,877,839,330,000,000,000,000,000,000,000 | 12 | Fix CVE-2019-13225: problem in converting if-then-else pattern to bytecode. |
BasicArgFormatter(BasicFormatter<Char, Impl> &formatter,
Spec &spec, const Char *fmt)
: internal::ArgFormatterBase<Impl, Char, Spec>(formatter.writer(), spec),
formatter_(formatter), format_(fmt) {} | 0 | [
"CWE-134",
"CWE-119",
"CWE-787"
] | fmt | 8cf30aa2be256eba07bb1cefb998c52326e846e7 | 26,978,301,791,298,346,000,000,000,000,000,000,000 | 4 | Fix segfault on complex pointer formatting (#642) |
static int tty_fasync(int fd, struct file *filp, int on)
{
struct tty_struct *tty = file_tty(filp);
int retval = -ENOTTY;
tty_lock(tty);
if (!tty_hung_up_p(filp))
retval = __tty_fasync(fd, filp, on);
tty_unlock(tty);
return retval;
} | 0 | [
"CWE-416"
] | linux | c8bcd9c5be24fb9e6132e97da5a35e55a83e36b9 | 289,072,774,852,913,380,000,000,000,000,000,000,000 | 12 | tty: Fix ->session locking
Currently, locking of ->session is very inconsistent; most places
protect it using the legacy tty mutex, but disassociate_ctty(),
__do_SAK(), tiocspgrp() and tiocgsid() don't.
Two of the writers hold the ctrl_lock (because they already need it for
->pgrp), but __proc_set_tty() doesn't do tha... |
ccbaWriteSVG(const char *filename,
CCBORDA *ccba)
{
char *svgstr;
PROCNAME("ccbaWriteSVG");
if (!filename)
return ERROR_INT("filename not defined", procName, 1);
if (!ccba)
return ERROR_INT("ccba not defined", procName, 1);
if ((svgstr = ccbaWriteSVGString(filename,... | 0 | [
"CWE-125"
] | leptonica | 8d6e1755518cfb98536d6c3daf0601f226d16842 | 247,983,651,188,978,000,000,000,000,000,000,000,000 | 20 | Issue 23433 in oss-fuzz: Heap-buffer-overflow in findNextBorderPixel()
* Check pix boundary when looking for the next pixel. |
static int ext3_fill_super (struct super_block *sb, void *data, int silent)
{
struct buffer_head * bh;
struct ext3_super_block *es = NULL;
struct ext3_sb_info *sbi;
ext3_fsblk_t block;
ext3_fsblk_t sb_block = get_sb_block(&data, sb);
ext3_fsblk_t logic_sb_block;
unsigned long offset = 0;
unsigned int journal_in... | 0 | [
"CWE-20"
] | linux | 8d0c2d10dd72c5292eda7a06231056a4c972e4cc | 657,164,955,564,800,800,000,000,000,000,000,000 | 470 | ext3: Fix format string issues
ext3_msg() takes the printk prefix as the second parameter and the
format string as the third parameter. Two callers of ext3_msg omit the
prefix and pass the format string as the second parameter and the first
parameter to the format string as the third parameter. In both cases
this stri... |
static NTSTATUS get_null_nt_acl(TALLOC_CTX *mem_ctx, struct security_descriptor **ppsd)
{
size_t sd_size;
*ppsd = make_standard_sec_desc( mem_ctx, &global_sid_World, &global_sid_World, NULL, &sd_size);
if(!*ppsd) {
DEBUG(0,("get_null_nt_acl: Unable to malloc space for security descriptor.\n"));
return NT_STATUS... | 0 | [
"CWE-189"
] | samba | b4bfcdf921aeee05c4608d7b48618fdfb1f134dc | 109,933,922,007,985,920,000,000,000,000,000,000,000 | 12 | Fix bug #10010 - Missing integer wrap protection in EA list reading can cause server to loop with DOS.
Ensure we never wrap whilst adding client provided input.
Signed-off-by: Jeremy Allison <jra@samba.org> |
read_server (assuan_fd_t sock, void *buffer, size_t size)
{
int nread;
do
{
#ifdef HAVE_W32_SYSTEM
/* Under Windows we need to use recv for a socket. */
# if defined(USE_NPTH)
npth_unprotect ();
# endif
nread = recv (FD2INT (sock), buffer, size, 0);
# if defined(USE_NPTH)
npth_protect ... | 0 | [
"CWE-352"
] | gnupg | 4a4bb874f63741026bd26264c43bb32b1099f060 | 145,589,514,591,639,100,000,000,000,000,000,000,000 | 30 | dirmngr: Avoid possible CSRF attacks via http redirects.
* dirmngr/http.h (parsed_uri_s): Add fields off_host and off_path.
(http_redir_info_t): New.
* dirmngr/http.c (do_parse_uri): Set new fields.
(same_host_p): New.
(http_prepare_redirect): New.
* dirmngr/t-http-basic.c: New test.
* dirmngr/ks-engine-hkp.c (send_re... |
static void phar_spl_foreign_dtor(spl_filesystem_object *object TSRMLS_DC) /* {{{ */
{
phar_archive_data *phar = (phar_archive_data *) object->oth;
if (!phar->is_persistent) {
phar_archive_delref(phar TSRMLS_CC);
}
object->oth = NULL;
} | 0 | [
"CWE-416"
] | php-src | b2cf3f064b8f5efef89bb084521b61318c71781b | 92,386,639,466,243,420,000,000,000,000,000,000,000 | 10 | Fixed bug #68901 (use after free) |
static int fastrpc_invoke(struct fastrpc_user *fl, char __user *argp)
{
struct fastrpc_invoke_args *args = NULL;
struct fastrpc_invoke inv;
u32 nscalars;
int err;
if (copy_from_user(&inv, argp, sizeof(inv)))
return -EFAULT;
/* nscalars is truncated here to max supported value */
nscalars = REMOTE_SCALARS_LEN... | 0 | [
"CWE-400",
"CWE-401"
] | linux | fc739a058d99c9297ef6bfd923b809d85855b9a9 | 86,519,257,725,040,470,000,000,000,000,000,000,000 | 29 | misc: fastrpc: prevent memory leak in fastrpc_dma_buf_attach
In fastrpc_dma_buf_attach if dma_get_sgtable fails the allocated memory
for a should be released.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Link: https://lore.kernel.org/r/20190925152742.16258-1-navid.emamdoost@gmail.com
Signed-off-by: Greg... |
xcf_load_layer_props (XcfInfo *info,
GimpImage *image,
GimpLayer **layer,
GList **item_path,
gboolean *apply_mask,
gboolean *edit_mask,
gboolean *show_mask,
... | 0 | [
"CWE-416"
] | gimp | e82aaa4b4ee0703c879e35ea9321fff6be3e9b6f | 55,504,232,248,696,705,000,000,000,000,000,000,000 | 229 | Bug 767873 - (CVE-2016-4994) Multiple Use-After-Free when parsing...
...XCF channel and layer properties
The properties PROP_ACTIVE_LAYER, PROP_FLOATING_SELECTION,
PROP_ACTIVE_CHANNEL saves the current object pointer the @info
structure. Others like PROP_SELECTION (for channel) and
PROP_GROUP_ITEM (for layer) will de... |
static int snd_seq_ioctl_delete_port(struct snd_seq_client *client, void *arg)
{
struct snd_seq_port_info *info = arg;
int err;
/* it is not allowed to remove the port for an another client */
if (info->addr.client != client->number)
return -EPERM;
err = snd_seq_delete_port(client, info->addr.port);
if (err >... | 0 | [
"CWE-416",
"CWE-362"
] | linux | 71105998845fb012937332fe2e806d443c09e026 | 259,026,447,852,802,800,000,000,000,000,000,000,000 | 14 | ALSA: seq: Fix use-after-free at creating a port
There is a potential race window opened at creating and deleting a
port via ioctl, as spotted by fuzzing. snd_seq_create_port() creates
a port object and returns its pointer, but it doesn't take the
refcount, thus it can be deleted immediately by another thread.
Meanwh... |
inline long long hufLength(long long code) { return code & 63; } | 0 | [
"CWE-20",
"CWE-190"
] | tinyexr | a685e3332f61cd4e59324bf3f669d36973d64270 | 161,200,571,661,279,420,000,000,000,000,000,000,000 | 1 | Make line_no with too large value(2**20) invalid. Fixes #124 |
static void device_qual(struct usb_composite_dev *cdev)
{
struct usb_qualifier_descriptor *qual = cdev->req->buf;
qual->bLength = sizeof(*qual);
qual->bDescriptorType = USB_DT_DEVICE_QUALIFIER;
/* POLICY: same bcdUSB and device type info at both speeds */
qual->bcdUSB = cdev->desc.bcdUSB;
qual->bDeviceClass = cd... | 0 | [
"CWE-476"
] | linux | 75e5b4849b81e19e9efe1654b30d7f3151c33c2c | 50,718,020,161,944,180,000,000,000,000,000,000,000 | 16 | USB: gadget: validate interface OS descriptor requests
Stall the control endpoint in case provided index exceeds array size of
MAX_CONFIG_INTERFACES or when the retrieved function pointer is null.
Signed-off-by: Szymon Heidrich <szymon.heidrich@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregk... |
static int uas_slave_alloc(struct scsi_device *sdev)
{
struct uas_dev_info *devinfo =
(struct uas_dev_info *)sdev->host->hostdata;
sdev->hostdata = devinfo;
/*
* USB has unusual DMA-alignment requirements: Although the
* starting address of each scatter-gather element doesn't matter,
* the length of each e... | 0 | [
"CWE-125"
] | linux | 786de92b3cb26012d3d0f00ee37adf14527f35c4 | 205,766,084,904,903,500,000,000,000,000,000,000,000 | 32 | USB: uas: fix bug in handling of alternate settings
The uas driver has a subtle bug in the way it handles alternate
settings. The uas_find_uas_alt_setting() routine returns an
altsetting value (the bAlternateSetting number in the descriptor), but
uas_use_uas_driver() then treats that value as an index to the
intf->al... |
DWORD nla_get_error(rdpNla* nla)
{
if (!nla)
return ERROR_INTERNAL_ERROR;
return nla->errorCode;
} | 0 | [] | FreeRDP | 479e891545473f01c187daffdfa05fc752b54b72 | 327,762,428,554,353,500,000,000,000,000,000,000,000 | 6 | check return values for SetCredentialsAttributes, throw warnings for unsupported attributes |
REGEXP *
Perl_re_op_compile(pTHX_ SV ** const patternp, int pat_count,
OP *expr, const regexp_engine* eng, REGEXP *old_re,
bool *is_bare_re, const U32 orig_rx_flags, const U32 pm_flags)
{
dVAR;
REGEXP *Rx; /* Capital 'R' means points to a REGEXP */
STRLEN plen;
char *exp;
regnod... | 0 | [
"CWE-120"
] | perl5 | 66bbb51b93253a3f87d11c2695cfb7bdb782184a | 78,146,659,307,423,760,000,000,000,000,000,000,000 | 1,029 | study_chunk: avoid mutating regexp program within GOSUB
gh16947 and gh17743: studying GOSUB may restudy in an inner call
(via a mix of recursion and enframing) something that an outer call
is in the middle of looking at. Let the outer frame deal with it.
(CVE-2020-12723)
(cherry picked from commit c4033e740bd18d9fb... |
static int _nfs4_proc_access(struct inode *inode, struct nfs_access_entry *entry)
{
struct nfs_server *server = NFS_SERVER(inode);
struct nfs4_accessargs args = {
.fh = NFS_FH(inode),
.bitmask = server->cache_consistency_bitmask,
};
struct nfs4_accessres res = {
.server = server,
};
struct rpc_message msg =... | 0 | [
"CWE-119",
"CWE-401"
] | linux | 7d3e91a89b7adbc2831334def9e494dd9892f9af | 231,753,401,246,690,550,000,000,000,000,000,000,000 | 48 | NFSv4: Check for buffer length in __nfs4_get_acl_uncached
Commit 1f1ea6c "NFSv4: Fix buffer overflow checking in
__nfs4_get_acl_uncached" accidently dropped the checking for too small
result buffer length.
If someone uses getxattr on "system.nfs4_acl" on an NFSv4 mount
supporting ACLs, the ACL has not been cached and... |
mz_bool mz_zip_reader_end(mz_zip_archive *pZip) {
if ((!pZip) || (!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) ||
(pZip->m_zip_mode != MZ_ZIP_MODE_READING))
return MZ_FALSE;
if (pZip->m_pState) {
mz_zip_internal_state *pState = pZip->m_pState;
pZip->m_pState = NULL;
mz_zip_array_... | 0 | [
"CWE-20",
"CWE-190"
] | tinyexr | a685e3332f61cd4e59324bf3f669d36973d64270 | 271,431,408,485,581,270,000,000,000,000,000,000,000 | 25 | Make line_no with too large value(2**20) invalid. Fixes #124 |
static int get_msix_state(QEMUFile *f, void *pv, size_t size)
{
msix_load(pv, f);
return 0;
} | 0 | [] | qemu | 43b11a91dd861a946b231b89b7542856ade23d1b | 202,864,490,158,186,500,000,000,000,000,000,000,000 | 5 | msix: implement pba write (but read-only)
qpci_msix_pending() writes on pba region, causing qemu to SEGV:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff7fba8c0 (LWP 25882)]
0x0000000000000000 in ?? ()
(gdb) bt
#0 0x0000000000000000 in ()
#1 0x00005555556556c5 in memor... |
g_file_create_readwrite_finish (GFile *file,
GAsyncResult *res,
GError **error)
{
GFileIface *iface;
g_return_val_if_fail (G_IS_FILE (file), NULL);
g_return_val_if_fail (G_IS_ASYNC_RESULT (res), NULL);
if (g_async_result_legacy_pro... | 0 | [
"CWE-362"
] | glib | d8f8f4d637ce43f8699ba94c9b7648beda0ca174 | 168,524,511,343,764,500,000,000,000,000,000,000,000 | 15 | gfile: Limit access to files when copying
file_copy_fallback creates new files with default permissions and
set the correct permissions after the operation is finished. This
might cause that the files can be accessible by more users during
the operation than expected. Use G_FILE_CREATE_PRIVATE for the new
files to lim... |
new_offset_item (void)
{
struct off_item *k;
k = xmalloc_clear (sizeof *k);
return k;
} | 0 | [
"CWE-416"
] | gnupg | f0f71a721ccd7ab9e40b8b6b028b59632c0cc648 | 159,295,846,235,683,170,000,000,000,000,000,000,000 | 7 | gpg: Prevent an invalid memory read using a garbled keyring.
* g10/keyring.c (keyring_get_keyblock): Whitelist allowed packet
types.
* g10/keydb.c (parse_keyblock_image): Ditto.
--
The keyring DB code did not reject packets which don't belong into a
keyring. If for example the keyblock contains a literal data packet... |
nf_nat_redirect_ipv6(struct sk_buff *skb, const struct nf_nat_range *range,
unsigned int hooknum)
{
struct nf_nat_range newrange;
struct in6_addr newdst;
enum ip_conntrack_info ctinfo;
struct nf_conn *ct;
ct = nf_ct_get(skb, &ctinfo);
if (hooknum == NF_INET_LOCAL_OUT) {
newdst = loopback_addr;
} else {... | 0 | [
"CWE-476",
"CWE-703"
] | linux | 94f9cd81436c85d8c3a318ba92e236ede73752fc | 264,786,446,301,110,140,000,000,000,000,000,000,000 | 39 | netfilter: nf_nat_redirect: add missing NULL pointer check
Commit 8b13eddfdf04cbfa561725cfc42d6868fe896f56 ("netfilter: refactor NAT
redirect IPv4 to use it from nf_tables") has introduced a trivial logic
change which can result in the following crash.
BUG: unable to handle kernel NULL pointer dereference at 00000000... |
TEST(UriSuite, TestUnescaping) {
const bool PLUS_TO_SPACE = true;
const bool PLUS_DONT_TOUCH = false;
// Proper
ASSERT_TRUE(testUnescapingHelper(L"abc%20%41BC", L"abc ABC"));
ASSERT_TRUE(testUnescapingHelper(L"%20", L" "));
// Incomplete
ASSERT_TRUE(testUnescapingHelper(L"%0", L"%0"));
// Nonhex
A... | 0 | [
"CWE-125"
] | uriparser | cef25028de5ff872c2e1f0a6c562eb3ea9ecbce4 | 320,064,008,018,616,330,000,000,000,000,000,000,000 | 87 | Fix uriParse*Ex* out-of-bounds read |
bfad_im_vport_set_symbolic_name(struct fc_vport *fc_vport)
{
struct bfad_vport_s *vport = (struct bfad_vport_s *)fc_vport->dd_data;
struct bfad_im_port_s *im_port =
(struct bfad_im_port_s *)vport->drv_port.im_port;
struct bfad_s *bfad = im_port->bfad;
struct Scsi_Host *vshost = vport->drv_port.im_port->shost;
c... | 0 | [
"CWE-400",
"CWE-401"
] | linux | 0e62395da2bd5166d7c9e14cbc7503b256a34cb0 | 99,492,169,215,284,270,000,000,000,000,000,000,000 | 26 | scsi: bfa: release allocated memory in case of error
In bfad_im_get_stats if bfa_port_get_stats fails, allocated memory needs to
be released.
Link: https://lore.kernel.org/r/20190910234417.22151-1-navid.emamdoost@gmail.com
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Martin K. Petersen <m... |
static double mp_self_bitwise_and(_cimg_math_parser& mp) {
double &val = _mp_arg(1);
return val = (double)((longT)val & (longT)_mp_arg(2)); | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 337,116,260,463,629,820,000,000,000,000,000,000,000 | 4 | Fix other issues in 'CImg<T>::load_bmp()'. |
static int fuse_permission(struct inode *inode, int mask)
{
struct fuse_conn *fc = get_fuse_conn(inode);
bool refreshed = false;
int err = 0;
if (!fuse_allow_current_process(fc))
return -EACCES;
/*
* If attributes are needed, refresh them before proceeding
*/
if (fc->default_permissions ||
((mask & M... | 1 | [
"CWE-459"
] | linux | 5d069dbe8aaf2a197142558b6fb2978189ba3454 | 325,512,857,498,804,300,000,000,000,000,000,000,000 | 57 | 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 int qcow2_image_open(struct bdev *bdev, int dirfd, const char *pathname, int flags)
{
struct qcow2_header buf;
struct qcow2_header header;
struct qcow_state *s;
uint64_t l1_size;
unsigned int shift;
ssize_t read;
s = calloc(1, sizeof(struct qcow_state));
if (!s)
return -1;
bdev->private = s;
bdev->... | 0 | [
"CWE-200"
] | tcmu-runner | 8cf8208775022301adaa59c240bb7f93742d1329 | 197,700,963,241,311,900,000,000,000,000,000,000,000 | 143 | removed all check_config callback implementations to avoid security issues
see github issue #194
qcow.c contained an information leak, could test for existance of any
file in the system
file_example.c and file_optical.c allow also to test for existance of
any file, plus to temporarily create empty new files anywhere... |
static struct bio_map_data *bio_alloc_map_data(struct iov_iter *data,
gfp_t gfp_mask)
{
struct bio_map_data *bmd;
if (data->nr_segs > UIO_MAXIOV)
return NULL;
bmd = kmalloc(struct_size(bmd, iov, data->nr_segs), gfp_mask);
if (!bmd)
return NULL;
memcpy(bmd->iov, data->iov, sizeof(struct iovec) * d... | 0 | [
"CWE-200"
] | linux | cc8f7fe1f5eab010191aa4570f27641876fa1267 | 310,659,740,606,515,970,000,000,000,000,000,000,000 | 16 | block-map: add __GFP_ZERO flag for alloc_page in function bio_copy_kern
Add __GFP_ZERO flag for alloc_page in function bio_copy_kern to initialize
the buffer of a bio.
Signed-off-by: Haimin Zhang <tcs.kernel@gmail.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: ... |
void createVerifier() {
ON_CALL(mock_factory_, create(_, _, _, _))
.WillByDefault(Invoke([&](const ::google::jwt_verify::CheckAudience*,
const absl::optional<std::string>& provider, bool, bool) {
return std::move(mock_auths_[provider ? provider.value() : allowfa... | 0 | [
"CWE-303",
"CWE-703"
] | envoy | ea39e3cba652bcc4b11bb0d5c62b017e584d2e5a | 16,748,121,934,897,783,000,000,000,000,000,000,000 | 9 | jwt_authn: fix a bug where JWT with wrong issuer is allowed in allow_missing case (#15194)
[jwt] When allow_missing is used inside RequiresAny, the requests with JWT with wrong issuer are accepted. This is a bug, allow_missing should only allow requests without any JWT. This change fixed the above issue by preserving ... |
static void sprint_byte_with_x(char* s, unsigned int v)
{
sprintf(s, "\\x%02x", (v & 0377));
} | 0 | [
"CWE-125"
] | oniguruma | 65a9b1aa03c9bc2dc01b074295b9603232cb3b78 | 130,673,960,019,914,720,000,000,000,000,000,000,000 | 4 | onig-5.9.2 |
BaseType_t xQueueCRReceive( QueueHandle_t xQueue,
void * pvBuffer,
TickType_t xTicksToWait )
{
BaseType_t xReturn;
Queue_t * const pxQueue = xQueue;
/* If the queue is already empty we may have to block. A critical ... | 0 | [
"CWE-200",
"CWE-190"
] | FreeRTOS-Kernel | 47338393f1f79558f6144213409f09f81d7c4837 | 104,537,479,719,765,830,000,000,000,000,000,000,000 | 88 | add assert for addition overflow on queue creation (#225) |
skip_unusable (void *dummy, u32 * keyid, PKT_user_id * uid)
{
int unusable = 0;
KBNODE keyblock;
(void) dummy;
keyblock = get_pubkeyblock (keyid);
if (!keyblock)
{
log_error ("error checking usability status of %s\n", keystr (keyid));
goto leave;
}
/* Is the user ID in question revoke... | 0 | [
"CWE-310"
] | gnupg | 4bde12206c5bf199dc6e12a74af8da4558ba41bf | 230,869,245,238,896,330,000,000,000,000,000,000,000 | 41 | gpg: Distinguish between missing and cleared key flags.
* include/cipher.h (PUBKEY_USAGE_NONE): New.
* g10/getkey.c (parse_key_usage): Set new flag.
--
We do not want to use the default capabilities (derived from the
algorithm) if any key flags are given in a signature. Thus if key
flags are used in any way, the def... |
*/
static void bfq_dispatch_remove(struct request_queue *q, struct request *rq)
{
struct bfq_queue *bfqq = RQ_BFQQ(rq);
/*
* For consistency, the next instruction should have been
* executed after removing the request from the queue and
* dispatching it. We execute instead this instruction before
* bfq_rem... | 0 | [
"CWE-416"
] | linux | 2f95fa5c955d0a9987ffdc3a095e2f4e62c5f2a9 | 264,092,195,223,578,170,000,000,000,000,000,000,000 | 21 | block, bfq: fix use-after-free in bfq_idle_slice_timer_body
In bfq_idle_slice_timer func, bfqq = bfqd->in_service_queue is
not in bfqd-lock critical section. The bfqq, which is not
equal to NULL in bfq_idle_slice_timer, may be freed after passing
to bfq_idle_slice_timer_body. So we will access the freed memory.
In ad... |
int fgetgrent_sane(FILE *stream, struct group **gr) {
struct group *g;
assert(gr);
assert(stream);
errno = 0;
g = fgetgrent(stream);
if (!g && errno != ENOENT)
return errno_or_else(EIO);
*gr = g;
return !!g;
} | 0 | [
"CWE-269"
] | systemd | 156a5fd297b61bce31630d7a52c15614bf784843 | 333,595,969,526,939,420,000,000,000,000,000,000,000 | 14 | basic/user-util: always use base 10 for user/group numbers
We would parse numbers with base prefixes as user identifiers. For example,
"0x2b3bfa0" would be interpreted as UID==45334432 and "01750" would be
interpreted as UID==1000. This parsing was used also in cases where either a
user/group name or number may be spe... |
vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
{
const ecma_compiled_code_t *bytecode_header_p = frame_ctx_p->shared_p->bytecode_header_p;
const uint8_t *byte_code_p = frame_ctx_p->byte_code_p;
ecma_value_t *literal_start_p = frame_ctx_p->literal_start_p;
ecma_value_t *stack_top_p;
uint16_t enco... | 1 | [
"CWE-416"
] | jerryscript | 3ad76f932c8d2e3b9ba2d95e64848698ec7d7290 | 117,248,586,394,637,890,000,000,000,000,000,000,000 | 3,977 | Fix for-in collection cleanup on abrupt 'has' result (#4807)
This patch fixes #4747
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik robert.fancsik@h-lab.eu |
static int request_frame(AVFilterLink *outlink)
{
AVFilterContext *ctx = outlink->src;
FPSContext *s = ctx->priv;
int frames_out = s->frames_out;
int ret = 0;
while (ret >= 0 && s->frames_out == frames_out)
ret = ff_request_frame(ctx->inputs[0]);
/* flush the fifo */
if (ret... | 0 | [
"CWE-399"
] | FFmpeg | cdd5df8189ff1537f7abe8defe971f80602cc2d2 | 6,901,170,626,839,670,000,000,000,000,000,000,000 | 30 | avfilter/vf_fps: make sure the fifo is not empty before using it
Fixes Ticket2905
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> |
fill_rect(xchar chr, cattr attr, bool sel, short y0, short x0, short y1, short x1)
{
//printf("fill_rect %d,%d..%d,%d\n", y0, x0, y1, x1);
int width = charwidth(chr);
if (chr == UCSWIDE || width < 1)
return;
wchar low = 0;
if (chr > 0xFFFF) {
low = low_surrogate(chr);
chr = high_surrogate(chr);
... | 0 | [
"CWE-703",
"CWE-770"
] | mintty | bd52109993440b6996760aaccb66e68e782762b9 | 95,332,001,799,826,800,000,000,000,000,000,000,000 | 126 | tame some window operations, just in case |
cmsBool Type_Text_Description_Write(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, void* Ptr, cmsUInt32Number nItems)
{
cmsMLU* mlu = (cmsMLU*) Ptr;
char *Text = NULL;
wchar_t *Wide = NULL;
cmsUInt32Number len, len_text, len_tag_requirement, len_aligned;
cmsBool rc = FALSE;
char Fille... | 0 | [
"CWE-125"
] | Little-CMS | 5ca71a7bc18b6897ab21d815d15e218e204581e2 | 232,734,956,882,290,300,000,000,000,000,000,000,000 | 91 | Added an extra check to MLU bounds
Thanks to Ibrahim el-sayed for spotting the bug |
int blkid_partition_get_type(blkid_partition par)
{
return par->type;
} | 0 | [] | util-linux | 50d1594c2e6142a3b51d2143c74027480df082e0 | 96,668,757,528,843,130,000,000,000,000,000,000,000 | 4 | libblkid: avoid non-empty recursion in EBR
This is extension to the patch 7164a1c34d18831ac61c6744ad14ce916d389b3f.
We also need to detect non-empty recursion in the EBR chain. It's
possible to create standard valid logical partitions and in the last one
points back to the EBR chain. In this case all offsets will be ... |
Frame::Frame()
: add_id_(0),
additional_(NULL),
additional_length_(0),
duration_(0),
duration_set_(false),
frame_(NULL),
is_key_(false),
length_(0),
track_number_(0),
timestamp_(0),
discard_padding_(0),
reference_block_timestamp_(0),
reference_... | 0 | [
"CWE-20"
] | libvpx | f00890eecdf8365ea125ac16769a83aa6b68792d | 4,521,065,496,287,207,000,000,000,000,000,000,000 | 14 | update libwebm to libwebm-1.0.0.27-352-g6ab9fcf
https://chromium.googlesource.com/webm/libwebm/+log/af81f26..6ab9fcf
Change-Id: I9d56e1fbaba9b96404b4fbabefddc1a85b79c25d |
static int dccp_v6_rcv(struct sk_buff *skb)
{
const struct dccp_hdr *dh;
struct sock *sk;
int min_cov;
/* Step 1: Check header basics */
if (dccp_invalid_packet(skb))
goto discard_it;
/* Step 1: If header checksum is incorrect, drop packet and return. */
if (dccp_v6_csum_finish(skb, &ipv6_hdr(skb)->saddr,
... | 0 | [
"CWE-362"
] | linux-2.6 | f6d8bd051c391c1c0458a30b2a7abcd939329259 | 229,075,654,521,117,200,000,000,000,000,000,000,000 | 95 | inet: add RCU protection to inet->opt
We lack proper synchronization to manipulate inet->opt ip_options
Problem is ip_make_skb() calls ip_setup_cork() and
ip_setup_cork() possibly makes a copy of ipc->opt (struct ip_options),
without any protection against another thread manipulating inet->opt.
Another thread can ch... |
// Return a visualizable uchar8 image for display routines.
CImg<ucharT> __get_select(const CImgDisplay& disp, const int normalization,
const int x, const int y, const int z) const {
if (is_empty()) return CImg<ucharT>(1,1,1,1,0);
const CImg<T> crop = get_shared_channel... | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 213,679,479,245,738,100,000,000,000,000,000,000,000 | 57 | Fix other issues in 'CImg<T>::load_bmp()'. |
int STDCALL
mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg)
{
DBUG_ENTER("mysql_option");
DBUG_PRINT("enter",("option: %d",(int) option));
switch (option) {
case MYSQL_OPT_CONNECT_TIMEOUT:
mysql->options.connect_timeout= *(uint*) arg;
break;
case MYSQL_OPT_READ_TIMEOUT:
mysql... | 1 | [
"CWE-284",
"CWE-295"
] | mysql-server | 3bd5589e1a5a93f9c224badf983cd65c45215390 | 1,420,226,730,816,010,500,000,000,000,000,000,000 | 166 | WL#6791 : Redefine client --ssl option to imply enforced encryption
# Changed the meaning of the --ssl=1 option of all client binaries
to mean force ssl, not try ssl and fail over to eunecrypted
# Added a new MYSQL_OPT_SSL_ENFORCE mysql_options()
option to specify that an ssl connection is required.
# Added a new macr... |
PHP_FUNCTION(openssl_x509_read)
{
zval *cert;
X509 *x509;
zend_resource *res;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &cert) == FAILURE) {
return;
}
x509 = php_openssl_x509_from_zval(cert, 1, &res);
ZVAL_RES(return_value, res);
if (x509 == NULL) {
php_error_docref(NULL, E_WARNING, "supplied parame... | 0 | [
"CWE-326"
] | php-src | 0216630ea2815a5789a24279a1211ac398d4de79 | 18,441,305,779,758,482,000,000,000,000,000,000,000 | 17 | Fix bug #79601 (Wrong ciphertext/tag in AES-CCM encryption for a 12 bytes IV) |
lexer_compare_identifier_to_chars (const uint8_t *left_p, /**< left identifier */
const uint8_t *right_p, /**< right identifier string */
size_t size) /**< byte size of the two identifiers */
{
uint8_t utf8_buf[6];
do
{
if (*left_p == *rig... | 0 | [
"CWE-288"
] | jerryscript | f3a420b672927037beb4508d7bdd68fb25d2caf6 | 228,690,461,328,817,500,000,000,000,000,000,000,000 | 50 | Fix class static block opening brace parsing (#4942)
The next character should not be consumed after finding the static block opening brace.
This patch fixes #4916.
JerryScript-DCO-1.0-Signed-off-by: Martin Negyokru negyokru@inf.u-szeged.hu |
crm_send_plaintext(int sock, const char *buf, size_t len)
{
int rc = 0;
const char *unsent = buf;
int total_send;
if (buf == NULL) {
return -1;
}
total_send = len;
crm_trace("Message on socket %d: size=%d", sock, len);
retry:
rc = write(sock, unsent, len);
if (rc < 0) {
... | 0 | [
"CWE-399"
] | pacemaker | 564f7cc2a51dcd2f28ab12a13394f31be5aa3c93 | 258,816,056,633,832,980,000,000,000,000,000,000,000 | 39 | High: core: Internal tls api improvements for reuse with future LRMD tls backend. |
mech_rpa_auth_phase1(struct auth_request *auth_request,
const unsigned char *data, size_t data_size)
{
struct rpa_auth_request *request =
(struct rpa_auth_request *)auth_request;
const unsigned char *token2;
size_t token2_size;
const char *service, *error;
if (!rpa_parse_token1(data, data_size, &error)) ... | 0 | [
"CWE-125"
] | core | 69ad3c902ea4bbf9f21ab1857d8923f975dc6145 | 250,215,650,727,675,700,000,000,000,000,000,000,000 | 26 | auth: mech-rpa - Fail on zero len buffer |
static struct ldb_message_element *map_objectclass_generate_local(struct ldb_module *module, void *mem_ctx, const char *local_attr, const struct ldb_message *remote)
{
const struct ldb_map_context *data = map_get_context(module);
struct ldb_context *ldb;
struct ldb_message_element *el, *oc;
struct ldb_val val;
uns... | 0 | [
"CWE-200"
] | samba | 0a3aa5f908e351201dc9c4d4807b09ed9eedff77 | 305,320,487,535,622,320,000,000,000,000,000,000,000 | 56 | 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... |
template<typename t>
CImg<doubleT> eval(const char *const expression, const CImg<t>& xyzc,
const CImgList<T> *const list_inputs=0, CImgList<T> *const list_outputs=0) const {
return _eval(0,expression,xyzc,list_inputs,list_outputs); | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 173,678,627,646,134,850,000,000,000,000,000,000,000 | 4 | Fix other issues in 'CImg<T>::load_bmp()'. |
bool dwgReader18::readDwgTables(DRW_Header& hdr) {
DRW_DBG("\ndwgReader18::readDwgTables\n");
dwgSectionInfo si = sections[secEnum::OBJECTS];
if (si.Id < 0 //not found, ends
|| !parseDataPage( si/*, objData*/)) {
return false;
}
//global store for uncompressed data of all pages
... | 0 | [
"CWE-191"
] | libdxfrw | ba3fa95648bef948e008dfbdd31a4d21badd71f0 | 284,620,034,096,594,460,000,000,000,000,000,000,000 | 17 | fixed out-of-bounds write vulnerability CVE-2021-21898
as reported in TALOS-2021-1349 / CVE-2021-21898,
dwgCompressor::decompress18() could be abused with a malformed DWG file
to force out-of-bounds write and possibly lead to malicious code
execution. |
static void** cdeque_filter_p(struct filter_info** f) {
return (void**) (size_t) f;
} | 0 | [
"CWE-20",
"CWE-125"
] | libarchive | 94821008d6eea81e315c5881cdf739202961040a | 304,067,395,521,952,530,000,000,000,000,000,000,000 | 3 | RAR5 reader: reject files that declare invalid header flags
One of the fields in RAR5's base block structure is the size of the
header. Some invalid files declare a 0 header size setting, which can
confuse the unpacker. Minimum header size for RAR5 base blocks is 7
bytes (4 bytes for CRC, and 3 bytes for the rest), so... |
read_mysql_one_value(MYSQL *connection, const char *query)
{
MYSQL_RES *mysql_result;
MYSQL_ROW row;
char *result = NULL;
mysql_result = xb_mysql_query(connection, query, true);
ut_ad(mysql_num_fields(mysql_result) == 1);
if ((row = mysql_fetch_row(mysql_result))) {
result = strdup(row[0]);
}
mysql_free_r... | 0 | [
"CWE-200"
] | percona-xtrabackup | 7742f875bb289a874246fb4653b7cd9f14b588fe | 300,995,253,752,549,320,000,000,000,000,000,000,000 | 18 | PXB-2722 password is written into xtrabackup_info
https://jira.percona.com/browse/PXB-2722
Analysis:
password passed with -p option is written into backup tool_command in xtrabackup_info
Fix:
mask password before writting into xtrabackup_info |
virtual bool count_sargable_conds(void *arg) { return 0; } | 0 | [
"CWE-617"
] | server | 2e7891080667c59ac80f788eef4d59d447595772 | 21,623,167,356,014,114,000,000,000,000,000,000,000 | 1 | MDEV-25635 Assertion failure when pushing from HAVING into WHERE of view
This bug could manifest itself after pushing a where condition over a
mergeable derived table / view / CTE DT into a grouping view / derived
table / CTE V whose item list contained set functions with constant
arguments such as MIN(2), SUM(1) etc.... |
static int ethtool_get_ufo(struct net_device *dev, char __user *useraddr)
{
struct ethtool_value edata = { ETHTOOL_GTSO };
if (!dev->ethtool_ops->get_ufo)
return -EOPNOTSUPP;
edata.data = dev->ethtool_ops->get_ufo(dev);
if (copy_to_user(useraddr, &edata, sizeof(edata)))
return -EFAULT;
return 0;
} | 0 | [] | linux | e89e9cf539a28df7d0eb1d0a545368e9920b34ac | 308,930,348,487,153,880,000,000,000,000,000,000,000 | 11 | [IPv4/IPv6]: UFO Scatter-gather approach
Attached is kernel patch for UDP Fragmentation Offload (UFO) feature.
1. This patch incorporate the review comments by Jeff Garzik.
2. Renamed USO as UFO (UDP Fragmentation Offload)
3. udp sendfile support with UFO
This patches uses scatter-gather feature of skb to generate l... |
httpClientHandlerHeaders(FdEventHandlerPtr event, StreamRequestPtr srequest,
HTTPConnectionPtr connection)
{
HTTPRequestPtr request;
int rc;
int method, version;
AtomPtr url = NULL;
int start;
int code;
AtomPtr message;
start = 0;
/* Work around clients work... | 0 | [
"CWE-617"
] | polipo | 0e2b44af619e46e365971ea52b97457bc0778cd3 | 232,039,910,422,287,940,000,000,000,000,000,000,000 | 76 | Try to read POST requests to local configuration interface correctly. |
pushParseTest(const char *filename, const char *result,
const char *err ATTRIBUTE_UNUSED,
int options) {
xmlParserCtxtPtr ctxt;
xmlDocPtr doc;
const char *base;
int size, res;
int cur = 0;
nb_tests++;
/*
* load the document in memory and work from there.
*/
... | 1 | [
"CWE-125"
] | libxml2 | a820dbeac29d330bae4be05d9ecd939ad6b4aa33 | 48,274,254,203,674,830,000,000,000,000,000,000,000 | 84 | Bug 758605: Heap-based buffer overread in xmlDictAddString <https://bugzilla.gnome.org/show_bug.cgi?id=758605>
Reviewed by David Kilzer.
* HTMLparser.c:
(htmlParseName): Add bounds check.
(htmlParseNameComplex): Ditto.
* result/HTML/758605.html: Added.
* result/HTML/758605.html.err: Added.
* result/HTML/758605.html.s... |
g_NPN_MemFree(void *ptr)
{
D(bugiI("NPN_MemFree ptr=%p\n", ptr));
NPW_MemFree(ptr);
D(bugiD("NPN_MemFree done\n"));
} | 0 | [
"CWE-264"
] | nspluginwrapper | 7e4ab8e1189846041f955e6c83f72bc1624e7a98 | 174,060,787,254,472,820,000,000,000,000,000,000,000 | 6 | Support all the new variables added |
void KrecipesView::moveTipButton( int, int )
{
contextButton->setGeometry( leftPanel->width() - 42, leftPanel->height() - 42, 32, 32 );
} | 0 | [] | krecipes | cd1490fb5fe82cbe9172a43be13298001b446ecd | 235,489,774,471,229,400,000,000,000,000,000,000,000 | 4 | Use WebKit instead of KHTML for printing recipes, fixes sourceforge #2990118 and
#2960140.
svn path=/trunk/extragear/utils/krecipes/; revision=1137824 |
inline bool WireFormatLite::ReadPackedPrimitive(io::CodedInputStream* input,
RepeatedField<CType>* values) {
int length;
if (!input->ReadVarintSizeAsInt(&length)) return false;
io::CodedInputStream::Limit limit = input->PushLimit(length);
while (input->BytesUntilL... | 0 | [
"CWE-703"
] | protobuf | d1635e1496f51e0d5653d856211e8821bc47adc4 | 135,410,193,735,721,520,000,000,000,000,000,000,000 | 13 | Apply patch |
static bool create_db_dir(char *fnam)
{
char *p = alloca(strlen(fnam)+1);
strcpy(p, fnam);
fnam = p;
p = p + 1;
again:
while (*p && *p != '/') p++;
if (!*p)
return true;
*p = '\0';
if (mkdir(fnam, 0755) && errno != EEXIST) {
fprintf(stderr, "failed to create %s\n", fnam);
*p = '/';
return false;
}
*(... | 0 | [
"CWE-284",
"CWE-862"
] | lxc | 16af238036a5464ae8f2420ed3af214f0de875f9 | 337,587,564,323,983,060,000,000,000,000,000,000,000 | 20 | CVE-2017-5985: Ensure target netns is caller-owned
Before this commit, lxc-user-nic could potentially have been tricked into
operating on a network namespace over which the caller did not hold privilege.
This commit ensures that the caller is privileged over the network namespace by
temporarily dropping privilege.
L... |
static int is_ncq(uint8_t ata_cmd)
{
/* Based on SATA 3.2 section 13.6.3.2 */
switch (ata_cmd) {
case READ_FPDMA_QUEUED:
case WRITE_FPDMA_QUEUED:
case NCQ_NON_DATA:
case RECEIVE_FPDMA_QUEUED:
case SEND_FPDMA_QUEUED:
return 1;
default:
return 0;
}
} | 0 | [
"CWE-772",
"CWE-401"
] | qemu | d68f0f778e7f4fbd674627274267f269e40f0b04 | 332,437,085,084,824,740,000,000,000,000,000,000,000 | 14 | ide: ahci: call cleanup function in ahci unit
This can avoid memory leak when hotunplug the ahci device.
Signed-off-by: Li Qiang <liqiang6-s@360.cn>
Message-id: 1488449293-80280-4-git-send-email-liqiang6-s@360.cn
Signed-off-by: John Snow <jsnow@redhat.com> |
static int hardware_enable_all(void)
{
int r = 0;
raw_spin_lock(&kvm_count_lock);
kvm_usage_count++;
if (kvm_usage_count == 1) {
atomic_set(&hardware_enable_failed, 0);
on_each_cpu(hardware_enable_nolock, NULL, 1);
if (atomic_read(&hardware_enable_failed)) {
hardware_disable_all_nolock();
r = -EBUSY;... | 0 | [
"CWE-416"
] | linux | 0774a964ef561b7170d8d1b1bfe6f88002b6d219 | 332,342,252,135,534,500,000,000,000,000,000,000,000 | 21 | KVM: Fix out of range accesses to memslots
Reset the LRU slot if it becomes invalid when deleting a memslot to fix
an out-of-bounds/use-after-free access when searching through memslots.
Explicitly check for there being no used slots in search_memslots(), and
in the caller of s390's approximation variant.
Fixes: 369... |
int g_dhcpv6_client_set_ias(GDHCPClient *dhcp_client, int index,
int code, uint32_t *T1, uint32_t *T2,
GSList *addresses)
{
GSList *list;
uint8_t *ia_options, *pos;
int len, count, total_len;
count = g_slist_length(addresses);
if (count == 0)
return -EINVAL;
g_dhcp_client_set_request(dhcp_client, code);... | 0 | [] | connman | a74524b3e3fad81b0fd1084ffdf9f2ea469cd9b1 | 299,840,304,223,563,900,000,000,000,000,000,000,000 | 60 | gdhcp: Avoid leaking stack data via unitiialized variable
Fixes: CVE-2021-26676 |
void fmtutil_free_SAUCE(deark *c, struct de_SAUCE_info *si)
{
if(!si) return;
ucstring_destroy(si->title);
ucstring_destroy(si->artist);
ucstring_destroy(si->organization);
ucstring_destroy(si->comment);
de_free(c, si);
} | 0 | [
"CWE-369"
] | deark | 62acb7753b0e3c0d3ab3c15057b0a65222313334 | 95,699,890,042,228,370,000,000,000,000,000,000,000 | 9 | pict,macrsrc: Fixed a bug that could cause division by 0
Found by F. Çelik. |
static int mov_write_mdhd_tag(AVIOContext *pb, MOVMuxContext *mov,
MOVTrack *track)
{
int version = track->track_duration < INT32_MAX ? 0 : 1;
if (track->mode == MODE_ISM)
version = 1;
(version == 1) ? avio_wb32(pb, 44) : avio_wb32(pb, 32); /* size */
ffio_wfourcc... | 0 | [
"CWE-369"
] | FFmpeg | 2c0e98a0b478284bdff6d7a4062522605a8beae5 | 98,248,213,101,904,600,000,000,000,000,000,000,000 | 38 | avformat/movenc: Write version 2 of audio atom if channels is not known
The version 1 needs the channel count and would divide by 0
Fixes: division by 0
Fixes: fpe_movenc.c_1108_1.ogg
Fixes: fpe_movenc.c_1108_2.ogg
Fixes: fpe_movenc.c_1108_3.wav
Found-by: #CHEN HONGXU# <HCHEN017@e.ntu.edu.sg>
Signed-off-by: Michael N... |
hstoreCheckValLen(size_t len)
{
if (len > HSTORE_MAX_VALUE_LEN)
ereport(ERROR,
(errcode(ERRCODE_STRING_DATA_RIGHT_TRUNCATION),
errmsg("string too long for hstore value")));
return len;
} | 0 | [
"CWE-703",
"CWE-189"
] | postgres | 31400a673325147e1205326008e32135a78b4d8a | 130,659,673,222,596,230,000,000,000,000,000,000,000 | 8 | Predict integer overflow to avoid buffer overruns.
Several functions, mostly type input functions, calculated an allocation
size such that the calculation wrapped to a small positive value when
arguments implied a sufficiently-large requirement. Writes past the end
of the inadvertent small allocation followed shortly... |
static int io_madvise(struct io_kiocb *req, bool force_nonblock)
{
#if defined(CONFIG_ADVISE_SYSCALLS) && defined(CONFIG_MMU)
struct io_madvise *ma = &req->madvise;
int ret;
if (force_nonblock)
return -EAGAIN;
ret = do_madvise(ma->addr, ma->len, ma->advice);
if (ret < 0)
req_set_fail_links(req);
io_req_comp... | 0 | [] | linux | 0f2122045b946241a9e549c2a76cea54fa58a7ff | 180,270,668,096,761,000,000,000,000,000,000,000,000 | 18 | io_uring: don't rely on weak ->files references
Grab actual references to the files_struct. To avoid circular references
issues due to this, we add a per-task note that keeps track of what
io_uring contexts a task has used. When the tasks execs or exits its
assigned files, we cancel requests based on this tracking.
W... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.