func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
bool SplashOutputDev::getVectorAntialias() {
return splash->getVectorAntialias();
} | 0 | [
"CWE-369"
] | poppler | b224e2f5739fe61de9fa69955d016725b2a4b78d | 289,212,227,544,274,260,000,000,000,000,000,000,000 | 3 | SplashOutputDev::tilingPatternFill: Fix crash on broken file
Issue #802 |
static void cjson_replace_item_in_object_should_preserve_name(void)
{
cJSON root[1] = {{ NULL, NULL, NULL, 0, NULL, 0, 0, NULL }};
cJSON *child = NULL;
cJSON *replacement = NULL;
child = cJSON_CreateNumber(1);
TEST_ASSERT_NOT_NULL(child);
replacement = cJSON_CreateNumber(2);
TEST_ASSERT_NOT... | 0 | [
"CWE-754",
"CWE-787"
] | cJSON | be749d7efa7c9021da746e685bd6dec79f9dd99b | 146,625,020,981,544,200,000,000,000,000,000,000,000 | 19 | Fix crash of cJSON_GetObjectItemCaseSensitive when calling it on arrays |
compression::algorithm compression_algorithm()
{
return comp_algorithm_;
} | 0 | [
"CWE-416"
] | Crow | fba01dc76d6ea940ad7c8392e8f39f9647241d8e | 17,883,745,427,004,279,000,000,000,000,000,000,000 | 4 | Prevent HTTP pipelining which Crow doesn't support. |
bool AuthorizationSessionImpl::isAuthorizedForAnyActionOnResource(const ResourcePattern& resource) {
if (_externalState->shouldIgnoreAuthChecks()) {
return true;
}
std::array<ResourcePattern, resourceSearchListCapacity> resourceSearchList;
const int resourceSearchListLength =
buildResou... | 0 | [
"CWE-613"
] | mongo | e55d6e2292e5dbe2f97153251d8193d1cc89f5d7 | 49,855,779,206,424,370,000,000,000,000,000,000,000 | 19 | SERVER-38984 Validate unique User ID on UserCache hit |
static void register_http_post_files_variable_ex(char *var, zval *val, zval *http_post_files, zend_bool override_protection TSRMLS_DC) /* {{{ */
{
safe_php_register_variable_ex(var, val, http_post_files, override_protection TSRMLS_CC);
} | 0 | [
"CWE-399"
] | php-src | 4605d536d23b00813d11cc906bb48d39bdcf5f25 | 213,642,126,210,803,420,000,000,000,000,000,000,000 | 4 | Fixed bug #69364 - use smart_str to assemble strings |
static inline size_t GetPixelMetaChannels(const Image *magick_restrict image)
{
return(image->number_meta_channels);
} | 0 | [
"CWE-20",
"CWE-125"
] | ImageMagick | 8187d2d8fd010d2d6b1a3a8edd935beec404dddc | 291,232,954,138,008,000,000,000,000,000,000,000,000 | 4 | https://github.com/ImageMagick/ImageMagick/issues/1610 |
static void free_user(struct kref *ref)
{
struct ipmi_user *user = container_of(ref, struct ipmi_user, refcount);
kfree(user);
} | 1 | [
"CWE-416",
"CWE-284"
] | linux | 77f8269606bf95fcb232ee86f6da80886f1dfae8 | 193,842,034,869,084,300,000,000,000,000,000,000,000 | 5 | ipmi: fix use-after-free of user->release_barrier.rda
When we do the following test, we got oops in ipmi_msghandler driver
while((1))
do
service ipmievd restart & service ipmievd restart
done
---------------------------------------------------------------
[ 294.230186] Unable to handle kernel paging request at virt... |
DECLAREContigPutFunc(putRGBcontig16bittile)
{
int samplesperpixel = img->samplesperpixel;
uint16 *wp = (uint16 *)pp;
(void) y;
fromskew *= samplesperpixel;
while (h-- > 0) {
for (x = w; x-- > 0;) {
*cp++ = PACK(img->Bitdepth16To8[wp[0]],
img->Bitdepth16To8[wp[1]],
img->Bitdepth16To8[wp[2]]);
... | 0 | [
"CWE-119"
] | libtiff | 40a5955cbf0df62b1f9e9bd7d9657b0070725d19 | 75,989,507,225,063,285,000,000,000,000,000,000,000 | 17 | * 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 |
static HostnameValidationResult matches_subject_alternative_name(const char *hostname, const X509 *server_cert) {
HostnameValidationResult result = MatchNotFound;
int i;
int san_names_nb = -1;
STACK_OF(GENERAL_NAME) *san_names = NULL;
// Try to extract the names within the SAN extension from the certificate
san_... | 0 | [
"CWE-295"
] | openfortivpn | 6328a070ddaab16faaf008cb9a8a62439c30f2a8 | 232,180,728,765,391,900,000,000,000,000,000,000,000 | 38 | fix TLS Certificate CommonName NULL Byte Vulnerability
CVE-2020-7043 TLS Certificate CommonName NULL Byte Vulnerability is fixed
with this commit
with #8 hostname validation for the certificate was introduced
but unfortunately strncasecmp() was used to compare the byte array
against the expected hostname. This does n... |
static inline unsigned int __skb_pagelen(const struct sk_buff *skb)
{
unsigned int i, len = 0;
for (i = skb_shinfo(skb)->nr_frags - 1; (int)i >= 0; i--)
len += skb_frag_size(&skb_shinfo(skb)->frags[i]);
return len; | 0 | [
"CWE-20"
] | linux | 2b16f048729bf35e6c28a40cbfad07239f9dcd90 | 222,890,740,283,970,660,000,000,000,000,000,000,000 | 8 | net: create skb_gso_validate_mac_len()
If you take a GSO skb, and split it into packets, will the MAC
length (L2 + L3 + L4 headers + payload) of those packets be small
enough to fit within a given length?
Move skb_gso_mac_seglen() to skbuff.h with other related functions
like skb_gso_network_seglen() so we can use it... |
void drop_privs(int force_nogroups) {
gid_t gid = getgid();
if (arg_debug)
printf("Drop privileges: pid %d, uid %d, gid %d, force_nogroups %d\n",
getpid(), getuid(), gid, force_nogroups);
// configure supplementary groups
EUID_ROOT();
if (gid == 0 || force_nogroups) {
if (setgroups(0, NULL) < 0)
e... | 0 | [
"CWE-269",
"CWE-94"
] | firejail | 27cde3d7d1e4e16d4190932347c7151dc2a84c50 | 216,267,890,600,534,620,000,000,000,000,000,000,000 | 23 | fixing CVE-2022-31214 |
longlong Item_func_int_div::val_int()
{
DBUG_ASSERT(fixed == 1);
/*
Perform division using DECIMAL math if either of the operands has a
non-integer type
*/
if (args[0]->result_type() != INT_RESULT ||
args[1]->result_type() != INT_RESULT)
{
my_decimal tmp;
my_decimal *val0p= args[0]->val... | 0 | [
"CWE-120"
] | server | eca207c46293bc72dd8d0d5622153fab4d3fccf1 | 147,877,722,119,735,610,000,000,000,000,000,000,000 | 63 | 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 remove_disconnect_timer(struct avdtp *session)
{
if (!session->dc_timer)
return;
timeout_remove(session->dc_timer);
session->dc_timer = 0;
session->stream_setup = FALSE;
/* Release disconnect timer reference */
avdtp_unref(session);
} | 0 | [
"CWE-703"
] | bluez | 7a80d2096f1b7125085e21448112aa02f49f5e9a | 167,379,269,961,969,060,000,000,000,000,000,000,000 | 12 | avdtp: Fix accepting invalid/malformed capabilities
Check if capabilities are valid before attempting to copy them. |
void CLASS apply_tiff()
{
int max_samp=0, raw=-1, thm=-1, i;
struct jhead jh;
thumb_misc = 16;
if (thumb_offset) {
fseek (ifp, thumb_offset, SEEK_SET);
if (ljpeg_start (&jh, 1)) {
thumb_misc = jh.bits;
thumb_width = jh.wide;
thumb_height = jh.high;
}
}
for (i=0; i < (int) t... | 0 | [
"CWE-189"
] | rawstudio | 983bda1f0fa5fa86884381208274198a620f006e | 308,459,519,947,794,500,000,000,000,000,000,000,000 | 118 | Avoid overflow in ljpeg_start(). |
static int vdbeRecordCompareDebug(
int nKey1, const void *pKey1, /* Left key */
const UnpackedRecord *pPKey2, /* Right key */
int desiredResult /* Correct answer */
){
u32 d1; /* Offset into aKey[] of next data element */
u32 idx1; /* Offset into aKey[] of next header element *... | 0 | [
"CWE-755"
] | sqlite | 8654186b0236d556aa85528c2573ee0b6ab71be3 | 306,402,945,198,982,970,000,000,000,000,000,000,000 | 97 | When an error occurs while rewriting the parser tree for window functions
in the sqlite3WindowRewrite() routine, make sure that pParse->nErr is set,
and make sure that this shuts down any subsequent code generation that might
depend on the transformations that were implemented. This fixes a problem
discovered by the Y... |
mbc_case_fold(OnigCaseFoldType flag ARG_UNUSED,
const UChar** pp, const UChar* end ARG_UNUSED, UChar* lower)
{
const UChar* p = *pp;
if (ONIGENC_IS_MBC_ASCII(p)) {
*lower = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p);
(*pp)++;
return 1;
}
else {
int i;
int len = enclen(ONIG_ENCODING_SJIS, p... | 0 | [
"CWE-125"
] | oniguruma | 65a9b1aa03c9bc2dc01b074295b9603232cb3b78 | 143,302,188,681,513,410,000,000,000,000,000,000,000 | 21 | onig-5.9.2 |
reload_check_thread(__attribute__((unused)) thread_t * thread)
{
list old_checkers_queue;
log_message(LOG_INFO, "Reloading");
/* Use standard scheduling while reloading */
reset_process_priorities();
/* set the reloading flag */
SET_RELOAD;
log_message(LOG_INFO, "Got SIGHUP, reloading checker configuration")... | 0 | [
"CWE-200"
] | keepalived | 26c8d6374db33bcfcdcd758b1282f12ceef4b94f | 205,212,281,865,642,800,000,000,000,000,000,000,000 | 49 | Disable fopen_safe() append mode by default
If a non privileged user creates /tmp/keepalived.log and has it open
for read (e.g. tail -f), then even though keepalived will change the
owner to root and remove all read/write permissions from non owners,
the application which already has the file open will be able to read... |
unsigned short mg_url_port(const char *url) {
struct url u = urlparse(url);
unsigned short port = 0;
if (strncmp(url, "http:", 5) == 0 || strncmp(url, "ws:", 3) == 0) port = 80;
if (strncmp(url, "wss:", 4) == 0 || strncmp(url, "https:", 6) == 0)
port = 443;
if (strncmp(url, "mqtt:", 5) == 0) port = 1883;
... | 0 | [
"CWE-552"
] | mongoose | c65c8fdaaa257e0487ab0aaae9e8f6b439335945 | 167,500,941,685,098,170,000,000,000,000,000,000,000 | 11 | Protect against the directory traversal in mg_upload() |
static inline int current_is_64bit(void)
{
/*
* We can't use test_thread_flag() here because we may be on an
* interrupt stack, and the thread flags don't get copied over
* from the thread_info on the main stack to the interrupt stack.
*/
return !test_ti_thread_flag(task_thread_info(current), TIF_32BIT);
} | 0 | [
"CWE-399"
] | linux | 9a5cbce421a283e6aea3c4007f141735bf9da8c3 | 155,145,328,846,481,940,000,000,000,000,000,000,000 | 9 | powerpc/perf: Cap 64bit userspace backtraces to PERF_MAX_STACK_DEPTH
We cap 32bit userspace backtraces to PERF_MAX_STACK_DEPTH
(currently 127), but we forgot to do the same for 64bit backtraces.
Cc: stable@vger.kernel.org
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.i... |
RefreshAll(isblank)
int isblank;
{
struct canvas *cv;
ASSERT(display);
debug("Signalling full refresh!\n");
for (cv = D_cvlist; cv; cv = cv->c_next)
{
CV_CALL(cv, LayRedisplayLine(-1, -1, -1, isblank));
display = cv->c_display; /* just in case! */
}
RefreshArea(0, 0, D_width - 1, D_height... | 0 | [] | screen | c5db181b6e017cfccb8d7842ce140e59294d9f62 | 121,314,881,784,793,520,000,000,000,000,000,000,000 | 14 | ansi: add support for xterm OSC 11
It allows for getting and setting the background color. Notably, Vim uses
OSC 11 to learn whether it's running on a light or dark colored terminal
and choose a color scheme accordingly.
Tested with gnome-terminal and xterm. When called with "?" argument the
current background color ... |
static uint64_t find_max_local_usn(struct replPropertyMetaDataBlob omd)
{
uint32_t count = omd.ctr.ctr1.count;
uint64_t max = 0;
uint32_t i;
for (i=0; i < count; i++) {
struct replPropertyMetaData1 m = omd.ctr.ctr1.array[i];
if (max < m.local_usn) {
max = m.local_usn;
}
}
return max;
} | 0 | [
"CWE-200"
] | samba | 0a3aa5f908e351201dc9c4d4807b09ed9eedff77 | 271,825,180,059,693,900,000,000,000,000,000,000,000 | 13 | CVE-2022-32746 ldb: Make use of functions for appending to an ldb_message
This aims to minimise usage of the error-prone pattern of searching for
a just-added message element in order to make modifications to it (and
potentially finding the wrong element).
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15009
Signed... |
enc_start (struct b64state *state, FILE *fp, estream_t stream,
const char *title)
{
memset (state, 0, sizeof *state);
state->fp = fp;
state->stream = stream;
state->lasterr = 0;
if (title && !*title)
state->flags |= B64ENC_NO_LINEFEEDS;
else if (title)
{
if (!strncmp (title, "PGP ",... | 0 | [
"CWE-20"
] | gnupg | 2183683bd633818dd031b090b5530951de76f392 | 163,496,253,132,760,540,000,000,000,000,000,000,000 | 22 | 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 ... |
static void io_wq_assign_next(struct io_wq_work **workptr, struct io_kiocb *nxt)
{
struct io_kiocb *link;
io_prep_async_work(nxt, &link);
*workptr = &nxt->work;
if (link) {
nxt->work.flags |= IO_WQ_WORK_CB;
nxt->work.func = io_link_work_cb;
nxt->work.data = link;
}
} | 0 | [] | linux | ff002b30181d30cdfbca316dadd099c3ca0d739c | 290,605,862,530,966,530,000,000,000,000,000,000,000 | 12 | io_uring: grab ->fs as part of async preparation
This passes it in to io-wq, so it assumes the right fs_struct when
executing async work that may need to do lookups.
Cc: stable@vger.kernel.org # 5.3+
Signed-off-by: Jens Axboe <axboe@kernel.dk> |
static int set_serial_info(struct acm *acm,
struct serial_struct __user *newinfo)
{
struct serial_struct new_serial;
unsigned int closing_wait, close_delay;
int retval = 0;
if (copy_from_user(&new_serial, newinfo, sizeof(new_serial)))
return -EFAULT;
close_delay = new_serial.close_delay * 10;
closing_wait... | 0 | [
"CWE-703"
] | linux | 8835ba4a39cf53f705417b3b3a94eb067673f2c9 | 129,464,857,466,197,560,000,000,000,000,000,000,000 | 30 | USB: cdc-acm: more sanity checking
An attack has become available which pretends to be a quirky
device circumventing normal sanity checks and crashes the kernel
by an insufficient number of interfaces. This patch adds a check
to the code path for quirky devices.
Signed-off-by: Oliver Neukum <ONeukum@suse.com>
CC: sta... |
void tcp_init_transfer(struct sock *sk, int bpf_op)
{
struct inet_connection_sock *icsk = inet_csk(sk);
struct tcp_sock *tp = tcp_sk(sk);
tcp_mtup_init(sk);
icsk->icsk_af_ops->rebuild_header(sk);
tcp_init_metrics(sk);
/* Initialize the congestion window to start the transfer.
* Cut cwnd down to 1 per RFC5681 ... | 0 | [
"CWE-190"
] | net | 3b4929f65b0d8249f19a50245cd88ed1a2f78cff | 45,388,308,217,836,310,000,000,000,000,000,000,000 | 25 | 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... |
inline size_t WireFormatLite::SInt64SizePlusOne(int64_t value) {
return io::CodedOutputStream::VarintSize64PlusOne(ZigZagEncode64(value));
} | 0 | [
"CWE-703"
] | protobuf | d1635e1496f51e0d5653d856211e8821bc47adc4 | 67,810,457,442,346,520,000,000,000,000,000,000,000 | 3 | Apply patch |
static int tipc_add_tlv(struct sk_buff *skb, u16 type, void *data, u16 len)
{
struct tlv_desc *tlv = (struct tlv_desc *)skb_tail_pointer(skb);
if (tipc_skb_tailroom(skb) < TLV_SPACE(len))
return -EMSGSIZE;
skb_put(skb, TLV_SPACE(len));
tlv->tlv_type = htons(type);
tlv->tlv_len = htons(TLV_LENGTH(len));
if (le... | 0 | [
"CWE-200"
] | net | 5d2be1422e02ccd697ccfcd45c85b4a26e6178e2 | 187,742,968,901,360,430,000,000,000,000,000,000,000 | 15 | tipc: fix an infoleak in tipc_nl_compat_link_dump
link_info.str is a char array of size 60. Memory after the NULL
byte is not initialized. Sending the whole object out can cause
a leak.
Signed-off-by: Kangjie Lu <kjlu@gatech.edu>
Signed-off-by: David S. Miller <davem@davemloft.net> |
static void stub_device_reset(struct usbip_device *ud)
{
struct stub_device *sdev = container_of(ud, struct stub_device, ud);
struct usb_device *udev = sdev->udev;
int ret;
dev_dbg(&udev->dev, "device reset");
ret = usb_lock_device_for_reset(udev, NULL);
if (ret < 0) {
dev_err(&udev->dev, "lock for reset\n");... | 0 | [
"CWE-362"
] | linux | 22076557b07c12086eeb16b8ce2b0b735f7a27e7 | 84,756,036,977,478,380,000,000,000,000,000,000,000 | 31 | usbip: usbip_host: fix NULL-ptr deref and use-after-free errors
usbip_host updates device status without holding lock from stub probe,
disconnect and rebind code paths. When multiple requests to import a
device are received, these unprotected code paths step all over each
other and drive fails with NULL-ptr deref and ... |
static void read_vw(
XLCd lcd,
OMData font_set,
int num)
{
char **value, buf[BUFSIZ];
int count;
snprintf(buf, sizeof(buf), "fs%d.font.vertical_map", num);
_XlcGetResource(lcd, "XLC_FONTSET", buf, &value, &count);
if (count > 0){
_XlcDbg_printValue(buf,value,count);
... | 0 | [
"CWE-190"
] | libx11 | acdaaadcb3d85c61fd43669fc5dddf0f8c3f911d | 103,646,659,550,220,020,000,000,000,000,000,000,000 | 24 | Fix an integer overflow in init_om()
CVE-2020-14363
This can lead to a double free later, as reported by Jayden Rivers.
Signed-off-by: Matthieu Herrb <matthieu@herrb.eu> |
static int dcc_send_one_file(int queue, const char *target, const char *fname,
IRC_SERVER_REC *server, CHAT_DCC_REC *chat,
int passive)
{
struct stat st;
char *str;
char host[MAX_IP_LEN];
int hfile, port = 0;
SEND_DCC_REC *dcc;
IPADDR own_ip;
GIOChannel *handle;
if (dcc_find_request(DCC_... | 1 | [
"CWE-416"
] | irssi | 43e44d553d44e313003cee87e6ea5e24d68b84a1 | 170,161,230,237,265,500,000,000,000,000,000,000,000 | 96 | Merge branch 'security' into 'master'
Security
Closes GL#12, GL#13, GL#14, GL#15, GL#16
See merge request irssi/irssi!23 |
static void inotify_dev_event_dequeue(struct inotify_device *dev)
{
if (!list_empty(&dev->events)) {
struct inotify_kernel_event *kevent;
kevent = inotify_dev_get_event(dev);
remove_kevent(dev, kevent);
free_kevent(kevent);
}
} | 0 | [
"CWE-399"
] | linux-2.6 | 3632dee2f8b8a9720329f29eeaa4ec4669a3aff8 | 108,043,734,155,947,720,000,000,000,000,000,000,000 | 9 | inotify: clean up inotify_read and fix locking problems
If userspace supplies an invalid pointer to a read() of an inotify
instance, the inotify device's event list mutex is unlocked twice.
This causes an unbalance which effectively leaves the data structure
unprotected, and we can trigger oopses by accessing the inot... |
conn_key_reverse(struct conn_key *key)
{
struct ct_endpoint tmp;
tmp = key->src;
key->src = key->dst;
key->dst = tmp;
} | 0 | [
"CWE-400"
] | ovs | 35c280072c1c3ed58202745b7d27fbbd0736999b | 325,406,843,303,158,360,000,000,000,000,000,000,000 | 8 | 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... |
HttpTransact::LookupSkipOpenServer(State* s)
{
// cache will not be looked up. open a connection
// to a parent proxy or to the origin server.
find_server_and_update_current_info(s);
if (s->current.request_to == PARENT_PROXY) {
TRANSACT_RETURN(SM_ACTION_DNS_LOOKUP, PPDNSLookup);
}
ink_assert(s->curren... | 0 | [
"CWE-119"
] | trafficserver | 8b5f0345dade6b2822d9b52c8ad12e63011a5c12 | 155,619,913,369,592,600,000,000,000,000,000,000,000 | 21 | Fix the internal buffer sizing. Thanks to Sudheer for helping isolating this bug |
const std::string& Subgraph::GetName() const { return name_; } | 0 | [
"CWE-476"
] | tensorflow | f8378920345f4f4604202d4ab15ef64b2aceaa16 | 150,705,450,250,160,660,000,000,000,000,000,000,000 | 1 | Prevent a null pointer dereference in TFLite.
PiperOrigin-RevId: 370800353
Change-Id: Ic9c9712ce5c6e384c954dcd640a5bd9ff05c9a05 |
void TransposerBase::setAlgorithm(TransposerBase::ALGORITHM a)
{
TransposerBase::algorithm = a;
}
| 0 | [
"CWE-617"
] | soundtouch | 107f2c5d201a4dfea1b7f15c5957ff2ac9e5f260 | 143,003,529,445,479,130,000,000,000,000,000,000,000 | 4 | Replaced illegal-number-of-channel assertions with run-time exception |
TfLiteStatus ReluPrepare(TfLiteContext* context, TfLiteNode* node) {
ReluOpData* data = reinterpret_cast<ReluOpData*>(node->user_data);
TF_LITE_ENSURE_EQ(context, NumInputs(node), 1);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
const TfLiteTensor* input = GetInput(context, node, 0);
TfLiteTensor* output ... | 1 | [
"CWE-125",
"CWE-787"
] | tensorflow | 1970c2158b1ffa416d159d03c3370b9a462aee35 | 147,107,890,992,070,960,000,000,000,000,000,000,000 | 17 | [tflite]: Insert `nullptr` checks when obtaining tensors.
As part of ongoing refactoring, `tflite::GetInput`, `tflite::GetOutput`, `tflite::GetTemporary` and `tflite::GetIntermediates` will return `nullptr` in some cases. Hence, we insert the `nullptr` checks on all usages.
We also insert `nullptr` checks on usages o... |
tv_get_string_chk(typval_T *varp)
{
static char_u mybuf[NUMBUFLEN];
return tv_get_string_buf_chk(varp, mybuf);
} | 0 | [
"CWE-125",
"CWE-122"
] | vim | 1e56bda9048a9625bce6e660938c834c5c15b07d | 65,010,677,982,792,790,000,000,000,000,000,000,000 | 6 | patch 9.0.0104: going beyond allocated memory when evaluating string constant
Problem: Going beyond allocated memory when evaluating string constant.
Solution: Properly skip over <Key> form. |
void jslSeekToP(JslCharPos *seekToChar) {
if (lex->it.var) jsvLockAgain(lex->it.var); // see jslGetNextCh
jsvStringIteratorFree(&lex->it);
lex->it = jsvStringIteratorClone(&seekToChar->it);
jsvUnLock(lex->it.var); // see jslGetNextCh
lex->currCh = seekToChar->currCh;
lex->tokenStart.it.var = 0;
lex->token... | 0 | [
"CWE-787"
] | Espruino | bed844f109b6c222816740555068de2e101e8018 | 282,188,073,850,932,900,000,000,000,000,000,000,000 | 10 | remove strncpy usage as it's effectively useless, replace with an assertion since fn is only used internally (fix #1426) |
static void disconnect_complete(uint8_t status, uint16_t length,
const void *param, void *user_data)
{
const struct mgmt_rp_disconnect *rp = param;
struct btd_adapter *adapter = user_data;
if (status == MGMT_STATUS_NOT_CONNECTED) {
btd_warn(adapter->dev_id,
"Disconnecting failed: already disconnected");
... | 0 | [
"CWE-862",
"CWE-863"
] | bluez | b497b5942a8beb8f89ca1c359c54ad67ec843055 | 198,474,890,474,519,470,000,000,000,000,000,000,000 | 24 | 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 clear_ftrace_swapper(void)
{
struct task_struct *p;
int cpu;
get_online_cpus();
for_each_online_cpu(cpu) {
p = idle_task(cpu);
clear_tsk_trace_trace(p);
}
put_online_cpus();
} | 0 | [
"CWE-703"
] | linux | 6a76f8c0ab19f215af2a3442870eeb5f0e81998d | 152,999,700,127,071,690,000,000,000,000,000,000,000 | 12 | 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... |
static void do_async_commit(struct work_struct *work)
{
struct btrfs_async_commit *ac =
container_of(work, struct btrfs_async_commit, work);
/*
* We've got freeze protection passed with the transaction.
* Tell lockdep about it.
*/
if (ac->newtrans->type & __TRANS_FREEZABLE)
__sb_writers_acquired(ac->newtr... | 0 | [
"CWE-703",
"CWE-667"
] | linux | 1cb3db1cf383a3c7dbda1aa0ce748b0958759947 | 60,720,773,050,495,610,000,000,000,000,000,000,000 | 17 | btrfs: fix deadlock with concurrent chunk allocations involving system chunks
When a task attempting to allocate a new chunk verifies that there is not
currently enough free space in the system space_info and there is another
task that allocated a new system chunk but it did not finish yet the
creation of the respecti... |
static int cma_accept_ib(struct rdma_id_private *id_priv,
struct rdma_conn_param *conn_param)
{
struct ib_cm_rep_param rep;
int ret;
ret = cma_modify_qp_rtr(id_priv, conn_param);
if (ret)
goto out;
ret = cma_modify_qp_rts(id_priv, conn_param);
if (ret)
goto out;
memset(&rep, 0, sizeof rep);
rep.qp_nu... | 0 | [
"CWE-20"
] | linux | b2853fd6c2d0f383dbdf7427e263eb576a633867 | 216,866,462,305,215,320,000,000,000,000,000,000,000 | 30 | IB/core: Don't resolve passive side RoCE L2 address in CMA REQ handler
The code that resolves the passive side source MAC within the rdma_cm
connection request handler was both redundant and buggy, so remove it.
It was redundant since later, when an RC QP is modified to RTR state,
the resolution will take place in th... |
set_display_seat_id (GdmSession *self,
const char *name)
{
g_free (self->priv->display_seat_id);
self->priv->display_seat_id = g_strdup (name);
} | 0 | [] | gdm | 5ac224602f1d603aac5eaa72e1760d3e33a26f0a | 119,613,650,426,027,270,000,000,000,000,000,000,000 | 6 | session: disconnect signals from worker proxy when conversation is freed
We don't want an outstanding reference on the worker proxy to lead to
signal handlers getting dispatched after the conversation is freed.
https://bugzilla.gnome.org/show_bug.cgi?id=758032 |
int is_git_directory(const char *suspect)
{
struct strbuf path = STRBUF_INIT;
int ret = 0;
size_t len;
/* Check worktree-related signatures */
strbuf_addstr(&path, suspect);
strbuf_complete(&path, '/');
strbuf_addstr(&path, "HEAD");
if (validate_headref(path.buf))
goto done;
strbuf_reset(&path);
get_commo... | 0 | [
"CWE-22"
] | git | 3b0bf2704980b1ed6018622bdf5377ec22289688 | 23,056,306,118,853,590,000,000,000,000,000,000,000 | 39 | setup: tighten ownership checks post CVE-2022-24765
8959555cee7 (setup_git_directory(): add an owner check for the top-level
directory, 2022-03-02), adds a function to check for ownership of
repositories using a directory that is representative of it, and ways to
add exempt a specific repository from said check if nee... |
int kernel_sendmsg(struct socket *sock, struct msghdr *msg,
struct kvec *vec, size_t num, size_t size)
{
mm_segment_t oldfs = get_fs();
int result;
set_fs(KERNEL_DS);
/*
* the following is safe, since for compiler definitions of kvec and
* iovec are identical, yielding the same in-core layout and alignmen... | 0 | [] | linux-2.6 | 644595f89620ba8446cc555be336d24a34464950 | 258,729,038,230,476,930,000,000,000,000,000,000,000 | 17 | compat: Handle COMPAT_USE_64BIT_TIME in net/socket.c
Use helper functions aware of COMPAT_USE_64BIT_TIME to write struct
timeval and struct timespec to userspace in net/socket.c.
Signed-off-by: H. Peter Anvin <hpa@zytor.com> |
send_environment_variable (const char *key,
const char *value,
GdmSessionConversation *conversation)
{
gdm_dbus_worker_call_set_environment_variable (conversation->worker_proxy,
k... | 0 | [] | gdm | 05e5fc24b0f803098c1d05dae86f5eb05bd0c2a4 | 91,046,512,249,261,150,000,000,000,000,000,000,000 | 9 | session: Cancel worker proxy async ops when freeing conversations
We need to cancel ongoing async ops for worker proxies when freeing
conversations or we'll crash when the completion handler runs and we
access free'd memory.
https://bugzilla.gnome.org/show_bug.cgi?id=758032 |
HandShakeState& States::useHandShake()
{
return handshakeLayer_;
} | 0 | [
"CWE-254"
] | mysql-server | e7061f7e5a96c66cb2e0bf46bec7f6ff35801a69 | 199,718,320,755,367,980,000,000,000,000,000,000,000 | 4 | Bug #22738607: YASSL FUNCTION X509_NAME_GET_INDEX_BY_NID IS NOT WORKING AS EXPECTED. |
static int fixup_call_args(struct bpf_verifier_env *env)
{
#ifndef CONFIG_BPF_JIT_ALWAYS_ON
struct bpf_prog *prog = env->prog;
struct bpf_insn *insn = prog->insnsi;
int i, depth;
#endif
int err = 0;
if (env->prog->jit_requested &&
!bpf_prog_is_dev_bound(env->prog->aux)) {
err = jit_subprogs(env);
if (err... | 0 | [] | linux | 9b00f1b78809309163dda2d044d9e94a3c0248a3 | 268,405,499,406,863,900,000,000,000,000,000,000,000 | 38 | bpf: Fix truncation handling for mod32 dst reg wrt zero
Recently noticed that when mod32 with a known src reg of 0 is performed,
then the dst register is 32-bit truncated in verifier:
0: R1=ctx(id=0,off=0,imm=0) R10=fp0
0: (b7) r0 = 0
1: R0_w=inv0 R1=ctx(id=0,off=0,imm=0) R10=fp0
1: (b7) r1 = -1
2: R0_w=inv... |
void DRW_TableEntry::parseCode(int code, dxfReader *reader){
switch (code) {
case 5:
handle = reader->getHandleString();
break;
case 330:
parentHandle = reader->getHandleString();
break;
case 2:
name = reader->getUtf8String();
break;
case 70:
f... | 0 | [
"CWE-191"
] | libdxfrw | fcd977cc7f8f6cc7f012e5b72d33cf7d77b3fa69 | 53,643,505,674,599,120,000,000,000,000,000,000,000 | 74 | fixed heap use after free vulnerability CVE-2021-21900
as reported in TALOS-2021-1351 / CVE-2021-21900,
DRW_TableEntry::parseCode had the potential to trigger an use after free exception with a malformed DXF file. |
void b43_hf_write(struct b43_wldev *dev, u64 value)
{
u16 lo, mi, hi;
lo = (value & 0x00000000FFFFULL);
mi = (value & 0x0000FFFF0000ULL) >> 16;
hi = (value & 0xFFFF00000000ULL) >> 32;
b43_shm_write16(dev, B43_SHM_SHARED, B43_SHM_SH_HOSTF1, lo);
b43_shm_write16(dev, B43_SHM_SHARED, B43_SHM_SH_HOSTF2, mi);
b43_sh... | 0 | [
"CWE-134"
] | wireless | 9538cbaab6e8b8046039b4b2eb6c9d614dc782bd | 16,762,412,049,287,300,000,000,000,000,000,000,000 | 11 | 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... |
GF_Box *pitm_box_new()
{
ISOM_DECL_BOX_ALLOC(GF_PrimaryItemBox, GF_ISOM_BOX_TYPE_PITM);
return (GF_Box *)tmp;
} | 0 | [
"CWE-401",
"CWE-787"
] | gpac | ec64c7b8966d7e4642d12debb888be5acf18efb9 | 248,184,825,776,835,900,000,000,000,000,000,000,000 | 5 | fixed #1786 (fuzz) |
storageVolLookupByName(virStoragePoolPtr pool,
const char *name)
{
virStoragePoolObj *obj;
virStoragePoolDef *def;
virStorageVolDef *voldef;
virStorageVolPtr vol = NULL;
if (!(obj = virStoragePoolObjFromStoragePool(pool)))
return NULL;
def = virStoragePoolObjGetDe... | 0 | [] | libvirt | 447f69dec47e1b0bd15ecd7cd49a9fd3b050fb87 | 11,156,608,380,445,946,000,000,000,000,000,000,000 | 37 | storage_driver: Unlock object on ACL fail in storagePoolLookupByTargetPath
'virStoragePoolObjListSearch' returns a locked and refed object, thus we
must release it on ACL permission failure.
Fixes: 7aa0e8c0cb8
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1984318
Signed-off-by: Peter Krempa <pkrempa@redhat.co... |
static int scrub_checksum_super(struct scrub_block *sblock)
{
struct btrfs_super_block *s;
struct scrub_ctx *sctx = sblock->sctx;
u8 calculated_csum[BTRFS_CSUM_SIZE];
u8 on_disk_csum[BTRFS_CSUM_SIZE];
struct page *page;
void *mapped_buffer;
u64 mapped_size;
void *p;
u32 crc = ~(u32)0;
int fail_gen = 0;
int f... | 0 | [
"CWE-476",
"CWE-284"
] | linux | 09ba3bc9dd150457c506e4661380a6183af651c1 | 238,987,694,982,694,760,000,000,000,000,000,000,000 | 75 | 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... |
void FreeArray( _cmsDICarray* a)
{
if (a ->Name.Offsets != NULL) FreeElem(&a->Name);
if (a ->Value.Offsets != NULL) FreeElem(&a ->Value);
if (a ->DisplayName.Offsets != NULL) FreeElem(&a->DisplayName);
if (a ->DisplayValue.Offsets != NULL) FreeElem(&a ->DisplayValue);
} | 0 | [] | Little-CMS | 41d222df1bc6188131a8f46c32eab0a4d4cdf1b6 | 164,412,154,402,837,490,000,000,000,000,000,000,000 | 7 | Memory squeezing fix: lcms2 cmsPipeline construction
When creating a new pipeline, lcms would often try to allocate a stage
and pass it to cmsPipelineInsertStage without checking whether the
allocation succeeded. cmsPipelineInsertStage would then assert (or crash)
if it had not.
The fix here is to change cmsPipelineI... |
mailimf_dot_atom_text_parse(const char * message, size_t length,
size_t * indx, char ** result)
{
return mailimf_atom_parse(message, length, indx, result);
} | 0 | [
"CWE-476"
] | libetpan | 1fe8fbc032ccda1db9af66d93016b49c16c1f22d | 310,082,218,325,960,820,000,000,000,000,000,000,000 | 5 | Fixed crash #274 |
void reset_cache(binlog_cache_data* cache_data)
{
cache_data->reset();
} | 0 | [
"CWE-264"
] | mysql-server | 48bd8b16fe382be302c6f0b45931be5aa6f29a0e | 268,210,531,933,444,980,000,000,000,000,000,000,000 | 4 | Bug#24388753: PRIVILEGE ESCALATION USING MYSQLD_SAFE
[This is the 5.5/5.6 version of the bugfix].
The problem was that it was possible to write log files ending
in .ini/.cnf that later could be parsed as an options file.
This made it possible for users to specify startup options
without the permissions to do so.
Thi... |
struct dentry *kern_path_create(int dfd, const char *pathname,
struct path *path, unsigned int lookup_flags)
{
struct filename *filename = getname_kernel(pathname);
struct dentry *res;
if (IS_ERR(filename))
return ERR_CAST(filename);
res = filename_create(dfd, filename, path, lookup_flags);
putname(filename... | 0 | [
"CWE-416"
] | linux | f15133df088ecadd141ea1907f2c96df67c729f0 | 83,121,654,145,723,520,000,000,000,000,000,000,000 | 12 | path_openat(): fix double fput()
path_openat() jumps to the wrong place after do_tmpfile() - it has
already done path_cleanup() (as part of path_lookupat() called by
do_tmpfile()), so doing that again can lead to double fput().
Cc: stable@vger.kernel.org # v3.11+
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> |
PSecBuffer sspi_FindSecBuffer(PSecBufferDesc pMessage, ULONG BufferType)
{
int index;
PSecBuffer pSecBuffer = NULL;
for (index = 0; index < pMessage->cBuffers; index++)
{
if (pMessage->pBuffers[index].BufferType == BufferType)
{
pSecBuffer = &pMessage->pBuffers[index];
break;
}
}
return pSecBuffer;
... | 0 | [
"CWE-476",
"CWE-125"
] | FreeRDP | 0773bb9303d24473fe1185d85a424dfe159aff53 | 172,003,609,947,014,770,000,000,000,000,000,000,000 | 16 | nla: invalidate sec handle after creation
If sec pointer isn't invalidated after creation it is not possible
to check if the upper and lower pointers are valid.
This fixes a segfault in the server part if the client disconnects before
the authentication was finished. |
static bool ipv6_lonely_lladdr(struct inet6_ifaddr *ifp)
{
struct inet6_ifaddr *ifpiter;
struct inet6_dev *idev = ifp->idev;
list_for_each_entry_reverse(ifpiter, &idev->addr_list, if_list) {
if (ifpiter->scope > IFA_LINK)
break;
if (ifp != ifpiter && ifpiter->scope == IFA_LINK &&
(ifpiter->flags & (IFA... | 0 | [
"CWE-20"
] | linux | 77751427a1ff25b27d47a4c36b12c3c8667855ac | 301,734,247,971,482,750,000,000,000,000,000,000,000 | 16 | ipv6: addrconf: validate new MTU before applying it
Currently we don't check if the new MTU is valid or not and this allows
one to configure a smaller than minimum allowed by RFCs or even bigger
than interface own MTU, which is a problem as it may lead to packet
drops.
If you have a daemon like NetworkManager running... |
static int start_graph_tracing(void)
{
struct ftrace_ret_stack **ret_stack_list;
int ret, cpu;
ret_stack_list = kmalloc(FTRACE_RETSTACK_ALLOC_SIZE *
sizeof(struct ftrace_ret_stack *),
GFP_KERNEL);
if (!ret_stack_list)
return -ENOMEM;
/* The cpu_boot init_task->ret_stack will never be freed */
for_eac... | 0 | [
"CWE-703"
] | linux | 6a76f8c0ab19f215af2a3442870eeb5f0e81998d | 82,330,166,413,653,350,000,000,000,000,000,000,000 | 32 | 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... |
static void addECSOption(char* packet, const size_t& packetSize, uint16_t* len, const ComboAddress& remote, int stamp)
{
string EDNSRR;
struct dnsheader* dh = (struct dnsheader*) packet;
EDNSSubnetOpts eso;
if(stamp < 0)
eso.source = Netmask(remote);
else {
ComboAddress stamped(remote);
*((char*)... | 1 | [
"CWE-787"
] | pdns | f9c57c98da1b1007a51680629b667d57d9b702b8 | 222,164,442,128,917,060,000,000,000,000,000,000,000 | 28 | dnsreplay: Bail out on a too small outgoing buffer |
void set_length(int new_len) { cur_len_ = new_len; } | 0 | [] | envoy | 3b5acb2f43548862dadb243de7cf3994986a8e04 | 63,016,260,637,805,140,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... |
rrinternal_get_owner(sldns_buffer* strbuf, uint8_t* rr, size_t* len,
size_t* dname_len, uint8_t* origin, size_t origin_len, uint8_t* prev,
size_t prev_len, char* token, size_t token_len)
{
/* split the rr in its parts -1 signals trouble */
if(sldns_bget_token(strbuf, token, "\t\n ", token_len) == -1) {
return RET... | 0 | [] | unbound | 3f3cadd416d6efa92ff2d548ac090f42cd79fee9 | 108,170,381,077,397,630,000,000,000,000,000,000,000 | 58 | - Fix Out of Bounds Write in sldns_str2wire_str_buf(),
reported by X41 D-Sec. |
ModuleExport size_t RegisterHDRImage(void)
{
MagickInfo
*entry;
entry=SetMagickInfo("HDR");
entry->decoder=(DecodeImageHandler *) ReadHDRImage;
entry->encoder=(EncodeImageHandler *) WriteHDRImage;
entry->description=ConstantString("Radiance RGBE image format");
entry->module=ConstantString("HDR");
en... | 0 | [
"CWE-20",
"CWE-703",
"CWE-835"
] | ImageMagick | 97aa7d7cfd2027f6ba7ce42caf8b798541b9cdc6 | 128,895,655,705,293,640,000,000,000,000,000,000,000 | 14 | Fixed infinite loop and added checks for the sscanf result. |
int mwifiex_cmd_802_11_scan(struct host_cmd_ds_command *cmd,
struct mwifiex_scan_cmd_config *scan_cfg)
{
struct host_cmd_ds_802_11_scan *scan_cmd = &cmd->params.scan;
/* Set fixed field variables in scan command */
scan_cmd->bss_mode = scan_cfg->bss_mode;
memcpy(scan_cmd->bssid, scan_cfg->specific_bssid,
... | 0 | [
"CWE-269",
"CWE-787"
] | linux | b70261a288ea4d2f4ac7cd04be08a9f0f2de4f4d | 36,937,919,505,684,470,000,000,000,000,000,000,000 | 20 | mwifiex: Fix possible buffer overflows in mwifiex_cmd_append_vsie_tlv()
mwifiex_cmd_append_vsie_tlv() calls memcpy() without checking
the destination size may trigger a buffer overflower,
which a local user could use to cause denial of service
or the execution of arbitrary code.
Fix it by putting the length check befo... |
static ssize_t inode_readahead_blks_store(struct ext4_attr *a,
struct ext4_sb_info *sbi,
const char *buf, size_t count)
{
unsigned long t;
if (parse_strtoul(buf, 0x40000000, &t))
return -EINVAL;
if (!is_power_of_2(t))
return -EINVAL;
sbi->s_inode_readahead_blks = t;
return count;
} | 0 | [
"CWE-703"
] | linux | 744692dc059845b2a3022119871846e74d4f6e11 | 21,177,859,461,451,146,000,000,000,000,000,000,000 | 15 | ext4: use ext4_get_block_write in buffer write
Allocate uninitialized extent before ext4 buffer write and
convert the extent to initialized after io completes.
The purpose is to make sure an extent can only be marked
initialized after it has been written with new data so
we can safely drop the i_mutex lock in ext4 DIO... |
void skipLabel()
{
uint8_t len;
while((len=get8BitInt())) {
if(len >= 0xc0) { // extended label
get8BitInt();
return;
}
skipBytes(len);
}
} | 0 | [
"CWE-399"
] | pdns | adb10be102ddd4d2baf7a8adbb5673946fe5e555 | 202,542,327,765,691,900,000,000,000,000,000,000,000 | 11 | fix forward reference-check in getLabelFromContent() |
static double mp_vprod(_cimg_math_parser& mp) {
_cimg_mp_vfunc(res = vec.product());
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 160,918,223,226,949,150,000,000,000,000,000,000,000 | 3 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
PixarLogClose(TIFF* tif)
{
TIFFDirectory *td = &tif->tif_dir;
/* In a really sneaky (and really incorrect, and untruthful, and
* troublesome, and error-prone) maneuver that completely goes against
* the spirit of TIFF, and breaks TIFF, on close, we covertly
* modify both bitspersample and sampleformat in the d... | 1 | [
"CWE-125"
] | libtiff | 1044b43637fa7f70fb19b93593777b78bd20da86 | 209,864,999,212,578,100,000,000,000,000,000,000,000 | 15 | * libtiff/tif_pixarlog.c, libtiff/tif_luv.c: fix heap-based buffer
overflow on generation of PixarLog / LUV compressed files, with
ColorMap, TransferFunction attached and nasty plays with bitspersample.
The fix for LUV has not been tested, but suffers from the same kind
of issue of PixarLog.
Reported by Agostino Sarubb... |
static void __io_complete_rw(struct io_kiocb *req, long res, long res2,
unsigned int issue_flags)
{
int cflags = 0;
if ((res == -EAGAIN || res == -EOPNOTSUPP) && io_rw_reissue(req))
return;
if (res != req->result)
req_set_fail_links(req);
if (req->rw.kiocb.ki_flags & IOCB_WRITE)
kiocb_end_write(req)... | 0 | [
"CWE-667"
] | linux | 3ebba796fa251d042be42b929a2d916ee5c34a49 | 175,938,841,777,714,930,000,000,000,000,000,000 | 16 | io_uring: ensure that SQPOLL thread is started for exit
If we create it in a disabled state because IORING_SETUP_R_DISABLED is
set on ring creation, we need to ensure that we've kicked the thread if
we're exiting before it's been explicitly disabled. Otherwise we can run
into a deadlock where exit is waiting go park t... |
double Item_func_log::val_real()
{
DBUG_ASSERT(fixed == 1);
double value= args[0]->val_real();
if ((null_value= args[0]->null_value))
return 0.0;
if (value <= 0.0)
{
signal_divide_by_null();
return 0.0;
}
if (arg_count == 2)
{
double value2= args[1]->val_real();
if ((null_value= args... | 0 | [
"CWE-120"
] | server | eca207c46293bc72dd8d0d5622153fab4d3fccf1 | 220,982,638,567,187,380,000,000,000,000,000,000,000 | 25 | MDEV-25317 Assertion `scale <= precision' failed in decimal_bin_size And Assertion `scale >= 0 && precision > 0 && scale <= precision' failed in decimal_bin_size_inline/decimal_bin_size.
Precision should be kept below DECIMAL_MAX_SCALE for computations.
It can be bigger in Item_decimal. I'd fix this too but it changes... |
static int http_open(URLContext *h, const char *uri, int flags,
AVDictionary **options)
{
HTTPContext *s = h->priv_data;
int ret;
if( s->seekable == 1 )
h->is_streamed = 0;
else
h->is_streamed = 1;
s->filesize = -1;
s->location = av_strdup(uri);
if (!s-... | 1 | [
"CWE-119",
"CWE-787"
] | FFmpeg | 2a05c8f813de6f2278827734bf8102291e7484aa | 11,671,129,861,013,781,000,000,000,000,000,000,000 | 40 | http: make length/offset-related variables unsigned.
Fixes #5992, reported and found by Paul Cher <paulcher@icloud.com>. |
fetch_token_in_cc(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
{
int num;
OnigCodePoint c, c2;
const OnigSyntaxType* syn = env->syntax;
OnigEncoding enc = env->enc;
UChar* prev;
UChar* p = *src;
PFETCH_READY;
if (PEND) {
tok->type = TK_EOT;
return tok->type;
}
PFETCH(c);
tok->t... | 0 | [
"CWE-476"
] | Onigmo | 00cc7e28a3ed54b3b512ef3b58ea737a57acf1f9 | 231,889,508,465,063,870,000,000,000,000,000,000,000 | 249 | Fix SEGV in onig_error_code_to_str() (Fix #132)
When onig_new(ONIG_SYNTAX_PERL) fails with ONIGERR_INVALID_GROUP_NAME,
onig_error_code_to_str() crashes.
onig_scan_env_set_error_string() should have been used when returning
ONIGERR_INVALID_GROUP_NAME. |
static void glfs_async_cbk(glfs_fd_t *fd, ssize_t ret, void *data)
{
glfs_cbk_cookie *cookie = data;
struct tcmu_device *dev = cookie->dev;
struct tcmulib_cmd *cmd = cookie->cmd;
size_t length = cookie->length;
if (ret < 0 || ret != length) {
/* Read/write/flush failed */
switch (cookie->op) {
case TCMU_GLF... | 0 | [
"CWE-200",
"CWE-119"
] | tcmu-runner | 61bd03e600d2abf309173e9186f4d465bb1b7157 | 212,336,680,237,942,440,000,000,000,000,000,000,000 | 27 | glfs: discard glfs_check_config
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com> |
libssh2_session_handshake(LIBSSH2_SESSION *session, libssh2_socket_t sock)
{
int rc;
BLOCK_ADJUST(rc, session, session_startup(session, sock) );
return rc;
} | 0 | [
"CWE-787"
] | libssh2 | dc109a7f518757741590bb993c0c8412928ccec2 | 162,558,759,982,261,580,000,000,000,000,000,000,000 | 8 | Security fixes (#315)
* Bounds checks
Fixes for CVEs
https://www.libssh2.org/CVE-2019-3863.html
https://www.libssh2.org/CVE-2019-3856.html
* Packet length bounds check
CVE
https://www.libssh2.org/CVE-2019-3855.html
* Response length check
CVE
https://www.libssh2.org/CVE-2019-3859.html
* Bounds ch... |
int ha_myisam::index_read_idx_map(uchar *buf, uint index, const uchar *key,
key_part_map keypart_map,
enum ha_rkey_function find_flag)
{
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
ha_statistic_increment(&SSV::ha_r... | 0 | [
"CWE-362"
] | mysql-server | 4e5473862e6852b0f3802b0cd0c6fa10b5253291 | 130,872,627,773,342,330,000,000,000,000,000,000,000 | 11 | 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... |
_copyWindowAgg(const WindowAgg *from)
{
WindowAgg *newnode = makeNode(WindowAgg);
CopyPlanFields((const Plan *) from, (Plan *) newnode);
COPY_SCALAR_FIELD(winref);
COPY_SCALAR_FIELD(partNumCols);
if (from->partNumCols > 0)
{
COPY_POINTER_FIELD(partColIdx, from->partNumCols * sizeof(AttrNumber));
COPY_POINT... | 0 | [
"CWE-362"
] | postgres | 5f173040e324f6c2eebb90d86cf1b0cdb5890f0a | 309,442,450,717,703,400,000,000,000,000,000,000,000 | 25 | 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... |
flow_count_mpls_labels(const struct flow *flow, struct flow_wildcards *wc)
{
/* dl_type is always masked. */
if (eth_type_mpls(flow->dl_type)) {
int i;
int cnt;
cnt = 0;
for (i = 0; i < FLOW_MAX_MPLS_LABELS; i++) {
if (wc) {
wc->masks.mpls_lse[i] |= h... | 0 | [
"CWE-400"
] | ovs | 79349cbab0b2a755140eedb91833ad2760520a83 | 128,959,217,061,773,290,000,000,000,000,000,000,000 | 24 | 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... |
static inline int check_pmd_range(struct vm_area_struct *vma, pud_t *pud,
unsigned long addr, unsigned long end,
const nodemask_t *nodes, unsigned long flags,
void *private)
{
pmd_t *pmd;
unsigned long next;
pmd = pmd_offset(pud, addr);
do {
next = pmd_addr_end(addr, end);
split_huge_page_pmd(vma->vm_mm,... | 1 | [
"CWE-264"
] | linux-2.6 | 1a5a9906d4e8d1976b701f889d8f35d54b928f25 | 340,220,446,198,502,500,000,000,000,000,000,000,000 | 20 | mm: thp: fix pmd_bad() triggering in code paths holding mmap_sem read mode
In some cases it may happen that pmd_none_or_clear_bad() is called with
the mmap_sem hold in read mode. In those cases the huge page faults can
allocate hugepmds under pmd_none_or_clear_bad() and that can trigger a
false positive from pmd_bad(... |
ZEND_API int _zend_ts_hash_index_update_or_next_insert(TsHashTable *ht, ulong h, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC)
{
int retval;
begin_write(ht);
retval = _zend_hash_index_update_or_next_insert(TS_HASH(ht), h, pData, nDataSize, pDest, flag ZEND_FILE_LINE_RELAY_CC);
end_write(ht... | 0 | [] | php-src | 24125f0f26f3787c006e4a51611ba33ee3b841cb | 91,494,876,834,247,600,000,000,000,000,000,000,000 | 10 | Fixed bug #68676 (Explicit Double Free) |
int r_jwe_set_header_str_value(jwe_t * jwe, const char * key, const char * str_value) {
int ret;
if (jwe != NULL) {
if ((ret = _r_json_set_str_value(jwe->j_header, key, str_value)) == RHN_OK) {
o_free(jwe->header_b64url);
jwe->header_b64url = NULL;
}
return ret;
} else {
return RHN_ER... | 0 | [
"CWE-787"
] | rhonabwy | b4c2923a1ba4fabf9b55a89244127e153a3e549b | 323,717,835,563,308,880,000,000,000,000,000,000,000 | 13 | Fix buffer overflow on r_jwe_aesgcm_key_unwrap |
terminal_loop(int blocking)
{
int c;
int termwinkey = 0;
int ret;
#ifdef UNIX
int tty_fd = curbuf->b_term->tl_job->jv_channel
->ch_part[get_tty_part(curbuf->b_term)].ch_fd;
#endif
int restore_cursor = FALSE;
/* Remember the terminal we are sending keys to. However, the terminal
... | 0 | [
"CWE-476"
] | vim | cd929f7ba8cc5b6d6dcf35c8b34124e969fed6b8 | 52,876,158,991,793,020,000,000,000,000,000,000,000 | 186 | patch 8.1.0633: crash when out of memory while opening a terminal window
Problem: Crash when out of memory while opening a terminal window.
Solution: Handle out-of-memory more gracefully. |
StatusOr<ParserStatus> ConnectionImpl::onMessageComplete() {
ENVOY_CONN_LOG(trace, "message complete", connection_);
dispatchBufferedBody();
if (handling_upgrade_) {
// If this is an upgrade request, swallow the onMessageComplete. The
// upgrade payload will be treated as stream body.
ASSERT(!deferr... | 0 | [
"CWE-416"
] | envoy | fe7c69c248f4fe5a9080c7ccb35275b5218bb5ab | 206,074,524,093,142,770,000,000,000,000,000,000,000 | 21 | internal redirect: fix a lifetime bug (#785)
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Matt Klein <mklein@lyft.com>
Signed-off-by: Pradeep Rao <pcrao@google.com> |
check_end (const char *p)
{
if (!p)
return false;
while (c_isspace (*p))
++p;
if (!*p
|| (p[0] == 'G' && p[1] == 'M' && p[2] == 'T')
|| ((p[0] == '+' || p[0] == '-') && c_isdigit (p[1])))
return true;
else
return false;
} | 0 | [
"CWE-20"
] | wget | 3e25a9817f47fbb8660cc6a3b2f3eea239526c6c | 150,558,961,079,152,440,000,000,000,000,000,000,000 | 13 | Introduce --trust-server-names. Close CVE-2010-2252. |
}
//! Return a shared sublist \newinstance.
const CImgList<T> get_shared_images(const unsigned int pos0, const unsigned int pos1) const {
if (pos0>pos1 || pos1>=_width)
throw CImgArgumentException(_cimglist_instance
"get_shared_images(): Specified sub-list ... | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 338,658,353,122,788,050,000,000,000,000,000,000,000 | 10 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
static bool reset_fw_if_needed(struct mlx5_core_dev *dev)
{
bool supported = (ioread32be(&dev->iseg->initializing) >>
MLX5_FW_RESET_SUPPORTED_OFFSET) & 1;
u32 fatal_error;
if (!supported)
return false;
/* The reset only needs to be issued by one PF. The health buffer is
* shared between all functions, an... | 0 | [
"CWE-400",
"CWE-401"
] | linux | c7ed6d0183d5ea9bc31bcaeeba4070bd62546471 | 303,925,130,955,472,780,000,000,000,000,000,000,000 | 30 | net/mlx5: fix memory leak in mlx5_fw_fatal_reporter_dump
In mlx5_fw_fatal_reporter_dump if mlx5_crdump_collect fails the
allocated memory for cr_data must be released otherwise there will be
memory leak. To fix this, this commit changes the return instruction
into goto error handling.
Fixes: 9b1f29823605 ("net/mlx5: ... |
static void __perf_event_init_context(struct perf_event_context *ctx)
{
raw_spin_lock_init(&ctx->lock);
mutex_init(&ctx->mutex);
INIT_LIST_HEAD(&ctx->active_ctx_list);
perf_event_groups_init(&ctx->pinned_groups);
perf_event_groups_init(&ctx->flexible_groups);
INIT_LIST_HEAD(&ctx->event_list);
INIT_LIST_HEAD(&ctx... | 0 | [
"CWE-401"
] | tip | 7bdb157cdebbf95a1cd94ed2e01b338714075d00 | 83,037,573,429,885,560,000,000,000,000,000,000,000 | 12 | perf/core: Fix a memory leak in perf_event_parse_addr_filter()
As shown through runtime testing, the "filename" allocation is not
always freed in perf_event_parse_addr_filter().
There are three possible ways that this could happen:
- It could be allocated twice on subsequent iterations through the loop,
- or leake... |
static int eval_if(const char *hdr, struct meth_params *params,
const struct namespace_t *namespace,
struct mailbox *tgt_mailbox, const char *tgt_resource,
const char *tgt_etag, const char *tgt_lock_token,
unsigned *locked)
{
unsigned ret =... | 0 | [] | cyrus-imapd | 6703ff881b6056e0c045a7b795ce8ba1bbb87027 | 104,782,464,484,177,560,000,000,000,000,000,000,000 | 146 | http_dav.c: add 'private' Cache-Control directive for cacheable responses that require authentication |
static u_int16_t concat_hash_string(struct ndpi_packet_struct *packet,
char *buf, u_int8_t client_hash) {
u_int16_t offset = 22, buf_out_len = 0;
if(offset+sizeof(u_int32_t) >= packet->payload_packet_len)
goto invalid_payload;
u_int32_t len = ntohl(*(u_int32_t*)&packet->payload[offset]);
offset += 4;... | 1 | [
"CWE-190",
"CWE-787"
] | nDPI | 7ce478a58b4dd29a8d1e6f4e9df2f778613d9202 | 144,572,567,098,073,570,000,000,000,000,000,000,000 | 147 | ssh: fixing unsigned overflow leading to heap overflow
cf GHSL-2020-051 |
mm_request_receive(int sock, Buffer *m)
{
u_char buf[4];
u_int msg_len;
debug3("%s entering", __func__);
if (atomicio(read, sock, buf, sizeof(buf)) != sizeof(buf)) {
if (errno == EPIPE)
cleanup_exit(255);
fatal("%s: read: %s", __func__, strerror(errno));
}
msg_len = get_u32(buf);
if (msg_len > 256 * 102... | 0 | [
"CWE-20",
"CWE-200"
] | openssh-portable | d4697fe9a28dab7255c60433e4dd23cf7fce8a8b | 306,004,158,118,806,600,000,000,000,000,000,000,000 | 20 | Don't resend username to PAM; it already has it.
Pointed out by Moritz Jodeit; ok dtucker@ |
void sqlite3SelectReset(Parse *pParse, Select *p){
if( ALWAYS(p) ){
clearSelect(pParse->db, p, 0);
memset(&p->iLimit, 0, sizeof(Select) - offsetof(Select,iLimit));
p->pEList = sqlite3ExprListAppend(pParse, 0,
sqlite3ExprAlloc(pParse->db,TK_NULL,0,0));
p->pSrc = sqlite3DbMallocZero... | 0 | [
"CWE-125"
] | sqlite | 39df24a3f02495e5ef6bb5ea8ce029a2c1e377e6 | 10,019,109,963,915,055,000,000,000,000,000,000,000 | 9 | Do not allow the constant-propagation optimization to apple to ON/USING clause
terms as it does not help and it might cause downstream problems.
FossilOrigin-Name: 1bc783da63d58b05c690468b569cb2787846357b63c1100d11777666c5787bf4 |
static inline void __free_iova(struct dma_iommu_mapping *mapping,
dma_addr_t addr, size_t size)
{
unsigned int start = (addr - mapping->base) >>
(mapping->order + PAGE_SHIFT);
unsigned int count = ((size >> PAGE_SHIFT) +
(1 << mapping->order) - 1) >> mapping->order;
unsigned long flags;
... | 0 | [
"CWE-284",
"CWE-264"
] | linux | 0ea1ec713f04bdfac343c9702b21cd3a7c711826 | 179,191,562,390,075,560,000,000,000,000,000,000,000 | 13 | ARM: dma-mapping: don't allow DMA mappings to be marked executable
DMA mapping permissions were being derived from pgprot_kernel directly
without using PAGE_KERNEL. This causes them to be marked with executable
permission, which is not what we want. Fix this.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk... |
struct fpm_worker_pool_s *fpm_worker_pool_alloc() /* {{{ */
{
struct fpm_worker_pool_s *ret;
ret = malloc(sizeof(struct fpm_worker_pool_s));
if (!ret) {
return 0;
}
memset(ret, 0, sizeof(struct fpm_worker_pool_s));
ret->idle_spawn_rate = 1;
ret->log_fd = -1;
return ret;
} | 0 | [
"CWE-787"
] | php-src | fadb1f8c1d08ae62b4f0a16917040fde57a3b93b | 148,794,295,675,257,780,000,000,000,000,000,000,000 | 15 | Fix bug #81026 (PHP-FPM oob R/W in root process leading to priv escalation)
The main change is to store scoreboard procs directly to the variable sized
array rather than indirectly through the pointer.
Signed-off-by: Stanislav Malyshev <stas@php.net> |
static void sd_read_block_characteristics(struct scsi_disk *sdkp)
{
unsigned char *buffer;
u16 rot;
const int vpd_len = 64;
buffer = kmalloc(vpd_len, GFP_KERNEL);
if (!buffer ||
/* Block Device Characteristics VPD */
scsi_get_vpd_page(sdkp->device, 0xb1, buffer, vpd_len))
goto out;
rot = get_unalig... | 0 | [
"CWE-284",
"CWE-264"
] | linux | 0bfc96cb77224736dfa35c3c555d37b3646ef35e | 54,808,935,711,127,510,000,000,000,000,000,000,000 | 21 | block: fail SCSI passthrough ioctls on partition devices
Linux allows executing the SG_IO ioctl on a partition or LVM volume, and
will pass the command to the underlying block device. This is
well-known, but it is also a large security problem when (via Unix
permissions, ACLs, SELinux or a combination thereof) a prog... |
static int tcp_orphan_retries(struct sock *sk, bool alive)
{
int retries = sock_net(sk)->ipv4.sysctl_tcp_orphan_retries; /* May be zero. */
/* We know from an ICMP that something is wrong. */
if (sk->sk_err_soft && !alive)
retries = 0;
/* However, if socket sent something recently, select some safe
* number o... | 0 | [
"CWE-770"
] | net | 967c05aee439e6e5d7d805e195b3a20ef5c433d6 | 59,852,658,817,557,925,000,000,000,000,000,000,000 | 15 | tcp: enforce tcp_min_snd_mss in tcp_mtu_probing()
If mtu probing is enabled tcp_mtu_probing() could very well end up
with a too small MSS.
Use the new sysctl tcp_min_snd_mss to make sure MSS search
is performed in an acceptable range.
CVE-2019-11479 -- tcp mss hardcoded to 48
Signed-off-by: Eric Dumazet <edumazet@g... |
int snd_rawmidi_output_params(struct snd_rawmidi_substream *substream,
struct snd_rawmidi_params * params)
{
char *newbuf;
struct snd_rawmidi_runtime *runtime = substream->runtime;
if (substream->append && substream->use_count > 1)
return -EBUSY;
snd_rawmidi_drain_output(substream);
if (params->buffer... | 1 | [
"CWE-415"
] | linux | 39675f7a7c7e7702f7d5341f1e0d01db746543a0 | 253,309,626,826,670,350,000,000,000,000,000,000,000 | 28 | ALSA: rawmidi: Change resized buffers atomically
The SNDRV_RAWMIDI_IOCTL_PARAMS ioctl may resize the buffers and the
current code is racy. For example, the sequencer client may write to
buffer while it being resized.
As a simple workaround, let's switch to the resized buffer inside the
stream runtime lock.
Reported... |
int CLASS parse_jpeg(int offset)
{
int len, save, hlen, mark;
fseek(ifp, offset, SEEK_SET);
if (fgetc(ifp) != 0xff || fgetc(ifp) != 0xd8)
return 0;
while (fgetc(ifp) == 0xff && (mark = fgetc(ifp)) != 0xda)
{
order = 0x4d4d;
len = get2() - 2;
save = ftell(ifp);
if (mark == 0xc0 || mark == ... | 0 | [
"CWE-119",
"CWE-125"
] | LibRaw | f1394822a0152ceed77815eafa5cac4e8baab10a | 291,261,801,944,483,930,000,000,000,000,000,000,000 | 38 | SECUNIA advisory 76000 #1 (wrong fuji width set via tiff tag |
OidSendFunctionCall(Oid functionId, Datum val)
{
FmgrInfo flinfo;
fmgr_info(functionId, &flinfo);
return SendFunctionCall(&flinfo, val);
} | 0 | [
"CWE-264"
] | postgres | 537cbd35c893e67a63c59bc636c3e888bd228bc7 | 130,897,858,227,681,510,000,000,000,000,000,000,000 | 7 | 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 ... |
void Compute(OpKernelContext* context) override {
// boxes: [num_boxes, 4]
const Tensor& boxes = context->input(0);
// scores: [num_boxes]
const Tensor& scores = context->input(1);
// max_output_size: scalar
const Tensor& max_output_size = context->input(2);
OP_REQUIRES(
context, T... | 0 | [
"CWE-369",
"CWE-681"
] | tensorflow | b5cdbf12ffcaaffecf98f22a6be5a64bb96e4f58 | 225,071,791,795,662,740,000,000,000,000,000,000,000 | 28 | Prevent overflow due to integer conversion to unsigned.
PiperOrigin-RevId: 387738045
Change-Id: Id7e95bc07e02df1c66b72bd09f389608c87bdebe |
NextWindow()
{
register struct win **pp;
int n = fore ? fore->w_number : maxwin;
struct win *group = fore ? fore->w_group : 0;
for (pp = fore ? wtab + n + 1 : wtab; pp != wtab + n; pp++)
{
if (pp == wtab + maxwin)
pp = wtab;
if (*pp)
{
if (!fore || group == (*pp)->w_group)
break;
}
... | 0 | [] | screen | c5db181b6e017cfccb8d7842ce140e59294d9f62 | 243,229,922,694,442,700,000,000,000,000,000,000,000 | 20 | ansi: add support for xterm OSC 11
It allows for getting and setting the background color. Notably, Vim uses
OSC 11 to learn whether it's running on a light or dark colored terminal
and choose a color scheme accordingly.
Tested with gnome-terminal and xterm. When called with "?" argument the
current background color ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.