func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
is_code_ctype(OnigCodePoint code, unsigned int ctype)
{
if (code < 256)
return ENC_IS_ISO_8859_14_CTYPE(code, ctype);
else
return FALSE;
} | 0 | [
"CWE-125"
] | oniguruma | 65a9b1aa03c9bc2dc01b074295b9603232cb3b78 | 94,096,153,479,122,360,000,000,000,000,000,000,000 | 7 | onig-5.9.2 |
static void atusb_work_urbs(struct work_struct *work)
{
struct atusb *atusb =
container_of(to_delayed_work(work), struct atusb, work);
struct usb_device *usb_dev = atusb->usb_dev;
struct urb *urb;
int ret;
if (atusb->shutdown)
return;
do {
urb = usb_get_from_anchor(&atusb->idle_urbs);
if (!urb)
re... | 0 | [
"CWE-399",
"CWE-119"
] | linux | 05a974efa4bdf6e2a150e3f27dc6fcf0a9ad5655 | 268,138,997,711,012,860,000,000,000,000,000,000,000 | 24 | ieee802154: atusb: do not use the stack for buffers to make them DMA able
From 4.9 we should really avoid using the stack here as this will not be DMA
able on various platforms. This changes the buffers already being present in
time of 4.9 being released. This should go into stable as well.
Reported-by: Dan Carpenter... |
int __btrfs_setxattr(struct btrfs_trans_handle *trans,
struct inode *inode, const char *name,
const void *value, size_t size, int flags)
{
struct btrfs_root *root = BTRFS_I(inode)->root;
int ret;
if (trans)
return do_setxattr(trans, inode, name, value, size, flags);
trans = btrfs_start_transaction... | 0 | [
"CWE-416",
"CWE-362"
] | linux | 5f5bc6b1e2d5a6f827bc860ef2dc5b6f365d1339 | 155,304,880,567,546,450,000,000,000,000,000,000,000 | 27 | Btrfs: make xattr replace operations atomic
Replacing a xattr consists of doing a lookup for its existing value, delete
the current value from the respective leaf, release the search path and then
finally insert the new value. This leaves a time window where readers (getxattr,
listxattrs) won't see any value for the x... |
generate_hash_secret_salt(void)
{
unsigned int seed = time(NULL) % UINT_MAX;
srand(seed);
return rand();
} | 0 | [
"CWE-119"
] | libexpat | ba0f9c3b40c264b8dd392e02a7a060a8fa54f032 | 159,946,243,318,520,620,000,000,000,000,000,000,000 | 6 | CVE-2015-1283 Sanity check size calculations. r=peterv, a=abillings
https://sourceforge.net/p/expat/bugs/528/ |
void send_message_wrap(ConnectionRef con, const bufferlist& data) {
Message *m = new MPing();
Payload pl{Payload::PING, index++, data};
bufferlist bl;
::encode(pl, bl);
m->set_data(bl);
if (!con->get_messenger()->get_default_policy().lossy) {
Mutex::Locker l(lock);
sent[pl.seq] = p... | 0 | [
"CWE-287",
"CWE-284"
] | ceph | 5ead97120e07054d80623dada90a5cc764c28468 | 336,974,533,706,783,900,000,000,000,000,000,000,000 | 14 | 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 ... |
local void zlib_free(voidpf opaque, voidpf address)
{
free_track(opaque, address);
} | 0 | [
"CWE-703",
"CWE-22"
] | pigz | fdad1406b3ec809f4954ff7cdf9e99eb18c2458f | 99,241,750,507,176,550,000,000,000,000,000,000,000 | 4 | When decompressing with -N or -NT, strip any path from header name.
This uses the path of the compressed file combined with the name
from the header as the name of the decompressed output file. Any
path information in the header name is stripped. This avoids a
possible vulnerability where absolute or descending path... |
int imap_rename_mailbox (IMAP_DATA* idata, IMAP_MBOX* mx, const char* newname)
{
char oldmbox[LONG_STRING];
char newmbox[LONG_STRING];
BUFFER *b;
int rc = 0;
imap_munge_mbox_name (idata, oldmbox, sizeof (oldmbox), mx->mbox);
imap_munge_mbox_name (idata, newmbox, sizeof (newmbox), newname);
b = mutt_buff... | 0 | [
"CWE-200",
"CWE-319"
] | mutt | 3e88866dc60b5fa6aaba6fd7c1710c12c1c3cd01 | 221,112,667,882,827,370,000,000,000,000,000,000,000 | 20 | Prevent possible IMAP MITM via PREAUTH response.
This is similar to CVE-2014-2567 and CVE-2020-12398. STARTTLS is not
allowed in the Authenticated state, so previously Mutt would
implicitly mark the connection as authenticated and skip any
encryption checking/enabling.
No credentials are exposed, but it does allow m... |
static void __init hugetlb_hstate_alloc_pages_onenode(struct hstate *h, int nid)
{
unsigned long i;
char buf[32];
for (i = 0; i < h->max_huge_pages_node[nid]; ++i) {
if (hstate_is_gigantic(h)) {
if (!alloc_bootmem_huge_page(h, nid))
break;
} else {
struct page *page;
gfp_t gfp_mask = htlb_alloc_mas... | 0 | [] | linux | a4a118f2eead1d6c49e00765de89878288d4b890 | 191,325,515,125,449,270,000,000,000,000,000,000,000 | 30 | hugetlbfs: flush TLBs correctly after huge_pmd_unshare
When __unmap_hugepage_range() calls to huge_pmd_unshare() succeed, a TLB
flush is missing. This TLB flush must be performed before releasing the
i_mmap_rwsem, in order to prevent an unshared PMDs page from being
released and reused before the TLB flush took place... |
MONGO_EXPORT int bson_append_long( bson *b, const char *name, const int64_t i ) {
if ( bson_append_estart( b , BSON_LONG, name, 8 ) == BSON_ERROR )
return BSON_ERROR;
bson_append64( b , &i );
return BSON_OK;
} | 0 | [
"CWE-190"
] | mongo-c-driver-legacy | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | 152,888,742,254,223,640,000,000,000,000,000,000,000 | 6 | don't mix up int and size_t (first pass to fix that) |
rb_str_empty(str)
VALUE str;
{
if (RSTRING(str)->len == 0)
return Qtrue;
return Qfalse;
} | 0 | [
"CWE-20"
] | ruby | e926ef5233cc9f1035d3d51068abe9df8b5429da | 228,540,124,319,704,070,000,000,000,000,000,000,000 | 7 | * random.c (rb_genrand_int32, rb_genrand_real), intern.h: Export.
* string.c (rb_str_tmp_new), intern.h: New function.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
int CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont, unsigned int flags)
{
BIO *cmsbio;
int ret = 0;
if (!(cmsbio = CMS_dataInit(cms, dcont))) {
CMSerr(CMS_F_CMS_FINAL, CMS_R_CMS_LIB);
return 0;
}
SMIME_crlf_copy(data, cmsbio, flags);
(void)BIO_flush(cmsbio);
if (!CM... | 0 | [
"CWE-327"
] | openssl | e21f8cf78a125cd3c8c0d1a1a6c8bb0b901f893f | 233,444,801,434,623,580,000,000,000,000,000,000,000 | 26 | Fix a padding oracle in PKCS7_dataDecode and CMS_decrypt_set1_pkey
An attack is simple, if the first CMS_recipientInfo is valid but the
second CMS_recipientInfo is chosen ciphertext. If the second
recipientInfo decodes to PKCS #1 v1.5 form plaintext, the correct
encryption key will be replaced by garbage, and the mess... |
hb_buffer_new (void)
{
hb_buffer_t *buffer;
buffer = malloc (sizeof (hb_buffer_t));
if (HB_UNLIKELY (!buffer))
return NULL;
buffer->allocated = 0;
buffer->in_string = NULL;
buffer->alt_string = NULL;
buffer->positions = NULL;
hb_buffer_clear (buffer);
return buffer;
} | 0 | [] | pango | 336bb3201096bdd0494d29926dd44e8cca8bed26 | 191,432,428,080,856,330,000,000,000,000,000,000,000 | 17 | [HB] Remove all references to the old code! |
static void allocate_segment_by_default(struct f2fs_sb_info *sbi,
int type, bool force)
{
struct curseg_info *curseg = CURSEG_I(sbi, type);
if (force)
new_curseg(sbi, type, true);
else if (!is_set_ckpt_flags(sbi, CP_CRC_RECOVERY_FLAG) &&
type == CURSEG_WARM_NODE)
new_curseg(sbi, type, false);
else i... | 0 | [
"CWE-200",
"CWE-476"
] | linux | d4fdf8ba0e5808ba9ad6b44337783bd9935e0982 | 180,612,980,675,110,740,000,000,000,000,000,000,000 | 19 | f2fs: fix a panic caused by NULL flush_cmd_control
Mount fs with option noflush_merge, boot failed for illegal address
fcc in function f2fs_issue_flush:
if (!test_opt(sbi, FLUSH_MERGE)) {
ret = submit_flush_wait(sbi);
atomic_inc(&fcc->issued_flush); -> Here, fcc illegal
... |
static struct posix_acl *reiserfs_posix_acl_from_disk(const void *value, size_t size)
{
const char *end = (char *)value + size;
int n, count;
struct posix_acl *acl;
if (!value)
return NULL;
if (size < sizeof(reiserfs_acl_header))
return ERR_PTR(-EINVAL);
if (((reiserfs_acl_header *) value)->a_version !=
... | 0 | [
"CWE-862",
"CWE-285"
] | linux | 073931017b49d9458aa351605b43a7e34598caef | 227,985,410,391,775,640,000,000,000,000,000,000,000 | 66 | posix_acl: Clear SGID bit when setting file permissions
When file permissions are modified via chmod(2) and the user is not in
the owning group or capable of CAP_FSETID, the setgid bit is cleared in
inode_change_ok(). Setting a POSIX ACL via setxattr(2) sets the file
permissions as well as the new ACL, but doesn't cl... |
CNF_Initialise(int r, int client_only)
{
restarted = r;
hwts_interfaces = ARR_CreateInstance(sizeof (CNF_HwTsInterface));
init_sources = ARR_CreateInstance(sizeof (IPAddr));
ntp_sources = ARR_CreateInstance(sizeof (NTP_Source));
refclock_sources = ARR_CreateInstance(sizeof (RefclockParameters));
broadcast... | 0 | [
"CWE-59"
] | chrony | e18903a6b56341481a2e08469c0602010bf7bfe3 | 52,019,689,852,460,660,000,000,000,000,000,000,000 | 29 | switch to new util file functions
Replace all fopen(), rename(), and unlink() calls with the new util
functions. |
DEFUN (clear_bgp_as_soft,
clear_bgp_as_soft_cmd,
"clear bgp <1-65535> soft",
CLEAR_STR
BGP_STR
"Clear peers with the AS number\n"
"Soft reconfig\n")
{
return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_as,
BGP_CLEAR_SOFT_BOTH, argv[0]);
} | 0 | [
"CWE-125"
] | frr | 6d58272b4cf96f0daa846210dd2104877900f921 | 122,981,888,974,286,310,000,000,000,000,000,000,000 | 11 | [bgpd] cleanup, compact and consolidate capability parsing code
2007-07-26 Paul Jakma <paul.jakma@sun.com>
* (general) Clean up and compact capability parsing slightly.
Consolidate validation of length and logging of generic TLV, and
memcpy of capability data, thus removing such from cap specifc
code (not a... |
display_view_pair_list (struct dwarf_section *section,
unsigned char **vstart_ptr,
unsigned int debug_info_entry,
unsigned char *vlistend)
{
unsigned char *vstart = *vstart_ptr;
unsigned char *section_end = section->start + section->size;
unsigned int pointer_size = debug_information [debug_info_entry].p... | 0 | [
"CWE-703"
] | binutils-gdb | 695c6dfe7e85006b98c8b746f3fd5f913c94ebff | 120,094,087,269,029,340,000,000,000,000,000,000,000 | 34 | PR29370, infinite loop in display_debug_abbrev
The PR29370 testcase is a fuzzed object file with multiple
.trace_abbrev sections. Multiple .trace_abbrev or .debug_abbrev
sections are not a violation of the DWARF standard. The DWARF5
standard even gives an example of multiple .debug_abbrev sections
contained in group... |
static void free_out_dir(struct out_dir *outdir)
{
free(outdir->buf);
free(outdir->hashes);
outdir->max = 0;
outdir->num =0;
} | 0 | [
"CWE-787"
] | e2fsprogs | 8dd73c149f418238f19791f9d666089ef9734dff | 33,220,039,764,921,603,000,000,000,000,000,000,000 | 7 | e2fsck: abort if there is a corrupted directory block when rehashing
In e2fsck pass 3a, when we are rehashing directories, at least in
theory, all of the directories should have had corruptions with
respect to directory entry structure fixed. However, it's possible
(for example, if the user declined a fix) that we ca... |
static int cma_resolve_ib_route(struct rdma_id_private *id_priv,
unsigned long timeout_ms)
{
struct rdma_route *route = &id_priv->id.route;
struct cma_work *work;
int ret;
work = kzalloc(sizeof *work, GFP_KERNEL);
if (!work)
return -ENOMEM;
cma_init_resolve_route_work(work, id_priv);
if (!route->path_re... | 0 | [
"CWE-416"
] | linux | bc0bdc5afaa740d782fbf936aaeebd65e5c2921d | 141,686,833,926,307,750,000,000,000,000,000,000,000 | 32 | RDMA/cma: Do not change route.addr.src_addr.ss_family
If the state is not idle then rdma_bind_addr() will immediately fail and
no change to global state should happen.
For instance if the state is already RDMA_CM_LISTEN then this will corrupt
the src_addr and would cause the test in cma_cancel_operation():
if (cma... |
static int vmx_deliver_posted_interrupt(struct kvm_vcpu *vcpu, int vector)
{
struct vcpu_vmx *vmx = to_vmx(vcpu);
int r;
r = vmx_deliver_nested_posted_interrupt(vcpu, vector);
if (!r)
return 0;
if (!vcpu->arch.apicv_active)
return -1;
if (pi_test_and_set_pir(vector, &vmx->pi_desc))
return 0;
/* If a pr... | 0 | [
"CWE-703"
] | linux | 6cd88243c7e03845a450795e134b488fc2afb736 | 166,186,517,482,911,020,000,000,000,000,000,000,000 | 28 | KVM: x86: do not report a vCPU as preempted outside instruction boundaries
If a vCPU is outside guest mode and is scheduled out, it might be in the
process of making a memory access. A problem occurs if another vCPU uses
the PV TLB flush feature during the period when the vCPU is scheduled
out, and a virtual address ... |
void reply_ntrename(struct smb_request *req)
{
connection_struct *conn = req->conn;
struct smb_filename *smb_fname_old = NULL;
struct smb_filename *smb_fname_new = NULL;
char *oldname = NULL;
char *newname = NULL;
const char *p;
NTSTATUS status;
bool src_has_wcard = False;
bool dest_has_wcard = False;
uint32 ... | 0 | [
"CWE-189"
] | samba | efdbcabbe97a594572d71d714d258a5854c5d8ce | 23,484,427,567,091,642,000,000,000,000,000,000,000 | 176 | Fix bug #10010 - Missing integer wrap protection in EA list reading can cause server to loop with DOS.
Ensure we never wrap whilst adding client provided input.
CVE-2013-4124
Signed-off-by: Jeremy Allison <jra@samba.org> |
static struct treesame_state *initialise_treesame(struct rev_info *revs, struct commit *commit)
{
unsigned n = commit_list_count(commit->parents);
struct treesame_state *st = xcalloc(1, sizeof(*st) + n);
st->nparents = n;
add_decoration(&revs->treesame, &commit->object, st);
return st;
} | 0 | [
"CWE-119",
"CWE-787"
] | git | 34fa79a6cde56d6d428ab0d3160cb094ebad3305 | 77,327,925,744,483,160,000,000,000,000,000,000,000 | 8 | prefer memcpy to strcpy
When we already know the length of a string (e.g., because
we just malloc'd to fit it), it's nicer to use memcpy than
strcpy, as it makes it more obvious that we are not going to
overflow the buffer (because the size we pass matches the
size in the allocation).
This also eliminates calls to st... |
xfs_writepage_map(
struct xfs_writepage_ctx *wpc,
struct writeback_control *wbc,
struct inode *inode,
struct page *page,
loff_t offset,
__uint64_t end_offset)
{
LIST_HEAD(submit_list);
struct xfs_ioend *ioend, *next;
struct buffer_head *bh, *head;
ssize_t len = 1 << inode->i_blkbits;
int ... | 0 | [
"CWE-362"
] | linux | 04197b341f23b908193308b8d63d17ff23232598 | 129,422,603,946,886,510,000,000,000,000,000,000,000 | 143 | xfs: don't BUG() on mixed direct and mapped I/O
We've had reports of generic/095 causing XFS to BUG() in
__xfs_get_blocks() due to the existence of delalloc blocks on a
direct I/O read. generic/095 issues a mix of various types of I/O,
including direct and memory mapped I/O to a single file. This is
clearly not suppor... |
utf16be_mbc_to_code(const UChar* p, const UChar* end)
{
OnigCodePoint code;
if (UTF16_IS_SURROGATE_FIRST(*p)) {
if (end - p < 4) return 0;
code = ((((p[0] - 0xd8) << 2) + ((p[1] & 0xc0) >> 6) + 1) << 16)
+ ((((p[1] & 0x3f) << 2) + (p[2] - 0xdc)) << 8)
+ p[3];
}
else {
if (end - p ... | 0 | [
"CWE-125"
] | php-src | 9d6c59eeea88a3e9d7039cb4fed5126ef704593a | 12,887,083,838,499,531,000,000,000,000,000,000,000 | 16 | Fix bug #77418 - Heap overflow in utf32be_mbc_to_code |
static int check_ld_imm(struct bpf_verifier_env *env, struct bpf_insn *insn)
{
struct bpf_insn_aux_data *aux = cur_aux(env);
struct bpf_reg_state *regs = cur_regs(env);
struct bpf_map *map;
int err;
if (BPF_SIZE(insn->code) != BPF_DW) {
verbose(env, "invalid BPF_LD_IMM insn\n");
return -EINVAL;
}
if (insn->... | 0 | [
"CWE-119",
"CWE-681",
"CWE-787"
] | linux | 5b9fbeb75b6a98955f628e205ac26689bcb1383e | 181,236,091,921,155,740,000,000,000,000,000,000,000 | 46 | 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... |
static __always_inline void set_root(struct nameidata *nd)
{
get_fs_root(current->fs, &nd->root);
} | 0 | [
"CWE-416"
] | linux | f15133df088ecadd141ea1907f2c96df67c729f0 | 329,261,365,154,991,740,000,000,000,000,000,000,000 | 4 | path_openat(): fix double fput()
path_openat() jumps to the wrong place after do_tmpfile() - it has
already done path_cleanup() (as part of path_lookupat() called by
do_tmpfile()), so doing that again can lead to double fput().
Cc: stable@vger.kernel.org # v3.11+
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> |
SetMatViewPopulatedState(Relation relation, bool newstate)
{
Relation pgrel;
HeapTuple tuple;
Assert(relation->rd_rel->relkind == RELKIND_MATVIEW);
/*
* Update relation's pg_class entry. Crucial side-effect: other backends
* (and this one too!) are sent SI message to make them rebuild relcache
* entries.
... | 0 | [
"CWE-209"
] | postgres | 804b6b6db4dcfc590a468e7be390738f9f7755fb | 333,985,407,992,342,600,000,000,000,000,000,000,000 | 34 | 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... |
bool check_create_options(DDL_options_st options)
{
if (options.or_replace() && options.if_not_exists())
{
my_error(ER_WRONG_USAGE, MYF(0), "OR REPLACE", "IF NOT EXISTS");
return true;
}
return false;
} | 0 | [
"CWE-703"
] | server | 39feab3cd31b5414aa9b428eaba915c251ac34a2 | 319,224,816,706,422,100,000,000,000,000,000,000,000 | 9 | MDEV-26412 Server crash in Item_field::fix_outer_field for INSERT SELECT
IF an INSERT/REPLACE SELECT statement contained an ON expression in the top
level select and this expression used a subquery with a column reference
that could not be resolved then an attempt to resolve this reference as
an outer reference caused... |
PJ_DEF(pj_bool_t) pjsip_tx_data_is_valid( pjsip_tx_data *tdata )
{
return tdata->buf.cur != tdata->buf.start;
} | 0 | [
"CWE-297",
"CWE-295"
] | pjproject | 67e46c1ac45ad784db5b9080f5ed8b133c122872 | 336,400,384,234,430,160,000,000,000,000,000,000,000 | 4 | Merge pull request from GHSA-8hcp-hm38-mfph
* Check hostname during TLS transport selection
* revision based on feedback
* remove the code in create_request that has been moved |
GF_Err gf_isom_av1_config_new(GF_ISOFile *the_file, u32 trackNumber, GF_AV1Config *cfg, const char *URLname, const char *URNname, u32 *outDescriptionIndex)
{
GF_TrackBox *trak;
GF_Err e;
u32 dataRefIndex;
GF_MPEGVisualSampleEntryBox *entry;
GF_SampleDescriptionBox *stsd;
e = CanAccessMovie(the_file, GF_ISOM_OPEN... | 0 | [
"CWE-401"
] | gpac | 0a85029d694f992f3631e2f249e4999daee15cbf | 21,085,261,633,421,550,000,000,000,000,000,000,000 | 36 | fixed #1785 (fuzz) |
static int md_require_https_maybe(request_rec *r)
{
const md_srv_conf_t *sc;
apr_uri_t uri;
const char *s;
int status;
if (opt_ssl_is_https
&& strncmp(WELL_KNOWN_PREFIX, r->parsed_uri.path, sizeof(WELL_KNOWN_PREFIX)-1)) {
sc = ap_get_module_config(r->server->module_con... | 1 | [
"CWE-476"
] | mod_md | e71001955809247b3aa4d269e1e0741b4fe0fc3d | 4,862,763,705,332,507,000,000,000,000,000,000,000 | 51 | v1.1.12, notifycmd improvements |
test_bson_init_static (void)
{
static const uint8_t data[5] = {5};
bson_t b;
bson_init_static (&b, data, sizeof data);
BSON_ASSERT ((b.flags & BSON_FLAG_RDONLY));
bson_destroy (&b);
} | 0 | [
"CWE-125"
] | libbson | 42900956dc461dfe7fb91d93361d10737c1602b3 | 184,891,608,479,234,040,000,000,000,000,000,000,000 | 9 | CDRIVER-2269 Check for zero string length in codewscope |
PHP_FUNCTION(imagesetstyle)
{
zval *IM, *styles;
gdImagePtr im;
int * stylearr;
int index;
HashPosition pos;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra", &IM, &styles) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(im, gdImagePtr, &IM, -1, "Image", le_gd);
/* copy the style values in the style... | 0 | [
"CWE-703",
"CWE-189"
] | php-src | 2938329ce19cb8c4197dec146c3ec887c6f61d01 | 229,140,395,491,835,980,000,000,000,000,000,000,000 | 43 | Fixed bug #66356 (Heap Overflow Vulnerability in imagecrop())
And also fixed the bug: arguments are altered after some calls |
static __init int hardware_setup(void)
{
int r = -ENOMEM, i, msr;
rdmsrl_safe(MSR_EFER, &host_efer);
for (i = 0; i < ARRAY_SIZE(vmx_msr_index); ++i)
kvm_define_shared_msr(i, vmx_msr_index[i]);
vmx_io_bitmap_a = (unsigned long *)__get_free_page(GFP_KERNEL);
if (!vmx_io_bitmap_a)
return r;
vmx_io_bitmap_b =... | 1 | [
"CWE-284",
"CWE-264"
] | linux | 3ce424e45411cf5a13105e0386b6ecf6eeb4f66f | 290,308,019,200,445,420,000,000,000,000,000,000,000 | 209 | kvm:vmx: more complete state update on APICv on/off
The function to update APICv on/off state (in particular, to deactivate
it when enabling Hyper-V SynIC) is incomplete: it doesn't adjust
APICv-related fields among secondary processor-based VM-execution
controls. As a result, Windows 2012 guests get stuck when SynIC... |
void set_command(enum_sql_command command,
uint scope,
DDL_options_st options)
{
set_command(command, options);
create_info.options|= scope; // HA_LEX_CREATE_TMP_TABLE or 0
} | 0 | [
"CWE-703"
] | server | 39feab3cd31b5414aa9b428eaba915c251ac34a2 | 303,474,369,677,535,300,000,000,000,000,000,000,000 | 7 | MDEV-26412 Server crash in Item_field::fix_outer_field for INSERT SELECT
IF an INSERT/REPLACE SELECT statement contained an ON expression in the top
level select and this expression used a subquery with a column reference
that could not be resolved then an attempt to resolve this reference as
an outer reference caused... |
brand ()
{
/* From "Random number generators: good ones are hard to find",
Park and Miller, Communications of the ACM, vol. 31, no. 10,
October 1988, p. 1195. filtered through FreeBSD */
long h, l;
/* Can't seed with 0. */
if (rseed == 0)
rseed = 123459876;
h = rseed / 127773;
l = rseed % 127... | 0 | [] | bash | 863d31ae775d56b785dc5b0105b6d251515d81d5 | 156,465,758,893,710,700,000,000,000,000,000,000,000 | 19 | commit bash-20120224 snapshot |
_equalCreateEnumStmt(const CreateEnumStmt *a, const CreateEnumStmt *b)
{
COMPARE_NODE_FIELD(typeName);
COMPARE_NODE_FIELD(vals);
return true;
} | 0 | [
"CWE-362"
] | postgres | 5f173040e324f6c2eebb90d86cf1b0cdb5890f0a | 226,647,254,445,317,460,000,000,000,000,000,000,000 | 7 | 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... |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE_EQ(context, NumInputs(node), 2);
OpContext op_context(context, node);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), op_context.params->num_splits);
auto input_type = op_context.input->type;
TF_LITE_ENSURE(context,
... | 1 | [
"CWE-125",
"CWE-787"
] | tensorflow | 1970c2158b1ffa416d159d03c3370b9a462aee35 | 287,143,741,767,714,200,000,000,000,000,000,000,000 | 25 | [tflite]: Insert `nullptr` checks when obtaining tensors.
As part of ongoing refactoring, `tflite::GetInput`, `tflite::GetOutput`, `tflite::GetTemporary` and `tflite::GetIntermediates` will return `nullptr` in some cases. Hence, we insert the `nullptr` checks on all usages.
We also insert `nullptr` checks on usages o... |
int lzxd_decompress(struct lzxd_stream *lzx, off_t out_bytes) {
/* bitstream and huffman reading variables */
register unsigned int bit_buffer;
register int bits_left, i=0;
unsigned char *i_ptr, *i_end;
register unsigned short sym;
int match_length, length_footer, extra, verbatim_bits, bytes_todo;
int th... | 1 | [
"CWE-703",
"CWE-189"
] | libmspack | 18b6a2cc0b87536015bedd4f7763e6b02d5aa4f3 | 231,285,809,750,050,000,000,000,000,000,000,000,000 | 499 | Prevent a 1-byte underread of the input buffer if an odd-sized data block comes just before an uncompressed block header |
static int nfs_init_server(struct nfs_server *server, const struct nfs_mount_data *data)
{
struct nfs_client *clp;
int error, nfsvers = 2;
dprintk("--> nfs_init_server()\n");
#ifdef CONFIG_NFS_V3
if (data->flags & NFS_MOUNT_VER3)
nfsvers = 3;
#endif
/* Allocate or find a client reference we can use */
clp = ... | 0 | [
"CWE-20"
] | linux-2.6 | 54af3bb543c071769141387a42deaaab5074da55 | 337,497,672,690,720,030,000,000,000,000,000,000,000 | 59 | NFS: Fix an Oops in encode_lookup()
It doesn't look as if the NFS file name limit is being initialised correctly
in the struct nfs_server. Make sure that we limit whatever is being set in
nfs_probe_fsinfo() and nfs_init_server().
Also ensure that readdirplus and nfs4_path_walk respect our file name
limits.
Signed-of... |
static ogg_uint32_t bitreverse(ogg_uint32_t x){
x= ((x>>16)&0x0000ffff) | ((x<<16)&0xffff0000);
x= ((x>> 8)&0x00ff00ff) | ((x<< 8)&0xff00ff00);
x= ((x>> 4)&0x0f0f0f0f) | ((x<< 4)&0xf0f0f0f0);
x= ((x>> 2)&0x33333333) | ((x<< 2)&0xcccccccc);
return((x>> 1)&0x55555555) | ((x<< 1)&0xaaaaaaaa);
} | 0 | [
"CWE-787"
] | vorbis | 667ceb4aab60c1f74060143bb24e5f427b3cce5f | 168,450,448,298,582,500,000,000,000,000,000,000,000 | 7 | CVE-2018-5146: Prevent out-of-bounds write in codebook decoding.
Codebooks that are not an exact divisor of the partition size are now
truncated to fit within the partition. |
uint64_t readValue(struct READER *reader, int size) {
int i, c;
uint64_t value;
c = fgetc(reader->fhd);
if (c < 0)
return 0xffffffffffffffffLL;
value = (uint8_t) c;
for (i = 1; i < size; i++) {
c = fgetc(reader->fhd);
if (c < 0)
return 0xffffffffffffffffLL;
value |= ((uint64_t) c) << (i * 8);
}
retur... | 0 | [
"CWE-476",
"CWE-787"
] | libmysofa | 2e6fac6ab6156dae8e8c6f417741388084b70d6f | 122,993,954,372,024,760,000,000,000,000,000,000,000 | 15 | Fixed recursive function calls |
static int vidioc_reqbufs(struct file *file, void *fh, struct v4l2_requestbuffers *b)
{
struct v4l2_loopback_device *dev;
struct v4l2_loopback_opener *opener;
int i;
MARK();
dev = v4l2loopback_getdevice(file);
opener = file->private_data;
dprintk("reqbufs: %d\t%d=%d\n", b->memory, b->count, dev->buffers_number... | 0 | [
"CWE-787"
] | v4l2loopback | 64a216af4c09c9ba9326057d7e78994271827eff | 194,757,449,368,564,200,000,000,000,000,000,000,000 | 63 | add explicit format specifier to printf() invocations
CWE-134 |
static int create_home_and_chdir(const char * const home)
{
char *pathcomp;
char *z;
size_t len;
const char delim = '/';
if (home == NULL || *home != '/') {
return -1;
}
if (chdir(home) == 0) {
return 0;
}
if (create_home == 0) {
return -1;
}
len = st... | 0 | [
"CWE-434"
] | pure-ftpd | 37ad222868e52271905b94afea4fc780d83294b4 | 144,443,468,189,839,480,000,000,000,000,000,000,000 | 51 | Initialize the max upload file size when quotas are enabled
Due to an unwanted check, files causing the quota to be exceeded
were deleted after the upload, but not during the upload.
The bug was introduced in 2009 in version 1.0.23
Spotted by @DroidTest, thanks! |
cd_device_db_empty (CdDeviceDb *ddb,
GError **error)
{
CdDeviceDbPrivate *priv = GET_PRIVATE (ddb);
const gchar *statement;
gchar *error_msg = NULL;
gint rc;
g_return_val_if_fail (CD_IS_DEVICE_DB (ddb), FALSE);
g_return_val_if_fail (priv->db != NULL, FALSE);
statement = "DELETE FROM devices;DELETE FROM... | 0 | [
"CWE-200"
] | colord | adf41f36cf7214d7d6fa8d528b74eba47c377405 | 112,336,232,479,883,470,000,000,000,000,000,000,000 | 25 | Fix a small memory leak in sqlite3_exec()
Fixes https://github.com/hughsie/colord/issues/110 |
void update_cached_date() { cached_date_ = util::http_date(tstamp_cached_); } | 0 | [] | nghttp2 | 95efb3e19d174354ca50c65d5d7227d92bcd60e1 | 315,643,858,800,576,660,000,000,000,000,000,000,000 | 1 | Don't read too greedily |
R_API ut64 r_bin_java_methodref_cp_calc_size(RBinJavaCPTypeObj *obj) {
ut64 size = 0;
// tag
size += 1;
// obj->info.cp_method.class_idx = R_BIN_JAVA_USHORT (buffer, 1);
size += 2;
// obj->info.cp_method.name_and_type_idx = R_BIN_JAVA_USHORT (buffer, 3);
size += 2;
return size;
} | 0 | [
"CWE-119",
"CWE-788"
] | radare2 | 6c4428f018d385fc80a33ecddcb37becea685dd5 | 85,509,595,295,858,430,000,000,000,000,000,000,000 | 10 | Improve boundary checks to fix oobread segfaults ##crash
* Reported by Cen Zhang via huntr.dev
* Reproducer: bins/fuzzed/javaoob-havoc.class |
bool CModules::OnMode2(const CNick* pOpNick, CChan& Channel, char uMode,
const CString& sArg, bool bAdded, bool bNoChange) {
MODUNLOADCHK(OnMode2(pOpNick, Channel, uMode, sArg, bAdded, bNoChange));
return false;
} | 0 | [
"CWE-20",
"CWE-264"
] | znc | 8de9e376ce531fe7f3c8b0aa4876d15b479b7311 | 179,681,385,261,342,040,000,000,000,000,000,000,000 | 5 | Fix remote code execution and privilege escalation vulnerability.
To trigger this, need to have a user already.
Thanks for Jeriko One <jeriko.one@gmx.us> for finding and reporting this.
CVE-2019-12816 |
static inline void netdev_set_xmit_lockdep_class(spinlock_t *lock,
unsigned short dev_type)
{
} | 0 | [
"CWE-399"
] | linux | 6ec82562ffc6f297d0de36d65776cff8e5704867 | 82,055,802,410,745,560,000,000,000,000,000,000,000 | 4 | veth: Dont kfree_skb() after dev_forward_skb()
In case of congestion, netif_rx() frees the skb, so we must assume
dev_forward_skb() also consume skb.
Bug introduced by commit 445409602c092
(veth: move loopback logic to common location)
We must change dev_forward_skb() to always consume skb, and veth to not
double fr... |
static bool is_swapgs_serializing(void)
{
/*
* Technically, swapgs isn't serializing on AMD (despite it previously
* being documented as such in the APM). But according to AMD, %gs is
* updated non-speculatively, and the issuing of %gs-relative memory
* operands will be blocked until the %gs update completes,... | 0 | [] | linux | a2059825986a1c8143fd6698774fa9d83733bb11 | 89,492,005,307,368,170,000,000,000,000,000,000,000 | 11 | x86/speculation: Enable Spectre v1 swapgs mitigations
The previous commit added macro calls in the entry code which mitigate the
Spectre v1 swapgs issue if the X86_FEATURE_FENCE_SWAPGS_* features are
enabled. Enable those features where applicable.
The mitigations may be disabled with "nospectre_v1" or "mitigations... |
static int aes_t4_gcm_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
const unsigned char *iv, int enc)
{
EVP_AES_GCM_CTX *gctx = ctx->cipher_data;
if (!iv && !key)
return 1;
if (key) {
int bits = ctx->key_len * 8;
aes_t4_set_encrypt_key(key, bi... | 0 | [] | openssl | 1a3701f4fe0530a40ec073cd78d02cfcc26c0f8e | 316,089,314,626,419,240,000,000,000,000,000,000,000 | 45 | Sanity check EVP_CTRL_AEAD_TLS_AAD
The various implementations of EVP_CTRL_AEAD_TLS_AAD expect a buffer of at
least 13 bytes long. Add sanity checks to ensure that the length is at
least that. Also add a new constant (EVP_AEAD_TLS1_AAD_LEN) to evp.h to
represent this length. Thanks to Kevin Wojtysiak (Int3 Solutions) ... |
static bool nl80211_get_ap_channel(struct cfg80211_registered_device *rdev,
struct cfg80211_ap_settings *params)
{
struct wireless_dev *wdev;
bool ret = false;
list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) {
if (wdev->iftype != NL80211_IFTYPE_AP &&
wdev->iftype != NL80211_IFTYPE_P2P_GO)
... | 0 | [
"CWE-120"
] | linux | f88eb7c0d002a67ef31aeb7850b42ff69abc46dc | 119,571,815,757,093,380,000,000,000,000,000,000,000 | 21 | nl80211: validate beacon head
We currently don't validate the beacon head, i.e. the header,
fixed part and elements that are to go in front of the TIM
element. This means that the variable elements there can be
malformed, e.g. have a length exceeding the buffer size, but
most downstream code from this assumes that thi... |
njs_array_of(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs,
njs_index_t unused)
{
uint32_t length, i;
njs_array_t *array;
length = nargs > 1 ? nargs - 1 : 0;
array = njs_array_alloc(vm, 0, length, NJS_ARRAY_SPARE);
if (njs_slow_path(array == NULL)) {
return NJS_ERROR;
}
... | 0 | [
"CWE-703"
] | njs | 2e00e95473861846aa8538be87db07699d9f676d | 20,918,211,948,260,428,000,000,000,000,000,000,000 | 23 | Fixed Array.prototype.slice() with slow "this" argument.
Previously, when "this" argument was not a fast array, but the "deleted" array
was a fast array, the "deleted" array may be left in uninitialized state if
"this" argument had gaps.
This fix is to ensure that "deleted" is properly initialized.
This fixes #485 i... |
static int handle_ept_violation(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
{
u64 exit_qualification;
gpa_t gpa;
int gla_validity;
exit_qualification = vmcs_read64(EXIT_QUALIFICATION);
if (exit_qualification & (1 << 6)) {
printk(KERN_ERR "EPT: GPA exceeds GAW!\n");
return -ENOTSUPP;
}
gla_validity = (... | 0 | [
"CWE-20"
] | linux-2.6 | 16175a796d061833aacfbd9672235f2d2725df65 | 185,880,914,426,972,700,000,000,000,000,000,000,000 | 29 | KVM: VMX: Don't allow uninhibited access to EFER on i386
vmx_set_msr() does not allow i386 guests to touch EFER, but they can still
do so through the default: label in the switch. If they set EFER_LME, they
can oops the host.
Fix by having EFER access through the normal channel (which will check for
EFER_LME) even o... |
regcomp (preg, pattern, cflags)
regex_t *preg;
const char *pattern;
int cflags;
{
reg_errcode_t ret;
reg_syntax_t syntax
= (cflags & REG_EXTENDED) ?
RE_SYNTAX_POSIX_EXTENDED : RE_SYNTAX_POSIX_BASIC;
/* regex_compile will allocate the space for the compiled pattern. */
preg->buffer = 0;
... | 0 | [
"CWE-190",
"CWE-252"
] | glibc | 2864e767053317538feafa815046fff89e5a16be | 152,886,586,683,941,220,000,000,000,000,000,000,000 | 71 | Update.
1999-11-09 Ulrich Drepper <drepper@cygnus.com>
* elf/dl-load.c (_dl_dst_count): Allow $ORIGIN to point to
directory with the reference since this is as secure as using the
object with the dependency.
(_dl_dst_substitute): Likewise.
* elf/dl-load.c (_dl_dst_count): Change strings in first two
strncmp ... |
int crypto_hash_walk_done(struct crypto_hash_walk *walk, int err)
{
unsigned int alignmask = walk->alignmask;
unsigned int nbytes = walk->entrylen;
walk->data -= walk->offset;
if (nbytes && walk->offset & alignmask && !err) {
walk->offset = ALIGN(walk->offset, alignmask + 1);
walk->data += walk->offset;
nb... | 0 | [
"CWE-310"
] | linux | 9a5467bf7b6e9e02ec9c3da4e23747c05faeaac6 | 27,687,313,940,042,990,000,000,000,000,000,000,000 | 37 | crypto: user - fix info leaks in report API
Three errors resulting in kernel memory disclosure:
1/ The structures used for the netlink based crypto algorithm report API
are located on the stack. As snprintf() does not fill the remainder of
the buffer with null bytes, those stack bytes will be disclosed to users
of th... |
std::string GetTempFileName() {
#if !defined _MSC_VER && !defined __MINGW32__
std::string temp_file_name_template_str =
std::string(std::getenv("TEST_TMPDIR") ? std::getenv("TEST_TMPDIR")
: ".") +
"/libwebm_temp.XXXXXX";
char* temp_file_name_template =
... | 0 | [
"CWE-20"
] | libvpx | 34d54b04e98dd0bac32e9aab0fbda0bf501bc742 | 247,935,152,563,939,200,000,000,000,000,000,000,000 | 33 | update libwebm to libwebm-1.0.0.27-358-gdbf1d10
changelog:
https://chromium.googlesource.com/webm/libwebm/+log/libwebm-1.0.0.27-351-g9f23fbc..libwebm-1.0.0.27-358-gdbf1d10
Change-Id: I28a6b3ae02a53fb1f2029eee11e9449afb94c8e3 |
void c_SimpleXMLElement::t_addattribute(const String& qname,
const String& value /* = null_string */,
const String& ns /* = null_string */) {
if (qname.empty()) {
raise_warning("Attribute name is required");
return;
}
if (m_n... | 0 | [
"CWE-94"
] | hhvm | 95f96e7287effe2fcdfb9a5338d1a7e4f55b083b | 148,401,437,744,222,630,000,000,000,000,000,000,000 | 48 | Fix libxml_disable_entity_loader()
This wasn't calling requestInit and setting the libxml handler no null.
So the first time an error came along it would reset the handler from
no-op to reading again.
This is a much better fix, we set our custom handler in requestInit and
when libxml_disable_entity_loader we store th... |
static int cma_modify_qp_rts(struct rdma_id_private *id_priv,
struct rdma_conn_param *conn_param)
{
struct ib_qp_attr qp_attr;
int qp_attr_mask, ret;
mutex_lock(&id_priv->qp_mutex);
if (!id_priv->id.qp) {
ret = 0;
goto out;
}
qp_attr.qp_state = IB_QPS_RTS;
ret = rdma_init_qp_attr(&id_priv->id, &qp_... | 0 | [
"CWE-416"
] | linux | bc0bdc5afaa740d782fbf936aaeebd65e5c2921d | 225,731,389,635,147,200,000,000,000,000,000,000,000 | 24 | RDMA/cma: Do not change route.addr.src_addr.ss_family
If the state is not idle then rdma_bind_addr() will immediately fail and
no change to global state should happen.
For instance if the state is already RDMA_CM_LISTEN then this will corrupt
the src_addr and would cause the test in cma_cancel_operation():
if (cma... |
static void php_session_initialize(TSRMLS_D) /* {{{ */
{
char *val = NULL;
int vallen;
if (!PS(mod)) {
php_error_docref(NULL TSRMLS_CC, E_ERROR, "No storage module chosen - failed to initialize session");
return;
}
/* Open session handler first */
if (PS(mod)->s_open(&PS(mod_data), PS(save_path), PS(session... | 0 | [
"CWE-264"
] | php-src | 25e8fcc88fa20dc9d4c47184471003f436927cde | 114,420,241,156,371,070,000,000,000,000,000,000,000 | 52 | Strict session |
*/
int __weak kvm_arch_create_vm_debugfs(struct kvm *kvm)
{
return 0; | 0 | [
"CWE-459"
] | linux | 683412ccf61294d727ead4a73d97397396e69a6b | 335,446,765,016,789,300,000,000,000,000,000,000,000 | 4 | KVM: SEV: add cache flush to solve SEV cache incoherency issues
Flush the CPU caches when memory is reclaimed from an SEV guest (where
reclaim also includes it being unmapped from KVM's memslots). Due to lack
of coherency for SEV encrypted memory, failure to flush results in silent
data corruption if userspace is mal... |
static PHP_FUNCTION(preg_replace_callback)
{
preg_replace_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1, 0);
} | 0 | [
"CWE-119"
] | php-src | c351b47ce85a3a147cfa801fa9f0149ab4160834 | 126,917,472,461,467,040,000,000,000,000,000,000,000 | 4 | Initialize the offset table - PCRE may sometimes miss offsets |
static int fetch_with_import(struct transport *transport,
int nr_heads, struct ref **to_fetch)
{
struct child_process fastimport;
struct helper_data *data = transport->data;
int i;
struct ref *posn;
struct strbuf buf = STRBUF_INIT;
get_helper(transport);
if (get_importer(transport, &fastimport))
die(... | 0 | [] | git | 68061e3470210703cb15594194718d35094afdc0 | 41,297,915,122,075,790,000,000,000,000,000,000,000 | 71 | fast-import: disallow "feature export-marks" by default
The fast-import stream command "feature export-marks=<path>" lets the
stream write marks to an arbitrary path. This may be surprising if you
are running fast-import against an untrusted input (which otherwise
cannot do anything except update Git objects and refs)... |
static ps_sd *ps_sd_new(ps_mm *data, const char *key)
{
php_uint32 hv, slot;
ps_sd *sd;
int keylen;
keylen = strlen(key);
sd = mm_malloc(data->mm, sizeof(ps_sd) + keylen);
if (!sd) {
TSRMLS_FETCH();
php_error_docref(NULL TSRMLS_CC, E_WARNING, "mm_malloc failed, avail %d, err %s", mm_available(data->mm), mm... | 1 | [
"CWE-264"
] | php-src | 25e8fcc88fa20dc9d4c47184471003f436927cde | 163,133,205,239,190,950,000,000,000,000,000,000,000 | 41 | Strict session |
int mem_check_range(struct rxe_mem *mem, u64 iova, size_t length)
{
switch (mem->type) {
case RXE_MEM_TYPE_DMA:
return 0;
case RXE_MEM_TYPE_MR:
case RXE_MEM_TYPE_FMR:
return ((iova < mem->iova) ||
((iova + length) > (mem->iova + mem->length))) ?
-EFAULT : 0;
default:
return -EFAULT;
}
} | 1 | [
"CWE-190"
] | linux | 647bf3d8a8e5777319da92af672289b2a6c4dc66 | 164,071,686,352,454,820,000,000,000,000,000,000,000 | 16 | IB/rxe: Fix mem_check_range integer overflow
Update the range check to avoid integer-overflow in edge case.
Resolves CVE 2016-8636.
Signed-off-by: Eyal Itkin <eyal.itkin@gmail.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <d... |
static void set_entropy(pj_ssl_sock_t *ssock)
{
int ret = 0;
switch (ssock->param.entropy_type) {
#ifndef OPENSSL_NO_EGD
case PJ_SSL_ENTROPY_EGD:
ret = RAND_egd(ssock->param.entropy_path.ptr);
break;
#endif
case PJ_SSL_ENTROPY_RANDOM:
ret = RAND_load_file("/dev/random",255);
break;
case ... | 0 | [
"CWE-362",
"CWE-703"
] | pjproject | d5f95aa066f878b0aef6a64e60b61e8626e664cd | 81,563,080,076,039,480,000,000,000,000,000,000,000 | 31 | Merge pull request from GHSA-cv8x-p47p-99wr
* - Avoid SSL socket parent/listener getting destroyed during handshake by increasing parent's reference count.
- Add missing SSL socket close when the newly accepted SSL socket is discarded in SIP TLS transport.
* - Fix silly mistake: accepted active socket created without... |
lexer_consume_generator (parser_context_t *context_p) /**< context */
{
if (!(context_p->token.flags & LEXER_NO_SKIP_SPACES))
{
lexer_skip_spaces (context_p);
context_p->token.flags = (uint8_t) (context_p->token.flags | LEXER_NO_SKIP_SPACES);
}
if (context_p->source_p >= context_p->source_end_p
|... | 0 | [
"CWE-416"
] | jerryscript | 3bcd48f72d4af01d1304b754ef19fe1a02c96049 | 177,008,596,807,829,920,000,000,000,000,000,000,000 | 20 | 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 |
static void qxl_reset_handler(DeviceState *dev)
{
PCIQXLDevice *d = PCI_QXL(PCI_DEVICE(dev));
qxl_hard_reset(d, 0);
} | 0 | [
"CWE-476"
] | qemu | d52680fc932efb8a2f334cc6993e705ed1e31e99 | 295,447,603,328,177,250,000,000,000,000,000,000,000 | 6 | 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... |
ZrtpPacketConfirm* ZRtp::prepareConfirm2MultiStream(ZrtpPacketConfirm* confirm1, uint32_t* errMsg) {
// check Confirm1 packet using the keys
// prepare Confirm2 packet
// don't update SAS, RS
sendInfo(Info, InfoInitConf1Received);
uint8_t confMac[MAX_DIGEST_LENGTH];
uint32_t macLen;
close... | 0 | [
"CWE-119"
] | ZRTPCPP | c8617100f359b217a974938c5539a1dd8a120b0e | 221,619,198,876,775,970,000,000,000,000,000,000,000 | 64 | Fix vulnerabilities found and reported by Mark Dowd
- limit length of memcpy
- limit number of offered algorithms in Hello packet
- length check in PING packet
- fix a small coding error |
static int snd_usb_playback_open(struct snd_pcm_substream *substream)
{
return snd_usb_pcm_open(substream, SNDRV_PCM_STREAM_PLAYBACK);
} | 0 | [] | sound | 447d6275f0c21f6cc97a88b3a0c601436a4cdf2a | 72,951,196,092,962,380,000,000,000,000,000,000,000 | 4 | ALSA: usb-audio: Add sanity checks for endpoint accesses
Add some sanity check codes before actually accessing the endpoint via
get_endpoint() in order to avoid the invalid access through a
malformed USB descriptor. Mostly just checking bNumEndpoints, but in
one place (snd_microii_spdif_default_get()), the validity o... |
static void SetLexerLocus( TidyDocImpl* doc, Lexer *lexer )
{
lexer->lines = doc->docIn->curline;
lexer->columns = doc->docIn->curcol;
} | 0 | [
"CWE-119"
] | tidy-html5 | c18f27a58792f7fbd0b30a0ff50d6b40a82f940d | 115,615,583,633,304,900,000,000,000,000,000,000,000 | 5 | Issue #217 - avoid len going negative, ever... |
MagickExport void ScaleResampleFilter(ResampleFilter *resample_filter,
const double dux,const double duy,const double dvx,const double dvy)
{
double A,B,C,F;
assert(resample_filter != (ResampleFilter *) NULL);
assert(resample_filter->signature == MagickCoreSignature);
resample_filter->limit_reached = Magick... | 1 | [
"CWE-369"
] | ImageMagick | 8d25d94a363b104acd6ff23df7470aeedb806c51 | 231,019,287,981,565,350,000,000,000,000,000,000,000 | 175 | https://github.com/ImageMagick/ImageMagick/issues/3195 |
static unsigned long bpf_skb_copy(void *dst_buff, const void *skb,
unsigned long off, unsigned long len)
{
void *ptr = skb_header_pointer(skb, off, len, dst_buff);
if (unlikely(!ptr))
return len;
if (ptr != dst_buff)
memcpy(dst_buff, ptr, len);
return 0;
} | 0 | [
"CWE-120"
] | linux | 050fad7c4534c13c8eb1d9c2ba66012e014773cb | 144,711,303,248,450,920,000,000,000,000,000,000,000 | 12 | 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... |
report_error(int ierr)
{
int reported_error;
/* FIXME: This does not seem to report all reasonable errors correctly */
if (ierr == -1 && errno != 0)
reported_error = errno;
else
reported_error = WEXITSTATUS(ierr);
fill_gpval_integer("GPVAL_SYSTEM_ERRNO", reported_error);
if (reported_error ... | 0 | [
"CWE-415"
] | gnuplot | 052cbd17c3cbbc602ee080b2617d32a8417d7563 | 94,415,878,293,150,790,000,000,000,000,000,000,000 | 18 | successive failures of "set print <foo>" could cause double-free
Bug #2312 |
static int nf_tables_delset(struct sk_buff *skb, const struct nfnl_info *info,
const struct nlattr * const nla[])
{
struct netlink_ext_ack *extack = info->extack;
u8 genmask = nft_genmask_next(info->net);
u8 family = info->nfmsg->nfgen_family;
struct net *net = info->net;
const struct nlattr *attr;
struct ... | 0 | [] | net | 520778042ccca019f3ffa136dd0ca565c486cedd | 339,292,438,652,830,600,000,000,000,000,000,000,000 | 45 | netfilter: nf_tables: disallow non-stateful expression in sets earlier
Since 3e135cd499bf ("netfilter: nft_dynset: dynamic stateful expression
instantiation"), it is possible to attach stateful expressions to set
elements.
cd5125d8f518 ("netfilter: nf_tables: split set destruction in deactivate
and destroy phase") in... |
plainIndexDiskObjects(FILE *out, char *root)
{
indexDiskObjects(out, root, 0);
} | 0 | [
"CWE-617"
] | polipo | 0e2b44af619e46e365971ea52b97457bc0778cd3 | 186,114,822,521,865,330,000,000,000,000,000,000,000 | 4 | Try to read POST requests to local configuration interface correctly. |
FOLLY_ALWAYS_INLINE bool isCompatibleWithType(
NimbleProtocolReader* iprot,
TType expectedFieldType) {
return iprot->isCompatibleWithType(expectedFieldType, *this);
} | 0 | [
"CWE-703",
"CWE-770"
] | fbthrift | 3f156207e8a6583d88999487e954320dc18955e6 | 200,659,345,580,324,400,000,000,000,000,000,000,000 | 5 | Better handling of truncated data when reading containers
Summary:
Currently we read the container size and blindly pre-allocate the container of that size. This allows malicious attacker to send few bytes message and cause server to allocate GBs of memory.
This diff changes the logic to check if we have at least 1b/... |
static block_t *Encode( encoder_t *p_enc, picture_t *p_pic )
{
encoder_sys_t *p_sys = p_enc->p_sys;
block_t *p_block, *p_output_chain = NULL;
SchroFrame *p_frame;
bool b_go = true;
if( !p_pic ) {
if( !p_sys->started || p_sys->b_eos_pulled )
return NULL;
if( !p_sys->b_eo... | 0 | [
"CWE-120",
"CWE-787"
] | vlc | 9bb0353a5c63a7f8c6fc853faa3df4b4df1f5eb5 | 335,901,731,544,882,500,000,000,000,000,000,000,000 | 177 | codec: schroedinger: fix potential buffer overflow.
The variable len is a raw 32 bit value read using GetDWBE. If this
value is larger than UINT32_MAX - sizeof(eos), this will cause an
integer overflow in the subsequent call to malloc, and finally a
buffer overflow when calling memcpy. We fix this by checking len
acco... |
static int __gup_device_huge_pud(pud_t pud, unsigned long addr,
unsigned long end, struct page **pages, int *nr)
{
unsigned long fault_pfn;
fault_pfn = pud_pfn(pud) + ((addr & ~PUD_MASK) >> PAGE_SHIFT);
return __gup_device_huge(fault_pfn, addr, end, pages, nr);
} | 0 | [
"CWE-119"
] | linux | 1be7107fbe18eed3e319a6c3e83c78254b693acb | 208,844,025,624,495,400,000,000,000,000,000,000,000 | 8 | mm: larger stack guard gap, between vmas
Stack guard page is a useful feature to reduce a risk of stack smashing
into a different mapping. We have been using a single page gap which
is sufficient to prevent having stack adjacent to a different mapping.
But this seems to be insufficient in the light of the stack usage ... |
static void networt_send_buffer_signed (sockent_t *se, /* {{{ */
const char *in_buffer, size_t in_buffer_size)
{
part_signature_sha256_t ps;
char buffer[BUFF_SIG_SIZE + in_buffer_size];
size_t buffer_offset;
size_t username_len;
gcry_md_hd_t hd;
gcry_error_t err;
unsigned char *hash;
hd = NULL;
er... | 0 | [
"CWE-119",
"CWE-787"
] | collectd | b589096f907052b3a4da2b9ccc9b0e2e888dfc18 | 5,223,075,623,959,308,000,000,000,000,000,000,000 | 76 | network plugin: Fix heap overflow in parse_packet().
Emilien Gaspar has identified a heap overflow in parse_packet(), the
function used by the network plugin to parse incoming network packets.
This is a vulnerability in collectd, though the scope is not clear at
this point. At the very least specially crafted network... |
void license_free_binary_blob(LICENSE_BLOB* blob)
{
if (blob)
{
free(blob->data);
free(blob);
}
} | 0 | [
"CWE-125"
] | FreeRDP | 6ade7b4cbfd71c54b3d724e8f2d6ac76a58e879a | 71,374,802,790,024,460,000,000,000,000,000,000,000 | 8 | Fixed OOB Read in license_read_new_or_upgrade_license_packet
CVE-2020-11099 thanks to @antonio-morales for finding this. |
BIO *cms_EnvelopedData_init_bio(CMS_ContentInfo *cms)
{
CMS_EncryptedContentInfo *ec;
STACK_OF(CMS_RecipientInfo) *rinfos;
CMS_RecipientInfo *ri;
int i, ok = 0;
BIO *ret;
/* Get BIO first to set up key */
ec = cms->d.envelopedData->encryptedContentInfo;
ret = cms_EncryptedContent_init_... | 0 | [
"CWE-311",
"CWE-327"
] | openssl | 08229ad838c50f644d7e928e2eef147b4308ad64 | 249,739,476,753,113,530,000,000,000,000,000,000,000 | 45 | Fix a padding oracle in PKCS7_dataDecode and CMS_decrypt_set1_pkey
An attack is simple, if the first CMS_recipientInfo is valid but the
second CMS_recipientInfo is chosen ciphertext. If the second
recipientInfo decodes to PKCS #1 v1.5 form plaintext, the correct
encryption key will be replaced by garbage, and the mess... |
Scan::Scan(class Frame *frame)
: JKeeper(frame->EnvironOf()), m_pNext(NULL), m_pFrame(frame), m_pParser(NULL),
m_pHuffman(NULL), m_pConditioner(NULL), m_bHidden(false)
{
m_ucScanIndex = 0;
for(int i = 0;i < 4;i++) {
m_pComponent[i] = NULL;
m_ucMappingTable[i] = 0;
}
} | 0 | [
"CWE-476"
] | libjpeg | ea6315164b1649ff932a396b7600eac4bffcfaba | 169,913,433,646,174,950,000,000,000,000,000,000,000 | 12 | Added a check whether all components in a scan are actually present. |
static char *ask_new_field(struct chfn_control *ctl, const char *question,
char *def_val)
{
int len;
char *buf = NULL; /* leave initialized to NULL or getline segfaults */
#ifndef HAVE_LIBREADLINE
size_t dummy = 0;
#endif
if (!def_val)
def_val = "";
while (true) {
printf("%s [%s]:", question, def_val);
... | 1 | [
"CWE-209"
] | util-linux | faa5a3a83ad0cb5e2c303edbfd8cd823c9d94c17 | 88,842,803,038,574,400,000,000,000,000,000,000,000 | 41 | chsh, chfn: remove readline support [CVE-2022-0563]
The readline library uses INPUTRC= environment variable to get a path
to the library config file. When the library cannot parse the
specified file, it prints an error message containing data from the
file.
Unfortunately, the library does not use secure_getenv() (or ... |
static void convert_32s8u_C1R(const OPJ_INT32* pSrc, OPJ_BYTE* pDst,
OPJ_SIZE_T length)
{
OPJ_SIZE_T i;
for (i = 0; i < length; ++i) {
pDst[i] = (OPJ_BYTE)pSrc[i];
}
} | 0 | [
"CWE-787"
] | openjpeg | e5285319229a5d77bf316bb0d3a6cbd3cb8666d9 | 175,714,884,865,715,000,000,000,000,000,000,000,000 | 8 | pgxtoimage(): fix write stack buffer overflow (#997) |
enc_canon_props(char_u *name)
{
int i;
i = enc_canon_search(name);
if (i >= 0)
return enc_canon_table[i].prop;
#ifdef MSWIN
if (name[0] == 'c' && name[1] == 'p' && VIM_ISDIGIT(name[2]))
{
CPINFO cpinfo;
// Get info on this codepage to find out what it is.
if (GetCPInfo(atoi((char *)name + 2),... | 0 | [
"CWE-122",
"CWE-787"
] | vim | f6d39c31d2177549a986d170e192d8351bd571e2 | 37,013,305,942,975,424,000,000,000,000,000,000,000 | 31 | 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. |
void neddisablethreadcache(nedpool *p) THROWSPEC
{
int mycache;
if(!p)
{
p=&syspool;
if(!syspool.threads) InitPool(&syspool, 0, -1);
}
mycache=(int)(size_t) TLSGET(p->mycache);
if(!mycache)
{ /* Set to mspace 0 */
if(TLSSET(p->mycache, (void *)-1)) abort();
}
else if(mycache>0)
{ /* Set to last used msp... | 0 | [
"CWE-119",
"CWE-787"
] | git | 34fa79a6cde56d6d428ab0d3160cb094ebad3305 | 290,961,980,980,980,730,000,000,000,000,000,000,000 | 30 | prefer memcpy to strcpy
When we already know the length of a string (e.g., because
we just malloc'd to fit it), it's nicer to use memcpy than
strcpy, as it makes it more obvious that we are not going to
overflow the buffer (because the size we pass matches the
size in the allocation).
This also eliminates calls to st... |
xmlSchemaFreeWildcard(xmlSchemaWildcardPtr wildcard)
{
if (wildcard == NULL)
return;
if (wildcard->annot != NULL)
xmlSchemaFreeAnnot(wildcard->annot);
if (wildcard->nsSet != NULL)
xmlSchemaFreeWildcardNsSet(wildcard->nsSet);
if (wildcard->negNsSet != NULL)
xmlFree(wildcard->negNsSet);
... | 0 | [
"CWE-134"
] | libxml2 | 4472c3a5a5b516aaf59b89be602fbce52756c3e9 | 142,158,481,553,934,310,000,000,000,000,000,000,000 | 12 | Fix some format string warnings with possible format string vulnerability
For https://bugzilla.gnome.org/show_bug.cgi?id=761029
Decorate every method in libxml2 with the appropriate
LIBXML_ATTR_FORMAT(fmt,args) macro and add some cleanups
following the reports. |
static void htlistcheck(GWindow gw, struct gmenuitem *mi, GEvent *UNUSED(e)) {
FontView *fv = (FontView *) GDrawGetUserData(gw);
int anychars = FVAnyCharSelected(fv);
int multilayer = fv->b.sf->multilayer;
for ( mi = mi->sub; mi->ti.text!=NULL || mi->ti.line ; ++mi ) {
switch ( mi->mid ) {
case MID... | 0 | [
"CWE-119",
"CWE-787"
] | fontforge | 626f751752875a0ddd74b9e217b6f4828713573c | 188,040,190,716,397,970,000,000,000,000,000,000,000 | 33 | Warn users before discarding their unsaved scripts (#3852)
* Warn users before discarding their unsaved scripts
This closes #3846. |
static const char *gf_filter_get_args_stripped(GF_FilterSession *fsess, const char *in_args, Bool is_dst)
{
char szEscape[7];
char *args_striped = NULL;
if (in_args) {
const char *key;
if (is_dst) {
key = "dst";
} else {
key = "src";
}
if (!strncmp(in_args, key, 3) && (in_args[3]==fsess->sep_name)) {... | 0 | [
"CWE-787"
] | gpac | da37ec8582266983d0ec4b7550ec907401ec441e | 325,160,135,199,115,540,000,000,000,000,000,000,000 | 35 | fixed crashes for very long path - cf #1908 |
static int is_hugetlb_entry_migration(pte_t pte)
{
swp_entry_t swp;
if (huge_pte_none(pte) || pte_present(pte))
return 0;
swp = pte_to_swp_entry(pte);
if (non_swap_entry(swp) && is_migration_entry(swp))
return 1;
else
return 0;
} | 0 | [
"CWE-399"
] | linux | 90481622d75715bfcb68501280a917dbfe516029 | 64,423,867,031,538,610,000,000,000,000,000,000,000 | 12 | hugepages: fix use after free bug in "quota" handling
hugetlbfs_{get,put}_quota() are badly named. They don't interact with the
general quota handling code, and they don't much resemble its behaviour.
Rather than being about maintaining limits on on-disk block usage by
particular users, they are instead about maintai... |
control_notify_session_renamed(struct session *s)
{
struct client *c;
TAILQ_FOREACH(c, &clients, entry) {
if (!CONTROL_SHOULD_NOTIFY_CLIENT(c))
continue;
control_write(c, "%%session-renamed $%u %s", s->id, s->name);
}
} | 0 | [] | src | b32e1d34e10a0da806823f57f02a4ae6e93d756e | 76,450,066,727,810,980,000,000,000,000,000,000,000 | 11 | evbuffer_new and bufferevent_new can both fail (when malloc fails) and
return NULL. GitHub issue 1547. |
ArgParser::argDecrypt()
{
o.decrypt = true;
o.encrypt = false;
o.copy_encryption = false;
} | 0 | [
"CWE-787"
] | qpdf | d71f05ca07eb5c7cfa4d6d23e5c1f2a800f52e8e | 313,595,843,598,946,200,000,000,000,000,000,000,000 | 6 | 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 copy_vm86_regs_from_user(struct kernel_vm86_regs *regs,
const struct vm86_regs __user *user,
unsigned extra)
{
int ret = 0;
/* copy ax-fs inclusive */
ret += copy_from_user(regs, user, offsetof(struct kernel_vm86_regs, pt.orig_ax));
/* copy orig_ax-__gsh+extra */
ret += copy_from_user(&... | 0 | [
"CWE-264"
] | linux-2.6 | 1a5a9906d4e8d1976b701f889d8f35d54b928f25 | 84,044,843,786,931,250,000,000,000,000,000,000,000 | 15 | mm: thp: fix pmd_bad() triggering in code paths holding mmap_sem read mode
In some cases it may happen that pmd_none_or_clear_bad() is called with
the mmap_sem hold in read mode. In those cases the huge page faults can
allocate hugepmds under pmd_none_or_clear_bad() and that can trigger a
false positive from pmd_bad(... |
virDomainDefAddDiskControllersForType(virDomainDefPtr def,
int controllerType,
int diskBus)
{
size_t i;
int maxController = -1;
for (i = 0; i < def->ndisks; i++) {
if (def->disks[i]->bus != diskBus)
continue;
... | 0 | [
"CWE-212"
] | libvirt | a5b064bf4b17a9884d7d361733737fb614ad8979 | 325,667,601,695,928,900,000,000,000,000,000,000,000 | 28 | conf: Don't format http cookies unless VIR_DOMAIN_DEF_FORMAT_SECURE is used
Starting with 3b076391befc3fe72deb0c244ac6c2b4c100b410
(v6.1.0-122-g3b076391be) we support http cookies. Since they may contain
somewhat sensitive information we should not format them into the XML
unless VIR_DOMAIN_DEF_FORMAT_SECURE is assert... |
deep_count_load (DeepCountState *state,
GFile *location)
{
state->deep_count_location = g_object_ref (location);
#ifdef DEBUG_LOAD_DIRECTORY
g_message ("load_directory called to get deep file count for %p", location);
#endif
g_file_enumerate_children_async (state->deep_count_locat... | 0 | [
"CWE-20"
] | nautilus | 1630f53481f445ada0a455e9979236d31a8d3bb0 | 252,684,172,606,896,700,000,000,000,000,000,000,000 | 22 | mime-actions: use file metadata for trusting desktop files
Currently we only trust desktop files that have the executable bit
set, and don't replace the displayed icon or the displayed name until
it's trusted, which prevents for running random programs by a malicious
desktop file.
However, the executable permission i... |
static void gf_dump_vrml_field(GF_SceneDumper *sdump, GF_Node *node, GF_FieldInfo field)
{
u32 i, sf_type;
Bool needs_field_container;
GF_ChildNodeItem *list;
void *slot_ptr;
switch (field.fieldType) {
case GF_SG_VRML_SFNODE:
assert ( *(GF_Node **)field.far_ptr);
if (sdump->XMLDump) {
if (!sdump->X3DDump... | 1 | [
"CWE-476"
] | gpac | 0102c5d4db7fdbf08b5b591b2a6264de33867a07 | 204,728,815,593,643,880,000,000,000,000,000,000,000 | 162 | fixed #2232 |
int SSL_clear(SSL *s)
{
if (s->method == NULL)
{
SSLerr(SSL_F_SSL_CLEAR,SSL_R_NO_METHOD_SPECIFIED);
return(0);
}
if (ssl_clear_bad_session(s))
{
SSL_SESSION_free(s->session);
s->session=NULL;
}
s->error=0;
s->hit=0;
s->shutdown=0;
#if 0 /* Disabled since version 1.10 of this file (early return... | 0 | [] | openssl | ee2ffc279417f15fef3b1073c7dc81a908991516 | 74,164,415,462,996,270,000,000,000,000,000,000,000 | 71 | Add Next Protocol Negotiation. |
const char* valuestrsafe() const {
return type() == mongo::String ? valuestr() : "";
} | 0 | [
"CWE-613"
] | mongo | e55d6e2292e5dbe2f97153251d8193d1cc89f5d7 | 132,427,394,789,673,880,000,000,000,000,000,000,000 | 3 | SERVER-38984 Validate unique User ID on UserCache hit |
check_compat_entry_size_and_hooks(struct compat_arpt_entry *e,
struct xt_table_info *newinfo,
unsigned int *size,
const unsigned char *base,
const unsigned char *limit,
const unsigned int *hook_entries,
const unsigned int *underflows,
const char *name)
{
struct xt_entry_target... | 1 | [
"CWE-284",
"CWE-264"
] | linux | ce683e5f9d045e5d67d1312a42b359cb2ab2a13c | 124,930,015,977,751,570,000,000,000,000,000,000,000 | 75 | netfilter: x_tables: check for bogus target offset
We're currently asserting that targetoff + targetsize <= nextoff.
Extend it to also check that targetoff is >= sizeof(xt_entry).
Since this is generic code, add an argument pointing to the start of the
match/target, we can then derive the base structure size from the... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.