func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
xfs_file_aio_write_checks(
struct kiocb *iocb,
struct iov_iter *from,
int *iolock)
{
struct file *file = iocb->ki_filp;
struct inode *inode = file->f_mapping->host;
struct xfs_inode *ip = XFS_I(inode);
ssize_t error = 0;
size_t count = iov_iter_count(from);
restart:
error = generic_write_checks(iocb... | 0 | [
"CWE-19"
] | linux | fc0561cefc04e7803c0f6501ca4f310a502f65b8 | 246,395,396,092,096,900,000,000,000,000,000,000,000 | 91 | xfs: optimise away log forces on timestamp updates for fdatasync
xfs: timestamp updates cause excessive fdatasync log traffic
Sage Weil reported that a ceph test workload was writing to the
log on every fdatasync during an overwrite workload. Event tracing
showed that the only metadata modification being made was the... |
static int _gnutls_recv_supplemental(gnutls_session_t session)
{
gnutls_buffer_st buf;
int ret;
_gnutls_debug_log("EXT[%p]: Expecting supplemental data\n",
session);
ret =
_gnutls_recv_handshake(session, GNUTLS_HANDSHAKE_SUPPLEMENTAL,
1, &buf);
if (ret < 0) {
gnutls_assert();
return ret;
}
... | 0 | [
"CWE-310"
] | gnutls | db9a7d810f9ee4c9cc49731f5fd9bdeae68d7eaa | 18,411,500,632,668,120,000,000,000,000,000,000,000 | 27 | handshake: check for TLS_FALLBACK_SCSV
If TLS_FALLBACK_SCSV was sent by the client during the handshake, and
the advertised protocol version is lower than GNUTLS_TLS_VERSION_MAX,
send the "Inappropriate fallback" fatal alert and abort the handshake.
This mechanism was defined in RFC7507. |
static my_off_t get_record_for_key(MI_INFO *info, MI_KEYDEF *keyinfo,
uchar *key)
{
return _mi_dpos(info,0,key+_mi_keylength(keyinfo,key));
} /* get_record_for_key */ | 0 | [
"CWE-362"
] | mysql-server | 4e5473862e6852b0f3802b0cd0c6fa10b5253291 | 309,470,357,789,894,830,000,000,000,000,000,000,000 | 5 | 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... |
R_API int r_socket_read_block(RSocket *s, unsigned char *buf, int len) {
return -1;
} | 1 | [
"CWE-78"
] | radare2 | 04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9 | 160,914,280,763,868,350,000,000,000,000,000,000,000 | 3 | Fix command injection on PDB download (#16966)
* Fix r_sys_mkdirp with absolute path on Windows
* Fix build with --with-openssl
* Use RBuffer in r_socket_http_answer()
* r_socket_http_answer: Fix read for big responses
* Implement r_str_escape_sh()
* Cleanup r_socket_connect() on Windows
* Fix socket being creat... |
static void svm_load_eoi_exitmap(struct kvm_vcpu *vcpu, u64 *eoi_exit_bitmap)
{
return;
} | 0 | [] | kvm | 854e8bb1aa06c578c2c9145fa6bfe3680ef63b23 | 305,609,377,583,255,920,000,000,000,000,000,000,000 | 4 | KVM: x86: Check non-canonical addresses upon WRMSR
Upon WRMSR, the CPU should inject #GP if a non-canonical value (address) is
written to certain MSRs. The behavior is "almost" identical for AMD and Intel
(ignoring MSRs that are not implemented in either architecture since they would
anyhow #GP). However, IA32_SYSENTE... |
void vterm_state_focus_out(VTermState *state)
{
if(state->mode.report_focus)
vterm_push_output_sprintf_ctrl(state->vt, C1_CSI, "O");
} | 0 | [
"CWE-476"
] | vim | cd929f7ba8cc5b6d6dcf35c8b34124e969fed6b8 | 251,033,283,345,271,270,000,000,000,000,000,000,000 | 5 | 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. |
LOCAL void free_descriptions_metadata(MMDB_s *mmdb)
{
if (!mmdb->metadata.description.count) {
return;
}
for (size_t i = 0; i < mmdb->metadata.description.count; i++) {
if (NULL != mmdb->metadata.description.descriptions[i]) {
if (NULL !=
mmdb->metadata.descripti... | 0 | [] | libmaxminddb | 51255f113fe3c7b63ffe957636a7656a3ff9d1ff | 74,726,077,729,082,750,000,000,000,000,000,000,000 | 25 | Fix several segfaults from missing bounds checks
These were found using afl-fuzz. There are several more similar failure
that warrant investigation. If we want to add tests, I have several
corrupt databases we could add, but these are trivially reproducible
when using the existing test databases as input to afl-fuzz. |
have_handshake_fragment(SSL *s, int type, unsigned char *buf,
int len, int peek)
{
if ((type == SSL3_RT_HANDSHAKE) && (s->d1->handshake_fragment_len > 0))
/* (partially) satisfy request from storage */
{
unsigned char *src = s->d1->handshake_fragment;
unsigned char *dst = buf;
unsigned int k,n;
/* ... | 0 | [
"CWE-310"
] | openssl | 270881316664396326c461ec7a124aec2c6cc081 | 97,868,379,141,050,330,000,000,000,000,000,000,000 | 27 | Add and use a constant-time memcmp.
This change adds CRYPTO_memcmp, which compares two vectors of bytes in
an amount of time that's independent of their contents. It also changes
several MAC compares in the code to use this over the standard memcmp,
which may leak information about the size of a matching prefix.
(cher... |
static inline u32 skb_network_header_len(const struct sk_buff *skb)
{
return skb->transport_header - skb->network_header; | 0 | [
"CWE-20"
] | linux | 2b16f048729bf35e6c28a40cbfad07239f9dcd90 | 192,594,242,084,918,330,000,000,000,000,000,000,000 | 4 | 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... |
firewall_is_fascist_or(void)
{
return (reachable_or_addr_policy != NULL || firewall_is_fascist_impl());
} | 0 | [] | tor | 1afc2ed956a35b40dfd1d207652af5b50c295da7 | 19,751,694,598,966,722,000,000,000,000,000,000,000 | 4 | Fix policies.c instance of the "if (r=(a-b)) return r" pattern
I think this one probably can't underflow, since the input ranges
are small. But let's not tempt fate.
This patch also replaces the "cmp" functions here with just "eq"
functions, since nothing actually checked for anything besides 0 and
nonzero.
Related... |
TEST_P(ProxyProtocolTest, PartialRead) {
connect();
write("PROXY TCP4");
write(" 254.254.2");
dispatcher_->run(Event::Dispatcher::RunType::NonBlock);
write("54.254 1.2");
write(".3.4 65535");
write(" 1234\r\n...");
expectData("...");
EXPECT_EQ(server_connection_->remoteAddress()->ip()->addressAsS... | 0 | [
"CWE-400"
] | envoy | dfddb529e914d794ac552e906b13d71233609bf7 | 136,597,388,506,447,360,000,000,000,000,000,000,000 | 19 | listener: Add configurable accepted connection limits (#153)
Add support for per-listener limits on accepted connections.
Signed-off-by: Tony Allen <tony@allen.gg> |
static int jas_image_growcmpts(jas_image_t *image, int maxcmpts)
{
jas_image_cmpt_t **newcmpts;
int cmptno;
newcmpts = (!image->cmpts_) ? jas_malloc(maxcmpts * sizeof(jas_image_cmpt_t *)) :
jas_realloc(image->cmpts_, maxcmpts * sizeof(jas_image_cmpt_t *));
if (!newcmpts) {
return -1;
}
image->cmpts_ = newcm... | 1 | [
"CWE-189"
] | jasper | 3c55b399c36ef46befcb21e4ebc4799367f89684 | 301,459,550,013,057,560,000,000,000,000,000,000,000 | 17 | At many places in the code, jas_malloc or jas_recalloc was being
invoked with the size argument being computed in a manner that would not
allow integer overflow to be detected. Now, these places in the code
have been modified to use special-purpose memory allocation functions
(e.g., jas_alloc2, jas_alloc3, jas_realloc... |
xmlParsePITarget(xmlParserCtxtPtr ctxt) {
const xmlChar *name;
name = xmlParseName(ctxt);
if ((name != NULL) &&
((name[0] == 'x') || (name[0] == 'X')) &&
((name[1] == 'm') || (name[1] == 'M')) &&
((name[2] == 'l') || (name[2] == 'L'))) {
int i;
if ((name[0] == 'x') && (name[1] == ... | 0 | [] | libxml2 | be2a7edaf289c5da74a4f9ed3a0b6c733e775230 | 228,851,672,816,421,000,000,000,000,000,000,000,000 | 33 | Fix for CVE-2014-3660
Issues related to the billion laugh entity expansion which happened to
escape the initial set of fixes |
inline kj::ArrayPtr<const word> SegmentBuilder::currentlyAllocated() {
return kj::arrayPtr(ptr.begin(), pos - ptr.begin());
} | 0 | [
"CWE-20"
] | capnproto | 52bc956459a5e83d7c31be95763ff6399e064ae4 | 169,857,018,956,885,760,000,000,000,000,000,000,000 | 3 | SECURITY: Prevent compiler from eliding bounds checks.
Details: https://github.com/sandstorm-io/capnproto/blob/master/security-advisories/2017-04-17-0-apple-32bit-elides-bounds-check.md |
R_IPI bool r_bin_file_set_bytes(RBinFile *bf, const ut8 *bytes, ut64 sz, bool steal_ptr) {
r_return_val_if_fail (bf && bytes, false);
r_buf_free (bf->buf);
if (steal_ptr) {
bf->buf = r_buf_new_with_pointers (bytes, sz, true);
} else {
bf->buf = r_buf_new_with_bytes (bytes, sz);
}
return bf->buf;
} | 0 | [
"CWE-125"
] | radare2 | 193f4fe01d7f626e2ea937450f2e0c4604420e9d | 279,693,799,364,966,360,000,000,000,000,000,000,000 | 10 | Fix integer overflow in string search causing oobread ##crash
* Reported by @greatergoodest via huntrdev
* BountyID: 8a3dc5cb-08b3-4807-82b2-77f08c137a04
* Reproducer bfileovf |
HttpHeader::getAuthToken(Http::HdrType id, const char *auth_scheme) const
{
const char *field;
int l;
assert(auth_scheme);
field = getStr(id);
static const SBuf nil;
if (!field) /* no authorization field */
return nil;
l = strlen(auth_scheme);
if (!l || strncasecmp(fie... | 0 | [
"CWE-444"
] | squid | 9c8e2a71aa1d3c159a319d9365c346c48dc783a5 | 174,761,926,656,321,900,000,000,000,000,000,000,000 | 40 | Enforce token characters for field-name (#700)
RFC 7230 defines field-name as a token. Request splitting and cache
poisoning attacks have used non-token characters to fool broken HTTP
agents behind or in front of Squid for years. This change should
significantly reduce that abuse.
If we discover exceptional situatio... |
static void php_array_element_export(zval *zv, zend_ulong index, zend_string *key, int level, smart_str *buf) /* {{{ */
{
if (key == NULL) { /* numeric key */
buffer_append_spaces(buf, level+1);
smart_str_append_long(buf, (zend_long) index);
smart_str_appendl(buf, " => ", 4);
} else { /* string key */
zend_s... | 0 | [
"CWE-416"
] | php-src | b2af4e8868726a040234de113436c6e4f6372d17 | 26,817,587,241,972,743,000,000,000,000,000,000,000 | 26 | Complete the fix of bug #70172 for PHP 7 |
static int cifs_parse_security_flavors(char *value,
struct smb_vol *vol)
{
substring_t args[MAX_OPT_ARGS];
switch (match_token(value, cifs_secflavor_tokens, args)) {
case Opt_sec_krb5:
vol->secFlg |= CIFSSEC_MAY_KRB5 | CIFSSEC_MAY_SIGN;
break;
case Opt_sec_krb5i:
vol->secFlg |= CIFSSEC_MAY_KRB5 |... | 0 | [
"CWE-703",
"CWE-189"
] | linux | 1fc29bacedeabb278080e31bb9c1ecb49f143c3b | 31,614,847,600,291,224,000,000,000,000,000,000,000 | 52 | cifs: fix off-by-one bug in build_unc_path_to_root
commit 839db3d10a (cifs: fix up handling of prefixpath= option) changed
the code such that the vol->prepath no longer contained a leading
delimiter and then fixed up the places that accessed that field to
account for that change.
One spot in build_unc_path_to_root wa... |
struct dma_chan *dma_request_slave_channel_reason(struct device *dev,
const char *name)
{
struct dma_chan *chan;
/* If device-tree is present get slave info from here */
if (dev->of_node)
return of_dma_request_slave_channel(dev->of_node, name);
/* If device was enumerated by ACPI get slave info from her... | 0 | [] | linux | 7bced397510ab569d31de4c70b39e13355046387 | 226,897,737,667,171,070,000,000,000,000,000,000,000 | 18 | net_dma: simple removal
Per commit "77873803363c net_dma: mark broken" net_dma is no longer used
and there is no plan to fix it.
This is the mechanical removal of bits in CONFIG_NET_DMA ifdef guards.
Reverting the remainder of the net_dma induced changes is deferred to
subsequent patches.
Marked for stable due to Ro... |
static void vga_draw_cursor_line(uint8_t *d1,
const uint8_t *src1,
int poffset, int w,
unsigned int color0,
unsigned int color1,
unsigned int color_xor)
{
... | 0 | [
"CWE-119"
] | qemu | 026aeffcb4752054830ba203020ed6eb05bcaba8 | 96,505,015,735,399,100,000,000,000,000,000,000,000 | 33 | cirrus: stop passing around dst pointers in the blitter
Instead pass around the address (aka offset into vga memory). Calculate
the pointer in the rop_* functions, after applying the mask to the
address, to make sure the address stays within the valid range.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-i... |
static int kvm_ioctl_create_device(struct kvm *kvm,
struct kvm_create_device *cd)
{
struct kvm_device_ops *ops = NULL;
struct kvm_device *dev;
bool test = cd->flags & KVM_CREATE_DEVICE_TEST;
int ret;
if (cd->type >= ARRAY_SIZE(kvm_device_ops_table))
return -ENODEV;
ops = kvm_device_ops_table[cd->type];... | 0 | [
"CWE-416",
"CWE-362"
] | linux | cfa39381173d5f969daf43582c95ad679189cbc9 | 229,473,121,920,819,750,000,000,000,000,000,000,000 | 52 | kvm: fix kvm_ioctl_create_device() reference counting (CVE-2019-6974)
kvm_ioctl_create_device() does the following:
1. creates a device that holds a reference to the VM object (with a borrowed
reference, the VM's refcount has not been bumped yet)
2. initializes the device
3. transfers the reference to the device t... |
void crypt_free(struct crypt_device *cd)
{
if (!cd)
return;
log_dbg(cd, "Releasing crypt device %s context.", mdata_device_path(cd));
dm_backend_exit(cd);
crypt_free_volume_key(cd->volume_key);
crypt_free_type(cd);
device_free(cd, cd->device);
device_free(cd, cd->metadata_device);
free(CONST_CAST(void*)c... | 0 | [
"CWE-345"
] | cryptsetup | 0113ac2d889c5322659ad0596d4cfc6da53e356c | 11,686,196,912,308,928,000,000,000,000,000,000,000 | 22 | Fix CVE-2021-4122 - LUKS2 reencryption crash recovery attack
Fix possible attacks against data confidentiality through LUKS2 online
reencryption extension crash recovery.
An attacker can modify on-disk metadata to simulate decryption in
progress with crashed (unfinished) reencryption step and persistently
decrypt par... |
irc_server_gnutls_callback (void *data, gnutls_session_t tls_session,
const gnutls_datum_t *req_ca, int nreq,
const gnutls_pk_algorithm_t *pk_algos,
int pk_algos_len, gnutls_retr_st *answer)
{
struct t_irc_server *server;
gnutls... | 1 | [
"CWE-20"
] | weechat | c265cad1c95b84abfd4e8d861f25926ef13b5d91 | 126,645,762,687,895,800,000,000,000,000,000,000,000 | 247 | Fix verification of SSL certificates by calling gnutls verify callback (patch #7459) |
TEST_P(ProtocolIntegrationTest, 304HeadResponseWithoutContentLength) {
initialize();
codec_client_ = makeHttpConnection(lookupPort("http"));
auto response = codec_client_->makeHeaderOnlyRequest(
Http::TestRequestHeaderMapImpl{{":method", "HEAD"},
{":path", "/test/long/ur... | 0 | [
"CWE-416"
] | envoy | 148de954ed3585d8b4298b424aa24916d0de6136 | 46,489,633,567,095,260,000,000,000,000,000,000,000 | 18 | CVE-2021-43825
Response filter manager crash
Signed-off-by: Yan Avlasov <yavlasov@google.com> |
const String *Item_param::value_query_val_str(THD *thd, String *str) const
{
switch (value.type_handler()->cmp_type()) {
case INT_RESULT:
str->set_int(value.integer, unsigned_flag, &my_charset_bin);
return str;
case REAL_RESULT:
str->set_real(value.real, NOT_FIXED_DEC, &my_charset_bin);
return str... | 0 | [
"CWE-416"
] | server | c02ebf3510850ba78a106be9974c94c3b97d8585 | 142,766,869,338,789,130,000,000,000,000,000,000,000 | 64 | MDEV-24176 Preparations
1. moved fix_vcol_exprs() call to open_table()
mysql_alter_table() doesn't do lock_tables() so it cannot win from
fix_vcol_exprs() from there. Tests affected: main.default_session
2. Vanilla cleanups and comments. |
create_policy_2_svc(cpol_arg *arg, struct svc_req *rqstp)
{
static generic_ret ret;
char *prime_arg;
gss_buffer_desc client_name = GSS_C_EMPTY_BUFFER;
gss_buffer_desc service_name = GSS_C_EMPTY_BUFFER;
OM_uint32 ... | 0 | [
"CWE-119",
"CWE-772",
"CWE-401"
] | krb5 | 83ed75feba32e46f736fcce0d96a0445f29b96c2 | 207,373,960,515,873,550,000,000,000,000,000,000,000 | 52 | Fix leaks in kadmin server stubs [CVE-2015-8631]
In each kadmind server stub, initialize the client_name and
server_name variables, and release them in the cleanup handler. Many
of the stubs will otherwise leak the client and server name if
krb5_unparse_name() fails. Also make sure to free the prime_arg
variables in... |
void Messageheader::Parser::checkHeaderspace(unsigned chars) const
{
if (headerdataPtr + chars >= header.rawdata + sizeof(header.rawdata))
throw HttpError(HTTP_REQUEST_ENTITY_TOO_LARGE, "header too large");
} | 1 | [
"CWE-200"
] | tntnet | 9bd3b14042e12d84f39ea9f55731705ba516f525 | 9,987,327,469,318,868,000,000,000,000,000,000,000 | 5 | fix possible information leak |
static struct sk_buff *tcp_shift_skb_data(struct sock *sk, struct sk_buff *skb,
struct tcp_sacktag_state *state,
u32 start_seq, u32 end_seq,
bool dup_sack)
{
struct tcp_sock *tp = tcp_sk(sk);
struct sk_buff *prev;
int mss;
int pcount = 0;
int len;
int in_sack;
if (!sk_can_gso(sk))
goto fa... | 0 | [
"CWE-703",
"CWE-189"
] | linux | 8b8a321ff72c785ed5e8b4cf6eda20b35d427390 | 97,702,735,932,225,400,000,000,000,000,000,000,000 | 137 | tcp: fix zero cwnd in tcp_cwnd_reduction
Patch 3759824da87b ("tcp: PRR uses CRB mode by default and SS mode
conditionally") introduced a bug that cwnd may become 0 when both
inflight and sndcnt are 0 (cwnd = inflight + sndcnt). This may lead
to a div-by-zero if the connection starts another cwnd reduction
phase by set... |
xmlNop(void) {
return(0);
} | 0 | [
"CWE-134"
] | libxml2 | 4472c3a5a5b516aaf59b89be602fbce52756c3e9 | 166,692,137,910,835,600,000,000,000,000,000,000,000 | 3 | Fix some format string warnings with possible format string vulnerability
For https://bugzilla.gnome.org/show_bug.cgi?id=761029
Decorate every method in libxml2 with the appropriate
LIBXML_ATTR_FORMAT(fmt,args) macro and add some cleanups
following the reports. |
static bool register_builtin(struct st_maria_plugin *plugin,
struct st_plugin_int *tmp,
struct st_plugin_int **ptr)
{
DBUG_ENTER("register_builtin");
tmp->ref_count= 0;
tmp->plugin_dl= 0;
if (insert_dynamic(&plugin_array, (uchar*)&tmp))
DBUG_RETURN(... | 0 | [
"CWE-416"
] | server | c05fd700970ad45735caed3a6f9930d4ce19a3bd | 270,892,515,692,614,430,000,000,000,000,000,000,000 | 21 | MDEV-26323 use-after-poison issue of MariaDB server |
static MagickBooleanType sixel_encode_impl(unsigned char *pixels, size_t width,size_t height,
unsigned char *palette, size_t ncolors, int keycolor,
sixel_output_t *context)
{
#define RelinquishNodesAndMap \
while ((np = context->node_free) != NULL) { \
context->node_free ... | 0 | [
"CWE-399",
"CWE-401"
] | ImageMagick | 748a03651e5b138bcaf160d15133de2f4b1b89ce | 286,150,435,414,806,720,000,000,000,000,000,000,000 | 195 | https://github.com/ImageMagick/ImageMagick/issues/1452 |
archive_read_format_iso9660_cleanup(struct archive_read *a)
{
struct iso9660 *iso9660;
int r = ARCHIVE_OK;
iso9660 = (struct iso9660 *)(a->format->data);
release_files(iso9660);
free(iso9660->read_ce_req.reqs);
archive_string_free(&iso9660->pathname);
archive_string_free(&iso9660->previous_pathname);
if (iso96... | 0 | [
"CWE-125"
] | libarchive | f9569c086ff29259c73790db9cbf39fe8fb9d862 | 151,105,907,515,626,070,000,000,000,000,000,000,000 | 29 | iso9660: validate directory record length |
xmlRelaxNGElemPush(xmlRelaxNGValidCtxtPtr ctxt, xmlRegExecCtxtPtr exec)
{
if (ctxt->elemTab == NULL) {
ctxt->elemMax = 10;
ctxt->elemTab = (xmlRegExecCtxtPtr *) xmlMalloc(ctxt->elemMax *
sizeof
... | 0 | [
"CWE-134"
] | libxml2 | 502f6a6d08b08c04b3ddfb1cd21b2f699c1b7f5b | 174,005,405,580,436,600,000,000,000,000,000,000,000 | 27 | More format string warnings with possible format string vulnerability
For https://bugzilla.gnome.org/show_bug.cgi?id=761029
adds a new xmlEscapeFormatString() function to escape composed format
strings |
R_API int r_str_split(char *str, char ch) {
int i;
char *p;
if (!str || !*str) {
return 0;
}
/* TODO: sync with r1 code */
for (i = 1, p = str; *p; p++) {
if (*p == ch) {
i++;
*p = '\0';
} // s/ /\0/g
}
return i;
} | 0 | [
"CWE-78"
] | radare2 | 04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9 | 210,079,984,486,272,270,000,000,000,000,000,000,000 | 15 | Fix command injection on PDB download (#16966)
* Fix r_sys_mkdirp with absolute path on Windows
* Fix build with --with-openssl
* Use RBuffer in r_socket_http_answer()
* r_socket_http_answer: Fix read for big responses
* Implement r_str_escape_sh()
* Cleanup r_socket_connect() on Windows
* Fix socket being creat... |
static void usbredir_create_parser(USBRedirDevice *dev)
{
uint32_t caps[USB_REDIR_CAPS_SIZE] = { 0, };
int flags = 0;
DPRINTF("creating usbredirparser\n");
dev->parser = qemu_oom_check(usbredirparser_create());
dev->parser->priv = dev;
dev->parser->log_func = usbredir_log;
dev->parser->rea... | 0 | [
"CWE-770"
] | qemu | 7ec54f9eb62b5d177e30eb8b1cad795a5f8d8986 | 339,550,172,247,735,040,000,000,000,000,000,000,000 | 51 | usb/redir: avoid dynamic stack allocation (CVE-2021-3527)
Use autofree heap allocation instead.
Fixes: 4f4321c11ff ("usb: use iovecs in USBPacket")
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id:... |
static int exif_scan_thumbnail(image_info_type *ImageInfo)
{
uchar c, *data = (uchar*)ImageInfo->Thumbnail.data;
int n, marker;
size_t length=2, pos=0;
jpeg_sof_info sof_info;
if (!data) {
return FALSE; /* nothing to do here */
}
if (memcmp(data, "\xFF\xD8\xFF", 3)) {
if (!I... | 1 | [
"CWE-125"
] | php-src | 73ff4193be24192c894dc0502d06e2b2db35eefb | 78,470,551,766,539,350,000,000,000,000,000,000,000 | 84 | Fix bug #77988 - heap-buffer-overflow on php_jpg_get16 |
static void desc_read_cb(struct gatt_db_attribute *attrib,
unsigned int id, uint16_t offset,
uint8_t opcode, struct bt_att *att,
void *user_data)
{
struct external_desc *desc = user_data;
struct btd_device *device;
if (desc->attrib != attrib) {
error("Read callback called with incorrect attribute")... | 1 | [
"CWE-416"
] | bluez | 838c0dc7641e1c991c0f3027bf94bee4606012f8 | 128,492,495,392,324,910,000,000,000,000,000,000,000 | 27 | gatt: Fix not cleaning up when disconnected
There is a current use after free possible on a gatt server if a client
disconnects while a WriteValue call is being processed with dbus.
This patch includes the addition of a pending disconnect callback to handle
cleanup better if a disconnect occurs during a write, an acq... |
void JSObject::preventExtensions(JSObject *self) {
assert(
!self->flags_.proxyObject &&
"[[Extensible]] slot cannot be set directly on Proxy objects");
self->flags_.noExtend = true;
} | 0 | [
"CWE-843",
"CWE-125"
] | hermes | fe52854cdf6725c2eaa9e125995da76e6ceb27da | 132,694,797,704,527,590,000,000,000,000,000,000,000 | 6 | [CVE-2020-1911] Look up HostObject computed properties on the right object in the prototype chain.
Summary:
The change in the hermes repository fixes the security vulnerability
CVE-2020-1911. This vulnerability only affects applications which
allow evaluation of uncontrolled, untrusted JavaScript code not
shipped wit... |
static struct ip_esp_hdr *esp_output_set_esn(struct sk_buff *skb,
struct xfrm_state *x,
struct ip_esp_hdr *esph,
struct esp_output_extra *extra)
{
/* For ESN we move the header forward by 4 bytes to
* accomodate the high bits. We will move it back after
* encryption.
*/
if ((x->pr... | 0 | [
"CWE-787"
] | linux | ebe48d368e97d007bfeb76fcb065d6cfc4c96645 | 121,827,475,382,135,850,000,000,000,000,000,000,000 | 29 | esp: Fix possible buffer overflow in ESP transformation
The maximum message size that can be send is bigger than
the maximum site that skb_page_frag_refill can allocate.
So it is possible to write beyond the allocated buffer.
Fix this by doing a fallback to COW in that case.
v2:
Avoid get get_order() costs as sugg... |
static inline uint32_t lnc_mchash(const uint8_t *ether_addr)
{
#define LNC_POLYNOMIAL 0xEDB88320UL
uint32_t crc = 0xFFFFFFFF;
int idx, bit;
uint8_t data;
for (idx = 0; idx < 6; idx++) {
for (data = *ether_addr++, bit = 0; bit < MULTICAST_FILTER_LEN; bit++) {
crc = (crc >> 1... | 0 | [] | qemu | 837f21aacf5a714c23ddaadbbc5212f9b661e3f7 | 93,154,574,645,379,680,000,000,000,000,000,000,000 | 16 | net: pcnet: add check to validate receive data size(CVE-2015-7504)
In loopback mode, pcnet_receive routine appends CRC code to the
receive buffer. If the data size given is same as the buffer size,
the appended CRC code overwrites 4 bytes after s->buffer. Added a
check to avoid that.
Reported by: Qinghao Tang <luodal... |
static int strip_surrounding(char* str, char c1, char c2)
{
char* ptr= str;
/* Check if the first non space character is c1 */
while(*ptr && my_isspace(charset_info, *ptr))
ptr++;
if (*ptr == c1)
{
/* Replace it with a space */
*ptr= ' ';
/* Last non space charecter should be c2 */
ptr= ... | 0 | [
"CWE-284",
"CWE-295"
] | mysql-server | 3bd5589e1a5a93f9c224badf983cd65c45215390 | 165,464,348,362,028,220,000,000,000,000,000,000,000 | 29 | 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... |
client_process_dh(krb5_context context,
pkinit_plg_crypto_context plg_cryptoctx,
pkinit_req_crypto_context cryptoctx,
pkinit_identity_crypto_context id_cryptoctx,
unsigned char *subjectPublicKey_data,
unsigned int subjectPublicKey... | 0 | [
"CWE-476"
] | krb5 | f249555301940c6df3a2cdda13b56b5674eebc2e | 186,615,572,290,968,600,000,000,000,000,000,000,000 | 49 | PKINIT null pointer deref [CVE-2013-1415]
Don't dereference a null pointer when cleaning up.
The KDC plugin for PKINIT can dereference a null pointer when a
malformed packet causes processing to terminate early, leading to
a crash of the KDC process. An attacker would need to have a valid
PKINIT certificate or have ... |
static void inotify_remove_from_idr(struct fsnotify_group *group,
struct inotify_inode_mark *i_mark)
{
struct idr *idr = &group->inotify_data.idr;
spinlock_t *idr_lock = &group->inotify_data.idr_lock;
struct inotify_inode_mark *found_i_mark = NULL;
int wd;
spin_lock(idr_lock);
wd = i_mark->wd;
/*
* d... | 0 | [
"CWE-401"
] | linux-fs | 62c9d2674b31d4c8a674bee86b7edc6da2803aea | 55,986,380,488,260,780,000,000,000,000,000,000,000 | 64 | inotify: Fix fsnotify_mark refcount leak in inotify_update_existing_watch()
Commit 4d97f7d53da7dc83 ("inotify: Add flag IN_MASK_CREATE for
inotify_add_watch()") forgot to call fsnotify_put_mark() with
IN_MASK_CREATE after fsnotify_find_mark()
Fixes: 4d97f7d53da7dc83 ("inotify: Add flag IN_MASK_CREATE for inotify_add_... |
md_srv_conf_t *md_config_get(server_rec *s)
{
return config_get_int(s, NULL);
} | 0 | [
"CWE-476"
] | mod_md | e71001955809247b3aa4d269e1e0741b4fe0fc3d | 110,492,860,892,709,220,000,000,000,000,000,000,000 | 4 | v1.1.12, notifycmd improvements |
static int xen_cpu_up_prepare_hvm(unsigned int cpu)
{
int rc = 0;
/*
* This can happen if CPU was offlined earlier and
* offlining timed out in common_cpu_die().
*/
if (cpu_report_state(cpu) == CPU_DEAD_FROZEN) {
xen_smp_intr_free(cpu);
xen_uninit_lock_cpu(cpu);
}
if (cpu_acpi_id(cpu) != U32_MAX)
per... | 0 | [] | linux | fa1f57421e0b1c57843902c89728f823abc32f02 | 164,009,273,718,798,820,000,000,000,000,000,000,000 | 31 | xen/virtio: Enable restricted memory access using Xen grant mappings
In order to support virtio in Xen guests add a config option XEN_VIRTIO
enabling the user to specify whether in all Xen guests virtio should
be able to access memory via Xen grant mappings only on the host side.
Also set PLATFORM_VIRTIO_RESTRICTED_M... |
ActiveClient::ActiveClient(ConnPoolImplBase& parent, uint32_t lifetime_stream_limit,
uint32_t concurrent_stream_limit)
: parent_(parent), remaining_streams_(translateZeroToUnlimited(lifetime_stream_limit)),
configured_stream_limit_(translateZeroToUnlimited(concurrent_stream_limit)),... | 0 | [
"CWE-703",
"CWE-674"
] | envoy | 4b6dd3b53cd5c6d4d4df378a2fc62c1707522b31 | 172,375,260,079,128,420,000,000,000,000,000,000,000 | 17 | CVE-2022-23606
Avoid closing other connections to prevent deep recursion when a large number of idle connections are closed at the start of a pool drain, when a connection is closed.
Signed-off-by: Yan Avlasov <yavlasov@google.com> |
static ut32 thumb_getshift(const char *str) {
// only immediate shifts are ever used by thumb-2. Bit positions are different from ARM.
const char *shifts[] = {
"LSL", "LSR", "ASR", "ROR", 0, "RRX"
};
char *type = strdup (str);
char *arg;
char *space;
ut32 res = 0;
ut32 shift = false;
err = false;
ut32 argn;... | 0 | [
"CWE-125",
"CWE-787"
] | radare2 | e5c14c167b0dcf0a53d76bd50bacbbcc0dfc1ae7 | 330,610,806,629,580,200,000,000,000,000,000,000,000 | 60 | Fix #12417/#12418 (arm assembler heap overflows) |
static void svm_set_idt(struct kvm_vcpu *vcpu, struct desc_ptr *dt)
{
struct vcpu_svm *svm = to_svm(vcpu);
svm->vmcb->save.idtr.limit = dt->size;
svm->vmcb->save.idtr.base = dt->address ;
} | 0 | [
"CWE-400"
] | linux-2.6 | 9581d442b9058d3699b4be568b6e5eae38a41493 | 283,205,851,384,132,830,000,000,000,000,000,000,000 | 7 | KVM: Fix fs/gs reload oops with invalid ldt
kvm reloads the host's fs and gs blindly, however the underlying segment
descriptors may be invalid due to the user modifying the ldt after loading
them.
Fix by using the safe accessors (loadsegment() and load_gs_index()) instead
of home grown unsafe versions.
This is CVE-... |
irc_nick_count (struct t_irc_server *server, struct t_irc_channel *channel,
int *total, int *count_op, int *count_halfop, int *count_voice,
int *count_normal)
{
struct t_irc_nick *ptr_nick;
(*total) = 0;
(*count_op) = 0;
(*count_halfop) = 0;
(*count_voice) = 0;
(... | 0 | [
"CWE-120",
"CWE-787"
] | weechat | 40ccacb4330a64802b1f1e28ed9a6b6d3ca9197f | 339,756,113,761,571,960,000,000,000,000,000,000,000 | 31 | irc: fix crash when a new message 005 is received with longer nick prefixes
Thanks to Stuart Nevans Locke for reporting the issue. |
static inline int getPixelOverflowTC(gdImagePtr im, const int x, const int y, const int bgColor)
{
if (gdImageBoundsSafe(im, x, y)) {
const int c = im->tpixels[y][x];
if (c == im->transparent) {
return bgColor == -1 ? gdTrueColorAlpha(0, 0, 0, 127) : bgColor;
}
return c;
} else {
register int border = 0;... | 0 | [
"CWE-119"
] | php-src | 4bb422343f29f06b7081323844d9b52e1a71e4a5 | 707,508,283,598,344,700,000,000,000,000,000,000 | 48 | Fix bug #70976: fix boundary check on gdImageRotateInterpolated |
print_parent_path(FILE * hFile, TSK_FS_INFO * fs, TSK_INUM_T inum)
{
HFS_INFO *hfs = (HFS_INFO *) fs;
char fn[HFS_MAXNAMLEN + 1];
HFS_ENTRY entry;
if (inum == HFS_ROOT_INUM)
return 0;
if (inum <= HFS_ROOT_INUM) {
tsk_error_set_errno(TSK_ERR_FS_INODE_NUM);
tsk_error_set_errs... | 0 | [
"CWE-190",
"CWE-284"
] | sleuthkit | 114cd3d0aac8bd1aeaf4b33840feb0163d342d5b | 89,149,614,167,371,200,000,000,000,000,000,000,000 | 32 | hfs: fix keylen check in hfs_cat_traverse()
If key->key_len is 65535, calculating "uint16_t keylen' would
cause an overflow:
uint16_t keylen;
...
keylen = 2 + tsk_getu16(hfs->fs_info.endian, key->key_len)
so the code bypasses the sanity check "if (keylen > nodesize)"
which results in crash later:
./too... |
void ActiveStreamEncoderFilter::modifyEncodingBuffer(
std::function<void(Buffer::Instance&)> callback) {
ASSERT(parent_.state_.latest_data_encoding_filter_ == this);
callback(*parent_.buffered_response_data_.get());
} | 0 | [
"CWE-416"
] | envoy | 148de954ed3585d8b4298b424aa24916d0de6136 | 221,172,149,881,473,100,000,000,000,000,000,000,000 | 5 | CVE-2021-43825
Response filter manager crash
Signed-off-by: Yan Avlasov <yavlasov@google.com> |
GIT_INLINE(bool) verify_dotgit_ntfs_generic(const char *name, size_t len, const char *dotgit_name, size_t dotgit_len, const char *shortname_pfix)
{
int i, saw_tilde;
if (name[0] == '.' && len >= dotgit_len &&
!strncasecmp(name + 1, dotgit_name, dotgit_len)) {
return !only_spaces_and_dots(name + dotgit_len + 1... | 0 | [
"CWE-20",
"CWE-706"
] | libgit2 | 3f7851eadca36a99627ad78cbe56a40d3776ed01 | 280,401,378,247,250,570,000,000,000,000,000,000,000 | 36 | Disallow NTFS Alternate Data Stream attacks, even on Linux/macOS
A little-known feature of NTFS is that it offers to store metadata in
so-called "Alternate Data Streams" (inspired by Apple's "resource
forks") that are copied together with the file they are associated with.
These Alternate Data Streams can be accessed ... |
CImg<T>& _load_bmp(std::FILE *const file, const char *const filename) {
if (!file && !filename)
throw CImgArgumentException(_cimg_instance
"load_bmp(): Specified filename is (null).",
cimg_instance);
const ulongT fsiz = fil... | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 313,360,210,970,492,800,000,000,000,000,000,000,000 | 179 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
find_class(UnpicklerObject *self, PyObject *module_name, PyObject *global_name)
{
_Py_IDENTIFIER(find_class);
return _PyObject_CallMethodIdObjArgs((PyObject *)self, &PyId_find_class,
module_name, global_name, NULL);
} | 0 | [
"CWE-190",
"CWE-369"
] | cpython | a4ae828ee416a66d8c7bf5ee71d653c2cc6a26dd | 244,945,729,500,151,800,000,000,000,000,000,000,000 | 7 | closes bpo-34656: Avoid relying on signed overflow in _pickle memos. (GH-9261) |
static const char *parse_value( cJSON *item, const char *value )
{
if ( ! value )
return 0; /* Fail on null. */
if ( ! strncmp( value, "null", 4 ) ) {
item->type = cJSON_NULL;
return value + 4;
}
if ( ! strncmp( value, "false", 5 ) ) {
item->type = cJSON_False;
return value + 5;
}
if ( ! strncmp( value,... | 1 | [
"CWE-120",
"CWE-119",
"CWE-787"
] | iperf | 91f2fa59e8ed80dfbf400add0164ee0e508e412a | 131,639,156,457,381,020,000,000,000,000,000,000,000 | 30 | Fix a buffer overflow / heap corruption issue that could occur if a
malformed JSON string was passed on the control channel. This issue,
present in the cJSON library, was already fixed upstream, so was
addressed here in iperf3 by importing a newer version of cJSON (plus
local ESnet modifications).
Discovered and repo... |
static ssize_t nports_show(struct device *dev, struct device_attribute *attr,
char *out)
{
char *s = out;
/*
* Half the ports are for SPEED_HIGH and half for SPEED_SUPER,
* thus the * 2.
*/
out += sprintf(out, "%d\n", VHCI_PORTS * vhci_num_controllers);
return out - s;
} | 0 | [
"CWE-200"
] | linux | 2f2d0088eb93db5c649d2a5e34a3800a8a935fc5 | 165,937,098,041,551,840,000,000,000,000,000,000,000 | 12 | usbip: prevent vhci_hcd driver from leaking a socket pointer address
When a client has a USB device attached over IP, the vhci_hcd driver is
locally leaking a socket pointer address via the
/sys/devices/platform/vhci_hcd/status file (world-readable) and in debug
output when "usbip --debug port" is run.
Fix it to not... |
fw_create_instance(struct firmware *firmware, const char *fw_name,
struct device *device, u32 opt_flags)
{
struct fw_sysfs *fw_sysfs;
struct device *f_dev;
fw_sysfs = kzalloc(sizeof(*fw_sysfs), GFP_KERNEL);
if (!fw_sysfs) {
fw_sysfs = ERR_PTR(-ENOMEM);
goto exit;
}
fw_sysfs->nowait = !!(opt_flags & FW_... | 0 | [
"CWE-787"
] | linux | aa838896d87af561a33ecefea1caa4c15a68bc47 | 309,220,224,211,308,760,000,000,000,000,000,000,000 | 24 | 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... |
virtio_is_ready(struct virtio_net *dev)
{
struct vhost_virtqueue *vq;
uint32_t i;
if (dev->nr_vring == 0)
return 0;
for (i = 0; i < dev->nr_vring; i++) {
vq = dev->virtqueue[i];
if (!vq_is_ready(dev, vq))
return 0;
}
VHOST_LOG_CONFIG(INFO,
"virtio is now ready for processing.\n");
return 1;
} | 0 | [
"CWE-190"
] | dpdk | 3ae4beb079ce242240c34376a066bbccd0c0b23e | 59,176,317,074,563,490,000,000,000,000,000,000,000 | 19 | vhost: check log mmap offset and size overflow
vhost_user_set_log_base() is a message handler that is
called to handle the VHOST_USER_SET_LOG_BASE message.
Its payload contains a 64 bit size and offset. Both are
added up and used as a size when calling mmap().
There is no integer overflow check. If an integer overflo... |
static __le32 *handle_ar_packet(struct ar_context *ctx, __le32 *buffer)
{
struct fw_ohci *ohci = ctx->ohci;
struct fw_packet p;
u32 status, length, tcode;
int evt;
p.header[0] = cond_le32_to_cpu(buffer[0]);
p.header[1] = cond_le32_to_cpu(buffer[1]);
p.header[2] = cond_le32_to_cpu(buffer[2]);
tcode = (p.header... | 0 | [
"CWE-399"
] | linux-2.6 | 8c0c0cc2d9f4c523fde04bdfe41e4380dec8ee54 | 260,328,008,614,076,400,000,000,000,000,000,000,000 | 86 | firewire: ohci: handle receive packets with a data length of zero
Queueing to receive an ISO packet with a payload length of zero
silently does nothing in dualbuffer mode, and crashes the kernel in
packet-per-buffer mode. Return an error in dualbuffer mode, because
the DMA controller won't let us do what we want, and... |
const ExpiringCryptoKey& current() const {
map<uint64_t, ExpiringCryptoKey>::const_iterator p = secrets.begin();
++p;
return p->second;
} | 0 | [
"CWE-287",
"CWE-284"
] | ceph | 5ead97120e07054d80623dada90a5cc764c28468 | 46,932,078,652,159,670,000,000,000,000,000,000,000 | 5 | auth/cephx: add authorizer challenge
Allow the accepting side of a connection to reject an initial authorizer
with a random challenge. The connecting side then has to respond with an
updated authorizer proving they are able to decrypt the service's challenge
and that the new authorizer was produced for this specific ... |
MetricSnapshotImpl::MetricSnapshotImpl(Stats::Store& store) {
snapped_counters_ = store.counters();
counters_.reserve(snapped_counters_.size());
for (const auto& counter : snapped_counters_) {
counters_.push_back({counter->latch(), *counter});
}
snapped_gauges_ = store.gauges();
gauges_.reserve(snapped... | 0 | [
"CWE-400"
] | envoy | 542f84c66e9f6479bc31c6f53157c60472b25240 | 197,182,256,927,307,440,000,000,000,000,000,000,000 | 26 | overload: Runtime configurable global connection limits (#147)
Signed-off-by: Tony Allen <tony@allen.gg> |
packet_irq_handler(struct pcilynx *lynx)
{
struct client *client;
u32 tcode_mask, tcode, timestamp;
size_t length;
struct timespec64 ts64;
/* FIXME: Also report rcv_speed. */
length = __le32_to_cpu(lynx->rcv_pcl->pcl_status) & 0x00001fff;
tcode = __le32_to_cpu(lynx->rcv_buffer[1]) >> 4 & 0xf;
ktime_get_real... | 0 | [
"CWE-416"
] | linux | 829933ef05a951c8ff140e814656d73e74915faf | 318,198,583,542,687,700,000,000,000,000,000,000,000 | 30 | firewire: nosy: Fix a use-after-free bug in nosy_ioctl()
For each device, the nosy driver allocates a pcilynx structure.
A use-after-free might happen in the following scenario:
1. Open nosy device for the first time and call ioctl with command
NOSY_IOC_START, then a new client A will be malloced and added to
... |
static void parse_version(pj_scanner *scanner,
volatile parse_context *ctx)
{
ctx->last_error = PJMEDIA_SDP_EINVER;
/* check equal sign */
if (*(scanner->curptr+1) != '=') {
on_scanner_error(scanner);
return;
}
/* check version is 0 */
if (*(scanner->curptr+2) != '... | 0 | [
"CWE-121",
"CWE-120",
"CWE-787"
] | pjproject | 560a1346f87aabe126509bb24930106dea292b00 | 272,944,809,490,864,630,000,000,000,000,000,000,000 | 20 | Merge pull request from GHSA-f5qg-pqcg-765m |
xmlValidateNotationCallback(void *payload, void *data,
const xmlChar *name ATTRIBUTE_UNUSED) {
xmlEntityPtr cur = (xmlEntityPtr) payload;
xmlValidCtxtPtr ctxt = (xmlValidCtxtPtr) data;
if (cur == NULL)
return;
if (cur->etype == XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
xmlChar *nota... | 0 | [
"CWE-416"
] | libxml2 | 652dd12a858989b14eed4e84e453059cd3ba340e | 19,745,623,829,204,036,000,000,000,000,000,000,000 | 19 | [CVE-2022-23308] Use-after-free of ID and IDREF attributes
If a document is parsed with XML_PARSE_DTDVALID and without
XML_PARSE_NOENT, the value of ID attributes has to be normalized after
potentially expanding entities in xmlRemoveID. Otherwise, later calls
to xmlGetID can return a pointer to previously freed memory... |
ast_for_stmt(struct compiling *c, const node *n)
{
if (TYPE(n) == stmt) {
assert(NCH(n) == 1);
n = CHILD(n, 0);
}
if (TYPE(n) == simple_stmt) {
assert(num_stmts(n) == 1);
n = CHILD(n, 0);
}
if (TYPE(n) == small_stmt) {
n = CHILD(n, 0);
/* small_stmt: e... | 0 | [
"CWE-125"
] | cpython | a4d78362397fc3bced6ea80fbc7b5f4827aec55e | 190,090,707,056,170,830,000,000,000,000,000,000,000 | 73 | bpo-36495: Fix two out-of-bounds array reads (GH-12641)
Research and fix by @bradlarsen. |
bucket_insert (index_bucket *bucket,
CK_OBJECT_HANDLE handle)
{
unsigned int alloc;
int at = 0;
if (bucket->elem) {
at = binary_search (bucket->elem, 0, bucket->num, handle);
if (at < bucket->num && bucket->elem[at] == handle)
return;
}
alloc = alloc_size (bucket->num);
if (bucket->num + 1... | 1 | [
"CWE-190"
] | p11-kit | 5307a1d21a50cacd06f471a873a018d23ba4b963 | 215,437,475,606,015,750,000,000,000,000,000,000,000 | 29 | Check for arithmetic overflows before allocating |
SPL_METHOD(Array, getIterator)
{
zval *object = getThis();
spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
spl_array_object *iterator;
HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
if (zend_parse_parameters_none() == FAILURE) {
return;
}
if (!a... | 1 | [] | php-src | b7fa67742cd8d2b0ca0c0273b157f6ffee9ad6e2 | 153,260,200,866,464,030,000,000,000,000,000,000,000 | 21 | Fix bug #70068 (Dangling pointer in the unserialization of ArrayObject items) |
static void linear_dtr(struct dm_target *ti)
{
struct linear_c *lc = (struct linear_c *) ti->private;
dm_put_device(ti, lc->dev);
kfree(lc);
} | 0 | [
"CWE-284",
"CWE-264"
] | linux | ec8013beddd717d1740cfefb1a9b900deef85462 | 117,440,456,044,878,270,000,000,000,000,000,000,000 | 7 | dm: do not forward ioctls from logical volumes to the underlying device
A logical volume can map to just part of underlying physical volume.
In this case, it must be treated like a partition.
Based on a patch from Alasdair G Kergon.
Cc: Alasdair G Kergon <agk@redhat.com>
Cc: dm-devel@redhat.com
Signed-off-by: Paolo ... |
BSONObj spec() {
return BSON("$and" << BSON_ARRAY(0 << 1));
} | 0 | [
"CWE-835"
] | mongo | 0a076417d1d7fba3632b73349a1fd29a83e68816 | 167,892,951,677,038,160,000,000,000,000,000,000,000 | 3 | SERVER-38070 fix infinite loop in agg expression |
int security_read_policy(void **data, size_t *len)
{
int rc;
struct policy_file fp;
if (!ss_initialized)
return -EINVAL;
*len = security_policydb_len();
*data = vmalloc_user(*len);
if (!*data)
return -ENOMEM;
fp.data = *data;
fp.len = *len;
read_lock(&policy_rwlock);
rc = policydb_write(&policydb, &f... | 0 | [
"CWE-20"
] | linux | 2172fa709ab32ca60e86179dc67d0857be8e2c98 | 325,269,153,255,310,650,000,000,000,000,000,000,000 | 28 | SELinux: Fix kernel BUG on empty security contexts.
Setting an empty security context (length=0) on a file will
lead to incorrectly dereferencing the type and other fields
of the security context structure, yielding a kernel BUG.
As a zero-length security context is never valid, just reject
all such security contexts... |
void LanLinkProvider::udpBroadcastReceived()
{
while (m_udpSocket.hasPendingDatagrams()) {
QByteArray datagram;
datagram.resize(m_udpSocket.pendingDatagramSize());
QHostAddress sender;
m_udpSocket.readDatagram(datagram.data(), datagram.size(), &sender);
if (sender.isLoopba... | 0 | [
"CWE-400",
"CWE-703"
] | kdeconnect-kde | 4fbd01a3d44a0bcca888c49a77ec7cfd10e113d7 | 162,436,875,735,513,610,000,000,000,000,000,000,000 | 55 | Limit identity packets to 8KiB
Healthy identity packages shouldn't be that big and we don't want to
allow systems around us to send us ever humongous packages that will
just leave us without any memory.
Thanks Matthias Gerstner <mgerstner@suse.de> for reporting this. |
inline static bool jas_safe_size_sub(size_t x, size_t y, size_t *result)
{
if (y > x) {
return false;
}
*result = x - y;
return true;
} | 0 | [
"CWE-119"
] | jasper | 65536647d380571d1a9a6c91fa03775fb5bbd256 | 234,957,660,669,054,030,000,000,000,000,000,000,000 | 8 | A new experimental memory allocator has been introduced. The allocator
is experimental in the sense that its API is not considered stable and
the allocator may change or disappear entirely in future versions of
the code. This new allocator tracks how much memory is being used by
jas_malloc and friends. A maximum upp... |
int sc_file_set_content(sc_file_t *file, const u8 *content,
size_t content_len)
{
u8 *tmp;
if (!sc_file_valid(file)) {
return SC_ERROR_INVALID_ARGUMENTS;
}
if (content == NULL) {
if (file->encoded_content != NULL)
free(file->encoded_content);
file->encoded_content = NULL;
file->encoded_content_len =... | 0 | [
"CWE-415",
"CWE-119"
] | OpenSC | 360e95d45ac4123255a4c796db96337f332160ad | 288,491,418,419,835,050,000,000,000,000,000,000,000 | 31 | fixed out of bounds writes
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting the problems. |
vnc_display_setup_auth(int *auth,
int *subauth,
QCryptoTLSCreds *tlscreds,
bool password,
bool sasl,
bool websocket,
Error **errp)
{
/*
* We have a choice of 3 authenticatio... | 0 | [
"CWE-401"
] | qemu | 6bf21f3d83e95bcc4ba35a7a07cc6655e8b010b0 | 225,397,042,767,503,800,000,000,000,000,000,000,000 | 109 | vnc: fix memory leak when vnc disconnect
Currently when qemu receives a vnc connect, it creates a 'VncState' to
represent this connection. In 'vnc_worker_thread_loop' it creates a
local 'VncState'. The connection 'VcnState' and local 'VncState' exchange
data in 'vnc_async_encoding_start' and 'vnc_async_encoding_end'.
... |
static int http_getc(HTTPContext *s)
{
int len;
if (s->buf_ptr >= s->buf_end) {
len = ffurl_read(s->hd, s->buffer, BUFFER_SIZE);
if (len < 0) {
return len;
} else if (len == 0) {
return AVERROR_EOF;
} else {
s->buf_ptr = s->buffer;
... | 0 | [
"CWE-119",
"CWE-787"
] | FFmpeg | 2a05c8f813de6f2278827734bf8102291e7484aa | 90,459,675,662,997,960,000,000,000,000,000,000,000 | 16 | http: make length/offset-related variables unsigned.
Fixes #5992, reported and found by Paul Cher <paulcher@icloud.com>. |
static inline u16 q922_to_dlci(u8 *hdr)
{
return ((hdr[0] & 0xFC) << 2) | ((hdr[1] & 0xF0) >> 4);
} | 0 | [
"CWE-703",
"CWE-264"
] | linux | 550fd08c2cebad61c548def135f67aba284c6162 | 314,139,232,858,976,230,000,000,000,000,000,000,000 | 4 | net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared
After the last patch, We are left in a state in which only drivers calling
ether_setup have IFF_TX_SKB_SHARING set (we assume that drivers touching real
hardware call ether_setup for their net_devices and don't hold any state in
their skbs. There... |
static long fuse_file_fallocate(struct file *file, int mode, loff_t offset,
loff_t length)
{
struct fuse_file *ff = file->private_data;
struct inode *inode = file_inode(file);
struct fuse_inode *fi = get_fuse_inode(inode);
struct fuse_mount *fm = ff->fm;
FUSE_ARGS(args);
struct fuse_fallocate_in inarg = {
.... | 0 | [
"CWE-459"
] | linux | 5d069dbe8aaf2a197142558b6fb2978189ba3454 | 216,591,883,095,832,140,000,000,000,000,000,000,000 | 92 | fuse: fix bad inode
Jan Kara's analysis of the syzbot report (edited):
The reproducer opens a directory on FUSE filesystem, it then attaches
dnotify mark to the open directory. After that a fuse_do_getattr() call
finds that attributes returned by the server are inconsistent, and calls
make_bad_inode() which,... |
void __exit sco_exit(void)
{
bt_procfs_cleanup(&init_net, "sco");
debugfs_remove(sco_debugfs);
if (bt_sock_unregister(BTPROTO_SCO) < 0)
BT_ERR("SCO socket unregistration failed");
proto_unregister(&sco_proto);
} | 0 | [
"CWE-200"
] | linux | c8c499175f7d295ef867335bceb9a76a2c3cdc38 | 221,711,325,284,484,320,000,000,000,000,000,000,000 | 11 | Bluetooth: SCO - Fix missing msg_namelen update in sco_sock_recvmsg()
If the socket is in state BT_CONNECT2 and BT_SK_DEFER_SETUP is set in
the flags, sco_sock_recvmsg() returns early with 0 without updating the
possibly set msg_namelen member. This, in turn, leads to a 128 byte
kernel stack leak in net/socket.c.
Fix... |
int nghttp2_check_authority(const uint8_t *value, size_t len) {
const uint8_t *last;
for (last = value + len; value != last; ++value) {
if (!VALID_AUTHORITY_CHARS[*value]) {
return 0;
}
}
return 1;
} | 0 | [
"CWE-707"
] | nghttp2 | 336a98feb0d56b9ac54e12736b18785c27f75090 | 203,895,725,305,511,620,000,000,000,000,000,000,000 | 9 | Implement max settings option |
static void init_sasl_conn(conn *c) {
assert(c);
/* should something else be returned? */
if (!settings.sasl)
return;
c->authenticated = false;
if (!c->sasl_conn) {
int result=sasl_server_new("memcached",
NULL,
m... | 0 | [
"CWE-287"
] | memcached | 87c1cf0f20be20608d3becf854e9cf0910f4ad32 | 25,686,446,024,286,030,000,000,000,000,000,000,000 | 22 | explicitly record sasl auth states
It was previously possible to bypass authentication due to implicit
state management. Now we explicitly consider ourselves
unauthenticated on any new connections and authentication attempts.
bug316
Signed-off-by: Dustin Sallings <dustin@spy.net> |
static void test_insert()
{
MYSQL_STMT *stmt;
int rc;
char str_data[50];
char tiny_data;
MYSQL_RES *result;
MYSQL_BIND my_bind[2];
ulong length;
myheader("test_insert");
rc= mysql_autocommit(mysql, TRUE);
myquery(rc);
rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_pr... | 0 | [
"CWE-416"
] | server | eef21014898d61e77890359d6546d4985d829ef6 | 117,380,691,579,500,720,000,000,000,000,000,000,000 | 75 | MDEV-11933 Wrong usage of linked list in mysql_prune_stmt_list
mysql_prune_stmt_list() was walking the list following
element->next pointers, but inside the loop it was invoking
list_add(element) that modified element->next. So, mysql_prune_stmt_list()
failed to visit and reset all elements, and some of them were left... |
char *widen_string(char *buf, int n, char *end, struct printf_spec spec)
{
unsigned spaces;
if (likely(n >= spec.field_width))
return buf;
/* we want to pad the sucker */
spaces = spec.field_width - n;
if (!(spec.flags & LEFT)) {
move_right(buf - n, end, n, spaces);
return buf + spaces;
}
while (spaces--)... | 0 | [
"CWE-200"
] | linux | ad67b74d2469d9b82aaa572d76474c95bc484d57 | 188,113,804,366,131,760,000,000,000,000,000,000,000 | 19 | printk: hash addresses printed with %p
Currently there exist approximately 14 000 places in the kernel where
addresses are being printed using an unadorned %p. This potentially
leaks sensitive information regarding the Kernel layout in memory. Many
of these calls are stale, instead of fixing every call lets hash the
a... |
LUALIB_API int luaL_argerror(lua_State *L, int narg, const char *msg)
{
err_argmsg(L, narg, msg);
return 0; /* unreachable */
} | 0 | [
"CWE-125"
] | LuaJIT | 53f82e6e2e858a0a62fd1a2ff47e9866693382e6 | 143,622,776,896,789,860,000,000,000,000,000,000,000 | 5 | Fix frame traversal for __gc handler frames.
Reported by Changochen. |
void ass_blur1234_horz_c(int16_t *dst, const int16_t *src,
uintptr_t src_width, uintptr_t src_height,
const int16_t *param)
{
uintptr_t dst_width = src_width + 8;
uintptr_t size = ((src_width + STRIPE_MASK) & ~STRIPE_MASK) * src_height;
uintptr_t step = STRI... | 0 | [
"CWE-119",
"CWE-787"
] | libass | 08e754612019ed84d1db0d1fc4f5798248decd75 | 193,453,035,834,413,370,000,000,000,000,000,000 | 23 | Fix blur coefficient calculation buffer overflow
Found by fuzzer test case id:000082,sig:11,src:002579,op:havoc,rep:8.
Correctness should be checked, but this fixes the overflow for good. |
nghttp2_stream *nghttp2_session_open_stream(nghttp2_session *session,
int32_t stream_id, uint8_t flags,
nghttp2_priority_spec *pri_spec_in,
nghttp2_stream_state initial_state,
... | 0 | [] | nghttp2 | 0a6ce87c22c69438ecbffe52a2859c3a32f1620f | 234,824,160,611,785,800,000,000,000,000,000,000,000 | 135 | Add nghttp2_option_set_max_outbound_ack |
static int ip_error(struct sk_buff *skb)
{
struct rtable *rt = skb_rtable(skb);
struct net_device *dev = skb->dev;
struct in_device *in_dev;
struct inet_peer *peer;
unsigned long now;
struct net *net;
bool send;
int code;
if (netif_is_l3_master(skb->dev)) {
dev = __dev_get_by_index(dev_net(skb->dev), IPCB(s... | 0 | [
"CWE-327"
] | linux | aa6dd211e4b1dde9d5dc25d699d35f789ae7eeba | 287,596,373,334,195,080,000,000,000,000,000,000,000 | 75 | inet: use bigger hash table for IP ID generation
In commit 73f156a6e8c1 ("inetpeer: get rid of ip_id_count")
I used a very small hash table that could be abused
by patient attackers to reveal sensitive information.
Switch to a dynamic sizing, depending on RAM size.
Typical big hosts will now use 128x more storage (2... |
bool maybe_null_in_table() const
{ return null_ptr >= table->record[0] && null_ptr <= ptr; } | 0 | [
"CWE-416",
"CWE-703"
] | server | 08c7ab404f69d9c4ca6ca7a9cf7eec74c804f917 | 51,749,498,386,994,850,000,000,000,000,000,000,000 | 2 | MDEV-24176 Server crashes after insert in the table with virtual
column generated using date_format() and if()
vcol_info->expr is allocated on expr_arena at parsing stage. Since
expr item is allocated on expr_arena all its containee items must be
allocated on expr_arena too. Otherwise fix_session_expr() will
encounter... |
AuthorizationManager::AuthorizationManager(AuthExternalState* externalState) {
_externalState.reset(externalState);
} | 0 | [
"CWE-264"
] | mongo | 23344f8b7506df694f66999693ee3c00dfd6afae | 106,112,437,203,206,930,000,000,000,000,000,000,000 | 3 | SERVER-9983 Do not needlessly lock when looking up privileges for the __system@local user.
Uncorrected, this can cause replica set heartbeats to stall behind operations
that hold the read lock for a long time. |
xmlSchemaResolveAttrUseReferences(xmlSchemaAttributeUsePtr ause,
xmlSchemaParserCtxtPtr ctxt)
{
if ((ctxt == NULL) || (ause == NULL))
return(-1);
if ((ause->attrDecl == NULL) ||
(ause->attrDecl->type != XML_SCHEMA_EXTRA_QNAMEREF))
return(0);
{
xmlSchemaQNameRefPtr ref = WXS_QNAME_CAST ause->attrD... | 0 | [
"CWE-134"
] | libxml2 | 4472c3a5a5b516aaf59b89be602fbce52756c3e9 | 192,202,657,748,744,800,000,000,000,000,000,000,000 | 29 | Fix some format string warnings with possible format string vulnerability
For https://bugzilla.gnome.org/show_bug.cgi?id=761029
Decorate every method in libxml2 with the appropriate
LIBXML_ATTR_FORMAT(fmt,args) macro and add some cleanups
following the reports. |
static struct l2cap_chan *__l2cap_get_chan_by_scid(struct l2cap_conn *conn,
u16 cid)
{
struct l2cap_chan *c;
list_for_each_entry(c, &conn->chan_l, list) {
if (c->scid == cid)
return c;
}
return NULL;
} | 0 | [
"CWE-787"
] | linux | e860d2c904d1a9f38a24eb44c9f34b8f915a6ea3 | 258,502,885,198,338,600,000,000,000,000,000,000,000 | 11 | Bluetooth: Properly check L2CAP config option output buffer length
Validate the output buffer length for L2CAP config requests and responses
to avoid overflowing the stack buffer used for building the option blocks.
Cc: stable@vger.kernel.org
Signed-off-by: Ben Seri <ben@armis.com>
Signed-off-by: Marcel Holtmann <mar... |
static int test_iffile_section(cmd_parms *cmd, const char *arg)
{
const char *relative;
apr_finfo_t sb;
/*
* At least on Windows, if the path we are testing is not valid (for example
* a path on a USB key that is not plugged), 'ap_server_root_relative()' will
* return NULL. In such a case, c... | 0 | [] | httpd | ecebcc035ccd8d0e2984fe41420d9e944f456b3c | 320,432,378,281,132,900,000,000,000,000,000,000,000 | 15 | Merged r1734009,r1734231,r1734281,r1838055,r1838079,r1840229,r1876664,r1876674,r1876784,r1879078,r1881620,r1887311,r1888871 from trunk:
*) core: Split ap_create_request() from ap_read_request(). [Graham Leggett]
*) core, h2: common ap_parse_request_line() and ap_check_request_header()
code. [Yann Ylavic]
... |
static RzDyldRebaseInfo *get_rebase_info(RzDyldCache *cache, ut64 slideInfoOffset, ut64 slideInfoSize, ut64 start_of_data, ut64 slide) {
ut8 *tmp_buf_1 = NULL;
ut8 *tmp_buf_2 = NULL;
ut8 *one_page_buf = NULL;
RzBuffer *cache_buf = cache->buf;
ut64 offset = slideInfoOffset;
ut32 slide_info_version = 0;
if (rz_bu... | 0 | [
"CWE-787"
] | rizin | 556ca2f9eef01ec0f4a76d1fbacfcf3a87a44810 | 82,202,069,496,025,470,000,000,000,000,000,000,000 | 226 | Fix oob write in dyldcache
When the individual n_slide_infos were too high, the sum would overflow
and too few entries would be allocated. |
static int hufEncode // return: output size (in bits)
(const long long *hcode, // i : encoding table
const unsigned short *in, // i : uncompressed input buffer
const int ni, // i : input buffer size (in bytes)
int rlc, // i : rl code
char *out) ... | 0 | [
"CWE-20",
"CWE-190"
] | tinyexr | a685e3332f61cd4e59324bf3f669d36973d64270 | 166,499,752,701,513,260,000,000,000,000,000,000,000 | 42 | Make line_no with too large value(2**20) invalid. Fixes #124 |
GF_Err gf_m4v_parse_config(GF_M4VParser *m4v, GF_M4VDecSpecInfo *dsi)
{
if (m4v->mpeg12) {
return gf_m4v_parse_config_mpeg12(m4v, dsi);
} else {
return gf_m4v_parse_config_mpeg4(m4v, dsi);
}
} | 0 | [
"CWE-119",
"CWE-787"
] | gpac | 90dc7f853d31b0a4e9441cba97feccf36d8b69a4 | 74,783,666,848,693,875,000,000,000,000,000,000,000 | 8 | fix some exploitable overflows (#994, #997) |
GF_Err traf_box_size(GF_Box *s)
{
u32 pos=0;
GF_TrackFragmentBox *ptr = (GF_TrackFragmentBox *) s;
//Header first
gf_isom_check_position(s, (GF_Box *)ptr->tfhd, &pos);
gf_isom_check_position_list(s, ptr->sub_samples, &pos);
gf_isom_check_position(s, (GF_Box *)ptr->tfdt, &pos);
gf_isom_check_position_list(s, pt... | 0 | [
"CWE-787"
] | gpac | 388ecce75d05e11fc8496aa4857b91245007d26e | 333,014,776,024,186,160,000,000,000,000,000,000,000 | 27 | fixed #1587 |
static bson *chunk_new( bson_oid_t id, int chunkNumber,
const char *data, int len ) {
bson *b = bson_malloc( sizeof( bson ) );
bson_init( b );
bson_append_oid( b, "files_id", &id );
bson_append_int( b, "n", chunkNumber );
bson_append_binary( b, "data", BSON_BIN_BINARY, data,... | 0 | [
"CWE-190"
] | mongo-c-driver-legacy | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | 313,426,184,362,512,470,000,000,000,000,000,000,000 | 11 | don't mix up int and size_t (first pass to fix that) |
static int __init enable_strict_msr_control(char *str)
{
strict_msr_control = true;
pr_info("Enabling strict facility control\n");
return 0;
} | 0 | [] | linux | 5d176f751ee3c6eededd984ad409bff201f436a7 | 114,842,486,388,721,780,000,000,000,000,000,000,000 | 7 | powerpc: tm: Enable transactional memory (TM) lazily for userspace
Currently the MSR TM bit is always set if the hardware is TM capable.
This adds extra overhead as it means the TM SPRS (TFHAR, TEXASR and
TFAIR) must be swapped for each process regardless of if they use TM.
For processes that don't use TM the TM MSR ... |
static int io_account_mem(struct io_ring_ctx *ctx, unsigned long nr_pages)
{
int ret;
if (ctx->user) {
ret = __io_account_mem(ctx->user, nr_pages);
if (ret)
return ret;
}
if (ctx->mm_account)
atomic64_add(nr_pages, &ctx->mm_account->pinned_vm);
return 0; | 0 | [
"CWE-667"
] | linux | 3ebba796fa251d042be42b929a2d916ee5c34a49 | 254,517,508,932,255,180,000,000,000,000,000,000,000 | 15 | 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... |
void vnc_display_add_client(const char *id, int csock, bool skipauth)
{
VncDisplay *vs = vnc_display_find(id);
if (!vs) {
return;
}
vnc_connect(vs, csock, skipauth, false);
} | 0 | [] | qemu | 4c65fed8bdf96780735dbdb92a8bd0d6b6526cc3 | 115,446,281,277,815,430,000,000,000,000,000,000,000 | 9 | ui: vnc: avoid floating point exception
While sending 'SetPixelFormat' messages to a VNC server,
the client could set the 'red-max', 'green-max' and 'blue-max'
values to be zero. This leads to a floating point exception in
write_png_palette while doing frame buffer updates.
Reported-by: Lian Yihan <lianyihan@360.cn>
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.