func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
static gboolean fill_in_context(TGAContext *ctx, GError **err)
{
gboolean alpha;
guint w, h;
g_return_val_if_fail(ctx != NULL, FALSE);
ctx->run_length_encoded =
((ctx->hdr->type == TGA_TYPE_RLE_PSEUDOCOLOR)
|| (ctx->hdr->type == TGA_TYPE_RLE_TRUECOLOR)
|| (ctx->hdr->type == TGA_TYPE_RLE_GRAYSCALE));
... | 0 | [
"CWE-119"
] | gdk-pixbuf | 6ddca835100107e6b5841ce9d56074f6d98c387e | 312,911,705,987,999,750,000,000,000,000,000,000,000 | 56 | io-tga: Colormaps are always present, so always parse them.
We might end up with a colormap with 0 entries, but whatever, it's a
colormap. |
static void nested_release_page(struct page *page)
{
kvm_release_page_dirty(page);
} | 0 | [] | kvm | a642fc305053cc1c6e47e4f4df327895747ab485 | 86,305,638,826,228,920,000,000,000,000,000,000,000 | 4 | kvm: vmx: handle invvpid vm exit gracefully
On systems with invvpid instruction support (corresponding bit in
IA32_VMX_EPT_VPID_CAP MSR is set) guest invocation of invvpid
causes vm exit, which is currently not handled and results in
propagation of unknown exit to userspace.
Fix this by installing an invvpid vm exit ... |
filter_finalize (struct backend *b, struct connection *conn)
{
struct backend_filter *f = container_of (b, struct backend_filter, backend);
void *handle = connection_get_handle (conn, f->backend.i);
struct b_conn nxdata = { .b = f->backend.next, .conn = conn };
debug ("%s: finalize", f->name);
/* Call these... | 0 | [
"CWE-406"
] | nbdkit | bf0d61883a2f02f4388ec10dc92d4c61c093679e | 78,070,877,385,111,590,000,000,000,000,000,000,000 | 17 | server: Fix regression for NBD_OPT_INFO before NBD_OPT_GO
Most known NBD clients do not bother with NBD_OPT_INFO (except for
clients like 'qemu-nbd --list' that don't ever intend to connect), but
go straight to NBD_OPT_GO. However, it's not too hard to hack up qemu
to add in an extra client step (whether info on the ... |
void __dl_add(struct dl_bw *dl_b, u64 tsk_bw)
{
dl_b->total_bw += tsk_bw;
} | 0 | [
"CWE-200"
] | linux | 4efbc454ba68def5ef285b26ebfcfdb605b52755 | 250,036,415,680,839,200,000,000,000,000,000,000,000 | 4 | sched: Fix information leak in sys_sched_getattr()
We're copying the on-stack structure to userspace, but forgot to give
the right number of bytes to copy. This allows the calling process to
obtain up to PAGE_SIZE bytes from the stack (and possibly adjacent
kernel memory).
This fix copies only as much as we actually ... |
only_eq_ref_tables(JOIN *join,ORDER *order,table_map tables)
{
tables&= ~PSEUDO_TABLE_BITS;
for (JOIN_TAB **tab=join->map2table ; tables ; tab++, tables>>=1)
{
if (tables & 1 && !eq_ref_table(join, order, *tab))
return 0;
}
return 1;
} | 0 | [] | server | ff77a09bda884fe6bf3917eb29b9d3a2f53f919b | 301,927,675,129,594,670,000,000,000,000,000,000,000 | 10 | MDEV-22464 Server crash on UPDATE with nested subquery
Uninitialized ref_pointer_array[] because setup_fields() got empty
fields list. mysql_multi_update() for some reason does that by
substituting the fields list with empty total_list for the
mysql_select() call (looks like wrong merge since total_list is not
used a... |
TEST_P(JSITest, JSErrorDoesNotInfinitelyRecurse) {
Value globalError = rt.global().getProperty(rt, "Error");
rt.global().setProperty(rt, "Error", Value::undefined());
try {
rt.global().getPropertyAsFunction(rt, "NotAFunction");
FAIL() << "expected exception";
} catch (const JSError& ex) {
EXPECT_EQ(... | 0 | [
"CWE-843",
"CWE-125"
] | hermes | fe52854cdf6725c2eaa9e125995da76e6ceb27da | 206,918,118,310,145,530,000,000,000,000,000,000,000 | 35 | [CVE-2020-1911] Look up HostObject computed properties on the right object in the prototype chain.
Summary:
The change in the hermes repository fixes the security vulnerability
CVE-2020-1911. This vulnerability only affects applications which
allow evaluation of uncontrolled, untrusted JavaScript code not
shipped wit... |
static int shmem_reserve_inode(struct super_block *sb)
{
struct shmem_sb_info *sbinfo = SHMEM_SB(sb);
if (sbinfo->max_inodes) {
spin_lock(&sbinfo->stat_lock);
if (!sbinfo->free_inodes) {
spin_unlock(&sbinfo->stat_lock);
return -ENOSPC;
}
sbinfo->free_inodes--;
spin_unlock(&sbinfo->stat_lock);
}
retu... | 0 | [
"CWE-400"
] | linux-2.6 | 14fcc23fdc78e9d32372553ccf21758a9bd56fa1 | 114,130,782,469,327,570,000,000,000,000,000,000,000 | 14 | tmpfs: fix kernel BUG in shmem_delete_inode
SuSE's insserve initscript ordering program hits kernel BUG at mm/shmem.c:814
on 2.6.26. It's using posix_fadvise on directories, and the shmem_readpage
method added in 2.6.23 is letting POSIX_FADV_WILLNEED allocate useless pages
to a tmpfs directory, incrementing i_blocks ... |
Error Box_pitm::parse(BitstreamRange& range)
{
parse_full_box_header(range);
if (get_version()==0) {
m_item_ID = range.read16();
}
else {
m_item_ID = range.read32();
}
return range.get_error();
} | 0 | [
"CWE-703"
] | libheif | 2710c930918609caaf0a664e9c7bc3dce05d5b58 | 284,877,512,115,466,200,000,000,000,000,000,000,000 | 13 | force fraction to a limited resolution to finally solve those pesky numerical edge cases |
nautilus_window_delete_event_callback (GtkWidget *widget,
GdkEvent *event,
gpointer user_data)
{
NautilusWindow *window;
window = NAUTILUS_WINDOW (widget);
nautilus_window_close (window);
return TRUE;
} | 0 | [] | nautilus | 1e1c916f5537eb5e4144950f291f4a3962fc2395 | 269,787,174,893,068,600,000,000,000,000,000,000,000 | 11 | Add "interactive" argument to nautilus_file_mark_desktop_file_trusted.
2009-02-24 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-file-operations.c:
* libnautilus-private/nautilus-file-operations.h:
* libnautilus-private/nautilus-mime-actions.c:
Add "interactive" ... |
check_l4_icmp6(const struct conn_key *key, const void *data, size_t size,
const void *l3, bool validate_checksum)
{
return validate_checksum ? checksum_valid(key, data, size, l3) : true;
} | 0 | [
"CWE-400"
] | ovs | 79349cbab0b2a755140eedb91833ad2760520a83 | 47,261,648,847,065,550,000,000,000,000,000,000,000 | 5 | flow: Support extra padding length.
Although not required, padding can be optionally added until
the packet length is MTU bytes. A packet with extra padding
currently fails sanity checks.
Vulnerability: CVE-2020-35498
Fixes: fa8d9001a624 ("miniflow_extract: Properly handle small IP packets.")
Reported-by: Joakim Hind... |
xmlTextReaderHasValue(xmlTextReaderPtr reader) {
xmlNodePtr node;
if (reader == NULL)
return(-1);
if (reader->node == NULL)
return(0);
if (reader->curnode != NULL)
node = reader->curnode;
else
node = reader->node;
switch (node->type) {
case XML_ATTRIBUTE_NODE:
case XML_TEXT_... | 0 | [
"CWE-399"
] | libxml2 | 213f1fe0d76d30eaed6e5853057defc43e6df2c9 | 34,978,687,751,375,500,000,000,000,000,000,000,000 | 24 | CVE-2015-1819 Enforce the reader to run in constant memory
One of the operation on the reader could resolve entities
leading to the classic expansion issue. Make sure the
buffer used for xmlreader operation is bounded.
Introduce a new allocation type for the buffers for this effect. |
GF_Err gp_rtp_builder_do_latm(GP_RTPPacketizer *builder, u8 *data, u32 data_size, u8 IsAUEnd, u32 FullAUSize, u32 duration)
{
u32 size, latm_hdr_size, i, data_offset;
Bool fragmented;
if (!data) {
latm_flush(builder);
return GF_OK;
}
if ((builder->flags & GP_RTP_PCK_USE_MULTI) && builder->max_ptime) {
if (... | 0 | [
"CWE-787"
] | gpac | 1773b7a34bc08734aee7d3f5dfe65d06389fe15a | 202,222,315,128,789,500,000,000,000,000,000,000,000 | 78 | fixed #2173 |
TPM2B_Marshal(TPM2B *source, UINT32 maxSize, BYTE **buffer, INT32 *size)
{
UINT16 written = 0;
assert(source->size <= maxSize); // libtpms added
written += UINT16_Marshal(&(source->size), buffer, size);
written += Array_Marshal(source->buffer, source->size, buffer, size);
return written;
} | 0 | [
"CWE-787"
] | libtpms | 3ef9b26cb9f28bd64d738bff9505a20d4eb56acd | 188,725,907,660,290,440,000,000,000,000,000,000,000 | 8 | tpm2: Add maxSize parameter to TPM2B_Marshal for sanity checks
Add maxSize parameter to TPM2B_Marshal and assert on it checking
the size of the data intended to be marshaled versus the maximum
buffer size.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> |
int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
{
return __bond_release_one(bond_dev, slave_dev, false, false);
} | 0 | [
"CWE-476",
"CWE-703"
] | linux | 105cd17a866017b45f3c45901b394c711c97bf40 | 195,496,474,926,466,900,000,000,000,000,000,000,000 | 4 | bonding: fix null dereference in bond_ipsec_add_sa()
If bond doesn't have real device, bond->curr_active_slave is null.
But bond_ipsec_add_sa() dereferences bond->curr_active_slave without
null checking.
So, null-ptr-deref would occur.
Test commands:
ip link add bond0 type bond
ip link set bond0 up
ip x s... |
SYSCALL_DEFINE1(sigpending, old_sigset_t __user *, set)
{
return do_sigpending(set, sizeof(*set));
} | 0 | [] | linux-2.6 | 0083fc2c50e6c5127c2802ad323adf8143ab7856 | 216,212,929,654,433,560,000,000,000,000,000,000,000 | 4 | do_sigaltstack: avoid copying 'stack_t' as a structure to user space
Ulrich Drepper correctly points out that there is generally padding in
the structure on 64-bit hosts, and that copying the structure from
kernel to user space can leak information from the kernel stack in those
padding bytes.
Avoid the whole issue b... |
void CheckErrorsGPU(OpKernelContext* context, int batch_dim, int seq_dim) {
const Tensor& input = context->input(0);
const Tensor& seq_lengths = context->input(1);
OP_REQUIRES(context, batch_dim != seq_dim,
errors::InvalidArgument("batch_dim == seq_dim == ", seq_dim));
OP_REQUIRES(context, seq_di... | 0 | [
"CWE-120",
"CWE-787"
] | tensorflow | ecf768cbe50cedc0a45ce1ee223146a3d3d26d23 | 300,958,621,409,332,300,000,000,000,000,000,000,000 | 19 | Add missing validations to reverse_sequence_op
PiperOrigin-RevId: 372178683
Change-Id: Iac97ebab5b342f1262c77a7d9bcb4267b305ce5b |
get_word_rgb_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
/* This version is for reading raw-word-format PPM files with any maxval */
{
ppm_source_ptr source = (ppm_source_ptr) sinfo;
register JSAMPROW ptr;
register U_CHAR * bufferptr;
register JSAMPLE *rescale = source->rescale;
JDIMENSION col;
if (... | 0 | [] | libjpeg-turbo | 6709e4a0cfa44d4f54ee8ad05753d4aa9260cb91 | 88,025,233,982,668,500,000,000,000,000,000,000,000 | 27 | Check range of integer values in PPM text file
Add checks to ensure values are within the specified range.
Fixes mozilla/mozjpeg#141, closes #8 |
int qeth_set_access_ctrl_online(struct qeth_card *card, int fallback)
{
int rc = 0;
QETH_CARD_TEXT(card, 4, "setactlo");
if ((card->info.type == QETH_CARD_TYPE_OSD ||
card->info.type == QETH_CARD_TYPE_OSX) &&
qeth_adp_supported(card, IPA_SETADP_SET_ACCESS_CONTROL)) {
rc = qeth_setadpparms_set_access_... | 0 | [
"CWE-200",
"CWE-119"
] | linux | 6fb392b1a63ae36c31f62bc3fc8630b49d602b62 | 314,693,222,642,081,980,000,000,000,000,000,000,000 | 27 | qeth: avoid buffer overflow in snmp ioctl
Check user-defined length in snmp ioctl request and allow request
only if it fits into a qeth command buffer.
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Reviewed-by: Heiko Carstens <heicars2@linux.vnet.ibm.c... |
xmlValidGetElemDecl(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
xmlNodePtr elem, int *extsubset) {
xmlElementPtr elemDecl = NULL;
const xmlChar *prefix = NULL;
if ((ctxt == NULL) || (doc == NULL) ||
(elem == NULL) || (elem->name == NULL))
return(NULL);
if (extsubset != NULL)
*ext... | 0 | [] | libxml2 | 932cc9896ab41475d4aa429c27d9afd175959d74 | 176,967,977,735,174,440,000,000,000,000,000,000,000 | 49 | Fix buffer size checks in xmlSnprintfElementContent
xmlSnprintfElementContent failed to correctly check the available
buffer space in two locations.
Fixes bug 781333 (CVE-2017-9047) and bug 781701 (CVE-2017-9048).
Thanks to Marcel Böhme and Thuan Pham for the report. |
void Compute(OpKernelContext* ctx) override {
const Tensor& in0 = ctx->input(0);
const Tensor& in1 = ctx->input(1);
auto in0_flat = in0.flat<Tin>();
auto in1_flat = in1.flat<Tin>();
const Device& eigen_device = ctx->eigen_device<Device>();
Tensor* out = nullptr;
if (std::is_same<Tin, Tout... | 1 | [
"CWE-476",
"CWE-787"
] | tensorflow | 93f428fd1768df147171ed674fee1fc5ab8309ec | 92,857,430,627,306,040,000,000,000,000,000,000,000 | 18 | Fix nullptr deref and heap OOB access in binary cwise ops.
PiperOrigin-RevId: 387936777
Change-Id: I608b8074cec36a982cca622b7144cb2c43e6e19f |
status_symbol_sets(stream * s, pcl_state_t * pcs, pcl_data_storage_t storage)
{
gs_const_string key;
void *value;
pl_dict_enum_t denum;
ushort *idlist;
int nid;
if (storage == 0)
return 0; /* no "currently selected" symbol set */
/* Note carefully the meaning of this ... | 0 | [
"CWE-787"
] | ghostpdl | e1134d375e2ca176068e19a2aa9b040baffe1c22 | 6,130,916,644,938,920,000,000,000,000,000,000,000 | 53 | Bug 705156(1): Avoid double free of PCL error buffer |
gen_call(codegen_scope *s, node *tree, int val, int safe)
{
mrb_sym sym = nsym(tree->cdr->car);
int skip = 0, n = 0, nk = 0, noop = 0, noself = 0, blk = 0, sp_save = cursp();
if (!tree->car) {
noself = noop = 1;
push();
}
else {
codegen(s, tree->car, VAL); /* receiver */
}
if (safe) {
int... | 0 | [
"CWE-415",
"CWE-122"
] | mruby | 38b164ace7d6ae1c367883a3d67d7f559783faad | 37,161,575,665,247,735,000,000,000,000,000,000,000 | 90 | codegen.c: fix a bug in `gen_values()`.
- Fix limit handling that fails 15 arguments method calls.
- Fix too early argument packing in arrays. |
static int kernel_fs_postparse(struct libmnt_table *tb,
struct libmnt_fs *fs, pid_t *tid,
const char *filename)
{
int rc = 0;
const char *src = mnt_fs_get_srcpath(fs);
/* This is a filesystem description from /proc, so we're in some process
* namespace. Let's remember the process PID.
*/
if... | 0 | [
"CWE-552",
"CWE-703"
] | util-linux | 166e87368ae88bf31112a30e078cceae637f4cdb | 105,216,173,648,595,000,000,000,000,000,000,000,000 | 38 | libmount: remove support for deleted mount table entries
The "(deleted)" suffix has been originally used by kernel for deleted
mountpoints. Since kernel commit 9d4d65748a5ca26ea8650e50ba521295549bf4e3
(Dec 2014) kernel does not use this suffix for mount stuff in /proc at
all. Let's remove this support from libmount to... |
static void vhost_vq_meta_reset(struct vhost_dev *d)
{
int i;
for (i = 0; i < d->nvqs; ++i)
__vhost_vq_meta_reset(d->vqs[i]);
} | 0 | [
"CWE-120"
] | linux | 060423bfdee3f8bc6e2c1bac97de24d5415e2bc4 | 286,127,758,312,134,980,000,000,000,000,000,000,000 | 7 | vhost: make sure log_num < in_num
The code assumes log_num < in_num everywhere, and that is true as long as
in_num is incremented by descriptor iov count, and log_num by 1. However
this breaks if there's a zero sized descriptor.
As a result, if a malicious guest creates a vring desc with desc.len = 0,
it may cause th... |
static int gen_ndis_set_resp(struct rndis_params *params, u32 OID,
u8 *buf, u32 buf_len, rndis_resp_t *r)
{
rndis_set_cmplt_type *resp;
int i, retval = -ENOTSUPP;
if (!r)
return -ENOMEM;
resp = (rndis_set_cmplt_type *)r->buf;
if (!resp)
return -ENOMEM;
if (buf_len && rndis_debug > 1) {
pr_debug("s... | 0 | [
"CWE-200",
"CWE-668"
] | linux | 38ea1eac7d88072bbffb630e2b3db83ca649b826 | 242,923,408,226,609,370,000,000,000,000,000,000,000 | 66 | usb: gadget: rndis: check size of RNDIS_MSG_SET command
Check the size of the RNDIS_MSG_SET command given to us before
attempting to respond to an invalid message size.
Reported-by: Szymon Heidrich <szymon.heidrich@gmail.com>
Cc: stable@kernel.org
Tested-by: Szymon Heidrich <szymon.heidrich@gmail.com>
Signed-off-by: ... |
static inline void *freelist_dereference(const struct kmem_cache *s,
void *ptr_addr)
{
return freelist_ptr(s, (void *)*(unsigned long *)(ptr_addr),
(unsigned long)ptr_addr);
} | 0 | [] | linux | fd4d9c7d0c71866ec0c2825189ebd2ce35bd95b8 | 283,923,555,331,507,500,000,000,000,000,000,000,000 | 6 | mm: slub: add missing TID bump in kmem_cache_alloc_bulk()
When kmem_cache_alloc_bulk() attempts to allocate N objects from a percpu
freelist of length M, and N > M > 0, it will first remove the M elements
from the percpu freelist, then call ___slab_alloc() to allocate the next
element and repopulate the percpu freelis... |
piv_get_serial_nr_from_CHUI(sc_card_t* card, sc_serial_number_t* serial)
{
int r;
int i;
u8 gbits;
u8 *rbuf = NULL;
const u8 *body;
const u8 *fascn;
const u8 *guid;
size_t rbuflen = 0, bodylen, fascnlen, guidlen;
SC_FUNC_CALLED(card->ctx, SC_LOG_DEBUG_VERBOSE);
if (card->serialnr.len) {
*serial = card->s... | 0 | [] | OpenSC | 456ac566938a1da774db06126a2fa6c0cba514b3 | 319,972,172,060,823,760,000,000,000,000,000,000,000 | 67 | PIV Improved parsing of data from the card
Based on Fuzz testing, many of the calls to sc_asn1_find_tag were replaced
with sc_asn1_read_tag. The input is also tested that the
expected tag is the first byte. Additional tests are also add.
sc_asn1_find_tag will skip 0X00 or 0Xff if found. NIST sp800-73-x specs
do not ... |
static bool submodule_is_config_only(
checkout_data *data,
const char *path)
{
git_submodule *sm = NULL;
unsigned int sm_loc = 0;
bool rval = false;
if (git_submodule_lookup(&sm, data->repo, path) < 0)
return true;
if (git_submodule_location(&sm_loc, sm) < 0 ||
sm_loc == GIT_SUBMODULE_STATUS_IN_CONFIG)
r... | 0 | [
"CWE-20",
"CWE-706"
] | libgit2 | 64c612cc3e25eff5fb02c59ef5a66ba7a14751e4 | 280,944,898,689,553,260,000,000,000,000,000,000,000 | 19 | Protect against 8.3 "short name" attacks also on Linux/macOS
The Windows Subsystem for Linux (WSL) is getting increasingly popular,
in particular because it makes it _so_ easy to run Linux software on
Windows' files, via the auto-mounted Windows drives (`C:\` is mapped to
`/mnt/c/`, no need to set that up manually).
... |
xmlCopyAttributeTable(xmlAttributeTablePtr table) {
return((xmlAttributeTablePtr) xmlHashCopy(table,
(xmlHashCopier) xmlCopyAttribute));
} | 0 | [] | libxml2 | 932cc9896ab41475d4aa429c27d9afd175959d74 | 240,198,139,033,584,670,000,000,000,000,000,000,000 | 4 | Fix buffer size checks in xmlSnprintfElementContent
xmlSnprintfElementContent failed to correctly check the available
buffer space in two locations.
Fixes bug 781333 (CVE-2017-9047) and bug 781701 (CVE-2017-9048).
Thanks to Marcel Böhme and Thuan Pham for the report. |
static int bond_set_promiscuity(struct bonding *bond, int inc)
{
int err = 0;
if (USES_PRIMARY(bond->params.mode)) {
/* write lock already acquired */
if (bond->curr_active_slave) {
err = dev_set_promiscuity(bond->curr_active_slave->dev,
inc);
}
} else {
struct slave *slave;
int i;
bond_for_ea... | 0 | [
"CWE-703",
"CWE-264"
] | linux | 550fd08c2cebad61c548def135f67aba284c6162 | 119,548,479,713,213,930,000,000,000,000,000,000,000 | 20 | net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared
After the last patch, We are left in a state in which only drivers calling
ether_setup have IFF_TX_SKB_SHARING set (we assume that drivers touching real
hardware call ether_setup for their net_devices and don't hold any state in
their skbs. There... |
static int write_i2c_mem(struct edgeport_serial *serial,
int start_address, int length, __u8 address_type, __u8 *buffer)
{
struct device *dev = &serial->serial->dev->dev;
int status = 0;
int write_length;
__be16 be_start_address;
/* We can only send a maximum of 1 aligned byte page at a time */
/* calculate t... | 0 | [
"CWE-284",
"CWE-264"
] | linux | 1ee0a224bc9aad1de496c795f96bc6ba2c394811 | 206,321,326,261,602,500,000,000,000,000,000,000,000 | 65 | USB: io_ti: Fix NULL dereference in chase_port()
The tty is NULL when the port is hanging up.
chase_port() needs to check for this.
This patch is intended for stable series.
The behavior was observed and tested in Linux 3.2 and 3.7.1.
Johan Hovold submitted a more elaborate patch for the mainline kernel.
[ 56.277... |
CIFSSMBDelFile(const int xid, struct cifs_tcon *tcon, const char *fileName,
const struct nls_table *nls_codepage, int remap)
{
DELETE_FILE_REQ *pSMB = NULL;
DELETE_FILE_RSP *pSMBr = NULL;
int rc = 0;
int bytes_returned;
int name_len;
DelFileRetry:
rc = smb_init(SMB_COM_DELETE, 1, tcon, (void **) &pSMB,
... | 0 | [
"CWE-362",
"CWE-119",
"CWE-189"
] | linux | 9438fabb73eb48055b58b89fc51e0bc4db22fabd | 158,628,916,127,495,000,000,000,000,000,000,000,000 | 43 | cifs: fix possible memory corruption in CIFSFindNext
The name_len variable in CIFSFindNext is a signed int that gets set to
the resume_name_len in the cifs_search_info. The resume_name_len however
is unsigned and for some infolevels is populated directly from a 32 bit
value sent by the server.
If the server sends a v... |
template<typename tp, typename tf, typename tc, typename to>
CImg<T>& draw_object3d(LibBoard::Board& board,
const float x0, const float y0, const float z0,
const CImg<tp>& vertices, const CImgList<tf>& primitives,
const CImgList<tc... | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 51,255,269,643,583,600,000,000,000,000,000,000,000 | 12 | Fix other issues in 'CImg<T>::load_bmp()'. |
GF_Box *dref_New()
{
ISOM_DECL_BOX_ALLOC(GF_DataReferenceBox, GF_ISOM_BOX_TYPE_DREF);
return (GF_Box *)tmp;
} | 0 | [
"CWE-400",
"CWE-401"
] | gpac | d2371b4b204f0a3c0af51ad4e9b491144dd1225c | 308,355,129,092,768,060,000,000,000,000,000,000,000 | 5 | prevent dref memleak on invalid input (#1183) |
HRESULT Http::HrResponseHeader(const std::string &strHeader, const std::string &strValue)
{
m_lstHeaders.emplace_back(strHeader + ": " + strValue);
return hrSuccess;
} | 0 | [
"CWE-770"
] | kopano-core | 512457466b87039c6a8d25887fdaca6173619546 | 43,027,752,424,028,600,000,000,000,000,000,000,000 | 5 | Set limit on header size to prevent bad alloc
This sets a hard limit of 64 KiB to the header to prevent a memory
allocation exception from being thrown during the parsing of the request
headers. |
static int smack_socket_getpeersec_stream(struct socket *sock,
char __user *optval,
int __user *optlen, unsigned len)
{
struct socket_smack *ssp;
char *rcp = "";
int slen = 1;
int rc = 0;
ssp = sock->sk->sk_security;
if (ssp->smk_packet != NULL) {
rcp = ssp->smk_packet->smk_known;
slen = strlen... | 0 | [
"CWE-416"
] | linux | a3727a8bac0a9e77c70820655fd8715523ba3db7 | 101,180,267,978,386,380,000,000,000,000,000,000,000 | 25 | 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 ... |
evbuffer_copyout(struct evbuffer *buf, void *data_out, size_t datlen)
{
/*XXX fails badly on sendfile case. */
struct evbuffer_chain *chain;
char *data = data_out;
size_t nread;
ev_ssize_t result = 0;
EVBUFFER_LOCK(buf);
chain = buf->first;
if (datlen >= buf->total_len)
datlen = buf->total_len;
if (datle... | 1 | [
"CWE-189"
] | libevent | 20d6d4458bee5d88bda1511c225c25b2d3198d6c | 274,479,594,272,525,850,000,000,000,000,000,000,000 | 44 | Fix CVE-2014-6272 in Libevent 2.0
For this fix, we need to make sure that passing too-large inputs to
the evbuffer functions can't make us do bad things with the heap.
Also, lower the maximum chunk size to the lower of off_t, size_t maximum.
This is necessary since otherwise we could get into an infinite loop
if we ... |
bool is_sameX(const CImg<t>& img) const {
return is_sameX(img._width);
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 288,502,763,769,122,880,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. |
Value ExpressionMeta::evaluate(const Document& root, Variables* variables) const {
const auto& metadata = root.metadata();
switch (_metaType) {
case MetaType::kTextScore:
return metadata.hasTextScore() ? Value(metadata.getTextScore()) : Value();
case MetaType::kRandVal:
r... | 0 | [] | mongo | 1772b9a0393b55e6a280a35e8f0a1f75c014f301 | 171,693,388,921,655,730,000,000,000,000,000,000,000 | 34 | SERVER-49404 Enforce additional checks in $arrayToObject |
GF_Err sdtp_box_read(GF_Box *s, GF_BitStream *bs)
{
GF_SampleDependencyTypeBox *ptr = (GF_SampleDependencyTypeBox*)s;
/*out-of-order sdtp, assume no padding at the end*/
if (!ptr->sampleCount) ptr->sampleCount = (u32) ptr->size;
else if (ptr->sampleCount > (u32) ptr->size) return GF_ISOM_INVALID_FILE;
ptr->samp... | 0 | [
"CWE-787"
] | gpac | 388ecce75d05e11fc8496aa4857b91245007d26e | 1,910,142,274,423,851,800,000,000,000,000,000,000 | 15 | fixed #1587 |
virStoragePoolUpdateInactive(virStoragePoolObj *obj)
{
if (!virStoragePoolObjGetConfigFile(obj)) {
virStoragePoolObjRemove(driver->pools, obj);
} else if (virStoragePoolObjGetNewDef(obj)) {
virStoragePoolObjDefUseNewDef(obj);
}
} | 0 | [] | libvirt | 447f69dec47e1b0bd15ecd7cd49a9fd3b050fb87 | 277,073,791,592,711,350,000,000,000,000,000,000,000 | 8 | storage_driver: Unlock object on ACL fail in storagePoolLookupByTargetPath
'virStoragePoolObjListSearch' returns a locked and refed object, thus we
must release it on ACL permission failure.
Fixes: 7aa0e8c0cb8
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1984318
Signed-off-by: Peter Krempa <pkrempa@redhat.co... |
static void convert_gatt_entry(char *key, char *value, void *user_data)
{
char *src_addr = user_data;
char dst_addr[18];
char type = BDADDR_BREDR;
uint16_t handle;
int ret, err;
char filename[PATH_MAX];
GKeyFile *key_file;
struct stat st;
char group[6];
char *data;
gsize length = 0;
ret = sscanf(key, "%17s... | 0 | [
"CWE-862",
"CWE-863"
] | bluez | b497b5942a8beb8f89ca1c359c54ad67ec843055 | 30,965,899,890,997,810,000,000,000,000,000,000,000 | 46 | 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. |
const char *git_common_path(const char *fmt, ...)
{
struct strbuf *pathname = get_pathname();
va_list args;
va_start(args, fmt);
do_git_common_path(the_repository, pathname, fmt, args);
va_end(args);
return pathname->buf;
} | 0 | [
"CWE-20"
] | git | 7c3745fc6185495d5765628b4dfe1bd2c25a2981 | 96,374,281,443,834,570,000,000,000,000,000,000,000 | 9 | path: safeguard `.git` against NTFS Alternate Streams Accesses
Probably inspired by HFS' resource streams, NTFS supports "Alternate
Data Streams": by appending `:<stream-name>` to the file name,
information in addition to the file contents can be written and read,
information that is copied together with the file (unl... |
template <class MessageType> static MessageType parseYaml(const std::string& yaml) {
MessageType message;
TestUtility::loadFromYaml(yaml, message);
return message;
} | 0 | [] | envoy | 2c60632d41555ec8b3d9ef5246242be637a2db0f | 121,967,418,687,874,580,000,000,000,000,000,000,000 | 5 | http: header map security fixes for duplicate headers (#197)
Previously header matching did not match on all headers for
non-inline headers. This patch changes the default behavior to
always logically match on all headers. Multiple individual
headers will be logically concatenated with ',' similar to what
is done with... |
zfs_ace_v0_set_who(void *acep, uint64_t who)
{
((zfs_oldace_t *)acep)->z_fuid = who;
} | 0 | [
"CWE-200",
"CWE-732"
] | zfs | 716b53d0a14c72bda16c0872565dd1909757e73f | 254,545,848,020,959,560,000,000,000,000,000,000,000 | 4 | FreeBSD: Fix UNIX permissions checking
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Matt Macy <mmacy@FreeBSD.org>
Closes #10727 |
static void scalar_min_max_rsh(struct bpf_reg_state *dst_reg,
struct bpf_reg_state *src_reg)
{
u64 umax_val = src_reg->umax_value;
u64 umin_val = src_reg->umin_value;
/* BPF_RSH is an unsigned shift. If the value in dst_reg might
* be negative, then either:
* 1) src_reg might be zero, so the sign bit... | 0 | [
"CWE-119",
"CWE-681",
"CWE-787"
] | linux | 5b9fbeb75b6a98955f628e205ac26689bcb1383e | 309,296,005,363,090,260,000,000,000,000,000,000,000 | 33 | bpf: Fix scalar32_min_max_or bounds tracking
Simon reported an issue with the current scalar32_min_max_or() implementation.
That is, compared to the other 32 bit subreg tracking functions, the code in
scalar32_min_max_or() stands out that it's using the 64 bit registers instead
of 32 bit ones. This leads to bounds tra... |
get_user_cmd_addr_type(expand_T *xp UNUSED, int idx)
{
return (char_u *)addr_type_complete[idx].name;
} | 0 | [
"CWE-78"
] | vim | 8c62a08faf89663e5633dc5036cd8695c80f1075 | 288,464,087,275,324,740,000,000,000,000,000,000,000 | 4 | 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. |
deallocateRuleNames(RuleName **ruleNames) {
while (*ruleNames) {
struct RuleName *nameRule = *ruleNames;
*ruleNames = nameRule->next;
if (nameRule) free(nameRule);
}
} | 0 | [
"CWE-787"
] | liblouis | fb2bfce4ed49ac4656a8f7e5b5526e4838da1dde | 227,070,780,480,439,900,000,000,000,000,000,000,000 | 7 | Fix yet another buffer overflow in the braille table parser
Reported by Henri Salo
Fixes #592 |
static void fr_timer(unsigned long arg)
{
struct net_device *dev = (struct net_device *)arg;
hdlc_device *hdlc = dev_to_hdlc(dev);
int i, cnt = 0, reliable;
u32 list;
if (state(hdlc)->settings.dce) {
reliable = state(hdlc)->request &&
time_before(jiffies, state(hdlc)->last_poll +
state(hdlc)->setting... | 0 | [
"CWE-703",
"CWE-264"
] | linux | 550fd08c2cebad61c548def135f67aba284c6162 | 49,083,480,791,346,990,000,000,000,000,000,000,000 | 51 | net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared
After the last patch, We are left in a state in which only drivers calling
ether_setup have IFF_TX_SKB_SHARING set (we assume that drivers touching real
hardware call ether_setup for their net_devices and don't hold any state in
their skbs. There... |
static std::string uniqueFilename() {
return absl::StrCat(getpid(), "_", std::chrono::system_clock::now().time_since_epoch().count());
} | 0 | [] | envoy | 2c60632d41555ec8b3d9ef5246242be637a2db0f | 150,776,138,306,795,450,000,000,000,000,000,000,000 | 3 | http: header map security fixes for duplicate headers (#197)
Previously header matching did not match on all headers for
non-inline headers. This patch changes the default behavior to
always logically match on all headers. Multiple individual
headers will be logically concatenated with ',' similar to what
is done with... |
goa_utils_keyfile_set_string (GoaAccount *account, const gchar *key, const gchar *value)
{
GError *error;
GKeyFile *key_file;
gchar *contents;
gchar *group;
gchar *path;
gsize length;
contents = NULL;
path = g_strdup_printf ("%s/goa-1.0/accounts.conf", g_get_user_config_dir ());
group = g_strdup_pri... | 0 | [
"CWE-310"
] | gnome-online-accounts | edde7c63326242a60a075341d3fea0be0bc4d80e | 39,273,342,402,015,486,000,000,000,000,000,000,000 | 48 | Guard against invalid SSL certificates
None of the branded providers (eg., Google, Facebook and Windows Live)
should ever have an invalid certificate. So set "ssl-strict" on the
SoupSession object being used by GoaWebView.
Providers like ownCloud and Exchange might have to deal with
certificates that are not up to th... |
static void sync_regs(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
{
if (kvm_run->kvm_dirty_regs & KVM_SYNC_PREFIX)
kvm_s390_set_prefix(vcpu, kvm_run->s.regs.prefix);
if (kvm_run->kvm_dirty_regs & KVM_SYNC_CRS) {
memcpy(&vcpu->arch.sie_block->gcr, &kvm_run->s.regs.crs, 128);
/* some control register changes ... | 0 | [
"CWE-416"
] | linux | 0774a964ef561b7170d8d1b1bfe6f88002b6d219 | 113,826,733,210,257,200,000,000,000,000,000,000,000 | 48 | KVM: Fix out of range accesses to memslots
Reset the LRU slot if it becomes invalid when deleting a memslot to fix
an out-of-bounds/use-after-free access when searching through memslots.
Explicitly check for there being no used slots in search_memslots(), and
in the caller of s390's approximation variant.
Fixes: 369... |
ext4_ext_put_gap_in_cache(struct inode *inode, struct ext4_ext_path *path,
ext4_lblk_t block)
{
int depth = ext_depth(inode);
unsigned long len;
ext4_lblk_t lblock;
struct ext4_extent *ex;
ex = path[depth].p_ext;
if (ex == NULL) {
/* there is no extent yet, so gap is [0;-] */
lblock = 0;
len = EXT_MAX_... | 0 | [
"CWE-362"
] | linux-2.6 | dee1f973ca341c266229faa5a1a5bb268bed3531 | 10,413,179,263,411,189,000,000,000,000,000,000,000 | 42 | ext4: race-condition protection for ext4_convert_unwritten_extents_endio
We assumed that at the time we call ext4_convert_unwritten_extents_endio()
extent in question is fully inside [map.m_lblk, map->m_len] because
it was already split during submission. But this may not be true due to
a race between writeback vs fa... |
static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
zend_free_op free_op2;
zval *result = &EX_T(opline->result.u.var).tmp_var;
is_identical_function(result,
&opline->op1.u.constant,
_get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TS... | 0 | [] | php-src | ce96fd6b0761d98353761bf78d5bfb55291179fd | 101,204,036,814,013,570,000,000,000,000,000,000,000 | 14 | - 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 |
Status explain(OperationContext* opCtx,
const OpMsgRequest& opMsgRequest,
ExplainOptions::Verbosity verbosity,
BSONObjBuilder* out) const override {
std::string dbname = opMsgRequest.getDatabase().toString();
const BSONObj& cmdObj = opMsgReque... | 0 | [
"CWE-20"
] | mongo | d315547544d7146b93a8e6e94cc4b88cd0d19c95 | 141,695,420,218,398,270,000,000,000,000,000,000,000 | 59 | SERVER-38275 ban explain with UUID |
static int psi_cpu_open(struct inode *inode, struct file *file)
{
return single_open(file, psi_cpu_show, NULL);
} | 0 | [
"CWE-787"
] | linux | 6fcca0fa48118e6d63733eb4644c6cd880c15b8f | 192,035,721,200,892,520,000,000,000,000,000,000,000 | 4 | sched/psi: Fix OOB write when writing 0 bytes to PSI files
Issuing write() with count parameter set to 0 on any file under
/proc/pressure/ will cause an OOB write because of the access to
buf[buf_size-1] when NUL-termination is performed. Fix this by checking
for buf_size to be non-zero.
Signed-off-by: Suren Baghdasa... |
static struct tevent_req *cli_start_connection_send(
TALLOC_CTX *mem_ctx, struct tevent_context *ev,
const char *my_name, const char *dest_host,
const struct sockaddr_storage *dest_ss, int port,
int signing_state, int flags)
{
struct tevent_req *req, *subreq;
struct cli_start_connection_state *state;
req = teve... | 0 | [
"CWE-94"
] | samba | 94295b7aa22d2544af5323bca70d3dcb97fd7c64 | 299,662,986,732,874,400,000,000,000,000,000,000,000 | 32 | CVE-2016-2019: s3:libsmb: add comment regarding smbXcli_session_is_guest() with mandatory signing
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11860
Signed-off-by: Stefan Metzmacher <metze@samba.org> |
static inline struct page *dev_alloc_pages(unsigned int order)
{
return __dev_alloc_pages(GFP_ATOMIC | __GFP_NOWARN, order); | 0 | [
"CWE-20"
] | linux | 2b16f048729bf35e6c28a40cbfad07239f9dcd90 | 221,093,734,179,964,700,000,000,000,000,000,000,000 | 4 | net: create skb_gso_validate_mac_len()
If you take a GSO skb, and split it into packets, will the MAC
length (L2 + L3 + L4 headers + payload) of those packets be small
enough to fit within a given length?
Move skb_gso_mac_seglen() to skbuff.h with other related functions
like skb_gso_network_seglen() so we can use it... |
const Network::Address::InstanceConstSharedPtr& StreamEncoderImpl::connectionLocalAddress() {
return connection_.connection().connectionInfoProvider().localAddress();
} | 0 | [
"CWE-416"
] | envoy | fe7c69c248f4fe5a9080c7ccb35275b5218bb5ab | 256,770,492,876,171,850,000,000,000,000,000,000,000 | 3 | internal redirect: fix a lifetime bug (#785)
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Matt Klein <mklein@lyft.com>
Signed-off-by: Pradeep Rao <pcrao@google.com> |
cleanup_entry(struct ipt_entry *e, struct net *net)
{
struct xt_tgdtor_param par;
struct xt_entry_target *t;
struct xt_entry_match *ematch;
/* Cleanup all matches */
xt_ematch_foreach(ematch, e)
cleanup_match(ematch, net);
t = ipt_get_target(e);
par.net = net;
par.target = t->u.kernel.target;
par.ta... | 0 | [
"CWE-476"
] | linux | 57ebd808a97d7c5b1e1afb937c2db22beba3c1f8 | 108,207,145,033,476,100,000,000,000,000,000,000,000 | 20 | netfilter: add back stackpointer size checks
The rationale for removing the check is only correct for rulesets
generated by ip(6)tables.
In iptables, a jump can only occur to a user-defined chain, i.e.
because we size the stack based on number of user-defined chains we
cannot exceed stack size.
However, the underlyi... |
NTSTATUS check_reduced_name(connection_struct *conn, const char *fname)
{
#ifdef REALPATH_TAKES_NULL
bool free_resolved_name = True;
#else
char resolved_name_buf[PATH_MAX+1];
bool free_resolved_name = False;
#endif
char *resolved_name = NULL;
char *p = NULL;
DEBUG(3,("check_reduced_name [%s] [%s]\n", fnam... | 0 | [
"CWE-22"
] | samba | bd269443e311d96ef495a9db47d1b95eb83bb8f4 | 317,101,059,718,558,770,000,000,000,000,000,000,000 | 174 | Fix bug 7104 - "wide links" and "unix extensions" are incompatible.
Change parameter "wide links" to default to "no".
Ensure "wide links = no" if "unix extensions = yes" on a share.
Fix man pages to refect this.
Remove "within share" checks for a UNIX symlink set - even if
widelinks = no. The server will not follow t... |
static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags,
u32 val, ktime_t *abs_time, u32 bitset,
u32 __user *uaddr2)
{
struct hrtimer_sleeper timeout, *to = NULL;
struct rt_mutex_waiter rt_waiter;
struct rt_mutex *pi_mutex = NULL;
struct futex_hash_bucket *hb;
union futex_key key2 = FUTEX_... | 1 | [
"CWE-264",
"CWE-269"
] | linux | e9c243a5a6de0be8e584c604d353412584b592f8 | 106,533,933,646,444,340,000,000,000,000,000,000,000 | 140 | futex-prevent-requeue-pi-on-same-futex.patch futex: Forbid uaddr == uaddr2 in futex_requeue(..., requeue_pi=1)
If uaddr == uaddr2, then we have broken the rule of only requeueing from
a non-pi futex to a pi futex with this call. If we attempt this, then
dangling pointers may be left for rt_waiter resulting in an expl... |
static void smack_netlbl_delete(struct sock *sk)
{
struct socket_smack *ssp = sk->sk_security;
/*
* Take the label off the socket if one is set.
*/
if (ssp->smk_state != SMK_NETLBL_LABELED)
return;
local_bh_disable();
bh_lock_sock_nested(sk);
netlbl_sock_delattr(sk);
bh_unlock_sock(sk);
local_bh_enable(... | 0 | [
"CWE-416"
] | linux | a3727a8bac0a9e77c70820655fd8715523ba3db7 | 271,268,778,823,411,130,000,000,000,000,000,000,000 | 17 | 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 ... |
isofs_normalize_block_and_offset(struct iso_directory_record* de,
unsigned long *block,
unsigned long *offset)
{
/* Only directories are normalized. */
if (de->flags[0] & 2) {
*offset = 0;
*block = (unsigned long)isonum_733(de->extent)
+ (unsigned long)isonum_711(de->ext_attr_length);
}
} | 0 | [
"CWE-20",
"CWE-399"
] | linux | 410dd3cf4c9b36f27ed4542ee18b1af5e68645a4 | 118,426,852,841,530,150,000,000,000,000,000,000,000 | 11 | 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... |
xmlXPathWrapNodeSet(xmlNodeSetPtr val) {
xmlXPathObjectPtr ret;
ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
if (ret == NULL) {
xmlXPathErrMemory(NULL, "creating node set object\n");
return(NULL);
}
memset(ret, 0 , (size_t) sizeof(xmlXPathObject));
ret->type = XPATH_NOD... | 0 | [
"CWE-119"
] | libxml2 | 91d19754d46acd4a639a8b9e31f50f31c78f8c9c | 140,238,061,778,043,860,000,000,000,000,000,000,000 | 16 | Fix the semantic of XPath axis for namespace/attribute context nodes
The processing of namespace and attributes nodes was not compliant
to the XPath-1.0 specification |
int udp_lib_setsockopt(struct sock *sk, int level, int optname,
char __user *optval, unsigned int optlen,
int (*push_pending_frames)(struct sock *))
{
struct udp_sock *up = udp_sk(sk);
int val;
int err = 0;
int is_udplite = IS_UDPLITE(sk);
if (optlen < sizeof(int))
return -EINVAL;
if (get_us... | 0 | [
"CWE-400"
] | linux-2.6 | c377411f2494a931ff7facdbb3a6839b1266bcf6 | 3,935,477,645,027,546,000,000,000,000,000,000,000 | 80 | net: sk_add_backlog() take rmem_alloc into account
Current socket backlog limit is not enough to really stop DDOS attacks,
because user thread spend many time to process a full backlog each
round, and user might crazy spin on socket lock.
We should add backlog size and receive_queue size (aka rmem_alloc) to
pace writ... |
Item *Natural_join_column::create_item(THD *thd)
{
if (view_field)
{
DBUG_ASSERT(table_field == NULL);
return create_view_field(thd, table_ref, &view_field->item,
view_field->name);
}
return table_field;
} | 0 | [
"CWE-416"
] | server | 4681b6f2d8c82b4ec5cf115e83698251963d80d5 | 283,492,232,423,273,070,000,000,000,000,000,000,000 | 10 | MDEV-26281 ASAN use-after-poison when complex conversion is involved in blob
the bug was that in_vector array in Item_func_in was allocated in the
statement arena, not in the table->expr_arena.
revert part of the 5acd391e8b2d. Instead, change the arena correctly
in fix_all_session_vcol_exprs().
Remove TABLE_ARENA, t... |
__acquires(atalk_interfaces_lock)
{
loff_t l = *pos;
read_lock_bh(&atalk_interfaces_lock);
return l ? atalk_get_interface_idx(--l) : SEQ_START_TOKEN;
} | 0 | [
"CWE-416"
] | linux | 6377f787aeb945cae7abbb6474798de129e1f3ac | 30,317,637,729,963,820,000,000,000,000,000,000,000 | 7 | appletalk: Fix use-after-free in atalk_proc_exit
KASAN report this:
BUG: KASAN: use-after-free in pde_subdir_find+0x12d/0x150 fs/proc/generic.c:71
Read of size 8 at addr ffff8881f41fe5b0 by task syz-executor.0/2806
CPU: 0 PID: 2806 Comm: syz-executor.0 Not tainted 5.0.0-rc7+ #45
Hardware name: QEMU Standard PC (i440... |
int ha_maria::multi_range_read_explain_info(uint mrr_mode, char *str,
size_t size)
{
return ds_mrr.dsmrr_explain_info(mrr_mode, str, size);
} | 0 | [
"CWE-400"
] | server | 9e39d0ae44595dbd1570805d97c9c874778a6be8 | 40,091,037,231,571,527,000,000,000,000,000,000,000 | 5 | MDEV-25787 Bug report: crash on SELECT DISTINCT thousands_blob_fields
fix a debug assert to account for not opened temp tables |
static void process_timer_rebalance(struct task_struct *p,
unsigned int clock_idx,
union cpu_time_count expires,
union cpu_time_count val)
{
cputime_t ticks, left;
unsigned long long ns, nsleft;
struct task_struct *t = p;
unsigned int nthreads = atomic_read(&p->signal->live);
if (!nthread... | 0 | [
"CWE-189"
] | linux | f8bd2258e2d520dff28c855658bd24bdafb5102d | 179,609,577,436,319,460,000,000,000,000,000,000,000 | 64 | remove div_long_long_rem
x86 is the only arch right now, which provides an optimized for
div_long_long_rem and it has the downside that one has to be very careful that
the divide doesn't overflow.
The API is a little akward, as the arguments for the unsigned divide are
signed. The signed version also doesn't handle ... |
static void usb_mask_to_str(char *dest, size_t size,
unsigned int speedmask)
{
static const struct {
unsigned int mask;
const char *name;
} speeds[] = {
{ .mask = USB_SPEED_MASK_FULL, .name = "full" },
{ .mask = USB_SPEED_MASK_HIGH, .name = "high" ... | 0 | [
"CWE-119"
] | qemu | 9f8e9895c504149d7048e9fc5eb5cbb34b16e49a | 238,215,392,565,824,300,000,000,000,000,000,000,000 | 21 | usb: sanity check setup_index+setup_len in post_load
CVE-2013-4541
s->setup_len and s->setup_index are fed into usb_packet_copy as
size/offset into s->data_buf, it's possible for invalid state to exploit
this to load arbitrary data.
setup_len and setup_index should be checked to make sure
they are not negative.
Cc:... |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
auto* params =
reinterpret_cast<TfLiteConcatenationParams*>(node->builtin_data);
int axis = params->axis;
TfLiteTensor* output;
TF_LITE_ENSURE_OK(context, GetOutputSafe(context, node, 0, &output));
if (axis < 0) axis += output->dims->size;
/... | 0 | [
"CWE-476",
"CWE-190"
] | tensorflow | 4253f96a58486ffe84b61c0415bb234a4632ee73 | 28,666,720,540,575,463,000,000,000,000,000,000,000 | 83 | Fix integer overflow in TFLite concat
PiperOrigin-RevId: 371013841
Change-Id: I6a4782ce7ca753e23ff31e7fb6aeb7f9d412cd29 |
static CubeInfo *ClassifyImageColors(const Image *image,
ExceptionInfo *exception)
{
#define EvaluateImageTag " Compute image colors... "
CacheView
*image_view;
CubeInfo
*cube_info;
MagickBooleanType
proceed;
PixelInfo
pixel;
NodeInfo
*node_info;
register const Quantum
*p;... | 0 | [
"CWE-190"
] | ImageMagick | 94691f00839dbdf43edb1508af945ab19b388573 | 156,706,410,097,883,930,000,000,000,000,000,000,000 | 129 | https://github.com/ImageMagick/ImageMagick/issues/1750 |
static void header(RzBinFile *bf) {
rz_return_if_fail(bf && bf->o && bf->rbin);
QnxObj *bin = bf->o->bin_obj;
RzBin *rbin = bf->rbin;
rbin->cb_printf("QNX file header:\n");
rbin->cb_printf("version : 0x%xH\n", bin->lmfh.version);
rbin->cb_printf("cflags : 0x%xH\n", bin->lmfh.cflags);
rbin->cb_printf("cpu : 0x%xH... | 0 | [
"CWE-415"
] | rizin | 58926dffbe819fe9ebf5062f7130e026351cae01 | 227,262,937,938,671,900,000,000,000,000,000,000,000 | 20 | fix #2964 - double-free in bin_qnx.c |
static uint32_t __inline read_code (Bitstream *bs, uint32_t maxcode)
{
unsigned long local_sr;
uint32_t extras, code;
int bitcount;
if (maxcode < 2)
return maxcode ? getbit (bs) : 0;
bitcount = count_bits (maxcode);
#ifdef USE_BITMASK_TABLES
extras = bitset [bitcount] - maxcode - 1;
#e... | 0 | [
"CWE-125"
] | WavPack | 4bc05fc490b66ef2d45b1de26abf1455b486b0dc | 126,661,231,810,874,310,000,000,000,000,000,000,000 | 46 | fixes for 4 fuzz failures posted to SourceForge mailing list |
get_user_display_name (void)
{
const char *name;
char *utf8_name;
name = g_get_real_name ();
if (name == NULL || strcmp (name, "Unknown") == 0) {
name = g_get_user_name ();
}
utf8_name = NULL;
if (name != NULL) {
utf8_name... | 0 | [
"CWE-284"
] | cinnamon-screensaver | da7af55f1fa966c52e15cc288d4f8928eca8cc9f | 285,131,697,360,817,920,000,000,000,000,000,000,000 | 19 | Workaround gtk3 bug, don't allow GtkWindow to handle popup_menu. |
static void prvHeapInit( void ) /* PRIVILEGED_FUNCTION */
{
BlockLink_t * pxFirstFreeBlock;
uint8_t * pucAlignedHeap;
size_t uxAddress;
size_t xTotalHeapSize = configTOTAL_HEAP_SIZE;
/* Ensure the heap starts on a correctly aligned boundary. */
uxAddress = ( size_t ) ucHeap;
if( ... | 0 | [
"CWE-200",
"CWE-119"
] | FreeRTOS-Kernel | c7a9a01c94987082b223d3e59969ede64363da63 | 247,400,942,184,196,600,000,000,000,000,000,000,000 | 46 | Improve heap2 bounds checking (#224)
* Improve heap bounds checking in pvPortMalloc |
void safe_connect(MYSQL* mysql, const char *name, const char *host,
const char *user, const char *pass, const char *db,
int port, const char *sock)
{
int failed_attempts= 0;
DBUG_ENTER("safe_connect");
verbose_msg("Connecting to server %s:%d (socket %s) as '%s'"
... | 1 | [
"CWE-319"
] | mysql-server | 060b1eadf4913f7066484ea34ec62feead1bca44 | 232,493,163,241,115,570,000,000,000,000,000,000,000 | 46 | BUG#25575605: SETTING --SSL-MODE=REQUIRED SENDS CREDENTIALS BEFORE VERIFYING SSL CONNECTION
MYSQL_OPT_SSL_MODE option introduced.
It is set in case of --ssl-mode=REQUIRED and permits only SSL connection.
(cherry picked from commit 3b2d28578c526f347f5cfe763681eff365731f99) |
static int cdrom_select_disc(struct cdrom_device_info *cdi, int slot)
{
struct cdrom_changer_info *info;
int curslot;
int ret;
cd_dbg(CD_CHANGER, "entering cdrom_select_disc()\n");
if (!CDROM_CAN(CDC_SELECT_DISC))
return -EDRIVE_CANT_DO_THIS;
if (cdi->ops->check_events)
cdi->ops->check_events(cdi, 0, slot);... | 0 | [
"CWE-119",
"CWE-787"
] | linux | 9de4ee40547fd315d4a0ed1dd15a2fa3559ad707 | 81,566,313,784,119,440,000,000,000,000,000,000,000 | 56 | cdrom: information leak in cdrom_ioctl_media_changed()
This cast is wrong. "cdi->capacity" is an int and "arg" is an unsigned
long. The way the check is written now, if one of the high 32 bits is
set then we could read outside the info->slots[] array.
This bug is pretty old and it predates git.
Reviewed-by: Christ... |
static Image *ReadDOTImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
char
command[MaxTextExtent];
const char
*option;
graph_t
*graph;
Image
*image;
ImageInfo
*read_info;
MagickBooleanType
status;
/*
Open image file.
*/
assert(image_info != (const ImageIn... | 1 | [
"CWE-401"
] | ImageMagick6 | 6954a3f7f1bf1dad417260c5965f2c30a64fa25e | 228,211,555,435,365,430,000,000,000,000,000,000,000 | 73 | Fixed memory leak reported in #1558 and fixed other leak. |
static Value performCastDoubleToInt(ExpressionContext* const expCtx, Value inputValue) {
double inputDouble = inputValue.getDouble();
validateDoubleValueIsFinite(inputDouble);
uassert(ErrorCodes::ConversionFailure,
str::stream()
<< "Conversion would overf... | 0 | [] | mongo | 1772b9a0393b55e6a280a35e8f0a1f75c014f301 | 180,841,116,912,812,350,000,000,000,000,000,000,000 | 13 | SERVER-49404 Enforce additional checks in $arrayToObject |
Status BatchMatMulV2Shape(shape_inference::InferenceContext* c) {
ShapeHandle a_shape;
ShapeHandle b_shape;
TF_RETURN_IF_ERROR(c->WithRankAtLeast(c->input(0), 2, &a_shape));
TF_RETURN_IF_ERROR(c->WithRankAtLeast(c->input(1), 2, &b_shape));
// Determine output rows and columns.
bool adj_x;
bool adj_y;
T... | 0 | [
"CWE-369"
] | tensorflow | 8a793b5d7f59e37ac7f3cd0954a750a2fe76bad4 | 247,439,804,485,626,900,000,000,000,000,000,000,000 | 36 | Prevent division by 0 in common shape functions.
PiperOrigin-RevId: 387712197
Change-Id: Id25c7460e35b68aeeeac23b9a88e455b443ee149 |
static inline int nla_put_string(struct sk_buff *skb, int attrtype,
const char *str)
{
return nla_put(skb, attrtype, strlen(str) + 1, str);
} | 0 | [] | linux-2.6 | 1045b03e07d85f3545118510a587035536030c1c | 236,261,384,462,471,400,000,000,000,000,000,000,000 | 5 | 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... |
PHPAPI zend_class_entry *php_date_get_immutable_ce(void)
{
return date_ce_immutable;
} | 0 | [] | php-src | c377f1a715476934133f3254d1e0d4bf3743e2d2 | 54,955,512,456,898,150,000,000,000,000,000,000,000 | 4 | Fix bug #68942 (Use after free vulnerability in unserialize() with DateTimeZone) |
TfLiteStatus AverageEvalQuantizedUint8(TfLiteContext* context, TfLiteNode* node,
TfLitePoolParams* params, OpData* data,
const TfLiteTensor* input,
TfLiteTensor* output) {
int32_t activation_min;
int... | 0 | [
"CWE-703",
"CWE-835"
] | tensorflow | dfa22b348b70bb89d6d6ec0ff53973bacb4f4695 | 106,998,216,051,978,500,000,000,000,000,000,000,000 | 30 | Prevent a division by 0 in average ops.
PiperOrigin-RevId: 385184660
Change-Id: I7affd4554f9b336fca29ac68f633232c094d0bd3 |
bool ldb_dn_has_extended(struct ldb_dn *dn)
{
if ( ! dn || dn->invalid) return false;
if (dn->ext_linearized && (dn->ext_linearized[0] == '<')) return true;
return dn->ext_comp_num != 0;
} | 0 | [
"CWE-200"
] | samba | 7f51ec8c4ed9ba1f53d722e44fb6fb3cde933b72 | 268,970,621,394,916,850,000,000,000,000,000,000,000 | 6 | CVE-2015-5330: ldb_dn: simplify and fix ldb_dn_escape_internal()
Previously we relied on NUL terminated strings and jumped back and
forth between copying escaped bytes and memcpy()ing un-escaped chunks.
This simple version is easier to reason about and works with
unterminated strings. It may also be faster as it avoid... |
static void FVMenuAnchorPairs(GWindow gw, struct gmenuitem *mi, GEvent *UNUSED(e)) {
FontView *fv = (FontView *) GDrawGetUserData(gw);
SFShowKernPairs(fv->b.sf,NULL,mi->ti.userdata,fv->b.active_layer);
} | 0 | [
"CWE-119",
"CWE-787"
] | fontforge | 626f751752875a0ddd74b9e217b6f4828713573c | 63,313,218,510,609,745,000,000,000,000,000,000,000 | 4 | Warn users before discarding their unsaved scripts (#3852)
* Warn users before discarding their unsaved scripts
This closes #3846. |
ssize_t qemu_net_queue_receive_iov(NetQueue *queue,
const struct iovec *iov,
int iovcnt)
{
if (queue->delivering) {
return 0;
}
return qemu_net_queue_deliver_iov(queue, NULL, 0, iov, iovcnt);
} | 0 | [
"CWE-835"
] | qemu | 705df5466c98f3efdd2b68d3b31dad86858acad7 | 86,552,516,506,287,010,000,000,000,000,000,000,000 | 10 | net: introduce qemu_receive_packet()
Some NIC supports loopback mode and this is done by calling
nc->info->receive() directly which in fact suppresses the effort of
reentrancy check that is done in qemu_net_queue_send().
Unfortunately we can't use qemu_net_queue_send() here since for
loopback there's no sender as pee... |
static int tw5864_g_reg(struct file *file, void *fh,
struct v4l2_dbg_register *reg)
{
struct tw5864_input *input = video_drvdata(file);
struct tw5864_dev *dev = input->root;
if (reg->reg < INDIR_SPACE_MAP_SHIFT) {
if (reg->reg > 0x87fff)
return -EINVAL;
reg->size = 4;
reg->val = tw_readl(reg->reg);
} e... | 0 | [
"CWE-476"
] | linux | 2e7682ebfc750177a4944eeb56e97a3f05734528 | 7,111,154,893,728,810,000,000,000,000,000,000,000 | 21 | media: tw5864: Fix possible NULL pointer dereference in tw5864_handle_frame
'vb' null check should be done before dereferencing it in
tw5864_handle_frame, otherwise a NULL pointer dereference
may occur.
Fixes: 34d1324edd31 ("[media] pci: Add tw5864 driver")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-of... |
vhost_user_iotlb_miss(struct virtio_net *dev, uint64_t iova, uint8_t perm)
{
int ret;
struct VhostUserMsg msg = {
.request.slave = VHOST_USER_SLAVE_IOTLB_MSG,
.flags = VHOST_USER_VERSION,
.size = sizeof(msg.payload.iotlb),
.payload.iotlb = {
.iova = iova,
.perm = perm,
.type = VHOST_IOTLB_MISS,
},
... | 0 | [
"CWE-190"
] | dpdk | 3ae4beb079ce242240c34376a066bbccd0c0b23e | 59,283,645,175,685,250,000,000,000,000,000,000,000 | 24 | vhost: check log mmap offset and size overflow
vhost_user_set_log_base() is a message handler that is
called to handle the VHOST_USER_SET_LOG_BASE message.
Its payload contains a 64 bit size and offset. Both are
added up and used as a size when calling mmap().
There is no integer overflow check. If an integer overflo... |
write_unicode_binary(PicklerObject *self, PyObject *obj)
{
char header[9];
Py_ssize_t len;
PyObject *encoded = NULL;
Py_ssize_t size;
const char *data;
if (PyUnicode_READY(obj))
return -1;
data = PyUnicode_AsUTF8AndSize(obj, &size);
if (data == NULL) {
/* Issue #8383: f... | 0 | [
"CWE-190",
"CWE-369"
] | cpython | a4ae828ee416a66d8c7bf5ee71d653c2cc6a26dd | 66,275,260,848,691,000,000,000,000,000,000,000,000 | 57 | closes bpo-34656: Avoid relying on signed overflow in _pickle memos. (GH-9261) |
TEST_F(HcmUtilityTest, EnsureCreateSingletonsActuallyReturnsTheSameInstances) {
// Simulate `HttpConnectionManagerFilterConfigFactory::createFilterFactoryFromProtoTyped()`
// call for filter instance "one".
auto singletons_one = Utility::createSingletons(context_one_);
EXPECT_THAT(singletons_one.date_provider_... | 0 | [
"CWE-22"
] | envoy | 5333b928d8bcffa26ab19bf018369a835f697585 | 28,338,217,675,916,350,000,000,000,000,000,000,000 | 22 | Implement handling of escaped slash characters in URL path
Fixes: CVE-2021-29492
Signed-off-by: Yan Avlasov <yavlasov@google.com> |
static int l2cap_resegment(struct l2cap_chan *chan)
{
/* Placeholder */
return 0;
} | 0 | [
"CWE-787"
] | linux | e860d2c904d1a9f38a24eb44c9f34b8f915a6ea3 | 256,753,997,747,227,970,000,000,000,000,000,000,000 | 5 | Bluetooth: Properly check L2CAP config option output buffer length
Validate the output buffer length for L2CAP config requests and responses
to avoid overflowing the stack buffer used for building the option blocks.
Cc: stable@vger.kernel.org
Signed-off-by: Ben Seri <ben@armis.com>
Signed-off-by: Marcel Holtmann <mar... |
ecma_date_day_from_year (int32_t year) /**< year value */
{
if (JERRY_LIKELY (year >= 1970))
{
return (int32_t) (365 * (year - 1970)
+ ((year - 1969) / 4)
- ((year - 1901) / 100)
+ ((year - 1601) / 400));
}
return (int32_t) (365 * (year - 19... | 0 | [
"CWE-416"
] | jerryscript | 3bcd48f72d4af01d1304b754ef19fe1a02c96049 | 317,879,367,218,869,930,000,000,000,000,000,000,000 | 15 | Improve parse_identifier (#4691)
Ascii string length is no longer computed during string allocation.
JerryScript-DCO-1.0-Signed-off-by: Daniel Batiz batizjob@gmail.com |
njs_typed_array_get_string_tag(njs_vm_t *vm, njs_value_t *args,
njs_uint_t nargs, njs_index_t unused)
{
njs_value_t *this;
static const njs_value_t *tags[NJS_OBJ_TYPE_TYPED_ARRAY_SIZE] = {
&njs_typed_array_uint8_tag,
&njs_typed_array_uint8_clamped_tag,
&njs_typed_array_int8_tag,
... | 0 | [
"CWE-703"
] | njs | 5c6130a2a0b4c41ab415f6b8992aa323636338b9 | 59,510,370,091,833,570,000,000,000,000,000,000,000 | 28 | Fixed Array.prototype.fill() for typed-arrays.
This closes #478 issue on Github. |
void fxInt32Getter(txMachine* the, txSlot* data, txInteger offset, txSlot* slot, int endian)
{
txS4 value;
slot->kind = XS_INTEGER_KIND;
#ifdef mxMisalignedSettersCrash
value = c_read32(data->value.arrayBuffer.address + offset);
#else
value = *((txS4*)(data->value.arrayBuffer.address + offset));
#endif
slot->value... | 0 | [
"CWE-125"
] | moddable | 135aa9a4a6a9b49b60aa730ebc3bcc6247d75c45 | 34,620,930,496,419,674,000,000,000,000,000,000,000 | 12 | XS: #896 |
ar6000_bitrate_rx(void *devt, s32 rateKbps)
{
struct ar6_softc *ar = (struct ar6_softc *)devt;
ar->arBitRate = rateKbps;
wake_up(&arEvent);
} | 0 | [
"CWE-703",
"CWE-264"
] | linux | 550fd08c2cebad61c548def135f67aba284c6162 | 269,527,181,827,609,750,000,000,000,000,000,000,000 | 7 | 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... |
uc_scan_attr(
char_u *attr,
size_t len,
long *argt,
long *def,
int *flags,
int *compl,
char_u **compl_arg,
int *addr_type_arg)
{
char_u *p;
if (len == 0)
{
emsg(_("E175: No attribute specified"));
return FAIL;
}
/* First, try the simple attributes (no arguments... | 0 | [
"CWE-78"
] | vim | 8c62a08faf89663e5633dc5036cd8695c80f1075 | 239,894,082,717,872,280,000,000,000,000,000,000,000 | 153 | 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. |
static const char* secondary_order_string(UINT32 orderType)
{
const char* orders[] = { "[0x%02" PRIx8 "] Cache Bitmap",
"[0x%02" PRIx8 "] Cache Color Table",
"[0x%02" PRIx8 "] Cache Bitmap (Compressed)",
"[0x%02" PRIx8 "] Cache Glyph",
... | 0 | [
"CWE-415"
] | FreeRDP | 67c2aa52b2ae0341d469071d1bc8aab91f8d2ed8 | 217,056,525,455,301,200,000,000,000,000,000,000,000 | 20 | Fixed #6013: Check new length is > 0 |
static void bnx2x_get_common_hwinfo(struct bnx2x *bp)
{
u32 val, val2, val3, val4, id, boot_mode;
u16 pmc;
/* Get the chip revision id and number. */
/* chip num:16-31, rev:12-15, metal:4-11, bond_id:0-3 */
val = REG_RD(bp, MISC_REG_CHIP_NUM);
id = ((val & 0xffff) << 16);
val = REG_RD(bp, MISC_REG_CHIP_REV);
i... | 0 | [
"CWE-20"
] | linux | 8914a595110a6eca69a5e275b323f5d09e18f4f9 | 7,389,824,083,223,692,000,000,000,000,000,000,000 | 185 | bnx2x: disable GSO where gso_size is too big for hardware
If a bnx2x card is passed a GSO packet with a gso_size larger than
~9700 bytes, it will cause a firmware error that will bring the card
down:
bnx2x: [bnx2x_attn_int_deasserted3:4323(enP24p1s0f0)]MC assert!
bnx2x: [bnx2x_mc_assert:720(enP24p1s0f0)]XSTORM_ASSERT... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.