func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
int copy_mount_options(const void __user * data, unsigned long *where)
{
int i;
unsigned long page;
unsigned long size;
*where = 0;
if (!data)
return 0;
if (!(page = __get_free_page(GFP_KERNEL)))
return -ENOMEM;
/* We only care that *some* data at the address the user
* gave us is valid. Just in case, ... | 0 | [
"CWE-269"
] | linux-2.6 | ee6f958291e2a768fd727e7a67badfff0b67711a | 91,332,603,080,480,560,000,000,000,000,000,000,000 | 32 | 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... |
static inline bool ipv6_prefix_equal(const struct in6_addr *addr1,
const struct in6_addr *addr2,
unsigned int prefixlen)
{
const __be32 *a1 = addr1->s6_addr32;
const __be32 *a2 = addr2->s6_addr32;
unsigned int pdw, pbi;
/* check complete u32 in prefix */
pdw = prefixlen >> 5;
if (pdw && memcmp(... | 0 | [
"CWE-416",
"CWE-284",
"CWE-264"
] | linux | 45f6fad84cc305103b28d73482b344d7f5b76f39 | 225,355,367,500,754,850,000,000,000,000,000,000,000 | 20 | 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... |
R_API ut32 U(r_bin_java_swap_uint)(ut32 x) {
const ut32 Byte0 = x & 0x000000FF;
const ut32 Byte1 = x & 0x0000FF00;
const ut32 Byte2 = x & 0x00FF0000;
const ut32 Byte3 = x & 0xFF000000;
return (Byte0 << 24) | (Byte1 << 8) | (Byte2 >> 8) | (Byte3 >> 24);
} | 0 | [
"CWE-119",
"CWE-788"
] | radare2 | 6c4428f018d385fc80a33ecddcb37becea685dd5 | 174,313,683,199,790,130,000,000,000,000,000,000,000 | 7 | Improve boundary checks to fix oobread segfaults ##crash
* Reported by Cen Zhang via huntr.dev
* Reproducer: bins/fuzzed/javaoob-havoc.class |
GF_Err url_box_read(GF_Box *s, GF_BitStream *bs)
{
GF_DataEntryURLBox *ptr = (GF_DataEntryURLBox *)s;
if (ptr->size) {
ptr->location = (char*)gf_malloc((u32) ptr->size);
if (! ptr->location) return GF_OUT_OF_MEM;
gf_bs_read_data(bs, ptr->location, (u32)ptr->size);
}
return GF_OK;
} | 1 | [
"CWE-787"
] | gpac | 388ecce75d05e11fc8496aa4857b91245007d26e | 113,561,327,000,945,940,000,000,000,000,000,000,000 | 11 | fixed #1587 |
pshash_delindex (psi)
ps_index_t psi;
{
struct pidstat *ps;
ps = &bgpids.storage[psi];
if (ps->pid == NO_PID)
return;
if (ps->bucket_next != NO_PID)
bgpids.storage[ps->bucket_next].bucket_prev = ps->bucket_prev;
if (ps->bucket_prev != NO_PID)
bgpids.storage[ps->bucket_prev].bucket_next = ps... | 0 | [] | bash | 955543877583837c85470f7fb8a97b7aa8d45e6c | 84,577,887,630,966,700,000,000,000,000,000,000,000 | 16 | bash-4.4-rc2 release |
void finish(int) override {
pg->agent_choose_mode_restart();
} | 0 | [
"CWE-287",
"CWE-284"
] | ceph | 5ead97120e07054d80623dada90a5cc764c28468 | 268,463,337,409,787,740,000,000,000,000,000,000,000 | 3 | auth/cephx: add authorizer challenge
Allow the accepting side of a connection to reject an initial authorizer
with a random challenge. The connecting side then has to respond with an
updated authorizer proving they are able to decrypt the service's challenge
and that the new authorizer was produced for this specific ... |
tuplesort_set_bound(Tuplesortstate *state, int64 bound)
{
/* Assert we're called before loading any tuples */
Assert(state->status == TSS_INITIAL);
Assert(state->memtupcount == 0);
Assert(!state->bounded);
#ifdef DEBUG_BOUNDED_SORT
/* Honor GUC setting that disables the feature (for easy testing) */
if (!optimiz... | 0 | [
"CWE-209"
] | postgres | 804b6b6db4dcfc590a468e7be390738f9f7755fb | 332,985,186,049,482,900,000,000,000,000,000,000,000 | 33 | Fix column-privilege leak in error-message paths
While building error messages to return to the user,
BuildIndexValueDescription, ExecBuildSlotValueDescription and
ri_ReportViolation would happily include the entire key or entire row in
the result returned to the user, even if the user didn't have access to
view all o... |
static void convertToWithoutRowidTable(Parse *pParse, Table *pTab){
Index *pIdx;
Index *pPk;
int nPk;
int nExtra;
int i, j;
sqlite3 *db = pParse->db;
Vdbe *v = pParse->pVdbe;
/* Mark every PRIMARY KEY column as NOT NULL (except for imposter tables)
*/
if( !db->init.imposterTable ){
for(i=0; i<p... | 0 | [
"CWE-674",
"CWE-787"
] | sqlite | 38096961c7cd109110ac21d3ed7dad7e0cb0ae06 | 217,313,902,779,994,330,000,000,000,000,000,000,000 | 143 | Avoid infinite recursion in the ALTER TABLE code when a view contains an unused CTE that references, directly or indirectly, the view itself.
FossilOrigin-Name: 1d2e53a39b87e364685e21de137655b6eee725e4c6d27fc90865072d7c5892b5 |
static bool sk_skb_is_valid_access(int off, int size,
enum bpf_access_type type,
const struct bpf_prog *prog,
struct bpf_insn_access_aux *info)
{
switch (off) {
case bpf_ctx_range(struct __sk_buff, tc_classid):
case bpf_ctx_range(struct __sk_buff, data_meta):
return false;
}
if (type == BPF... | 0 | [
"CWE-120"
] | linux | 050fad7c4534c13c8eb1d9c2ba66012e014773cb | 167,970,556,260,321,930,000,000,000,000,000,000,000 | 34 | bpf: fix truncated jump targets on heavy expansions
Recently during testing, I ran into the following panic:
[ 207.892422] Internal error: Accessing user space memory outside uaccess.h routines: 96000004 [#1] SMP
[ 207.901637] Modules linked in: binfmt_misc [...]
[ 207.966530] CPU: 45 PID: 2256 Comm: test_ve... |
static void jpeg_term_destination(j_compress_ptr cinfo)
{
VncState *vs = cinfo->client_data;
Buffer *buffer = &vs->tight->jpeg;
buffer->offset = buffer->capacity - cinfo->dest->free_in_buffer;
} | 0 | [
"CWE-401"
] | qemu | 6bf21f3d83e95bcc4ba35a7a07cc6655e8b010b0 | 81,794,345,796,819,960,000,000,000,000,000,000,000 | 7 | vnc: fix memory leak when vnc disconnect
Currently when qemu receives a vnc connect, it creates a 'VncState' to
represent this connection. In 'vnc_worker_thread_loop' it creates a
local 'VncState'. The connection 'VcnState' and local 'VncState' exchange
data in 'vnc_async_encoding_start' and 'vnc_async_encoding_end'.
... |
static sasl_session_t *find_session(const char *uid)
{
sasl_session_t *p;
mowgli_node_t *n;
if (uid == NULL)
return NULL;
MOWGLI_ITER_FOREACH(n, sessions.head)
{
p = n->data;
if(p->uid != NULL && !strcmp(p->uid, uid))
return p;
}
return NULL;
} | 0 | [
"CWE-288"
] | atheme | de2ba3ca8f6c39b41431d989f3ac66002a487839 | 140,196,469,929,734,440,000,000,000,000,000,000,000 | 17 | modules/saslserv/main: backport 7.3 commits for pending EID login
This backports commits 4e664c75d0b280a052eb & ceb0235695e6736ce2ab
from the master branch.
The IRCv3.1 SASL specification contains the following wording:
If the client completes registration (with CAP END, NICK, USER
and any other necessary me... |
nfs4_dec_nlink_locked(struct inode *inode)
{
NFS_I(inode)->cache_validity |= NFS_INO_INVALID_OTHER;
drop_nlink(inode);
} | 0 | [
"CWE-787"
] | linux | b4487b93545214a9db8cbf32e86411677b0cca21 | 151,926,691,507,443,200,000,000,000,000,000,000,000 | 5 | 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... |
sdap_get_ad_match_rule_initgroups_step(struct tevent_req *subreq)
{
errno_t ret;
struct tevent_req *req =
tevent_req_callback_data(subreq, struct tevent_req);
struct sdap_ad_match_rule_initgr_state *state =
tevent_req_data(req, struct sdap_ad_match_rule_initgr_state);
size_t coun... | 0 | [
"CWE-264"
] | sssd | 191d7f7ce3de10d9e19eaa0a6ab3319bcd4ca95d | 197,884,846,974,650,520,000,000,000,000,000,000,000 | 98 | AD: process non-posix nested groups using tokenGroups
When initgr is performed for AD supporting tokenGroups, do not skip
non-posix groups.
Resolves:
https://fedorahosted.org/sssd/ticket/2343
Reviewed-by: Michal Židek <mzidek@redhat.com>
(cherry picked from commit 4932db6258ccfb612a3a28eb6a618c2f042b9d58) |
static void tcp_grow_window(struct sock *sk, const struct sk_buff *skb)
{
struct tcp_sock *tp = tcp_sk(sk);
int room;
room = min_t(int, tp->window_clamp, tcp_space(sk)) - tp->rcv_ssthresh;
/* Check #1 */
if (room > 0 && !tcp_under_memory_pressure(sk)) {
int incr;
/* Check #2. Increase window, if skb with su... | 0 | [
"CWE-190"
] | net | 3b4929f65b0d8249f19a50245cd88ed1a2f78cff | 112,254,697,720,269,070,000,000,000,000,000,000,000 | 26 | tcp: limit payload size of sacked skbs
Jonathan Looney reported that TCP can trigger the following crash
in tcp_shifted_skb() :
BUG_ON(tcp_skb_pcount(skb) < pcount);
This can happen if the remote peer has advertized the smallest
MSS that linux TCP accepts : 48
An skb can hold 17 fragments, and each fragment can ho... |
static bool arcmsr_remap_pciregion(struct AdapterControlBlock *acb)
{
struct pci_dev *pdev = acb->pdev;
switch (acb->adapter_type){
case ACB_ADAPTER_TYPE_A:{
acb->pmuA = ioremap(pci_resource_start(pdev,0), pci_resource_len(pdev,0));
if (!acb->pmuA) {
printk(KERN_NOTICE "arcmsr%d: memory mapping region fail \n... | 0 | [
"CWE-119",
"CWE-787"
] | linux | 7bc2b55a5c030685b399bb65b6baa9ccc3d1f167 | 334,198,568,829,339,940,000,000,000,000,000,000,000 | 60 | scsi: arcmsr: Buffer overflow in arcmsr_iop_message_xfer()
We need to put an upper bound on "user_len" so the memcpy() doesn't
overflow.
Cc: <stable@vger.kernel.org>
Reported-by: Marco Grassi <marco.gra@gmail.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Sig... |
comp_opt_exact_or_map_info(OptExactInfo* e, OptMapInfo* m)
{
#define COMP_EM_BASE 20
int ve, vm;
if (m->value <= 0) return -1;
ve = COMP_EM_BASE * e->len * (e->ignore_case ? 1 : 2);
vm = COMP_EM_BASE * 5 * 2 / m->value;
return comp_distance_value(&e->mmd, &m->mmd, ve, vm);
} | 0 | [
"CWE-125"
] | php-src | c6e34d91b88638966662caac62c4d0e90538e317 | 288,105,096,801,742,750,000,000,000,000,000,000,000 | 11 | Fix bug #77371 (heap buffer overflow in mb regex functions - compile_string_node) |
static void dump_status(struct req_state *s, int status,
const char *status_name)
{
s->formatter->set_status(status, status_name);
try {
RESTFUL_IO(s)->send_status(status, status_name);
} catch (rgw::io::Exception& e) {
ldout(s->cct, 0) << "ERROR: s->cio->send_status() returned err="
... | 0 | [
"CWE-770"
] | ceph | ab29bed2fc9f961fe895de1086a8208e21ddaddc | 97,141,961,130,966,500,000,000,000,000,000,000,000 | 11 | rgw: fix issues with 'enforce bounds' patch
The patch to enforce bounds on max-keys/max-uploads/max-parts had a few
issues that would prevent us from compiling it. Instead of changing the
code provided by the submitter, we're addressing them in a separate
commit to maintain the DCO.
Signed-off-by: Joao Eduardo Luis <... |
encode_winansi(unsigned long codepoint)
{
// Use this ugly switch statement to avoid a static, which is not
// thread-safe.
unsigned char ch = '\0';
switch (codepoint)
{
case 0x20ac:
ch = 0x80;
break;
case 0x201a:
ch = 0x82;
break;
case 0x192:
... | 0 | [
"CWE-787"
] | qpdf | d71f05ca07eb5c7cfa4d6d23e5c1f2a800f52e8e | 12,254,923,528,805,125,000,000,000,000,000,000,000 | 96 | 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 int update_prepare_order_info(rdpContext* context, ORDER_INFO* orderInfo, UINT32 orderType)
{
int length = 1;
orderInfo->fieldFlags = 0;
orderInfo->orderType = orderType;
orderInfo->controlFlags = ORDER_STANDARD;
orderInfo->controlFlags |= ORDER_TYPE_CHANGE;
length += 1;
length += get_primary_drawing_orde... | 0 | [
"CWE-20",
"CWE-125"
] | FreeRDP | 733ee3208306b1ea32697b356c0215180fc3f049 | 255,267,148,814,229,220,000,000,000,000,000,000,000 | 12 | Fixed invalid access in update_recv_primary_order
CVE-2020-11095 thanks @antonio-morales for finding this. |
static size_t vnc_client_read_plain(VncState *vs)
{
size_t ret;
VNC_DEBUG("Read plain %p size %zd offset %zd\n",
vs->input.buffer, vs->input.capacity, vs->input.offset);
buffer_reserve(&vs->input, 4096);
ret = vnc_client_read_buf(vs, buffer_end(&vs->input), 4096);
if (!ret)
ret... | 0 | [
"CWE-401"
] | qemu | 6bf21f3d83e95bcc4ba35a7a07cc6655e8b010b0 | 262,401,705,668,759,830,000,000,000,000,000,000,000 | 12 | vnc: fix memory leak when vnc disconnect
Currently when qemu receives a vnc connect, it creates a 'VncState' to
represent this connection. In 'vnc_worker_thread_loop' it creates a
local 'VncState'. The connection 'VcnState' and local 'VncState' exchange
data in 'vnc_async_encoding_start' and 'vnc_async_encoding_end'.
... |
parse_CLONE(char *arg, const struct ofpact_parse_params *pp)
{
const size_t clone_offset = ofpacts_pull(pp->ofpacts);
struct ofpact_nest *clone = ofpact_put_CLONE(pp->ofpacts);
char *error;
ofpbuf_pull(pp->ofpacts, sizeof *clone);
error = ofpacts_parse_copy(arg, pp, false, OFPACT_CLONE);
/* hea... | 0 | [
"CWE-416"
] | ovs | 77cccc74deede443e8b9102299efc869a52b65b2 | 289,889,028,028,683,500,000,000,000,000,000,000,000 | 21 | ofp-actions: Fix use-after-free while decoding RAW_ENCAP.
While decoding RAW_ENCAP action, decode_ed_prop() might re-allocate
ofpbuf if there is no enough space left. However, function
'decode_NXAST_RAW_ENCAP' continues to use old pointer to 'encap'
structure leading to write-after-free and incorrect decoding.
==3... |
static bool reg_is_pkt_pointer_any(const struct bpf_reg_state *reg)
{
return reg_is_pkt_pointer(reg) ||
reg->type == PTR_TO_PACKET_END;
} | 0 | [
"CWE-20"
] | linux | c131187db2d3fa2f8bf32fdf4e9a4ef805168467 | 58,392,334,513,482,720,000,000,000,000,000,000,000 | 5 | bpf: fix branch pruning logic
when the verifier detects that register contains a runtime constant
and it's compared with another constant it will prune exploration
of the branch that is guaranteed not to be taken at runtime.
This is all correct, but malicious program may be constructed
in such a way that it always has... |
MagickExport Image *SepiaToneImage(const Image *image,const double threshold,
ExceptionInfo *exception)
{
#define SepiaToneImageTag "SepiaTone/Image"
CacheView
*image_view,
*sepia_view;
Image
*sepia_image;
MagickBooleanType
status;
MagickOffsetType
progress;
ssize_t
y;
/*
... | 0 | [
"CWE-119",
"CWE-703"
] | ImageMagick | 3cbfb163cff9e5b8cdeace8312e9bfee810ed02b | 306,488,196,474,486,500,000,000,000,000,000,000,000 | 118 | https://github.com/ImageMagick/ImageMagick/issues/296 |
verify (gcry_mpi_t r, gcry_mpi_t s, gcry_mpi_t input, DSA_public_key *pkey )
{
gpg_err_code_t rc = 0;
gcry_mpi_t w, u1, u2, v;
gcry_mpi_t base[3];
gcry_mpi_t ex[3];
gcry_mpi_t hash;
unsigned int nbits;
if( !(mpi_cmp_ui( r, 0 ) > 0 && mpi_cmp( r, pkey->q ) < 0) )
return GPG_ERR_BAD_SIGNATURE; /* Asser... | 0 | [
"CWE-203"
] | libgcrypt | 7c2943309d14407b51c8166c4dcecb56a3628567 | 31,975,729,531,115,707,000,000,000,000,000,000,000 | 62 | dsa,ecdsa: Fix use of nonce, use larger one.
* cipher/dsa-common.c (_gcry_dsa_modify_k): New.
* cipher/pubkey-internal.h (_gcry_dsa_modify_k): New.
* cipher/dsa.c (sign): Use _gcry_dsa_modify_k.
* cipher/ecc-ecdsa.c (_gcry_ecc_ecdsa_sign): Likewise.
* cipher/ecc-gost.c (_gcry_ecc_gost_sign): Likewise.
CVE-id: CVE-201... |
void cql_server::response::serialize(const event::schema_change& event, uint8_t version)
{
if (version >= 3) {
write_string(to_string(event.change));
write_string(to_string(event.target));
write_string(event.keyspace);
switch (event.target) {
case event::schema_change::target... | 0 | [] | scylladb | 1c2eef384da439b0457b6d71c7e37d7268e471cb | 315,743,978,349,483,970,000,000,000,000,000,000,000 | 44 | transport/server.cc: Return correct size of decompressed lz4 buffer
An incorrect size is returned from the function, which could lead to
crashes or undefined behavior. Fix by erroring out in these cases.
Fixes #11476 |
static void family_init(QuicFamily *family, int bpc, int limit)
{
int l, b;
for (l = 0; l < bpc; l++) { /* fill arrays indexed by code number */
int altprefixlen, altcodewords;
altprefixlen = limit - bpc;
if (altprefixlen > (int)(bppmask[bpc - l])) {
altprefixlen = bppmask[... | 0 | [] | spice-common | 762e0abae36033ccde658fd52d3235887b60862d | 289,414,642,679,739,330,000,000,000,000,000,000,000 | 30 | quic: Check we have some data to start decoding quic image
All paths already pass some data to quic_decode_begin but for the
test check it, it's not that expensive test.
Checking for not 0 is enough, all other words will potentially be
read calling more_io_words but we need one to avoid a potential
initial buffer over... |
_equalLoadStmt(const LoadStmt *a, const LoadStmt *b)
{
COMPARE_STRING_FIELD(filename);
return true;
} | 0 | [
"CWE-362"
] | postgres | 5f173040e324f6c2eebb90d86cf1b0cdb5890f0a | 180,561,571,100,479,800,000,000,000,000,000,000,000 | 6 | 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... |
bool EbmlMaster::InsertElement(EbmlElement & element, size_t position)
{
std::vector<EbmlElement *>::iterator Itr = ElementList.begin();
while (Itr != ElementList.end() && position--)
{
++Itr;
}
if ((Itr == ElementList.end()) && position)
return false;
ElementList.insert(Itr, &element);
return tr... | 0 | [
"CWE-703"
] | libebml | 88409e2a94dd3b40ff81d08bf6d92f486d036b24 | 249,522,507,123,264,670,000,000,000,000,000,000,000 | 13 | EbmlMaster: propagate upper level element after infinite sized one correctly
When the parser encountered a deeply nested element with an infinite
size then a following element of an upper level was not propagated
correctly. Instead the element with the infinite size was added into the
EBML element tree a second time r... |
proto_read_null_string (p11_rpc_message *msg,
CK_UTF8CHAR_PTR *val)
{
const unsigned char *data;
size_t n_data;
assert (msg != NULL);
assert (val != NULL);
assert (msg->input != NULL);
/* Check that we're supposed to have this at this point */
assert (!msg->signature || p11_rpc_message_... | 0 | [
"CWE-190"
] | p11-kit | 5307a1d21a50cacd06f471a873a018d23ba4b963 | 236,315,824,351,904,160,000,000,000,000,000,000,000 | 26 | Check for arithmetic overflows before allocating |
Field::geometry_type get_geometry_type() const
{ return Type_geometry_attributes::get_geometry_type(); }; | 0 | [
"CWE-617"
] | server | 807945f2eb5fa22e6f233cc17b85a2e141efe2c8 | 139,578,382,652,606,460,000,000,000,000,000,000,000 | 2 | 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 void scrub_put_ctx(struct scrub_ctx *sctx)
{
if (refcount_dec_and_test(&sctx->refs))
scrub_free_ctx(sctx);
} | 0 | [
"CWE-476",
"CWE-284"
] | linux | 09ba3bc9dd150457c506e4661380a6183af651c1 | 231,187,587,214,810,400,000,000,000,000,000,000,000 | 5 | btrfs: merge btrfs_find_device and find_device
Both btrfs_find_device() and find_device() does the same thing except
that the latter does not take the seed device onto account in the device
scanning context. We can merge them.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.c... |
void iscsi_set_session_parameters(
struct iscsi_sess_ops *ops,
struct iscsi_param_list *param_list,
int leading)
{
char *tmpptr;
struct iscsi_param *param;
pr_debug("----------------------------------------------------"
"--------------\n");
list_for_each_entry(param, ¶m_list->param_list, p_list) {
if (... | 0 | [
"CWE-119"
] | target-pending | cea4dcfdad926a27a18e188720efe0f2c9403456 | 154,944,380,634,730,170,000,000,000,000,000,000,000 | 116 | iscsi-target: fix heap buffer overflow on error
If a key was larger than 64 bytes, as checked by iscsi_check_key(), the
error response packet, generated by iscsi_add_notunderstood_response(),
would still attempt to copy the entire key into the packet, overflowing
the structure on the heap.
Remote preauthentication ke... |
static u32 iwl_dump_ini_trigger(struct iwl_fw_runtime *fwrt,
struct iwl_fw_ini_trigger *trigger,
struct list_head *list)
{
int i;
u32 size = 0;
for (i = 0; i < le32_to_cpu(trigger->num_regions); i++) {
u32 reg_id = le32_to_cpu(trigger->data[i]), reg_type;
struct iwl_fw_ini_region_cfg *reg;
if (WARN_O... | 0 | [
"CWE-400",
"CWE-401"
] | linux | b4b814fec1a5a849383f7b3886b654a13abbda7d | 151,751,464,360,015,200,000,000,000,000,000,000,000 | 39 | iwlwifi: dbg_ini: fix memory leak in alloc_sgtable
In alloc_sgtable if alloc_page fails, the alocated table should be
released.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com> |
static double mp_vector_crop(_cimg_math_parser& mp) {
double *const ptrd = &_mp_arg(1) + 1;
const double *const ptrs = &_mp_arg(2) + 1;
const longT
length = (longT)mp.opcode[3],
start = (longT)_mp_arg(4),
sublength = (longT)mp.opcode[5];
if (start<0 |... | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 279,731,169,877,032,530,000,000,000,000,000,000,000 | 15 | Fix other issues in 'CImg<T>::load_bmp()'. |
GList *completion_msg(SERVER_REC *win_server,
SERVER_REC *find_server,
const char *nick, const char *prefix)
{
GSList *tmp, *list;
char *newprefix;
g_return_val_if_fail(nick != NULL, NULL);
if (servers == NULL) return NULL;
list = NULL;
if (find_server != NULL) {
completion_msg_server(&list, f... | 0 | [
"CWE-416"
] | irssi | 36564717c9f701e3a339da362ab46d220d27e0c1 | 182,011,713,990,101,500,000,000,000,000,000,000,000 | 34 | Merge branch 'security' into 'master'
Security
See merge request irssi/irssi!34
(cherry picked from commit b0d9cb33cd9ef9da7c331409e8b7c57a6f3aef3f) |
int check_hex(char *str, int len) {
int i;
for (i = 0; i < len; i++) {
if ((str[i] < '0' && str[i] > '9') && (str[i] < 'a' && str[i] > 'f') && (str[i] < 'A' && str[i] > 'F')
) {
return 0;
}
}
return 1;
} | 0 | [
"CWE-119",
"CWE-703",
"CWE-787"
] | uwsgi | cb4636f7c0af2e97a4eef7a3cdcbd85a71247bfe | 315,191,616,083,875,550,000,000,000,000,000,000,000 | 12 | improve uwsgi_expand_path() to sanitize input, avoiding stack corruption and potential security issue |
// Count parentheses/brackets level of each character of the expression.
CImg<uintT> get_level(CImg<charT>& _expr) const {
bool is_escaped = false, next_is_escaped = false;
unsigned int mode = 0, next_mode = 0; // { 0=normal | 1=char-string | 2=vector-string
CImg<uintT> res(_expr._wi... | 0 | [
"CWE-119",
"CWE-787"
] | CImg | ac8003393569aba51048c9d67e1491559877b1d1 | 229,133,618,166,820,150,000,000,000,000,000,000,000 | 37 | . |
static int setup_env(pool *p, cmd_rec *cmd, char *user, char *pass) {
struct passwd *pw;
config_rec *c, *tmpc;
char *origuser, *ourname = NULL, *anonname = NULL, *anongroup = NULL, *ugroup = NULL;
char *defaulttransfermode, *defroot = NULL,*defchdir = NULL,*xferlog = NULL;
const char *sess_ttyname;
int aclp... | 0 | [
"CWE-59",
"CWE-61"
] | proftpd | ecff21e0d0e84f35c299ef91d7fda088e516d4ed | 141,777,316,043,421,560,000,000,000,000,000,000,000 | 892 | Backporting recursive handling of DefaultRoot path, when AllowChrootSymlinks
is off, to 1.3.5 branch. |
inline uint64_t make_type(const T &arg) {
return MakeValue< BasicFormatter<char> >::type(arg);
} | 0 | [
"CWE-134",
"CWE-119",
"CWE-787"
] | fmt | 8cf30aa2be256eba07bb1cefb998c52326e846e7 | 307,453,937,267,810,070,000,000,000,000,000,000,000 | 3 | Fix segfault on complex pointer formatting (#642) |
int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str)
{
ASN1_GENERALIZEDTIME t;
t.type=V_ASN1_GENERALIZEDTIME;
t.length=strlen(str);
t.data=(unsigned char *)str;
if (ASN1_GENERALIZEDTIME_check(&t))
{
if (s != NULL)
{
if (!ASN1_STRING_set((ASN1_STRING *)s,
(unsigned char *)st... | 0 | [] | openssl | c7235be6e36c4bef84594aa3b2f0561db84b63d8 | 237,389,930,268,864,100,000,000,000,000,000,000,000 | 21 | RFC 3161 compliant time stamp request creation, response generation
and response verification.
Submitted by: Zoltan Glozik <zglozik@opentsa.org>
Reviewed by: Ulf Moeller |
static void remove_kevent(struct inotify_device *dev,
struct inotify_kernel_event *kevent)
{
list_del(&kevent->list);
dev->event_count--;
dev->queue_size -= sizeof(struct inotify_event) + kevent->event.len;
} | 0 | [
"CWE-399"
] | linux-2.6 | 3632dee2f8b8a9720329f29eeaa4ec4669a3aff8 | 134,945,999,827,232,410,000,000,000,000,000,000,000 | 8 | inotify: clean up inotify_read and fix locking problems
If userspace supplies an invalid pointer to a read() of an inotify
instance, the inotify device's event list mutex is unlocked twice.
This causes an unbalance which effectively leaves the data structure
unprotected, and we can trigger oopses by accessing the inot... |
sctp_disposition_t sctp_sf_shutdown_sent_abort(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
{
struct sctp_chunk *chunk = arg;
if (!sctp_vtag_verify_either(chunk, asoc))
return sctp_sf_pdiscard(ep, asoc, type... | 0 | [] | linux | bbd0d59809f923ea2b540cbd781b32110e249f6e | 25,147,894,964,932,880,000,000,000,000,000,000,000 | 34 | [SCTP]: Implement the receive and verification of AUTH chunk
This patch implements the receive path needed to process authenticated
chunks. Add ability to process the AUTH chunk and handle edge cases
for authenticated COOKIE-ECHO as well.
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David ... |
bool ldb_dn_check_special(struct ldb_dn *dn, const char *check)
{
if ( ! dn || dn->invalid) return false;
return ! strcmp(dn->linearized, check);
} | 0 | [
"CWE-200"
] | samba | 7f51ec8c4ed9ba1f53d722e44fb6fb3cde933b72 | 103,942,553,030,989,870,000,000,000,000,000,000,000 | 5 | 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... |
uint STDCALL mysql_errno(MYSQL *mysql)
{
return mysql ? mysql->net.last_errno : mysql_server_last_errno;
} | 0 | [
"CWE-254"
] | server | f0d774d48416bb06063184380b684380ca005a41 | 254,825,175,681,152,620,000,000,000,000,000,000,000 | 4 | MDEV-9212 ssl-validate-cert incorrect hostname check
Reimplement ssl_verify_server_cert() using the logic
from https://wiki.openssl.org/index.php/Hostname_validation
The bug was discovered by Alex Gaynor. |
inline std::shared_ptr<Ope> dot() { return std::make_shared<AnyCharacter>(); } | 0 | [
"CWE-125"
] | cpp-peglib | b3b29ce8f3acf3a32733d930105a17d7b0ba347e | 202,207,807,046,540,670,000,000,000,000,000,000,000 | 1 | Fix #122 |
int git_index__changed_relative_to(
git_index *index, const git_oid *checksum)
{
/* attempt to update index (ignoring errors) */
if (git_index_read(index, false) < 0)
giterr_clear();
return !!git_oid_cmp(&index->checksum, checksum);
} | 0 | [
"CWE-415",
"CWE-190"
] | libgit2 | 3db1af1f370295ad5355b8f64b865a2a357bcac0 | 8,779,108,248,268,574,000,000,000,000,000,000,000 | 9 | index: error out on unreasonable prefix-compressed path lengths
When computing the complete path length from the encoded
prefix-compressed path, we end up just allocating the complete path
without ever checking what the encoded path length actually is. This can
easily lead to a denial of service by just encoding an un... |
cnt_pipe(struct worker *wrk, struct req *req)
{
struct busyobj *bo;
enum req_fsm_nxt nxt;
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
AZ(req->objcore);
AZ(req->stale_oc);
AN(req->vcl);
wrk->stats->s_pipe++;
bo = VBO_GetBusyObj(wrk, req);
CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
VS... | 0 | [
"CWE-212"
] | varnish-cache | bd7b3d6d47ccbb5e1747126f8e2a297f38e56b8c | 159,386,209,258,983,890,000,000,000,000,000,000,000 | 62 | Clear err_code and err_reason at start of request handling
req->err_code and req->err_reason are set when going to synthetic
handling. From there the resp.reason HTTP field is set from
req->err_reason if set, or the generic code based on req->err_code is used
if it was NULL. This patch clears these members so that a v... |
GF_Err tenc_box_dump(GF_Box *a, FILE * trace)
{
GF_TrackEncryptionBox *ptr = (GF_TrackEncryptionBox*) a;
if (!a) return GF_BAD_PARAM;
gf_isom_box_dump_start(a, "TrackEncryptionBox", trace);
gf_fprintf(trace, "isEncrypted=\"%d\"", ptr->isProtected);
if (ptr->key_info[3])
gf_fprintf(trace, " IV_size=\"%d\" KID=... | 0 | [
"CWE-787"
] | gpac | ea1eca00fd92fa17f0e25ac25652622924a9a6a0 | 93,847,206,658,841,030,000,000,000,000,000,000,000 | 28 | fixed #2138 |
get_futex_key(u32 __user *uaddr, int fshared, union futex_key *key, int rw)
{
unsigned long address = (unsigned long)uaddr;
struct mm_struct *mm = current->mm;
struct page *page;
struct address_space *mapping;
int err, ro = 0;
/*
* The futex address must be "naturally" aligned.
*/
key->both.offset = address... | 0 | [
"CWE-416"
] | linux | 65d8fc777f6dcfee12785c057a6b57f679641c90 | 173,169,372,514,173,120,000,000,000,000,000,000,000 | 197 | futex: Remove requirement for lock_page() in get_futex_key()
When dealing with key handling for shared futexes, we can drastically reduce
the usage/need of the page lock. 1) For anonymous pages, the associated futex
object is the mm_struct which does not require the page lock. 2) For inode
based, keys, we can check un... |
static void nvme_rw_cb(void *opaque, int ret)
{
NvmeRequest *req = opaque;
NvmeNamespace *ns = req->ns;
BlockBackend *blk = ns->blkconf.blk;
trace_pci_nvme_rw_cb(nvme_cid(req), blk_name(blk));
if (ret) {
goto out;
}
if (ns->lbaf.ms) {
NvmeRwCmd *rw = (NvmeRwCmd *)&req->cm... | 0 | [] | qemu | 736b01642d85be832385063f278fe7cd4ffb5221 | 189,898,044,510,041,800,000,000,000,000,000,000,000 | 49 | hw/nvme: fix CVE-2021-3929
This fixes CVE-2021-3929 "locally" by denying DMA to the iomem of the
device itself. This still allows DMA to MMIO regions of other devices
(e.g. doing P2P DMA to the controller memory buffer of another NVMe
device).
Fixes: CVE-2021-3929
Reported-by: Qiuhao Li <Qiuhao.Li@outlook.com>
Review... |
onigenc_mbn_mbc_case_fold(OnigEncoding enc, OnigCaseFoldType flag ARG_UNUSED,
const UChar** pp, const UChar* end ARG_UNUSED,
UChar* lower)
{
int len;
const UChar *p = *pp;
if (ONIGENC_IS_MBC_ASCII(p)) {
*lower = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p);
(*pp)++;
return 1;
... | 0 | [
"CWE-125"
] | Onigmo | d4cf99d30bd5f6a8a4ababd0b9d7b06f3a479a24 | 261,871,436,213,230,920,000,000,000,000,000,000,000 | 23 | Fix out-of-bounds read in parse_char_class() (Close #139)
/[\x{111111}]/ causes out-of-bounds read when encoding is a single byte
encoding. \x{111111} is an invalid codepoint for a single byte encoding.
Check if it is a valid codepoint. |
static int starttls(struct transaction_t *txn, struct http_connection *conn)
{
int https = (txn == NULL);
int result;
SSL_CTX *ctx = NULL;
if (!conn) conn = txn->conn;
result=tls_init_serverengine("http",
5, /* depth to verify */
... | 0 | [] | cyrus-imapd | 602f12ed2af0a49ac4a58affbfea57d0fc23dea5 | 153,705,295,342,544,320,000,000,000,000,000,000,000 | 67 | httpd.c: only allow reuse of auth creds on a persistent connection against a backend server in a Murder |
static void read_conf(FILE *conffile)
{
char *buffer, *line, *val;
buffer = loadfile(conffile);
for (line = strtok(buffer, "\r\n"); line; line = strtok(NULL, "\r\n")) {
if (!strncmp(line, "export ", 7))
continue;
val = strchr(line, '=');
if (!val) {
printf("i... | 0 | [
"CWE-310"
] | jansson | 8f80c2d83808150724d31793e6ade92749b1faa4 | 118,272,487,429,679,510,000,000,000,000,000,000,000 | 37 | CVE-2013-6401: Change hash function, randomize hashes
Thanks to Florian Weimer and Eric Sesterhenn for reporting, reviewing
and testing. |
static bool vfswrap_brl_unlock_windows(struct vfs_handle_struct *handle,
struct messaging_context *msg_ctx,
struct byte_range_lock *br_lck,
const struct lock_struct *plock)
{
SMB_ASSERT(plock->lock_flav == WINDOWS_LOCK);
return brl_unlock_windows_default(msg_ctx, br_lck, plock... | 0 | [
"CWE-665"
] | samba | 30e724cbff1ecd90e5a676831902d1e41ec1b347 | 64,963,508,929,926,100,000,000,000,000,000,000,000 | 9 | FSCTL_GET_SHADOW_COPY_DATA: Initialize output array to zero
Otherwise num_volumes and the end marker can return uninitialized data
to the client.
Signed-off-by: Christof Schmitt <christof.schmitt@us.ibm.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org> |
MagickExport void ConvertRGBToHSL(const Quantum red,const Quantum green,
const Quantum blue,double *hue,double *saturation,double *lightness)
{
double
c,
max,
min;
/*
Convert RGB to HSL colorspace.
*/
assert(hue != (double *) NULL);
assert(saturation != (double *) NULL);
assert(lightness ... | 1 | [] | ImageMagick6 | 64c0cc234280544dabacc2b28017521851deebde | 64,316,640,286,512,380,000,000,000,000,000,000,000 | 43 | https://github.com/ImageMagick/ImageMagick/issues/3321 |
status_to_message(u_int32_t status)
{
const char *status_messages[] = {
"Success", /* SSH_FX_OK */
"End of file", /* SSH_FX_EOF */
"No such file", /* SSH_FX_NO_SUCH_FILE */
"Permission denied", /* SSH_FX_PERMISSION_DENIED */
"Failure", /* SSH_FX_FAILURE */
"Bad message", /* SSH_FX_BAD_MESSAGE */... | 0 | [
"CWE-732",
"CWE-703",
"CWE-269"
] | src | a6981567e8e215acc1ef690c8dbb30f2d9b00a19 | 302,252,616,440,238,470,000,000,000,000,000,000,000 | 16 | disallow creation (of empty files) in read-only mode; reported by
Michal Zalewski, feedback & ok deraadt@ |
spool_sname(const uschar * purpose, uschar * subdir)
{
return string_sprintf("%s%s%s%s%s",
queue_name, *queue_name ? "/" : "",
purpose,
*subdir ? "/" : "", subdir);
} | 0 | [
"CWE-78"
] | exim | 7ea1237c783e380d7bdb86c90b13d8203c7ecf26 | 113,941,964,680,245,870,000,000,000,000,000,000,000 | 7 | Events: raise msg:fail:internal & msg:complete for -Mrm. Bug 2310 |
static struct page *follow_page_pte(struct vm_area_struct *vma,
unsigned long address, pmd_t *pmd, unsigned int flags)
{
struct mm_struct *mm = vma->vm_mm;
struct dev_pagemap *pgmap = NULL;
struct page *page;
spinlock_t *ptl;
pte_t *ptep, pte;
retry:
if (unlikely(pmd_bad(*pmd)))
return no_page_table(vma, fla... | 1 | [
"CWE-362"
] | linux | 19be0eaffa3ac7d8eb6784ad9bdbc7d67ed8e619 | 1,422,580,736,863,415,300,000,000,000,000,000,000 | 137 | mm: remove gup_flags FOLL_WRITE games from __get_user_pages()
This is an ancient bug that was actually attempted to be fixed once
(badly) by me eleven years ago in commit 4ceb5db9757a ("Fix
get_user_pages() race for write access") but that was then undone due to
problems on s390 by commit f33ea7f404e5 ("fix get_user_p... |
static int qemu_chr_write_all(CharDriverState *s, const uint8_t *buf, int len)
{
int offset;
int res;
if (s->replay && replay_mode == REPLAY_MODE_PLAY) {
replay_char_write_event_load(&res, &offset);
assert(offset <= len);
qemu_chr_fe_write_buffer(s, buf, offset, &offset);
re... | 0 | [
"CWE-416"
] | qemu | a4afa548fc6dd9842ed86639b4d37d4d1c4ad480 | 238,918,482,396,094,780,000,000,000,000,000,000,000 | 23 | char: move front end handlers in CharBackend
Since the hanlders are associated with a CharBackend, rather than the
CharDriverState, it is more appropriate to store in CharBackend. This
avoids the handler copy dance in qemu_chr_fe_set_handlers() then
mux_chr_update_read_handler(), by storing the CharBackend pointer
dir... |
prepare_error_tgs (struct kdc_request_state *state,
krb5_kdc_req *request, krb5_ticket *ticket, int error,
krb5_principal canon_server,
krb5_data **response, const char *status,
krb5_pa_data **e_data)
{
krb5_error errpkt;
krb5_error_cod... | 0 | [
"CWE-20"
] | krb5 | 4c023ba43c16396f0d199e2df1cfa59b88b62acc | 201,408,506,978,008,640,000,000,000,000,000,000,000 | 66 | KDC null deref due to referrals [CVE-2013-1417]
An authenticated remote client can cause a KDC to crash by making a
valid TGS-REQ to a KDC serving a realm with a single-component name.
The process_tgs_req() function dereferences a null pointer because an
unusual failure condition causes a helper function to return suc... |
krb5_gss_get_mic_iov(OM_uint32 *minor_status,
gss_ctx_id_t context_handle,
gss_qop_t qop_req,
gss_iov_buffer_desc *iov,
int iov_count)
{
OM_uint32 major_status;
major_status = kg_seal_iov(minor_status, context_handle, FALSE,
... | 0 | [
"CWE-703"
] | krb5 | 82dc33da50338ac84c7b4102dc6513d897d0506a | 209,088,999,487,501,600,000,000,000,000,000,000,000 | 14 | Fix gss_process_context_token() [CVE-2014-5352]
[MITKRB5-SA-2015-001] The krb5 gss_process_context_token() should not
actually delete the context; that leaves the caller with a dangling
pointer and no way to know that it is invalid. Instead, mark the
context as terminated, and check for terminated contexts in the GSS... |
void SpatialAvgPool(OpKernelContext* context, Tensor* output,
const Tensor& input, const PoolParameters& params,
const Padding& padding) {
if (output->NumElements() == 0) {
return;
}
typedef Eigen::Map<const Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>>
ConstE... | 0 | [
"CWE-354"
] | tensorflow | 4dddb2fd0b01cdd196101afbba6518658a2c9e07 | 93,816,996,596,922,280,000,000,000,000,000,000,000 | 96 | Fix segfault in pools on empty shapes when certain dimension were very large.
Pooling ops multiply certain components of the input shape, e.g. by multiplying input.shape[1] * input.shape[2] * input.shape[3]. This multiplication could overflow an int64 value if shape[0] was 0 but shape[1], shape[2], and shape[3] were v... |
QPDFObjectHandle::newNull()
{
return QPDFObjectHandle(new QPDF_Null());
} | 0 | [
"CWE-835"
] | qpdf | afe0242b263a9e1a8d51dd81e42ab6de2e5127eb | 251,106,360,306,852,000,000,000,000,000,000,000,000 | 4 | Handle object ID 0 (fixes #99)
This is CVE-2017-9208.
The QPDF library uses object ID 0 internally as a sentinel to
represent a direct object, but prior to this fix, was not blocking
handling of 0 0 obj or 0 0 R as a special case. Creating an object in
the file with 0 0 obj could cause various infinite loops. The PDF... |
void dumpState(std::ostream& os, int indent_level = 0) const override {
HeaderMapImpl::dumpState(os, indent_level);
} | 0 | [] | envoy | 2c60632d41555ec8b3d9ef5246242be637a2db0f | 274,346,657,827,517,770,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... |
static void qxl_check_state(PCIQXLDevice *d)
{
QXLRam *ram = d->ram;
int spice_display_running = qemu_spice_display_is_running(&d->ssd);
assert(!spice_display_running || SPICE_RING_IS_EMPTY(&ram->cmd_ring));
assert(!spice_display_running || SPICE_RING_IS_EMPTY(&ram->cursor_ring));
} | 0 | [
"CWE-476"
] | qemu | d52680fc932efb8a2f334cc6993e705ed1e31e99 | 141,281,114,048,742,480,000,000,000,000,000,000,000 | 8 | qxl: check release info object
When releasing spice resources in release_resource() routine,
if release info object 'ext.info' is null, it leads to null
pointer dereference. Add check to avoid it.
Reported-by: Bugs SysSec <bugs-syssec@rub.de>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Message-id: 20190425... |
**/
CImg<Tfloat> operator%(const char *const expression) const {
return CImg<Tfloat>(*this,false)%=expression; | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 202,088,470,804,707,830,000,000,000,000,000,000,000 | 3 | Fix other issues in 'CImg<T>::load_bmp()'. |
bool open_and_lock_tables(THD *thd, const DDL_options_st &options,
TABLE_LIST *tables,
bool derived, uint flags,
Prelocking_strategy *prelocking_strategy)
{
uint counter;
MDL_savepoint mdl_savepoint= thd->mdl_context.mdl_savepoint();
DB... | 0 | [] | server | 0168d1eda30dad4b517659422e347175eb89e923 | 93,787,756,599,495,160,000,000,000,000,000,000,000 | 42 | MDEV-25766 Unused CTE lead to a crash in find_field_in_tables/find_order_in_list
Do not assume that subquery Item always present. |
static void reset_adv_monitors(uint16_t index)
{
struct mgmt_cp_remove_adv_monitor cp;
DBG("sending remove Adv Monitor command with handle 0");
/* Handle 0 indicates to remove all */
cp.monitor_handle = 0;
if (mgmt_send(mgmt_master, MGMT_OP_REMOVE_ADV_MONITOR, index,
sizeof(cp), &cp, reset_adv_monitors_comple... | 0 | [
"CWE-862",
"CWE-863"
] | bluez | b497b5942a8beb8f89ca1c359c54ad67ec843055 | 280,389,009,798,733,200,000,000,000,000,000,000,000 | 16 | 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. |
T& atXY(const int x, const int y, const int z=0, const int c=0) {
if (is_empty())
throw CImgInstanceException(_cimg_instance
"atXY(): Empty instance.",
cimg_instance);
return _atXY(x,y,z,c);
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 18,746,282,718,936,814,000,000,000,000,000,000,000 | 7 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
TABLE *find_locked_table(TABLE *list, const char *db, const char *table_name)
{
char key[MAX_DBKEY_LENGTH];
uint key_length= tdc_create_key(key, db, table_name);
for (TABLE *table= list; table ; table=table->next)
{
if (table->s->table_cache_key.length == key_length &&
!memcmp(table->s->table_cache_key.st... | 0 | [] | server | 0168d1eda30dad4b517659422e347175eb89e923 | 169,112,046,288,846,400,000,000,000,000,000,000,000 | 13 | MDEV-25766 Unused CTE lead to a crash in find_field_in_tables/find_order_in_list
Do not assume that subquery Item always present. |
toVAlign(char *oval, int *valign)
{
if (strcasecmp(oval, "top") == 0 || strcasecmp(oval, "baseline") == 0)
*valign = VALIGN_TOP;
else if (strcasecmp(oval, "bottom") == 0)
*valign = VALIGN_BOTTOM;
else if (strcasecmp(oval, "middle") == 0)
*valign = VALIGN_MIDDLE;
else
return 0;
return 1;
} | 0 | [
"CWE-20",
"CWE-476"
] | w3m | 33509cc81ec5f2ba44eb6fd98bd5c1b5873e46bd | 285,585,383,957,004,170,000,000,000,000,000,000,000 | 12 | Fix uninitialised values for <i> and <dd>
Bug-Debian: https://github.com/tats/w3m/issues/16 |
daemon_msg_open_req(uint8 ver, struct daemon_slpars *pars, uint32 plen,
char *source, size_t sourcelen)
{
char errbuf[PCAP_ERRBUF_SIZE]; // buffer for network errors
char errmsgbuf[PCAP_ERRBUF_SIZE]; // buffer for errors to send to the client
pcap_t *fp; // pcap_t main variable
int nread;
char sendbuf[RPCA... | 1 | [
"CWE-703",
"CWE-918"
] | libpcap | 33834cb2a4d035b52aa2a26742f832a112e90a0a | 236,360,285,436,192,250,000,000,000,000,000,000,000 | 84 | In the open request, reject capture sources that are URLs.
You shouldn't be able to ask a server to open a remote device on some
*other* server; just open it yourself.
This addresses Include Security issue F13: [libpcap] Remote Packet
Capture Daemon Allows Opening Capture URLs. |
void wait_for_device_probe(void)
{
/* wait for probe timeout */
wait_event(probe_timeout_waitqueue, !driver_deferred_probe_timeout);
/* wait for the deferred probe workqueue to finish */
flush_work(&deferred_probe_work);
/* wait for the known devices to complete their probing */
wait_event(probe_waitqueue, atom... | 0 | [
"CWE-787"
] | linux | aa838896d87af561a33ecefea1caa4c15a68bc47 | 17,829,170,913,940,864,000,000,000,000,000,000,000 | 12 | drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions
Convert the various sprintf fmaily calls in sysfs device show functions
to sysfs_emit and sysfs_emit_at for PAGE_SIZE buffer safety.
Done with:
$ spatch -sp-file sysfs_emit_dev.cocci --in-place --max-width=80 .
And cocci script:
$ cat s... |
~RGWPutLC() override {
free(data);
} | 0 | [
"CWE-770"
] | ceph | ab29bed2fc9f961fe895de1086a8208e21ddaddc | 162,008,446,378,977,720,000,000,000,000,000,000,000 | 3 | rgw: fix issues with 'enforce bounds' patch
The patch to enforce bounds on max-keys/max-uploads/max-parts had a few
issues that would prevent us from compiling it. Instead of changing the
code provided by the submitter, we're addressing them in a separate
commit to maintain the DCO.
Signed-off-by: Joao Eduardo Luis <... |
push_render_image(Str str, int width, int limit,
struct html_feed_environ *h_env)
{
struct readbuffer *obuf = h_env->obuf;
int indent = h_env->envs[h_env->envc].indent;
push_spaces(obuf, 1, (limit - width) / 2);
push_str(obuf, width, str, PC_ASCII);
push_spaces(obuf, 1, (limit - width + 1) / 2)... | 0 | [
"CWE-476"
] | w3m | 59b91cd8e30c86f23476fa81ae005cabff49ebb6 | 272,030,003,524,599,660,000,000,000,000,000,000,000 | 12 | Prevent segfault with malformed input type
Bug-Debian: https://github.com/tats/w3m/issues/7 |
Decode a modified UTF-7 string */
PHP_FUNCTION(imap_utf7_decode)
{
/* author: Andrew Skalski <askalski@chek.com> */
zend_string *arg;
const unsigned char *in, *inp, *endp;
unsigned char *out, *outp;
unsigned char c;
int inlen, outlen;
enum {
ST_NORMAL, /* printable text */
ST_DECODE0, /* encoded text rota... | 0 | [
"CWE-88"
] | php-src | 336d2086a9189006909ae06c7e95902d7d5ff77e | 294,295,765,307,140,740,000,000,000,000,000,000,000 | 135 | Disable rsh/ssh functionality in imap by default (bug #77153) |
TEST_F(ZNCTest, AwayNotify) {
auto znc = Run();
auto ircd = ConnectIRCd();
auto client = ConnectClient();
client.Write("CAP LS");
client.Write("PASS :hunter2");
client.Write("NICK nick");
client.Write("USER user/test x x :x");
QByteArray cap_ls;
client.ReadUntilAndGet(" LS :", cap_ls... | 0 | [
"CWE-476"
] | znc | d229761821da38d984a9e4098ad96842490dc001 | 108,078,487,648,564,600,000,000,000,000,000,000,000 | 30 | Fix echo-message for *status
Close #1705 |
swrite (CamelMimePart *sigpart,
GCancellable *cancellable,
GError **error)
{
CamelStream *ostream;
CamelDataWrapper *wrapper;
gchar *template;
gint fd, ret;
template = g_build_filename (g_get_tmp_dir (), "evolution-pgp.XXXXXX", NULL);
if ((fd = g_mkstemp (template)) == -1) {
g_free (template);
... | 0 | [
"CWE-200"
] | evolution-data-server | 5d8b92c622f6927b253762ff9310479dd3ac627d | 199,698,920,810,696,600,000,000,000,000,000,000,000 | 38 | CamelGpgContext: Enclose email addresses in brackets.
The recipient list for encrypting can be specified by either key ID or
email address. Enclose email addresses in brackets to ensure an exact
match, as per the gpg man page:
HOW TO SPECIFY A USER ID
...
By exact match on an email address.
... |
static int __nci_request(struct nci_dev *ndev,
void (*req)(struct nci_dev *ndev, const void *opt),
const void *opt, __u32 timeout)
{
int rc = 0;
long completion_rc;
ndev->req_status = NCI_REQ_PEND;
reinit_completion(&ndev->req_completion);
req(ndev, opt);
completion_rc =
wait_for_completion_interrupti... | 0 | [] | linux | 48b71a9e66c2eab60564b1b1c85f4928ed04e406 | 285,599,665,850,331,700,000,000,000,000,000,000,000 | 42 | NFC: add NCI_UNREG flag to eliminate the race
There are two sites that calls queue_work() after the
destroy_workqueue() and lead to possible UAF.
The first site is nci_send_cmd(), which can happen after the
nci_close_device as below
nfcmrvl_nci_unregister_dev | nfc_genl_dev_up
nci_close_device |
f... |
inline THD *get_thd() const
{ return likely(table) ? table->in_use : current_thd; } | 0 | [
"CWE-416",
"CWE-703"
] | server | 08c7ab404f69d9c4ca6ca7a9cf7eec74c804f917 | 189,804,453,587,544,930,000,000,000,000,000,000,000 | 2 | MDEV-24176 Server crashes after insert in the table with virtual
column generated using date_format() and if()
vcol_info->expr is allocated on expr_arena at parsing stage. Since
expr item is allocated on expr_arena all its containee items must be
allocated on expr_arena too. Otherwise fix_session_expr() will
encounter... |
int blkid_parttable_set_id(blkid_parttable tab, const unsigned char *id)
{
if (!tab)
return -1;
strncpy(tab->id, (const char *) id, sizeof(tab->id));
return 0;
} | 0 | [] | util-linux | 50d1594c2e6142a3b51d2143c74027480df082e0 | 266,063,887,379,488,530,000,000,000,000,000,000,000 | 8 | libblkid: avoid non-empty recursion in EBR
This is extension to the patch 7164a1c34d18831ac61c6744ad14ce916d389b3f.
We also need to detect non-empty recursion in the EBR chain. It's
possible to create standard valid logical partitions and in the last one
points back to the EBR chain. In this case all offsets will be ... |
\param filename Filename to write data to.
\param number When positive, represents an index added to the filename. Otherwise, no number is added.
\param digits Number of digits used for adding the number to the filename.
**/
const CImgList<T>& save(const char *const filename, const int number=... | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 40,087,132,398,793,466,000,000,000,000,000,000,000 | 76 | Fix other issues in 'CImg<T>::load_bmp()'. |
static int rtentry_to_fib_config(struct net *net, int cmd, struct rtentry *rt,
struct fib_config *cfg)
{
__be32 addr;
int plen;
memset(cfg, 0, sizeof(*cfg));
cfg->fc_nlinfo.nl_net = net;
if (rt->rt_dst.sa_family != AF_INET)
return -EAFNOSUPPORT;
/*
* Check mask for validity:
* a) it must be contiguo... | 0 | [
"CWE-399"
] | net-next | fbd40ea0180a2d328c5adc61414dc8bab9335ce2 | 238,236,213,906,836,250,000,000,000,000,000,000,000 | 130 | ipv4: Don't do expensive useless work during inetdev destroy.
When an inetdev is destroyed, every address assigned to the interface
is removed. And in this scenerio we do two pointless things which can
be very expensive if the number of assigned interfaces is large:
1) Address promotion. We are deleting all address... |
static int bell(void *user)
{
VTermScreen *screen = user;
if(screen->callbacks && screen->callbacks->bell)
return (*screen->callbacks->bell)(screen->cbdata);
return 0;
} | 0 | [
"CWE-476"
] | vim | cd929f7ba8cc5b6d6dcf35c8b34124e969fed6b8 | 77,076,444,038,143,230,000,000,000,000,000,000,000 | 9 | patch 8.1.0633: crash when out of memory while opening a terminal window
Problem: Crash when out of memory while opening a terminal window.
Solution: Handle out-of-memory more gracefully. |
static void qrtr_port_remove(struct qrtr_sock *ipc)
{
struct qrtr_ctrl_pkt *pkt;
struct sk_buff *skb;
int port = ipc->us.sq_port;
struct sockaddr_qrtr to;
to.sq_family = AF_QIPCRTR;
to.sq_node = QRTR_NODE_BCAST;
to.sq_port = QRTR_PORT_CTRL;
skb = qrtr_alloc_ctrl_packet(&pkt, GFP_KERNEL);
if (skb) {
pkt->cm... | 0 | [] | net | 7e78c597c3ebfd0cb329aa09a838734147e4f117 | 120,961,129,138,150,280,000,000,000,000,000,000,000 | 33 | net: qrtr: fix another OOB Read in qrtr_endpoint_post
This check was incomplete, did not consider size is 0:
if (len != ALIGN(size, 4) + hdrlen)
goto err;
if size from qrtr_hdr is 0, the result of ALIGN(size, 4)
will be 0, In case of len == hdrlen and size == 0
in header this check won't fail an... |
GF_Err stbl_Size(GF_Box *s)
{
GF_Err e;
GF_SampleTableBox *ptr = (GF_SampleTableBox *)s;
//Mandatory boxs (but not internally :)
if (ptr->SampleDescription) {
e = gf_isom_box_size((GF_Box *) ptr->SampleDescription);
if (e) return e;
ptr->size += ptr->SampleDescription->size;
}
if (ptr->SampleSize) {
e = ... | 0 | [
"CWE-400",
"CWE-401"
] | gpac | d2371b4b204f0a3c0af51ad4e9b491144dd1225c | 212,873,638,841,540,700,000,000,000,000,000,000,000 | 92 | prevent dref memleak on invalid input (#1183) |
time_t DTime::time()
{
return d_set.tv_sec;
} | 0 | [
"CWE-399"
] | pdns | 881b5b03a590198d03008e4200dd00cc537712f3 | 176,751,640,734,942,040,000,000,000,000,000,000,000 | 4 | Reject qname's wirelength > 255, `chopOff()` handle dot inside labels |
/* Send skb data on a socket. Socket must be locked. */
int skb_send_sock_locked(struct sock *sk, struct sk_buff *skb, int offset,
int len)
{
unsigned int orig_len = len;
struct sk_buff *head = skb;
unsigned short fragidx;
int slen, ret;
do_frag_list:
/* Deal with head data */
while (offset < skb_headlen(sk... | 0 | [
"CWE-20"
] | linux | 2b16f048729bf35e6c28a40cbfad07239f9dcd90 | 207,529,037,788,762,470,000,000,000,000,000,000,000 | 85 | 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... |
static void __swiotlb_unmap_page(struct device *dev, dma_addr_t dev_addr,
size_t size, enum dma_data_direction dir,
struct dma_attrs *attrs)
{
if (!is_device_dma_coherent(dev))
__dma_unmap_area(phys_to_virt(dma_to_phys(dev, dev_addr)), size, dir);
swiotlb_unmap_page(dev, dev_addr, size, dir, attrs);
} | 0 | [
"CWE-200"
] | linux | 6829e274a623187c24f7cfc0e3d35f25d087fcc5 | 1,410,979,563,341,105,700,000,000,000,000,000,000 | 8 | arm64: dma-mapping: always clear allocated buffers
Buffers allocated by dma_alloc_coherent() are always zeroed on Alpha,
ARM (32bit), MIPS, PowerPC, x86/x86_64 and probably other architectures.
It turned out that some drivers rely on this 'feature'. Allocated buffer
might be also exposed to userspace with dma_mmap() c... |
ext4_mb_new_inode_pa(struct ext4_allocation_context *ac)
{
struct super_block *sb = ac->ac_sb;
struct ext4_sb_info *sbi = EXT4_SB(sb);
struct ext4_prealloc_space *pa;
struct ext4_group_info *grp;
struct ext4_inode_info *ei;
/* preallocate only when found space is larger then requested */
BUG_ON(ac->ac_o_ex.fe_l... | 0 | [
"CWE-416"
] | linux | 8844618d8aa7a9973e7b527d038a2a589665002c | 162,531,810,600,478,280,000,000,000,000,000,000,000 | 89 | ext4: only look at the bg_flags field if it is valid
The bg_flags field in the block group descripts is only valid if the
uninit_bg or metadata_csum feature is enabled. We were not
consistently looking at this field; fix this.
Also block group #0 must never have uninitialized allocation bitmaps,
or need to be zeroed... |
const string unquotify(const string &item)
{
if(item.size()<2)
return item;
string::size_type bpos=0, epos=item.size();
if(item[0]=='"')
bpos=1;
if(item[epos-1]=='"')
epos-=1;
return item.substr(bpos,epos-bpos);
} | 0 | [
"CWE-399"
] | pdns | 881b5b03a590198d03008e4200dd00cc537712f3 | 125,916,338,374,232,570,000,000,000,000,000,000,000 | 15 | Reject qname's wirelength > 255, `chopOff()` handle dot inside labels |
static int clone_slice(H264Context *dst, H264Context *src)
{
memcpy(dst->block_offset, src->block_offset, sizeof(dst->block_offset));
dst->cur_pic_ptr = src->cur_pic_ptr;
dst->cur_pic = src->cur_pic;
dst->linesize = src->linesize;
dst->uvlinesize = src->uvlinesize;
dst->first_field = src... | 0 | [
"CWE-703"
] | FFmpeg | 29ffeef5e73b8f41ff3a3f2242d356759c66f91f | 451,506,347,534,484,200,000,000,000,000,000,000 | 24 | avcodec/h264: do not trust last_pic_droppable when marking pictures as done
This simplifies the code and fixes a deadlock
Fixes Ticket2927
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> |
static void iwl_sta_ucode_activate(struct iwl_priv *priv, u8 sta_id)
{
if (!(priv->stations[sta_id].used & IWL_STA_DRIVER_ACTIVE))
IWL_ERR(priv, "ACTIVATE a non DRIVER active station id %u "
"addr %pM\n",
sta_id, priv->stations[sta_id].sta.sta.addr);
if (priv->stations[sta_id].used & IWL_STA_UCODE_ACTIVE) {... | 1 | [
"CWE-119",
"CWE-787"
] | linux | 2da424b0773cea3db47e1e81db71eeebde8269d4 | 280,514,546,215,644,700,000,000,000,000,000,000,000 | 19 | iwlwifi: Sanity check for sta_id
On my testing, I saw some strange behavior
[ 421.739708] iwlwifi 0000:01:00.0: ACTIVATE a non DRIVER active station id 148 addr 00:00:00:00:00:00
[ 421.739719] iwlwifi 0000:01:00.0: iwl_sta_ucode_activate Added STA id 148 addr 00:00:00:00:00:00 to uCode
not sure how it happen, but ... |
int hns_rcb_get_ring_num(struct dsaf_device *dsaf_dev)
{
switch (dsaf_dev->dsaf_mode) {
case DSAF_MODE_ENABLE_FIX:
case DSAF_MODE_DISABLE_SP:
return 1;
case DSAF_MODE_DISABLE_FIX:
return 6;
case DSAF_MODE_ENABLE_0VM:
return 32;
case DSAF_MODE_DISABLE_6PORT_0VM:
case DSAF_MODE_ENABLE_16VM:
case DSAF_MOD... | 0 | [
"CWE-119",
"CWE-703"
] | linux | 412b65d15a7f8a93794653968308fc100f2aa87c | 157,093,356,821,790,350,000,000,000,000,000,000,000 | 35 | net: hns: fix ethtool_get_strings overflow in hns driver
hns_get_sset_count() returns HNS_NET_STATS_CNT and the data space allocated
is not enough for ethtool_get_strings(), which will cause random memory
corruption.
When SLAB and DEBUG_SLAB are both enabled, memory corruptions like the
the following can be observed ... |
void operator()(OpKernelContext* context, const Tensor& input_tensor,
Tensor& output_tensor, int n, bool reverse) {
const T* input = input_tensor.flat<T>().data();
T* output = output_tensor.flat<T>().data();
// Assume input_shape is [d1,d2,...dk], and output_shape is [d1,d2...dk-1],
... | 0 | [
"CWE-703",
"CWE-197"
] | tensorflow | ca8c013b5e97b1373b3bb1c97ea655e69f31a575 | 93,561,155,282,865,970,000,000,000,000,000,000,000 | 36 | Prevent integer truncation from 64 to 32 bits.
The `tensorflow::Shard` functions last argument must be a 2 argument function where both arguments are `int64` (`long long`, 64 bits). However, there are usages where code passes in a function where arguments are `int` or `int32` (32 bits). In these cases, it is possible ... |
static int ModuleCompare(const void *x,const void *y)
{
const char
**p,
**q;
p=(const char **) x;
q=(const char **) y;
return(LocaleCompare(*p,*q));
} | 0 | [
"CWE-200",
"CWE-362"
] | ImageMagick | 01faddbe2711a4156180c4a92837e2f23683cc68 | 19,568,263,953,975,582,000,000,000,000,000,000,000 | 10 | Use the correct rights. |
mb_lefthalve(int row, int col)
{
return (*mb_off2cells)(LineOffset[row] + col,
LineOffset[row] + screen_Columns) > 1;
} | 0 | [
"CWE-122",
"CWE-787"
] | vim | f6d39c31d2177549a986d170e192d8351bd571e2 | 115,604,695,237,173,570,000,000,000,000,000,000,000 | 5 | patch 9.0.0220: invalid memory access with for loop over NULL string
Problem: Invalid memory access with for loop over NULL string.
Solution: Make sure mb_ptr2len() consistently returns zero for NUL. |
static inline double MagickLog10(const double x)
{
#define Log10Epsilon (1.0e-11)
if (fabs(x) < Log10Epsilon)
return(log10(Log10Epsilon));
return(log10(fabs(x)));
} | 0 | [
"CWE-119",
"CWE-787"
] | ImageMagick6 | 91e58d967a92250439ede038ccfb0913a81e59fe | 209,494,753,919,192,900,000,000,000,000,000,000,000 | 8 | https://github.com/ImageMagick/ImageMagick/issues/1615 |
set_tagfunc_option(void)
{
#ifdef FEAT_EVAL
free_callback(&tfu_cb);
free_callback(&curbuf->b_tfu_cb);
if (*curbuf->b_p_tfu == NUL)
return OK;
if (option_set_callback_func(curbuf->b_p_tfu, &tfu_cb) == FAIL)
return FAIL;
copy_callback(&curbuf->b_tfu_cb, &tfu_cb);
#endif
return OK;
} | 0 | [
"CWE-416"
] | vim | adce965162dd89bf29ee0e5baf53652e7515762c | 210,615,668,613,465,760,000,000,000,000,000,000,000 | 17 | patch 9.0.0246: using freed memory when 'tagfunc' deletes the buffer
Problem: Using freed memory when 'tagfunc' deletes the buffer.
Solution: Make a copy of the tag name. |
void bandwidth_del_run_file(pid_t pid) {
char *fname;
if (asprintf(&fname, "%s/%d-bandwidth", RUN_FIREJAIL_BANDWIDTH_DIR, (int) pid) == -1)
errExit("asprintf");
unlink(fname);
free(fname);
} | 0 | [
"CWE-284",
"CWE-269"
] | firejail | 5d43fdcd215203868d440ffc42036f5f5ffc89fc | 65,801,095,461,797,770,000,000,000,000,000,000,000 | 7 | security fix |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.