func
string
target
int64
cwe
list
project
string
commit_id
string
hash
float64
size
int64
message
string
static inline void memalloc_nocma_restore(unsigned int flags) { current->flags = (current->flags & ~PF_MEMALLOC_NOCMA) | flags; }
0
[ "CWE-362", "CWE-703", "CWE-667" ]
linux
04f5866e41fb70690e28397487d8bd8eea7d712a
218,641,209,692,686,750,000,000,000,000,000,000,000
4
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...
static void audit_log_feature_change(int which, u32 old_feature, u32 new_feature, u32 old_lock, u32 new_lock, int res) { struct audit_buffer *ab; if (audit_enabled == AUDIT_OFF) return; ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_FEATURE_CHANGE); audit_log_task_info(ab, current); audit_log_format(ab,...
0
[ "CWE-264" ]
net
90f62cf30a78721641e08737bda787552428061e
21,383,621,410,651,040,000,000,000,000,000,000,000
15
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. ...
smb_send_rqst(struct TCP_Server_Info *server, struct smb_rqst *rqst) { int rc; struct kvec *iov = rqst->rq_iov; int n_vec = rqst->rq_nvec; unsigned int smb_buf_length = get_rfc1002_length(iov[0].iov_base); unsigned int i; size_t total_len = 0, sent; struct socket *ssocket = server->ssocket; int val = 1; cFYI(...
1
[ "CWE-362" ]
linux
ea702b80e0bbb2448e201472127288beb82ca2fe
284,377,414,863,607,370,000,000,000,000,000,000,000
61
cifs: move check for NULL socket into smb_send_rqst Cai reported this oops: [90701.616664] BUG: unable to handle kernel NULL pointer dereference at 0000000000000028 [90701.625438] IP: [<ffffffff814a343e>] kernel_setsockopt+0x2e/0x60 [90701.632167] PGD fea319067 PUD 103fda4067 PMD 0 [90701.637255] Oops: 0000 [#1] SMP ...
Return information about the system PHP was built on */ PHP_FUNCTION(php_uname) { char *mode = "a"; int modelen = sizeof("a")-1; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &mode, &modelen) == FAILURE) { return; } RETURN_STRING(php_get_uname(*mode), 0);
0
[ "CWE-200" ]
php-src
3804c0d00fa6e629173fb1c8c61f8f88d5fe39b9
323,273,736,836,726,870,000,000,000,000,000,000,000
10
Fix bug #67498 - phpinfo() Type Confusion Information Leak Vulnerability
do_encrypted_mdc( IOBUF out, int ctb, PKT_encrypted *ed ) { int rc = 0; u32 n; assert( ed->mdc_method ); /* Take version number and the following MDC packet in account. */ n = ed->len ? (ed->len + ed->extralen + 1 + 22) : 0; write_header(out, ctb, n ); iobuf_put(out, 1 ); /* version */ ...
0
[ "CWE-20" ]
gnupg
2183683bd633818dd031b090b5530951de76f392
124,081,847,347,223,390,000,000,000,000,000,000,000
16
Use inline functions to convert buffer data to scalars. * common/host2net.h (buf16_to_ulong, buf16_to_uint): New. (buf16_to_ushort, buf16_to_u16): New. (buf32_to_size_t, buf32_to_ulong, buf32_to_uint, buf32_to_u32): New. -- Commit 91b826a38880fd8a989318585eb502582636ddd8 was not enough to avoid all sign extension on ...
__update_curr(struct cfs_rq *cfs_rq, struct sched_entity *curr, unsigned long delta_exec) { unsigned long delta_exec_weighted; schedstat_set(curr->exec_max, max((u64)delta_exec, curr->exec_max)); curr->sum_exec_runtime += delta_exec; schedstat_add(cfs_rq, exec_clock, delta_exec); delta_exec_weighted = cal...
0
[]
linux-2.6
8f1bc385cfbab474db6c27b5af1e439614f3025c
64,938,841,381,334,885,000,000,000,000,000,000,000
12
sched: fair: weight calculations In order to level the hierarchy, we need to calculate load based on the root view. That is, each task's load is in the same unit. A / \ B 1 / \ 2 3 To compute 1's load we do: weight(1) -------------- rq_weight(A) To ...
static int virtio_net_handle_offloads(VirtIONet *n, uint8_t cmd, struct iovec *iov, unsigned int iov_cnt) { VirtIODevice *vdev = VIRTIO_DEVICE(n); uint64_t offloads; size_t s; if (!virtio_vdev_has_feature(vdev, VIRTIO_NET_F_CTRL_GUEST_OFFLOADS)) { return VIR...
0
[ "CWE-703" ]
qemu
abe300d9d894f7138e1af7c8e9c88c04bfe98b37
109,815,622,010,711,680,000,000,000,000,000,000,000
44
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 ...
void Curl_unencode_cleanup(struct Curl_easy *data) { struct SingleRequest *k = &data->req; struct contenc_writer *writer = k->writer_stack; while(writer) { k->writer_stack = writer->downstream; writer->handler->close_writer(data, writer); free(writer); writer = k->writer_stack; } }
0
[]
curl
3a09fbb7f264c67c438d01a30669ce325aa508e2
114,245,161,543,634,390,000,000,000,000,000,000,000
12
content_encoding: return error on too many compression steps The max allowed steps is arbitrarily set to 5. Bug: https://curl.se/docs/CVE-2022-32206.html CVE-2022-32206 Reported-by: Harry Sintonen Closes #9049
static int wdm_post_reset(struct usb_interface *intf) { struct wdm_device *desc = wdm_find_device(intf); int rv; clear_bit(WDM_RESETTING, &desc->flags); rv = recover_from_urb_loss(desc); mutex_unlock(&desc->wlock); mutex_unlock(&desc->rlock); return 0; }
1
[ "CWE-119", "CWE-269" ]
linux
c0f5ecee4e741667b2493c742b60b6218d40b3aa
6,128,285,033,536,031,000,000,000,000,000,000,000
11
USB: cdc-wdm: fix buffer overflow The buffer for responses must not overflow. If this would happen, set a flag, drop the data and return an error after user space has read all remaining data. Signed-off-by: Oliver Neukum <oliver@neukum.org> CC: stable@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundati...
static inline bool xfrm_dev_offload_ok(struct sk_buff *skb, struct xfrm_state *x) { return false; }
0
[ "CWE-416" ]
linux
dbb2483b2a46fbaf833cfb5deb5ed9cace9c7399
338,172,096,278,922,950,000,000,000,000,000,000,000
4
xfrm: clean up xfrm protocol checks In commit 6a53b7593233 ("xfrm: check id proto in validate_tmpl()") I introduced a check for xfrm protocol, but according to Herbert IPSEC_PROTO_ANY should only be used as a wildcard for lookup, so it should be removed from validate_tmpl(). And, IPSEC_PROTO_ANY is expected to only m...
static int pcm_chmap_ctl_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { struct snd_pcm_chmap *info = snd_kcontrol_chip(kcontrol); uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; uinfo->count = 0; uinfo->count = info->max_channels; uinfo->value.integer.min = 0; uinfo->value.integer.max...
0
[ "CWE-416", "CWE-362" ]
linux
3aa02cb664c5fb1042958c8d1aa8c35055a2ebc4
222,265,926,744,592,300,000,000,000,000,000,000,000
12
ALSA: pcm : Call kill_fasync() in stream lock Currently kill_fasync() is called outside the stream lock in snd_pcm_period_elapsed(). This is potentially racy, since the stream may get released even during the irq handler is running. Although snd_pcm_release_substream() calls snd_pcm_drop(), this doesn't guarantee th...
static inline void finish_lock_switch(struct rq *rq, struct task_struct *prev) { #ifdef CONFIG_SMP /* * After ->oncpu is cleared, the task can be moved to a different CPU. * We must ensure this doesn't happen until the switch is completely * finished. */ smp_wmb(); prev->oncpu = 0; #endif #ifndef __ARCH_WANT...
0
[]
linux-2.6
8f1bc385cfbab474db6c27b5af1e439614f3025c
143,869,159,564,955,520,000,000,000,000,000,000,000
15
sched: fair: weight calculations In order to level the hierarchy, we need to calculate load based on the root view. That is, each task's load is in the same unit. A / \ B 1 / \ 2 3 To compute 1's load we do: weight(1) -------------- rq_weight(A) To ...
remove_target_recursively (CommonJob *job, GFile *src, GFile *toplevel_dest, GFile *file) { GFileEnumerator *enumerator; GError *error; GFile *child; gboolean stop; char *primary, *secondary, *details; int response; GFileInfo *info; stop = FALSE; error = NULL; enumerator = g_file_enumerat...
0
[]
nautilus
ca2fd475297946f163c32dcea897f25da892b89d
66,245,358,905,315,030,000,000,000,000,000,000,000
126
Add nautilus_file_mark_desktop_file_trusted(), this now adds a #! line if 2009-02-24 Alexander Larsson <alexl@redhat.com> * libnautilus-private/nautilus-file-operations.c: * libnautilus-private/nautilus-file-operations.h: Add nautilus_file_mark_desktop_file_trusted(), this now adds a #! line if th...
static BIO *PKCS7_find_digest(EVP_MD_CTX **pmd, BIO *bio, int nid) { for (;;) { bio = BIO_find_type(bio, BIO_TYPE_MD); if (bio == NULL) { PKCS7err(PKCS7_F_PKCS7_FIND_DIGEST, PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST); return NULL; } BIO_get_md...
0
[]
openssl
c0334c2c92dd1bc3ad8138ba6e74006c3631b0f9
2,392,401,350,320,675,000,000,000,000,000,000,000
20
PKCS#7: avoid NULL pointer dereferences with missing content In PKCS#7, the ASN.1 content component is optional. This typically applies to inner content (detached signatures), however we must also handle unexpected missing outer content correctly. This patch only addresses functions reachable from parsing, decryption...
static void bnx2x_e1h_enable(struct bnx2x *bp) { int port = BP_PORT(bp); if (!(IS_MF_UFP(bp) && BNX2X_IS_MF_SD_PROTOCOL_FCOE(bp))) REG_WR(bp, NIG_REG_LLH0_FUNC_EN + port * 8, 1); /* Tx queue should be only re-enabled */ netif_tx_wake_all_queues(bp->dev); /* * Should not call netif_carrier_on since it will b...
0
[ "CWE-20" ]
linux
8914a595110a6eca69a5e275b323f5d09e18f4f9
217,455,228,669,561,920,000,000,000,000,000,000,000
15
bnx2x: disable GSO where gso_size is too big for hardware If a bnx2x card is passed a GSO packet with a gso_size larger than ~9700 bytes, it will cause a firmware error that will bring the card down: bnx2x: [bnx2x_attn_int_deasserted3:4323(enP24p1s0f0)]MC assert! bnx2x: [bnx2x_mc_assert:720(enP24p1s0f0)]XSTORM_ASSERT...
bool Item_cache_wrapper::val_bool() { Item *cached_value; DBUG_ENTER("Item_cache_wrapper::val_bool"); if (!expr_cache) { bool tmp= orig_item->val_bool(); null_value= orig_item->null_value; DBUG_RETURN(tmp); } if ((cached_value= check_cache())) { bool tmp= cached_value->val_bool(); nul...
0
[]
server
b000e169562697aa072600695d4f0c0412f94f4f
59,960,974,386,458,230,000,000,000,000,000,000,000
21
Bug#26361149 MYSQL SERVER CRASHES AT: COL IN(IFNULL(CONST, COL), NAME_CONST('NAME', NULL)) based on: commit f7316aa0c9a Author: Ajo Robert <ajo.robert@oracle.com> Date: Thu Aug 24 17:03:21 2017 +0530 Bug#26361149 MYSQL SERVER CRASHES AT: COL IN(IFNULL(CONST, COL), NAME_CONST('NAME'...
ServiceContext::UniqueOperationContext RenameCollectionTest::makeOpCtx() { return cc().makeOperationContext(); }
0
[ "CWE-20" ]
mongo
35c1b1f588f04926a958ad2fe4d9c59d79f81e8b
263,186,144,612,587,450,000,000,000,000,000,000,000
3
SERVER-35636 renameCollectionForApplyOps checks for complete namespace
cstrncmp(char_u *s1, char_u *s2, int *n) { int result; if (!rex.reg_ic) result = STRNCMP(s1, s2, *n); else result = MB_STRNICMP(s1, s2, *n); // if it failed and it's utf8 and we want to combineignore: if (result != 0 && enc_utf8 && rex.reg_icombine) { char_u *str1, *str2; int c1, c2, c11,...
0
[ "CWE-416" ]
vim
4c13e5e6763c6eb36a343a2b8235ea227202e952
50,806,809,993,308,570,000,000,000,000,000,000,000
47
patch 8.2.3949: using freed memory with /\%V Problem: Using freed memory with /\%V. Solution: Get the line again after getvvcol().
char * getBatteryString(void) { int batt_time; char * ret; char * batt_string; batt_time = getBatteryState(); if ( batt_time <= 60 ) { ret = (char *) calloc(1,2); ret[0] = ']'; return ret; } batt_string = getStringTimeFromSec( (double) batt_time ); ret = (char...
0
[ "CWE-787" ]
aircrack-ng
ff70494dd389ba570dbdbf36f217c28d4381c6b5
68,674,896,709,598,900,000,000,000,000,000,000,000
24
Airodump-ng: Fixed GPS stack overflow (Closes #13 on GitHub). git-svn-id: http://svn.aircrack-ng.org/trunk@2416 28c6078b-6c39-48e3-add9-af49d547ecab
static double mp_atan2(_cimg_math_parser& mp) { return std::atan2(_mp_arg(2),_mp_arg(3));
0
[ "CWE-125" ]
CImg
10af1e8c1ad2a58a0a3342a856bae63e8f257abb
140,038,905,073,547,910,000,000,000,000,000,000,000
3
Fix other issues in 'CImg<T>::load_bmp()'.
dump_putstr(win, attr, str) winid win UNUSED; int attr UNUSED; const char *str; { if (dumplog_file) fprintf(dumplog_file, "%s\n", str); }
0
[ "CWE-120", "CWE-269" ]
NetHack
f3def5c0b999478da2d0a8f0b6a7c370a2065f77
122,942,142,840,517,470,000,000,000,000,000,000,000
8
command line triggered buffer overruns Prevent extremely long command line arguments from overflowing local buffers in raw_printf or config_error_add. The increased buffer sizes they recently got to deal with long configuration file values aren't sufficient to handle command line induced overflows. choose_windows(co...
static void piix3_ide_xen_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); k->realize = pci_piix_ide_realize; k->vendor_id = PCI_VENDOR_ID_INTEL; k->device_id = PCI_DEVICE_ID_INTEL_82371SB_1; k->class_id = PCI_CLASS...
0
[]
qemu
6cd387833d05e8ad31829d97e474dc420625aed9
69,369,148,594,358,380,000,000,000,000,000,000,000
11
Fix release_drive on unplugged devices (pci_piix3_xen_ide_unplug) pci_piix3_xen_ide_unplug should completely unhook the unplugged IDEDevice from the corresponding BlockBackend, otherwise the next call to release_drive will try to detach the drive again. Suggested-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefa...
TPMI_ST_ATTEST_Unmarshal(TPMI_ST_ATTEST *target, BYTE **buffer, INT32 *size) { TPM_RC rc = TPM_RC_SUCCESS; TPMI_ST_ATTEST orig_target = *target; // libtpms added if (rc == TPM_RC_SUCCESS) { rc = TPM_ST_Unmarshal(target, buffer, size); } if (rc == TPM_RC_SUCCESS) { switch (*target) { case TPM_S...
0
[ "CWE-787" ]
libtpms
5cc98a62dc6f204dcf5b87c2ee83ac742a6a319b
80,361,282,731,579,060,000,000,000,000,000,000,000
25
tpm2: Restore original value if unmarshalled value was illegal Restore the original value of the memory location where data from a stream was unmarshalled and the unmarshalled value was found to be illegal. The goal is to not keep illegal values in memory. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
static int t1_getbyte(void) { int c = t1_getchar(); if (t1_pfa) return c; if (t1_block_length == 0) { if (c != 128) pdftex_fail("invalid marker"); c = t1_getchar(); if (c == 3) { while (!t1_eof()) t1_getchar(); return EOF; ...
0
[ "CWE-119" ]
texlive-source
6ed0077520e2b0da1fd060c7f88db7b2e6068e4c
96,503,399,196,335,570,000,000,000,000,000,000,000
23
writet1 protection against buffer overflow git-svn-id: svn://tug.org/texlive/trunk/Build/source@48697 c570f23f-e606-0410-a88d-b1316a301751
static void adapter_add_connection(struct btd_adapter *adapter, struct btd_device *device, uint8_t bdaddr_type) { device_add_connection(device, bdaddr_type); if (g_slist_find(adapter->connections, device)) { btd_error(adapter->dev_id, "Device is already marked as connected"); return; } adapter...
0
[ "CWE-862", "CWE-863" ]
bluez
b497b5942a8beb8f89ca1c359c54ad67ec843055
112,444,672,317,454,480,000,000,000,000,000,000,000
14
adapter: Fix storing discoverable setting discoverable setting shall only be store when changed via Discoverable property and not when discovery client set it as that be considered temporary just for the lifetime of the discovery.
static void init_builtin_echo(void) { #ifdef _WIN32 size_t echo_length; /* Look for "echo.exe" in same dir as mysqltest was started from */ dirname_part(builtin_echo, my_progname, &echo_length); fn_format(builtin_echo, ".\\echo.exe", builtin_echo, "", MYF(MY_REPLACE_DIR)); /* Make sure echo.exe ...
0
[ "CWE-284", "CWE-295" ]
mysql-server
3bd5589e1a5a93f9c224badf983cd65c45215390
229,480,253,106,315,370,000,000,000,000,000,000,000
22
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...
static ssize_t bat_socket_write(struct file *file, const char __user *buff, size_t len, loff_t *off) { struct socket_client *socket_client = file->private_data; struct bat_priv *bat_priv = socket_client->bat_priv; struct hard_iface *primary_if = NULL; struct sk_buff *skb; struct icmp_packet_rr *icmp_packet; ...
0
[ "CWE-119" ]
linux-2.6
b5a1eeef04cc7859f34dec9b72ea1b28e4aba07c
324,212,849,982,088,900,000,000,000,000,000,000,000
110
batman-adv: Only write requested number of byte to user buffer Don't write more than the requested number of bytes of an batman-adv icmp packet to the userspace buffer. Otherwise unrelated userspace memory might get overridden by the kernel. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lind...
gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) { TIFF* tif = img->tif; tileSeparateRoutine put = img->put.separate; unsigned char *buf; unsigned char *p0, *p1, *p2, *pa; uint32 row, y, nrow, rowstoread; tmsize_t pos; tmsize_t scanline; uint32 rowsperstrip, offset_row; uint32 imagewidth...
0
[ "CWE-119" ]
libtiff
40a5955cbf0df62b1f9e9bd7d9657b0070725d19
222,780,541,322,148,260,000,000,000,000,000,000,000
124
* libtiff/tif_next.c: add new tests to check that we don't read outside of the compressed input stream buffer. * libtiff/tif_getimage.c: in OJPEG case, fix checks on strile width/height
uint8_t* FAST_FUNC dname_enc(const uint8_t *cstr, int clen, const char *src, int *retlen) { uint8_t *d, *dname; int off; dname = convert_dname(src); if (dname == NULL) { *retlen = 0; return NULL; } d = dname; while (*d) { if (cstr) { off = find_offset(cstr, clen, d); if (off >= 0) { /* found a matc...
0
[]
busybox
d474ffc68290e0a83651c4432eeabfa62cd51e87
230,938,275,368,784,300,000,000,000,000,000,000,000
27
udhcp: fix a SEGV on malformed RFC1035-encoded domain name Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
int rtattr_parse(struct rtattr *tb[], int maxattr, struct rtattr *rta, int len) { memset(tb, 0, sizeof(struct rtattr*)*maxattr); while (RTA_OK(rta, len)) { unsigned flavor = rta->rta_type; if (flavor && flavor <= maxattr) tb[flavor-1] = rta; rta = RTA_NEXT(rta, len); } return 0; }
0
[ "CWE-200" ]
linux-2.6
9ef1d4c7c7aca1cd436612b6ca785b726ffb8ed8
267,845,045,706,418,670,000,000,000,000,000,000,000
12
[NETLINK]: Missing initializations in dumped data Mostly missing initialization of padding fields of 1 or 2 bytes length, two instances of uninitialized nlmsgerr->msg of 16 bytes length. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
int ip_mc_output(struct net *net, struct sock *sk, struct sk_buff *skb) { struct rtable *rt = skb_rtable(skb); struct net_device *dev = rt->dst.dev; /* * If the indicated interface is up and running, send the packet. */ IP_UPD_PO_STATS(net, IPSTATS_MIB_OUT, skb->len); skb->dev = dev; skb->protocol = htons(E...
0
[ "CWE-362" ]
net
85f1bd9a7b5a79d5baa8bf44af19658f7bf77bfa
252,159,359,001,927,860,000,000,000,000,000,000,000
61
udp: consistently apply ufo or fragmentation When iteratively building a UDP datagram with MSG_MORE and that datagram exceeds MTU, consistently choose UFO or fragmentation. Once skb_is_gso, always apply ufo. Conversely, once a datagram is split across multiple skbs, do not consider ufo. Sendpage already maintains th...
TEST_F(QuotedString_ExtractFrom_Tests, EscapedSingleQuote) { whenInputIs("\"hello \\\'world\\\'\""); resultMustBe("hello 'world'"); }
0
[ "CWE-415", "CWE-119" ]
ArduinoJson
5e7b9ec688d79e7b16ec7064e1d37e8481a31e72
133,462,956,655,450,080,000,000,000,000,000,000,000
4
Fix buffer overflow (pull request #81)
R_API char *r_egg_option_get(REgg *egg, const char *key) { return sdb_get (egg->db, key, NULL); }
0
[ "CWE-125" ]
radare2
e710401ebb4a892a87b0c709d709af8b5dcbbb01
268,429,821,507,955,000,000,000,000,000,000,000,000
3
patch #14211 heap buffer overflow in large ragg2 inputs. this should be refactored to use an RBuffer to enable dynamic resizing, but for now just patching it to bail out if we are about to overwrite the allocated statically sized buffer
void btrfs_bio_counter_sub(struct btrfs_fs_info *fs_info, s64 amount) { percpu_counter_sub(&fs_info->dev_replace.bio_counter, amount); cond_wake_up_nomb(&fs_info->dev_replace.replace_wait); }
0
[ "CWE-476", "CWE-284" ]
linux
09ba3bc9dd150457c506e4661380a6183af651c1
126,702,541,682,663,340,000,000,000,000,000,000,000
5
btrfs: merge btrfs_find_device and find_device Both btrfs_find_device() and find_device() does the same thing except that the latter does not take the seed device onto account in the device scanning context. We can merge them. Signed-off-by: Anand Jain <anand.jain@oracle.com> Reviewed-by: David Sterba <dsterba@suse.c...
vte_sequence_handler_ec (VteTerminal *terminal, GValueArray *params) { VteScreen *screen; VteRowData *rowdata; GValue *value; struct vte_charcell *cell; long col, i, count; screen = terminal->pvt->screen; /* If we got a parameter, use it. */ count = 1; if ((params != NULL) && (params->n_values > 0)) { valu...
0
[]
vte
58bc3a942f198a1a8788553ca72c19d7c1702b74
47,333,598,678,137,650,000,000,000,000,000,000,000
52
fix bug #548272 svn path=/trunk/; revision=2365
int Field_timestamp::store_TIME_with_warning(THD *thd, MYSQL_TIME *l_time, const ErrConv *str, int was_cut, bool have_smth_to_conv) { ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED; uin...
0
[ "CWE-120" ]
server
eca207c46293bc72dd8d0d5622153fab4d3fccf1
313,730,962,924,710,470,000,000,000,000,000,000,000
43
MDEV-25317 Assertion `scale <= precision' failed in decimal_bin_size And Assertion `scale >= 0 && precision > 0 && scale <= precision' failed in decimal_bin_size_inline/decimal_bin_size. Precision should be kept below DECIMAL_MAX_SCALE for computations. It can be bigger in Item_decimal. I'd fix this too but it changes...
static void ieee80211_deliver_skb_to_local_stack(struct sk_buff *skb, struct ieee80211_rx_data *rx) { struct ieee80211_sub_if_data *sdata = rx->sdata; struct net_device *dev = sdata->dev; if (unlikely((skb->protocol == sdata->control_port_protocol || skb->protocol == cpu_to_be16(ETH_P_PREAUTH)) && ...
0
[]
linux
588f7d39b3592a36fb7702ae3b8bdd9be4621e2f
14,824,707,273,166,818,000,000,000,000,000,000,000
22
mac80211: drop robust management frames from unknown TA When receiving a robust management frame, drop it if we don't have rx->sta since then we don't have a security association and thus couldn't possibly validate the frame. Cc: stable@vger.kernel.org Signed-off-by: Johannes Berg <johannes.berg@intel.com>
int efi_mem_desc_lookup(u64 phys_addr, efi_memory_desc_t *out_md) { efi_memory_desc_t *md; if (!efi_enabled(EFI_MEMMAP)) { pr_err_once("EFI_MEMMAP is not enabled.\n"); return -EINVAL; } if (!out_md) { pr_err_once("out_md is null.\n"); return -EINVAL; } for_each_efi_memory_desc(md) { u64 size; ...
0
[]
linux
1957a85b0032a81e6482ca4aab883643b8dae06e
51,057,081,201,142,510,000,000,000,000,000,000,000
27
efi: Restrict efivar_ssdt_load when the kernel is locked down efivar_ssdt_load allows the kernel to import arbitrary ACPI code from an EFI variable, which gives arbitrary code execution in ring 0. Prevent that when the kernel is locked down. Signed-off-by: Matthew Garrett <mjg59@google.com> Acked-by: Ard Biesheuvel <...
bool svm_interrupt_blocked(struct kvm_vcpu *vcpu) { struct vcpu_svm *svm = to_svm(vcpu); struct vmcb *vmcb = svm->vmcb; if (!gif_set(svm)) return true; if (is_guest_mode(vcpu)) { /* As long as interrupts are being delivered... */ if ((svm->nested.ctl.int_ctl & V_INTR_MASKING_MASK) ? !(svm->vmcb01.ptr...
0
[ "CWE-703" ]
linux
6cd88243c7e03845a450795e134b488fc2afb736
20,739,492,369,841,423,000,000,000,000,000,000,000
25
KVM: x86: do not report a vCPU as preempted outside instruction boundaries If a vCPU is outside guest mode and is scheduled out, it might be in the process of making a memory access. A problem occurs if another vCPU uses the PV TLB flush feature during the period when the vCPU is scheduled out, and a virtual address ...
static CPINLINE void swoole_mini_filter_add(zend_string *zstr, size_t offset, zend_uchar byte) { if (swSeriaG.pack_string) { offset -= _STR_HEADER_SIZE; //head 3bit is overhead if (offset >= 0x1fffffff) { return; } if (bigger_filter) { ...
0
[ "CWE-200", "CWE-502" ]
swoole-src
4cdbce5d9bf2fe596bb6acd7d6611f9e8c253a76
238,952,814,989,123,460,000,000,000,000,000,000,000
45
add buffer end check
message_get_severity( message_t *message) { return message->severity; }
0
[ "CWE-77" ]
amanda
29bae2e271093cd8d06ea98f73a474c685c5a314
321,582,891,171,495,650,000,000,000,000,000,000,000
5
* application-src/ambsdtar.c, application-src/amgtar.c, application-src/amstar.c: Filter option from COMMAND-OPTIONS * common-src/ammessage.c: Add message. git-svn-id: https://svn.code.sf.net/p/amanda/code/amanda/trunk@6483 a8d146d6-cc15-0410-8900-af154a0219e0
enable_console_log(void) { log_console = true; }
0
[ "CWE-59", "CWE-61" ]
keepalived
04f2d32871bb3b11d7dc024039952f2fe2750306
27,692,992,962,107,870,000,000,000,000,000,000,000
4
When opening files for write, ensure they aren't symbolic links Issue #1048 identified that if, for example, a non privileged user created a symbolic link from /etc/keepalvied.data to /etc/passwd, writing to /etc/keepalived.data (which could be invoked via DBus) would cause /etc/passwd to be overwritten. This commit ...
static int checkout_target_fullpath( git_buf **out, checkout_data *data, const char *path) { git_buf_truncate(&data->target_path, data->target_len); if (path && git_buf_puts(&data->target_path, path) < 0) return -1; *out = &data->target_path; return 0; }
0
[ "CWE-20", "CWE-706" ]
libgit2
64c612cc3e25eff5fb02c59ef5a66ba7a14751e4
316,022,536,293,937,820,000,000,000,000,000,000,000
12
Protect against 8.3 "short name" attacks also on Linux/macOS The Windows Subsystem for Linux (WSL) is getting increasingly popular, in particular because it makes it _so_ easy to run Linux software on Windows' files, via the auto-mounted Windows drives (`C:\` is mapped to `/mnt/c/`, no need to set that up manually). ...
get_stack_depth_rlimit(void) { #if defined(HAVE_GETRLIMIT) && defined(RLIMIT_STACK) static long val = 0; /* This won't change after process launch, so check just once */ if (val == 0) { struct rlimit rlim; if (getrlimit(RLIMIT_STACK, &rlim) < 0) val = -1; else if (rlim.rlim_cur == RLIM_INFINITY) val =...
0
[ "CWE-89" ]
postgres
2b3a8b20c2da9f39ffecae25ab7c66974fbc0d3b
141,215,223,894,323,640,000,000,000,000,000,000,000
30
Be more careful to not lose sync in the FE/BE protocol. If any error occurred while we were in the middle of reading a protocol message from the client, we could lose sync, and incorrectly try to interpret a part of another message as a new protocol message. That will usually lead to an "invalid frontend message" erro...
static bool tcp_time_to_recover(struct sock *sk, int flag) { struct tcp_sock *tp = tcp_sk(sk); /* Trick#1: The loss is proven. */ if (tp->lost_out) return true; /* Not-A-Trick#2 : Classic rule... */ if (!tcp_is_rack(sk) && tcp_dupack_heuristics(tp) > tp->reordering) return true; return false; }
0
[ "CWE-190" ]
net
3b4929f65b0d8249f19a50245cd88ed1a2f78cff
330,253,808,212,848,630,000,000,000,000,000,000,000
14
tcp: limit payload size of sacked skbs Jonathan Looney reported that TCP can trigger the following crash in tcp_shifted_skb() : BUG_ON(tcp_skb_pcount(skb) < pcount); This can happen if the remote peer has advertized the smallest MSS that linux TCP accepts : 48 An skb can hold 17 fragments, and each fragment can ho...
static struct sctp_chunk *sctp_do_ecn_ecne_work(struct sctp_association *asoc, __u32 lowest_tsn, struct sctp_chunk *chunk) { struct sctp_chunk *repl; /* Our previously transmitted packet ran into some congestion * so we should take action by reducing cwnd and ssthresh * and then ACK our peer that...
0
[]
linux
196d67593439b03088913227093e374235596e33
236,115,510,475,636,640,000,000,000,000,000,000,000
41
sctp: Add support to per-association statistics via a new SCTP_GET_ASSOC_STATS call The current SCTP stack is lacking a mechanism to have per association statistics. This is an implementation modeled after OpenSolaris' SCTP_GET_ASSOC_STATS. Userspace part will follow on lksctp if/when there is a general ACK on this. ...
static void opj_j2k_dump_MH_index(opj_j2k_t* p_j2k, FILE* out_stream) { opj_codestream_index_t* cstr_index = p_j2k->cstr_index; OPJ_UINT32 it_marker, it_tile, it_tile_part; fprintf(out_stream, "Codestream index from main header: {\n"); fprintf(out_stream, "\t Main header start position...
0
[ "CWE-416" ]
openjpeg
940100c28ae28931722290794889cf84a92c5f6f
163,888,603,529,507,000,000,000,000,000,000,000,000
67
Fix potential use-after-free in opj_j2k_write_mco function Fixes #563
static int wstunnel_check_request(request_st * const r, handler_ctx * const hctx) { const buffer * const vers = http_header_request_get(r, HTTP_HEADER_OTHER, CONST_STR_LEN("Sec-WebSocket-Version")); const long hybivers = (NULL != vers) ? light_isdigit(*vers->ptr) ? strtol(vers->ptr, NULL, 10) : -1 ...
0
[ "CWE-476" ]
lighttpd1.4
971773f1fae600074b46ef64f3ca1f76c227985f
46,476,773,281,412,440,000,000,000,000,000,000,000
25
[mod_wstunnel] fix crash with bad hybivers (fixes #3165) (thx Michał Dardas) x-ref: "mod_wstunnel null pointer dereference" https://redmine.lighttpd.net/issues/3165
smsg_attr_keep(int attr, const char *s, ...) { if (IObuff == NULL) { // Very early in initialisation and already something wrong, just // give the raw message so the user at least gets a hint. return msg_attr_keep((char *)s, attr, TRUE); } else { va_list arglist; va_start(arglist, s); vim_vsn...
0
[ "CWE-416" ]
vim
9f1a39a5d1cd7989ada2d1cb32f97d84360e050f
9,789,840,364,207,535,000,000,000,000,000,000,000
18
patch 8.2.4040: keeping track of allocated lines is too complicated Problem: Keeping track of allocated lines in user functions is too complicated. Solution: Instead of freeing individual lines keep them all until the end.
void setState(StateEnum s) { state = s; if (wcb_) { wcb_->state = s; } }
0
[ "CWE-125" ]
folly
c321eb588909646c15aefde035fd3133ba32cdee
274,574,628,327,705,700,000,000,000,000,000,000,000
6
Handle close_notify as standard writeErr in AsyncSSLSocket. Summary: Fixes CVE-2019-11934 Reviewed By: mingtaoy Differential Revision: D18020613 fbshipit-source-id: db82bb250e53f0d225f1280bd67bc74abd417836
static void do_revertframes(compiler_common *common) { DEFINE_COMPILER; struct sljit_jump *jump; struct sljit_label *mainloop; sljit_emit_fast_enter(compiler, RETURN_ADDR, 0); GET_LOCAL_BASE(TMP1, 0, 0); /* Drop frames until we reach STACK_TOP. */ mainloop = LABEL(); OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(STACK_TOP), -si...
0
[ "CWE-125" ]
php-src
8947fd9e9fdce87cd6c59817b1db58e789538fe9
223,535,943,693,546,500,000,000,000,000,000,000,000
53
Fix #78338: Array cross-border reading in PCRE We backport r1092 from pcre2.
R_API RBuffer *r_buf_ref(RBuffer *b) { if (b) { b->refctr++; } return b; }
0
[ "CWE-400", "CWE-703" ]
radare2
634b886e84a5c568d243e744becc6b3223e089cf
331,365,499,887,327,500,000,000,000,000,000,000,000
6
Fix DoS in PE/QNX/DYLDCACHE/PSX parsers ##crash * Reported by lazymio * Reproducer: AAA4AAAAAB4=
void dn_dev_up(struct net_device *dev) { struct dn_ifaddr *ifa; __le16 addr = decnet_address; int maybe_default = 0; struct dn_dev *dn_db = rtnl_dereference(dev->dn_ptr); if ((dev->type != ARPHRD_ETHER) && (dev->type != ARPHRD_LOOPBACK)) return; /* * Need to ensure that loopback device has a dn_db attached ...
0
[ "CWE-264" ]
net
90f62cf30a78721641e08737bda787552428061e
51,339,390,202,697,850,000,000,000,000,000,000,000
53
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. ...
mlx5_rxq_initialize(struct mlx5_rxq_data *rxq) { const unsigned int wqe_n = 1 << rxq->elts_n; unsigned int i; for (i = 0; (i != wqe_n); ++i) { volatile struct mlx5_wqe_data_seg *scat; uintptr_t addr; uint32_t byte_count; if (mlx5_rxq_mprq_enabled(rxq)) { struct mlx5_mprq_buf *buf = (*rxq->mprq_bufs)[i];...
0
[]
dpdk-stable
8b090f2664e9d014cd8fa0fde90597aaf4349e7e
339,286,642,900,519,300,000,000,000,000,000,000,000
46
net/mlx5: fix Rx queue recovery mechanism The local variables are getting inconsistent in data receiving routines after queue error recovery. Receive queue consumer index is getting wrong, need to reset one to the size of the queue (as RQ was fully replenished in recovery procedure). In MPRQ case, also the local cons...
int ldb_build_rename_req(struct ldb_request **ret_req, struct ldb_context *ldb, TALLOC_CTX *mem_ctx, struct ldb_dn *olddn, struct ldb_dn *newdn, struct ldb_control **controls, void *context, ldb_request_callback_t callback, struct ldb_request *parent) { struct ldb_request *req; *ret_req = NUL...
0
[ "CWE-476" ]
samba
d8b9bb274b7e7a390cf3bda9cd732cb2227bdbde
204,623,750,541,199,970,000,000,000,000,000,000,000
27
CVE-2020-10730: lib ldb: Check if ldb_lock_backend_callback called twice Prevent use after free issues if ldb_lock_backend_callback is called twice, usually due to ldb_module_done being called twice. This can happen if a module ignores the return value from function a function that calls ldb_module_done as part of it'...
static int hci_uart_send_frame(struct hci_dev *hdev, struct sk_buff *skb) { struct hci_uart *hu = hci_get_drvdata(hdev); BT_DBG("%s: type %d len %d", hdev->name, hci_skb_pkt_type(skb), skb->len); percpu_down_read(&hu->proto_lock); if (!test_bit(HCI_UART_PROTO_READY, &hu->flags)) { percpu_up_read(&hu->p...
0
[ "CWE-416" ]
linux
56897b217a1d0a91c9920cb418d6b3fe922f590a
210,838,858,505,860,380,000,000,000,000,000,000,000
21
Bluetooth: hci_ldisc: Postpone HCI_UART_PROTO_READY bit set in hci_uart_set_proto() task A: task B: hci_uart_set_proto flush_to_ldisc - p->open(hu) -> h5_open //alloc h5 - receive_buf - set_bit HCI_UART_PROTO_READY - tty_port_default_receive_buf - hci_uar...
parse_strict_transport_security (const char *header, time_t *max_age, bool *include_subdomains) { param_token name, value; const char *c_max_age = NULL; bool is = false; /* includeSubDomains */ bool is_url_encoded = false; bool success = false; if (header) { /* Process the STS header. Keys should...
0
[ "CWE-200" ]
wget
a933bdd31eee9c956a3b5cc142f004ef1fa94cb3
59,546,489,176,044,550,000,000,000,000,000,000,000
50
Keep fetched URLs in POSIX extended attributes * configure.ac: Check for xattr availability * src/Makefile.am: Add xattr.c * src/ftp.c: Include xattr.h. (getftp): Set attributes if enabled. * src/http.c: Include xattr.h. (gethttp): Add parameter 'original_url', set attributes if enabled. (http_loop): Add 'orig...
conv_get_fallback_for_private_encoding(const gchar *encoding) { if (encoding && (encoding[0] == 'X' || encoding[0] == 'x') && encoding[1] == '-') { if (!g_ascii_strcasecmp(encoding, CS_X_MACCYR)) return CS_MACCYR; if (!g_ascii_strcasecmp(encoding, CS_X_GBK)) return CS_GBK; } return encoding; }
0
[ "CWE-119" ]
claws
d390fa07f5548f3173dd9cc13b233db5ce934c82
73,668,841,496,574,220,000,000,000,000,000,000,000
12
Make sure we don't run out of the output buffer. Maybe fixes bug #3557
get_scan_primary (OpKind kind) { switch (kind) { default: case OP_KIND_COPY: { return f (_("Error while copying.")); } case OP_KIND_MOVE: { return f (_("Error while moving.")); } case OP_KIND_DELETE: { ...
0
[ "CWE-20" ]
nautilus
1630f53481f445ada0a455e9979236d31a8d3bb0
317,710,418,924,963,760,000,000,000,000,000,000,000
29
mime-actions: use file metadata for trusting desktop files Currently we only trust desktop files that have the executable bit set, and don't replace the displayed icon or the displayed name until it's trusted, which prevents for running random programs by a malicious desktop file. However, the executable permission i...
static ssize_t aio_run_iocb(struct kiocb *req, unsigned opcode, char __user *buf, bool compat) { struct file *file = req->ki_filp; ssize_t ret; unsigned long nr_segs; int rw; fmode_t mode; aio_rw_op *rw_op; rw_iter_op *iter_op; struct iovec inline_vec, *iovec = &inline_vec; struct iov_iter iter; switc...
0
[ "CWE-200" ]
linux
edfbbf388f293d70bf4b7c0bc38774d05e6f711a
89,094,250,386,880,880,000,000,000,000,000,000,000
109
aio: fix kernel memory disclosure in io_getevents() introduced in v3.10 A kernel memory disclosure was introduced in aio_read_events_ring() in v3.10 by commit a31ad380bed817aa25f8830ad23e1a0480fef797. The changes made to aio_read_events_ring() failed to correctly limit the index into ctx->ring_pages[], allowing an at...
static void ExportBlackQuantum(const Image *image,QuantumInfo *quantum_info, const MagickSizeType number_pixels,const Quantum *magick_restrict p, unsigned char *magick_restrict q,ExceptionInfo *exception) { QuantumAny range; ssize_t x; if (image->colorspace != CMYKColorspace) { (void) Thro...
0
[ "CWE-190" ]
ImageMagick
5af1dffa4b6ab984b5f13d1e91c95760d75f12a6
186,952,689,851,732,800,000,000,000,000,000,000,000
108
outside the range of representable values of type 'unsigned char' (#3083) Co-authored-by: Zhang Xiaohui <ruc_zhangxiaohui@163.com>
box_cn(Point *center, BOX *box) { center->x = (box->high.x + box->low.x) / 2.0; center->y = (box->high.y + box->low.y) / 2.0; }
0
[ "CWE-703", "CWE-189" ]
postgres
31400a673325147e1205326008e32135a78b4d8a
231,661,104,990,061,600,000,000,000,000,000,000,000
5
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...
SetClient2Server(rfbClient* client, int messageType) { client->supportedMessages.client2server[((messageType & 0xFF)/8)] |= (1<<(messageType % 8)); }
0
[ "CWE-20" ]
libvncserver
85a778c0e45e87e35ee7199f1f25020648e8b812
213,813,033,995,301,800,000,000,000,000,000,000,000
4
Check for MallocFrameBuffer() return value If MallocFrameBuffer() returns FALSE, frame buffer pointer is left to NULL. Subsequent writes into that buffer could lead to memory corruption, or even arbitrary code execution.
safe_path(const char *name, struct stat *stp, const char *pw_dir, uid_t uid, char *err, size_t errlen) { char buf[PATH_MAX], homedir[PATH_MAX]; char *cp; int comparehome = 0; struct stat st; if (realpath(name, buf) == NULL) { snprintf(err, errlen, "realpath %s failed: %s", name, strerror(errno)); re...
0
[]
openssh-portable
f3cbe43e28fe71427d41cfe3a17125b972710455
160,584,102,061,244,820,000,000,000,000,000,000,000
56
upstream: need initgroups() before setresgid(); reported by anton@, ok deraadt@ OpenBSD-Commit-ID: 6aa003ee658b316960d94078f2a16edbc25087ce
imapx_disconnect (CamelIMAPXServer *is) { g_cancellable_cancel (is->priv->cancellable); g_mutex_lock (&is->priv->stream_lock); if (is->priv->connection) { /* No need to wait for close for too long */ imapx_server_set_connection_timeout (is->priv->connection, 3); } g_clear_object (&is->priv->input_stream); ...
0
[ "CWE-476" ]
evolution-data-server
2cc39592b532cf0dc994fd3694b8e6bf924c9ab5
95,841,614,757,915,200,000,000,000,000,000,000,000
38
I#189 - Crash on malformed server response with minimal capabilities Closes https://gitlab.gnome.org/GNOME/evolution-data-server/issues/189
build_keyblock_image (kbnode_t keyblock, iobuf_t *r_iobuf, u32 **r_sigstatus) { gpg_error_t err; iobuf_t iobuf; kbnode_t kbctx, node; u32 n_sigs; u32 *sigstatus; *r_iobuf = NULL; if (r_sigstatus) *r_sigstatus = NULL; /* Allocate a vector for the signature cache. This is an array of u32 value...
0
[ "CWE-416" ]
gnupg
f0f71a721ccd7ab9e40b8b6b028b59632c0cc648
300,123,867,171,562,330,000,000,000,000,000,000,000
84
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...
void Field_time_hires::store_TIME(MYSQL_TIME *ltime) { ulonglong packed= sec_part_shift(pack_time(ltime), dec) + zero_point; store_bigendian(packed, ptr, Field_time_hires::pack_length()); }
0
[ "CWE-120" ]
server
eca207c46293bc72dd8d0d5622153fab4d3fccf1
250,949,612,818,243,160,000,000,000,000,000,000,000
5
MDEV-25317 Assertion `scale <= precision' failed in decimal_bin_size And Assertion `scale >= 0 && precision > 0 && scale <= precision' failed in decimal_bin_size_inline/decimal_bin_size. Precision should be kept below DECIMAL_MAX_SCALE for computations. It can be bigger in Item_decimal. I'd fix this too but it changes...
static inline void TCP_ECN_check_ce(struct tcp_sock *tp, const struct sk_buff *skb) { if (!(tp->ecn_flags & TCP_ECN_OK)) return; switch (TCP_SKB_CB(skb)->ip_dsfield & INET_ECN_MASK) { case INET_ECN_NOT_ECT: /* Funny extension: if ECT is not set on a segment, * and we already seen ECT on a previous segment, ...
0
[]
net-next
fdf5af0daf8019cec2396cdef8fb042d80fe71fa
5,228,556,253,099,108,600,000,000,000,000,000,000
21
tcp: drop SYN+FIN messages Denys Fedoryshchenko reported that SYN+FIN attacks were bringing his linux machines to their limits. Dont call conn_request() if the TCP flags includes SYN flag Reported-by: Denys Fedoryshchenko <denys@visp.net.lb> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S...
bool SafeX509InfoAccessPrint(const BIOPointer& out, X509_EXTENSION* ext) { const X509V3_EXT_METHOD* method = X509V3_EXT_get(ext); CHECK(method == X509V3_EXT_get_nid(NID_info_access)); AUTHORITY_INFO_ACCESS* descs = static_cast<AUTHORITY_INFO_ACCESS*>(X509V3_EXT_d2i(ext)); if (descs == nullptr) return...
0
[ "CWE-295" ]
node
466e5415a2b7b3574ab5403acb87e89a94a980d1
134,818,417,477,935,840,000,000,000,000,000,000,000
32
crypto,tls: implement safe x509 GeneralName format This change introduces JSON-compatible escaping rules for strings that include X.509 GeneralName components (see RFC 5280). This non-standard format avoids ambiguities and prevents injection attacks that could previously lead to X.509 certificates being accepted even ...
static void __perf_event__output_id_sample(struct perf_output_handle *handle, struct perf_sample_data *data) { u64 sample_type = data->type; if (sample_type & PERF_SAMPLE_TID) perf_output_put(handle, data->tid_entry); if (sample_type & PERF_SAMPLE_TIME) perf_output_put(handle, data->time); if (sample...
0
[ "CWE-284", "CWE-264" ]
linux
f63a8daa5812afef4f06c962351687e1ff9ccb2b
338,014,597,082,254,430,000,000,000,000,000,000,000
23
perf: Fix event->ctx locking There have been a few reported issues wrt. the lack of locking around changing event->ctx. This patch tries to address those. It avoids the whole rwsem thing; and while it appears to work, please give it some thought in review. What I did fail at is sensible runtime checks on the use of ...
static unsigned addChunk_tIME(ucvector* out, const LodePNGTime* time) { unsigned error = 0; unsigned char* data = (unsigned char*)malloc(7); if(!data) return 83; /*alloc fail*/ data[0] = (unsigned char)(time->year / 256); data[1] = (unsigned char)(time->year % 256); data[2] = (unsigned char)time->month; d...
0
[ "CWE-401" ]
FreeRDP
9fee4ae076b1ec97b97efb79ece08d1dab4df29a
284,831,454,019,256,100,000,000,000,000,000,000,000
16
Fixed #5645: realloc return handling
JOIN::reinit() { DBUG_ENTER("JOIN::reinit"); unit->offset_limit_cnt= (ha_rows)(select_lex->offset_limit ? select_lex->offset_limit->val_uint() : 0); first_record= false; group_sent= false; cleaned= false; if (aggr_tables) { JOIN_TAB *curr_tab= join_tab + exec_joi...
0
[]
server
ff77a09bda884fe6bf3917eb29b9d3a2f53f919b
44,327,050,907,890,505,000,000,000,000,000,000,000
66
MDEV-22464 Server crash on UPDATE with nested subquery Uninitialized ref_pointer_array[] because setup_fields() got empty fields list. mysql_multi_update() for some reason does that by substituting the fields list with empty total_list for the mysql_select() call (looks like wrong merge since total_list is not used a...
STBIDEF stbi_uc *stbi_load_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp) { stbi__context s; stbi__start_mem(&s,buffer,len); return stbi__load_and_postprocess_8bit(&s,x,y,comp,req_comp); }
0
[ "CWE-787" ]
stb
5ba0baaa269b3fd681828e0e3b3ac0f1472eaf40
125,782,492,341,086,380,000,000,000,000,000,000,000
6
stb_image: Reject fractional JPEG component subsampling ratios The component resamplers are not written to support this and I've never seen it happen in a real (non-crafted) JPEG file so I'm fine rejecting this as outright corrupt. Fixes issue #1178.
int get_evtchn_to_irq(evtchn_port_t evtchn) { if (evtchn >= xen_evtchn_max_channels()) return -1; if (evtchn_to_irq[EVTCHN_ROW(evtchn)] == NULL) return -1; return evtchn_to_irq[EVTCHN_ROW(evtchn)][EVTCHN_COL(evtchn)]; }
1
[ "CWE-362", "CWE-476" ]
linux
073d0552ead5bfc7a3a9c01de590e924f11b5dd2
35,741,833,209,611,096,000,000,000,000,000,000,000
8
xen/events: avoid removing an event channel while handling it Today it can happen that an event channel is being removed from the system while the event handling loop is active. This can lead to a race resulting in crashes or WARN() splats when trying to access the irq_info structure related to the event channel. Fix...
xsltCompilationCtxtCreate(xsltStylesheetPtr style) { xsltCompilerCtxtPtr ret; ret = (xsltCompilerCtxtPtr) xmlMalloc(sizeof(xsltCompilerCtxt)); if (ret == NULL) { xsltTransformError(NULL, style, NULL, "xsltCompilerCreate: allocation of compiler " "context failed.\n"); return(NULL); } mem...
0
[]
libxslt
7089a62b8f133b42a2981cf1f920a8b3fe9a8caa
176,234,993,108,341,760,000,000,000,000,000,000,000
33
Crash compiling stylesheet with DTD * libxslt/xslt.c: when a stylesheet embbeds a DTD the compilation process could get seriously wrong
int yr_object_dict_set_item( YR_OBJECT* object, YR_OBJECT* item, const char* key) { YR_OBJECT_DICTIONARY* dict; int i; int count; assert(object->type == OBJECT_TYPE_DICTIONARY); dict = object_as_dictionary(object); if (dict->items == NULL) { count = 64; dict->items = (YR_DICTIONAR...
0
[ "CWE-119", "CWE-787" ]
yara
4a342f01e5439b9bb901aff1c6c23c536baeeb3f
289,211,228,745,686,070,000,000,000,000,000,000,000
58
Fix heap overflow (reported by Jurriaan Bremer) When setting a new array item with yr_object_array_set_item() the array size is doubled if the index for the new item is larger than the already allocated ones. No further checks were made to ensure that the index fits into the array after doubling its capacity. If the a...
static int mpage_map_and_submit_buffers(struct mpage_da_data *mpd) { struct pagevec pvec; int nr_pages, i; struct inode *inode = mpd->inode; int bpp_bits = PAGE_SHIFT - inode->i_blkbits; pgoff_t start, end; ext4_lblk_t lblk; ext4_fsblk_t pblock; int err; bool map_bh = false; start = mpd->map.m_lblk >> bpp_bi...
0
[ "CWE-703" ]
linux
ce9f24cccdc019229b70a5c15e2b09ad9c0ab5d1
318,406,230,983,281,370,000,000,000,000,000,000,000
50
ext4: check journal inode extents more carefully Currently, system zones just track ranges of block, that are "important" fs metadata (bitmaps, group descriptors, journal blocks, etc.). This however complicates how extent tree (or indirect blocks) can be checked for inodes that actually track such metadata - currently...
create_custom_attr (MonoImage *image, MonoMethod *method, const guchar *data, guint32 len) { const char *p = (const char*)data; const char *named; guint32 i, j, num_named; MonoObject *attr; void *params_buf [32]; void **params; MonoMethodSignature *sig; mono_class_init (method->klass); if (!mono_verifier_ver...
0
[ "CWE-20" ]
mono
65292a69c837b8a5f7a392d34db63de592153358
15,928,948,503,796,737,000,000,000,000,000,000,000
96
Handle invalid instantiation of generic methods. * verify.c: Add new function to internal verifier API to check method instantiations. * reflection.c (mono_reflection_bind_generic_method_parameters): Check the instantiation before returning it. Fixes #655847
void init_re_comp(my_regex_t *re, const char* str) { int err= my_regcomp(re, str, (REG_EXTENDED | REG_ICASE | REG_NOSUB), &my_charset_latin1); if (err) { char erbuf[100]; int len= my_regerror(err, re, erbuf, sizeof(erbuf)); die("error %s, %d/%d `%s'\n", re_eprint(err), (int)len,...
0
[ "CWE-295" ]
mysql-server
b3e9211e48a3fb586e88b0270a175d2348935424
8,885,358,562,235,232,000,000,000,000,000,000,000
12
WL#9072: Backport WL#8785 to 5.5
HTTPSession::maybeResumePausedPipelinedTransaction( size_t oldStreamCount, uint32_t txnSeqn) { if (!codec_->supportsParallelRequests() && !transactions_.empty() && getPipelineStreamCount() < oldStreamCount && getPipelineStreamCount() == 1) { auto& nextTxn = transactions_.rbegin()->second; DCHECK...
0
[ "CWE-20" ]
proxygen
0600ebe59c3e82cd012def77ca9ca1918da74a71
123,247,236,743,487,530,000,000,000,000,000,000,000
15
Check that a secondary auth manager is set before dereferencing. Summary: CVE-2018-6343 Reviewed By: mingtaoy Differential Revision: D12994423 fbshipit-source-id: 9229ec11da8085f1fa153595e8e5353e19d06fb7
static int check_policy(X509_STORE_CTX *ctx) { int ret; if (ctx->parent) return 1; ret = X509_policy_check(&ctx->tree, &ctx->explicit_policy, ctx->chain, ctx->param->policies, ctx->param->flags); if (ret == 0) { X509err(X509_F_CHECK_POLICY, ERR_R_MALLOC_FAILUR...
0
[ "CWE-476" ]
openssl
6e629b5be45face20b4ca71c4fcbfed78b864a2e
9,898,029,117,083,680,000,000,000,000,000,000,000
50
Add some sanity checks when checking CRL scores Note: this was accidentally omitted from OpenSSL 1.0.2 branch. Without this fix any attempt to use CRLs will crash. CVE-2016-7052 Thanks to Bruce Stephens and Thomas Jakobi for reporting this issue. Reviewed-by: Stephen Henson <steve@openssl.org> Reviewed-by: Rich Sal...
xmlXPathNodeSetContains (xmlNodeSetPtr cur, xmlNodePtr val) { int i; if ((cur == NULL) || (val == NULL)) return(0); if (val->type == XML_NAMESPACE_DECL) { for (i = 0; i < cur->nodeNr; i++) { if (cur->nodeTab[i]->type == XML_NAMESPACE_DECL) { xmlNsPtr ns1, ns2; ns1 = (xmlNsPtr) val; ns2 = (xmlN...
0
[ "CWE-119" ]
libxml2
91d19754d46acd4a639a8b9e31f50f31c78f8c9c
193,401,641,337,196,200,000,000,000,000,000,000,000
26
Fix the semantic of XPath axis for namespace/attribute context nodes The processing of namespace and attributes nodes was not compliant to the XPath-1.0 specification
int blosc_get_nthreads(void) { return g_nthreads; }
0
[ "CWE-787" ]
c-blosc2
c4c6470e88210afc95262c8b9fcc27e30ca043ee
110,074,161,515,353,300,000,000,000,000,000,000,000
4
Fixed asan heap buffer overflow when not enough space to write compressed block size.
static int ttusbdecfe_dvbs_diseqc_send_master_cmd(struct dvb_frontend* fe, struct dvb_diseqc_master_cmd *cmd) { struct ttusbdecfe_state* state = (struct ttusbdecfe_state*) fe->demodulator_priv; u8 b[] = { 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; memcpy(&b[4], cmd->msg, cmd->msg_len); ...
1
[ "CWE-119", "CWE-787" ]
linux
f2e323ec96077642d397bb1c355def536d489d16
14,540,912,129,024,437,000,000,000,000,000,000,000
15
[media] ttusb-dec: buffer overflow in ioctl We need to add a limit check here so we don't overflow the buffer. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
static unsigned long wakeup_gran(struct sched_entity *se) { unsigned long gran = sysctl_sched_wakeup_granularity; /* * Since its curr running now, convert the gran from real-time * to virtual-time in his units. * * By using 'se' instead of 'curr' we penalize light tasks, so * they get preempted easier. Tha...
0
[ "CWE-400", "CWE-703", "CWE-835" ]
linux
c40f7d74c741a907cfaeb73a7697081881c497d0
176,865,694,641,915,270,000,000,000,000,000,000,000
19
sched/fair: Fix infinite loop in update_blocked_averages() by reverting a9e7f6544b9c Zhipeng Xie, Xie XiuQi and Sargun Dhillon reported lockups in the scheduler under high loads, starting at around the v4.18 time frame, and Zhipeng Xie tracked it down to bugs in the rq->leaf_cfs_rq_list manipulation. Do a (manual) re...
static ut8 bin_reloc_size(RBinReloc *reloc) { #define CASE(T) case R_BIN_RELOC_ ## T: return T / 8 switch (reloc->type) { CASE(8); CASE(16); CASE(32); CASE(64); } return 0; #undef CASE }
0
[ "CWE-125" ]
radare2
1f37c04f2a762500222dda2459e6a04646feeedf
77,946,266,641,891,840,000,000,000,000,000,000,000
11
Fix #9904 - crash in r2_hoobr_r_read_le32 (over 9000 entrypoints) and read_le oobread (#9923)
static void fib6_link_table(struct net *net, struct fib6_table *tb) { unsigned int h; /* * Initialize table lock at a single place to give lockdep a key, * tables aren't visible prior to being linked to the list. */ spin_lock_init(&tb->tb6_lock); h = tb->tb6_id & (FIB6_TABLE_HASHSZ - 1); /* * No protecti...
0
[ "CWE-755" ]
linux
7b09c2d052db4b4ad0b27b97918b46a7746966fa
291,312,263,246,898,750,000,000,000,000,000,000,000
17
ipv6: fix a typo in fib6_rule_lookup() Yi Ren reported an issue discovered by syzkaller, and bisected to the cited commit. Many thanks to Yi, this trivial patch does not reflect the patient work that has been done. Fixes: d64a1f574a29 ("ipv6: honor RT6_LOOKUP_F_DST_NOREF in rule lookup logic") Signed-off-by: Eric Du...
http_SetResp(struct http *to, const char *proto, uint16_t status, const char *response) { CHECK_OBJ_NOTNULL(to, HTTP_MAGIC); http_SetH(to, HTTP_HDR_PROTO, proto); assert(status >= 100 && status <= 999); to->status = status; http_SetH(to, HTTP_HDR_RESPONSE, response); }
0
[]
Varnish-Cache
29870c8fe95e4e8a672f6f28c5fbe692bea09e9c
228,031,580,962,007,120,000,000,000,000,000,000,000
10
Check for duplicate Content-Length headers in requests If a duplicate CL header is in the request, we fail the request with a 400 (Bad Request) Fix a test case that was sending duplicate CL by misstake and would not fail because of that.
static enum si_sm_result smi_event_handler(struct smi_info *smi_info, int time) { enum si_sm_result si_sm_result; restart: /* * There used to be a loop here that waited a little while * (around 25us) before giving up. That turned out to be * pointless, the minimum delays I was seeing were in the 300us...
0
[ "CWE-416" ]
linux
401e7e88d4ef80188ffa07095ac00456f901b8c4
242,790,490,044,666,080,000,000,000,000,000,000,000
120
ipmi_si: fix use-after-free of resource->name When we excute the following commands, we got oops rmmod ipmi_si cat /proc/ioports [ 1623.482380] Unable to handle kernel paging request at virtual address ffff00000901d478 [ 1623.482382] Mem abort info: [ 1623.482383] ESR = 0x96000007 [ 1623.482385] Exception class =...
int pm_qos_sysfs_add_flags(struct device *dev) { return sysfs_merge_group(&dev->kobj, &pm_qos_flags_attr_group); }
0
[ "CWE-787" ]
linux
aa838896d87af561a33ecefea1caa4c15a68bc47
21,746,716,164,694,930,000,000,000,000,000,000,000
4
drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions Convert the various sprintf fmaily calls in sysfs device show functions to sysfs_emit and sysfs_emit_at for PAGE_SIZE buffer safety. Done with: $ spatch -sp-file sysfs_emit_dev.cocci --in-place --max-width=80 . And cocci script: $ cat s...
static inline int nla_ok(const struct nlattr *nla, int remaining) { return remaining >= sizeof(*nla) && nla->nla_len >= sizeof(*nla) && nla->nla_len <= remaining; }
1
[]
linux-2.6
1045b03e07d85f3545118510a587035536030c1c
202,512,783,775,518,600,000,000,000,000,000,000,000
6
netlink: fix overrun in attribute iteration kmemcheck reported this: kmemcheck: Caught 16-bit read from uninitialized memory (f6c1ba30) 0500110001508abf050010000500000002017300140000006f72672e66726565 i i i i i i i i i i i i i u u u u u u u u u u u u u u u u u u u ^ Pid: 3...
RList *r_bin_ne_get_relocs(r_bin_ne_obj_t *bin) { RList *segments = bin->segments; if (!segments) { return NULL; } RList *entries = bin->entries; if (!entries) { return NULL; } RList *symbols = bin->symbols; if (!symbols) { return NULL; } ut16 *modref = calloc (bin->ne_header->ModRefs, sizeof (ut16)); ...
0
[ "CWE-20", "CWE-129" ]
radare2
2d782cdaa2112c10b8dd5e7a93c134b2ada9c1a6
196,694,322,801,175,920,000,000,000,000,000,000,000
146
Fix oobread segfaults in the NE bin parser ##crash * Reported by @han0nly via huntr.dev * Reproducers: seed1 seed2 * BountyID: ad3c9c4c-76e7-40c8-bd4a-c095acd8bb40
static void event_connected(IRC_SERVER_REC *server, const char *data, const char *from) { char *params, *nick; GTimeVal now; g_return_if_fail(server != NULL); params = event_get_params(data, 1, &nick); if (g_strcmp0(server->nick, nick) != 0) { /* nick changed unexpectedly .. connected via proxy, etc. */ g_f...
0
[ "CWE-416" ]
irssi
b8d3301d34f383f039071214872570385de1bb59
128,088,911,247,507,560,000,000,000,000,000,000,000
44
SASL support The only supported methods are PLAIN and EXTERNAL, the latter is untested as of now. The code gets the values from the keys named sasl_{mechanism,username,password} specified for each chatnet.
R_API void r_io_bank_free(RIOBank *bank) { if (bank) { r_queue_free (bank->todo); r_list_free (bank->maprefs); r_crbtree_free (bank->submaps); free (bank->name); free (bank); } }
0
[ "CWE-416" ]
radare2
b5cb90b28ec71fda3504da04e3cc94a362807f5e
162,196,641,427,384,770,000,000,000,000,000,000,000
9
Prefer memleak over usaf in io.bank's rbtree bug ##crash * That's a workaround, proper fix will come later * Reproducer: bins/fuzzed/iobank-crash * Reported by Akyne Choi via huntr.dev
void ff_color_frame(AVFrame *frame, const int c[4]) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format); int p, y, x; av_assert0(desc->flags & AV_PIX_FMT_FLAG_PLANAR); for (p = 0; p<desc->nb_components; p++) { uint8_t *dst = frame->data[p]; int is_chroma = p == 1 || p...
0
[ "CWE-787" ]
FFmpeg
2080bc33717955a0e4268e738acf8c1eeddbf8cb
24,919,916,164,400,560,000,000,000,000,000,000,000
22
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 int net_assign_generic(struct net *net, unsigned int id, void *data) { struct net_generic *ng, *old_ng; BUG_ON(!mutex_is_locked(&net_mutex)); BUG_ON(id < MIN_PERNET_OPS_ID); old_ng = rcu_dereference_protected(net->gen, lockdep_is_held(&net_mutex)); if (old_ng->s.len > id) { old_ng->ptr[id] = dat...
0
[ "CWE-416" ]
linux
21b5944350052d2583e82dd59b19a9ba94a007f0
298,323,469,482,982,370,000,000,000,000,000,000,000
37
net: Fix double free and memory corruption in get_net_ns_by_id() (I can trivially verify that that idr_remove in cleanup_net happens after the network namespace count has dropped to zero --EWB) Function get_net_ns_by_id() does not check for net::count after it has found a peer in netns_ids idr. It may dereference a...
fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var) { struct fb_fix_screeninfo *fix = &info->fix; unsigned int yres = info->var.yres; int err = 0; if (var->yoffset > 0) { if (var->vmode & FB_VMODE_YWRAP) { if (!fix->ywrapstep || (var->yoffset % fix->ywrapstep)) err = -EINVAL; else y...
0
[ "CWE-703", "CWE-189" ]
linux
fc9bbca8f650e5f738af8806317c0a041a48ae4a
37,851,255,344,236,120,000,000,000,000,000,000,000
35
vm: convert fb_mmap to vm_iomap_memory() helper This is my example conversion of a few existing mmap users. The fb_mmap() case is a good example because it is a bit more complicated than some: fb_mmap() mmaps one of two different memory areas depending on the page offset of the mmap (but happily there is never any mi...
static int mxf_seek_to_previous_partition(MXFContext *mxf) { AVIOContext *pb = mxf->fc->pb; if (!mxf->current_partition || mxf->run_in + mxf->current_partition->previous_partition <= mxf->last_forward_tell) return 0; /* we've parsed all partitions */ /* seek to previous partition */ ...
0
[ "CWE-703" ]
FFmpeg
f173cdfe669556aa92857adafe60cbe5f2aa1210
75,162,003,450,715,070,000,000,000,000,000,000,000
16
avformat/mxfdec: Fix DoS issues in mxf_read_index_entry_array() Fixes: 20170829A.mxf Co-Author: 张洪亮(望初)" <wangchu.zhl@alibaba-inc.com> Found-by: Xiaohei and Wangchu from Alibaba Security Team Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 900f39692ca0337a98a7cf047e4e2611071810c...
**/ T cubic_atXYZ_c(const float fx, const float fy, const float fz, const int c) const { return cimg::type<T>::cut(cubic_atXYZ(fx,fy,fz,c));
0
[ "CWE-119", "CWE-787" ]
CImg
ac8003393569aba51048c9d67e1491559877b1d1
335,050,870,753,949,200,000,000,000,000,000,000,000
3
.
static int fuse_device_clone(struct fuse_conn *fc, struct file *new) { struct fuse_dev *fud; if (new->private_data) return -EINVAL; fud = fuse_dev_alloc(fc); if (!fud) return -ENOMEM; new->private_data = fud; atomic_inc(&fc->dev_count); return 0; }
0
[ "CWE-416" ]
linux
15fab63e1e57be9fdb5eec1bbc5916e9825e9acb
127,662,262,747,862,560,000,000,000,000,000,000,000
16
fs: prevent page refcount overflow in pipe_buf_get Change pipe_buf_get() to return a bool indicating whether it succeeded in raising the refcount of the page (if the thing in the pipe is a page). This removes another mechanism for overflowing the page refcount. All callers converted to handle a failure. Reported-by:...