func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
lyd_wd_default(struct lyd_node_leaf_list *node)
{
struct lys_node_leaf *leaf;
struct lys_node_leaflist *llist;
struct lyd_node *iter;
struct lys_tpdf *tpdf;
const char *dflt = NULL, **dflts = NULL;
uint8_t dflts_size = 0, c, i;
if (!node || !(node->schema->nodetype & (LYS_LEAF | LYS_LEAFLIS... | 0 | [
"CWE-119"
] | libyang | 32fb4993bc8bb49e93e84016af3c10ea53964be5 | 320,693,286,108,187,500,000,000,000,000,000,000,000 | 110 | schema tree BUGFIX do not check features while still resolving schema
Fixes #723 |
static int em_rdpmc(struct x86_emulate_ctxt *ctxt)
{
u64 pmc;
if (ctxt->ops->read_pmc(ctxt, ctxt->regs[VCPU_REGS_RCX], &pmc))
return emulate_gp(ctxt, 0);
ctxt->regs[VCPU_REGS_RAX] = (u32)pmc;
ctxt->regs[VCPU_REGS_RDX] = pmc >> 32;
return X86EMUL_CONTINUE;
} | 0 | [] | kvm | e28ba7bb020f07193bc000453c8775e9d2c0dda7 | 41,213,839,657,130,733,000,000,000,000,000,000,000 | 10 | KVM: x86: fix missing checks in syscall emulation
On hosts without this patch, 32bit guests will crash (and 64bit guests
may behave in a wrong way) for example by simply executing following
nasm-demo-application:
[bits 32]
global _start
SECTION .text
_start: syscall
(I tested it with winxp and linux ... |
int js_pcall(js_State *J, int n)
{
int savetop = TOP - n - 2;
if (js_try(J)) {
/* clean up the stack to only hold the error object */
STACK[savetop] = STACK[TOP-1];
TOP = savetop + 1;
return 1;
}
js_call(J, n);
js_endtry(J);
return 0;
} | 0 | [
"CWE-476"
] | mujs | 77ab465f1c394bb77f00966cd950650f3f53cb24 | 307,349,336,255,863,400,000,000,000,000,000,000,000 | 13 | Fix 697401: Error when dropping extra arguments to lightweight functions. |
static int default_task_finished(int result,
struct strbuf *out,
void *pp_cb,
void *pp_task_cb)
{
return 0;
} | 0 | [] | git | 321fd82389742398d2924640ce3a61791fd27d60 | 217,458,498,447,260,600,000,000,000,000,000,000,000 | 7 | run-command: mark path lookup errors with ENOENT
Since commit e3a434468f (run-command: use the
async-signal-safe execv instead of execvp, 2017-04-19),
prepare_cmd() does its own PATH lookup for any commands we
run (on non-Windows platforms).
However, its logic does not match the old execvp call when
we fail to find a... |
DeepTiledInputFile::Data::~Data ()
{
delete [] numXTiles;
delete [] numYTiles;
for (size_t i = 0; i < tileBuffers.size(); i++)
delete tileBuffers[i];
if (multiPartBackwardSupport)
delete multiPartFile;
for (size_t i = 0; i < slices.size(); i++)
delete slices[i];
} | 1 | [
"CWE-125"
] | openexr | e79d2296496a50826a15c667bf92bdc5a05518b4 | 192,721,349,196,138,450,000,000,000,000,000,000,000 | 14 | fix memory leaks and invalid memory accesses
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz> |
static bool acl_group_override(connection_struct *conn,
SMB_STRUCT_STAT *psbuf,
const char *fname)
{
if ((errno != EPERM) && (errno != EACCES)) {
return false;
}
/* file primary group == user primary or supplementary group */
if (lp_acl_group_control(SNUM(conn)) &&
current_user_in_group(psbuf->st_gid)... | 0 | [
"CWE-264"
] | samba | d6c28913f3109d1327a3d1369b6eafd3874b2dca | 98,370,203,701,003,000,000,000,000,000,000,000,000 | 22 | Bug 6488: acl_group_override() call in posix acls references an uninitialized variable.
(cherry picked from commit f92195e3a1baaddda47a5d496f9488c8445b41ad) |
TEST_F(OptimizePipeline, MixedMatchPushedDown) {
auto unpack = fromjson(
"{$_internalUnpackBucket: { exclude: [], timeField: 'time', metaField: 'myMeta', "
"bucketMaxSpanSeconds: 3600}}");
auto pipeline = Pipeline::parse(
makeVector(unpack, fromjson("{$match: {myMeta: {$gte: 0, $lte: 5},... | 1 | [] | mongo | b3107d73a2c58d7e016b834dae0acfd01c0db8d7 | 64,275,006,503,360,730,000,000,000,000,000,000,000 | 23 | SERVER-59299: Flatten top-level nested $match stages in doOptimizeAt
(cherry picked from commit 4db5eceda2cff697f35c84cd08232bac8c33beec) |
void ListenerImpl::initialize() {
last_updated_ = listener_factory_context_->timeSource().systemTime();
// If workers have already started, we shift from using the global init manager to using a local
// per listener init manager. See ~ListenerImpl() for why we gate the onListenerWarmed() call
// by resetting t... | 0 | [
"CWE-400"
] | envoy | dfddb529e914d794ac552e906b13d71233609bf7 | 202,602,784,923,836,000,000,000,000,000,000,000,000 | 12 | listener: Add configurable accepted connection limits (#153)
Add support for per-listener limits on accepted connections.
Signed-off-by: Tony Allen <tony@allen.gg> |
static int socket_from_display(const char *display, char **path) {
size_t k;
char *f, *c;
assert(display);
assert(path);
if (!display_is_local(display))
return -EINVAL;
k = strspn(display+1, "0123456789");
f = new(char, STRLEN("/tmp/.X11-unix/X... | 0 | [
"CWE-863"
] | systemd | 83d4ab55336ff8a0643c6aa627b31e351a24040a | 310,526,234,996,084,300,000,000,000,000,000,000,000 | 24 | pam-systemd: use secure_getenv() rather than getenv()
And explain why in a comment. |
static void pcnet_rdte_poll(PCNetState *s)
{
s->csr[28] = s->csr[29] = 0;
if (s->rdra) {
int bad = 0;
#if 1
hwaddr crda = pcnet_rdra_addr(s, CSR_RCVRC(s));
hwaddr nrda = pcnet_rdra_addr(s, -1 + CSR_RCVRC(s));
hwaddr nnrd = pcnet_rdra_addr(s, -2 + CSR_RCVRC(s));
#else
hwad... | 0 | [
"CWE-835"
] | qemu | 99ccfaa1edafd79f7a3a0ff7b58ae4da7c514928 | 39,211,450,988,372,280,000,000,000,000,000,000,000 | 72 | pcnet: switch to use qemu_receive_packet() for loopback
This patch switches to use qemu_receive_packet() which can detect
reentrancy and return early.
This is intended to address CVE-2021-3416.
Cc: Prasad J Pandit <ppandit@redhat.com>
Cc: qemu-stable@nongnu.org
Buglink: https://bugs.launchpad.net/qemu/+bug/1917085
R... |
lys_ingrouping(const struct lys_node *node)
{
const struct lys_node *iter = node;
assert(node);
for(iter = node; iter && iter->nodetype != LYS_GROUPING; iter = lys_parent(iter));
if (!iter) {
return 0;
} else {
return 1;
}
} | 0 | [
"CWE-119"
] | libyang | 32fb4993bc8bb49e93e84016af3c10ea53964be5 | 55,099,566,141,686,270,000,000,000,000,000,000,000 | 12 | schema tree BUGFIX do not check features while still resolving schema
Fixes #723 |
static int execute_decode_slices(H264Context *h, int context_count)
{
AVCodecContext *const avctx = h->avctx;
H264Context *hx;
int i;
av_assert0(h->mb_y < h->mb_height);
if (h->avctx->hwaccel ||
h->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)
return 0;
if (context_coun... | 0 | [
"CWE-703"
] | FFmpeg | 8a3b85f3a7952c54a2c36ba1797f7e0cde9f85aa | 270,886,298,238,122,650,000,000,000,000,000,000,000 | 40 | avcodec/h264: update current_sps & sps->new only after the whole slice header decoder and init code finished
This avoids them being cleared before the full initialization finished
Fixes out of array read
Fixes: asan_heap-oob_f0c5e6_7071_cov_1605985132_mov_h264_aac__Demo_FlagOfOurFathers.mov
Found-by: Mateusz "j00ru" ... |
bool check_grant_db(THD *thd,const char *db)
{
Security_context *sctx= thd->security_ctx;
char helping [NAME_LEN+USERNAME_LENGTH+2];
uint len;
bool error= TRUE;
size_t copy_length;
copy_length= (size_t) (strlen(sctx->priv_user) +
strlen(db ? db : "")) + 1; /* Added 1 at the end to avoid
... | 0 | [] | mysql-server | 25d1b7e03b9b375a243fabdf0556c063c7282361 | 207,279,446,827,649,950,000,000,000,000,000,000,000 | 45 | Bug #22722946: integer overflow may lead to wrong results in get_56_lenc_string |
static BOOL rdp_write_window_list_capability_set(wStream* s, const rdpSettings* settings)
{
size_t header;
if (!Stream_EnsureRemainingCapacity(s, 32))
return FALSE;
header = rdp_capability_set_start(s);
Stream_Write_UINT32(s, settings->RemoteWndSupportLevel); /* wndSupportLevel (4 bytes) */
Stream_Write_UINT8(... | 0 | [
"CWE-119",
"CWE-125"
] | FreeRDP | 3627aaf7d289315b614a584afb388f04abfb5bbf | 269,751,178,337,666,000,000,000,000,000,000,000,000 | 15 | Fixed #6011: Bounds check in rdp_read_font_capability_set |
usm_set_usmStateReference_auth_protocol(struct usmStateReference *ref,
oid * auth_protocol,
size_t auth_protocol_len)
{
MAKE_ENTRY(ref, oid, auth_protocol, auth_protocol_len,
usr_auth_protocol, usr_auth_protocol_length);
... | 0 | [
"CWE-415"
] | net-snmp | 5f881d3bf24599b90d67a45cae7a3eb099cd71c9 | 68,938,668,970,766,910,000,000,000,000,000,000,000 | 7 | libsnmp, USM: Introduce a reference count in struct usmStateReference
This patch fixes https://sourceforge.net/p/net-snmp/bugs/2956/. |
static void string_list_free(string_list* list)
{
/* Note: we don't free the contents of the strings array: this */
/* is handled by the caller, either by returning this */
/* content, or freeing it itself. */
free(list->strings);
} | 0 | [
"CWE-787"
] | FreeRDP | 8305349a943c68b1bc8c158f431dc607655aadea | 20,158,190,027,491,407,000,000,000,000,000,000,000 | 7 | Fixed GHSL-2020-102 heap overflow
(cherry picked from commit 197b16cc15a12813c2e4fa2d6ae9cd9c4a57e581) |
jas_image_t *jas_image_chclrspc(jas_image_t *image, jas_cmprof_t *outprof,
int intent)
{
jas_image_t *inimage;
int minhstep;
int minvstep;
int i;
int j;
int k;
int n;
int hstep;
int vstep;
int numinauxchans;
int numoutauxchans;
int numinclrchans;
int numoutclrchans;
int prec;
jas_image_t *outimage;
in... | 0 | [
"CWE-189"
] | jasper | 3c55b399c36ef46befcb21e4ebc4799367f89684 | 291,120,294,607,828,320,000,000,000,000,000,000,000 | 176 | At many places in the code, jas_malloc or jas_recalloc was being
invoked with the size argument being computed in a manner that would not
allow integer overflow to be detected. Now, these places in the code
have been modified to use special-purpose memory allocation functions
(e.g., jas_alloc2, jas_alloc3, jas_realloc... |
static void add_static_types(struct cli_bc *bc)
{
unsigned i;
for (i=0;i<NUM_STATIC_TYPES;i++) {
bc->types[i].kind = DPointerType;
bc->types[i].numElements = 1;
bc->types[i].containedTypes = &containedTy[i];
bc->types[i].size = bc->types[i].align = 8;
}
} | 0 | [
"CWE-189"
] | clamav-devel | 3d664817f6ef833a17414a4ecea42004c35cc42f | 138,967,419,496,378,890,000,000,000,000,000,000,000 | 10 | fix recursion level crash (bb #3706).
Thanks to Stephane Chazelas for the analysis. |
void CLASS samsung_load_raw()
{
int row, col, c, i, dir, op[4], len[4];
order = 0x4949;
for (row=0; row < raw_height; row++) {
#ifdef LIBRAW_LIBRARY_BUILD
checkCancel();
#endif
fseek (ifp, strip_offset+row*4, SEEK_SET);
fseek (ifp, data_offset+get4(), SEEK_SET);
ph1_bits(-1);
FORC4 len[c] = r... | 1 | [
"CWE-125",
"CWE-787"
] | LibRaw | fd6330292501983ac75fe4162275794b18445bd9 | 317,099,516,662,178,270,000,000,000,000,000,000,000 | 33 | Secunia 81800#1: samsumg_load_raw
Secunia 81800#2: find_green
Secunia 81800#3: rollei_load_raw
remove_trailing_spaces: isspace() does not works right with signed non-latin chars
Secunia 81800#5/6: nikon_coolscan_load_raw
Secunia 81800#4: rollei_load_raw |
prefix_cmd(int midi_dev, unsigned char status)
{
if ((char *) midi_devs[midi_dev]->prefix_cmd == NULL)
return 1;
return midi_devs[midi_dev]->prefix_cmd(midi_dev, status);
} | 0 | [
"CWE-703",
"CWE-189"
] | linux | b769f49463711205d57286e64cf535ed4daf59e9 | 256,281,315,757,449,640,000,000,000,000,000,000,000 | 7 | sound/oss: remove offset from load_patch callbacks
Was: [PATCH] sound/oss/midi_synth: prevent underflow, use of
uninitialized value, and signedness issue
The offset passed to midi_synth_load_patch() can be essentially
arbitrary. If it's greater than the header length, this will result in
a copy_from_user(dst, src, n... |
static unsigned int xdr_align_pages(struct xdr_stream *xdr, unsigned int len)
{
struct xdr_buf *buf = xdr->buf;
unsigned int nwords = XDR_QUADLEN(len);
unsigned int copied;
if (xdr->nwords == 0)
return 0;
xdr_realign_pages(xdr);
if (nwords > xdr->nwords) {
nwords = xdr->nwords;
len = nwords << 2;
}
if (... | 0 | [
"CWE-119",
"CWE-787"
] | linux | 6d1c0f3d28f98ea2736128ed3e46821496dc3a8c | 294,959,836,612,056,900,000,000,000,000,000,000,000 | 23 | sunrpc: Avoid a KASAN slab-out-of-bounds bug in xdr_set_page_base()
This seems to happen fairly easily during READ_PLUS testing on NFS v4.2.
I found that we could end up accessing xdr->buf->pages[pgnr] with a pgnr
greater than the number of pages in the array. So let's just return
early if we're setting base to a poin... |
QByteArray Database::blob(const QByteArray &hash) {
QSqlQuery query;
query.prepare(QLatin1String("SELECT `data` FROM `blobs` WHERE `hash` = ?"));
query.addBindValue(hash);
query.exec();
if (query.next()) {
QByteArray qba = query.value(0).toByteArray();
query.prepare(QLatin1String("UPDATE `blobs` SET `seen` =... | 0 | [
"CWE-310"
] | mumble | 5632c35d6759f5e13a7dfe78e4ee6403ff6a8e3e | 114,576,711,945,376,200,000,000,000,000,000,000,000 | 17 | Explicitly remove file permissions for settings and DB |
cmsBool CMSEXPORT cmsMLUtranslationsCodes(const cmsMLU* mlu,
cmsUInt32Number idx,
char LanguageCode[3],
char CountryCode[3])
{
_cmsMLUentry *entry;
if (mlu == NULL) return FALSE;
i... | 0 | [
"CWE-703"
] | Little-CMS | 91c2db7f2559be504211b283bc3a2c631d6f06d9 | 269,613,767,904,983,500,000,000,000,000,000,000,000 | 18 | Non happy-path fixes |
ether_print(netdissect_options *ndo,
const u_char *p, u_int length, u_int caplen,
void (*print_encap_header)(netdissect_options *ndo, const u_char *), const u_char *encap_header_arg)
{
const struct ether_header *ep;
u_int orig_length;
u_short length_type;
u_int hdrlen;
int llc_hdrlen;
stru... | 0 | [
"CWE-125",
"CWE-787"
] | tcpdump | 1dcd10aceabbc03bf571ea32b892c522cbe923de | 222,945,533,581,212,800,000,000,000,000,000,000,000 | 117 | CVE-2017-12897/ISO CLNS: Use ND_TTEST() for the bounds checks in isoclns_print().
This fixes a buffer over-read discovered by Kamil Frankowicz.
Don't pass the remaining caplen - that's too hard to get right, and we
were getting it wrong in at least one case; just use ND_TTEST().
Add a test using the capture file sup... |
static char *plist_utf16_to_utf8(uint16_t *unistr, long len, long *items_read, long *items_written)
{
if (!unistr || (len <= 0)) return NULL;
char *outbuf = (char*)malloc(4*(len+1));
int p = 0;
int i = 0;
uint16_t wc;
uint32_t w;
int read_lead_surrogate = 0;
while (i < len) {
wc = unistr[i++];
if (wc >= ... | 0 | [
"CWE-125"
] | libplist | 4765d9a60ca4248a8f89289271ac69cbffcc29bc | 69,681,277,101,011,400,000,000,000,000,000,000,000 | 55 | bplist: Fix possible out-of-bounds read in parse_array_node() with proper bounds checking |
plperl_sv_to_literal(SV *sv, char *fqtypename)
{
Datum str = CStringGetDatum(fqtypename);
Oid typid = DirectFunctionCall1(regtypein, str);
Oid typoutput;
Datum datum;
bool typisvarlena,
isnull;
if (!OidIsValid(typid))
elog(ERROR, "lookup failed for type %s", fqtypename);
datum = plperl_sv_to_datum... | 0 | [
"CWE-264"
] | postgres | 537cbd35c893e67a63c59bc636c3e888bd228bc7 | 278,828,729,304,680,480,000,000,000,000,000,000,000 | 25 | Prevent privilege escalation in explicit calls to PL validators.
The primary role of PL validators is to be called implicitly during
CREATE FUNCTION, but they are also normal functions that a user can call
explicitly. Add a permissions check to each validator to ensure that a
user cannot use explicit validator calls ... |
R_API int r_bin_object_delete(RBin *bin, ut32 binfile_id, ut32 binobj_id) {
RBinFile *binfile = NULL; //, *cbinfile = r_bin_cur (bin);
RBinObject *obj = NULL;
int res = false;
#if 0
if (binfile_id == UT32_MAX && binobj_id == UT32_MAX) {
return false;
}
#endif
if (binfile_id == -1) {
binfile = r_bin_file_find... | 0 | [
"CWE-125"
] | radare2 | d31c4d3cbdbe01ea3ded16a584de94149ecd31d9 | 44,965,966,041,993,670,000,000,000,000,000,000,000 | 31 | Fix #8748 - Fix oobread on string search |
static void rtrs_clt_reconnect_work(struct work_struct *work)
{
struct rtrs_clt_path *clt_path;
struct rtrs_clt_sess *clt;
unsigned int delay_ms;
int err;
clt_path = container_of(to_delayed_work(work), struct rtrs_clt_path,
reconnect_dwork);
clt = clt_path->clt;
if (READ_ONCE(clt_path->state) != RTRS_CLT_R... | 0 | [
"CWE-415"
] | linux | 8700af2cc18c919b2a83e74e0479038fd113c15d | 261,612,753,623,271,700,000,000,000,000,000,000,000 | 42 | RDMA/rtrs-clt: Fix possible double free in error case
Callback function rtrs_clt_dev_release() for put_device() calls kfree(clt)
to free memory. We shouldn't call kfree(clt) again, and we can't use the
clt after kfree too.
Replace device_register() with device_initialize() and device_add() so that
dev_set_name can() ... |
backend_can_multi_conn (struct backend *b, struct connection *conn)
{
struct b_conn_handle *h = &conn->handles[b->i];
debug ("%s: can_multi_conn", b->name);
if (h->can_multi_conn == -1)
h->can_multi_conn = b->can_multi_conn (b, conn);
return h->can_multi_conn;
} | 0 | [
"CWE-406"
] | nbdkit | a6b88b195a959b17524d1c8353fd425d4891dc5f | 134,558,175,372,573,170,000,000,000,000,000,000,000 | 10 | server: Fix regression for NBD_OPT_INFO before NBD_OPT_GO
Most known NBD clients do not bother with NBD_OPT_INFO (except for
clients like 'qemu-nbd --list' that don't ever intend to connect), but
go straight to NBD_OPT_GO. However, it's not too hard to hack up qemu
to add in an extra client step (whether info on the ... |
static int mongo_check_is_master( mongo *conn ) {
bson out;
bson_iterator it;
bson_bool_t ismaster = 0;
int max_bson_size = MONGO_DEFAULT_MAX_BSON_SIZE;
out.data = NULL;
if ( mongo_simple_int_command( conn, "admin", "ismaster", 1, &out ) == MONGO_OK ) {
if( bson_find( &it, &out, "ismas... | 0 | [
"CWE-190"
] | mongo-c-driver-legacy | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | 28,250,810,300,449,054,000,000,000,000,000,000,000 | 29 | don't mix up int and size_t (first pass to fix that) |
void Virtual_tmp_table::setup_field_pointers()
{
uchar *null_pos= record[0];
uchar *field_pos= null_pos + s->null_bytes;
uint null_bit= 1;
for (Field **cur_ptr= field; *cur_ptr; ++cur_ptr)
{
Field *cur_field= *cur_ptr;
if ((cur_field->flags & NOT_NULL_FLAG))
cur_field->move_field(field_pos);
... | 0 | [] | server | ff77a09bda884fe6bf3917eb29b9d3a2f53f919b | 80,918,430,059,169,140,000,000,000,000,000,000,000 | 37 | MDEV-22464 Server crash on UPDATE with nested subquery
Uninitialized ref_pointer_array[] because setup_fields() got empty
fields list. mysql_multi_update() for some reason does that by
substituting the fields list with empty total_list for the
mysql_select() call (looks like wrong merge since total_list is not
used a... |
static int udf_readpage(struct file *file, struct page *page)
{
return mpage_readpage(page, udf_get_block);
} | 0 | [
"CWE-476"
] | linux | 7fc3b7c2981bbd1047916ade327beccb90994eee | 287,506,999,260,303,230,000,000,000,000,000,000,000 | 4 | udf: Fix NULL ptr deref when converting from inline format
udf_expand_file_adinicb() calls directly ->writepage to write data
expanded into a page. This however misses to setup inode for writeback
properly and so we can crash on inode->i_wb dereference when submitting
page for IO like:
BUG: kernel NULL pointer dere... |
void qemu_set_vnet_hdr_len(NetClientState *nc, int len)
{
if (!nc || !nc->info->set_vnet_hdr_len) {
return;
}
nc->vnet_hdr_len = len;
nc->info->set_vnet_hdr_len(nc, len);
} | 0 | [
"CWE-190"
] | qemu | 25c01bd19d0e4b66f357618aeefda1ef7a41e21a | 205,531,127,938,865,960,000,000,000,000,000,000,000 | 9 | net: drop too large packet early
We try to detect and drop too large packet (>INT_MAX) in 1592a9947036
("net: ignore packet size greater than INT_MAX") during packet
delivering. Unfortunately, this is not sufficient as we may hit
another integer overflow when trying to queue such large packet in
qemu_net_queue_append_... |
static inline void vring_avail_event(VirtQueue *vq, uint16_t val)
{
hwaddr pa;
if (!vq->notification) {
return;
}
pa = vq->vring.used + offsetof(VRingUsed, ring[vq->vring.num]);
stw_phys(pa, val);
} | 0 | [
"CWE-269"
] | qemu | 5f5a1318653c08e435cfa52f60b6a712815b659d | 106,331,792,896,337,080,000,000,000,000,000,000,000 | 9 | virtio: properly validate address before accessing config
There are several several issues in the current checking:
- The check was based on the minus of unsigned values which can overflow
- It was done after .{set|get}_config() which can lead crash when config_len
is zero since vdev->config is NULL
Fix this by:
... |
static int _epoll_ctl_del(epoll_t* epoll, int fd)
{
int ret = -1;
oe_fd_t* desc;
oe_host_fd_t host_epfd;
oe_host_fd_t host_fd;
int retval;
bool locked = false;
oe_errno = 0;
/* Check parameters. */
if (!epoll)
OE_RAISE_ERRNO(OE_EINVAL);
if (!(desc = oe_fdtable_get(fd, ... | 0 | [
"CWE-200",
"CWE-552"
] | openenclave | bcac8e7acb514429fee9e0b5d0c7a0308fd4d76b | 176,984,977,982,355,420,000,000,000,000,000,000,000 | 63 | Merge pull request from GHSA-525h-wxcc-f66m
Signed-off-by: Ming-Wei Shih <mishih@microsoft.com> |
static void dumpcclass(Reclass *cc) {
Rune *p;
for (p = cc->spans; p < cc->end; p += 2) {
if (p[0] > 32 && p[0] < 127)
printf(" %c", p[0]);
else
printf(" \\x%02x", p[0]);
if (p[1] > 32 && p[1] < 127)
printf("-%c", p[1]);
else
printf("-\\x%02x", p[1]);
}
putchar('\n');
} | 0 | [
"CWE-703",
"CWE-674"
] | mujs | 160ae29578054dc09fd91e5401ef040d52797e61 | 326,052,680,635,164,820,000,000,000,000,000,000,000 | 14 | Issue #162: Check stack overflow during regexp compilation.
Only bother checking during the first compilation pass that counts
the size of the program. |
TEST_F(Http1ServerConnectionImplTest, RequestWithTrailersKept) { expectTrailersTest(true); } | 0 | [
"CWE-770"
] | envoy | 7ca28ff7d46454ae930e193d97b7d08156b1ba59 | 113,011,605,420,268,280,000,000,000,000,000,000,000 | 1 | [http1] Include request URL in request header size computation, and reject partial headers that exceed configured limits (#145)
Signed-off-by: antonio <avd@google.com> |
parse_group_prop_ntr_selection_method(struct ofpbuf *payload,
enum ofp11_group_type group_type,
enum ofp15_group_mod_command group_cmd,
struct ofputil_group_props *gp)
{
struct ntr_group_prop_selection_... | 0 | [
"CWE-617",
"CWE-703"
] | ovs | 4af6da3b275b764b1afe194df6499b33d2bf4cde | 54,349,972,075,462,000,000,000,000,000,000,000,000 | 82 | ofp-group: Don't assert-fail decoding bad OF1.5 group mod type or command.
When decoding a group mod, the current code validates the group type and
command after the whole group mod has been decoded. The OF1.5 decoder,
however, tries to use the type and command earlier, when it might still be
invalid. This caused an... |
void lsrc_box_del(GF_Box *s)
{
GF_LASERConfigurationBox *ptr = (GF_LASERConfigurationBox *)s;
if (ptr == NULL) return;
if (ptr->hdr) gf_free(ptr->hdr);
gf_free(ptr);
} | 0 | [
"CWE-787"
] | gpac | 77510778516803b7f7402d7423c6d6bef50254c3 | 159,447,302,275,527,570,000,000,000,000,000,000,000 | 7 | fixed #2255 |
static bool test_writeclose(struct torture_context *tctx,
struct smbcli_state *cli)
{
union smb_write io;
NTSTATUS status;
bool ret = true;
int fnum;
uint8_t *buf;
const int maxsize = 90000;
const char *fname = BASEDIR "\\test.txt";
unsigned int seed = time(NULL);
union smb_fileinfo finfo;
buf = tallo... | 0 | [
"CWE-200"
] | samba | a60863458dc6b60a09aa8d31fada6c36f5043c76 | 129,120,163,355,464,580,000,000,000,000,000,000,000 | 150 | CVE-2022-32742: s4: torture: Add raw.write.bad-write test.
Reproduces the test code in:
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15085
Add knownfail.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org> |
static int local_renameat(FsContext *ctx, V9fsPath *olddir,
const char *old_name, V9fsPath *newdir,
const char *new_name)
{
int ret;
int odirfd, ndirfd;
odirfd = local_opendir_nofollow(ctx, olddir->data);
if (odirfd == -1) {
return -1;
}
... | 1 | [
"CWE-732"
] | qemu | 7a95434e0ca8a037fd8aa1a2e2461f92585eb77b | 27,729,923,074,625,057,000,000,000,000,000,000,000 | 63 | 9pfs: local: forbid client access to metadata (CVE-2017-7493)
When using the mapped-file security mode, we shouldn't let the client mess
with the metadata. The current code already tries to hide the metadata dir
from the client by skipping it in local_readdir(). But the client can still
access or modify it through sev... |
static inline int pte_young(pte_t pte)
{
return pte_flags(pte) & _PAGE_ACCESSED;
} | 0 | [
"CWE-119",
"CWE-787"
] | linux | 027ef6c87853b0a9df53175063028edb4950d476 | 233,755,749,590,209,670,000,000,000,000,000,000,000 | 4 | mm: thp: fix pmd_present for split_huge_page and PROT_NONE with THP
In many places !pmd_present has been converted to pmd_none. For pmds
that's equivalent and pmd_none is quicker so using pmd_none is better.
However (unless we delete pmd_present) we should provide an accurate
pmd_present too. This will avoid the ri... |
ZEND_VM_HOT_HANDLER(117, ZEND_SEND_VAR, VAR|CV, NUM)
{
USE_OPLINE
zval *varptr, *arg;
zend_free_op free_op1;
varptr = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(varptr) == IS_UNDEF)) {
SAVE_OPLINE();
ZVAL_UNDEFINED_OP1();
arg = ZEND_CALL_VAR(EX(call), opline->result.... | 0 | [
"CWE-787"
] | php-src | f1ce8d5f5839cb2069ea37ff424fb96b8cd6932d | 186,804,940,904,756,320,000,000,000,000,000,000,000 | 37 | Fix #73122: Integer Overflow when concatenating strings
We must avoid integer overflows in memory allocations, so we introduce
an additional check in the VM, and bail out in the rare case of an
overflow. Since the recent fix for bug #74960 still doesn't catch all
possible overflows, we fix that right away. |
static void submit_flushes(struct work_struct *ws)
{
struct mddev *mddev = container_of(ws, struct mddev, flush_work);
struct md_rdev *rdev;
INIT_WORK(&mddev->flush_work, md_submit_flush_data);
atomic_set(&mddev->flush_pending, 1);
rcu_read_lock();
rdev_for_each_rcu(rdev, mddev)
if (rdev->raid_disk >= 0 &&
... | 0 | [
"CWE-200"
] | linux | b6878d9e03043695dbf3fa1caa6dfc09db225b16 | 63,812,573,937,442,700,000,000,000,000,000,000,000 | 32 | md: use kzalloc() when bitmap is disabled
In drivers/md/md.c get_bitmap_file() uses kmalloc() for creating a
mdu_bitmap_file_t called "file".
5769 file = kmalloc(sizeof(*file), GFP_NOIO);
5770 if (!file)
5771 return -ENOMEM;
This structure is copied to user space at the end of the fun... |
void ha_partition::start_part_bulk_insert(THD *thd, uint part_id)
{
long old_buffer_size;
if (!bitmap_is_set(&m_bulk_insert_started, part_id) &&
bitmap_is_set(&m_bulk_insert_started, m_tot_parts))
{
old_buffer_size= thd->variables.read_buff_size;
/* Update read_buffer_size for this partition */
... | 0 | [] | mysql-server | be901b60ae59c93848c829d1b0b2cb523ab8692e | 15,907,698,649,399,522,000,000,000,000,000,000,000 | 15 | Bug#26390632: CREATE TABLE CAN CAUSE MYSQL TO EXIT.
Analysis
========
CREATE TABLE of InnoDB table with a partition name
which exceeds the path limit can cause the server
to exit.
During the preparation of the partition name,
there was no check to identify whether the complete
path name for partition exceeds the max ... |
template<typename t>
CImg<T>& distance_dijkstra(const T& value, const CImg<t>& metric,
const bool is_high_connectivity=false) {
return get_distance_dijkstra(value,metric,is_high_connectivity).move_to(*this); | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 333,457,955,888,905,780,000,000,000,000,000,000,000 | 4 | Fix other issues in 'CImg<T>::load_bmp()'. |
static kvm_pfn_t hva_to_pfn(unsigned long addr, bool atomic, bool *async,
bool write_fault, bool *writable)
{
struct vm_area_struct *vma;
kvm_pfn_t pfn = 0;
int npages, r;
/* we can do it either atomically or asynchronously, not both */
BUG_ON(atomic && async);
if (hva_to_pfn_fast(addr, write_fault, writable... | 0 | [
"CWE-416"
] | linux | 0774a964ef561b7170d8d1b1bfe6f88002b6d219 | 247,609,173,231,048,000,000,000,000,000,000,000,000 | 47 | KVM: Fix out of range accesses to memslots
Reset the LRU slot if it becomes invalid when deleting a memslot to fix
an out-of-bounds/use-after-free access when searching through memslots.
Explicitly check for there being no used slots in search_memslots(), and
in the caller of s390's approximation variant.
Fixes: 369... |
size_t AsyncSSLSocket::getRawBytesWritten() const {
// The bio(s) in the write path are in a chain
// each bio flushes to the next and finally written into the socket
// to get the rawBytesWritten on the socket,
// get the write bytes of the last bio
BIO* b;
if (!ssl_ || !(b = SSL_get_wbio(ssl_.get()))) {
... | 0 | [
"CWE-125"
] | folly | c321eb588909646c15aefde035fd3133ba32cdee | 200,345,578,005,131,240,000,000,000,000,000,000,000 | 17 | Handle close_notify as standard writeErr in AsyncSSLSocket.
Summary: Fixes CVE-2019-11934
Reviewed By: mingtaoy
Differential Revision: D18020613
fbshipit-source-id: db82bb250e53f0d225f1280bd67bc74abd417836 |
known_contexts_useful_p (vec<ipa_polymorphic_call_context> known_contexts)
{
ipa_polymorphic_call_context *ctx;
int i;
FOR_EACH_VEC_ELT (known_contexts, i, ctx)
if (!ctx->useless_p ())
return true;
return false;
} | 0 | [
"CWE-20"
] | gcc | a09ccc22459c565814f79f96586fe4ad083fe4eb | 337,843,404,367,528,560,000,000,000,000,000,000,000 | 10 | Avoid segfault when doing IPA-VRP but not IPA-CP (PR 93015)
2019-12-21 Martin Jambor <mjambor@suse.cz>
PR ipa/93015
* ipa-cp.c (ipcp_store_vr_results): Check that info exists
testsuite/
* gcc.dg/lto/pr93015_0.c: New test.
From-SVN: r279695 |
int rr_sequential(READ_RECORD *info)
{
int tmp;
while ((tmp= info->table->file->ha_rnd_next(info->record)))
{
/*
rnd_next can return RECORD_DELETED for MyISAM when one thread is
reading and another deleting without locks.
*/
if (info->thd->killed || (tmp != HA_ERR_RECORD_DELETED))
{
... | 0 | [] | server | 1b8bb44106f528f742faa19d23bd6e822be04f39 | 124,025,585,718,714,930,000,000,000,000,000,000,000 | 17 | MDEV-26351 segfault - (MARIA_HA *) 0x0 in ha_maria::extra
use the correct check. before invoking handler methods we
need to know that the table was opened, not only created. |
static int wait_for_connected(struct usb_device *udev,
struct usb_hub *hub, int *port1,
u16 *portchange, u16 *portstatus)
{
int status = 0, delay_ms = 0;
while (delay_ms < 2000) {
if (status || *portstatus & USB_PORT_STAT_CONNECTION)
break;
if (!port_is_power_on(hub, *portstatus)) {
status = -ENODEV;
... | 0 | [
"CWE-400",
"CWE-703"
] | linux | 704620afc70cf47abb9d6a1a57f3825d2bca49cf | 177,736,223,026,223,570,000,000,000,000,000,000,000 | 20 | USB: check usb_get_extra_descriptor for proper size
When reading an extra descriptor, we need to properly check the minimum
and maximum size allowed, to prevent from invalid data being sent by a
device.
Reported-by: Hui Peng <benquike@gmail.com>
Reported-by: Mathias Payer <mathias.payer@nebelwelt.net>
Co-developed-by... |
static void mutt_decode_quoted (STATE *s, LOFF_T len, int istext, iconv_t cd)
{
char line[STRING];
char decline[2*STRING];
size_t l = 0;
size_t linelen; /* number of input bytes in `line' */
size_t l3;
int last; /* store the last character in the input line */
if (istext)
state_set_prefix(s)... | 0 | [
"CWE-120"
] | mutt | e5ed080c00e59701ca62ef9b2a6d2612ebf765a5 | 326,133,803,841,973,900,000,000,000,000,000,000,000 | 53 | Fix uudecode buffer overflow.
mutt_decode_uuencoded() used each line's initial "length character"
without any validation. It would happily read past the end of the
input line, and with a suitable value even past the length of the
input buffer.
As I noted in ticket 404, there are several other changes that could
be a... |
void __fastcall TConsoleRunner::Input(
const UnicodeString Prompt, UnicodeString & Str, bool Echo, bool Interactive)
{
Print(Prompt);
if (!DoInput(Str, Echo, InputTimeout(), Interactive))
{
Abort();
}
}
| 0 | [
"CWE-787"
] | winscp | faa96e8144e6925a380f94a97aa382c9427f688d | 311,351,789,123,174,970,000,000,000,000,000,000,000 | 10 | Bug 1943: Prevent loading session settings that can lead to remote code execution from handled URLs
https://winscp.net/tracker/1943
(cherry picked from commit ec584f5189a856cd79509f754722a6898045c5e0)
Source commit: 0f4be408b3f01132b00682da72d925d6c4ee649b |
on_monitor_sighup(int signo)
{
sighup_received = 1;
#ifdef POSIX_SIGTYPE
return;
#else
return(0);
#endif
} | 0 | [
"CWE-476"
] | krb5 | 5d2d9a1abe46a2c1a8614d4672d08d9d30a5f8bf | 81,571,523,949,876,200,000,000,000,000,000,000,000 | 10 | Multi-realm KDC null deref [CVE-2013-1418]
If a KDC serves multiple realms, certain requests can cause
setup_server_realm() to dereference a null pointer, crashing the KDC.
CVSSv2: AV:N/AC:M/Au:N/C:N/I:N/A:P/E:POC/RL:OF/RC:C
A related but more minor vulnerability requires authentication to
exploit, and is only prese... |
MONGO_EXPORT void bson_iterator_from_buffer( bson_iterator *i, const char *buffer ) {
i->cur = buffer + 4;
i->first = 1;
} | 0 | [
"CWE-190"
] | mongo-c-driver-legacy | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | 40,552,304,253,023,000,000,000,000,000,000,000,000 | 4 | don't mix up int and size_t (first pass to fix that) |
void prepare_echo_response(Stream *stream, Http2Handler *hd) {
auto length = lseek(stream->file_ent->fd, 0, SEEK_END);
if (length == -1) {
hd->submit_rst_stream(stream, NGHTTP2_INTERNAL_ERROR);
return;
}
stream->body_length = length;
if (lseek(stream->file_ent->fd, 0, SEEK_SET) == -1) {
hd->submit... | 0 | [] | nghttp2 | 95efb3e19d174354ca50c65d5d7227d92bcd60e1 | 131,159,534,346,708,640,000,000,000,000,000,000,000 | 26 | Don't read too greedily |
MagickExport char *GetNextImageRegistry(void)
{
if (IsEventLogging() != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
if (registry == (void *) NULL)
return((char *) NULL);
return((char *) GetNextKeyInSplayTree(registry));
} | 0 | [
"CWE-476"
] | ImageMagick | cca91aa1861818342e3d072bb0fad7dc4ffac24a | 317,642,488,282,947,740,000,000,000,000,000,000,000 | 8 | https://github.com/ImageMagick/ImageMagick/issues/790 |
gsicc_search_icc_table(clist_icctable_t *icc_table, int64_t icc_hashcode, int *size)
{
int tablesize = icc_table->tablesize, k;
clist_icctable_entry_t *curr_entry;
curr_entry = icc_table->head;
for (k = 0; k < tablesize; k++ ) {
if ( curr_entry->serial_data.hashcode == icc_hashcode ) {
... | 0 | [] | ghostpdl | 6d444c273da5499a4cd72f21cb6d4c9a5256807d | 14,815,769,148,368,651,000,000,000,000,000,000,000 | 18 | Bug 697178: Add a file permissions callback
For the rare occasions when the graphics library directly opens a file
(currently for reading), this allows us to apply any restrictions on
file access normally applied in the interpteter. |
virtual void clipToStrokePath(GfxState * /*state*/) {} | 0 | [] | poppler | abf167af8b15e5f3b510275ce619e6fdb42edd40 | 232,861,829,927,822,940,000,000,000,000,000,000,000 | 1 | Implement tiling/patterns in SplashOutputDev
Fixes bug 13518 |
static void sc_usage(void)
{
BIO_printf(bio_err,"usage: s_client args\n");
BIO_printf(bio_err,"\n");
BIO_printf(bio_err," -host host - use -connect instead\n");
BIO_printf(bio_err," -port port - use -connect instead\n");
BIO_printf(bio_err," -connect host:port - who to connect to (default is %s:%s)\n",SSL... | 0 | [] | openssl | ee2ffc279417f15fef3b1073c7dc81a908991516 | 303,904,887,995,895,030,000,000,000,000,000,000,000 | 74 | Add Next Protocol Negotiation. |
void fill_luma_motion_vector_predictors(base_context* ctx,
const slice_segment_header* shdr,
de265_image* img,
int xC,int yC,int nCS,int xP,int yP,
int nPbW,int... | 0 | [
"CWE-787"
] | libde265 | 697aa4f7c774abd6374596e6707a6f4f54265355 | 197,002,547,428,779,920,000,000,000,000,000,000,000 | 74 | fix MC with HDR chroma, but SDR luma (#301) |
print_p2r_header (const char *name, const unsigned char *msg, size_t msglen)
{
DEBUGOUT_1 ("%s:\n", name);
if (msglen < 7)
return;
DEBUGOUT_1 (" dwLength ..........: %u\n", convert_le_u32 (msg+1));
DEBUGOUT_1 (" bSlot .............: %u\n", msg[5]);
DEBUGOUT_1 (" bSeq ..............: %u\n", msg[6]);
} | 0 | [
"CWE-20"
] | gnupg | 2183683bd633818dd031b090b5530951de76f392 | 198,239,993,283,252,400,000,000,000,000,000,000,000 | 9 | Use inline functions to convert buffer data to scalars.
* common/host2net.h (buf16_to_ulong, buf16_to_uint): New.
(buf16_to_ushort, buf16_to_u16): New.
(buf32_to_size_t, buf32_to_ulong, buf32_to_uint, buf32_to_u32): New.
--
Commit 91b826a38880fd8a989318585eb502582636ddd8 was not enough to
avoid all sign extension on ... |
static char *find_include(const char *prefix, const char *file) {
char *pfx = NULL, *ret = NULL, *env = r_sys_getenv (R_EGG_INCDIR_ENV);
if (!prefix) {
prefix = "";
}
if (*prefix == '$') {
char *out = r_sys_getenv (prefix + 1);
pfx = out? out: strdup ("");
} else {
pfx = strdup (prefix);
if (!pfx) {
f... | 0 | [
"CWE-416"
] | radare2 | 93af319e0af787ede96537d46210369f5c24240c | 141,128,523,732,065,500,000,000,000,000,000,000,000 | 50 | Fix #14296 - Segfault in ragg2 (#14308) |
f_isdirectory(typval_T *argvars, typval_T *rettv)
{
if (in_vim9script() && check_for_string_arg(argvars, 0) == FAIL)
return;
rettv->vval.v_number = mch_isdir(tv_get_string(&argvars[0]));
} | 0 | [
"CWE-823",
"CWE-703"
] | vim | 5921aeb5741fc6e84c870d68c7c35b93ad0c9f87 | 291,247,955,184,504,960,000,000,000,000,000,000,000 | 7 | patch 8.2.4418: crash when using special multi-byte character
Problem: Crash when using special multi-byte character.
Solution: Don't use isalpha() for an arbitrary character. |
normal_cmd(
oparg_T *oap,
int toplevel UNUSED) // TRUE when called from main()
{
cmdarg_T ca; // command arguments
int c;
int ctrl_w = FALSE; // got CTRL-W command
int old_col = curwin->w_curswant;
int need_flushbuf = FALSE; // need to call out_flush()
pos_T old_pos; // cursor p... | 0 | [
"CWE-416"
] | vim | e2fa213cf571041dbd04ab0329303ffdc980678a | 231,473,365,677,452,460,000,000,000,000,000,000,000 | 388 | patch 8.2.5024: using freed memory with "]d"
Problem: Using freed memory with "]d".
Solution: Copy the pattern before searching. |
**/
CImg<T>& operator+=(const char *const expression) {
return *this+=(+*this)._fill(expression,true,1,0,0,"operator+=",this); | 0 | [
"CWE-119",
"CWE-787"
] | CImg | ac8003393569aba51048c9d67e1491559877b1d1 | 262,754,147,611,547,600,000,000,000,000,000,000,000 | 3 | . |
sbni_interrupt( int irq, void *dev_id )
{
struct net_device *dev = dev_id;
struct net_local *nl = dev->priv;
int repeat;
spin_lock( &nl->lock );
if( nl->second )
spin_lock( &((struct net_local *) nl->second->priv)->lock );
do {
repeat = 0;
if( inb( dev->base_addr + CSR0 ) & (RC_RDY | TR_RDY) )
h... | 0 | [
"CWE-264"
] | linux-2.6 | f2455eb176ac87081bbfc9a44b21c7cd2bc1967e | 141,069,618,364,515,620,000,000,000,000,000,000,000 | 26 | wan: Missing capability checks in sbni_ioctl()
There are missing capability checks in the following code:
1300 static int
1301 sbni_ioctl( struct net_device *dev, struct ifreq *ifr, int cmd)
1302 {
[...]
1319 case SIOCDEVRESINSTATS :
1320 if( current->euid != 0 ) /* root only */
1321 ... |
void MYSQL_LOG::init(enum_log_type log_type_arg,
enum cache_type io_cache_type_arg)
{
DBUG_ENTER("MYSQL_LOG::init");
log_type= log_type_arg;
io_cache_type= io_cache_type_arg;
DBUG_PRINT("info",("log_type: %d", log_type));
DBUG_VOID_RETURN;
} | 0 | [
"CWE-264"
] | mysql-server | 48bd8b16fe382be302c6f0b45931be5aa6f29a0e | 313,648,991,076,505,300,000,000,000,000,000,000,000 | 9 | Bug#24388753: PRIVILEGE ESCALATION USING MYSQLD_SAFE
[This is the 5.5/5.6 version of the bugfix].
The problem was that it was possible to write log files ending
in .ini/.cnf that later could be parsed as an options file.
This made it possible for users to specify startup options
without the permissions to do so.
Thi... |
schannel_connect_step1(struct Curl_easy *data, struct connectdata *conn,
int sockindex)
{
ssize_t written = -1;
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
SecBuffer outbuf;
SecBufferDesc outbuf_desc;
SecBuffer inbuf;
SecBufferDesc inbuf_desc;
#ifdef HAS_ALPN
unsigned ... | 0 | [
"CWE-416",
"CWE-295"
] | curl | 7f4a9a9b2a49547eae24d2e19bc5c346e9026479 | 33,903,512,494,372,710,000,000,000,000,000,000,000 | 581 | openssl: associate/detach the transfer from connection
CVE-2021-22901
Bug: https://curl.se/docs/CVE-2021-22901.html |
XML_SetCdataSectionHandler(XML_Parser parser,
XML_StartCdataSectionHandler start,
XML_EndCdataSectionHandler end)
{
if (parser == NULL)
return;
startCdataSectionHandler = start;
endCdataSectionHandler = end;
} | 0 | [
"CWE-611"
] | libexpat | c4bf96bb51dd2a1b0e185374362ee136fe2c9d7f | 90,607,189,587,436,570,000,000,000,000,000,000,000 | 9 | xmlparse.c: Fix external entity infinite loop bug (CVE-2017-9233) |
static BROTLI_INLINE uint32_t BROTLI_UNALIGNED_LOAD32LE(const void* p) {
uint32_t value = BrotliUnalignedRead32(p);
return BROTLI_BSWAP32_(value);
} | 0 | [
"CWE-120"
] | brotli | 223d80cfbec8fd346e32906c732c8ede21f0cea6 | 215,193,405,575,505,750,000,000,000,000,000,000,000 | 4 | Update (#826)
* IMPORTANT: decoder: fix potential overflow when input chunk is >2GiB
* simplify max Huffman table size calculation
* eliminate symbol duplicates (static arrays in .h files)
* minor combing in research/ code |
MagickExport MagickBooleanType DrawAffineImage(Image *image,
const Image *source,const AffineMatrix *affine)
{
AffineMatrix
inverse_affine;
CacheView
*image_view,
*source_view;
ExceptionInfo
*exception;
MagickBooleanType
status;
MagickPixelPacket
zero;
PointInfo
extent[4],... | 0 | [] | ImageMagick6 | 4b5e026c704d777efe9c2ead5dd68ca4fe3b2aa1 | 174,786,277,012,104,270,000,000,000,000,000,000,000 | 157 | https://github.com/ImageMagick/ImageMagick/issues/3338 |
std::string get_program_invocation(const std::string &program_name)
{
const std::string real_program_name(program_name
#ifdef DEBUG
+ "-debug"
#endif
#ifdef _WIN32
+ ".exe"
#endif
);
return (path(game_config::wesnoth_program_dir) / real_program_name).string();
} | 0 | [
"CWE-200"
] | wesnoth | f8914468182e8d0a1551b430c0879ba236fe4d6d | 149,092,620,517,897,680,000,000,000,000,000,000,000 | 12 | Disallow inclusion of .pbl files from WML (bug #23504)
Note that this will also cause Lua wesnoth.have_file() to return false
on .pbl files. |
ff_layout_release_ds_info(struct pnfs_ds_commit_info *fl_cinfo,
struct inode *inode)
{
spin_lock(&inode->i_lock);
pnfs_generic_ds_cinfo_destroy(fl_cinfo);
spin_unlock(&inode->i_lock);
} | 0 | [
"CWE-787"
] | linux | ed34695e15aba74f45247f1ee2cf7e09d449f925 | 176,551,249,958,596,660,000,000,000,000,000,000,000 | 7 | pNFS/flexfiles: fix incorrect size check in decode_nfs_fh()
We (adam zabrocki, alexander matrosov, alexander tereshkin, maksym
bazalii) observed the check:
if (fh->size > sizeof(struct nfs_fh))
should not use the size of the nfs_fh struct which includes an extra two
bytes from the size field.
struct nfs_fh {
unsi... |
static void channel_change_topic(IRC_SERVER_REC *server, const char *channel,
const char *topic, const char *setby,
time_t settime)
{
CHANNEL_REC *chanrec;
char *recoded = NULL;
chanrec = channel_find(SERVER(server), channel);
if (chanrec == NULL) return;
/* the topic may be send out encoded, so we need... | 0 | [
"CWE-416"
] | irssi | 43e44d553d44e313003cee87e6ea5e24d68b84a1 | 152,126,712,150,172,920,000,000,000,000,000,000,000 | 25 | Merge branch 'security' into 'master'
Security
Closes GL#12, GL#13, GL#14, GL#15, GL#16
See merge request irssi/irssi!23 |
int push_unpushed_submodules(struct oid_array *commits,
const struct remote *remote,
const char **refspec, int refspec_nr,
const struct string_list *push_options,
int dry_run)
{
int i, ret = 1;
struct string_list needs_pushing = STRING_LIST_INIT_DUP;
if (!find_unpushed_submodules(com... | 0 | [] | git | a8dee3ca610f5a1d403634492136c887f83b59d2 | 226,565,836,576,068,800,000,000,000,000,000,000,000 | 48 | Disallow dubiously-nested submodule git directories
Currently it is technically possible to let a submodule's git
directory point right into the git dir of a sibling submodule.
Example: the git directories of two submodules with the names `hippo`
and `hippo/hooks` would be `.git/modules/hippo/` and
`.git/modules/hipp... |
static int handle_apic_access(struct kvm_vcpu *vcpu)
{
if (likely(fasteoi)) {
unsigned long exit_qualification = vmcs_readl(EXIT_QUALIFICATION);
int access_type, offset;
access_type = exit_qualification & APIC_ACCESS_TYPE;
offset = exit_qualification & APIC_ACCESS_OFFSET;
/*
* Sane guest uses MOV to writ... | 0 | [] | kvm | a642fc305053cc1c6e47e4f4df327895747ab485 | 181,652,608,414,470,750,000,000,000,000,000,000,000 | 22 | kvm: vmx: handle invvpid vm exit gracefully
On systems with invvpid instruction support (corresponding bit in
IA32_VMX_EPT_VPID_CAP MSR is set) guest invocation of invvpid
causes vm exit, which is currently not handled and results in
propagation of unknown exit to userspace.
Fix this by installing an invvpid vm exit ... |
lldp_tlv_end(struct dp_packet *p, unsigned int start)
{
ovs_be16 *tlv = dp_packet_at_assert(p, start, 2);
*tlv |= htons((dp_packet_size(p) - (start + 2)) & 0x1ff);
} | 0 | [
"CWE-400"
] | ovs | 78e712c0b1dacc2f12d2a03d98f083d8672867f0 | 133,629,731,024,295,950,000,000,000,000,000,000,000 | 5 | lldp: do not leak memory on multiple instances of TLVs
Upstream commit:
commit a8d3c90feca548fc0656d95b5d278713db86ff61
Date: Tue, 17 Nov 2020 09:28:17 -0500
lldp: avoid memory leak from bad packets
A packet that contains multiple instances of certain TLVs will cause
lldpd to continually allocate... |
cin_get_equal_amount(linenr_T lnum)
{
char_u *line;
char_u *s;
colnr_T col;
pos_T fp;
if (lnum > 1)
{
line = ml_get(lnum - 1);
if (*line != NUL && line[STRLEN(line) - 1] == '\\')
return -1;
}
line = s = ml_get(lnum);
while (*s != NUL && vim_strchr((char_u *)"=;{}\"'", *s) ==... | 0 | [
"CWE-122",
"CWE-787"
] | vim | 2de9b7c7c8791da8853a9a7ca9c467867465b655 | 87,179,163,097,962,660,000,000,000,000,000,000,000 | 37 | patch 8.2.3625: illegal memory access when C-indenting
Problem: Illegal memory access when C-indenting.
Solution: Also set the cursor column. |
static void udscs_connection_class_init(UdscsConnectionClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
VDAgentConnectionClass *conn_class = VDAGENT_CONNECTION_CLASS(klass);
gobject_class->finalize = udscs_connection_finalize;
conn_class->handle_header = conn_handle_header;
con... | 0 | [
"CWE-770"
] | spice-vd_agent | 91caa9223857708475d29df1768208fed1675340 | 331,622,249,411,344,800,000,000,000,000,000,000,000 | 10 | Avoids unlimited agent connections
Limit the number of agents that can be connected.
Avoids reaching the maximum number of files in a process.
Beside one file descriptor per agent the daemon open just some
other fixed number of files.
This issue was reported by SUSE security team.
Signed-off-by: Frediano Ziglio <fre... |
GF_Node *gf_sg_get_root_node(GF_SceneGraph *sg)
{
return sg ? sg->RootNode : NULL;
} | 0 | [
"CWE-416"
] | gpac | 9723dd0955894f2cb7be13b94cf7a47f2754b893 | 242,286,934,202,881,200,000,000,000,000,000,000,000 | 4 | fixed #2109 |
static long sock_prot_memory_allocated(struct proto *proto)
{
return proto->memory_allocated != NULL ? proto_memory_allocated(proto): -1L;
} | 0 | [
"CWE-119",
"CWE-787"
] | linux | 82981930125abfd39d7c8378a9cfdf5e1be2002b | 61,670,527,001,997,200,000,000,000,000,000,000,000 | 4 | net: cleanups in sock_setsockopt()
Use min_t()/max_t() macros, reformat two comments, use !!test_bit() to
match !!sock_flag()
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net> |
_rsvg_node_text_draw (RsvgNode * self, RsvgDrawingCtx * ctx, int dominate)
{
double x, y;
gboolean lastwasspace = TRUE;
RsvgNodeText *text = (RsvgNodeText *) self;
rsvg_state_reinherit_top (ctx, self->state, dominate);
x = _rsvg_css_normalize_length (&text->x, ctx, 'h');
y = _rsvg_css_normalize... | 0 | [] | librsvg | 34c95743ca692ea0e44778e41a7c0a129363de84 | 14,368,112,653,973,482,000,000,000,000,000,000,000 | 24 | Store node type separately in RsvgNode
The node name (formerly RsvgNode:type) cannot be used to infer
the sub-type of RsvgNode that we're dealing with, since for unknown
elements we put type = node-name. This lead to a (potentially exploitable)
crash e.g. when the element name started with "fe" which tricked
the old c... |
crypt_token_info crypt_token_status(struct crypt_device *cd, int token, const char **type)
{
if (_onlyLUKS2(cd, CRYPT_CD_QUIET | CRYPT_CD_UNRESTRICTED, 0))
return CRYPT_TOKEN_INVALID;
return LUKS2_token_status(cd, &cd->u.luks2.hdr, token, type);
} | 0 | [
"CWE-345"
] | cryptsetup | 0113ac2d889c5322659ad0596d4cfc6da53e356c | 292,091,401,268,017,100,000,000,000,000,000,000,000 | 7 | Fix CVE-2021-4122 - LUKS2 reencryption crash recovery attack
Fix possible attacks against data confidentiality through LUKS2 online
reencryption extension crash recovery.
An attacker can modify on-disk metadata to simulate decryption in
progress with crashed (unfinished) reencryption step and persistently
decrypt par... |
static inline void init_sd_lb_stats(struct sd_lb_stats *sds)
{
/*
* Skimp on the clearing to avoid duplicate work. We can avoid clearing
* local_stat because update_sg_lb_stats() does a full clear/assignment.
* We must however clear busiest_stat::avg_load because
* update_sd_pick_busiest() reads this before as... | 0 | [
"CWE-400",
"CWE-703",
"CWE-835"
] | linux | c40f7d74c741a907cfaeb73a7697081881c497d0 | 339,638,374,231,487,540,000,000,000,000,000,000,000 | 21 | sched/fair: Fix infinite loop in update_blocked_averages() by reverting a9e7f6544b9c
Zhipeng Xie, Xie XiuQi and Sargun Dhillon reported lockups in the
scheduler under high loads, starting at around the v4.18 time frame,
and Zhipeng Xie tracked it down to bugs in the rq->leaf_cfs_rq_list
manipulation.
Do a (manual) re... |
static int proc_setconfig(struct usb_dev_state *ps, void __user *arg)
{
int u;
int status = 0;
struct usb_host_config *actconfig;
if (get_user(u, (int __user *)arg))
return -EFAULT;
actconfig = ps->dev->actconfig;
/* Don't touch the device if any interfaces are claimed.
* It could interfere with other driv... | 0 | [
"CWE-200"
] | linux | 681fef8380eb818c0b845fca5d2ab1dcbab114ee | 319,063,118,680,770,140,000,000,000,000,000,000,000 | 47 | USB: usbfs: fix potential infoleak in devio
The stack object “ci” has a total size of 8 bytes. Its last 3 bytes
are padding bytes which are not initialized and leaked to userland
via “copy_to_user”.
Signed-off-by: Kangjie Lu <kjlu@gatech.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
static char *tcm_loop_get_endpoint_wwn(struct se_portal_group *se_tpg)
{
struct tcm_loop_tpg *tl_tpg =
(struct tcm_loop_tpg *)se_tpg->se_tpg_fabric_ptr;
/*
* Return the passed NAA identifier for the SAS Target Port
*/
return &tl_tpg->tl_hba->tl_wwn_address[0];
} | 0 | [
"CWE-119",
"CWE-787"
] | linux | 12f09ccb4612734a53e47ed5302e0479c10a50f8 | 143,702,272,752,972,360,000,000,000,000,000,000,000 | 9 | loopback: off by one in tcm_loop_make_naa_tpg()
This is an off by one 'tgpt' check in tcm_loop_make_naa_tpg() that could result
in memory corruption.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org> |
static void nvme_zone_reset_cb(void *opaque, int ret)
{
NvmeZoneResetAIOCB *iocb = opaque;
NvmeRequest *req = iocb->req;
NvmeNamespace *ns = req->ns;
if (ret < 0) {
iocb->ret = ret;
goto done;
}
if (iocb->zone) {
nvme_zrm_reset(ns, iocb->zone);
if (!iocb->all) ... | 0 | [] | qemu | 736b01642d85be832385063f278fe7cd4ffb5221 | 70,673,788,413,442,750,000,000,000,000,000,000,000 | 58 | 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... |
buflist_new(
char_u *ffname_arg, // full path of fname or relative
char_u *sfname_arg, // short fname or NULL
linenr_T lnum, // preferred cursor line
int flags) // BLN_ defines
{
char_u *ffname = ffname_arg;
char_u *sfname = sfname_arg;
buf_T *buf;
#ifdef UNIX
stat_T st;
#endif
i... | 0 | [
"CWE-416"
] | vim | 9b4a80a66544f2782040b641498754bcb5b8d461 | 33,623,469,486,996,893,000,000,000,000,000,000,000 | 271 | patch 8.2.4281: using freed memory with :lopen and :bwipe
Problem: Using freed memory with :lopen and :bwipe.
Solution: Do not use a wiped out buffer. |
int ext4_mark_inode_dirty(handle_t *handle, struct inode *inode)
{
struct ext4_iloc iloc;
struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
int err;
might_sleep();
trace_ext4_mark_inode_dirty(inode, _RET_IP_);
err = ext4_reserve_inode_write(handle, inode, &iloc);
if (err)
return err;
if (EXT4_I(inode)->i_ext... | 0 | [] | linux | 8e4b5eae5decd9dfe5a4ee369c22028f90ab4c44 | 184,374,461,210,892,270,000,000,000,000,000,000,000 | 18 | ext4: fail ext4_iget for root directory if unallocated
If the root directory has an i_links_count of zero, then when the file
system is mounted, then when ext4_fill_super() notices the problem and
tries to call iput() the root directory in the error return path,
ext4_evict_inode() will try to free the inode on disk, b... |
GC_API GC_ATTR_MALLOC void * GC_CALL GC_malloc_kind_global(size_t lb, int k)
{
void *op;
void **opp;
size_t lg;
DCL_LOCK_STATE;
GC_ASSERT(k < MAXOBJKINDS);
if (SMALL_OBJ(lb)) {
GC_DBG_COLLECT_AT_MALLOC(lb);
lg = GC_size_map[lb];
LOCK();
opp = &GC_obj_kinds[k].ok_... | 0 | [
"CWE-119"
] | bdwgc | 7292c02fac2066d39dd1bcc37d1a7054fd1e32ee | 200,396,279,595,537,400,000,000,000,000,000,000,000 | 34 | Fix malloc routines to prevent size value wrap-around
See issue #135 on Github.
* allchblk.c (GC_allochblk, GC_allochblk_nth): Use
OBJ_SZ_TO_BLOCKS_CHECKED instead of OBJ_SZ_TO_BLOCKS.
* malloc.c (GC_alloc_large): Likewise.
* alloc.c (GC_expand_hp_inner): Type of "bytes" local variable changed
from word to size_t; ca... |
static int get_client_master_key(SSL *s)
{
int is_export, i, n, keya, ek;
unsigned long len;
unsigned char *p;
const SSL_CIPHER *cp;
const EVP_CIPHER *c;
const EVP_MD *md;
p = (unsigned char *)s->init_buf->data;
if (s->state == SSL2_ST_GET_CLIENT_MASTER_KEY_A) {
i = ssl2_read(s,... | 1 | [
"CWE-20"
] | openssl | 86f8fb0e344d62454f8daf3e15236b2b59210756 | 170,603,313,163,069,730,000,000,000,000,000,000,000 | 155 | Fix reachable assert in SSLv2 servers.
This assert is reachable for servers that support SSLv2 and export ciphers.
Therefore, such servers can be DoSed by sending a specially crafted
SSLv2 CLIENT-MASTER-KEY.
Also fix s2_srvr.c to error out early if the key lengths are malformed.
These lengths are sent unencrypted, so... |
void exec_command_free_array(ExecCommand **c, size_t n) {
size_t i;
for (i = 0; i < n; i++)
c[i] = exec_command_free_list(c[i]);
} | 0 | [
"CWE-269"
] | systemd | f69567cbe26d09eac9d387c0be0fc32c65a83ada | 97,044,175,612,723,320,000,000,000,000,000,000,000 | 6 | core: expose SUID/SGID restriction as new unit setting RestrictSUIDSGID= |
local_scan_crash_handler(int sig)
{
log_write(0, LOG_MAIN|LOG_REJECT, "local_scan() function crashed with "
"signal %d - message temporarily rejected (size %d)", sig, message_size);
/* Does not return */
receive_bomb_out(US"local-scan-error", US"local verification problem");
} | 0 | [
"CWE-416"
] | exim | 4e6ae6235c68de243b1c2419027472d7659aa2b4 | 322,259,861,264,450,700,000,000,000,000,000,000,000 | 7 | Avoid release of store if there have been later allocations. Bug 2199 |
u32 parse_dashlive(char *arg, char *arg_val, u32 opt)
{
dash_mode = opt ? GF_DASH_DYNAMIC_DEBUG : GF_DASH_DYNAMIC;
dash_live = 1;
if (arg[10] == '=') {
dash_ctx_file = arg + 11;
}
dash_duration = atof(arg_val);
return 0; | 0 | [
"CWE-787"
] | gpac | 4e56ad72ac1afb4e049a10f2d99e7512d7141f9d | 134,823,821,549,362,270,000,000,000,000,000,000,000 | 10 | fixed #2216 |
void display_progress (double file_progress)
{
char title [40];
if (set_console_title) {
file_progress = (file_index + file_progress) / num_files;
sprintf (title, "%d%% (WvUnpack)", (int) ((file_progress * 100.0) + 0.5));
DoSetConsoleTitle (title);
}
} | 0 | [
"CWE-476",
"CWE-703"
] | WavPack | 25b4a2725d8568212e7cf89ca05ca29d128af7ac | 289,377,437,645,718,840,000,000,000,000,000,000,000 | 10 | issue #121: NULL pointer dereference in wvunpack.c
* check for NULL pointer before dereferencing in wvunpack.c
* sanitize custom extensions to be alphanumeric only |
static int exif_scan_thumbnail(image_info_type *ImageInfo)
{
uchar c, *data = (uchar*)ImageInfo->Thumbnail.data;
int n, marker;
size_t length=2, pos=0;
jpeg_sof_info sof_info;
if (!data) {
return FALSE; /* nothing to do here */
}
if (memcmp(data, "\xFF\xD8\xFF", 3)) {
if (!I... | 1 | [
"CWE-125"
] | php-src | f22101c8308669bb63c03a73a2cac2408d844f38 | 84,288,978,238,803,080,000,000,000,000,000,000,000 | 86 | Fix bug #78222 (heap-buffer-overflow on exif_scan_thumbnail)
(cherry picked from commit dea2989ab8ba87a6180af497b2efaf0527e985c5) |
static inline struct crypto_instance *shash_crypto_instance(
struct shash_instance *inst)
{
return container_of(&inst->alg.base, struct crypto_instance, alg);
} | 0 | [
"CWE-835"
] | linux | ef0579b64e93188710d48667cb5e014926af9f1b | 226,592,700,557,769,360,000,000,000,000,000,000,000 | 5 | crypto: ahash - Fix EINPROGRESS notification callback
The ahash API modifies the request's callback function in order
to clean up after itself in some corner cases (unaligned final
and missing finup).
When the request is complete ahash will restore the original
callback and everything is fine. However, when the requ... |
propagate_context_across_jump_function (cgraph_edge *cs,
ipa_jump_func *jfunc, int idx,
ipcp_lattice<ipa_polymorphic_call_context> *dest_lat)
{
ipa_edge_args *args = IPA_EDGE_REF (cs);
if (dest_lat->bottom)
return false;
bool ret = false;
bool added_sth = false;
bool type_preserved = true;
ip... | 0 | [
"CWE-20"
] | gcc | a09ccc22459c565814f79f96586fe4ad083fe4eb | 69,034,801,759,301,480,000,000,000,000,000,000,000 | 81 | Avoid segfault when doing IPA-VRP but not IPA-CP (PR 93015)
2019-12-21 Martin Jambor <mjambor@suse.cz>
PR ipa/93015
* ipa-cp.c (ipcp_store_vr_results): Check that info exists
testsuite/
* gcc.dg/lto/pr93015_0.c: New test.
From-SVN: r279695 |
void SSL_free(SSL *s)
{
int i;
if(s == NULL)
return;
i=CRYPTO_add(&s->references,-1,CRYPTO_LOCK_SSL);
#ifdef REF_PRINT
REF_PRINT("SSL",s);
#endif
if (i > 0) return;
#ifdef REF_CHECK
if (i < 0)
{
fprintf(stderr,"SSL_free, bad reference count\n");
abort(); /* ok */
}
#endif
if (s->param)
X509_VE... | 0 | [] | openssl | 0ffa49970b9f8ea66b43ce2eb7f8fd523b65bc2c | 155,612,066,933,196,720,000,000,000,000,000,000,000 | 100 | Backport support for fixed DH ciphersuites (from HEAD) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.