func
string
target
int64
cwe
list
project
string
commit_id
string
hash
float64
size
int64
message
string
static void ip6_mc_clear_src(struct ifmcaddr6 *pmc) { struct ip6_sf_list *psf, *nextpsf; for (psf = mc_dereference(pmc->mca_tomb, pmc->idev); psf; psf = nextpsf) { nextpsf = mc_dereference(psf->sf_next, pmc->idev); kfree_rcu(psf, rcu); } RCU_INIT_POINTER(pmc->mca_tomb, NULL); for (psf = mc_derefer...
0
[ "CWE-703" ]
linux
2d3916f3189172d5c69d33065c3c21119fe539fc
16,235,130,752,354,420,000,000,000,000,000,000,000
22
ipv6: fix skb drops in igmp6_event_query() and igmp6_event_report() While investigating on why a synchronize_net() has been added recently in ipv6_mc_down(), I found that igmp6_event_query() and igmp6_event_report() might drop skbs in some cases. Discussion about removing synchronize_net() from ipv6_mc_down() will ha...
static int readContigStripsIntoBuffer (TIFF* in, uint8* buf) { uint8* bufp = buf; int32 bytes_read = 0; uint32 strip, nstrips = TIFFNumberOfStrips(in); uint32 stripsize = TIFFStripSize(in); uint32 rows = 0; uint32 rps = TIFFGetFieldDefaulted(in, TIFFTAG_ROWSPERSTRIP, &...
0
[ "CWE-119", "CWE-125" ]
libtiff
9657bbe3cdce4aaa90e07d50c1c70ae52da0ba6a
133,550,630,117,062,810,000,000,000,000,000,000,000
33
* tools/tiffcrop.c: fix readContigStripsIntoBuffer() in -i (ignore) mode so that the output buffer is correctly incremented to avoid write outside bounds. Reported by Agostino Sarubbo. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2620
set_next_entity(struct cfs_rq *cfs_rq, struct sched_entity *se) { /* 'current' is not kept within the tree. */ if (se->on_rq) { /* * Any task has to be enqueued before it get to execute on * a CPU. So account for the time it spent waiting on the * runqueue. */ update_stats_wait_end(cfs_rq, se); __de...
0
[ "CWE-400", "CWE-703" ]
linux
de53fd7aedb100f03e5d2231cfce0e4993282425
153,023,188,896,855,550,000,000,000,000,000,000,000
31
sched/fair: Fix low cpu usage with high throttling by removing expiration of cpu-local slices It has been observed, that highly-threaded, non-cpu-bound applications running under cpu.cfs_quota_us constraints can hit a high percentage of periods throttled while simultaneously not consuming the allocated amount of quota...
int dev_queue_xmit(struct sk_buff *skb) { struct net_device *dev = skb->dev; struct Qdisc *q; int rc = -ENOMEM; if (skb_shinfo(skb)->frag_list && !(dev->features & NETIF_F_FRAGLIST) && __skb_linearize(skb, GFP_ATOMIC)) goto out_kfree_skb; /* Fragmented skb is linearized if device does not support SG,...
0
[]
linux
e89e9cf539a28df7d0eb1d0a545368e9920b34ac
274,172,312,789,388,920,000,000,000,000,000,000,000
118
[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...
static int cgw_create_job(struct sk_buff *skb, struct nlmsghdr *nlh) { struct rtcanmsg *r; struct cgw_job *gwj; u8 limhops = 0; int err = 0; if (!capable(CAP_NET_ADMIN)) return -EPERM; if (nlmsg_len(nlh) < sizeof(*r)) return -EINVAL; r = nlmsg_data(nlh); if (r->can_family != AF_CAN) return -EPFNOSUPPO...
1
[ "CWE-264" ]
net
90f62cf30a78721641e08737bda787552428061e
39,854,075,253,429,760,000,000,000,000,000,000,000
71
net: Use netlink_ns_capable to verify the permisions of netlink messages It is possible by passing a netlink socket to a more privileged executable and then to fool that executable into writing to the socket data that happens to be valid netlink message to do something that privileged executable did not intend to do. ...
vpeekc_nomap(void) { int c; ++no_mapping; ++allow_keys; c = vpeekc(); --no_mapping; --allow_keys; return c; }
0
[ "CWE-78" ]
vim
53575521406739cf20bbe4e384d88e7dca11f040
321,007,160,438,434,200,000,000,000,000,000,000,000
11
patch 8.1.1365: source command doesn't check for the sandbox Problem: Source command doesn't check for the sandbox. (Armin Razmjou) Solution: Check for the sandbox when sourcing a file.
flac_buffer_copy (SF_PRIVATE *psf) { FLAC_PRIVATE* pflac = (FLAC_PRIVATE*) psf->codec_data ; const FLAC__Frame *frame = pflac->frame ; const int32_t* const *buffer = pflac->wbuffer ; unsigned i = 0, j, offset, channels, len ; /* ** frame->header.blocksize is variable and we're using a constant blocksize ** of FL...
1
[ "CWE-119", "CWE-369" ]
libsndfile
60b234301adf258786d8b90be5c1d437fc8799e0
205,493,450,905,298,480,000,000,000,000,000,000,000
155
src/flac.c: Improve error handling Especially when dealing with corrupt or malicious files.
//! Calculate greatest common divisor. inline long gcd(long a, long b) { while (a) { const long c = a; a = b%a; b = c; } return b;
0
[ "CWE-125" ]
CImg
10af1e8c1ad2a58a0a3342a856bae63e8f257abb
129,578,187,842,694,570,000,000,000,000,000,000,000
4
Fix other issues in 'CImg<T>::load_bmp()'.
void MSG_WriteData( msg_t *buf, const void *data, int length ) { int i; for(i=0;i<length;i++) { MSG_WriteByte(buf, ((byte *)data)[i]); } }
0
[ "CWE-119" ]
ioq3
d2b1d124d4055c2fcbe5126863487c52fd58cca1
152,890,657,855,318,680,000,000,000,000,000,000,000
6
Fix/improve buffer overflow in MSG_ReadBits/MSG_WriteBits Prevent reading past end of message in MSG_ReadBits. If read past end of msg->data buffer (16348 bytes) the engine could SEGFAULT. Make MSG_WriteBits use an exact buffer overflow check instead of possibly failing with a few bytes left.
list_pending_descriptor_downloads(digestmap_t *result, int extrainfo) { int purpose = extrainfo ? DIR_PURPOSE_FETCH_EXTRAINFO : DIR_PURPOSE_FETCH_SERVERDESC; list_pending_downloads(result, purpose, "d/"); }
0
[ "CWE-399" ]
tor
308f6dad20675c42b29862f4269ad1fbfb00dc9a
232,963,062,893,205,700,000,000,000,000,000,000,000
6
Mitigate a side-channel leak of which relays Tor chooses for a circuit Tor's and OpenSSL's current design guarantee that there are other leaks, but this one is likely to be more easily exploitable, and is easy to fix.
int ldb_dn_update_components(struct ldb_dn *dn, const struct ldb_dn *ref_dn) { dn->components = talloc_realloc(dn, dn->components, struct ldb_dn_component, ref_dn->comp_num); if (!dn->components) { return LDB_ERR_OPERATIONS_ERROR; } memcpy(dn->components, ref_dn->components, sizeof(struct ldb_dn_comp...
0
[ "CWE-200" ]
samba
7f51ec8c4ed9ba1f53d722e44fb6fb3cde933b72
207,929,220,117,810,650,000,000,000,000,000,000,000
17
CVE-2015-5330: ldb_dn: simplify and fix ldb_dn_escape_internal() Previously we relied on NUL terminated strings and jumped back and forth between copying escaped bytes and memcpy()ing un-escaped chunks. This simple version is easier to reason about and works with unterminated strings. It may also be faster as it avoid...
void ip_cmsg_recv(struct msghdr *msg, struct sk_buff *skb) { struct inet_sock *inet = inet_sk(skb->sk); unsigned flags = inet->cmsg_flags; /* Ordered by supposed usage frequency */ if (flags & 1) ip_cmsg_recv_pktinfo(msg, skb); if ((flags >>= 1) == 0) return; if (flags & 1) ip_cmsg_recv_ttl(msg, skb); if...
0
[ "CWE-362" ]
linux-2.6
f6d8bd051c391c1c0458a30b2a7abcd939329259
164,952,181,974,977,630,000,000,000,000,000,000,000
40
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...
str_val(struct tbl *vp) { char *s; if ((vp->flag&SPECIAL)) getspec(vp); if (!(vp->flag&ISSET)) /* special to dollar() */ s = null; else if (!(vp->flag&INTEGER)) /* string source */ s = vp->val.s + vp->type; else { /* integer source */ mksh_uari_t n; unsigned int base; /** * worst case number ...
0
[]
mksh
de53d2df1c3b812c262cc1bddbfe0b3bfc25c14b
303,286,769,033,763,620,000,000,000,000,000,000,000
68
SECURITY: do not permit += from environment either this makes our environment filter/sanitisation complete
do_include(struct xkb_compose_table *table, struct scanner *s, const char *path, unsigned include_depth) { FILE *file; bool ok; char *string; size_t size; struct scanner new_s; if (include_depth >= MAX_INCLUDE_DEPTH) { scanner_err(s, "maximum include depth (%d) exceeded; mayb...
0
[ "CWE-835" ]
libxkbcommon
842e4351c2c97de6051cab6ce36b4a81e709a0e1
163,218,270,104,462,250,000,000,000,000,000,000,000
41
compose: fix infinite loop in parser on some inputs The parser would enter an infinite loop if an unterminated keysym literal occurs at EOF. Found with the afl fuzzer. Signed-off-by: Ran Benita <ran234@gmail.com>
JSON::checkSchema(JSON schema, std::list<std::string>& errors) { return checkSchemaInternal(this->m->value.getPointer(), schema.m->value.getPointer(), errors, ""); }
0
[ "CWE-787" ]
qpdf
d71f05ca07eb5c7cfa4d6d23e5c1f2a800f52e8e
249,541,618,265,393,920,000,000,000,000,000,000,000
6
Fix sign and conversion warnings (major) This makes all integer type conversions that have potential data loss explicit with calls that do range checks and raise an exception. After this commit, qpdf builds with no warnings when -Wsign-conversion -Wconversion is used with gcc or clang or when -W3 -Wd4800 is used with ...
const T* data() const { return buffer_; }
0
[]
envoy
3b5acb2f43548862dadb243de7cf3994986a8e04
287,428,093,219,467,850,000,000,000,000,000,000,000
1
http, url: Bring back chromium_url and http_parser_parse_url (#198) * Revert GURL as HTTP URL parser utility This reverts: 1. commit c9c4709c844b90b9bb2935d784a428d667c9df7d 2. commit d828958b591a6d79f4b5fa608ece9962b7afbe32 3. commit 2d69e30c51f2418faf267aaa6c1126fce9948c62 Signed-off-by: Dhi Aurrahman <dio@tetrat...
int ssl3_connect(SSL *s) { BUF_MEM *buf=NULL; unsigned long Time=(unsigned long)time(NULL); void (*cb)(const SSL *ssl,int type,int val)=NULL; int ret= -1; int new_state,state,skip=0; RAND_add(&Time,sizeof(Time),0); ERR_clear_error(); clear_sys_error(); if (s->info_callback != NULL) cb=s->info_callback; e...
0
[]
openssl
edc032b5e3f3ebb1006a9c89e0ae00504f47966f
32,820,016,505,059,125,000,000,000,000,000,000,000
450
Add SRP support.
int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r) { return( ASN1_item_verify(ASN1_ITEM_rptr(X509_REQ_INFO), a->sig_alg,a->signature,a->req_info,r)); }
0
[ "CWE-310" ]
openssl
684400ce192dac51df3d3e92b61830a6ef90be3e
202,240,143,060,536,240,000,000,000,000,000,000,000
5
Fix various certificate fingerprint issues. By using non-DER or invalid encodings outside the signed portion of a certificate the fingerprint can be changed without breaking the signature. Although no details of the signed portion of the certificate can be changed this can cause problems with some applications: e.g. t...
static void *get_a_tx_buf(struct virtproc_info *vrp) { unsigned int len; void *ret; /* support multiple concurrent senders */ mutex_lock(&vrp->tx_lock); /* * either pick the next unused tx buffer * (half of our buffers are used for sending messages) */ if (vrp->last_sbuf < vrp->num_bufs / 2) ret = vrp->...
0
[ "CWE-415" ]
linux
1680939e9ecf7764fba8689cfb3429c2fe2bb23c
221,564,145,486,651,240,000,000,000,000,000,000,000
22
rpmsg: virtio: Fix possible double free in rpmsg_virtio_add_ctrl_dev() vch will be free in virtio_rpmsg_release_device() when rpmsg_ctrldev_register_device() fails. There is no need to call kfree() again. Fixes: c486682ae1e2 ("rpmsg: virtio: Register the rpmsg_char device") Signed-off-by: Hangyu Hua <hbh25y@gmail.com...
void update_region(struct vc_data *vc, unsigned long start, int count) { WARN_CONSOLE_UNLOCKED(); if (con_should_update(vc)) { hide_cursor(vc); do_update_region(vc, start, count); set_cursor(vc); } }
0
[ "CWE-125" ]
linux
3c4e0dff2095c579b142d5a0693257f1c58b4804
293,217,307,074,243,440,000,000,000,000,000,000,000
10
vt: Disable KD_FONT_OP_COPY It's buggy: On Fri, Nov 06, 2020 at 10:30:08PM +0800, Minh Yuan wrote: > We recently discovered a slab-out-of-bounds read in fbcon in the latest > kernel ( v5.10-rc2 for now ). The root cause of this vulnerability is that > "fbcon_do_set_font" did not handle "vc->vc_font.data" and > "vc->...
virtual bool need_metadata_upload() const { return false; }
0
[ "CWE-770" ]
ceph
ab29bed2fc9f961fe895de1086a8208e21ddaddc
324,000,360,612,770,170,000,000,000,000,000,000,000
1
rgw: fix issues with 'enforce bounds' patch The patch to enforce bounds on max-keys/max-uploads/max-parts had a few issues that would prevent us from compiling it. Instead of changing the code provided by the submitter, we're addressing them in a separate commit to maintain the DCO. Signed-off-by: Joao Eduardo Luis <...
startTimer(void) { /* * Do nothing */ }
0
[ "CWE-416" ]
libxml2
1358d157d0bd83be1dfe356a69213df9fac0b539
281,572,314,821,487,000,000,000,000,000,000,000,000
6
Fix use-after-free with `xmllint --html --push` Call htmlCtxtUseOptions to make sure that names aren't stored in dictionaries. Note that this issue only affects xmllint using the HTML push parser. Fixes #230.
string validateSocketAddress(NegotiationDetails &details, const string &_address) const { string address = _address; stringstream error; switch (getSocketAddressType(address)) { case SAT_UNIX: { address = fixupSocketAddress(*details.options, address); string filename = parseUnixSocketAddress(address); ...
0
[ "CWE-200", "CWE-61" ]
passenger
4043718264095cde6623c2cbe8c644541036d7bf
43,244,250,387,337,090,000,000,000,000,000,000,000
44
Disable unused feature.
ffs_epfile_open(struct inode *inode, struct file *file) { struct ffs_epfile *epfile = inode->i_private; ENTER(); if (WARN_ON(epfile->ffs->state != FFS_ACTIVE)) return -ENODEV; file->private_data = epfile; ffs_data_opened(epfile->ffs); return 0; }
0
[ "CWE-416", "CWE-362" ]
linux
38740a5b87d53ceb89eb2c970150f6e94e00373a
322,827,504,114,553,700,000,000,000,000,000,000,000
14
usb: gadget: f_fs: Fix use-after-free When using asynchronous read or write operations on the USB endpoints the issuer of the IO request is notified by calling the ki_complete() callback of the submitted kiocb when the URB has been completed. Calling this ki_complete() callback will free kiocb. Make sure that the str...
DirectFunctionCall7Coll(PGFunction func, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4, Datum arg5, Datum arg6, Datum arg7) { FunctionCallInfoData fcinfo; Datum result; InitFunctionCallInfoData(fcinfo, NULL, 7, collation, NULL, NULL); fcinfo.arg[0] = arg1; fcinfo.arg[1] = arg2; fcin...
0
[ "CWE-264" ]
postgres
537cbd35c893e67a63c59bc636c3e888bd228bc7
55,668,931,539,321,070,000,000,000,000,000,000,000
32
Prevent privilege escalation in explicit calls to PL validators. The primary role of PL validators is to be called implicitly during CREATE FUNCTION, but they are also normal functions that a user can call explicitly. Add a permissions check to each validator to ensure that a user cannot use explicit validator calls ...
static inline int security_socket_setsockopt(struct socket *sock, int level, int optname) { return 0; }
0
[]
linux-2.6
ee18d64c1f632043a02e6f5ba5e045bb26a5465f
216,032,883,868,419,930,000,000,000,000,000,000,000
5
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...
int X509_TRUST_get_trust(X509_TRUST *xp) { return xp->trust; }
0
[]
openssl
33cc5dde478ba5ad79f8fd4acd8737f0e60e236e
69,106,375,837,992,040,000,000,000,000,000,000,000
4
Compat self-signed trust with reject-only aux data When auxiliary data contains only reject entries, continue to trust self-signed objects just as when no auxiliary data is present. This makes it possible to reject specific uses without changing what's accepted (and thus overring the underlying EKU). Added new suppo...
static int minix_statfs(struct dentry *dentry, struct kstatfs *buf) { struct minix_sb_info *sbi = minix_sb(dentry->d_sb); buf->f_type = dentry->d_sb->s_magic; buf->f_bsize = dentry->d_sb->s_blocksize; buf->f_blocks = (sbi->s_nzones - sbi->s_firstdatazone) << sbi->s_log_zone_size; buf->f_bfree = minix_count_free_bl...
0
[ "CWE-189" ]
linux-2.6
f5fb09fa3392ad43fbcfc2f4580752f383ab5996
201,105,527,621,063,260,000,000,000,000,000,000,000
13
[PATCH] Fix for minix crash Mounting a (corrupt) minix filesystem with zero s_zmap_blocks gives a spectacular crash on my 2.6.17.8 system, no doubt because minix/inode.c does an unconditional minix_set_bit(0,sbi->s_zmap[0]->b_data); [akpm@osdl.org: make labels conistent while we're there] Signed-off-by: Andrew Mort...
static int b43_bcma_probe(struct bcma_device *core) { struct b43_bus_dev *dev; struct b43_wl *wl; int err; dev = b43_bus_dev_bcma_init(core); if (!dev) return -ENODEV; wl = b43_wireless_init(dev); if (IS_ERR(wl)) { err = PTR_ERR(wl); goto bcma_out; } err = b43_one_core_attach(dev, wl); if (err) got...
0
[ "CWE-134" ]
wireless
9538cbaab6e8b8046039b4b2eb6c9d614dc782bd
198,213,034,851,556,080,000,000,000,000,000,000,000
31
b43: stop format string leaking into error msgs The module parameter "fwpostfix" is userspace controllable, unfiltered, and is used to define the firmware filename. b43_do_request_fw() populates ctx->errors[] on error, containing the firmware filename. b43err() parses its arguments as a format string. For systems with...
GPMF_ERR GPMF_Init(GPMF_stream *ms, uint32_t *buffer, int datasize) { if(ms) { ms->buffer = buffer; ms->buffer_size_longs = datasize >>2; GPMF_ResetState(ms); return GPMF_OK; } return GPMF_ERROR_MEMORY; }
0
[ "CWE-125", "CWE-369", "CWE-787" ]
gpmf-parser
341f12cd5b97ab419e53853ca00176457c9f1681
14,670,123,683,516,897,000,000,000,000,000,000,000
14
fixed many security issues with the too crude mp4 reader
napi_status napi_delete_element(napi_env env, napi_value object, uint32_t index, bool* result) { NAPI_PREAMBLE(env); v8::Local<v8::Context> context = env->context(); v8::Local<v8::Object> obj; CHECK_TO_OBJECT(env, ...
0
[ "CWE-191" ]
node
656260b4b65fec3b10f6da3fdc9f11fb941aafb5
60,106,863,940,846,240,000,000,000,000,000,000,000
18
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...
gx_image_enum_alloc(const gs_image_common_t * pic, const gs_int_rect * prect, gs_memory_t * mem, gx_image_enum **ppenum) { const gs_pixel_image_t *pim = (const gs_pixel_image_t *)pic; int width = pim->Width, height = pim->Height; int bpc = pim->BitsPerComponent; g...
1
[]
ghostpdl
cffb5712bc10c2c2f46adf311fc74aaae74cb784
114,964,084,093,293,600,000,000,000,000,000,000,000
58
Commit a9a58bb95 was incorrect, clearing some values that it shouldn't The penum->rect values were cleared, and this didn't cover all uses of gx_image_enum_alloc. Also, return *ppenum NULL if alloc fails in case the caller doesn't check the return code. Also, if we fail the enum_begin, free the enum and set *pinfo to ...
static void ax88179_disable_eee(struct usbnet *dev) { u16 tmp16; tmp16 = GMII_PHY_PGSEL_PAGE3; ax88179_write_cmd(dev, AX_ACCESS_PHY, AX88179_PHY_ID, GMII_PHY_PAGE_SELECT, 2, &tmp16); tmp16 = 0x3246; ax88179_write_cmd(dev, AX_ACCESS_PHY, AX88179_PHY_ID, MII_PHYADDR, 2, &tmp16); tmp16 = GMII_PHY_PGSEL_...
0
[ "CWE-787" ]
linux
57bc3d3ae8c14df3ceb4e17d26ddf9eeab304581
317,088,019,677,588,700,000,000,000,000,000,000,000
16
net: usb: ax88179_178a: Fix out-of-bounds accesses in RX fixup ax88179_rx_fixup() contains several out-of-bounds accesses that can be triggered by a malicious (or defective) USB device, in particular: - The metadata array (hdr_off..hdr_off+2*pkt_cnt) can be out of bounds, causing OOB reads and (on big-endian syst...
bool IsValidNodeName(StringPiece s, bool allow_internal_ops) { using ::tensorflow::strings::Scanner; Scanner scanner(s); scanner .One(allow_internal_ops ? Scanner::LETTER_DIGIT_DOT_UNDERSCORE : Scanner::LETTER_DIGIT_DOT) .Any(Scanner::LETTER_DIGIT_DASH_DOT_SLASH_UNDERSCOR...
0
[ "CWE-125", "CWE-369", "CWE-908" ]
tensorflow
0cc38aaa4064fd9e79101994ce9872c6d91f816b
34,347,740,848,855,247,000,000,000,000,000,000,000
20
Prevent unitialized memory access in `GraphConstructor::MakeEdge` The `MakeEdge` implementation assumes that there exists an output at `output_index` of `src` node and an input at `input_index` of `dst` node. However, if this is not the case this results in accessing data out of bounds. Because we are accessing an arr...
static int map_freeze(const union bpf_attr *attr) { int err = 0, ufd = attr->map_fd; struct bpf_map *map; struct fd f; if (CHECK_ATTR(BPF_MAP_FREEZE)) return -EINVAL; f = fdget(ufd); map = __bpf_map_get(f); if (IS_ERR(map)) return PTR_ERR(map); if (map->map_type == BPF_MAP_TYPE_STRUCT_OPS || map_val...
1
[ "CWE-367" ]
bpf
353050be4c19e102178ccc05988101887c25ae53
54,287,883,634,699,880,000,000,000,000,000,000,000
41
bpf: Fix toctou on read-only map's constant scalar tracking Commit a23740ec43ba ("bpf: Track contents of read-only maps as scalars") is checking whether maps are read-only both from BPF program side and user space side, and then, given their content is constant, reading out their data via map->ops->map_direct_value_ad...
long do_io_submit(aio_context_t ctx_id, long nr, struct iocb __user *__user *iocbpp, bool compat) { struct kioctx *ctx; long ret = 0; int i = 0; struct blk_plug plug; struct kiocb_batch batch; if (unlikely(nr < 0)) return -EINVAL; if (unlikely(nr > LONG_MAX/sizeof(*iocbpp))) nr = LONG_MAX/sizeof(*iocbp...
0
[ "CWE-200" ]
linux
a70b52ec1aaeaf60f4739edb1b422827cb6f3893
289,231,745,670,280,940,000,000,000,000,000,000,000
56
vfs: make AIO use the proper rw_verify_area() area helpers We had for some reason overlooked the AIO interface, and it didn't use the proper rw_verify_area() helper function that checks (for example) mandatory locking on the file, and that the size of the access doesn't cause us to overflow the provided offset limits ...
static void fpid_stop(struct seq_file *m, void *p) { mutex_unlock(&ftrace_lock); }
0
[ "CWE-703" ]
linux
6a76f8c0ab19f215af2a3442870eeb5f0e81998d
4,617,791,063,364,313,500,000,000,000,000,000,000
4
tracing: Fix possible NULL pointer dereferences Currently set_ftrace_pid and set_graph_function files use seq_lseek for their fops. However seq_open() is called only for FMODE_READ in the fops->open() so that if an user tries to seek one of those file when she open it for writing, it sees NULL seq_file and then panic...
flatpak_dir_collect_unmaintained_refs (FlatpakDir *self, const char *name_prefix, const char *arch, const char *branch, GHashTable *hash, ...
0
[ "CWE-74" ]
flatpak
fb473cad801c6b61706353256cab32330557374a
158,409,955,864,111,480,000,000,000,000,000,000,000
53
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...
static int gs_usb_set_bittiming(struct net_device *netdev) { struct gs_can *dev = netdev_priv(netdev); struct can_bittiming *bt = &dev->can.bittiming; struct usb_interface *intf = dev->iface; int rc; struct gs_device_bittiming *dbt; dbt = kmalloc(sizeof(*dbt), GFP_KERNEL); if (!dbt) return -ENOMEM; dbt->pro...
0
[ "CWE-400", "CWE-401" ]
linux
fb5be6a7b4863ecc44963bb80ca614584b6c7817
196,874,356,749,052,520,000,000,000,000,000,000,000
37
can: gs_usb: gs_can_open(): prevent memory leak In gs_can_open() if usb_submit_urb() fails the allocated urb should be released. Fixes: d08e973a77d1 ("can: gs_usb: Added support for the GS_USB CAN devices") Cc: linux-stable <stable@vger.kernel.org> Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com> Signed-off...
static int cbq_set_fopt(struct cbq_class *cl, struct tc_cbq_fopt *fopt) { cbq_change_defmap(cl, fopt->split, fopt->defmap, fopt->defchange); return 0; }
0
[ "CWE-200" ]
linux-2.6
8a47077a0b5aa2649751c46e7a27884e6686ccbf
241,569,469,800,468,730,000,000,000,000,000,000,000
5
[NETLINK]: Missing padding fields in dumped structures Plug holes with padding fields and initialized them to zero. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This function decrypts the crypttext */ PHP_FUNCTION(mcrypt_module_get_supported_key_sizes) { int i, count = 0; int *key_sizes; MCRYPT_GET_MODE_DIR_ARGS(algorithms_dir) array_init(return_value); key_sizes = mcrypt_module_get_algo_supported_key_sizes(module, dir, &count); for (i = 0; i < count; i++) { add_...
0
[ "CWE-190" ]
php-src
6c5211a0cef0cc2854eaa387e0eb036e012904d0
310,714,014,444,299,260,000,000,000,000,000,000,000
15
Fix bug #72455: Heap Overflow due to integer overflows
static int ahash_op_unaligned(struct ahash_request *req, int (*op)(struct ahash_request *)) { int err; err = ahash_save_req(req, ahash_op_unaligned_done); if (err) return err; err = op(req); if (err == -EINPROGRESS || (err == -EBUSY && (ahash_request_flags(req) & CRYPTO_TFM_REQ_MAY_BACK...
0
[ "CWE-835" ]
linux
ef0579b64e93188710d48667cb5e014926af9f1b
36,280,555,390,559,240,000,000,000,000,000,000,000
19
crypto: ahash - Fix EINPROGRESS notification callback The ahash API modifies the request's callback function in order to clean up after itself in some corner cases (unaligned final and missing finup). When the request is complete ahash will restore the original callback and everything is fine. However, when the requ...
static int __init fault_around_debugfs(void) { void *ret; ret = debugfs_create_file("fault_around_bytes", 0644, NULL, NULL, &fault_around_bytes_fops); if (!ret) pr_warn("Failed to create fault_around_bytes in debugfs"); return 0; }
0
[ "CWE-20" ]
linux
6b7339f4c31ad69c8e9c0b2859276e22cf72176d
196,678,063,112,743,140,000,000,000,000,000,000,000
10
mm: avoid setting up anonymous pages into file mapping Reading page fault handler code I've noticed that under right circumstances kernel would map anonymous pages into file mappings: if the VMA doesn't have vm_ops->fault() and the VMA wasn't fully populated on ->mmap(), kernel would handle page fault to not populated...
const CIRCSock* CClient::GetIRCSock() const { if (m_pNetwork) { return m_pNetwork->GetIRCSock(); } return nullptr; }
0
[ "CWE-476" ]
znc
2390ad111bde16a78c98ac44572090b33c3bd2d8
168,099,292,909,357,440,000,000,000,000,000,000,000
7
Fix null pointer dereference in echo-message The bug was introduced while fixing #1705. If a client did not enable echo-message, and doesn't have a network, it crashes. Thanks to LunarBNC for reporting this
sctp_disposition_t sctp_sf_do_9_2_shutdown(struct net *net, const struct sctp_endpoint *ep, const struct sctp_association *asoc, const sctp_subtype_t type, void *arg, sctp_cmd_seq_t *commands) { struct sctp_chunk *chunk = arg; sctp_shutdownhdr_t *sdh; sctp_disposition_t dispos...
0
[ "CWE-20", "CWE-476" ]
linux
ec0223ec48a90cb605244b45f7c62de856403729
259,165,332,876,814,130,000,000,000,000,000,000,000
81
net: sctp: fix sctp_sf_do_5_1D_ce to verify if we/peer is AUTH capable RFC4895 introduced AUTH chunks for SCTP; during the SCTP handshake RANDOM; CHUNKS; HMAC-ALGO are negotiated (CHUNKS being optional though): ---------- INIT[RANDOM; CHUNKS; HMAC-ALGO] ----------> <------- INIT-ACK[RANDOM; CHUNKS; HMAC-ALGO] ---...
int ext4_mb_add_groupinfo(struct super_block *sb, ext4_group_t group, struct ext4_group_desc *desc) { int i; int metalen = 0; struct ext4_sb_info *sbi = EXT4_SB(sb); struct ext4_group_info **meta_group_info; struct kmem_cache *cachep = get_groupinfo_cache(sb->s_blocksize_bits); /* * First check if this gr...
0
[ "CWE-416" ]
linux
8844618d8aa7a9973e7b527d038a2a589665002c
136,328,326,326,048,670,000,000,000,000,000,000,000
82
ext4: only look at the bg_flags field if it is valid The bg_flags field in the block group descripts is only valid if the uninit_bg or metadata_csum feature is enabled. We were not consistently looking at this field; fix this. Also block group #0 must never have uninitialized allocation bitmaps, or need to be zeroed...
RZ_API int rz_core_analysis_esil_fcn(RzCore *core, ut64 at, ut64 from, int reftype, int depth) { const char *esil; eprintf("TODO\n"); while (1) { // TODO: Implement the proper logic for doing esil analysis RzAnalysisOp *op = rz_core_analysis_op(core, at, RZ_ANALYSIS_OP_MASK_ESIL); if (!op) { break; } es...
0
[ "CWE-703" ]
rizin
6ce71d8aa3dafe3cdb52d5d72ae8f4b95916f939
217,687,551,766,071,340,000,000,000,000,000,000,000
20
Initialize retctx,ctx before freeing the inner elements In rz_core_analysis_type_match retctx structure was initialized on the stack only after a "goto out_function", where a field of that structure was freed. When the goto path is taken, the field is not properly initialized and it cause cause a crash of Rizin or hav...
static inline void r_write_at_le64(void *dest, ut64 val, size_t offset) { ut8 *d = (ut8*)dest + offset; r_write_le64 (d, val); }
0
[ "CWE-476" ]
radare2
1ea23bd6040441a21fbcfba69dce9a01af03f989
121,979,194,116,993,220,000,000,000,000,000,000,000
4
Fix #6816 - null deref in r_read_*
xmlSchemaGetCanonValueWhtspExt(xmlSchemaValPtr val, xmlSchemaWhitespaceValueType ws, xmlChar **retValue) { int list; xmlSchemaValType valType; const xmlChar *value, *value2 = NULL; if ((retValue == NULL) || (val == NULL)) return (-1); list = xmlSchemaValueGetNext(val) ? 1 : 0;...
0
[ "CWE-134" ]
libxml2
4472c3a5a5b516aaf59b89be602fbce52756c3e9
110,375,422,158,067,330,000,000,000,000,000,000,000
61
Fix some format string warnings with possible format string vulnerability For https://bugzilla.gnome.org/show_bug.cgi?id=761029 Decorate every method in libxml2 with the appropriate LIBXML_ATTR_FORMAT(fmt,args) macro and add some cleanups following the reports.
static void eh9(struct mg_connection *c, int ev, void *ev_data, void *fn_data) { if (ev == MG_EV_ERROR) { ASSERT(!strcmp((char *) ev_data, "error connecting to 127.0.0.1:55117")); *(int *) fn_data = 7; } (void) c; }
0
[ "CWE-552" ]
mongoose
c65c8fdaaa257e0487ab0aaae9e8f6b439335945
29,486,073,501,660,994,000,000,000,000,000,000,000
7
Protect against the directory traversal in mg_upload()
__kmem_cache_alias(const char *name, unsigned int size, unsigned int align, slab_flags_t flags, void (*ctor)(void *)) { struct kmem_cache *s, *c; s = find_mergeable(size, align, flags, name, ctor); if (s) { s->refcount++; /* * Adjust the object sizes so that we clear * the complete object on kzalloc...
0
[]
linux
fd4d9c7d0c71866ec0c2825189ebd2ce35bd95b8
115,082,721,420,844,900,000,000,000,000,000,000,000
29
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...
RAND_DRBG *RAND_DRBG_secure_new(int type, unsigned int flags, RAND_DRBG *parent) { return rand_drbg_new(1, type, flags, parent); }
0
[ "CWE-330" ]
openssl
1b0fe00e2704b5e20334a16d3c9099d1ba2ef1be
155,130,522,507,877,940,000,000,000,000,000,000,000
4
drbg: ensure fork-safety without using a pthread_atfork handler When the new OpenSSL CSPRNG was introduced in version 1.1.1, it was announced in the release notes that it would be fork-safe, which the old CSPRNG hadn't been. The fork-safety was implemented using a fork count, which was incremented by a pthread_atfork...
void udta_box_del(GF_Box *s) { u32 i; GF_UserDataMap *map; GF_UserDataBox *ptr = (GF_UserDataBox *)s; if (ptr == NULL) return; i=0; while ((map = (GF_UserDataMap *)gf_list_enum(ptr->recordList, &i))) { gf_isom_box_array_del(map->boxes); gf_free(map); } gf_list_del(ptr->recordList); gf_free(ptr);
0
[ "CWE-787" ]
gpac
388ecce75d05e11fc8496aa4857b91245007d26e
123,024,753,372,055,200,000,000,000,000,000,000,000
14
fixed #1587
window_redraw_active_switch(struct window *w, struct window_pane *wp) { const struct grid_cell *gc; if (wp == w->active) return; /* * If window-style and window-active-style are the same, we don't need * to redraw panes when switching active panes. */ gc = options_get_style(w->options, "window-active-styl...
0
[]
src
b32e1d34e10a0da806823f57f02a4ae6e93d756e
141,739,494,992,054,330,000,000,000,000,000,000,000
28
evbuffer_new and bufferevent_new can both fail (when malloc fails) and return NULL. GitHub issue 1547.
int attribute_align_arg avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame) { int ret; av_frame_unref(frame); if (!avcodec_is_open(avctx) || !av_codec_is_decoder(avctx->codec)) return AVERROR(EINVAL); if (avctx->codec->receive_frame) { if (avctx->internal->draining && !(avctx...
0
[ "CWE-787" ]
FFmpeg
2080bc33717955a0e4268e738acf8c1eeddbf8cb
269,143,688,194,219,450,000,000,000,000,000,000,000
49
avcodec/utils: correct align value for interplay Fixes out of array access Fixes: 452/fuzz-1-ffmpeg_VIDEO_AV_CODEC_ID_INTERPLAY_VIDEO_fuzzer Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
static void luma_mc(HEVCContext *s, int16_t *dst, ptrdiff_t dststride, AVFrame *ref, const Mv *mv, int x_off, int y_off, int block_w, int block_h) { HEVCLocalContext *lc = &s->HEVClc; uint8_t *src = ref->data[0]; ptrdiff_t srcstride = ref->linesize[0]; in...
0
[ "CWE-703" ]
FFmpeg
b25e84b7399bd91605596b67d761d3464dbe8a6e
282,171,071,409,383,660,000,000,000,000,000,000,000
39
hevc: check that the VCL NAL types are the same for all slice segments of a frame Fixes possible invalid memory access for mismatching skipped/non-skipped slice segments. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Sample-Id: 00001533-google
int ff_h264_check_intra_pred_mode(H264Context *h, int mode, int is_chroma) { static const int8_t top[4] = { LEFT_DC_PRED8x8, 1, -1, -1 }; static const int8_t left[5] = { TOP_DC_PRED8x8, -1, 2, -1, DC_128_PRED8x8 }; if (mode > 3U) { av_log(h->avctx, AV_LOG_ERROR, "out of range intra...
0
[ "CWE-703" ]
FFmpeg
8a3b85f3a7952c54a2c36ba1797f7e0cde9f85aa
99,389,756,232,885,100,000,000,000,000,000,000,000
40
avcodec/h264: update current_sps & sps->new only after the whole slice header decoder and init code finished This avoids them being cleared before the full initialization finished Fixes out of array read Fixes: asan_heap-oob_f0c5e6_7071_cov_1605985132_mov_h264_aac__Demo_FlagOfOurFathers.mov Found-by: Mateusz "j00ru" ...
static void __attribute__((__noreturn__)) exit_non_root(const char *option) { const uid_t ruid = getuid(); const uid_t euid = geteuid(); if (ruid == 0 && euid != 0) { /* user is root, but setuid to non-root */ if (option) errx(MOUNT_EX_USAGE, _("only root can use \"--%s\" option " "(effective UID is %u...
0
[ "CWE-200" ]
util-linux
5ebbc3865d1e53ef42e5f121c41faab23dd59075
71,655,235,609,691,340,000,000,000,000,000,000,000
18
mount: sanitize paths from non-root users $ mount /root/.ssh/../../dev/sda2 mount: only root can mount UUID=17bc65ec-4125-4e7c-8a7d-e2795064c736 on /boot this is too promiscuous. It seems better to ignore on command line specified paths which are not resolve-able for non-root users. Fixed version: $ mount /root...
static int xt_table_seq_show(struct seq_file *seq, void *v) { struct xt_table *table = list_entry(v, struct xt_table, list); if (*table->name) seq_printf(seq, "%s\n", table->name); return 0; }
0
[ "CWE-119" ]
nf-next
d7591f0c41ce3e67600a982bab6989ef0f07b3ce
332,617,064,575,661,600,000,000,000,000,000,000,000
8
netfilter: x_tables: introduce and use xt_copy_counters_from_user The three variants use same copy&pasted code, condense this into a helper and use that. Make sure info.name is 0-terminated. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
static void enter_smm_save_state_64(struct kvm_vcpu *vcpu, char *buf) { struct desc_ptr dt; struct kvm_segment seg; unsigned long val; int i; for (i = 0; i < 16; i++) put_smstate(u64, buf, 0x7ff8 - i * 8, kvm_register_read_raw(vcpu, i)); put_smstate(u64, buf, 0x7f78, kvm_rip_read(vcpu)); put_smstate(u32, buf...
0
[ "CWE-476" ]
linux
55749769fe608fa3f4a075e42e89d237c8e37637
203,914,582,745,422,530,000,000,000,000,000,000,000
52
KVM: x86: Fix wall clock writes in Xen shared_info not to mark page dirty When dirty ring logging is enabled, any dirty logging without an active vCPU context will cause a kernel oops. But we've already declared that the shared_info page doesn't get dirty tracking anyway, since it would be kind of insane to mark it di...
static int __init of_unittest_apply_revert_overlay_check(int overlay_nr, int unittest_nr, int before, int after, enum overlay_type ovtype) { int ret, ovcs_id; /* unittest device must be in before state */ if (of_unittest_device_exists(unittest_nr, ovtype) != before) { unittest(0, "%s with device @\"%s\" %s\n"...
0
[ "CWE-401" ]
linux
e13de8fe0d6a51341671bbe384826d527afe8d44
275,588,934,341,891,160,000,000,000,000,000,000,000
51
of: unittest: fix memory leak in unittest_data_add In unittest_data_add, a copy buffer is created via kmemdup. This buffer is leaked if of_fdt_unflatten_tree fails. The release for the unittest_data buffer is added. Fixes: b951f9dc7f25 ("Enabling OF selftest to run without machine's devicetree") Signed-off-by: Navid ...
static struct dce_hwseq *dcn10_hwseq_create( struct dc_context *ctx) { struct dce_hwseq *hws = kzalloc(sizeof(struct dce_hwseq), GFP_KERNEL); if (hws) { hws->ctx = ctx; hws->regs = &hwseq_reg; hws->shifts = &hwseq_shift; hws->masks = &hwseq_mask; hws->wa.DEGVIDCN10_253 = true; hws->wa.false_optc_underfl...
0
[ "CWE-400", "CWE-401" ]
linux
104c307147ad379617472dd91a5bcb368d72bd6d
255,173,547,913,384,280,000,000,000,000,000,000,000
16
drm/amd/display: prevent memory leak In dcn*_create_resource_pool the allocated memory should be released if construct pool fails. Reviewed-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
static OPJ_BOOL opj_t2_encode_packet(OPJ_UINT32 tileno, opj_tcd_tile_t * tile, opj_tcp_t * tcp, opj_pi_iterator_t *pi, OPJ_BYTE *dest, ...
1
[ "CWE-416", "CWE-787" ]
openjpeg
c535531f03369623b9b833ef41952c62257b507e
264,756,290,590,011,300,000,000,000,000,000,000,000
291
opj_t2_encode_packet(): fix potential write heap buffer overflow (#992)
static void ov51x_led_control(struct sd *sd, int on) { if (sd->invert_led) on = !on; switch (sd->bridge) { /* OV511 has no LED control */ case BRIDGE_OV511PLUS: reg_w(sd, R511_SYS_LED_CTL, on); break; case BRIDGE_OV518: case BRIDGE_OV518PLUS: reg_w_mask(sd, R518_GPIO_OUT, 0x02 * on, 0x02); break; case...
0
[ "CWE-476" ]
linux
998912346c0da53a6dbb71fab3a138586b596b30
107,958,386,299,552,410,000,000,000,000,000,000,000
19
media: ov519: add missing endpoint sanity checks Make sure to check that we have at least one endpoint before accessing the endpoint array to avoid dereferencing a NULL-pointer on stream start. Note that these sanity checks are not redundant as the driver is mixing looking up altsettings by index and by number, which...
PublicMarshalAndComputeName( TPMT_PUBLIC *publicArea, // IN: public area of an object TPM2B_NAME *name // OUT: name of the object ) { // Will marshal a public area into a template. This is because the internal // format for a TPM2B_PUBLIC is a structure and not a simpl...
0
[ "CWE-119" ]
libtpms
ea62fd9679f8c6fc5e79471b33cfbd8227bfed72
157,334,224,804,866,120,000,000,000,000,000,000,000
23
tpm2: Initialize a whole OBJECT before using it Initialize a whole OBJECT before using it. This is necessary since an OBJECT may also be used as a HASH_OBJECT via the ANY_OBJECT union and that HASH_OBJECT can leave bad size inidicators in TPM2B buffer in the OBJECT. To get rid of this problem we reset the whole OBJECT...
merge_render_child (RsvgNode *node, gpointer data) { struct merge_render_closure *closure = data; RsvgFilterPrimitive *fp; cairo_surface_t *in; if (rsvg_node_get_type (node) != RSVG_NODE_TYPE_FILTER_PRIMITIVE_MERGE_NODE) return TRUE; fp = rsvg_rust_cnode_get_impl (node); in = rsvg_fil...
0
[ "CWE-369" ]
librsvg
ecf9267a24b2c3c0cd211dbdfa9ef2232511972a
265,788,191,854,068,500,000,000,000,000,000,000,000
28
bgo#783835 - Don't divide by zero in box_blur_line() for gaussian blurs We were making the decision to use box blurs, instead of a true Gaussian kernel, based on the size of *both* x and y dimensions. Do them individually instead.
TokenBoundary(const std::shared_ptr<Ope> &ope) : ope_(ope) {}
0
[ "CWE-125" ]
cpp-peglib
b3b29ce8f3acf3a32733d930105a17d7b0ba347e
156,534,843,070,544,350,000,000,000,000,000,000,000
1
Fix #122
R_API st64 r_buf_read_at(RBuffer *b, ut64 addr, ut8 *buf, ut64 len) { r_return_val_if_fail (b && buf, -1); st64 o_addr = r_buf_seek (b, 0, R_BUF_CUR); st64 r = r_buf_seek (b, addr, R_BUF_SET); if (r < 0) { return r; } r = r_buf_read (b, buf, len); r_buf_seek (b, o_addr, R_BUF_SET); return r; }
0
[ "CWE-400", "CWE-703" ]
radare2
634b886e84a5c568d243e744becc6b3223e089cf
136,733,846,723,400,630,000,000,000,000,000,000,000
11
Fix DoS in PE/QNX/DYLDCACHE/PSX parsers ##crash * Reported by lazymio * Reproducer: AAA4AAAAAB4=
void alarm_start_relative(struct alarm *alarm, ktime_t start) { struct alarm_base *base = &alarm_bases[alarm->type]; start = ktime_add_safe(start, base->gettime()); alarm_start(alarm, start); }
0
[ "CWE-190" ]
linux
5f936e19cc0ef97dbe3a56e9498922ad5ba1edef
86,560,012,531,865,740,000,000,000,000,000,000,000
7
alarmtimer: Prevent overflow for relative nanosleep Air Icy reported: UBSAN: Undefined behaviour in kernel/time/alarmtimer.c:811:7 signed integer overflow: 1529859276030040771 + 9223372036854775807 cannot be represented in type 'long long int' Call Trace: alarm_timer_nsleep+0x44c/0x510 kernel/time/alarmtim...
static void oz_hcd_complete_set_interface(struct oz_port *port, struct urb *urb, u8 rcode, u8 if_num, u8 alt) { struct usb_hcd *hcd = port->ozhcd->hcd; int rc = 0; if ((rcode == 0) && (port->config_num > 0)) { struct usb_host_config *config; struct usb_host_interface *intf; oz_dbg(ON, "Set interface %d alt...
0
[ "CWE-703", "CWE-189" ]
linux
b1bb5b49373b61bf9d2c73a4d30058ba6f069e4c
235,899,510,759,732,980,000,000,000,000,000,000,000
24
ozwpan: Use unsigned ints to prevent heap overflow Using signed integers, the subtraction between required_size and offset could wind up being negative, resulting in a memcpy into a heap buffer with a negative length, resulting in huge amounts of network-supplied data being copied into the heap, which could potentiall...
string_find_internal(PyStringObject *self, PyObject *args, int dir) { PyObject *subobj; const char *sub; Py_ssize_t sub_len; Py_ssize_t start=0, end=PY_SSIZE_T_MAX; if (!stringlib_parse_args_finds("find/rfind/index/rindex", args, &subobj, &start, &end)) r...
0
[ "CWE-190" ]
cpython
c3c9db89273fabc62ea1b48389d9a3000c1c03ae
246,045,716,908,918,600,000,000,000,000,000,000,000
34
[2.7] bpo-30657: Check & prevent integer overflow in PyString_DecodeEscape (#2174)
CImg<charT> s_calling_function() const { CImg<charT> res; const unsigned int l1 = calling_function?(unsigned int)std::strlen(calling_function):0U, l2 = user_macro?(unsigned int)std::strlen(user_macro):0U; if (l2) { res.assign(l1 + l2 + 48); cimg_snpr...
0
[ "CWE-770" ]
cimg
619cb58dd90b4e03ac68286c70ed98acbefd1c90
329,504,283,804,434,600,000,000,000,000,000,000,000
14
CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size.
njs_values_equal(njs_vm_t *vm, njs_value_t *val1, njs_value_t *val2) { njs_int_t ret; njs_bool_t nv1, nv2; njs_value_t primitive; njs_value_t *hv, *lv; again: nv1 = njs_is_null_or_undefined(val1); nv2 = njs_is_null_or_undefined(val2); /* Void and null are equal and not comparable w...
0
[ "CWE-703", "CWE-754" ]
njs
222d6fdcf0c6485ec8e175f3a7b70d650c234b4e
290,074,113,337,923,900,000,000,000,000,000,000,000
74
Fixed njs_vmcode_interpreter() when "toString" conversion fails. Previously, while interpreting a user function, njs_vmcode_interpreter() might return prematurely when an error happens. This is not correct because the current frame has to be unwound (or exception caught) first. The fix is exit through only 5 appropr...
MagickExport QuantizeInfo *CloneQuantizeInfo(const QuantizeInfo *quantize_info) { QuantizeInfo *clone_info; clone_info=(QuantizeInfo *) AcquireMagickMemory(sizeof(*clone_info)); if (clone_info == (QuantizeInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); GetQuantizeIn...
0
[ "CWE-703", "CWE-772" ]
ImageMagick
0417cea1b6d72f90bd4f1f573f91e42a8ba66a89
319,273,825,176,349,630,000,000,000,000,000,000,000
18
https://github.com/ImageMagick/ImageMagick/issues/574
color_halftone_callback(cal_halftone_data_t *ht, void *arg) { gx_device *dev = arg; gx_color_index dev_white = gx_device_white(dev); gx_color_index dev_black = gx_device_black(dev); if (dev->is_planar) { (*dev_proc(dev, copy_planes)) (dev, ht->data, ht->x + (ht->offset_x<<3), ht->raster, ...
0
[ "CWE-787" ]
ghostpdl
027c546e0dd11e0526f1780a7f3c2c66acffe209
4,877,943,176,245,651,000,000,000,000,000,000,000
16
Bug 701842: Fix misindexing in gxicolor.c We were incorrectly decrementing position per-component, rather than per-pixel (in 2 places). Also, take care of some whitespace oddities.
static int bin_entry(RCore *r, int mode, ut64 laddr, int va, bool inifin) { char str[R_FLAG_NAME_SIZE]; RList *entries = r_bin_get_entries (r->bin); RListIter *iter; RBinAddr *entry = NULL; int i = 0; ut64 baddr = r_bin_get_baddr (r->bin); if (IS_MODE_RAD (mode)) { r_cons_printf ("fs symbols\n"); } else if (...
0
[ "CWE-125" ]
radare2
1f37c04f2a762500222dda2459e6a04646feeedf
274,618,233,319,051,900,000,000,000,000,000,000,000
128
Fix #9904 - crash in r2_hoobr_r_read_le32 (over 9000 entrypoints) and read_le oobread (#9923)
static int sort_insert_key(MI_SORT_PARAM *sort_param, register SORT_KEY_BLOCKS *key_block, uchar *key, my_off_t prev_block) { uint a_length,t_length,nod_flag; my_off_t filepos,key_file_length; uchar *anc_buff,*lastkey; MI_KEY_PARAM s_temp; MI_INFO *info; MI_KEYDEF *keyinfo=sort_param->keyinfo; ...
0
[ "CWE-362" ]
mysql-server
4e5473862e6852b0f3802b0cd0c6fa10b5253291
107,818,780,163,896,620,000,000,000,000,000,000,000
81
Bug#24388746: PRIVILEGE ESCALATION AND RACE CONDITION USING CREATE TABLE During REPAIR TABLE of a MyISAM table, a temporary data file (.TMD) is created. When repair finishes, this file is renamed to the original .MYD file. The problem was that during this rename, we copied the stats from the old file to the new file w...
static int cliSendCommand(int argc, char **argv, long repeat) { char *command = argv[0]; size_t *argvlen; int j, output_raw; if (!config.eval_ldb && /* In debugging mode, let's pass "help" to Redis. */ (!strcasecmp(command,"help") || !strcasecmp(command,"?"))) { cliOutputHelp(--argc, ++...
0
[ "CWE-119", "CWE-787" ]
redis
9fdcc15962f9ff4baebe6fdd947816f43f730d50
80,414,799,122,270,170,000,000,000,000,000,000,000
105
Security: fix redis-cli buffer overflow. Thanks to Fakhri Zulkifli for reporting it. The fix switched to dynamic allocation, copying the final prompt in the static buffer only at the end.
index_build(Relation heapRelation, Relation indexRelation, IndexInfo *indexInfo, bool isprimary, bool isreindex) { RegProcedure procedure; IndexBuildResult *stats; Oid save_userid; int save_sec_context; int save_nestlevel; /* * sanity checks */ Assert(RelationIsValid(indexRelation)); Asse...
0
[ "CWE-362" ]
postgres
5f173040e324f6c2eebb90d86cf1b0cdb5890f0a
94,987,020,172,830,280,000,000,000,000,000,000,000
144
Avoid repeated name lookups during table and index DDL. If the name lookups come to different conclusions due to concurrent activity, we might perform some parts of the DDL on a different table than other parts. At least in the case of CREATE INDEX, this can be used to cause the permissions checks to be performed aga...
int filp_close(struct file *filp, fl_owner_t id) { int retval = 0; if (!file_count(filp)) { printk(KERN_ERR "VFS: Close: file count is 0\n"); return 0; } if (filp->f_op && filp->f_op->flush) retval = filp->f_op->flush(filp, id); if (likely(!(filp->f_mode & FMODE_PATH))) { dnotify_flush(filp, id); lock...
0
[ "CWE-732" ]
linux-stable
e57712ebebbb9db7d8dcef216437b3171ddcf115
16,223,256,090,652,692,000,000,000,000,000,000,000
19
merge fchmod() and fchmodat() guts, kill ancient broken kludge The kludge in question is undocumented and doesn't work for 32bit binaries on amd64, sparc64 and s390. Passing (mode_t)-1 as mode had (since 0.99.14v and contrary to behaviour of any other Unix, prescriptions of POSIX, SuS and our own manpages) was kinda-...
static void n_tty_receive_overrun(struct tty_struct *tty) { struct n_tty_data *ldata = tty->disc_data; char buf[64]; ldata->num_overrun++; if (time_after(jiffies, ldata->overrun_time + HZ) || time_after(ldata->overrun_time, jiffies)) { printk(KERN_WARNING "%s: %d input overrun(s)\n", tty_name(tty, buf), ...
0
[ "CWE-362" ]
tty
4291086b1f081b869c6d79e5b7441633dc3ace00
143,666,475,720,791,230,000,000,000,000,000,000,000
15
n_tty: Fix n_tty_write crash when echoing in raw mode The tty atomic_write_lock does not provide an exclusion guarantee for the tty driver if the termios settings are LECHO & !OPOST. And since it is unexpected and not allowed to call TTY buffer helpers like tty_insert_flip_string concurrently, this may lead to crashe...
static int receive_filter(VirtIONet *n, const uint8_t *buf, int size) { static const uint8_t bcast[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; static const uint8_t vlan[] = {0x81, 0x00}; uint8_t *ptr = (uint8_t *)buf; int i; if (n->promisc) return 1; ptr += n->host_hdr_len; if (!mem...
0
[ "CWE-703" ]
qemu
abe300d9d894f7138e1af7c8e9c88c04bfe98b37
271,775,894,026,541,900,000,000,000,000,000,000,000
50
virtio-net: fix map leaking on error during receive Commit bedd7e93d0196 ("virtio-net: fix use after unmap/free for sg") tries to fix the use after free of the sg by caching the virtqueue elements in an array and unmap them at once after receiving the packets, But it forgot to unmap the cached elements on error which ...
return val<(double)min()?min():val>(double)max()?max():(unsigned short)val; }
0
[ "CWE-125" ]
CImg
10af1e8c1ad2a58a0a3342a856bae63e8f257abb
212,722,508,021,975,400,000,000,000,000,000,000,000
1
Fix other issues in 'CImg<T>::load_bmp()'.
wf_cliprdr_server_format_list_response(CliprdrClientContext* context, const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse) { (void)context; (void)formatListResponse; if (formatListResponse->msgFlags != CB_RESPONSE_OK) return E_FAIL; return CHANNEL_RC_OK; }
0
[ "CWE-20" ]
FreeRDP
0d79670a28c0ab049af08613621aa0c267f977e9
260,398,876,203,507,860,000,000,000,000,000,000,000
11
Fixed missing input checks for file contents request reported by Valentino Ricotta (Thalium)
static void tulip_update_ts(TULIPState *s, int state) { s->csr[5] &= ~(CSR5_TS_MASK << CSR5_TS_SHIFT); s->csr[5] |= (state & CSR5_TS_MASK) << CSR5_TS_SHIFT; trace_tulip_tx_state(tulip_tx_state_name(state)); }
0
[ "CWE-787" ]
qemu
8ffb7265af64ec81748335ec8f20e7ab542c3850
205,165,644,718,910,030,000,000,000,000,000,000,000
6
net: tulip: check frame size and r/w data length Tulip network driver while copying tx/rx buffers does not check frame size against r/w data length. This may lead to OOB buffer access. Add check to avoid it. Limit iterations over descriptors to avoid potential infinite loop issue in tulip_xmit_list_update. Reported-...
static void xhci_xfer_unmap(XHCITransfer *xfer) { usb_packet_unmap(&xfer->packet, &xfer->sgl); qemu_sglist_destroy(&xfer->sgl); }
0
[ "CWE-835" ]
qemu
96d87bdda3919bb16f754b3d3fd1227e1f38f13c
14,971,331,861,145,720,000,000,000,000,000,000,000
5
xhci: guard xhci_kick_epctx against recursive calls Track xhci_kick_epctx processing being active in a variable. Check the variable before calling xhci_kick_epctx from xhci_kick_ep. Add an assert to make sure we don't call recursively into xhci_kick_epctx. Cc: 1653384@bugs.launchpad.net Fixes: 94b037f2a451b3dc855f9...
static void atl2_intr_rx(struct atl2_adapter *adapter) { struct net_device *netdev = adapter->netdev; struct rx_desc *rxd; struct sk_buff *skb; do { rxd = adapter->rxd_ring+adapter->rxd_write_ptr; if (!rxd->status.update) break; /* end of tx */ /* clear this flag at once */ rxd->status.update = 0; i...
0
[ "CWE-200" ]
linux
f43bfaeddc79effbf3d0fcb53ca477cca66f3db8
167,212,817,208,376,510,000,000,000,000,000,000,000
61
atl2: Disable unimplemented scatter/gather feature atl2 includes NETIF_F_SG in hw_features even though it has no support for non-linear skbs. This bug was originally harmless since the driver does not claim to implement checksum offload and that used to be a requirement for SG. Now that SG and checksum offload are i...
buf_reload(buf_T *buf, int orig_mode) { exarg_T ea; pos_T old_cursor; linenr_T old_topline; int old_ro = buf->b_p_ro; buf_T *savebuf; bufref_T bufref; int saved = OK; aco_save_T aco; int flags = READ_NEW; /* set curwin/curbuf for "buf" and save some things */ aucmd_prepbu...
0
[ "CWE-200", "CWE-668" ]
vim
5a73e0ca54c77e067c3b12ea6f35e3e8681e8cf8
105,892,052,169,103,890,000,000,000,000,000,000,000
152
patch 8.0.1263: others can read the swap file if a user is careless Problem: Others can read the swap file if a user is careless with his primary group. Solution: If the group permission allows for reading but the world permissions doesn't, make sure the group is right.
TEST(ComparisonsTest, EqualBroadcastTwoD) { ComparisonOpModel model({1, 1, 2, 4}, {1, 1, 1, 4}, TensorType_INT32, BuiltinOperator_EQUAL); model.PopulateTensor<int>(model.input1(), {-1, 9, 7, 3, 2, 4, 2, 8}); model.PopulateTensor<int>(model.input2(), {7, 1, 2, 4}); model.Invoke(); EX...
0
[ "CWE-20", "CWE-703" ]
tensorflow
a989426ee1346693cc015792f11d715f6944f2b8
58,462,049,823,208,180,000,000,000,000,000,000,000
11
Improve to cover scale value greater than one PiperOrigin-RevId: 433050921
static DetectRunScratchpad DetectRunSetup( const DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, Packet * const p, Flow * const pflow) { AppProto alproto = ALPROTO_UNKNOWN; uint8_t flow_flags = 0; /* flow/state flags */ bool app_decoder_events = false; PACKET_PROFILING_DETECT_START...
0
[ "CWE-347" ]
suricata
d8634daf74c882356659addb65fb142b738a186b
277,652,955,593,009,650,000,000,000,000,000,000,000
93
stream: fix false negative on bad RST If a bad RST was received the stream inspection would not happen for that packet, but it would still move the 'raw progress' tracker forward. Following good packets would then fail to detect anything before the 'raw progress' position. Bug #2770 Reported-by: Alexey Vishnyakov
static int read_data(void *opaque, uint8_t *buf, int buf_size) { struct playlist *v = opaque; HLSContext *c = v->parent->priv_data; int ret, i; int just_opened = 0; restart: if (!v->needed) return AVERROR_EOF; if (!v->input) { int64_t reload_interval; /* Check that the...
1
[ "CWE-703" ]
FFmpeg
7ba100d3e6e8b1e5d5342feb960a7f081d6e15af
44,862,356,240,814,440,000,000,000,000,000,000,000
93
avformat/hls: Fix DoS due to infinite loop Fixes: loop.m3u The default max iteration count of 1000 is arbitrary and ideas for a better solution are welcome Found-by: Xiaohei and Wangchu from Alibaba Security Team Previous version reviewed-by: Steven Liu <lingjiujianke@gmail.com> Signed-off-by: Michael Niedermayer <...
conntrack_ipf_ctx(struct conntrack *ct) { return ct->ipf; }
0
[ "CWE-400" ]
ovs
79349cbab0b2a755140eedb91833ad2760520a83
144,729,644,892,066,440,000,000,000,000,000,000,000
4
flow: Support extra padding length. Although not required, padding can be optionally added until the packet length is MTU bytes. A packet with extra padding currently fails sanity checks. Vulnerability: CVE-2020-35498 Fixes: fa8d9001a624 ("miniflow_extract: Properly handle small IP packets.") Reported-by: Joakim Hind...
autoar_extractor_step_extract (AutoarExtractor *self) { /* Step 3: Extract files * We have to re-open the archive to extract files */ struct archive *a; struct archive_entry *entry; int r; g_debug ("autoar_extractor_step_extract: called"); r = libarchive_create_read_object (self->use_raw_format, s...
1
[ "CWE-22" ]
gnome-autoar
adb067e645732fdbe7103516e506d09eb6a54429
97,854,517,590,670,380,000,000,000,000,000,000,000
107
AutoarExtractor: Do not extract files outside the destination dir Currently, a malicious archive can cause that the files are extracted outside of the destination dir. This can happen if the archive contains a file whose parent is a symbolic link, which points outside of the destination dir. This is potentially a secu...
ConnectionExists(struct SessionHandle *data, struct connectdata *needle, struct connectdata **usethis, bool *force_reuse) { struct connectdata *check; struct connectdata *chosen = 0; bool canPipeline = IsPipeliningPossible(data, needle); bool wantNTLMhttp = ((d...
0
[ "CWE-200" ]
curl
b3875606925536f82fc61f3114ac42f29eaf6945
118,719,071,927,243,050,000,000,000,000,000,000,000
271
curl_easy_duphandle: CURLOPT_COPYPOSTFIELDS read out of bounds When duplicating a handle, the data to post was duplicated using strdup() when it could be binary and contain zeroes and it was not even zero terminated! This caused read out of bounds crashes/segfaults. Since the lib/strdup.c file no longer is easily sha...
void js_rot2pop1(js_State *J) { /* A B -> B */ STACK[TOP-2] = STACK[TOP-1]; --TOP; }
0
[ "CWE-476" ]
mujs
77ab465f1c394bb77f00966cd950650f3f53cb24
247,785,766,925,275,380,000,000,000,000,000,000,000
6
Fix 697401: Error when dropping extra arguments to lightweight functions.
gettimeofday_time(void) { struct timeval tv; gettimeofday(&tv, NULL); return tv.tv_sec + tv.tv_usec * 1e-6; }
0
[ "CWE-415" ]
mruby
97319697c8f9f6ff27b32589947e1918e3015503
231,175,893,354,851,170,000,000,000,000,000,000,000
6
Cancel 9cdf439 Should not free the pointer in `realloc` since it can cause use-after-free problem.
long ssl3_default_timeout(void) { /* 2 hours, the 24 hours mentioned in the SSLv3 spec * is way too long for http, the cache would over fill */ return(60*60*2); }
0
[ "CWE-310" ]
openssl
ca989269a2876bae79393bd54c3e72d49975fc75
98,118,432,078,735,550,000,000,000,000,000,000,000
6
Use version in SSL_METHOD not SSL structure. When deciding whether to use TLS 1.2 PRF and record hash algorithms use the version number in the corresponding SSL_METHOD structure instead of the SSL structure. The SSL structure version is sometimes inaccurate. Note: OpenSSL 1.0.2 and later effectively do this already. (...
ignorableWhitespaceDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len) { char out[40]; int i; callbacks++; if (noout) return; for (i = 0;(i<len) && (i < 30);i++) out[i] = ch[i]; out[i] = 0; fprintf(stdout, "SAX.ignorableWhitespace(%s, %d)\n", out, len); }
0
[ "CWE-416" ]
libxml2
1358d157d0bd83be1dfe356a69213df9fac0b539
113,033,051,058,935,220,000,000,000,000,000,000,000
13
Fix use-after-free with `xmllint --html --push` Call htmlCtxtUseOptions to make sure that names aren't stored in dictionaries. Note that this issue only affects xmllint using the HTML push parser. Fixes #230.
void CLASS kodak_c603_load_raw() { uchar *pixel; int row, col, y, cb, cr, rgb[3], c; pixel = (uchar *) calloc (raw_width, 3*sizeof *pixel); merror (pixel, "kodak_c603_load_raw()"); #ifdef LIBRAW_LIBRARY_BUILD try { #endif for (row=0; row < height; row++) { #ifdef LIBRAW_LIBRARY_BUILD checkCancel(); #en...
1
[ "CWE-787" ]
LibRaw
8682ad204392b914ab1cc6ebcca9c27c19c1a4b4
67,417,327,925,048,810,000,000,000,000,000,000,000
35
0.18.17
ast_for_exprlist(struct compiling *c, const node *n, expr_context_ty context) { asdl_seq *seq; int i; expr_ty e; REQ(n, exprlist); seq = _Py_asdl_seq_new((NCH(n) + 1) / 2, c->c_arena); if (!seq) return NULL; for (i = 0; i < NCH(n); i += 2) { e = ast_for_expr(c, CHILD(n, i))...
0
[ "CWE-125" ]
cpython
a4d78362397fc3bced6ea80fbc7b5f4827aec55e
133,978,766,420,816,850,000,000,000,000,000,000,000
21
bpo-36495: Fix two out-of-bounds array reads (GH-12641) Research and fix by @bradlarsen.