func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
verify_type_compatibility_full (VerifyContext *ctx, MonoType *target, MonoType *candidate, gboolean strict)
{
#define IS_ONE_OF3(T, A, B, C) (T == A || T == B || T == C)
#define IS_ONE_OF2(T, A, B) (T == A || T == B)
MonoType *original_candidate = candidate;
VERIFIER_DEBUG ( printf ("checking type compatibility %s x... | 0 | [
"CWE-20"
] | mono | 4905ef1130feb26c3150b28b97e4a96752e0d399 | 23,390,650,923,001,780,000,000,000,000,000,000,000 | 186 | Handle invalid instantiation of generic methods.
* verify.c: Add new function to internal verifier API to check
method instantiations.
* reflection.c (mono_reflection_bind_generic_method_parameters):
Check the instantiation before returning it.
Fixes #655847 |
static void write_bulk_callback(struct urb *urb)
{
struct hso_net *odev = urb->context;
int status = urb->status;
/* Sanity check */
if (!odev || !test_bit(HSO_NET_RUNNING, &odev->flags)) {
dev_err(&urb->dev->dev, "%s: device not running\n", __func__);
return;
}
/* Do we still have a valid kernel network de... | 0 | [
"CWE-125"
] | linux | 5146f95df782b0ac61abde36567e718692725c89 | 52,616,849,873,376,520,000,000,000,000,000,000,000 | 28 | USB: hso: Fix OOB memory access in hso_probe/hso_get_config_data
The function hso_probe reads if_num from the USB device (as an u8) and uses
it without a length check to index an array, resulting in an OOB memory read
in hso_probe or hso_get_config_data.
Add a length check for both locations and updated hso_probe to ... |
ServiceProtoValidateTicket(ServiceConnection *conn,
ProtoRequest *req)
{
VGAuthError err;
gchar *packet;
gchar *sPacket;
char *userName = NULL;
char *token = NULL;
ServiceValidationResultsType type;
ServiceValidationResultsData *svd = NULL;
/*
* The ticket code wi... | 0 | [] | open-vm-tools | 70a74758bfe0042c27f15ce590fb21a2bc54d745 | 244,080,901,765,090,200,000,000,000,000,000,000,000 | 73 | Properly check authorization on incoming guestOps requests.
Fix public pipe request checks. Only a SessionRequest type should
be accepted on the public pipe. |
int32_t ByteArray::Get(int32_t index) {
return InternalGet(index) & 0xff;
} | 1 | [
"CWE-119",
"CWE-703"
] | sfntly | c56b85408bab232efd7e650f0994272a174e3b92 | 157,086,658,473,777,620,000,000,000,000,000,000,000 | 3 | Add a bounds check to ByteArray::Get(). |
MagickExport MagickBooleanType TransformImageColorspace(Image *image,
const ColorspaceType colorspace,ExceptionInfo *exception)
{
MagickBooleanType
status;
assert(image != (Image *) NULL);
assert(image->signature == MagickCoreSignature);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEve... | 0 | [
"CWE-369"
] | ImageMagick | 75f6f5032690077cae3eaeda3c0165cc765eaeb5 | 233,508,649,085,822,860,000,000,000,000,000,000,000 | 33 | https://github.com/ImageMagick/ImageMagick/issues/3295 |
isofs_dentry_cmp(const struct dentry *parent, const struct dentry *dentry,
unsigned int len, const char *str, const struct qstr *name)
{
return isofs_dentry_cmp_common(len, str, name, 0, 0);
} | 0 | [
"CWE-20",
"CWE-399"
] | linux | 410dd3cf4c9b36f27ed4542ee18b1af5e68645a4 | 250,652,892,376,693,560,000,000,000,000,000,000,000 | 5 | isofs: Fix unbounded recursion when processing relocated directories
We did not check relocated directory in any way when processing Rock
Ridge 'CL' tag. Thus a corrupted isofs image can possibly have a CL
entry pointing to another CL entry leading to possibly unbounded
recursion in kernel code and thus stack overflow... |
get_min_match_length(Node* node, OnigDistance *min, ScanEnv* env)
{
OnigDistance tmin;
int r = 0;
*min = 0;
switch (NTYPE(node)) {
case NT_BREF:
{
int i;
int* backs;
Node** nodes = SCANENV_MEM_NODES(env);
BRefNode* br = NBREF(node);
if (br->state & NST_RECURSION) break;
... | 0 | [
"CWE-125"
] | php-src | c6e34d91b88638966662caac62c4d0e90538e317 | 93,812,053,907,168,200,000,000,000,000,000,000,000 | 121 | Fix bug #77371 (heap buffer overflow in mb regex functions - compile_string_node) |
static int get_extended_base_var(char *name, int baselen, int c)
{
do {
if (c == '\n')
return -1;
c = get_next_char();
} while (isspace(c));
/* We require the format to be '[base "extension"]' */
if (c != '"')
return -1;
name[baselen++] = '.';
for (;;) {
int ch = get_next_char();
if (ch == '\n')
... | 0 | [
"CWE-94"
] | linux | aba8d056078e47350d85b06a9cabd5afcc4b72ea | 301,825,638,507,942,980,000,000,000,000,000,000,000 | 35 | perf tools: do not look at ./config for configuration
In addition to /etc/perfconfig and $HOME/.perfconfig, perf looks for
configuration in the file ./config, imitating git which looks at
$GIT_DIR/config. If ./config is not a perf configuration file, it
fails, or worse, treats it as a configuration file and changes b... |
void bitmap_cache_free(rdpBitmapCache* bitmapCache)
{
int i, j;
rdpBitmap* bitmap;
if (bitmapCache)
{
for (i = 0; i < (int)bitmapCache->maxCells; i++)
{
for (j = 0; j < (int)bitmapCache->cells[i].number + 1; j++)
{
bitmap = bitmapCache->cells[i].entries[j];
Bitmap_Free(bitmapCache->context, bitma... | 1 | [
"CWE-125"
] | FreeRDP | 0b6b92a25a77d533b8a92d6acc840a81e103684e | 224,078,996,857,473,440,000,000,000,000,000,000,000 | 22 | Fixed CVE-2020-11525: Out of bounds read in bitmap_cache_new
Thanks to Sunglin and HuanGMz from Knownsec 404 |
struct iovec *iovec_from_user(const struct iovec __user *uvec,
unsigned long nr_segs, unsigned long fast_segs,
struct iovec *fast_iov, bool compat)
{
struct iovec *iov = fast_iov;
int ret;
/*
* SuS says "The readv() function *may* fail if the iovcnt argument was
* less than or equal to 0, or greater than {I... | 0 | [
"CWE-665",
"CWE-284"
] | linux | 9d2231c5d74e13b2a0546fee6737ee4446017903 | 208,861,964,968,124,400,000,000,000,000,000,000,000 | 34 | lib/iov_iter: initialize "flags" in new pipe_buffer
The functions copy_page_to_iter_pipe() and push_pipe() can both
allocate a new pipe_buffer, but the "flags" member initializer is
missing.
Fixes: 241699cd72a8 ("new iov_iter flavour: pipe-backed")
To: Alexander Viro <viro@zeniv.linux.org.uk>
To: linux-fsdevel@vger.k... |
*/
static int pskb_carve_inside_nonlinear(struct sk_buff *skb, const u32 off,
int pos, gfp_t gfp_mask)
{
int i, k = 0;
int size = skb_end_offset(skb);
u8 *data;
const int nfrags = skb_shinfo(skb)->nr_frags;
struct skb_shared_info *shinfo;
size = SKB_DATA_ALIGN(size);
if (skb_pfmemalloc(skb))
gfp_... | 0 | [
"CWE-703",
"CWE-125"
] | linux | 8605330aac5a5785630aec8f64378a54891937cc | 297,107,014,962,799,780,000,000,000,000,000,000,000 | 80 | tcp: fix SCM_TIMESTAMPING_OPT_STATS for normal skbs
__sock_recv_timestamp can be called for both normal skbs (for
receive timestamps) and for skbs on the error queue (for transmit
timestamps).
Commit 1c885808e456
(tcp: SOF_TIMESTAMPING_OPT_STATS option for SO_TIMESTAMPING)
assumes any skb passed to __sock_recv_timest... |
JsVar *jspeBinaryExpression() {
return __jspeBinaryExpression(jspeUnaryExpression(),0);
} | 0 | [
"CWE-787"
] | Espruino | e069be2ecc5060ef47391716e4de94999595b260 | 316,346,784,495,279,240,000,000,000,000,000,000,000 | 3 | Fix potential corruption issue caused by `delete [].__proto__` (fix #2142) |
static struct smack_known *smack_from_secattr(struct netlbl_lsm_secattr *sap,
struct socket_smack *ssp)
{
struct smack_known *skp;
int found = 0;
int acat;
int kcat;
/*
* Netlabel found it in the cache.
*/
if ((sap->flags & NETLBL_SECATTR_CACHE) != 0)
return (struct smack_known *)sap->cache->data;
... | 0 | [
"CWE-416"
] | linux | a3727a8bac0a9e77c70820655fd8715523ba3db7 | 327,259,924,147,445,580,000,000,000,000,000,000,000 | 74 | selinux,smack: fix subjective/objective credential use mixups
Jann Horn reported a problem with commit eb1231f73c4d ("selinux:
clarify task subjective and objective credentials") where some LSM
hooks were attempting to access the subjective credentials of a task
other than the current task. Generally speaking, it is ... |
static inline void xen_alloc_callback_vector(void) {} | 0 | [
"CWE-400",
"CWE-703"
] | linux | e99502f76271d6bc4e374fe368c50c67a1fd3070 | 4,555,790,266,651,799,400,000,000,000,000,000,000 | 1 | xen/events: defer eoi in case of excessive number of events
In case rogue guests are sending events at high frequency it might
happen that xen_evtchn_do_upcall() won't stop processing events in
dom0. As this is done in irq handling a crash might be the result.
In order to avoid that, delay further inter-domain events... |
keygrip_from_pk (PKT_public_key *pk, unsigned char *array)
{
gpg_error_t err;
gcry_sexp_t s_pkey;
if (DBG_PACKET)
log_debug ("get_keygrip for public key\n");
switch (pk->pubkey_algo)
{
case GCRY_PK_DSA:
err = gcry_sexp_build (&s_pkey, NULL,
"(public-key(dsa(p%m)(... | 0 | [
"CWE-20"
] | gnupg | 2183683bd633818dd031b090b5530951de76f392 | 206,887,695,607,418,200,000,000,000,000,000,000,000 | 75 | Use inline functions to convert buffer data to scalars.
* common/host2net.h (buf16_to_ulong, buf16_to_uint): New.
(buf16_to_ushort, buf16_to_u16): New.
(buf32_to_size_t, buf32_to_ulong, buf32_to_uint, buf32_to_u32): New.
--
Commit 91b826a38880fd8a989318585eb502582636ddd8 was not enough to
avoid all sign extension on ... |
AP_DECLARE(void) ap_time_process_request(ap_sb_handle_t *sbh, int status)
{
worker_score *ws;
if (!sbh)
return;
if (sbh->child_num < 0) {
return;
}
ws = &ap_scoreboard_image->servers[sbh->child_num][sbh->thread_num];
if (status == START_PREQUEST) {
ws->start_time = ws... | 0 | [
"CWE-476"
] | httpd | fa7b2a5250e54363b3a6c8ac3aaa7de4e8da9b2e | 243,092,141,747,997,460,000,000,000,000,000,000,000 | 23 | Merge r1878092 from trunk:
Fix a NULL pointer dereference
* server/scoreboard.c (ap_increment_counts): In certain cases like certain
invalid requests r->method might be NULL here. r->method_number defaults
to M_GET and hence is M_GET in these cases.
Submitted by: rpluem
Reviewed by: covener, ylavic, jfclere
gi... |
asmlinkage long sys_fchownat(int dfd, const char __user *filename, uid_t user,
gid_t group, int flag)
{
struct nameidata nd;
int error = -EINVAL;
int follow;
if ((flag & ~AT_SYMLINK_NOFOLLOW) != 0)
goto out;
follow = (flag & AT_SYMLINK_NOFOLLOW) ? 0 : LOOKUP_FOLLOW;
error = __user_walk_fd(dfd, filenam... | 0 | [
"CWE-264"
] | linux-2.6 | 7b82dc0e64e93f430182f36b46b79fcee87d3532 | 26,828,401,307,746,490,000,000,000,000,000,000,000 | 19 | Remove suid/sgid bits on [f]truncate()
.. to match what we do on write(). This way, people who write to files
by using [f]truncate + writable mmap have the same semantics as if they
were using the write() family of system calls.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> |
static int nfs4_do_set_security_label(struct inode *inode,
struct nfs4_label *ilabel,
struct nfs_fattr *fattr,
struct nfs4_label *olabel)
{
struct nfs4_exception exception = { };
int err;
do {
err = _nfs4_do_set_security_label(inode, ilabel,
fattr, olabel);
trace_nfs4_set_security_label(inode, err);
... | 0 | [
"CWE-787"
] | linux | b4487b93545214a9db8cbf32e86411677b0cca21 | 16,345,669,015,124,390,000,000,000,000,000,000,000 | 17 | nfs: Fix getxattr kernel panic and memory overflow
Move the buffer size check to decode_attr_security_label() before memcpy()
Only call memcpy() if the buffer is large enough
Fixes: aa9c2669626c ("NFS: Client implementation of Labeled-NFS")
Signed-off-by: Jeffrey Mitchell <jeffrey.mitchell@starlab.io>
[Trond: clean u... |
int security_path_symlink(struct path *path, struct dentry *dentry,
const char *old_name)
{
if (unlikely(IS_PRIVATE(path->dentry->d_inode)))
return 0;
return security_ops->path_symlink(path, dentry, old_name);
} | 0 | [] | linux-2.6 | ee18d64c1f632043a02e6f5ba5e045bb26a5465f | 268,799,001,137,940,670,000,000,000,000,000,000,000 | 7 | KEYS: Add a keyctl to install a process's session keyring on its parent [try #6]
Add a keyctl to install a process's session keyring onto its parent. This
replaces the parent's session keyring. Because the COW credential code does
not permit one process to change another process's credentials directly, the
change is... |
void SNC_io_parser<EW>::
print_sedge(SHalfedge_handle e) const {
//index { twin, sprev, snext, source, sface, prev, next, facet | circle } mark
out << index(e) << " { "
<< index(e->twin()) << ", "
<< index(e->sprev()) << ", " << index(e->snext()) << ", "
<< index(e->source()) << ", " << index(e->inc... | 0 | [
"CWE-125"
] | cgal | 5a1ab45058112f8647c14c02f58905ecc597ec76 | 314,087,807,360,441,520,000,000,000,000,000,000,000 | 25 | Fix Nef_3 |
**/
const CImg<T>& save_jpeg(const char *const filename, const unsigned int quality=100) const {
return _save_jpeg(0,filename,quality); | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 28,722,949,048,973,157,000,000,000,000,000,000,000 | 3 | Fix other issues in 'CImg<T>::load_bmp()'. |
UINT rdpgfx_write_rect16(wStream* s, const RECTANGLE_16* rect16)
{
Stream_Write_UINT16(s, rect16->left); /* left (2 bytes) */
Stream_Write_UINT16(s, rect16->top); /* top (2 bytes) */
Stream_Write_UINT16(s, rect16->right); /* right (2 bytes) */
Stream_Write_UINT16(s, rect16->bottom); /* bottom (2 bytes) */
re... | 0 | [
"CWE-190"
] | FreeRDP | 40393700642ad38437982e8a3afc34ff33ccf28e | 320,609,706,968,527,650,000,000,000,000,000,000,000 | 8 | Fixed input sanitation in rdpgfx_recv_solid_fill_pdu
The input rectangle must be checked for plausibility.
Thanks to Sunglin and HuanGMz of the Knownsec 404 security team and pangzi of pwnzen |
xdiff_out(
long start_a,
long count_a,
long start_b,
long count_b,
void *priv)
{
diffout_T *dout = (diffout_T *)priv;
diffhunk_T *p = ALLOC_ONE(diffhunk_T);
if (p == NULL)
return -1;
if (ga_grow(&dout->dout_ga, 1) == FAIL)
{
vim_free(p);
return -1;
}
p->lnum_orig = start_a + 1;
... | 0 | [
"CWE-787"
] | vim | c101abff4c6756db4f5e740fde289decb9452efa | 285,441,022,615,443,920,000,000,000,000,000,000,000 | 26 | patch 8.2.5164: invalid memory access after diff buffer manipulations
Problem: Invalid memory access after diff buffer manipulations.
Solution: Use zero offset when change removes all lines in a diff block. |
int SSL_renegotiate(SSL *s)
{
if (s->new_session == 0)
{
s->new_session=1;
}
return(s->method->ssl_renegotiate(s));
} | 0 | [] | openssl | ee2ffc279417f15fef3b1073c7dc81a908991516 | 63,543,672,495,687,520,000,000,000,000,000,000,000 | 8 | Add Next Protocol Negotiation. |
static void set_device_wakeable_complete(uint8_t status, uint16_t length,
const void *param, void *user_data)
{
const struct mgmt_rp_set_device_flags *rp = param;
struct btd_adapter *adapter = user_data;
struct btd_device *dev;
char addr[18];
if (status != MGMT_STATUS_SUCCESS) {
btd_error(adapter->dev_id,... | 0 | [
"CWE-862",
"CWE-863"
] | bluez | b497b5942a8beb8f89ca1c359c54ad67ec843055 | 122,779,477,027,756,800,000,000,000,000,000,000,000 | 33 | adapter: Fix storing discoverable setting
discoverable setting shall only be store when changed via Discoverable
property and not when discovery client set it as that be considered
temporary just for the lifetime of the discovery. |
longlong Item_func_is_used_lock::val_int()
{
DBUG_ASSERT(fixed == 1);
String *res= args[0]->val_str(&value);
THD *thd= current_thd;
null_value= 1;
if (!ull_name_ok(res))
return 0;
MDL_key ull_key;
ull_key.mdl_key_init(MDL_key::USER_LOCK, res->c_ptr_safe(), "");
ulong thread_id = thd->mdl_context.g... | 0 | [
"CWE-120"
] | server | eca207c46293bc72dd8d0d5622153fab4d3fccf1 | 201,511,228,459,164,600,000,000,000,000,000,000,000 | 19 | MDEV-25317 Assertion `scale <= precision' failed in decimal_bin_size And Assertion `scale >= 0 && precision > 0 && scale <= precision' failed in decimal_bin_size_inline/decimal_bin_size.
Precision should be kept below DECIMAL_MAX_SCALE for computations.
It can be bigger in Item_decimal. I'd fix this too but it changes... |
static int sock_fasync(int fd, struct file *filp, int on)
{
struct socket *sock = filp->private_data;
struct sock *sk = sock->sk;
struct socket_wq *wq = &sock->wq;
if (sk == NULL)
return -EINVAL;
lock_sock(sk);
fasync_helper(fd, filp, on, &wq->fasync_list);
if (!wq->fasync_list)
sock_reset_flag(sk, SOCK_F... | 0 | [] | linux | d69e07793f891524c6bbf1e75b9ae69db4450953 | 86,127,627,301,196,700,000,000,000,000,000,000,000 | 20 | net: disallow ancillary data for __sys_{send,recv}msg_file()
Only io_uring uses (and added) these, and we want to disallow the
use of sendmsg/recvmsg for anything but regular data transfers.
Use the newly added prep helper to split the msghdr copy out from
the core function, to check for msg_control and msg_controllen... |
static OPJ_BOOL opj_j2k_read_crg ( opj_j2k_t *p_j2k,
OPJ_BYTE * p_header_data,
OPJ_UINT32 p_header_size,
opj_event_mgr_t * p_manager
)
{
OPJ_UINT32 l_nb_comp;
... | 0 | [
"CWE-416"
] | openjpeg | 940100c28ae28931722290794889cf84a92c5f6f | 259,622,810,560,756,600,000,000,000,000,000,000,000 | 31 | Fix potential use-after-free in opj_j2k_write_mco function
Fixes #563 |
void kvm_track_tsc_matching(struct kvm_vcpu *vcpu)
{
#ifdef CONFIG_X86_64
bool vcpus_matched;
bool do_request = false;
struct kvm_arch *ka = &vcpu->kvm->arch;
struct pvclock_gtod_data *gtod = &pvclock_gtod_data;
vcpus_matched = (ka->nr_vcpus_matched_tsc + 1 ==
atomic_read(&vcpu->kvm->online_vcpus));
if (vcp... | 0 | [
"CWE-119"
] | kvm | c300aa64ddf57d9c5d9c898a64b36877345dd4a9 | 194,409,793,151,770,000,000,000,000,000,000,000,000 | 26 | KVM: x86: fix for buffer overflow in handling of MSR_KVM_SYSTEM_TIME (CVE-2013-1796)
If the guest sets the GPA of the time_page so that the request to update the
time straddles a page then KVM will write onto an incorrect page. The
write is done byusing kmap atomic to get a pointer to the page for the time
structure ... |
copy_files_disk_to_tape (int in_des, int out_des, off_t num_bytes,
char *filename)
{
off_t size;
off_t k;
int rc;
off_t original_num_bytes;
original_num_bytes = num_bytes;
while (num_bytes > 0)
{
if (input_size == 0)
if ((rc = disk_fill_input_buffer (in_des,
num_bytes < DISK_IO_BLOCK... | 0 | [
"CWE-190"
] | cpio | dd96882877721703e19272fe25034560b794061b | 40,174,196,976,213,994,000,000,000,000,000,000,000 | 45 | Rewrite dynamic string support.
* src/dstring.c (ds_init): Take a single argument.
(ds_free): New function.
(ds_resize): Take a single argument. Use x2nrealloc to expand
the storage.
(ds_reset,ds_append,ds_concat,ds_endswith): New function.
(ds_fgetstr): Rewrite. In particular, this fixes integer overflow.
* src/dst... |
static void exit_handler(int signo)
{
(void)signo;
running = 0;
} | 0 | [
"CWE-119",
"CWE-787"
] | ssdp-responder | ce04b1f29a137198182f60bbb628d5ceb8171765 | 74,587,963,346,197,330,000,000,000,000,000,000,000 | 5 | Fix #1: Ensure recv buf is always NUL terminated
Signed-off-by: Joachim Nilsson <troglobit@gmail.com> |
static inline int ib_addr_loopback(const struct ib_addr *a)
{
return ((a->sib_addr32[0] | a->sib_addr32[1] |
a->sib_addr32[2] | (a->sib_addr32[3] ^ htonl(1))) == 0);
} | 0 | [
"CWE-284",
"CWE-264"
] | linux | e6bd18f57aad1a2d1ef40e646d03ed0f2515c9e3 | 42,449,502,644,178,837,000,000,000,000,000,000,000 | 5 | IB/security: Restrict use of the write() interface
The drivers/infiniband stack uses write() as a replacement for
bi-directional ioctl(). This is not safe. There are ways to
trigger write calls that result in the return structure that
is normally written to user space being shunted off to user
specified kernel memory... |
static void test_wl4166_1()
{
MYSQL_STMT *stmt;
int int_data;
char str_data[50];
char tiny_data;
short small_data;
longlong big_data;
float real_data;
double double_data;
ulong length[7];
my_bool is_null[7];
MYSQL_BIND my_bind[7];
int rc;
int i;
my... | 0 | [
"CWE-284",
"CWE-295"
] | mysql-server | 3bd5589e1a5a93f9c224badf983cd65c45215390 | 269,181,549,317,662,760,000,000,000,000,000,000,000 | 116 | 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... |
rsvg_alpha_blt (cairo_surface_t *src,
gint srcx,
gint srcy,
gint srcwidth,
gint srcheight,
cairo_surface_t *dst,
gint dstx,
gint dsty)
{
gint src_surf_width, src_surf_height;
gint dst_surf_width, dst_... | 0 | [] | librsvg | a51919f7e1ca9c535390a746fbf6e28c8402dc61 | 135,477,966,159,566,200,000,000,000,000,000,000,000 | 68 | rsvg: Add rsvg_acquire_node()
This function does proper recursion checks when looking up resources
from URLs and thereby helps avoiding infinite loops when cyclic
references span multiple types of elements. |
authentic_parse_size(unsigned char *in, size_t *out)
{
if (!in || !out)
return SC_ERROR_INVALID_ARGUMENTS;
if (*in < 0x80) {
*out = *in;
return 1;
}
else if (*in == 0x81) {
*out = *(in + 1);
return 2;
}
else if (*in == 0x82) {
*out = *(in + 1) * 0x100 + *(in + 2);
return 3;
}
return SC_ERR... | 0 | [
"CWE-125"
] | OpenSC | 8fe377e93b4b56060e5bbfb6f3142ceaeca744fa | 138,724,779,487,198,000,000,000,000,000,000,000,000 | 20 | fixed out of bounds reads
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting and suggesting security fixes. |
static RSA_PSS_PARAMS *rsa_pss_decode(const X509_ALGOR *alg,
X509_ALGOR **pmaskHash)
{
const unsigned char *p;
int plen;
RSA_PSS_PARAMS *pss;
*pmaskHash = NULL;
if (!alg->parameter || alg->parameter->type != V_ASN1_SEQUENCE)
return NULL;
p = alg->p... | 0 | [
"CWE-476"
] | openssl | d8541d7e9e63bf5f343af24644046c8d96498c17 | 302,050,484,745,025,870,000,000,000,000,000,000,000 | 30 | Add PSS parameter check.
Avoid seg fault by checking mgf1 parameter is not NULL. This can be
triggered during certificate verification so could be a DoS attack
against a client or a server enabling client authentication.
Thanks to Loïc Jonas Etienne (Qnective AG) for discovering this bug.
CVE-2015-3194
Reviewed-by:... |
ArgParser::argMinVersion(char* parameter)
{
o.min_version = parameter;
} | 0 | [
"CWE-787"
] | qpdf | d71f05ca07eb5c7cfa4d6d23e5c1f2a800f52e8e | 216,654,937,868,435,500,000,000,000,000,000,000,000 | 4 | Fix sign and conversion warnings (major)
This makes all integer type conversions that have potential data loss
explicit with calls that do range checks and raise an exception. After
this commit, qpdf builds with no warnings when -Wsign-conversion
-Wconversion is used with gcc or clang or when -W3 -Wd4800 is used
with ... |
static void reparent_leader(struct task_struct *father, struct task_struct *p,
struct list_head *dead)
{
if (unlikely(p->exit_state == EXIT_DEAD))
return;
/* We don't want people slaying init. */
p->exit_signal = SIGCHLD;
/* If it has exited notify the new parent about this child's death. */
if (!p->ptrace... | 0 | [
"CWE-200",
"CWE-284"
] | linux | 6c85501f2fabcfc4fc6ed976543d252c4eaf4be9 | 8,141,779,587,560,516,000,000,000,000,000,000,000 | 20 | fix infoleak in waitid(2)
kernel_waitid() can return a PID, an error or 0. rusage is filled in the first
case and waitid(2) rusage should've been copied out exactly in that case, *not*
whenever kernel_waitid() has not returned an error. Compat variant shares that
braino; none of kernel_wait4() callers do, so the bel... |
SMBC_server_internal(TALLOC_CTX *ctx,
SMBCCTX *context,
bool connect_if_not_found,
const char *server,
uint16_t port,
const char *share,
char **pp_workgroup,
char **pp_username,
char **pp_password,
bool *in_cache)
{
SM... | 1 | [
"CWE-20"
] | samba | 1ba49b8f389eda3414b14410c7fbcb4041ca06b1 | 247,508,868,240,973,940,000,000,000,000,000,000,000 | 393 | CVE-2015-5296: s3:libsmb: force signing when requiring encryption in SMBC_server_internal()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11536
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org> |
void Item_func_locate::print(String *str, enum_query_type query_type)
{
str->append(STRING_WITH_LEN("locate("));
args[1]->print(str, query_type);
str->append(',');
args[0]->print(str, query_type);
if (arg_count == 3)
{
str->append(',');
args[2]->print(str, query_type);
}
str->append(')');
} | 0 | [
"CWE-120"
] | server | eca207c46293bc72dd8d0d5622153fab4d3fccf1 | 314,231,953,321,646,000,000,000,000,000,000,000,000 | 13 | MDEV-25317 Assertion `scale <= precision' failed in decimal_bin_size And Assertion `scale >= 0 && precision > 0 && scale <= precision' failed in decimal_bin_size_inline/decimal_bin_size.
Precision should be kept below DECIMAL_MAX_SCALE for computations.
It can be bigger in Item_decimal. I'd fix this too but it changes... |
const Type_handler *type_handler() const
{
return Type_handler::get_handler_by_field_type(date_time_field_type);
} | 0 | [
"CWE-617"
] | server | 807945f2eb5fa22e6f233cc17b85a2e141efe2c8 | 270,270,510,905,671,500,000,000,000,000,000,000,000 | 4 | MDEV-26402: A SEGV in Item_field::used_tables/update_depend_map_for_order...
When doing condition pushdown from HAVING into WHERE,
Item_equal::create_pushable_equalities() calls
item->set_extraction_flag(IMMUTABLE_FL) for constant items.
Then, Item::cleanup_excluding_immutables_processor() checks for this flag
to see ... |
static inline void ccid3_hc_tx_update_s(struct ccid3_hc_tx_sock *hc, int len)
{
const u16 old_s = hc->tx_s;
hc->tx_s = tfrc_ewma(hc->tx_s, len, 9);
if (hc->tx_s != old_s)
ccid3_update_send_interval(hc);
} | 0 | [
"CWE-200"
] | linux | 7b07f8eb75aa3097cdfd4f6eac3da49db787381d | 321,342,044,324,299,330,000,000,000,000,000,000,000 | 9 | dccp: fix info leak via getsockopt(DCCP_SOCKOPT_CCID_TX_INFO)
The CCID3 code fails to initialize the trailing padding bytes of struct
tfrc_tx_info added for alignment on 64 bit architectures. It that for
potentially leaks four bytes kernel stack via the getsockopt() syscall.
Add an explicit memset(0) before filling th... |
local int inflateStateCheck(strm)
z_streamp strm;
{
struct inflate_state FAR *state;
if (strm == Z_NULL ||
strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0)
return 1;
state = (struct inflate_state FAR *)strm->state;
if (state == Z_NULL || state->strm != strm ||
state-... | 0 | [
"CWE-787"
] | zlib | eff308af425b67093bab25f80f1ae950166bece1 | 167,167,981,646,968,210,000,000,000,000,000,000,000 | 13 | Fix a bug when getting a gzip header extra field with inflate().
If the extra field was larger than the space the user provided with
inflateGetHeader(), and if multiple calls of inflate() delivered
the extra header data, then there could be a buffer overflow of the
provided space. This commit assures that provided spa... |
static int ntop_get_interface_hosts(lua_State* vm) {
NetworkInterfaceView *ntop_interface = getCurrentInterface(vm);
ntop->getTrace()->traceEvent(TRACE_INFO, "%s() called", __FUNCTION__);
if(ntop_interface) ntop_interface->getActiveHostsList(vm, get_allowed_nets(vm), false, false);
return(CONST_LUA_OK);
} | 0 | [
"CWE-254"
] | ntopng | 2e0620be3410f5e22c9aa47e261bc5a12be692c6 | 299,528,493,430,015,960,000,000,000,000,000,000,000 | 9 | Added security fix to avoid escalating privileges to non-privileged users
Many thanks to Dolev Farhi for reporting it |
static int l_strton (const TValue *obj, TValue *result) {
lua_assert(obj != result);
if (!cvt2num(obj)) /* is object not a string? */
return 0;
else
return (luaO_str2num(svalue(obj), result) == vslen(obj) + 1);
} | 0 | [
"CWE-416",
"CWE-125",
"CWE-787"
] | lua | eb41999461b6f428186c55abd95f4ce1a76217d5 | 113,139,066,897,983,100,000,000,000,000,000,000,000 | 7 | Fixed bugs of stack reallocation x GC
Macro 'checkstackGC' was doing a GC step after resizing the stack;
the GC could shrink the stack and undo the resize. Moreover, macro
'checkstackp' also does a GC step, which could remove the preallocated
CallInfo when calling a function. (Its name has been changed to
'checkstackG... |
get_property_type (MonoProperty *prop)
{
MonoMethodSignature *sig;
if (prop->get) {
sig = mono_method_signature (prop->get);
return sig->ret;
} else if (prop->set) {
sig = mono_method_signature (prop->set);
return sig->params [sig->param_count - 1];
}
return NULL;
} | 0 | [
"CWE-264"
] | mono | 035c8587c0d8d307e45f1b7171a0d337bb451f1e | 314,931,459,931,505,000,000,000,000,000,000,000,000 | 12 | Allow only primitive types/enums in RuntimeHelpers.InitializeArray (). |
static double mp_complex_div_sv(_cimg_math_parser& mp) {
const double
*ptr2 = &_mp_arg(3) + 1,
r1 = _mp_arg(2),
r2 = *(ptr2++), i2 = *ptr2;
double *ptrd = &_mp_arg(1) + 1;
const double denom = r2*r2 + i2*i2;
*(ptrd++) = r1*r2/denom;
*ptrd = -... | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 320,173,040,611,175,600,000,000,000,000,000,000,000 | 11 | Fix other issues in 'CImg<T>::load_bmp()'. |
inline void Mean(const tflite::MeanParams& op_params,
const RuntimeShape& unextended_input_shape,
const uint8_t* input_data, int32_t input_zero_point,
float input_scale, const RuntimeShape& unextended_output_shape,
uint8_t* output_data, int32_t output_... | 0 | [
"CWE-119",
"CWE-787"
] | tensorflow | 2d88f470dea2671b430884260f3626b1fe99830a | 250,920,911,370,928,680,000,000,000,000,000,000,000 | 58 | [tflite] Ensure `ResolveAxis` properly handles negative inputs.
In Python, a list `l` of length `n` allows indexing with negative indices, `l[i]`. The only constraint is that `n + i` becomes positive. Code in `ResolveAxis` assumes the constraints and only checks it using a `DCHECK`. But the macro is a no-op in non-deb... |
virtual bool check_equality(THD *thd, COND_EQUAL *cond, List<Item> *eq_list)
{
return false;
} | 0 | [
"CWE-617"
] | server | 2e7891080667c59ac80f788eef4d59d447595772 | 120,489,010,089,517,290,000,000,000,000,000,000,000 | 4 | 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.... |
static u8 ncp_reply_byte(struct ncp_server *server, int offset)
{
return *(const u8 *)ncp_reply_data(server, offset);
} | 0 | [
"CWE-119"
] | staging | 4c41aa24baa4ed338241d05494f2c595c885af8f | 335,416,121,209,878,840,000,000,000,000,000,000,000 | 4 | staging: ncpfs: memory corruption in ncp_read_kernel()
If the server is malicious then *bytes_read could be larger than the
size of the "target" buffer. It would lead to memory corruption when we
do the memcpy().
Reported-by: Dr Silvio Cesare of InfoSect <Silvio Cesare <silvio.cesare@gmail.com>
Signed-off-by: Dan Ca... |
Item_func_isnull::remove_eq_conds(THD *thd, Item::cond_result *cond_value,
bool top_level_arg)
{
Item *real_item= args[0]->real_item();
if (real_item->type() == Item::FIELD_ITEM)
{
Field *field= ((Item_field*) real_item)->field;
if ((field->flags & NOT_NULL_FLAG) &&
... | 0 | [] | server | 8c34eab9688b4face54f15f89f5d62bdfd93b8a7 | 295,937,859,885,021,900,000,000,000,000,000,000,000 | 113 | MDEV-28094 Window function in expression in ORDER BY
call item->split_sum_func() in setup_order() just as
it's done in setup_fields() |
static UINT parallel_process_irp_device_control(PARALLEL_DEVICE* parallel, IRP* irp)
{
Stream_Write_UINT32(irp->output, 0); /* OutputBufferLength */
return irp->Complete(irp);
} | 0 | [
"CWE-415",
"CWE-125"
] | FreeRDP | 795842f4096501fcefc1a7f535ccc8132feb31d7 | 50,777,945,177,459,680,000,000,000,000,000,000,000 | 5 | Fixed oob read in parallel_process_irp_create |
u32 gf_isom_has_time_offset(GF_ISOFile *the_file, u32 trackNumber)
{
u32 i;
GF_CompositionOffsetBox *ctts;
GF_TrackBox *trak;
trak = gf_isom_get_track_from_file(the_file, trackNumber);
if (!trak || !trak->Media->information->sampleTable->CompositionOffset) return 0;
//return true at the first offset found
ctts ... | 0 | [
"CWE-476"
] | gpac | ebfa346eff05049718f7b80041093b4c5581c24e | 37,356,608,619,930,220,000,000,000,000,000,000,000 | 15 | fixed #1706 |
*/
int __skb_vlan_pop(struct sk_buff *skb, u16 *vlan_tci)
{
struct vlan_hdr *vhdr;
int offset = skb->data - skb_mac_header(skb);
int err;
if (WARN_ONCE(offset,
"__skb_vlan_pop got skb with skb->data not at mac header (offset %d)\n",
offset)) {
return -EINVAL;
}
err = skb_ensure_writable(skb, ... | 0 | [
"CWE-703",
"CWE-125"
] | linux | 8605330aac5a5785630aec8f64378a54891937cc | 139,870,042,739,154,240,000,000,000,000,000,000,000 | 34 | tcp: fix SCM_TIMESTAMPING_OPT_STATS for normal skbs
__sock_recv_timestamp can be called for both normal skbs (for
receive timestamps) and for skbs on the error queue (for transmit
timestamps).
Commit 1c885808e456
(tcp: SOF_TIMESTAMPING_OPT_STATS option for SO_TIMESTAMPING)
assumes any skb passed to __sock_recv_timest... |
static struct sock *unix_create1(struct net *net, struct socket *sock)
{
struct sock *sk = NULL;
struct unix_sock *u;
atomic_long_inc(&unix_nr_socks);
if (atomic_long_read(&unix_nr_socks) > 2 * get_max_files())
goto out;
sk = sk_alloc(net, PF_UNIX, GFP_KERNEL, &unix_proto);
if (!sk)
goto out;
sock_init_da... | 0 | [
"CWE-287",
"CWE-284"
] | linux | e0e3cea46d31d23dc40df0a49a7a2c04fe8edfea | 11,109,163,929,986,414,000,000,000,000,000,000,000 | 39 | af_netlink: force credentials passing [CVE-2012-3520]
Pablo Neira Ayuso discovered that avahi and
potentially NetworkManager accept spoofed Netlink messages because of a
kernel bug. The kernel passes all-zero SCM_CREDENTIALS ancillary data
to the receiver if the sender did not provide such data, instead of not
includ... |
int cpu_memory_rw_debug(CPUState *cpu, target_ulong addr,
uint8_t *buf, int len, int is_write)
{
int l;
hwaddr phys_addr;
target_ulong page;
while (len > 0) {
page = addr & TARGET_PAGE_MASK;
phys_addr = cpu_get_phys_page_debug(cpu, page);
/* if no physica... | 0 | [] | qemu | c3c1bb99d1c11978d9ce94d1bdcf0705378c1459 | 2,323,417,164,713,099,700,000,000,000,000,000,000 | 28 | exec: Respect as_tranlsate_internal length clamp
address_space_translate_internal will clamp the *plen length argument
based on the size of the memory region being queried. The iommu walker
logic in addresss_space_translate was ignoring this by discarding the
post fn call value of *plen. Fix by just always using *plen... |
CmdRevokeRolesFromRole() : BasicCommand("revokeRolesFromRole") {} | 0 | [
"CWE-613"
] | mongo | e55d6e2292e5dbe2f97153251d8193d1cc89f5d7 | 306,748,539,022,880,560,000,000,000,000,000,000,000 | 1 | SERVER-38984 Validate unique User ID on UserCache hit |
int fpm_log_write(char *log_format) /* {{{ */
{
char *s, *b;
char buffer[FPM_LOG_BUFFER+1];
int token, test;
size_t len, len2;
struct fpm_scoreboard_proc_s proc, *proc_p;
struct fpm_scoreboard_s *scoreboard;
char tmp[129];
char format[129];
time_t now_epoch;
#ifdef HAVE_TIMES
clock_t tms_total;
#endif
if (!... | 0 | [
"CWE-119",
"CWE-125"
] | php-src | 2721a0148649e07ed74468f097a28899741eb58f | 323,371,868,448,719,530,000,000,000,000,000,000,000 | 375 | Fixed bug #70755: fpm_log.c memory leak and buffer overflow |
compile_tree(Node* node, regex_t* reg, ScanEnv* env)
{
int n, len, pos, r = 0;
switch (NODE_TYPE(node)) {
case NODE_LIST:
do {
r = compile_tree(NODE_CAR(node), reg, env);
} while (r == 0 && IS_NOT_NULL(node = NODE_CDR(node)));
break;
case NODE_ALT:
{
Node* x = node;
len = 0;
... | 0 | [
"CWE-476"
] | oniguruma | 410f5916429e7d2920e1d4867388514f605413b8 | 186,765,920,770,349,800,000,000,000,000,000,000,000 | 191 | fix #87: Read unknown address in onig_error_code_to_str() |
struct sk_buff *isdn_ppp_mp_discard(ippp_bundle *mp,
struct sk_buff *from, struct sk_buff *to)
{
if (from)
while (from != to) {
struct sk_buff *next = from->next;
isdn_ppp_mp_free_skb(mp, from);
from = next;
}
return from;
} | 0 | [] | linux | 4ab42d78e37a294ac7bc56901d563c642e03c4ae | 287,145,579,301,191,080,000,000,000,000,000,000,000 | 11 | ppp, slip: Validate VJ compression slot parameters completely
Currently slhc_init() treats out-of-range values of rslots and tslots
as equivalent to 0, except that if tslots is too large it will
dereference a null pointer (CVE-2015-7799).
Add a range-check at the top of the function and make it return an
ERR_PTR() on... |
uint64_t getCurrentTimeInMs() {
return myCurrentTime;
} | 0 | [
"CWE-254",
"CWE-787"
] | bzrtp | bbb1e6e2f467ee4bd7b9a8c800e4f07343d7d99b | 60,781,318,416,403,920,000,000,000,000,000,000,000 | 3 | Add ZRTP Commit packet hvi check on DHPart2 packet reception |
static int ip_mc_leave_src(struct sock *sk, struct ip_mc_socklist *iml,
struct in_device *in_dev)
{
struct ip_sf_socklist *psf = rtnl_dereference(iml->sflist);
int err;
if (psf == NULL) {
/* any-source empty exclude case */
return ip_mc_del_src(in_dev, &iml->multi.imr_multiaddr.s_addr,
iml->sfmode, 0, ... | 0 | [
"CWE-399",
"CWE-703",
"CWE-369"
] | linux | a8c1f65c79cbbb2f7da782d4c9d15639a9b94b27 | 161,170,103,800,183,920,000,000,000,000,000,000,000 | 19 | igmp: Avoid zero delay when receiving odd mixture of IGMP queries
Commit 5b7c84066733c5dfb0e4016d939757b38de189e4 ('ipv4: correct IGMP
behavior on v3 query during v2-compatibility mode') added yet another
case for query parsing, which can result in max_delay = 0. Substitute
a value of 1, as in the usual v3 case.
Rep... |
int base64_decode_block(const char *code_in, int length_in, char *plaintext_out,
struct base64_decodestate *state_in)
{
const char *codec = code_in;
char *plainc = plaintext_out;
signed char fragmt;
*plainc = state_in->plainchar;
switch (state_in->step) {
while (1) {
case step_a:
do {
if (codec ... | 0 | [
"CWE-119",
"CWE-787"
] | frr | ac3133450de12ba86c051265fc0f1b12bc57b40c | 56,963,307,422,543,220,000,000,000,000,000,000,000 | 61 | isisd: fix #10505 using base64 encoding
Using base64 instead of the raw string to encode
the binary data.
Signed-off-by: whichbug <whichbug@github.com> |
memcmp_constant_time (const void *a, const void *b, size_t size) {
const uint8_t * a1 = a;
const uint8_t * b1 = b;
int ret = 0;
size_t i;
for (i = 0; i < size; i++) {
ret |= *a1++ ^ *b1++;
}
return ret;
} | 0 | [
"CWE-200"
] | openvpn | 11d21349a4e7e38a025849479b36ace7c2eec2ee | 249,561,668,823,652,440,000,000,000,000,000,000,000 | 12 | Use constant time memcmp when comparing HMACs in openvpn_decrypt.
Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: Gert Doering <gert@greenie.muc.de> |
void PackLinuxElf32x86::pack1(OutputFile *fo, Filter &ft)
{
super::pack1(fo, ft);
if (0!=xct_off) // shared library
return;
generateElfHdr(fo, stub_i386_linux_elf_fold, getbrk(phdri, e_phnum) );
} | 0 | [
"CWE-476"
] | upx | ef336dbcc6dc8344482f8cf6c909ae96c3286317 | 79,105,605,016,051,910,000,000,000,000,000,000,000 | 7 | Protect against bad crafted input.
https://github.com/upx/upx/issues/128
modified: p_lx_elf.cpp |
void release_mounts(struct list_head *head)
{
struct vfsmount *mnt;
while (!list_empty(head)) {
mnt = list_first_entry(head, struct vfsmount, mnt_hash);
list_del_init(&mnt->mnt_hash);
if (mnt->mnt_parent != mnt) {
struct dentry *dentry;
struct vfsmount *m;
spin_lock(&vfsmount_lock);
dentry = mnt->mn... | 0 | [
"CWE-269"
] | linux-2.6 | ee6f958291e2a768fd727e7a67badfff0b67711a | 338,221,811,697,120,700,000,000,000,000,000,000,000 | 21 | check privileges before setting mount propagation
There's a missing check for CAP_SYS_ADMIN in do_change_type().
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torva... |
int SSL_set_alpn_protos(SSL *ssl, const unsigned char* protos,
unsigned protos_len)
{
if (ssl->alpn_client_proto_list)
OPENSSL_free(ssl->alpn_client_proto_list);
ssl->alpn_client_proto_list = OPENSSL_malloc(protos_len);
if (!ssl->alpn_client_proto_list)
return 1;
memcpy(ssl->alpn_client_proto_list, protos,... | 0 | [
"CWE-310"
] | openssl | cf6da05304d554aaa885151451aa4ecaa977e601 | 311,872,060,259,725,120,000,000,000,000,000,000,000 | 14 | Support TLS_FALLBACK_SCSV.
Reviewed-by: Stephen Henson <steve@openssl.org> |
static inline bool ipv6_addr_equal(const struct in6_addr *a1,
const struct in6_addr *a2)
{
#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64
const unsigned long *ul1 = (const unsigned long *)a1;
const unsigned long *ul2 = (const unsigned long *)a2;
return ((ul1[0] ^ ul2[0]) | (ul1[1]... | 0 | [
"CWE-416",
"CWE-284",
"CWE-264"
] | linux | 45f6fad84cc305103b28d73482b344d7f5b76f39 | 91,772,894,300,645,840,000,000,000,000,000,000,000 | 15 | ipv6: add complete rcu protection around np->opt
This patch addresses multiple problems :
UDP/RAW sendmsg() need to get a stable struct ipv6_txoptions
while socket is not locked : Other threads can change np->opt
concurrently. Dmitry posted a syzkaller
(http://github.com/google/syzkaller) program desmonstrating
use-a... |
static RList *r_bin_wasm_get_sections_by_id (RList *sections, ut8 id) {
RBinWasmSection *sec = NULL;
RList *ret = NULL;
RListIter *iter = NULL;
// memory leak
if (!(ret = r_list_new ())) {
return NULL;
}
r_list_foreach (sections, iter, sec) {
if (sec->id == id) {
r_list_append(ret, sec);
}
}
return ... | 0 | [
"CWE-125",
"CWE-787"
] | radare2 | d2632f6483a3ceb5d8e0a5fb11142c51c43978b4 | 40,830,281,268,206,477,000,000,000,000,000,000,000 | 16 | Fix crash in fuzzed wasm r2_hoobr_consume_init_expr |
GF_Err maxr_Read(GF_Box *s, GF_BitStream *bs)
{
GF_MAXRBox *ptr = (GF_MAXRBox *)s;
if (ptr == NULL) return GF_BAD_PARAM;
ptr->granularity = gf_bs_read_u32(bs);
ptr->maxDataRate = gf_bs_read_u32(bs);
return GF_OK;
} | 0 | [
"CWE-400",
"CWE-401"
] | gpac | d2371b4b204f0a3c0af51ad4e9b491144dd1225c | 275,619,292,124,786,320,000,000,000,000,000,000,000 | 8 | prevent dref memleak on invalid input (#1183) |
FormIndexDatum(IndexInfo *indexInfo,
TupleTableSlot *slot,
EState *estate,
Datum *values,
bool *isnull)
{
ListCell *indexpr_item;
int i;
if (indexInfo->ii_Expressions != NIL &&
indexInfo->ii_ExpressionsState == NIL)
{
/* First time through, set up expression evaluation state */
in... | 0 | [
"CWE-362"
] | postgres | 5f173040e324f6c2eebb90d86cf1b0cdb5890f0a | 179,438,485,914,397,800,000,000,000,000,000,000,000 | 55 | Avoid repeated name lookups during table and index DDL.
If the name lookups come to different conclusions due to concurrent
activity, we might perform some parts of the DDL on a different table
than other parts. At least in the case of CREATE INDEX, this can be
used to cause the permissions checks to be performed aga... |
static void wsrep_prepare_for_autocommit_retry(THD* thd,
char* rawbuf,
uint length,
Parser_state* parser_state)
{
thd->clear_error();
close_thread_tables(thd);
thd->wsrep_re... | 0 | [
"CWE-703"
] | server | 39feab3cd31b5414aa9b428eaba915c251ac34a2 | 161,363,065,774,950,630,000,000,000,000,000,000,000 | 50 | MDEV-26412 Server crash in Item_field::fix_outer_field for INSERT SELECT
IF an INSERT/REPLACE SELECT statement contained an ON expression in the top
level select and this expression used a subquery with a column reference
that could not be resolved then an attempt to resolve this reference as
an outer reference caused... |
static int len_ext_prop(struct usb_configuration *c, int interface)
{
struct usb_function *f;
struct usb_os_desc *d;
int j, res;
res = 10; /* header length */
f = c->interface[interface];
for (j = 0; j < f->os_desc_n; ++j) {
if (interface != f->os_desc_table[j].if_id)
continue;
d = f->os_desc_table[j].os_... | 0 | [
"CWE-476"
] | linux | 75e5b4849b81e19e9efe1654b30d7f3151c33c2c | 310,343,790,028,996,960,000,000,000,000,000,000,000 | 17 | USB: gadget: validate interface OS descriptor requests
Stall the control endpoint in case provided index exceeds array size of
MAX_CONFIG_INTERFACES or when the retrieved function pointer is null.
Signed-off-by: Szymon Heidrich <szymon.heidrich@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregk... |
grub_disk_cache_fetch (unsigned long dev_id, unsigned long disk_id,
grub_disk_addr_t sector)
{
struct grub_disk_cache *cache;
unsigned index;
index = grub_disk_cache_get_index (dev_id, disk_id, sector);
cache = grub_disk_cache_table + index;
if (cache->dev_id == dev_id && cache->disk_id == disk_id
... | 0 | [
"CWE-20",
"CWE-119"
] | radare2 | c57997e76ec70862174a1b3b3aeb62a6f8570e85 | 110,054,100,444,566,730,000,000,000,000,000,000,000 | 25 | Fix r2_hbo_grub_memmove ext2 crash |
SendFileUploadLengthErrMsg(rfbClientPtr cl)
{
FileTransferMsg fileUploadErrMsg;
memset(&fileUploadErrMsg, 0, sizeof(FileTransferMsg));
fileUploadErrMsg = GetFileUploadLengthErrResponseMsg();
if((fileUploadErrMsg.data == NULL) || (fileUploadErrMsg.length == 0)) {
rfbLog("File [%s]: Method [%s]: Unexpected erro... | 0 | [
"CWE-416"
] | libvncserver | ca2a5ac02fbbadd0a21fabba779c1ea69173d10b | 224,358,437,982,560,440,000,000,000,000,000,000,000 | 17 | tightvnc-filetransfer: fix heap use-after-free
One can only guess what the intended semantics were here, but as every
other rfbCloseClient() call in this file is followed by an immediate
return, let's assume this was forgotton in this case.
Anyway, don't forget to clean up to not leak memory.
Closes #241 |
void raw_icmp_error(struct sk_buff *skb, int protocol, u32 info)
{
int hash;
struct sock *raw_sk;
const struct iphdr *iph;
struct net *net;
hash = protocol & (RAW_HTABLE_SIZE - 1);
read_lock(&raw_v4_hashinfo.lock);
raw_sk = sk_head(&raw_v4_hashinfo.ht[hash]);
if (raw_sk) {
int dif = skb->dev->ifindex;
int... | 0 | [
"CWE-362"
] | linux | 8f659a03a0ba9289b9aeb9b4470e6fb263d6f483 | 184,253,157,271,447,530,000,000,000,000,000,000,000 | 28 | net: ipv4: fix for a race condition in raw_sendmsg
inet->hdrincl is racy, and could lead to uninitialized stack pointer
usage, so its value should be read only once.
Fixes: c008ba5bdc9f ("ipv4: Avoid reading user iov twice after raw_probe_proto_opt")
Signed-off-by: Mohamed Ghannam <simo.ghannam@gmail.com>
Reviewed-by... |
mesh_new_callback(struct mesh_area* mesh, struct query_info* qinfo,
uint16_t qflags, struct edns_data* edns, sldns_buffer* buf,
uint16_t qid, mesh_cb_func_type cb, void* cb_arg, int rpz_passthru)
{
struct mesh_state* s = NULL;
int unique = unique_mesh_state(edns->opt_list_in, mesh->env);
int timeout = mesh->env->... | 0 | [
"CWE-613",
"CWE-703"
] | unbound | f6753a0f1018133df552347a199e0362fc1dac68 | 271,542,272,750,374,540,000,000,000,000,000,000,000 | 76 | - Fix the novel ghost domain issues CVE-2022-30698 and CVE-2022-30699. |
void jpc_mqdec_setinput(jpc_mqdec_t *mqdec, jas_stream_t *in)
{
mqdec->in = in;
} | 0 | [
"CWE-189"
] | jasper | 3c55b399c36ef46befcb21e4ebc4799367f89684 | 58,526,306,201,820,330,000,000,000,000,000,000,000 | 4 | 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... |
MagickPrivate void XListBrowserWidget(Display *display,XWindows *windows,
XWindowInfo *window_info,const char *const *list,const char *action,
const char *query,char *reply)
{
#define CancelButtonText "Cancel"
char
primary_selection[MagickPathExtent];
int
x;
int
i;
static MagickStatusType
... | 1 | [] | ImageMagick | caae805079001b97d7f76a9ae6e3d16dbcc306d8 | 257,361,673,270,364,050,000,000,000,000,000,000,000 | 873 | https://github.com/ImageMagick/ImageMagick/issues/3336 |
int gettimeofday(struct timeval *__p, void *__t) {
union {
unsigned long long ns100; /* time since 1 Jan 1601 in 100ns units */
FILETIME ft;
} now;
GetSystemTimeAsFileTime (&now.ft);
__p->tv_usec = (long) ((now.ns100 / 10LL) % SSH_USEC_IN_SEC);
__p->tv_sec = (long)(((now.ns100 / 10LL ) / SSH_USEC_IN... | 0 | [] | libssh | 2ba1dea5493fb2f5a5be2dd263ce46ccb5f8ec76 | 290,148,229,287,158,800,000,000,000,000,000,000,000 | 12 | CVE-2019-14889: misc: Add function to quote file names
The added function quote file names strings to be used in a shell.
Special cases are treated for the charactes '\'' and '!'.
Fixes T181
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry pic... |
static int test_gf2m_modsqrt(void)
{
BIGNUM *a = NULL, *b[2] = {NULL,NULL}, *c = NULL, *d = NULL;
BIGNUM *e = NULL, *f = NULL;
int i, j, st = 0;
if (!TEST_ptr(a = BN_new())
|| !TEST_ptr(b[0] = BN_new())
|| !TEST_ptr(b[1] = BN_new())
|| !TEST_ptr(c = BN_new())
... | 0 | [] | openssl | 3bf7b73ea7123045b8f972badc67ed6878e6c37f | 227,913,909,455,298,570,000,000,000,000,000,000,000 | 44 | Fix a carry overflow bug in bn_sqr_comba4/8 for mips 32-bit targets
bn_sqr_comba8 does for instance compute a wrong result for the value:
a=0x4aaac919 62056c84 fba7334e 1a6be678 022181ba fd3aa878 899b2346 ee210f45
The correct result is:
r=0x15c72e32 605a3061 d11b1012 3c187483 6df96999 bd0c22ba d3e7d437 4724a82f
9... |
add_state_check_num(regex_t* reg, int num)
{
StateCheckNumType n = (StateCheckNumType )num;
BBUF_ADD(reg, &n, SIZE_STATE_CHECK_NUM);
return 0;
} | 0 | [
"CWE-125"
] | php-src | c6e34d91b88638966662caac62c4d0e90538e317 | 313,349,928,805,301,270,000,000,000,000,000,000,000 | 7 | Fix bug #77371 (heap buffer overflow in mb regex functions - compile_string_node) |
f_ch_close(typval_T *argvars, typval_T *rettv UNUSED)
{
channel_T *channel = get_channel_arg(&argvars[0], TRUE, FALSE, 0);
if (channel != NULL)
{
channel_close(channel, FALSE);
channel_clear(channel);
}
} | 0 | [
"CWE-78"
] | vim | 8c62a08faf89663e5633dc5036cd8695c80f1075 | 244,597,640,075,493,860,000,000,000,000,000,000,000 | 10 | patch 8.1.0881: can execute shell commands in rvim through interfaces
Problem: Can execute shell commands in rvim through interfaces.
Solution: Disable using interfaces in restricted mode. Allow for writing
file with writefile(), histadd() and a few others. |
template<typename t, typename tc>
CImg<T>& draw_gaussian(const float xc, const float yc, const CImg<t>& tensor,
const tc *const color, const float opacity=1) {
if (is_empty()) return *this;
if (tensor._width!=2 || tensor._height!=2 || tensor._depth!=1 || tensor._spectrum!=... | 0 | [
"CWE-119",
"CWE-787"
] | CImg | ac8003393569aba51048c9d67e1491559877b1d1 | 108,950,235,670,509,100,000,000,000,000,000,000,000 | 33 | . |
TEST_F(QueryPlannerTest, NToReturnHackWithFindCommand) {
params.options |= QueryPlannerParams::SPLIT_LIMITED_SORT;
runQueryAsCommand(fromjson("{find: 'testns', sort: {a:1}, ntoreturn:3}"));
assertNumSolutions(1U);
assertSolutionExists(
"{ensureSorted: {pattern: {a: 1}, node: "
"{or: {n... | 0 | [] | mongo | ee97c0699fd55b498310996ee002328e533681a3 | 253,569,964,028,455,000,000,000,000,000,000,000,000 | 13 | SERVER-36993 Fix crash due to incorrect $or pushdown for indexed $expr. |
int fgetsgent_sane(FILE *stream, struct sgrp **sg) {
struct sgrp *s;
assert(sg);
assert(stream);
errno = 0;
s = fgetsgent(stream);
if (!s && errno != ENOENT)
return errno_or_else(EIO);
*sg = s;
return !!s;
} | 0 | [
"CWE-269"
] | systemd | 156a5fd297b61bce31630d7a52c15614bf784843 | 188,595,944,615,820,270,000,000,000,000,000,000,000 | 14 | basic/user-util: always use base 10 for user/group numbers
We would parse numbers with base prefixes as user identifiers. For example,
"0x2b3bfa0" would be interpreted as UID==45334432 and "01750" would be
interpreted as UID==1000. This parsing was used also in cases where either a
user/group name or number may be spe... |
ast_for_expr_stmt(struct compiling *c, const node *n)
{
REQ(n, expr_stmt);
/* expr_stmt: testlist_star_expr (annassign | augassign (yield_expr|testlist) |
('=' (yield_expr|testlist_star_expr))*)
annassign: ':' test ['=' test]
testlist_star_expr: (test|star_expr) (',' te... | 1 | [
"CWE-125"
] | cpython | dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c | 68,729,970,484,388,050,000,000,000,000,000,000,000 | 175 | bpo-35766: Merge typed_ast back into CPython (GH-11645) |
p11_index_replace (p11_index *index,
CK_OBJECT_HANDLE handle,
CK_ATTRIBUTE *replace)
{
CK_OBJECT_HANDLE handles[] = { handle, 0 };
return_val_if_fail (index != NULL, CKR_GENERAL_ERROR);
return index_replacev (index, handles, CKA_INVALID,
&replace, replace... | 0 | [
"CWE-190"
] | p11-kit | 5307a1d21a50cacd06f471a873a018d23ba4b963 | 337,504,958,029,334,620,000,000,000,000,000,000,000 | 9 | Check for arithmetic overflows before allocating |
static void convert_fuse_statfs(struct kstatfs *stbuf, struct fuse_kstatfs *attr)
{
stbuf->f_type = FUSE_SUPER_MAGIC;
stbuf->f_bsize = attr->bsize;
stbuf->f_frsize = attr->frsize;
stbuf->f_blocks = attr->blocks;
stbuf->f_bfree = attr->bfree;
stbuf->f_bavail = attr->bavail;
stbuf->f_files = attr->file... | 0 | [
"CWE-459"
] | linux | 5d069dbe8aaf2a197142558b6fb2978189ba3454 | 100,970,405,181,274,000,000,000,000,000,000,000,000 | 13 | 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,... |
dns_zone_getraw(dns_zone_t *zone, dns_zone_t **raw) {
REQUIRE(DNS_ZONE_VALID(zone));
REQUIRE(raw != NULL && *raw == NULL);
LOCK(&zone->lock);
INSIST(zone != zone->raw);
if (zone->raw != NULL)
dns_zone_attach(zone->raw, raw);
UNLOCK(&zone->lock);
} | 0 | [
"CWE-327"
] | bind9 | f09352d20a9d360e50683cd1d2fc52ccedcd77a0 | 55,059,895,352,082,800,000,000,000,000,000,000,000 | 10 | 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. |
static void on_scanner_error(pj_scanner *scanner)
{
PJ_UNUSED_ARG(scanner);
PJ_THROW(SYNTAX_ERROR);
} | 0 | [
"CWE-121",
"CWE-120",
"CWE-787"
] | pjproject | 560a1346f87aabe126509bb24930106dea292b00 | 293,863,545,538,657,600,000,000,000,000,000,000,000 | 6 | Merge pull request from GHSA-f5qg-pqcg-765m |
void AutoParallel::AddSharedNodes(GraphDef* graph) {
string prefix = strings::StrCat(kAutoParallelPrefix, "-Replica-", 0);
for (const auto& node : shared_nodes_) {
auto new_node = graph->add_node();
*new_node = *all_nodes_[node];
for (int i = 0; i < new_node->input_size(); i++) {
if (NotSharedNode... | 0 | [
"CWE-703",
"CWE-908"
] | tensorflow | 68867bf01239d9e1048f98cbad185bf4761bedd3 | 267,219,759,029,852,770,000,000,000,000,000,000,000 | 13 | Prevent unitialized variable use in grappler.
PiperOrigin-RevId: 399702928
Change-Id: Id7e75451fbff297692dfb687f60ea04b25c96b24 |
static void snd_usb_init_substream(struct snd_usb_stream *as,
int stream,
struct audioformat *fp)
{
struct snd_usb_substream *subs = &as->substream[stream];
INIT_LIST_HEAD(&subs->fmt_list);
spin_lock_init(&subs->lock);
subs->stream = as;
subs->direction = stream;
subs->dev = as->chip->dev;
subs->... | 0 | [] | linux | 836b34a935abc91e13e63053d0a83b24dfb5ea78 | 321,727,585,847,603,360,000,000,000,000,000,000,000 | 27 | ALSA: usb-audio: Fix double-free in error paths after snd_usb_add_audio_stream() call
create_fixed_stream_quirk(), snd_usb_parse_audio_interface() and
create_uaxx_quirk() functions allocate the audioformat object by themselves
and free it upon error before returning. However, once the object is linked
to a stream, it'... |
ModuleSilence()
: CTCTags::EventListener(this)
, cmd(this)
{
} | 0 | [
"CWE-416"
] | inspircd | 7b47de3c194f239c5fea09a0e49696c9af017d51 | 195,642,766,904,284,750,000,000,000,000,000,000,000 | 5 | Copy the silence flags when sending update notifications.
This fixes a crash bug in the silence module on some versions of GCC. |
static long sfile_seek(jas_stream_obj_t *obj, long offset, int origin)
{
FILE *fp;
JAS_DBGLOG(100, ("sfile_seek(%p, %ld, %d)\n", obj, offset, origin));
fp = JAS_CAST(FILE *, obj);
return fseek(fp, offset, origin);
} | 0 | [
"CWE-415",
"CWE-190",
"CWE-369"
] | jasper | 634ce8e8a5accc0fa05dd2c20d42b4749d4b2735 | 231,934,280,053,266,970,000,000,000,000,000,000,000 | 7 | Made some changes to the I/O stream library for memory streams.
There were a number of potential problems due to the possibility
of integer overflow.
Changed some integral types to the larger types size_t or ssize_t.
For example, the function mem_resize now takes the buffer size parameter
as a size_t.
Added a new funct... |
uptimeString(u_long timeticks, char *buf, size_t buflen)
{
int centisecs, seconds, minutes, hours, days;
if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_NUMERIC_TIMETICKS)) {
snprintf(buf, buflen, "%lu", timeticks);
return buf;
}
centisecs = timeticks % 10... | 0 | [
"CWE-59",
"CWE-61"
] | net-snmp | 4fd9a450444a434a993bc72f7c3486ccce41f602 | 103,008,074,494,001,910,000,000,000,000,000,000,000 | 38 | CHANGES: snmpd: Stop reading and writing the mib_indexes/* files
Caching directory contents is something the operating system should do
and is not something Net-SNMP should do. Instead of storing a copy of
the directory contents in ${tmp_dir}/mib_indexes/${n}, always scan a
MIB directory. |
static double mp_isinf(_cimg_math_parser& mp) {
return (double)cimg::type<double>::is_inf(_mp_arg(2));
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 194,136,461,183,291,970,000,000,000,000,000,000,000 | 3 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
static int ocfs2_readpages(struct file *filp, struct address_space *mapping,
struct list_head *pages, unsigned nr_pages)
{
int ret, err = -EIO;
struct inode *inode = mapping->host;
struct ocfs2_inode_info *oi = OCFS2_I(inode);
loff_t start;
struct page *last;
/*
* Use the nonblocking flag for the dlm cod... | 0 | [
"CWE-20"
] | linux-2.6 | 272b62c1f0f6f742046e45b50b6fec98860208a0 | 118,018,053,246,936,230,000,000,000,000,000,000,000 | 46 | Treat writes as new when holes span across page boundaries
When a hole spans across page boundaries, the next write forces
a read of the block. This could end up reading existing garbage
data from the disk in ocfs2_map_page_blocks. This leads to
non-zero holes. In order to avoid this, mark the writes as new
when the h... |
static void ide_drive_pio_pre_save(void *opaque)
{
IDEState *s = opaque;
int idx;
s->cur_io_buffer_offset = s->data_ptr - s->io_buffer;
s->cur_io_buffer_len = s->data_end - s->data_ptr;
idx = transfer_end_table_idx(s->end_transfer_func);
if (idx == -1) {
fprintf(stderr, "%s: invalid en... | 0 | [
"CWE-189"
] | qemu | 940973ae0b45c9b6817bab8e4cf4df99a9ef83d7 | 240,633,555,175,810,600,000,000,000,000,000,000,000 | 17 | ide: Correct improper smart self test counter reset in ide core.
The SMART self test counter was incorrectly being reset to zero,
not 1. This had the effect that on every 21st SMART EXECUTE OFFLINE:
* We would write off the beginning of a dynamically allocated buffer
* We forgot the SMART history
Fix this.
Signed-o... |
alloc(size_t size)
{
return lalloc(size, TRUE);
} | 0 | [
"CWE-416"
] | vim | 9f1a39a5d1cd7989ada2d1cb32f97d84360e050f | 8,187,902,246,710,558,000,000,000,000,000,000,000 | 4 | patch 8.2.4040: keeping track of allocated lines is too complicated
Problem: Keeping track of allocated lines in user functions is too
complicated.
Solution: Instead of freeing individual lines keep them all until the end. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.