func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
static int parse_unc(const char *unc_name, struct parsed_mount_info *parsed_info)
{
int length = strnlen(unc_name, MAX_UNC_LEN);
const char *host, *share, *prepath;
size_t hostlen, sharelen, prepathlen;
if (length > (MAX_UNC_LEN - 1)) {
fprintf(stderr, "mount error: UNC name too long\n");
return EX_USAGE;
}
... | 0 | [
"CWE-20"
] | cifs-utils | f6eae44a3d05b6515a59651e6bed8b6dde689aec | 178,111,741,943,109,670,000,000,000,000,000,000,000 | 80 | mtab: handle ENOSPC/EFBIG condition properly when altering mtab
It's possible that when mount.cifs goes to append the mtab that there
won't be enough space to do so, and the mntent won't be appended to the
file in its entirety.
Add a my_endmntent routine that will fflush and then fsync the FILE if
that succeeds. If e... |
enum_func_status
php_mysqlnd_rowp_read_text_protocol_aux(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval ** fields,
unsigned int field_count, const MYSQLND_FIELD * fields_metadata,
zend_bool as_int_or_float, zend_bool copy_data, MYSQLND_STATS * stats TSRMLS_DC)
{
unsigned int i;
zend_bool last_field_... | 0 | [
"CWE-119",
"CWE-787"
] | php-src | 28f80baf3c53e267c9ce46a2a0fadbb981585132 | 325,703,409,906,620,970,000,000,000,000,000,000,000 | 188 | Fix bug #72293 - Heap overflow in mysqlnd related to BIT fields |
static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
#define SkipLinesOp 0x01
#define SetColorOp 0x02
#define SkipPixelsOp 0x03
#define ByteDataOp 0x05
#define RunDataOp 0x06
#define EOFOp 0x07
#define ThrowRLEException(exception,message) \
{ \
if (colormap != (unsigned char *) NUL... | 1 | [] | ImageMagick | 86cb33143c5b21912187403860a7c26761a3cd23 | 258,602,064,411,101,930,000,000,000,000,000,000,000 | 578 | https://github.com/ImageMagick/ImageMagick/issues/502 |
schedule_folder_update (CamelEwsStore *ews_store,
GHashTable *folder_ids)
{
struct ScheduleUpdateData *sud;
CamelSettings *settings;
g_return_if_fail (ews_store != NULL);
g_return_if_fail (ews_store->priv != NULL);
UPDATE_LOCK (ews_store);
g_hash_table_foreach (folder_ids, get_folder_names_to_update, ews_sto... | 0 | [
"CWE-295"
] | evolution-ews | 915226eca9454b8b3e5adb6f2fff9698451778de | 199,149,153,936,077,100,000,000,000,000,000,000,000 | 37 | I#27 - SSL Certificates are not validated
This depends on https://gitlab.gnome.org/GNOME/evolution-data-server/commit/6672b8236139bd6ef41ecb915f4c72e2a052dba5 too.
Closes https://gitlab.gnome.org/GNOME/evolution-ews/issues/27 |
void sctp_generate_proto_unreach_event(unsigned long data)
{
struct sctp_transport *transport = (struct sctp_transport *) data;
struct sctp_association *asoc = transport->asoc;
struct net *net = sock_net(asoc->base.sk);
sctp_bh_lock_sock(asoc->base.sk);
if (sock_owned_by_user(asoc->base.sk)) {
SCTP_DEBUG_PRINT... | 0 | [] | linux | 196d67593439b03088913227093e374235596e33 | 27,126,248,455,742,747,000,000,000,000,000,000,000 | 31 | sctp: Add support to per-association statistics via a new SCTP_GET_ASSOC_STATS call
The current SCTP stack is lacking a mechanism to have per association
statistics. This is an implementation modeled after OpenSolaris'
SCTP_GET_ASSOC_STATS.
Userspace part will follow on lksctp if/when there is a general ACK on
this.
... |
int ns_msg_getflag(ns_msg handle, int flag)
{
return ((handle)._flags & _ns_flagdata[flag].mask) >> _ns_flagdata[flag].shift;
} | 0 | [
"CWE-79"
] | uclibc-ng | 0f822af0445e5348ce7b7bd8ce1204244f31d174 | 910,185,736,537,334,700,000,000,000,000,000,000 | 4 | libc/inet/resolv.c: add __hnbad to check DNS entries for validity…
… using the same rules glibc does
also call __hnbad in some places to check answers |
static int llc_ui_shutdown(struct socket *sock, int how)
{
struct sock *sk = sock->sk;
int rc = -ENOTCONN;
lock_sock(sk);
if (unlikely(sk->sk_state != TCP_ESTABLISHED))
goto out;
rc = -EINVAL;
if (how != 2)
goto out;
rc = llc_send_disc(sk);
if (!rc)
rc = llc_ui_wait_for_disc(sk, sk->sk_rcvtimeo);
/* Wak... | 0 | [
"CWE-200"
] | linux-2.6 | 28e9fc592cb8c7a43e4d3147b38be6032a0e81bc | 275,405,257,452,466,100,000,000,000,000,000,000,000 | 20 | NET: llc, zero sockaddr_llc struct
sllc_arphrd member of sockaddr_llc might not be changed. Zero sllc
before copying to the above layer's structure.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net> |
int kvm_arch_hardware_setup(void)
{
return kvm_x86_ops->hardware_setup();
} | 0 | [
"CWE-476"
] | linux-2.6 | 59839dfff5eabca01cc4e20b45797a60a80af8cb | 37,997,309,324,738,405,000,000,000,000,000,000,000 | 4 | KVM: x86: check for cr3 validity in ioctl_set_sregs
Matt T. Yourst notes that kvm_arch_vcpu_ioctl_set_sregs lacks validity
checking for the new cr3 value:
"Userspace callers of KVM_SET_SREGS can pass a bogus value of cr3 to
the kernel. This will trigger a NULL pointer access in gfn_to_rmap()
when userspace next tries... |
static inline int sniffing_mode(struct airo_info *ai)
{
return (le16_to_cpu(ai->config.rmode) & le16_to_cpu(RXMODE_MASK)) >=
le16_to_cpu(RXMODE_RFMON);
} | 0 | [
"CWE-703",
"CWE-264"
] | linux | 550fd08c2cebad61c548def135f67aba284c6162 | 221,858,116,746,159,880,000,000,000,000,000,000,000 | 5 | 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... |
int key_reject_and_link(struct key *key,
unsigned timeout,
unsigned error,
struct key *keyring,
struct key *authkey)
{
struct assoc_array_edit *edit;
struct timespec now;
int ret, awaken, link_ret = 0;
key_check(key);
key_check(keyring);
awaken = 0;
ret = -EBUSY;
if (keyring) {
if (keyring->res... | 1 | [
"CWE-703"
] | linux | 38327424b40bcebe2de92d07312c89360ac9229a | 300,831,704,163,784,120,000,000,000,000,000,000,000 | 62 | KEYS: potential uninitialized variable
If __key_link_begin() failed then "edit" would be uninitialized. I've
added a check to fix that.
This allows a random user to crash the kernel, though it's quite
difficult to achieve. There are three ways it can be done as the user
would have to cause an error to occur in __ke... |
static bool only_ipaddrs_in_list(const char **list)
{
bool only_ip = true;
if (!list) {
return true;
}
for (; *list ; list++) {
/* factor out the special strings */
if (strequal(*list, "ALL") || strequal(*list, "FAIL") ||
strequal(*list, "EXCEPT")) {
continue;
}
if (!is_ipaddress(*list)) {
... | 0 | [] | samba | 91f4275873ebeda8f57684f09df67162ae80515a | 116,473,457,006,821,860,000,000,000,000,000,000,000 | 33 | swat: Use additional nonce on XSRF protection
If the user had a weak password on the root account of a machine running
SWAT, there still was a chance of being targetted by an XSRF on a
malicious web site targetting the SWAT setup.
Use a random nonce stored in secrets.tdb to close this possible attack
window. Thanks t... |
static int vhost_vdpa_alloc_domain(struct vhost_vdpa *v)
{
struct vdpa_device *vdpa = v->vdpa;
const struct vdpa_config_ops *ops = vdpa->config;
struct device *dma_dev = vdpa_get_dma_dev(vdpa);
struct bus_type *bus;
int ret;
/* Device want to do DMA by itself */
if (ops->set_map || ops->dma_map)
return 0;
b... | 0 | [
"CWE-416"
] | linux | f6bbf0010ba004f5e90c7aefdebc0ee4bd3283b9 | 9,426,622,213,958,834,000,000,000,000,000,000,000 | 33 | vhost-vdpa: fix use-after-free of v->config_ctx
When the 'v->config_ctx' eventfd_ctx reference is released we didn't
set it to NULL. So if the same character device (e.g. /dev/vhost-vdpa-0)
is re-opened, the 'v->config_ctx' is invalid and calling again
vhost_vdpa_config_put() causes use-after-free issues like the
foll... |
int main(int argc, char* argv[]) {
char* l_csr_file;
REALTYPE* l_a_sp;
unsigned int* l_rowptr;
unsigned int* l_colidx;
unsigned int l_rowcount, l_colcount, l_elements;
REALTYPE* l_a_dense;
REALTYPE* l_b;
REALTYPE* l_c_betaone;
REALTYPE* l_c_betazero;
REALTYPE* l_c_gold_betaone;
REALTYPE* l_c_gold... | 0 | [
"CWE-119",
"CWE-787"
] | libxsmm | 151481489192e6d1997f8bde52c5c425ea41741d | 320,661,761,140,806,240,000,000,000,000,000,000,000 | 248 | Issue #287: made CSR/CSC readers more robust against invalid input (case #1). |
int dvb_unregister_frontend(struct dvb_frontend* fe)
{
struct dvb_frontend_private *fepriv = fe->frontend_priv;
dev_dbg(fe->dvb->device, "%s:\n", __func__);
mutex_lock(&frontend_mutex);
dvb_frontend_stop(fe);
dvb_remove_device(fepriv->dvbdev);
/* fe is invalid now */
mutex_unlock(&frontend_mutex);
dvb_fronten... | 0 | [
"CWE-416"
] | linux | b1cb7372fa822af6c06c8045963571d13ad6348b | 301,279,295,463,313,770,000,000,000,000,000,000,000 | 14 | dvb_frontend: don't use-after-free the frontend struct
dvb_frontend_invoke_release() may free the frontend struct.
So, the free logic can't update it anymore after calling it.
That's OK, as __dvb_frontend_free() is called only when the
krefs are zeroed, so nobody is using it anymore.
That should fix the following KA... |
_g_object_ref (gpointer object)
{
return (object != NULL) ? g_object_ref (object) : NULL;
} | 0 | [
"CWE-22"
] | file-roller | b147281293a8307808475e102a14857055f81631 | 36,226,643,098,851,332,000,000,000,000,000,000,000 | 4 | libarchive: sanitize filenames before extracting |
Utility::Singletons Utility::createSingletons(Server::Configuration::FactoryContext& context) {
std::shared_ptr<Http::TlsCachingDateProviderImpl> date_provider =
context.singletonManager().getTyped<Http::TlsCachingDateProviderImpl>(
SINGLETON_MANAGER_REGISTERED_NAME(date_provider), [&context] {
... | 0 | [
"CWE-22"
] | envoy | 5333b928d8bcffa26ab19bf018369a835f697585 | 106,279,643,120,997,620,000,000,000,000,000,000,000 | 37 | Implement handling of escaped slash characters in URL path
Fixes: CVE-2021-29492
Signed-off-by: Yan Avlasov <yavlasov@google.com> |
static void ctx_flush_and_put(struct io_ring_ctx *ctx, bool *locked)
{
if (!ctx)
return;
if (*locked) {
io_submit_flush_completions(ctx);
mutex_unlock(&ctx->uring_lock);
*locked = false;
}
percpu_ref_put(&ctx->refs);
} | 0 | [
"CWE-416"
] | linux | e677edbcabee849bfdd43f1602bccbecf736a646 | 28,348,960,428,014,700,000,000,000,000,000,000,000 | 11 | io_uring: fix race between timeout flush and removal
io_flush_timeouts() assumes the timeout isn't in progress of triggering
or being removed/canceled, so it unconditionally removes it from the
timeout list and attempts to cancel it.
Leave it on the list and let the normal timeout cancelation take care
of it.
Cc: st... |
date_s__valid_jd_p(int argc, VALUE *argv, VALUE klass)
{
VALUE vjd, vsg;
VALUE argv2[2];
rb_scan_args(argc, argv, "11", &vjd, &vsg);
argv2[0] = vjd;
if (argc < 2)
argv2[1] = DBL2NUM(GREGORIAN);
else
argv2[1] = vsg;
return valid_jd_sub(2, argv2, klass, 1);
} | 0 | [] | date | 3959accef8da5c128f8a8e2fd54e932a4fb253b0 | 171,103,382,558,445,200,000,000,000,000,000,000,000 | 15 | Add length limit option for methods that parses date strings
`Date.parse` now raises an ArgumentError when a given date string is
longer than 128. You can configure the limit by giving `limit` keyword
arguments like `Date.parse(str, limit: 1000)`. If you pass `limit: nil`,
the limit is disabled.
Not only `Date.parse`... |
void onUnderlyingConnectionBelowWriteBufferLowWatermark() override { onBelowLowWatermark(); } | 0 | [
"CWE-400"
] | envoy | 0e49a495826ea9e29134c1bd54fdeb31a034f40c | 12,897,700,834,266,328,000,000,000,000,000,000,000 | 1 | http/2: add stats and stream flush timeout (#139)
This commit adds a new stream flush timeout to guard against a
remote server that does not open window once an entire stream has
been buffered for flushing. Additional stats have also been added
to better understand the codecs view of active streams as well as
amount o... |
static char *vfswrap_getwd(vfs_handle_struct *handle)
{
char *result;
START_PROFILE(syscall_getwd);
result = sys_getwd();
END_PROFILE(syscall_getwd);
return result;
} | 0 | [
"CWE-665"
] | samba | 30e724cbff1ecd90e5a676831902d1e41ec1b347 | 197,707,404,025,477,200,000,000,000,000,000,000,000 | 9 | FSCTL_GET_SHADOW_COPY_DATA: Initialize output array to zero
Otherwise num_volumes and the end marker can return uninitialized data
to the client.
Signed-off-by: Christof Schmitt <christof.schmitt@us.ibm.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org> |
static void move_ptes(struct vm_area_struct *vma, pmd_t *old_pmd,
unsigned long old_addr, unsigned long old_end,
struct vm_area_struct *new_vma, pmd_t *new_pmd,
unsigned long new_addr, bool need_rmap_locks)
{
struct mm_struct *mm = vma->vm_mm;
pte_t *old_pte, *new_pte, pte;
spinlock_t *old_ptl, *new_ptl;
bool... | 0 | [
"CWE-459"
] | linux | eb66ae030829605d61fbef1909ce310e29f78821 | 312,575,985,127,842,000,000,000,000,000,000,000,000 | 78 | mremap: properly flush TLB before releasing the page
Jann Horn points out that our TLB flushing was subtly wrong for the
mremap() case. What makes mremap() special is that we don't follow the
usual "add page to list of pages to be freed, then flush tlb, and then
free pages". No, mremap() obviously just _moves_ the p... |
put_post_cb (void *opaque, http_t http)
{
struct put_post_parm_s *parm = opaque;
gpg_error_t err = 0;
estream_t fp;
size_t len;
fp = http_get_write_ptr (http);
len = strlen (parm->datastring);
es_fprintf (fp,
"Content-Type: application/x-www-form-urlencoded\r\n"
"Content-Leng... | 0 | [
"CWE-352"
] | gnupg | 4a4bb874f63741026bd26264c43bb32b1099f060 | 218,886,790,296,541,050,000,000,000,000,000,000,000 | 18 | dirmngr: Avoid possible CSRF attacks via http redirects.
* dirmngr/http.h (parsed_uri_s): Add fields off_host and off_path.
(http_redir_info_t): New.
* dirmngr/http.c (do_parse_uri): Set new fields.
(same_host_p): New.
(http_prepare_redirect): New.
* dirmngr/t-http-basic.c: New test.
* dirmngr/ks-engine-hkp.c (send_re... |
static inline bool d_is_whiteout(const struct dentry *dentry)
{
return __d_entry_type(dentry) == DCACHE_WHITEOUT_TYPE;
} | 0 | [
"CWE-284"
] | linux | 54d5ca871e72f2bb172ec9323497f01cd5091ec7 | 30,607,013,763,859,807,000,000,000,000,000,000,000 | 4 | vfs: add vfs_select_inode() helper
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Cc: <stable@vger.kernel.org> # v4.2+ |
static u32 __init armv8pmu_read_num_pmnc_events(void)
{
u32 nb_cnt;
/* Read the nb of CNTx counters supported from PMNC */
nb_cnt = (armv8pmu_pmcr_read() >> ARMV8_PMCR_N_SHIFT) & ARMV8_PMCR_N_MASK;
/* Add the CPU cycles counter and return */
return nb_cnt + 1;
} | 0 | [
"CWE-284",
"CWE-264"
] | linux | 8fff105e13041e49b82f92eef034f363a6b1c071 | 265,843,683,763,926,200,000,000,000,000,000,000,000 | 10 | arm64: perf: reject groups spanning multiple HW PMUs
The perf core implicitly rejects events spanning multiple HW PMUs, as in
these cases the event->ctx will differ. However this validation is
performed after pmu::event_init() is called in perf_init_event(), and
thus pmu::event_init() may be called with a group leader... |
static void ShowMakerNoteGeneric(unsigned char * ValuePtr, int ByteCount)
{
int a;
for (a=0;a<ByteCount;a++){
if (a > 10){
printf("...");
break;
}
printf(" %02x",ValuePtr[a]);
}
printf(" (%d bytes)", ByteCount);
printf("\n");
} | 0 | [
"CWE-703"
] | jhead | a50953a266583981b51a181c2fce73dad2ac5d7d | 137,483,937,650,086,690,000,000,000,000,000,000,000 | 13 | Make pointer range checks more consistent.
Also twiddle the unused floating point print code (not used in real exif files),
but fuzz testing hits it. New code is equivalent but doesn't cause bus error (don't understand why, but this is all a very bogus thing anyway, just trying to avoid fuzz testing hits. |
static int proc_base_fill_cache(struct file *filp, void *dirent,
filldir_t filldir, struct task_struct *task, const struct pid_entry *p)
{
return proc_fill_cache(filp, dirent, filldir, p->name, p->len,
proc_base_instantiate, task, p);
} | 0 | [] | linux | 0499680a42141d86417a8fbaa8c8db806bea1201 | 103,489,044,027,711,190,000,000,000,000,000,000,000 | 6 | procfs: add hidepid= and gid= mount options
Add support for mount options to restrict access to /proc/PID/
directories. The default backward-compatible "relaxed" behaviour is left
untouched.
The first mount option is called "hidepid" and its value defines how much
info about processes we want to be available for non... |
static __net_init int proto_init_net(struct net *net)
{
if (!proc_create_net("protocols", 0444, net->proc_net, &proto_seq_ops,
sizeof(struct seq_net_private)))
return -ENOMEM;
return 0;
} | 0 | [] | net | 35306eb23814444bd4021f8a1c3047d3cb0c8b2b | 273,153,200,303,323,730,000,000,000,000,000,000,000 | 8 | af_unix: fix races in sk_peer_pid and sk_peer_cred accesses
Jann Horn reported that SO_PEERCRED and SO_PEERGROUPS implementations
are racy, as af_unix can concurrently change sk_peer_pid and sk_peer_cred.
In order to fix this issue, this patch adds a new spinlock that needs
to be used whenever these fields are read o... |
QPDF::getFilename() const
{
return this->file->getName();
} | 0 | [
"CWE-399",
"CWE-835"
] | qpdf | 701b518d5c56a1449825a3a37a716c58e05e1c3e | 182,496,100,140,855,650,000,000,000,000,000,000,000 | 4 | Detect recursion loops resolving objects (fixes #51)
During parsing of an object, sometimes parts of the object have to be
resolved. An example is stream lengths. If such an object directly or
indirectly points to the object being parsed, it can cause an infinite
loop. Guard against all cases of re-entrant resolution ... |
grammar_start_symbol_set (symbol *sym, location loc)
{
if (start_flag)
complain (&loc, complaint, _("multiple %s declarations"), "%start");
else
{
start_flag = true;
startsymbol = sym;
startsymbol_loc = loc;
}
} | 0 | [] | bison | b7aab2dbad43aaf14eebe78d54aafa245a000988 | 183,532,230,039,409,270,000,000,000,000,000,000,000 | 11 | fix: crash when redefining the EOF token
Reported by Agency for Defense Development.
https://lists.gnu.org/r/bug-bison/2020-08/msg00008.html
On an empty such as
%token FOO
BAR
FOO 0
%%
input: %empty
we crash because when we find FOO 0, we decrement ntokens (since FOO
was discovered... |
static int pkey_gost2018_decrypt(EVP_PKEY_CTX *pctx, unsigned char *key,
size_t *key_len, const unsigned char *in,
size_t in_len)
{
const unsigned char *p = in;
struct gost_pmeth_data *data;
EVP_PKEY *priv;
PSKeyTransport_gost *pst = NULL;
int ret ... | 0 | [
"CWE-120",
"CWE-787"
] | engine | b2b4d629f100eaee9f5942a106b1ccefe85b8808 | 113,851,282,919,558,530,000,000,000,000,000,000,000 | 96 | On unpacking key blob output buffer size should be fixed
Related: CVE-2022-29242 |
void utf8_snprintf(gchar *dst, gsize byte_len, const gchar *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
gchar *str = g_strdup_vprintf(fmt, ap);
va_end(ap);
utf8_strncpy(dst, str, byte_len);
g_free(str);
} | 0 | [
"CWE-200"
] | gerbv | 319a8af890e4d0a5c38e6d08f510da8eefc42537 | 96,287,189,463,301,710,000,000,000,000,000,000,000 | 10 | Remove local alias to parameter array
Normalizing access to `gerbv_simplified_amacro_t::parameter` as a step to fix CVE-2021-40402 |
ns_client_error(ns_client_t *client, isc_result_t result) {
dns_message_t *message = NULL;
dns_rcode_t rcode;
bool trunc = false;
REQUIRE(NS_CLIENT_VALID(client));
CTRACE("error");
message = client->message;
if (client->rcode_override == -1) {
rcode = dns_result_torcode(result);
} else {
rcode = (dns_rc... | 0 | [
"CWE-617"
] | bind9 | 15996f0cb15631b95a801e3e88928494a69ad6ee | 260,426,348,446,429,800,000,000,000,000,000,000,000 | 175 | ns_client_error() could assert if rcode was overridden to NOERROR
The client->rcode_override was originally created to force the server
to send SERVFAIL in some cases when it would normally have sent FORMERR.
More recently, it was used in a3ba95116ed04594ea59a8124bf781b30367a7a2
commit (part of GL #2790) to force the... |
int sisusb_setidxregandor(struct sisusb_usb_data *sisusb, int port, u8 idx,
u8 myand, u8 myor)
{
int ret;
u8 tmp;
ret = sisusb_write_memio_byte(sisusb, SISUSB_TYPE_IO, port, idx);
ret |= sisusb_read_memio_byte(sisusb, SISUSB_TYPE_IO, port + 1, &tmp);
tmp &= myand;
tmp |= myor;
ret |= sisusb_write_memio_byte(s... | 0 | [
"CWE-476"
] | linux | 9a5729f68d3a82786aea110b1bfe610be318f80a | 179,637,127,172,165,620,000,000,000,000,000,000,000 | 13 | USB: sisusbvga: fix oops in error path of sisusb_probe
The pointer used to log a failure of usb_register_dev() must
be set before the error is logged.
v2: fix that minor is not available before registration
Signed-off-by: oliver Neukum <oneukum@suse.com>
Reported-by: syzbot+a0cbdbd6d169020c8959@syzkaller.appspotmail... |
void Http2Session::Settings(const FunctionCallbackInfo<Value>& args) {
Http2Session* session;
ASSIGN_OR_RETURN_UNWRAP(&session, args.Holder());
CHECK(args[0]->IsFunction());
args.GetReturnValue().Set(session->AddSettings(args[0].As<Function>()));
} | 0 | [
"CWE-416"
] | node | a3c33d4ce78f74d1cf1765704af5b427aa3840a6 | 183,203,151,898,232,780,000,000,000,000,000,000,000 | 6 | http2: update handling of rst_stream with error code NGHTTP2_CANCEL
The PR updates the handling of rst_stream frames and adds all streams
to the pending list on receiving rst frames with the error code
NGHTTP2_CANCEL.
The changes will remove dependency on the stream state that may allow
bypassing the checks in certai... |
void md5_final(unsigned char *md, MD5CTX c) {
gcry_md_final(c);
memcpy(md, gcry_md_read(c, 0), MD5_DIGEST_LEN);
gcry_md_close(c);
} | 0 | [
"CWE-310"
] | libssh | e99246246b4061f7e71463f8806b9dcad65affa0 | 123,766,872,588,939,800,000,000,000,000,000,000,000 | 5 | security: fix for vulnerability CVE-2014-0017
When accepting a new connection, a forking server based on libssh forks
and the child process handles the request. The RAND_bytes() function of
openssl doesn't reset its state after the fork, but simply adds the
current process id (getpid) to the PRNG state, which is not g... |
void Convert::generic_convert(const char * in, int size, CharVector & out)
{
buf_.clear();
decode_->decode(in, size, buf_);
FilterChar * start = buf_.pbegin();
FilterChar * stop = buf_.pend();
if (!filter.empty())
filter.process(start, stop);
encode_->encode(start, stop, out);
} | 0 | [
"CWE-125"
] | aspell | de29341638833ba7717bd6b5e6850998454b044b | 178,888,736,689,418,900,000,000,000,000,000,000,000 | 10 | Don't allow null-terminated UCS-2/4 strings using the original API.
Detect if the encoding is UCS-2/4 and the length is -1 in affected API
functions and refuse to convert the string. If the string ends up
being converted somehow, abort with an error message in DecodeDirect
and ConvDirect. To convert a null terminate... |
static struct hlist_head *netdev_create_hash(void)
{
int i;
struct hlist_head *hash;
hash = kmalloc(sizeof(*hash) * NETDEV_HASHENTRIES, GFP_KERNEL);
if (hash != NULL)
for (i = 0; i < NETDEV_HASHENTRIES; i++)
INIT_HLIST_HEAD(&hash[i]);
return hash;
} | 0 | [
"CWE-399"
] | linux | 6ec82562ffc6f297d0de36d65776cff8e5704867 | 178,360,135,170,068,070,000,000,000,000,000,000,000 | 12 | veth: Dont kfree_skb() after dev_forward_skb()
In case of congestion, netif_rx() frees the skb, so we must assume
dev_forward_skb() also consume skb.
Bug introduced by commit 445409602c092
(veth: move loopback logic to common location)
We must change dev_forward_skb() to always consume skb, and veth to not
double fr... |
static int ext4_dio_get_block_unwritten_async(struct inode *inode,
sector_t iblock, struct buffer_head *bh_result, int create)
{
int ret;
/* We don't expect handle for direct IO */
WARN_ON_ONCE(ext4_journal_current_handle());
ret = ext4_get_block_trans(inode, iblock, bh_result,
EXT4_GET_BLOCKS_IO_CREATE_... | 0 | [
"CWE-200"
] | linux | 06bd3c36a733ac27962fea7d6f47168841376824 | 303,803,639,371,503,340,000,000,000,000,000,000,000 | 33 | ext4: fix data exposure after a crash
Huang has reported that in his powerfail testing he is seeing stale
block contents in some of recently allocated blocks although he mounts
ext4 in data=ordered mode. After some investigation I have found out
that indeed when delayed allocation is used, we don't add inode to
transa... |
static const char* PE_(bin_pe_get_claimed_authentihash)(RBinPEObj* pe) {
if (!pe->spcinfo) {
return NULL;
}
RASN1Binary *digest = pe->spcinfo->messageDigest.digest;
return digest? r_hex_bin2strdup (digest->binary, digest->length): NULL;
} | 0 | [
"CWE-400",
"CWE-703"
] | radare2 | 634b886e84a5c568d243e744becc6b3223e089cf | 215,042,910,054,242,260,000,000,000,000,000,000,000 | 7 | Fix DoS in PE/QNX/DYLDCACHE/PSX parsers ##crash
* Reported by lazymio
* Reproducer: AAA4AAAAAB4= |
gx_default_begin_page(gx_device * dev, gs_gstate * pgs)
{
return 0;
} | 0 | [] | ghostpdl | c9b362ba908ca4b1d7c72663a33229588012d7d9 | 170,833,888,943,036,470,000,000,000,000,000,000,000 | 4 | Bug 699670: disallow copying of the epo device
The erasepage optimisation (epo) subclass device shouldn't be allowed to be
copied because the subclass private data, child and parent pointers end up
being shared between the original device and the copy.
Add an epo_finish_copydevice which NULLs the three offending poin... |
static unsigned long mmap_legacy_base(void)
{
if (mmap_is_ia32())
return TASK_UNMAPPED_BASE;
else
return TASK_UNMAPPED_BASE + mmap_rnd();
} | 0 | [
"CWE-284",
"CWE-264"
] | linux | 4e7c22d447bb6d7e37bfe39ff658486ae78e8d77 | 102,810,967,728,111,780,000,000,000,000,000,000,000 | 7 | x86, mm/ASLR: Fix stack randomization on 64-bit systems
The issue is that the stack for processes is not properly randomized on
64 bit architectures due to an integer overflow.
The affected function is randomize_stack_top() in file
"fs/binfmt_elf.c":
static unsigned long randomize_stack_top(unsigned long stack_top... |
void ip_send_unicast_reply(struct sock *sk, struct sk_buff *skb,
const struct ip_options *sopt,
__be32 daddr, __be32 saddr,
const struct ip_reply_arg *arg,
unsigned int len)
{
struct ip_options_data replyopts;
struct ipcm_cookie ipc;
struct flowi4 fl4;
struct rtable *rt = skb_rtable(skb);
s... | 0 | [
"CWE-362"
] | net | 85f1bd9a7b5a79d5baa8bf44af19658f7bf77bfa | 120,990,692,533,715,640,000,000,000,000,000,000,000 | 74 | udp: consistently apply ufo or fragmentation
When iteratively building a UDP datagram with MSG_MORE and that
datagram exceeds MTU, consistently choose UFO or fragmentation.
Once skb_is_gso, always apply ufo. Conversely, once a datagram is
split across multiple skbs, do not consider ufo.
Sendpage already maintains th... |
void PackLinuxElf64::unpack(OutputFile *fo)
{
if (e_phoff != sizeof(Elf64_Ehdr)) {// Phdrs not contiguous with Ehdr
throwCantUnpack("bad e_phoff");
}
unsigned const c_phnum = get_te16(&ehdri.e_phnum);
upx_uint64_t old_data_off = 0;
upx_uint64_t old_data_len = 0;
upx_uint64_t old_dtinit =... | 1 | [
"CWE-787"
] | upx | 4e2fdb464a885c694408552c31739cb04b77bdcf | 144,171,854,376,241,950,000,000,000,000,000,000,000 | 350 | Defend against bad PT_DYNAMIC
https://github.com/upx/upx/issues/391
modified: p_lx_elf.cpp
modified: p_lx_elf.h |
static void pmac_ide_flush(DBDMA_io *io)
{
MACIOIDEState *m = io->opaque;
if (m->aiocb) {
blk_drain_all();
}
} | 0 | [
"CWE-399"
] | qemu | 3251bdcf1c67427d964517053c3d185b46e618e8 | 83,496,021,977,771,360,000,000,000,000,000,000,000 | 8 | ide: Correct handling of malformed/short PRDTs
This impacts both BMDMA and AHCI HBA interfaces for IDE.
Currently, we confuse the difference between a PRDT having
"0 bytes" and a PRDT having "0 complete sectors."
When we receive an incomplete sector, inconsistent error checking
leads to an infinite loop wherein the c... |
xstring& MirrorJob::FormatShortStatus(xstring& s)
{
if(bytes_to_transfer>0 && (!parent_mirror || parent_mirror->bytes_to_transfer!=bytes_to_transfer)) {
long long curr_bytes_transferred=GetBytesCount();
if(parent_mirror)
curr_bytes_transferred+=bytes_transferred;
s.appendf("%s/%s (%d%%)",
... | 0 | [
"CWE-20",
"CWE-401"
] | lftp | a27e07d90a4608ceaf928b1babb27d4d803e1992 | 83,827,410,521,553,710,000,000,000,000,000,000,000 | 15 | mirror: prepend ./ to rm and chmod arguments to avoid URL recognition (fix #452) |
void *idr_find(struct idr *idp, int id)
{
int n;
struct idr_layer *p;
p = rcu_dereference_raw(idp->top);
if (!p)
return NULL;
n = (p->layer+1) * IDR_BITS;
/* Mask off upper bits we don't use for the search. */
id &= MAX_ID_MASK;
if (id >= (1 << n))
return NULL;
BUG_ON(n == 0);
while (n > 0 && p) {
n... | 0 | [] | linux | 2dcb22b346be7b7b7e630a8970d69cf3f1111ec1 | 138,413,754,458,773,630,000,000,000,000,000,000,000 | 24 | idr: fix backtrack logic in idr_remove_all
Currently idr_remove_all will fail with a use after free error if
idr::layers is bigger than 2, which on 32 bit systems corresponds to items
more than 1024. This is due to stepping back too many levels during
backtracking. For simplicity let's assume that IDR_BITS=1 -> we h... |
void fmtutil_generate_bmpfileheader(deark *c, dbuf *outf, const struct de_bmpinfo *bi,
i64 file_size_override)
{
i64 file_size_to_write;
dbuf_write(outf, (const u8*)"BM", 2);
if(file_size_override)
file_size_to_write = file_size_override;
else
file_size_to_write = 14 + bi->total_size;
dbuf_writeu32le(outf, ... | 0 | [
"CWE-369"
] | deark | 62acb7753b0e3c0d3ab3c15057b0a65222313334 | 145,979,398,996,981,950,000,000,000,000,000,000,000 | 16 | pict,macrsrc: Fixed a bug that could cause division by 0
Found by F. Çelik. |
static int snd_timer_register_system(void)
{
struct snd_timer *timer;
struct snd_timer_system_private *priv;
int err;
err = snd_timer_global_new("system", SNDRV_TIMER_GLOBAL_SYSTEM, &timer);
if (err < 0)
return err;
strcpy(timer->name, "system timer");
timer->hw = snd_timer_system;
priv = kzalloc(sizeof(*pri... | 0 | [
"CWE-416",
"CWE-703"
] | linux | e7af6307a8a54f0b873960b32b6a644f2d0fbd97 | 246,492,820,859,831,560,000,000,000,000,000,000,000 | 22 | ALSA: timer: Fix incorrectly assigned timer instance
The clean up commit 41672c0c24a6 ("ALSA: timer: Simplify error path in
snd_timer_open()") unified the error handling code paths with the
standard goto, but it introduced a subtle bug: the timer instance is
stored in snd_timer_open() incorrectly even if it returns an... |
TEST_F(RouterTest, UpstreamPerTryIdleTimeout) {
InSequence s;
callbacks_.route_->route_entry_.retry_policy_.per_try_idle_timeout_ =
std::chrono::milliseconds(3000);
// This pattern helps ensure that we're actually invoking the callback.
bool filter_state_verified = false;
router_.config().upstream_log... | 0 | [
"CWE-703"
] | envoy | f0bb2219112d8cdb4c4e8b346834f962925362ca | 322,330,411,067,391,630,000,000,000,000,000,000,000 | 73 | [1.20] CVE-2022-21655
Crash with direct_response
Signed-off-by: Otto van der Schaaf <ovanders@redhat.com> |
Cached_item_field(THD *thd, Field *arg_field): field(arg_field)
{
field= arg_field;
/* TODO: take the memory allocation below out of the constructor. */
buff= (uchar*) thd_calloc(thd, length= field->pack_length());
} | 0 | [
"CWE-617"
] | server | 2e7891080667c59ac80f788eef4d59d447595772 | 273,228,795,010,965,330,000,000,000,000,000,000,000 | 6 | MDEV-25635 Assertion failure when pushing from HAVING into WHERE of view
This bug could manifest itself after pushing a where condition over a
mergeable derived table / view / CTE DT into a grouping view / derived
table / CTE V whose item list contained set functions with constant
arguments such as MIN(2), SUM(1) etc.... |
unregister_ftrace_function_probe_func(char *glob, struct ftrace_probe_ops *ops)
{
__unregister_ftrace_function_probe(glob, ops, NULL, PROBE_TEST_FUNC);
} | 0 | [
"CWE-703"
] | linux | 6a76f8c0ab19f215af2a3442870eeb5f0e81998d | 338,528,359,135,522,900,000,000,000,000,000,000,000 | 4 | tracing: Fix possible NULL pointer dereferences
Currently set_ftrace_pid and set_graph_function files use seq_lseek
for their fops. However seq_open() is called only for FMODE_READ in
the fops->open() so that if an user tries to seek one of those file
when she open it for writing, it sees NULL seq_file and then panic... |
word_to_hex_npad(char *out, guint16 word)
{
if (word >= 0x1000)
*out++ = low_nibble_of_octet_to_hex((guint8)(word >> 12));
if (word >= 0x0100)
*out++ = low_nibble_of_octet_to_hex((guint8)(word >> 8));
if (word >= 0x0010)
*out++ = low_nibble_of_octet_to_hex((guint8)(word >> 4));
*out++ = low_nibble_of_octet_to... | 0 | [
"CWE-125"
] | wireshark | d5f2657825e63e4126ebd7d13a59f3c6e8a9e4e1 | 58,271,865,499,488,880,000,000,000,000,000,000,000 | 11 | epan: Limit our bits in decode_bits_in_field.
Limit the number of bits we process in decode_bits_in_field, otherwise
we'll overrun our buffer. Fixes #16958. |
ZEND_API int zend_ts_hash_find(TsHashTable *ht, char *arKey, uint nKeyLength, void **pData)
{
int retval;
begin_read(ht);
retval = zend_hash_find(TS_HASH(ht), arKey, nKeyLength, pData);
end_read(ht);
return retval;
} | 0 | [] | php-src | 24125f0f26f3787c006e4a51611ba33ee3b841cb | 83,917,154,700,293,140,000,000,000,000,000,000,000 | 10 | Fixed bug #68676 (Explicit Double Free) |
static void rtl8xxxu_int_complete(struct urb *urb)
{
struct rtl8xxxu_priv *priv = (struct rtl8xxxu_priv *)urb->context;
struct device *dev = &priv->udev->dev;
int ret;
if (rtl8xxxu_debug & RTL8XXXU_DEBUG_INTERRUPT)
dev_dbg(dev, "%s: status %i\n", __func__, urb->status);
if (urb->status == 0) {
usb_anchor_urb(... | 0 | [
"CWE-400",
"CWE-401"
] | linux | a2cdd07488e666aa93a49a3fc9c9b1299e27ef3c | 180,392,132,807,923,120,000,000,000,000,000,000,000 | 17 | rtl8xxxu: prevent leaking urb
In rtl8xxxu_submit_int_urb if usb_submit_urb fails the allocated urb
should be released.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Reviewed-by: Chris Chiu <chiu@endlessm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org> |
check_anon(kdc_realm_t *kdc_active_realm,
krb5_principal client, krb5_principal server)
{
/* If restrict_anon is set, reject requests from anonymous to principals
* other than the local TGT. */
if (kdc_active_realm->realm_restrict_anon &&
krb5_principal_compare_any_realm(kdc_context, cli... | 0 | [
"CWE-476"
] | krb5 | 93b4a6306a0026cf1cc31ac4bd8a49ba5d034ba7 | 10,406,514,969,587,572,000,000,000,000,000,000,000 | 12 | Fix S4U2Self KDC crash when anon is restricted
In validate_as_request(), when enforcing restrict_anonymous_to_tgt,
use client.princ instead of request->client; the latter is NULL when
validating S4U2Self requests.
CVE-2016-3120:
In MIT krb5 1.9 and later, an authenticated attacker can cause krb5kdc
to dereference a ... |
mrb_obj_methods(mrb_state *mrb, mrb_bool recur, mrb_value obj, mrb_method_flag_t flag)
{
return mrb_class_instance_method_list(mrb, recur, mrb_class(mrb, obj), 0);
} | 0 | [
"CWE-824"
] | mruby | b64ce17852b180dfeea81cf458660be41a78974d | 60,247,556,009,510,120,000,000,000,000,000,000,000 | 4 | Should not call `initialize_copy` for `TT_ICLASS`; fix #4027
Since `TT_ICLASS` is a internal object that should never be revealed
to Ruby world. |
static struct ucounts *inc_net_namespaces(struct user_namespace *ns)
{
return inc_ucount(ns, current_euid(), UCOUNT_NET_NAMESPACES);
} | 0 | [
"CWE-416"
] | linux | 21b5944350052d2583e82dd59b19a9ba94a007f0 | 145,841,657,117,985,330,000,000,000,000,000,000,000 | 4 | net: Fix double free and memory corruption in get_net_ns_by_id()
(I can trivially verify that that idr_remove in cleanup_net happens
after the network namespace count has dropped to zero --EWB)
Function get_net_ns_by_id() does not check for net::count
after it has found a peer in netns_ids idr.
It may dereference a... |
static int ath6kl_wmi_tx_status_event_rx(struct wmi *wmi, u8 *datap, int len,
struct ath6kl_vif *vif)
{
struct wmi_tx_status_event *ev;
u32 id;
if (len < sizeof(*ev))
return -EINVAL;
ev = (struct wmi_tx_status_event *) datap;
id = le32_to_cpu(ev->id);
ath6kl_dbg(ATH6KL_DBG_WMI, "tx_status: id=%x ack_sta... | 0 | [
"CWE-125"
] | linux | 5d6751eaff672ea77642e74e92e6c0ac7f9709ab | 143,205,287,167,880,670,000,000,000,000,000,000,000 | 25 | ath6kl: add some bounds checking
The "ev->traffic_class" and "reply->ac" variables come from the network
and they're used as an offset into the wmi->stream_exist_for_ac[] array.
Those variables are u8 so they can be 0-255 but the stream_exist_for_ac[]
array only has WMM_NUM_AC (4) elements. We need to add a couple bo... |
int dev_open(struct net_device *dev)
{
int ret;
/*
* Is it already up?
*/
if (dev->flags & IFF_UP)
return 0;
/*
* Open device
*/
ret = __dev_open(dev);
if (ret < 0)
return ret;
/*
* ... and announce new interface.
*/
rtmsg_ifinfo(RTM_NEWLINK, dev, IFF_UP|IFF_RUNNING);
call_netdevice_notifier... | 0 | [
"CWE-399"
] | linux | 6ec82562ffc6f297d0de36d65776cff8e5704867 | 266,791,342,518,687,700,000,000,000,000,000,000,000 | 25 | veth: Dont kfree_skb() after dev_forward_skb()
In case of congestion, netif_rx() frees the skb, so we must assume
dev_forward_skb() also consume skb.
Bug introduced by commit 445409602c092
(veth: move loopback logic to common location)
We must change dev_forward_skb() to always consume skb, and veth to not
double fr... |
void Item_ref::update_used_tables()
{
if (!get_depended_from())
(*ref)->update_used_tables();
} | 0 | [] | server | b000e169562697aa072600695d4f0c0412f94f4f | 271,086,298,571,198,480,000,000,000,000,000,000,000 | 5 | Bug#26361149 MYSQL SERVER CRASHES AT: COL IN(IFNULL(CONST, COL), NAME_CONST('NAME', NULL))
based on:
commit f7316aa0c9a
Author: Ajo Robert <ajo.robert@oracle.com>
Date: Thu Aug 24 17:03:21 2017 +0530
Bug#26361149 MYSQL SERVER CRASHES AT: COL IN(IFNULL(CONST,
COL), NAME_CONST('NAME'... |
static inline void svm_inject_irq(struct vcpu_svm *svm, int irq)
{
struct vmcb_control_area *control;
control = &svm->vmcb->control;
control->int_vector = irq;
control->int_ctl &= ~V_INTR_PRIO_MASK;
control->int_ctl |= V_IRQ_MASK |
((/*control->int_vector >> 4*/ 0xf) << V_INTR_PRIO_SHIFT);
} | 0 | [
"CWE-400"
] | linux-2.6 | 9581d442b9058d3699b4be568b6e5eae38a41493 | 241,700,878,772,508,040,000,000,000,000,000,000,000 | 10 | 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-... |
static int mailimf_second_parse(const char * message, size_t length,
size_t * indx, int * result)
{
uint32_t second;
int r;
r = mailimf_number_parse(message, length, indx, &second);
if (r != MAILIMF_NO_ERROR)
return r;
* result = second;
return MAILIMF_NO_ERROR;
} | 0 | [
"CWE-476"
] | libetpan | 1fe8fbc032ccda1db9af66d93016b49c16c1f22d | 194,876,378,352,542,950,000,000,000,000,000,000,000 | 14 | Fixed crash #274 |
static int shred_file(int fd, const char *filename, const struct logInfo *log)
{
char count[DIGITS]; /* that's a lot of shredding :) */
const char **fullCommand;
int id = 0;
int status;
pid_t pid;
if (log->preremove) {
message(MESS_DEBUG, "running preremove script\n");
if (... | 0 | [
"CWE-732"
] | logrotate | f46d0bdfc9c53515c13880c501f4d2e1e7dd8b25 | 334,973,871,758,019,950,000,000,000,000,000,000,000 | 83 | Lock state file to prevent parallel execution
Running multiple instances of logrotate on the same set of log-files
might have undesirable effects.
Add command line option --skip-state-lock to skip locking the state
file, for example if locking is unsupported or prohibited.
Fixes: https://github.com/logrotate/logrota... |
void sock_def_readable(struct sock *sk)
{
struct socket_wq *wq;
rcu_read_lock();
wq = rcu_dereference(sk->sk_wq);
if (skwq_has_sleeper(wq))
wake_up_interruptible_sync_poll(&wq->wait, EPOLLIN | EPOLLPRI |
EPOLLRDNORM | EPOLLRDBAND);
sk_wake_async(sk, SOCK_WAKE_WAITD, POLL_IN);
rcu_read_unlock();
} | 0 | [] | net | 35306eb23814444bd4021f8a1c3047d3cb0c8b2b | 245,634,841,429,603,850,000,000,000,000,000,000,000 | 12 | af_unix: fix races in sk_peer_pid and sk_peer_cred accesses
Jann Horn reported that SO_PEERCRED and SO_PEERGROUPS implementations
are racy, as af_unix can concurrently change sk_peer_pid and sk_peer_cred.
In order to fix this issue, this patch adds a new spinlock that needs
to be used whenever these fields are read o... |
/* }}} */
static int check_id_allowed(char *id, long what) /* {{{ */
{
if (what & PHP_DATE_TIMEZONE_GROUP_AFRICA && strncasecmp(id, "Africa/", 7) == 0) return 1;
if (what & PHP_DATE_TIMEZONE_GROUP_AMERICA && strncasecmp(id, "America/", 8) == 0) return 1;
if (what & PHP_DATE_TIMEZONE_GROUP_ANTARCTICA... | 0 | [] | php-src | bb057498f7457e8b2eba98332a3bad434de4cf12 | 8,061,305,989,358,884,000,000,000,000,000,000,000 | 15 | Fix #70277: new DateTimeZone($foo) is ignoring text after null byte
The DateTimeZone constructors are not binary safe. They're parsing the timezone
as string, but discard the length when calling timezone_initialize(). This
patch adds a tz_len parameter and a respective check to timezone_initialize(). |
BGD_DECLARE(gdIOCtx *) gdNewDynamicCtx(int initialSize, void *data)
{
/* 2.0.23: Phil Moore: 'return' keyword was missing! */
return gdNewDynamicCtxEx(initialSize, data, 1);
} | 0 | [
"CWE-119",
"CWE-787"
] | libgd | 53110871935244816bbb9d131da0bccff734bfe9 | 107,287,038,388,725,670,000,000,000,000,000,000,000 | 5 | Avoid potentially dangerous signed to unsigned conversion
We make sure to never pass a negative `rlen` as size to memcpy(). See
also <https://bugs.php.net/bug.php?id=73280>.
Patch provided by Emmanuel Law. |
static unsigned long rings_size(struct io_ring_ctx *ctx, unsigned int sq_entries,
unsigned int cq_entries, size_t *sq_offset)
{
struct io_rings *rings;
size_t off, sq_array_size;
off = struct_size(rings, cqes, cq_entries);
if (off == SIZE_MAX)
return SIZE_MAX;
if (ctx->flags & IORING_SETUP_CQE32) {
if (c... | 0 | [
"CWE-416"
] | linux | 9cae36a094e7e9d6e5fe8b6dcd4642138b3eb0c7 | 24,595,955,240,633,246,000,000,000,000,000,000,000 | 32 | io_uring: reinstate the inflight tracking
After some debugging, it was realized that we really do still need the
old inflight tracking for any file type that has io_uring_fops assigned.
If we don't, then trivial circular references will mean that we never get
the ctx cleaned up and hence it'll leak.
Just bring back t... |
static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
concat_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
&opline->op2.u.constant TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
} | 0 | [] | php-src | ce96fd6b0761d98353761bf78d5bfb55291179fd | 4,890,796,360,515,558,300,000,000,000,000,000,000 | 12 | - fix #39863, do not accept paths with NULL in them. See http://news.php.net/php.internals/50191, trunk will have the patch later (adding a macro and/or changing (some) APIs. Patch by Rasmus |
virDomainMigratePerform3Params(virDomainPtr domain,
const char *dconnuri,
virTypedParameterPtr params,
int nparams,
const char *cookiein,
int cookieinlen,
... | 0 | [
"CWE-254"
] | libvirt | 506e9d6c2d4baaf580d489fff0690c0ff2ff588f | 18,767,756,126,122,774,000,000,000,000,000,000,000 | 41 | virDomainGetTime: Deny on RO connections
We have a policy that if API may end up talking to a guest agent
it should require RW connection. We don't obey the rule in
virDomainGetTime().
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> |
static void edge_break(struct tty_struct *tty, int break_state)
{
struct usb_serial_port *port = tty->driver_data;
struct edgeport_port *edge_port = usb_get_serial_port_data(port);
int status;
int bv = 0; /* Off */
if (break_state == -1)
bv = 1; /* On */
status = ti_do_config(edge_port, UMPC_SET_CLR_BREAK, bv)... | 0 | [
"CWE-191"
] | linux | 654b404f2a222f918af9b0cd18ad469d0c941a8e | 56,564,342,164,185,660,000,000,000,000,000,000,000 | 14 | USB: serial: io_ti: fix information leak in completion handler
Add missing sanity check to the bulk-in completion handler to avoid an
integer underflow that can be triggered by a malicious device.
This avoids leaking 128 kB of memory content from after the URB transfer
buffer to user space.
Fixes: 8c209e6782ca ("USB... |
cmsHPROFILE CMSEXPORT cmsOpenProfileFromMemTHR(cmsContext ContextID, const void* MemPtr, cmsUInt32Number dwSize)
{
_cmsICCPROFILE* NewIcc;
cmsHPROFILE hEmpty;
hEmpty = cmsCreateProfilePlaceholder(ContextID);
if (hEmpty == NULL) return NULL;
NewIcc = (_cmsICCPROFILE*) hEmpty;
// Ok, in this case ... | 0 | [] | Little-CMS | d2d902b9a03583ae482c782b2f243f7e5268a47d | 278,116,844,672,244,480,000,000,000,000,000,000,000 | 23 | >Changes from Richard Hughes |
color_cap_rv_fct (void)
{
/* By this point, it was 1 (or already -1). */
color_option = -1; /* That's still != 0. */
} | 0 | [
"CWE-189"
] | grep | 8fcf61523644df42e1905c81bed26838e0b04f91 | 225,621,372,411,605,400,000,000,000,000,000,000,000 | 5 | grep: fix integer-overflow issues in main program
* NEWS: Document this.
* bootstrap.conf (gnulib_modules): Add inttypes, xstrtoimax.
Remove xstrtoumax.
* src/main.c: Include <inttypes.h>, for INTMAX_MAX, PRIdMAX.
(context_length_arg, prtext, grepbuf, grep, grepfile)
(get_nondigit_option, main):
Use intmax_t, not int,... |
void policies_print(BIO *out, X509_STORE_CTX *ctx)
{
X509_POLICY_TREE *tree;
int explicit_policy;
int free_out = 0;
if (out == NULL)
{
out = BIO_new_fp(stderr, BIO_NOCLOSE);
free_out = 1;
}
tree = X509_STORE_CTX_get0_policy_tree(ctx);
explicit_policy = X509_STORE_CTX_get_explicit_policy(ctx);
BIO_print... | 0 | [] | openssl | a70da5b3ecc3160368529677006801c58cb369db | 109,452,453,854,175,750,000,000,000,000,000,000,000 | 21 | New functions to check a hostname email or IP address against a
certificate. Add options to s_client, s_server and x509 utilities
to print results of checks. |
gs_window_clear (GSWindow *window)
{
g_return_if_fail (GS_IS_WINDOW (window));
clear_widget (GTK_WIDGET (window));
clear_widget (window->priv->drawing_area);
} | 0 | [] | gnome-screensaver | a5f66339be6719c2b8fc478a1d5fc6545297d950 | 223,910,614,793,435,540,000,000,000,000,000,000,000 | 7 | Ensure keyboard grab and unlock dialog exist after monitor removal
gnome-screensaver currently doesn't deal with monitors getting
removed properly. If the unlock dialog is on the removed monitor
then the unlock dialog and its associated keyboard grab are not
moved to an existing monitor when the monitor removal is pr... |
void git_path_diriter_free(git_path_diriter *diriter)
{
if (diriter == NULL)
return;
git_buf_dispose(&diriter->path_utf8);
if (diriter->handle != INVALID_HANDLE_VALUE) {
FindClose(diriter->handle);
diriter->handle = INVALID_HANDLE_VALUE;
}
} | 0 | [
"CWE-20",
"CWE-706"
] | libgit2 | 3f7851eadca36a99627ad78cbe56a40d3776ed01 | 138,966,689,709,130,760,000,000,000,000,000,000,000 | 12 | 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 ... |
void ConnectDialog::on_qaFavoriteAdd_triggered() {
ServerItem *si = static_cast<ServerItem *>(qtwServers->currentItem());
if (! si || (si->itType == ServerItem::FavoriteType))
return;
si = new ServerItem(si);
qtwServers->fixupName(si);
qlItems << si;
qtwServers->siFavorite->addServerItem(si);
qtwServers->setC... | 0 | [
"CWE-59",
"CWE-61"
] | mumble | e59ee87abe249f345908c7d568f6879d16bfd648 | 60,594,618,213,953,400,000,000,000,000,000,000,000 | 12 | FIX(client): Only allow "http"/"https" for URLs in ConnectDialog
Our public server list registration script doesn't have an URL scheme
whitelist for the website field.
Turns out a malicious server can register itself with a dangerous URL in
an attempt to attack a user's machine.
User interaction is required, as the ... |
static void t1_scan_keys(PDF pdf)
{
int i, k;
char *p, *q, *r;
const key_entry *key;
if (t1_prefix("/FontType")) {
p = t1_line_array + strlen("FontType") + 1;
if ((i = (int) t1_scan_num(p, 0)) != 1)
formatted_error("type 1","Type%d fonts unsupported by backend", i);
r... | 0 | [
"CWE-119"
] | texlive-source | 6ed0077520e2b0da1fd060c7f88db7b2e6068e4c | 64,079,664,885,136,750,000,000,000,000,000,000,000 | 60 | writet1 protection against buffer overflow
git-svn-id: svn://tug.org/texlive/trunk/Build/source@48697 c570f23f-e606-0410-a88d-b1316a301751 |
pixContrastNorm(PIX *pixd,
PIX *pixs,
l_int32 sx,
l_int32 sy,
l_int32 mindiff,
l_int32 smoothx,
l_int32 smoothy)
{
PIX *pixmin, *pixmax;
PROCNAME("pixContrastNorm");
if (!pixs || pixGetD... | 0 | [
"CWE-125"
] | leptonica | 3c18c43b6a3f753f0dfff99610d46ad46b8bfac4 | 86,307,369,302,665,500,000,000,000,000,000,000,000 | 38 | Fixing oss-fuzz issue 22512: Heap-buffer-overflow in rasteropGeneralLow()
* Simplified the hole-filling function
` |
static void get_delta_sk(X509_STORE_CTX *ctx, X509_CRL **dcrl, int *pscore,
X509_CRL *base, STACK_OF(X509_CRL) *crls)
{
X509_CRL *delta;
int i;
if (!(ctx->param->flags & X509_V_FLAG_USE_DELTAS))
return;
if (!((ctx->current_cert->ex_flags | base->flags) & EXFLAG_FRESHEST)... | 0 | [] | openssl | 33cc5dde478ba5ad79f8fd4acd8737f0e60e236e | 115,065,256,287,627,150,000,000,000,000,000,000,000 | 21 | Compat self-signed trust with reject-only aux data
When auxiliary data contains only reject entries, continue to trust
self-signed objects just as when no auxiliary data is present.
This makes it possible to reject specific uses without changing
what's accepted (and thus overring the underlying EKU).
Added new suppo... |
DEFUN(srchfor, SEARCH SEARCH_FORE WHEREIS, "Search forward")
{
srch(forwardSearch, "Forward: ");
} | 0 | [
"CWE-59",
"CWE-241"
] | w3m | 18dcbadf2771cdb0c18509b14e4e73505b242753 | 224,627,479,529,555,470,000,000,000,000,000,000,000 | 4 | Make temporary directory safely when ~/.w3m is unwritable |
void addQueryableBackupPrivileges(PrivilegeVector* privileges) {
Privilege::addPrivilegeToPrivilegeVector(
privileges, Privilege(ResourcePattern::forAnyResource(), ActionType::collStats));
Privilege::addPrivilegeToPrivilegeVector(
privileges, Privilege(ResourcePattern::forAnyNormalResource(), Ac... | 0 | [
"CWE-20"
] | mongo | cbec187266a9f902b3906ae8ccef2bbda0c5b27b | 153,206,353,328,749,150,000,000,000,000,000,000,000 | 70 | SERVER-36263 Bypassing operation validation in applyOps should require special privilege |
static inline void put_tpel_pixels_mc00_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
switch(width){
case 2: put_pixels2_8_c (dst, src, stride, height); break;
case 4: put_pixels4_8_c (dst, src, stride, height); break;
case 8: put_pixels8_8_c (dst, src, stride, height); break;
... | 0 | [
"CWE-703",
"CWE-189"
] | FFmpeg | 454a11a1c9c686c78aa97954306fb63453299760 | 150,256,261,345,182,920,000,000,000,000,000,000,000 | 8 | avcodec/dsputil: fix signedness in sizeof() comparissions
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> |
static void __vsock_remove_bound(struct vsock_sock *vsk)
{
list_del_init(&vsk->bound_table);
sock_put(&vsk->sk);
} | 0 | [
"CWE-667"
] | linux | c518adafa39f37858697ac9309c6cf1805581446 | 83,283,639,406,459,090,000,000,000,000,000,000,000 | 5 | vsock: fix the race conditions in multi-transport support
There are multiple similar bugs implicitly introduced by the
commit c0cfa2d8a788fcf4 ("vsock: add multi-transports support") and
commit 6a2c0962105ae8ce ("vsock: prevent transport modules unloading").
The bug pattern:
[1] vsock_sock.transport pointer is copie... |
dwarf_select_sections_by_letters (const char *letters)
{
int result = 0;
while (* letters)
{
const debug_dump_long_opts *entry;
for (entry = debug_option_table; entry->letter; entry++)
{
if (entry->letter == * letters)
{
if (entry->val == 0)
* entry->variable = 0;
else
*... | 0 | [
"CWE-703"
] | binutils-gdb | 695c6dfe7e85006b98c8b746f3fd5f913c94ebff | 38,374,485,137,319,693,000,000,000,000,000,000,000 | 34 | PR29370, infinite loop in display_debug_abbrev
The PR29370 testcase is a fuzzed object file with multiple
.trace_abbrev sections. Multiple .trace_abbrev or .debug_abbrev
sections are not a violation of the DWARF standard. The DWARF5
standard even gives an example of multiple .debug_abbrev sections
contained in group... |
really_add_connection (NMConnection *connection,
gboolean canceled,
GError *error,
gpointer user_data)
{
ActionInfo *info = user_data;
NMConnectionEditor *editor;
GError *editor_error = NULL;
const char *message = _("The connection editor dialog c... | 0 | [
"CWE-200"
] | network-manager-applet | 8627880e07c8345f69ed639325280c7f62a8f894 | 317,389,247,335,587,000,000,000,000,000,000,000,000 | 40 | editor: prevent any registration of objects on the system bus
D-Bus access-control is name-based; so requests for a specific name
are allowed/denied based on the rules in /etc/dbus-1/system.d. But
apparently apps still get a non-named service on the bus, and if we
register *any* object even though we don't have a nam... |
unzzip_show_list (int argc, char ** argv)
{
return unzzip_list(argc, argv, 0);
} | 0 | [
"CWE-772"
] | zziplib | 83a2da55922f67e07f22048ac9671a44cc0d35c4 | 155,604,367,541,314,760,000,000,000,000,000,000,000 | 4 | ensure disk_close to avoid mem-leak #40 |
dns_zonemgr_settransfersin(dns_zonemgr_t *zmgr, uint32_t value) {
REQUIRE(DNS_ZONEMGR_VALID(zmgr));
zmgr->transfersin = value;
} | 0 | [
"CWE-327"
] | bind9 | f09352d20a9d360e50683cd1d2fc52ccedcd77a0 | 231,332,608,492,008,200,000,000,000,000,000,000,000 | 5 | Update keyfetch_done compute_tag check
If in keyfetch_done the compute_tag fails (because for example the
algorithm is not supported), don't crash, but instead ignore the
key. |
SYSCALL_DEFINE3(mknod, const char __user *, filename, umode_t, mode, unsigned, dev)
{
return do_mknodat(AT_FDCWD, filename, mode, dev);
} | 0 | [
"CWE-416",
"CWE-284"
] | linux | d0cb50185ae942b03c4327be322055d622dc79f6 | 233,334,257,936,451,820,000,000,000,000,000,000,000 | 4 | do_last(): fetch directory ->i_mode and ->i_uid before it's too late
may_create_in_sticky() call is done when we already have dropped the
reference to dir.
Fixes: 30aba6656f61e (namei: allow restricted O_CREAT of FIFOs and regular files)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> |
exitcmd(int argc, char **argv)
{
if (stoppedjobs())
return 0;
if (argc > 1)
savestatus = number(argv[1]);
exraise(EXEXIT);
/* NOTREACHED */
} | 0 | [] | dash | 29d6f2148f10213de4e904d515e792d2cf8c968e | 183,325,499,555,626,170,000,000,000,000,000,000,000 | 11 | eval: Check nflag in evaltree instead of cmdloop
This patch moves the nflag check from cmdloop into evaltree. This
is so that nflag will be in force even if we enter the shell via a
path other than cmdloop, e.g., through sh -c.
Reported-by: Joey Hess <id@joeyh.name>
Signed-off-by: Herbert Xu <herbert@gondor.apana.or... |
void ServerConnectionImpl::onUrl(const char* data, size_t length) {
if (active_request_) {
active_request_->request_url_.append(data, length);
}
} | 0 | [
"CWE-400",
"CWE-703"
] | envoy | afc39bea36fd436e54262f150c009e8d72db5014 | 301,605,998,684,131,170,000,000,000,000,000,000,000 | 5 | Track byteSize of HeaderMap internally.
Introduces a cached byte size updated internally in HeaderMap. The value
is stored as an optional, and is cleared whenever a non-const pointer or
reference to a HeaderEntry is accessed. The cached value can be set with
refreshByteSize() which performs an iteration over the Heade... |
R_API bool r_io_bank_map_depriorize(RIO *io, const ut32 bankid, const ut32 mapid) {
RIOBank *bank = r_io_bank_get (io, bankid);
RIOMap *map = r_io_map_get (io, mapid);
r_return_val_if_fail (bank && map, false);
RListIter *iter;
RIOMapRef *mapref = NULL;
r_list_foreach (bank->maprefs, iter, mapref) {
if (mapref-... | 0 | [
"CWE-416"
] | radare2 | b5cb90b28ec71fda3504da04e3cc94a362807f5e | 54,142,613,053,745,440,000,000,000,000,000,000,000 | 23 | Prefer memleak over usaf in io.bank's rbtree bug ##crash
* That's a workaround, proper fix will come later
* Reproducer: bins/fuzzed/iobank-crash
* Reported by Akyne Choi via huntr.dev |
static inline int nla_nest_compat_end(struct sk_buff *skb, struct nlattr *start)
{
struct nlattr *nest = (void *)start + NLMSG_ALIGN(start->nla_len);
start->nla_len = skb_tail_pointer(skb) - (unsigned char *)start;
return nla_nest_end(skb, nest);
} | 0 | [] | linux-2.6 | 1045b03e07d85f3545118510a587035536030c1c | 254,914,989,881,275,680,000,000,000,000,000,000,000 | 7 | netlink: fix overrun in attribute iteration
kmemcheck reported this:
kmemcheck: Caught 16-bit read from uninitialized memory (f6c1ba30)
0500110001508abf050010000500000002017300140000006f72672e66726565
i i i i i i i i i i i i i u u u u u u u u u u u u u u u u u u u
^
Pid: 3... |
static void vmx_inject_nmi(struct kvm_vcpu *vcpu)
{
struct vcpu_vmx *vmx = to_vmx(vcpu);
++vcpu->stat.nmi_injections;
vmx->loaded_vmcs->nmi_known_unmasked = false;
if (vmx->rmode.vm86_active) {
if (kvm_inject_realmode_interrupt(vcpu, NMI_VECTOR, 0) != EMULATE_DONE)
kvm_make_request(KVM_REQ_TRIPLE_FAULT, vcpu... | 0 | [
"CWE-20",
"CWE-617"
] | linux | 3a8b0677fc6180a467e26cc32ce6b0c09a32f9bb | 115,535,143,794,254,640,000,000,000,000,000,000,000 | 16 | KVM: VMX: Do not BUG() on out-of-bounds guest IRQ
The value of the guest_irq argument to vmx_update_pi_irte() is
ultimately coming from a KVM_IRQFD API call. Do not BUG() in
vmx_update_pi_irte() if the value is out-of bounds. (Especially,
since KVM as a whole seems to hang after that.)
Instead, print a message only o... |
MaybeLocal<Value> GetPeerCert(
Environment* env,
const SSLPointer& ssl,
bool abbreviated,
bool is_server) {
ClearErrorOnReturn clear_error_on_return;
Local<Object> result;
MaybeLocal<Object> maybe_cert;
// NOTE: This is because of the odd OpenSSL behavior. On client `cert_chain`
// contains t... | 0 | [
"CWE-295"
] | node | 466e5415a2b7b3574ab5403acb87e89a94a980d1 | 266,974,637,785,737,540,000,000,000,000,000,000,000 | 68 | crypto,tls: implement safe x509 GeneralName format
This change introduces JSON-compatible escaping rules for strings that
include X.509 GeneralName components (see RFC 5280). This non-standard
format avoids ambiguities and prevents injection attacks that could
previously lead to X.509 certificates being accepted even ... |
onigenc_init(void)
{
return 0;
} | 0 | [
"CWE-125"
] | Onigmo | d4cf99d30bd5f6a8a4ababd0b9d7b06f3a479a24 | 309,167,282,197,512,230,000,000,000,000,000,000,000 | 4 | Fix out-of-bounds read in parse_char_class() (Close #139)
/[\x{111111}]/ causes out-of-bounds read when encoding is a single byte
encoding. \x{111111} is an invalid codepoint for a single byte encoding.
Check if it is a valid codepoint. |
static void hevc_parse_hrd_parameters(GF_BitStream *bs, Bool commonInfPresentFlag, int maxNumSubLayersMinus1)
{
int i;
Bool nal_hrd_parameters_present_flag = GF_FALSE;
Bool vcl_hrd_parameters_present_flag = GF_FALSE;
Bool sub_pic_hrd_params_present_flag = GF_FALSE;
if (commonInfPresentFlag) {
nal_hrd_parameters_... | 0 | [
"CWE-119",
"CWE-787"
] | gpac | 90dc7f853d31b0a4e9441cba97feccf36d8b69a4 | 245,083,979,269,029,330,000,000,000,000,000,000,000 | 50 | fix some exploitable overflows (#994, #997) |
static int rsa_prepare_blinding( rsa_context *ctx,
int (*f_rng)(void *, unsigned char *, size_t), void *p_rng )
{
int ret;
if( ctx->Vf.p != NULL )
{
/* We already have blinding values, just update them by squaring */
MPI_CHK( mpi_mul_mpi( &ctx->Vi, &ctx->Vi, &ctx->Vi ) );
... | 1 | [
"CWE-310"
] | polarssl | 6b06502c4b19ce40a88faca3528b9f3f0c87a755 | 227,778,554,332,612,530,000,000,000,000,000,000,000 | 31 | Changed RSA blinding to a slower but thread-safe version |
GF_Err fdsa_AddBox(GF_Box *s, GF_Box *a)
{
GF_HintSample *ptr = (GF_HintSample *)s;
switch(a->type) {
case GF_ISOM_BOX_TYPE_FDPA:
gf_list_add(ptr->packetTable, a);
break;
case GF_ISOM_BOX_TYPE_EXTR:
if (ptr->extra_data) ERROR_ON_DUPLICATED_BOX(a, ptr)
ptr->extra_data = (GF_ExtraDataBox*)a;
break;
defaul... | 0 | [
"CWE-400",
"CWE-401"
] | gpac | d2371b4b204f0a3c0af51ad4e9b491144dd1225c | 58,297,940,144,119,920,000,000,000,000,000,000,000 | 16 | prevent dref memleak on invalid input (#1183) |
int TS_TST_INFO_set_serial(TS_TST_INFO *a, ASN1_INTEGER *serial)
{
ASN1_INTEGER *new_serial;
if (a->serial == serial)
return 1;
new_serial = ASN1_INTEGER_dup(serial);
if (new_serial == NULL)
{
TSerr(TS_F_TS_TST_INFO_SET_SERIAL, ERR_R_MALLOC_FAILURE);
return 0;
}
ASN1_INTEGER_free(a->serial);
a->serial... | 0 | [] | openssl | c7235be6e36c4bef84594aa3b2f0561db84b63d8 | 298,787,179,396,644,900,000,000,000,000,000,000,000 | 16 | RFC 3161 compliant time stamp request creation, response generation
and response verification.
Submitted by: Zoltan Glozik <zglozik@opentsa.org>
Reviewed by: Ulf Moeller |
static void schedule_orphans_remove(struct perf_event_context *ctx)
{
if (!ctx->task || ctx->orphans_remove_sched || !perf_wq)
return;
if (queue_delayed_work(perf_wq, &ctx->orphans_remove, 1)) {
get_ctx(ctx);
ctx->orphans_remove_sched = true;
}
} | 0 | [
"CWE-284",
"CWE-264"
] | linux | f63a8daa5812afef4f06c962351687e1ff9ccb2b | 144,326,716,852,686,600,000,000,000,000,000,000,000 | 10 | perf: Fix event->ctx locking
There have been a few reported issues wrt. the lack of locking around
changing event->ctx. This patch tries to address those.
It avoids the whole rwsem thing; and while it appears to work, please
give it some thought in review.
What I did fail at is sensible runtime checks on the use of
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.