func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
static int write_all (const struct commonio_db *db)
/*@requires notnull db->fp@*/
{
const struct commonio_entry *p;
void *eptr;
for (p = db->head; NULL != p; p = p->next) {
if (p->changed) {
eptr = p->eptr;
assert (NULL != eptr);
if (db->ops->put (eptr, db->fp) != 0) {
return -1;
}
} else if (N... | 0 | [
"CWE-119",
"CWE-787"
] | shadow | 954e3d2e7113e9ac06632aee3c69b8d818cc8952 | 238,995,920,287,394,130,000,000,000,000,000,000,000 | 24 | Fix buffer overflow if NULL line is present in db.
If ptr->line == NULL for an entry, the first cycle will exit,
but the second one will happily write past entries buffer.
We actually do not want to exit the first cycle prematurely
on ptr->line == NULL.
Signed-off-by: Tomas Mraz <tmraz@fedoraproject.org> |
parse_double_time(const char *text, VALUE clas) {
long v = 0;
long v2 = 0;
const char *dot = 0;
char c;
for (; '.' != *text; text++) {
c = *text;
if (c < '0' || '9' < c) {
return Qnil;
}
v = 10 * v + (long)(c - '0');
}
dot = text++;
for (; '\0' != *text && text - dot <= 6; ... | 0 | [
"CWE-20"
] | ox | e4565dbc167f0d38c3f93243d7a4fcfc391cbfc8 | 20,524,396,894,125,870,000,000,000,000,000,000,000 | 30 | Avoid crash with invalid XML passed to Oj.parse_obj() |
void Compute(OpKernelContext* const context) override {
core::RefCountPtr<BoostedTreesEnsembleResource> resource;
// Get the resource.
OP_REQUIRES_OK(context, LookupResource(context, HandleFromInput(context, 0),
&resource));
// Get the inputs.
OpInputLis... | 1 | [
"CWE-703",
"CWE-197"
] | tensorflow | ca8c013b5e97b1373b3bb1c97ea655e69f31a575 | 83,232,128,611,169,110,000,000,000,000,000,000,000 | 69 | Prevent integer truncation from 64 to 32 bits.
The `tensorflow::Shard` functions last argument must be a 2 argument function where both arguments are `int64` (`long long`, 64 bits). However, there are usages where code passes in a function where arguments are `int` or `int32` (32 bits). In these cases, it is possible ... |
Document getSpec() {
return DOC("input" << DOC_ARRAY(vector<Value>() << DOC_ARRAY(1 << 2)) << "expected"
<< DOC("$setIntersection" << vector<Value>() << "$setUnion"
<< DOC_ARRAY(1 << 2)
... | 0 | [
"CWE-835"
] | mongo | 0a076417d1d7fba3632b73349a1fd29a83e68816 | 245,708,601,748,895,100,000,000,000,000,000,000,000 | 11 | SERVER-38070 fix infinite loop in agg expression |
void AuthorizationSession::logoutDatabase(const std::string& dbname) {
Principal* principal = _authenticatedPrincipals.lookupByDBName(dbname);
if (!principal)
return;
_acquiredPrivileges.revokePrivilegesFromUser(principal->getName());
_authenticatedPrincipals.removeByDBNa... | 0 | [
"CWE-264"
] | mongo | c5ad04549e40b1069029026081d9324e9e06156c | 219,593,701,854,931,370,000,000,000,000,000,000,000 | 8 | SERVER-9983 Do not needlessly lock when looking up privileges for the __system@local user.
Uncorrected, this can cause replica set heartbeats to stall behind operations
that hold the read lock for a long time. |
static void md_merge_srv(md_t *md, md_srv_conf_t *base_sc, apr_pool_t *p)
{
if (!md->sc) {
md->sc = base_sc;
}
if (!md->ca_url) {
md->ca_url = md_config_gets(md->sc, MD_CONFIG_CA_URL);
}
if (!md->ca_proto) {
md->ca_proto = md_config_gets(md->sc, MD_CONFIG_CA_PROTO);
}
... | 0 | [
"CWE-476"
] | mod_md | e71001955809247b3aa4d269e1e0741b4fe0fc3d | 314,312,542,015,458,660,000,000,000,000,000,000,000 | 44 | v1.1.12, notifycmd improvements |
TestContext(Extensions::Common::Wasm::Wasm* wasm) : Extensions::Common::Wasm::Context(wasm) {} | 0 | [
"CWE-476"
] | envoy | 8788a3cf255b647fd14e6b5e2585abaaedb28153 | 219,200,712,858,260,600,000,000,000,000,000,000,000 | 1 | 1.4 - Do not call into the VM unless the VM Context has been created. (#24)
* Ensure that the in VM Context is created before onDone is called.
Signed-off-by: John Plevyak <jplevyak@gmail.com>
* Update as per offline discussion.
Signed-off-by: John Plevyak <jplevyak@gmail.com>
* Set in_vm_context_created_ in onNet... |
maybe_load_repodata(Repodata *data, Id keyname)
{
if (keyname && !repodata_precheck_keyname(data, keyname))
return 0; /* do not bother... */
if (data->state == REPODATA_AVAILABLE || data->state == REPODATA_LOADING)
return 1;
if (data->state == REPODATA_ERROR)
return 0;
return maybe_load_repodata_stu... | 0 | [
"CWE-125"
] | libsolv | fdb9c9c03508990e4583046b590c30d958f272da | 130,769,431,812,713,780,000,000,000,000,000,000,000 | 10 | repodata_schema2id: fix heap-buffer-overflow in memcmp
When the length of last schema in data->schemadata is
less than length of input schema, we got a read overflow
in asan test.
Signed-off-by: Zhipeng Xie <xiezhipeng1@huawei.com> |
static void t1_include(PDF pdf)
{
do {
t1_getline();
t1_scan_param(pdf);
t1_putline(pdf);
}
while (t1_in_eexec == 0);
t1_start_eexec(pdf);
do {
t1_getline();
t1_scan_param(pdf);
t1_putline(pdf);
}
while (!(t1_charstrings() || t1_subrs()));
... | 0 | [
"CWE-119"
] | texlive-source | 6ed0077520e2b0da1fd060c7f88db7b2e6068e4c | 275,451,165,784,264,060,000,000,000,000,000,000,000 | 34 | writet1 protection against buffer overflow
git-svn-id: svn://tug.org/texlive/trunk/Build/source@48697 c570f23f-e606-0410-a88d-b1316a301751 |
void __mnt_drop_write_file(struct file *file)
{
__mnt_drop_write(file->f_path.mnt);
} | 0 | [
"CWE-269"
] | user-namespace | a6138db815df5ee542d848318e5dae681590fccd | 181,709,980,816,083,260,000,000,000,000,000,000,000 | 4 | mnt: Only change user settable mount flags in remount
Kenton Varda <kenton@sandstorm.io> discovered that by remounting a
read-only bind mount read-only in a user namespace the
MNT_LOCK_READONLY bit would be cleared, allowing an unprivileged user
to the remount a read-only mount read-write.
Correct this by replacing t... |
rfbTightExtensionMsgHandler(struct _rfbClientRec* cl, void* data,
const rfbClientToServerMsg* msg)
{
switch (msg->type) {
case rfbFileListRequest:
return handleMessage(cl, "rfbFileListRequest", HandleFileListRequest);
case rfbFileDownloadRequest:
return handleMessage(cl, "rfbFileDownloadRequest", Hand... | 0 | [] | libvncserver | 804335f9d296440bb708ca844f5d89b58b50b0c6 | 331,098,346,500,192,470,000,000,000,000,000,000,000 | 51 | Thread safety for zrle, zlib, tight.
Proposed tight security type fix for debian bug 517422. |
void __init reset_cpu_topology(void)
{
unsigned int cpu;
for_each_possible_cpu(cpu) {
struct cpu_topology *cpu_topo = &cpu_topology[cpu];
cpu_topo->thread_id = -1;
cpu_topo->core_id = -1;
cpu_topo->package_id = -1;
cpu_topo->llc_id = -1;
clear_cpu_topology(cpu);
}
} | 0 | [
"CWE-787"
] | linux | aa838896d87af561a33ecefea1caa4c15a68bc47 | 10,866,713,644,166,370,000,000,000,000,000,000,000 | 15 | drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions
Convert the various sprintf fmaily calls in sysfs device show functions
to sysfs_emit and sysfs_emit_at for PAGE_SIZE buffer safety.
Done with:
$ spatch -sp-file sysfs_emit_dev.cocci --in-place --max-width=80 .
And cocci script:
$ cat s... |
path_n_gt(PG_FUNCTION_ARGS)
{
PATH *p1 = PG_GETARG_PATH_P(0);
PATH *p2 = PG_GETARG_PATH_P(1);
PG_RETURN_BOOL(p1->npts > p2->npts);
} | 0 | [
"CWE-703",
"CWE-189"
] | postgres | 31400a673325147e1205326008e32135a78b4d8a | 14,998,065,473,048,723,000,000,000,000,000,000,000 | 7 | Predict integer overflow to avoid buffer overruns.
Several functions, mostly type input functions, calculated an allocation
size such that the calculation wrapped to a small positive value when
arguments implied a sufficiently-large requirement. Writes past the end
of the inadvertent small allocation followed shortly... |
fill1 (unsigned short data[/*n*/], int n, float bias, IMATH_NAMESPACE::Rand48 & rand48)
{
for (int i = 0; i < n; ++i)
data[i] = (unsigned short)
(pow (rand48.nextf(), double(bias)) * (USHRT_MAX + 1));
} | 0 | [
"CWE-190"
] | openexr | 51a92d67f53c08230734e74564c807043cbfe41e | 108,070,202,423,008,510,000,000,000,000,000,000,000 | 6 | check for valid Huf code lengths (#849)
* check for valid Huf code lengths
* test non-fast huf decoder in testHuf
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz> |
void CLASS parseSonyLensType2 (uchar a, uchar b) {
ushort lid2;
lid2 = (((ushort)a)<<8) | ((ushort)b);
if (!lid2) return;
if (lid2 < 0x100)
{
imgdata.lens.makernotes.AdapterID = lid2;
switch (lid2) {
case 1:
case 2:
case 3:
case 6:
imgdata.lens.makernotes.LensMoun... | 0 | [
"CWE-129"
] | LibRaw | 89d065424f09b788f443734d44857289489ca9e2 | 187,789,736,245,948,000,000,000,000,000,000,000,000 | 25 | fixed two more problems found by fuzzer |
struct psi_trigger *psi_trigger_create(struct psi_group *group,
char *buf, size_t nbytes, enum psi_res res)
{
struct psi_trigger *t;
enum psi_states state;
u32 threshold_us;
u32 window_us;
if (static_branch_likely(&psi_disabled))
return ERR_PTR(-EOPNOTSUPP);
if (sscanf(buf, "some %u %u", &threshold_us, &wi... | 0 | [
"CWE-787"
] | linux | 6fcca0fa48118e6d63733eb4644c6cd880c15b8f | 289,451,809,345,141,260,000,000,000,000,000,000,000 | 74 | sched/psi: Fix OOB write when writing 0 bytes to PSI files
Issuing write() with count parameter set to 0 on any file under
/proc/pressure/ will cause an OOB write because of the access to
buf[buf_size-1] when NUL-termination is performed. Fix this by checking
for buf_size to be non-zero.
Signed-off-by: Suren Baghdasa... |
router_get_trusteddirserver_by_digest(const char *digest)
{
if (!trusted_dir_servers)
return NULL;
SMARTLIST_FOREACH(trusted_dir_servers, dir_server_t *, ds,
{
if (tor_memeq(ds->digest, digest, DIGEST_LEN))
return ds;
});
return NULL;
} | 0 | [] | tor | 1afc2ed956a35b40dfd1d207652af5b50c295da7 | 232,585,368,897,935,100,000,000,000,000,000,000,000 | 13 | Fix policies.c instance of the "if (r=(a-b)) return r" pattern
I think this one probably can't underflow, since the input ranges
are small. But let's not tempt fate.
This patch also replaces the "cmp" functions here with just "eq"
functions, since nothing actually checked for anything besides 0 and
nonzero.
Related... |
static int replmd_name_modify(struct replmd_replicated_request *ar,
struct ldb_request *req, struct ldb_dn *dn)
{
struct ldb_message *msg;
const char *rdn_name;
const struct ldb_val *rdn_val;
const struct dsdb_attribute *rdn_attr;
int ret;
msg = ldb_msg_new(req);
if (msg == NULL) {
goto failed;
}
m... | 1 | [
"CWE-200"
] | samba | 0a3aa5f908e351201dc9c4d4807b09ed9eedff77 | 224,633,367,753,195,680,000,000,000,000,000,000,000 | 70 | CVE-2022-32746 ldb: Make use of functions for appending to an ldb_message
This aims to minimise usage of the error-prone pattern of searching for
a just-added message element in order to make modifications to it (and
potentially finding the wrong element).
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15009
Signed... |
static int gre_handle_offloads(struct sk_buff *skb, bool csum)
{
return iptunnel_handle_offloads(skb,
csum ? SKB_GSO_GRE_CSUM : SKB_GSO_GRE);
} | 0 | [
"CWE-125"
] | net | 7892032cfe67f4bde6fc2ee967e45a8fbaf33756 | 100,714,186,052,895,020,000,000,000,000,000,000,000 | 5 | ip6_gre: fix ip6gre_err() invalid reads
Andrey Konovalov reported out of bound accesses in ip6gre_err()
If GRE flags contains GRE_KEY, the following expression
*(((__be32 *)p) + (grehlen / 4) - 1)
accesses data ~40 bytes after the expected point, since
grehlen includes the size of IPv6 headers.
Let's use a "struct ... |
virtual bool check_partition_func_processor(void *arg) { return 1;} | 0 | [
"CWE-617"
] | server | 2e7891080667c59ac80f788eef4d59d447595772 | 199,409,260,426,926,300,000,000,000,000,000,000,000 | 1 | MDEV-25635 Assertion failure when pushing from HAVING into WHERE of view
This bug could manifest itself after pushing a where condition over a
mergeable derived table / view / CTE DT into a grouping view / derived
table / CTE V whose item list contained set functions with constant
arguments such as MIN(2), SUM(1) etc.... |
hstore_akeys(PG_FUNCTION_ARGS)
{
HStore *hs = PG_GETARG_HS(0);
Datum *d;
ArrayType *a;
HEntry *entries = ARRPTR(hs);
char *base = STRPTR(hs);
int count = HS_COUNT(hs);
int i;
if (count == 0)
{
a = construct_empty_array(TEXTOID);
PG_RETURN_POINTER(a);
}
d = (Datum *) palloc(sizeof(Datum... | 0 | [
"CWE-703",
"CWE-189"
] | postgres | 31400a673325147e1205326008e32135a78b4d8a | 94,557,957,651,608,870,000,000,000,000,000,000,000 | 31 | Predict integer overflow to avoid buffer overruns.
Several functions, mostly type input functions, calculated an allocation
size such that the calculation wrapped to a small positive value when
arguments implied a sufficiently-large requirement. Writes past the end
of the inadvertent small allocation followed shortly... |
int btrfs_scrub_dev(struct btrfs_fs_info *fs_info, u64 devid, u64 start,
u64 end, struct btrfs_scrub_progress *progress,
int readonly, int is_dev_replace)
{
struct scrub_ctx *sctx;
int ret;
struct btrfs_device *dev;
unsigned int nofs_flag;
if (btrfs_fs_closing(fs_info))
return -EINVAL;
if (fs_info... | 1 | [
"CWE-476",
"CWE-284"
] | linux | 09ba3bc9dd150457c506e4661380a6183af651c1 | 71,034,765,595,523,380,000,000,000,000,000,000,000 | 159 | btrfs: merge btrfs_find_device and find_device
Both btrfs_find_device() and find_device() does the same thing except
that the latter does not take the seed device onto account in the device
scanning context. We can merge them.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.c... |
lr_get_best_checksum(const LrMetalink *metalink,
GSList **checksums)
{
gboolean ret;
LrChecksumType ch_type;
gchar *ch_value;
// From the metalink itself
ret = lr_best_checksum(metalink->hashes, &ch_type, &ch_value);
if (ret)
{
LrDownloadTargetChecksum *dtch;
... | 0 | [
"CWE-22"
] | librepo | 7daea2a2429a54dad68b1de9b37a5f65c5cf2600 | 129,197,251,502,343,680,000,000,000,000,000,000,000 | 32 | Validate path read from repomd.xml (RhBug:1868639)
= changelog =
msg: Validate path read from repomd.xml
type: security
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1868639 |
void ha_partition::clear_handler_file()
{
if (m_engine_array)
plugin_unlock_list(NULL, m_engine_array, m_tot_parts);
free_root(&m_mem_root, MYF(MY_KEEP_PREALLOC));
m_file_buffer= NULL;
m_engine_array= NULL;
m_connect_string= NULL;
} | 0 | [] | server | f305a7ce4bccbd56520d874e1d81a4f29bc17a96 | 273,129,539,749,479,340,000,000,000,000,000,000,000 | 9 | bugfix: long partition names |
pdf_filter_Tstar(fz_context *ctx, pdf_processor *proc)
{
pdf_filter_processor *p = (pdf_filter_processor*)proc;
pdf_tos_newline(&p->tos, p->gstate->pending.text.leading);
/* If Tm_pending, then just adjusting the matrix (as
* pdf_tos_newline has done) is enough. Otherwise we
* need to actually call the operator.... | 0 | [
"CWE-125"
] | mupdf | 97096297d409ec6f206298444ba00719607e8ba8 | 226,031,125,684,485,600,000,000,000,000,000,000,000 | 10 | Bug 701292: Fix test for missing/empty string. |
static bool is_debug_pagealloc_cache(struct kmem_cache *cachep)
{
if (debug_pagealloc_enabled() && OFF_SLAB(cachep) &&
(cachep->size % PAGE_SIZE) == 0)
return true;
return false;
} | 0 | [
"CWE-703"
] | linux | c4e490cf148e85ead0d1b1c2caaba833f1d5b29f | 189,681,267,019,789,560,000,000,000,000,000,000,000 | 8 | mm/slab.c: fix SLAB freelist randomization duplicate entries
This patch fixes a bug in the freelist randomization code. When a high
random number is used, the freelist will contain duplicate entries. It
will result in different allocations sharing the same chunk.
It will result in odd behaviours and crashes. It sh... |
SslBumpEstablish(const Comm::ConnectionPointer &, char *, size_t, Comm::Flag errflag, int, void *data)
{
ClientHttpRequest *r = static_cast<ClientHttpRequest*>(data);
debugs(85, 5, HERE << "responded to CONNECT: " << r << " ? " << errflag);
assert(r && cbdataReferenceValid(r));
r->sslBumpEstablish(errf... | 0 | [
"CWE-116"
] | squid | 7024fb734a59409889e53df2257b3fc817809fb4 | 45,541,921,491,702,100,000,000,000,000,000,000,000 | 8 | Handle more Range requests (#790)
Also removed some effectively unused code. |
int nfsd_nrpools(struct net *net)
{
struct nfsd_net *nn = net_generic(net, nfsd_net_id);
if (nn->nfsd_serv == NULL)
return 0;
else
return nn->nfsd_serv->sv_nrpools;
} | 0 | [
"CWE-20"
] | linux | e6838a29ecb484c97e4efef9429643b9851fba6e | 23,410,407,222,369,537,000,000,000,000,000,000,000 | 9 | nfsd: check for oversized NFSv2/v3 arguments
A client can append random data to the end of an NFSv2 or NFSv3 RPC call
without our complaining; we'll just stop parsing at the end of the
expected data and ignore the rest.
Encoded arguments and replies are stored together in an array of pages,
and if a call is too large... |
void reset_open_tables_state(THD *thd)
{
open_tables= 0;
temporary_tables= 0;
derived_tables= 0;
rec_tables= 0;
extra_lock= 0;
lock= 0;
locked_tables_mode= LTM_NONE;
state_flags= 0U;
m_reprepare_observer= NULL;
} | 0 | [
"CWE-416"
] | server | 4681b6f2d8c82b4ec5cf115e83698251963d80d5 | 158,541,211,920,384,320,000,000,000,000,000,000,000 | 12 | MDEV-26281 ASAN use-after-poison when complex conversion is involved in blob
the bug was that in_vector array in Item_func_in was allocated in the
statement arena, not in the table->expr_arena.
revert part of the 5acd391e8b2d. Instead, change the arena correctly
in fix_all_session_vcol_exprs().
Remove TABLE_ARENA, t... |
static int ZEND_FASTCALL ZEND_CONT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
zend_free_op free_op2;
zend_brk_cont_element *el;
el = zend_brk_cont(_get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC), opline->op1.u.opline_num,
EX(op_array), EX(Ts) TSRMLS... | 0 | [] | php-src | ce96fd6b0761d98353761bf78d5bfb55291179fd | 158,297,313,103,281,070,000,000,000,000,000,000,000 | 11 | - fix #39863, do not accept paths with NULL in them. See http://news.php.net/php.internals/50191, trunk will have the patch later (adding a macro and/or changing (some) APIs. Patch by Rasmus |
RGWOp *RGWHandler_REST_Obj_SWIFT::op_copy()
{
return new RGWCopyObj_ObjStore_SWIFT;
} | 0 | [
"CWE-617"
] | ceph | f44a8ae8aa27ecef69528db9aec220f12492810e | 311,523,708,878,193,530,000,000,000,000,000,000,000 | 4 | rgw: RGWSwiftWebsiteHandler::is_web_dir checks empty subdir_name
checking for empty name avoids later assertion in RGWObjectCtx::set_atomic
Fixes: CVE-2021-3531
Reviewed-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 7196a469b4470f3c8628489df9a41ec8b... |
g_vfs_daemon_has_blocking_processes (GVfsDaemon *daemon)
{
GList *l;
g_mutex_lock (&daemon->lock);
for (l = daemon->jobs; l != NULL; l = l->next)
{
if (!G_VFS_IS_JOB_UNMOUNT (l->data))
{
g_debug ("blocking job: %p\n", l->data);
g_mutex_unlock (&daemon->lock);
retur... | 0 | [
"CWE-276"
] | gvfs | e3808a1b4042761055b1d975333a8243d67b8bfe | 180,379,567,239,765,900,000,000,000,000,000,000,000 | 18 | gvfsdaemon: Check that the connecting client is the same user
Otherwise, an attacker who learns the abstract socket address from
netstat(8) or similar could connect to it and issue D-Bus method
calls.
Signed-off-by: Simon McVittie <smcv@collabora.com> |
check_max_stack_depth(int *newval, void **extra, GucSource source)
{
long newval_bytes = *newval * 1024L;
long stack_rlimit = get_stack_depth_rlimit();
if (stack_rlimit > 0 && newval_bytes > stack_rlimit - STACK_DEPTH_SLOP)
{
GUC_check_errdetail("\"max_stack_depth\" must not exceed %ldkB.",
(stack_rlimi... | 0 | [
"CWE-89"
] | postgres | 2b3a8b20c2da9f39ffecae25ab7c66974fbc0d3b | 165,075,976,411,267,020,000,000,000,000,000,000,000 | 14 | Be more careful to not lose sync in the FE/BE protocol.
If any error occurred while we were in the middle of reading a protocol
message from the client, we could lose sync, and incorrectly try to
interpret a part of another message as a new protocol message. That will
usually lead to an "invalid frontend message" erro... |
apr_status_t h2_request_add_header(h2_request *req, apr_pool_t *pool,
const char *name, size_t nlen,
const char *value, size_t vlen)
{
apr_status_t status = APR_SUCCESS;
if (nlen <= 0) {
return status;
}
if (name[0]... | 0 | [
"CWE-416"
] | mod_h2 | 576ed4866e88dfca432b2b92576a7590d6118a79 | 20,800,426,622,652,789,000,000,000,000,000,000,000 | 52 | * Integrated a forgotten request init fix from Apache subversion |
static inline void VectorMultiplyAdd(const DDSVector4 a, const DDSVector4 b,
const DDSVector4 c, DDSVector4 *destination)
{
destination->x = (a.x * b.x) + c.x;
destination->y = (a.y * b.y) + c.y;
destination->z = (a.z * b.z) + c.z;
destination->w = (a.w * b.w) + c.w;
} | 0 | [
"CWE-20",
"CWE-617"
] | ImageMagick | 0c5b1e430a83ef793a7334bbbee408cf3c628699 | 326,978,157,498,440,900,000,000,000,000,000,000,000 | 8 | Added check to prevent image being 0x0 (reported in #489). |
TfLiteRegistration* Register_PACK() {
static TfLiteRegistration r = {nullptr, nullptr, pack::Prepare, pack::Eval};
return &r;
} | 0 | [
"CWE-125",
"CWE-787"
] | tensorflow | 1970c2158b1ffa416d159d03c3370b9a462aee35 | 238,640,292,739,369,040,000,000,000,000,000,000,000 | 4 | [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... |
static int xfrm_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
{
struct net *net = sock_net(skb->sk);
struct nlattr *attrs[XFRMA_MAX+1];
const struct xfrm_link *link;
int type, err;
#ifdef CONFIG_COMPAT
if (in_compat_syscall())
return -EOPNOTSUPP;
#endif
type = nlh->nlmsg_type;
if (type > XFRM_MSG_M... | 0 | [
"CWE-284"
] | linux | 677e806da4d916052585301785d847c3b3e6186a | 114,353,121,153,118,600,000,000,000,000,000,000,000 | 49 | xfrm_user: validate XFRM_MSG_NEWAE XFRMA_REPLAY_ESN_VAL replay_window
When a new xfrm state is created during an XFRM_MSG_NEWSA call we
validate the user supplied replay_esn to ensure that the size is valid
and to ensure that the replay_window size is within the allocated
buffer. However later it is possible to updat... |
translatePresentationContextList(LST_HEAD ** internalList,
LST_HEAD ** SCUSCPRoleList,
LST_HEAD ** userContextList)
{
PRV_PRESENTATIONCONTEXTITEM
* context;
DUL_PRESENTATIONCONTEXT
* userContext;
DUL_SUBITEM
* subItem;... | 0 | [
"CWE-415",
"CWE-703",
"CWE-401"
] | dcmtk | a9697dfeb672b0b9412c00c7d36d801e27ec85cb | 91,781,342,697,542,300,000,000,000,000,000,000,000 | 64 | Fixed poss. NULL pointer dereference/double free.
Thanks to Jinsheng Ba <bajinsheng@u.nus.edu> for the report and some patches. |
check_authenticated_user_and_ip(int userid, struct query *q)
{
int res = check_user_and_ip(userid, q);
if (res)
return res;
if (!users[userid].authenticated)
return 1;
return 0;
} | 0 | [] | iodine | b715be5cf3978fbe589b03b09c9398d0d791f850 | 286,166,072,405,717,760,000,000,000,000,000,000,000 | 11 | Fix authentication bypass bug
The client could bypass the password check by continuing after getting error
from the server and guessing the network parameters. The server would still
accept the rest of the setup and also network traffic.
Add checks for normal and raw mode that user has authenticated before allowing
a... |
void CloneUser(const CString& sLine) {
if (!GetUser()->IsAdmin()) {
PutModule(
t_s("Error: You need to have admin rights to add new users!"));
return;
}
const CString sOldUsername = sLine.Token(1),
sNewUsername = sLine.Token(2, t... | 0 | [
"CWE-20"
] | znc | 64613bc8b6b4adf1e32231f9844d99cd512b8973 | 73,558,545,949,172,210,000,000,000,000,000,000,000 | 39 | Don't crash if user specified invalid encoding.
This is CVE-2019-9917 |
static int muscle_list_files(sc_card_t *card, u8 *buf, size_t bufLen)
{
muscle_private_t* priv = MUSCLE_DATA(card);
mscfs_t *fs = priv->fs;
int x;
int count = 0;
mscfs_check_cache(priv->fs);
for(x = 0; x < fs->cache.size; x++) {
u8* oid= fs->cache.array[x].objectId.id;
sc_debug(card->ctx, SC_LOG_DEBUG_NORMA... | 1 | [
"CWE-415",
"CWE-119"
] | OpenSC | 360e95d45ac4123255a4c796db96337f332160ad | 248,685,593,606,543,900,000,000,000,000,000,000,000 | 24 | fixed out of bounds writes
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting the problems. |
ReportFileSystemError(const FileSystemException &ex): e(ex) { } | 0 | [
"CWE-59"
] | passenger | 9dda49f4a3ebe9bafc48da1bd45799f30ce19566 | 282,188,101,724,430,530,000,000,000,000,000,000,000 | 1 | Fixed a problem with graceful web server restarts.
This problem was introduced in 4.0.6 during the attempt to fix issue #910. |
static int file_exists(char * filename)
{
MY_STAT stat_arg;
if (!my_stat(filename, &stat_arg, MYF(0)))
{
return 0;
}
return 1;
} | 0 | [
"CWE-200"
] | mysql-server | 0dbd5a8797ed4bd18e8b883988fb62177eb0f73f | 315,928,490,996,729,860,000,000,000,000,000,000 | 10 | Bug#21973610: BUFFER OVERFLOW ISSUES
Description : Incorrect usage of sprintf/strcpy caused
possible buffer overflow issues at various
places.
Solution : - Fixed mysql_plugin and mysqlshow
- Fixed regex library issues
Reviewed-By : Georgi Kodinov <georgi.kodinov@oracle.com>
Rev... |
static u32 destroy_obj_hashfn(const struct tcf_proto *tp)
{
return jhash_3words(tp->chain->index, tp->prio,
(__force __u32)tp->protocol, 0);
} | 0 | [
"CWE-416"
] | linux | 04c2a47ffb13c29778e2a14e414ad4cb5a5db4b5 | 302,103,191,903,594,520,000,000,000,000,000,000,000 | 5 | net: sched: fix use-after-free in tc_new_tfilter()
Whenever tc_new_tfilter() jumps back to replay: label,
we need to make sure @q and @chain local variables are cleared again,
or risk use-after-free as in [1]
For consistency, apply the same fix in tc_ctl_chain()
BUG: KASAN: use-after-free in mini_qdisc_pair_swap+0x1... |
init_graphics(PyObject *module) {
if (PyType_Ready(&GraphicsManager_Type) < 0) return false;
if (PyModule_AddObject(module, "GraphicsManager", (PyObject *)&GraphicsManager_Type) != 0) return false;
if (PyModule_AddFunctions(module, module_methods) != 0) return false;
Py_INCREF(&GraphicsManager_Type);
... | 0 | [
"CWE-787"
] | kitty | 82c137878c2b99100a3cdc1c0f0efea069313901 | 333,904,598,633,697,770,000,000,000,000,000,000,000 | 7 | Graphics protocol: Dont return filename in the error message when opening file fails, since filenames can contain control characters
Fixes #3128 |
void hid_dump_field(struct hid_field *field, int n, struct seq_file *f) {
int j;
if (field->physical) {
tab(n, f);
seq_printf(f, "Physical(");
hid_resolv_usage(field->physical, f); seq_printf(f, ")\n");
}
if (field->logical) {
tab(n, f);
seq_printf(f, "Logical(");
hid_resolv_usage(field->logical, f); s... | 0 | [
"CWE-835",
"CWE-787"
] | linux | 717adfdaf14704fd3ec7fa2c04520c0723247eac | 185,546,684,971,340,400,000,000,000,000,000,000,000 | 96 | HID: debug: check length before copy_to_user()
If our length is greater than the size of the buffer, we
overflow the buffer
Cc: stable@vger.kernel.org
Signed-off-by: Daniel Rosenberg <drosen@google.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz> |
CImg<T>& assign(const char *const filename) {
return load(filename);
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 268,206,291,007,880,230,000,000,000,000,000,000,000 | 3 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
struct ssh_iterator *ssh_list_find(const struct ssh_list *list, void *value){
struct ssh_iterator *it;
for(it = ssh_list_get_iterator(list); it != NULL ;it=it->next)
if(it->data==value)
return it;
return NULL;
} | 0 | [] | libssh | 2ba1dea5493fb2f5a5be2dd263ce46ccb5f8ec76 | 4,458,127,380,434,321,000,000,000,000,000,000,000 | 7 | CVE-2019-14889: misc: Add function to quote file names
The added function quote file names strings to be used in a shell.
Special cases are treated for the charactes '\'' and '!'.
Fixes T181
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry pic... |
struct sctp_chunk *sctp_make_sack(const struct sctp_association *asoc)
{
struct sctp_chunk *retval;
struct sctp_sackhdr sack;
int len;
__u32 ctsn;
__u16 num_gabs, num_dup_tsns;
struct sctp_association *aptr = (struct sctp_association *)asoc;
struct sctp_tsnmap *map = (struct sctp_tsnmap *)&asoc->peer.tsn_map;
s... | 1 | [] | linux | 196d67593439b03088913227093e374235596e33 | 255,769,719,096,566,640,000,000,000,000,000,000,000 | 97 | sctp: Add support to per-association statistics via a new SCTP_GET_ASSOC_STATS call
The current SCTP stack is lacking a mechanism to have per association
statistics. This is an implementation modeled after OpenSolaris'
SCTP_GET_ASSOC_STATS.
Userspace part will follow on lksctp if/when there is a general ACK on
this.
... |
jas_image_t *pnm_decode(jas_stream_t *in, char *opts)
{
pnm_hdr_t hdr;
jas_image_t *image;
jas_image_cmptparm_t cmptparms[3];
jas_image_cmptparm_t *cmptparm;
int i;
JAS_DBGLOG(10, ("pnm_decode(%p, \"%s\")\n", in, opts ? opts : ""));
if (opts) {
jas_eprintf("warning: ignoring options\n");
}
/* Read the fil... | 0 | [
"CWE-20",
"CWE-190"
] | jasper | d42b2388f7f8e0332c846675133acea151fc557a | 4,295,213,654,415,090,600,000,000,000,000,000,000 | 63 | The generation of the configuration file jas_config.h has been completely
reworked in order to avoid pollution of the global namespace.
Some problematic types like uchar, ulong, and friends have been replaced
with names with a jas_ prefix.
An option max_samples has been added to the BMP and JPEG decoders to
restrict ... |
xmlFARecurseDeterminism(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr state,
int to, xmlRegAtomPtr atom) {
int ret = 1;
int res;
int transnr, nbTrans;
xmlRegTransPtr t1;
int deep = 1;
if (state == NULL)
return(ret);
if (state->markd == XML_REGEXP_MARK_VISITED)
return(ret);
... | 0 | [
"CWE-119"
] | libxml2 | cbb271655cadeb8dbb258a64701d9a3a0c4835b4 | 260,959,003,105,606,760,000,000,000,000,000,000,000 | 49 | Bug 757711: heap-buffer-overflow in xmlFAParsePosCharGroup <https://bugzilla.gnome.org/show_bug.cgi?id=757711>
* xmlregexp.c:
(xmlFAParseCharRange): Only advance to the next character if
there is no error. Advancing to the next character in case of
an error while parsing regexp leads to an out of bounds access. |
static int stbi__zexpand(stbi__zbuf *z, char *zout, int n) // need to make room for n bytes
{
char *q;
unsigned int cur, limit, old_limit;
z->zout = zout;
if (!z->z_expandable) return stbi__err("output buffer limit","Corrupt PNG");
cur = (unsigned int) (z->zout - z->zout_start);
limit = old_limit =... | 0 | [
"CWE-787"
] | stb | 5ba0baaa269b3fd681828e0e3b3ac0f1472eaf40 | 106,092,862,313,349,620,000,000,000,000,000,000,000 | 21 | stb_image: Reject fractional JPEG component subsampling ratios
The component resamplers are not written to support this and I've
never seen it happen in a real (non-crafted) JPEG file so I'm
fine rejecting this as outright corrupt.
Fixes issue #1178. |
static int jpc_dec_tiledecode(jpc_dec_t *dec, jpc_dec_tile_t *tile)
{
int i;
int j;
jpc_dec_tcomp_t *tcomp;
jpc_dec_rlvl_t *rlvl;
jpc_dec_band_t *band;
int compno;
int rlvlno;
int bandno;
int adjust;
int v;
jpc_dec_ccp_t *ccp;
jpc_dec_cmpt_t *cmpt;
if (jpc_dec_decodecblks(dec, tile)) {
jas_eprintf("jpc_... | 0 | [
"CWE-190"
] | jasper | a712a2041085e7cd5f2b153e1532ac2a2954ffaa | 30,699,012,399,366,970,000,000,000,000,000,000,000 | 133 | Added some additional checking to prevent a potential integer overflow
due to conversion in the JPC decoder. |
Status Extend(const GraphDef& graph) override {
return errors::Unimplemented("Session::Extend()");
} | 0 | [
"CWE-20",
"CWE-703"
] | tensorflow | adf095206f25471e864a8e63a0f1caef53a0e3a6 | 212,724,653,809,642,770,000,000,000,000,000,000,000 | 3 | Validate `NodeDef`s from `FunctionDefLibrary` of a `GraphDef`.
We already validated `NodeDef`s from a `GraphDef` but missed validating those from the `FunctionDefLibrary`. Thus, some maliciously crafted models could evade detection and cause denial of service due to a `CHECK`-fail.
PiperOrigin-RevId: 332536309
Change... |
int Get32s(void * Long)
{
if (MotorolaOrder){
return ((( char *)Long)[0] << 24) | (((uchar *)Long)[1] << 16)
| (((uchar *)Long)[2] << 8 ) | (((uchar *)Long)[3] << 0 );
}else{
return ((( char *)Long)[3] << 24) | (((uchar *)Long)[2] << 16)
| (((uchar *)Long)[1] << 8 )... | 0 | [
"CWE-703"
] | jhead | a50953a266583981b51a181c2fce73dad2ac5d7d | 299,205,059,713,638,120,000,000,000,000,000,000,000 | 10 | Make pointer range checks more consistent.
Also twiddle the unused floating point print code (not used in real exif files),
but fuzz testing hits it. New code is equivalent but doesn't cause bus error (don't understand why, but this is all a very bogus thing anyway, just trying to avoid fuzz testing hits. |
void WBell(Window *p, int visual)
{
Canvas *cv;
if (displays == NULL)
p->w_bell = BELL_DONE;
for (display = displays; display; display = display->d_next) {
for (cv = D_cvlist; cv; cv = cv->c_next)
if (cv->c_layer->l_bottom == &p->w_layer)
break;
if (cv && !visual)
AddCStr(D_BL);
else if (cv && D_VB... | 0 | [
"CWE-119"
] | screen | c336a32a1dcd445e6b83827f83531d4c6414e2cd | 265,747,983,360,637,900,000,000,000,000,000,000,000 | 17 | Fix stack overflow due to too deep recursion
Bug: 45713
How to reproduce:
Run this command inside screen
$ printf '\x1b[10000000T'
screen will recursively call MScrollV to depth n/256. This is time consuming and will overflow stack if n is huge. |
void gdImageString16 (gdImagePtr im, gdFontPtr f, int x, int y, unsigned short *s, int color)
{
int i;
int l;
l = strlen16(s);
for (i = 0; (i < l); i++) {
gdImageChar(im, f, x, y, s[i], color);
x += f->w;
}
} | 0 | [
"CWE-119"
] | php-src | e7f2356665c2569191a946b6fc35b437f0ae1384 | 168,902,098,138,914,670,000,000,000,000,000,000,000 | 10 | Fix #66387: Stack overflow with imagefilltoborder
The stack overflow is caused by the recursive algorithm in combination with a
very large negative coordinate passed to gdImageFillToBorder(). As there is
already a clipping for large positive coordinates to the width and height of
the image, it seems to be consequent t... |
static int decode_lookupp(struct xdr_stream *xdr)
{
return decode_op_hdr(xdr, OP_LOOKUPP);
} | 0 | [
"CWE-787"
] | linux | b4487b93545214a9db8cbf32e86411677b0cca21 | 118,950,902,837,007,340,000,000,000,000,000,000,000 | 4 | nfs: Fix getxattr kernel panic and memory overflow
Move the buffer size check to decode_attr_security_label() before memcpy()
Only call memcpy() if the buffer is large enough
Fixes: aa9c2669626c ("NFS: Client implementation of Labeled-NFS")
Signed-off-by: Jeffrey Mitchell <jeffrey.mitchell@starlab.io>
[Trond: clean u... |
GF_Err video_sample_entry_box_read(GF_Box *s, GF_BitStream *bs)
{
GF_MPEGVisualSampleEntryBox *mp4v = (GF_MPEGVisualSampleEntryBox*)s;
GF_Err e;
e = gf_isom_video_sample_entry_read((GF_VisualSampleEntryBox *)s, bs);
if (e) return e;
e = gf_isom_box_array_read(s, bs, video_sample_entry_on_child_box);
if (e) return... | 0 | [
"CWE-787"
] | gpac | 388ecce75d05e11fc8496aa4857b91245007d26e | 275,334,734,574,286,700,000,000,000,000,000,000,000 | 35 | fixed #1587 |
static int exec_mmap(struct mm_struct *mm)
{
struct task_struct *tsk;
struct mm_struct *old_mm, *active_mm;
/* Notify parent that we're no longer interested in the old VM */
tsk = current;
old_mm = current->mm;
mm_release(tsk, old_mm);
if (old_mm) {
sync_mm_rss(old_mm);
/*
* Make sure that if there is a... | 0 | [
"CWE-362"
] | linux | 8b01fc86b9f425899f8a3a8fc1c47d73c2c20543 | 273,886,504,557,092,570,000,000,000,000,000,000,000 | 43 | fs: take i_mutex during prepare_binprm for set[ug]id executables
This prevents a race between chown() and execve(), where chowning a
setuid-user binary to root would momentarily make the binary setuid
root.
This patch was mostly written by Linus Torvalds.
Signed-off-by: Jann Horn <jann@thejh.net>
Signed-off-by: Linu... |
void Curl_getoff_all_pipelines(struct Curl_easy *data,
struct connectdata *conn)
{
bool recv_head = (conn->readchannel_inuse &&
Curl_recvpipe_head(data, conn));
bool send_head = (conn->writechannel_inuse &&
Curl_sendpipe_head(data, conn));
if... | 0 | [
"CWE-119"
] | curl | 9b5e12a5491d2e6b68e0c88ca56f3a9ef9fba400 | 266,083,799,855,282,750,000,000,000,000,000,000,000 | 13 | url: fix alignment of ssl_backend_data struct
- Align the array of ssl_backend_data on a max 32 byte boundary.
8 is likely to be ok but I went with 32 for posterity should one of
the ssl_backend_data structs change to contain a larger sized variable
in the future.
Prior to this change (since dev 70f1db3, release 7.5... |
executable_completion (filename, searching_path)
const char *filename;
int searching_path;
{
char *f;
int r;
f = savestring (filename);
bash_directory_completion_hook (&f);
r = searching_path ? executable_file (f) : executable_or_directory (f);
free (f);
return r;
} | 0 | [
"CWE-20"
] | bash | 4f747edc625815f449048579f6e65869914dd715 | 267,582,415,785,565,150,000,000,000,000,000,000,000 | 14 | Bash-4.4 patch 7 |
void FieldStore::append_last_trailer_value(const char *data, size_t len) {
shrpx::append_last_header_value(balloc_, trailer_key_prev_, buffer_size_,
trailers_, data, len);
} | 0 | [] | nghttp2 | 319d5ab1c6d916b6b8a0d85b2ae3f01b3ad04f2c | 9,307,421,300,237,558,000,000,000,000,000,000,000 | 4 | nghttpx: Fix request stall
Fix request stall if backend connection is reused and buffer is full. |
static xmlNsPtr xmlSearchNsPrefixByHref(xmlDocPtr doc, xmlNodePtr node, const xmlChar * href)
{
xmlNsPtr cur;
xmlNodePtr orig = node;
while (node) {
if (node->type == XML_ENTITY_REF_NODE ||
node->type == XML_ENTITY_NODE ||
node->type == XML_ENTITY_DECL) {
return NULL;
}
if (node->type == XML_EL... | 0 | [
"CWE-19"
] | php-src | c8eaca013a3922e8383def6158ece2b63f6ec483 | 240,465,956,002,001,840,000,000,000,000,000,000,000 | 36 | Added type checks |
QPDFTokenizer::presentEOF()
{
if (this->m->state == st_inline_image)
{
size_t len = this->m->val.length();
if ((len >= 3) &&
isDelimiter(this->m->val.at(len-3)) &&
(this->m->val.at(len-2) == 'E') &&
(this->m->val.at(len-1) == 'I'))
{
QTC::T... | 0 | [
"CWE-787"
] | qpdf | d71f05ca07eb5c7cfa4d6d23e5c1f2a800f52e8e | 212,830,181,821,306,900,000,000,000,000,000,000,000 | 42 | 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 ... |
p11_index_set (p11_index *index,
CK_OBJECT_HANDLE handle,
CK_ATTRIBUTE *attrs,
CK_ULONG count)
{
CK_ATTRIBUTE *update;
index_object *obj;
return_val_if_fail (index != NULL, CKR_GENERAL_ERROR);
obj = p11_dict_get (index->objects, &handle);
if (obj == NULL)
return CKR... | 0 | [
"CWE-190"
] | p11-kit | 5307a1d21a50cacd06f471a873a018d23ba4b963 | 117,221,995,882,415,060,000,000,000,000,000,000,000 | 19 | Check for arithmetic overflows before allocating |
void buildMD5(SSL& ssl, Finished& fin, const opaque* sender)
{
opaque md5_result[MD5_LEN];
opaque md5_inner[SIZEOF_SENDER + SECRET_LEN + PAD_MD5];
opaque md5_outer[SECRET_LEN + PAD_MD5 + MD5_LEN];
const opaque* master_secret =
ssl.getSecurity().get_connection().master_secret_;
// make md... | 0 | [] | mysql-server | b9768521bdeb1a8069c7b871f4536792b65fd79b | 36,041,925,781,336,710,000,000,000,000,000,000,000 | 26 | Updated yassl to yassl-2.3.8
(cherry picked from commit 7f9941eab55ed672bfcccd382dafbdbcfdc75aaa) |
static void textview_add_parts(TextView *textview, MimeInfo *mimeinfo)
{
cm_return_if_fail(mimeinfo != NULL);
cm_return_if_fail(mimeinfo->node != NULL);
recursive_add_parts(textview, mimeinfo->node);
} | 0 | [
"CWE-601"
] | claws | ac286a71ed78429e16c612161251b9ea90ccd431 | 234,622,170,528,681,700,000,000,000,000,000,000,000 | 7 | harden link checker before accepting click |
static ut32 getthimmed12(const char *str) {
ut64 num = getnum (str);
if (err) {
return 0;
}
st32 FSD = 0;
ut64 result = 0;
if (num <= 0xff) {
return num << 8;
} else if ( ((num & 0xff00ff00) == 0) && ((num & 0x00ff0000) == ((num & 0x000000ff) << 16)) ) {
result |= (num & 0x000000ff) << 8;
result |= 0x0... | 0 | [
"CWE-125",
"CWE-787"
] | radare2 | e5c14c167b0dcf0a53d76bd50bacbbcc0dfc1ae7 | 260,570,546,226,057,300,000,000,000,000,000,000,000 | 36 | Fix #12417/#12418 (arm assembler heap overflows) |
router_add_running_routers_to_smartlist(smartlist_t *sl, int allow_invalid,
int need_uptime, int need_capacity,
int need_guard)
{
if (!routerlist)
return;
SMARTLIST_FOREACH(routerlist->routers, routerinfo_t *, router,
{
if (r... | 0 | [
"CWE-399"
] | tor | 308f6dad20675c42b29862f4269ad1fbfb00dc9a | 266,320,309,651,586,670,000,000,000,000,000,000,000 | 20 | Mitigate a side-channel leak of which relays Tor chooses for a circuit
Tor's and OpenSSL's current design guarantee that there are other leaks,
but this one is likely to be more easily exploitable, and is easy to fix. |
void streamLastValidID(stream *s, streamID *maxid)
{
streamIterator si;
streamIteratorStart(&si,s,NULL,NULL,1);
int64_t numfields;
streamIteratorGetID(&si,maxid,&numfields);
streamIteratorStop(&si);
} | 0 | [
"CWE-190"
] | redis | f6a40570fa63d5afdd596c78083d754081d80ae3 | 24,503,678,272,470,587,000,000,000,000,000,000,000 | 8 | Fix ziplist and listpack overflows and truncations (CVE-2021-32627, CVE-2021-32628)
- fix possible heap corruption in ziplist and listpack resulting by trying to
allocate more than the maximum size of 4GB.
- prevent ziplist (hash and zset) from reaching size of above 1GB, will be
converted to HT encoding, that's n... |
int v9fs_vfs_rmdir(struct inode *i, struct dentry *d)
{
return v9fs_remove(i, d, AT_REMOVEDIR);
} | 0 | [
"CWE-835"
] | linux | 5e3cc1ee1405a7eb3487ed24f786dec01b4cbe1f | 257,988,443,200,147,960,000,000,000,000,000,000,000 | 4 | 9p: use inode->i_lock to protect i_size_write() under 32-bit
Use inode->i_lock to protect i_size_write(), else i_size_read() in
generic_fillattr() may loop infinitely in read_seqcount_begin() when
multiple processes invoke v9fs_vfs_getattr() or v9fs_vfs_getattr_dotl()
simultaneously under 32-bit SMP environment, and a... |
static int ext4_quota_on(struct super_block *sb, int type, int format_id,
const struct path *path)
{
int err;
if (!test_opt(sb, QUOTA))
return -EINVAL;
/* Quotafile not on the same filesystem? */
if (path->dentry->d_sb != sb)
return -EXDEV;
/* Journaling quota? */
if (EXT4_SB(sb)->s_qf_names[type]) {
... | 0 | [] | linux | a45403b51582a87872927a3e0fc0a389c26867f1 | 155,340,356,339,627,400,000,000,000,000,000,000,000 | 72 | ext4: always initialize the crc32c checksum driver
The extended attribute code now uses the crc32c checksum for hashing
purposes, so we should just always always initialize it. We also want
to prevent NULL pointer dereferences if one of the metadata checksum
features is enabled after the file sytsem is originally mou... |
static BROTLI_INLINE void PrepareLiteralDecoding(BrotliDecoderState* s) {
uint8_t context_mode;
size_t trivial;
uint32_t block_type = s->block_type_rb[1];
uint32_t context_offset = block_type << BROTLI_LITERAL_CONTEXT_BITS;
s->context_map_slice = s->context_map + context_offset;
trivial = s->trivial_literal... | 0 | [
"CWE-120"
] | brotli | 223d80cfbec8fd346e32906c732c8ede21f0cea6 | 205,898,451,141,431,700,000,000,000,000,000,000,000 | 12 | 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 |
static void sctp_shutdown(struct sock *sk, int how)
{
struct net *net = sock_net(sk);
struct sctp_endpoint *ep;
if (!sctp_style(sk, TCP))
return;
ep = sctp_sk(sk)->ep;
if (how & SEND_SHUTDOWN && !list_empty(&ep->asocs)) {
struct sctp_association *asoc;
sk->sk_state = SCTP_SS_CLOSING;
asoc = list_entry(e... | 0 | [
"CWE-617",
"CWE-362"
] | linux | 2dcab598484185dea7ec22219c76dcdd59e3cb90 | 169,157,078,263,718,650,000,000,000,000,000,000,000 | 18 | sctp: avoid BUG_ON on sctp_wait_for_sndbuf
Alexander Popov reported that an application may trigger a BUG_ON in
sctp_wait_for_sndbuf if the socket tx buffer is full, a thread is
waiting on it to queue more data and meanwhile another thread peels off
the association being used by the first thread.
This patch replaces ... |
static uint64_t ns_to_ticks(uint64_t value)
{
return (muldiv64(value, FS_PER_NS, HPET_CLK_PERIOD));
} | 0 | [
"CWE-119"
] | qemu | 3f1c49e2136fa08ab1ef3183fd55def308829584 | 275,264,788,715,702,080,000,000,000,000,000,000,000 | 4 | hpet: fix buffer overrun on invalid state load
CVE-2013-4527 hw/timer/hpet.c buffer overrun
hpet is a VARRAY with a uint8 size but static array of 32
To fix, make sure num_timers is valid using VMSTATE_VALID hook.
Reported-by: Anthony Liguori <anthony@codemonkey.ws>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com... |
create_dir_include(agooErr err) {
gqlDir dir = gql_directive_create(err, "include", NULL, 0);
gqlType boolean_nn;
if (NULL == dir) {
return err->code;
}
dir->core = true;
if (NULL == (boolean_nn = gql_assure_nonnull(err, &gql_bool_type)) ||
AGOO_ERR_OK != gql_directive_on(err, dir, "FIELD", ... | 0 | [
"CWE-703"
] | agoo | ecb72fa66f3d846b724b4fa1d7648669cebabe0c | 247,001,176,618,112,000,000,000,000,000,000,000,000 | 19 | Protect against recursive fragment in schema
Really a error on the developers part but this catches the error. |
static gboolean motion_notify_event(GtkWidget *text_view, GdkEventMotion *event)
{
gint x, y;
gtk_text_view_window_to_buffer_coords(GTK_TEXT_VIEW(text_view),
GTK_TEXT_WINDOW_WIDGET,
event->x, event->y, &x, &y);
set_cursor_... | 0 | [
"CWE-200"
] | libreport | 257578a23d1537a2d235aaa2b1488ee4f818e360 | 285,326,148,131,585,170,000,000,000,000,000,000,000 | 11 | wizard: fix save users changes after reviewing dump dir files
If the user reviewed the dump dir's files during reporting the crash, the
changes was thrown away and original data was passed to the bugzilla bug
report.
report-gtk saves the first text view buffer and then reloads data from the
reported problem directory... |
static int ext4_init_new_dir(handle_t *handle, struct inode *dir,
struct inode *inode)
{
struct buffer_head *dir_block = NULL;
struct ext4_dir_entry_2 *de;
ext4_lblk_t block = 0;
unsigned int blocksize = dir->i_sb->s_blocksize;
int csum_size = 0;
int err;
if (ext4_has_metadata_csum(dir->i_sb))
csum_si... | 0 | [
"CWE-125"
] | linux | 5872331b3d91820e14716632ebb56b1399b34fe1 | 164,530,460,828,886,470,000,000,000,000,000,000,000 | 40 | ext4: fix potential negative array index in do_split()
If for any reason a directory passed to do_split() does not have enough
active entries to exceed half the size of the block, we can end up
iterating over all "count" entries without finding a split point.
In this case, count == move, and split will be zero, and w... |
static void vnc_listen_regular_read(void *opaque)
{
vnc_listen_read(opaque, false);
} | 0 | [
"CWE-125"
] | qemu | bea60dd7679364493a0d7f5b54316c767cf894ef | 330,781,102,991,777,770,000,000,000,000,000,000,000 | 4 | ui/vnc: fix potential memory corruption issues
this patch makes the VNC server work correctly if the
server surface and the guest surface have different sizes.
Basically the server surface is adjusted to not exceed VNC_MAX_WIDTH
x VNC_MAX_HEIGHT and additionally the width is rounded up to multiple of
VNC_DIRTY_PIXELS... |
fast_edit_packet(struct pcap_pkthdr *pkthdr, u_char **pktdata,
COUNTER iteration, bool cached, int datalink)
{
uint32_t pkt_len = pkthdr->caplen;
u_char *packet = *pktdata;
ipv4_hdr_t *ip_hdr = NULL;
ipv6_hdr_t *ip6_hdr = NULL;
uint32_t src_ip, dst_ip;
uint32_t src_ip_orig, dst_ip_orig;
... | 1 | [
"CWE-476"
] | tcpreplay | 46cf964a7db636da76abeebf10482acf6f682a87 | 284,256,605,212,790,700,000,000,000,000,000,000,000 | 117 | Bug #677 - fixes for tcpprep tree |
static void fix_frag_index_entries(MOVFragmentIndex *frag_index, int index,
int id, int entries)
{
int i;
MOVFragmentStreamInfo * frag_stream_info;
if (index < 0)
return;
for (i = index; i < frag_index->nb_items; i++) {
frag_stream_info = get_frag_stre... | 0 | [
"CWE-703"
] | FFmpeg | c953baa084607dd1d84c3bfcce3cf6a87c3e6e05 | 11,735,664,143,544,170,000,000,000,000,000,000,000 | 14 | avformat/mov: Check count sums in build_open_gop_key_points()
Fixes: ffmpeg.md
Fixes: Out of array access
Fixes: CVE-2022-2566
Found-by: Andy Nguyen <theflow@google.com>
Found-by: 3pvd <3pvd@google.com>
Reviewed-by: Andy Nguyen <theflow@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> |
free_keys(void)
{
unsigned int i;
Key *key;
for (i = 0; i < ARR_GetSize(keys); i++) {
key = ARR_GetElement(keys, i);
switch (key->class) {
case NTP_MAC:
Free(key->data.ntp_mac.value);
break;
case CMAC:
CMC_DestroyInstance(key->data.cmac);
break;
default:
... | 0 | [
"CWE-59"
] | chrony | e18903a6b56341481a2e08469c0602010bf7bfe3 | 14,777,730,864,350,803,000,000,000,000,000,000,000 | 22 | switch to new util file functions
Replace all fopen(), rename(), and unlink() calls with the new util
functions. |
gsf_infile_tar_dup (GsfInput *src_input, GError **err)
{
GsfInfileTar *res, *src;
unsigned ui;
src = GSF_INFILE_TAR (src_input);
if (src->err) {
if (err)
*err = g_error_copy (src->err);
return NULL;
}
res = (GsfInfileTar *)g_object_new (GSF_INFILE_TAR_TYPE, NULL);
gsf_infile_tar_set_source (res, src->so... | 0 | [
"CWE-476"
] | libgsf | 95a8351a75758cf10b3bf6abae0b6b461f90d9e5 | 133,732,105,628,732,640,000,000,000,000,000,000,000 | 26 | tar: fix crash on broken tar file. |
void finalizeTable() {
CustomInlineHeaderRegistry::finalize<Interface::header_map_type>();
auto& headers = CustomInlineHeaderRegistry::headers<Interface::header_map_type>();
size_ = headers.size();
for (const auto& header : headers) {
this->add(header.first.get().c_str(), [&header](H... | 0 | [] | envoy | 2c60632d41555ec8b3d9ef5246242be637a2db0f | 24,133,921,223,669,293,000,000,000,000,000,000,000 | 10 | http: header map security fixes for duplicate headers (#197)
Previously header matching did not match on all headers for
non-inline headers. This patch changes the default behavior to
always logically match on all headers. Multiple individual
headers will be logically concatenated with ',' similar to what
is done with... |
static void pdfobj_flag(struct pdf_struct *pdf, struct pdf_obj *obj, enum pdf_flag flag)
{
const char *s;
pdf->flags |= 1 << flag;
if (!cli_debug_flag)
return;
switch (flag) {
case UNTERMINATED_OBJ_DICT:
s = "dictionary not terminated";
break;
case ESCAPED_COMMON_PDFNAME:
/* like /Java... | 0 | [] | clamav-devel | f0eb394501ec21b9fe67f36cbf5db788711d4236 | 121,995,069,631,291,630,000,000,000,000,000,000,000 | 26 | bb #2016. |
gdm_session_worker_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
GdmSessionWorker *self;
self = GDM_SESSION_WORKER (object);
switch (prop_id)... | 0 | [] | gdm | c25ef9245be4e0be2126ef3d075df4401949b570 | 63,729,772,235,310,630,000,000,000,000,000,000,000 | 18 | Store the face and dmrc files in a cache. Refer to bug #565151. |
static inline void CopyFitsRecord(char *buffer,const char *data,
const ssize_t offset)
{
size_t
length;
if (data == (char *) NULL)
return;
length=MagickMin(strlen(data),80);
if (length > (size_t) (FITSBlocksize-offset))
length=FITSBlocksize-offset;
(void) strncpy(buffer+offset,data,length);
} | 0 | [
"CWE-401"
] | ImageMagick6 | 210474b2fac6a661bfa7ed563213920e93e76395 | 23,243,013,062,022,257,000,000,000,000,000,000,000 | 13 | Fix ultra rare but potential memory-leak |
ContentSettingsObserver::~ContentSettingsObserver() {
} | 0 | [
"CWE-20",
"CWE-200"
] | muon | c18663aa171c6cdf03da3e8c70df8663645b97c4 | 63,685,604,791,059,170,000,000,000,000,000,000,000 | 2 | Issue: 15232 AllowScript should use atom::ContentSettingsManager like other Allow* methods in the observer |
evutil_fast_socket_nonblocking(evutil_socket_t fd)
{
#ifdef _WIN32
return evutil_make_socket_nonblocking(fd);
#else
if (fcntl(fd, F_SETFL, O_NONBLOCK) == -1) {
event_warn("fcntl(%d, F_SETFL)", fd);
return -1;
}
return 0;
#endif
} | 0 | [
"CWE-119",
"CWE-787"
] | libevent | 329acc18a0768c21ba22522f01a5c7f46cacc4d5 | 304,581,078,416,699,580,000,000,000,000,000,000,000 | 12 | evutil_parse_sockaddr_port(): fix buffer overflow
@asn-the-goblin-slayer:
"Length between '[' and ']' is cast to signed 32 bit integer on line 1815. Is
the length is more than 2<<31 (INT_MAX), len will hold a negative value.
Consequently, it will pass the check at line 1816. Segfault happens at line
1819.
... |
TEST_F(QueryPlannerTest, NegationCannotUseSparseIndex) {
// Sparse indexes can't support negation queries because they are sparse, and {a: {$ne: 5}}
// will match documents which don't have an "a" field.
addIndex(fromjson("{a: 1}"),
false, // multikey
true // sparse
);
... | 0 | [
"CWE-754"
] | mongo | f8f55e1825ee5c7bdb3208fc7c5b54321d172732 | 174,993,603,755,573,280,000,000,000,000,000,000,000 | 13 | SERVER-44377 generate correct plan for indexed inequalities to null |
int ext4_convert_unwritten_extents(struct inode *inode, loff_t offset,
ssize_t len)
{
handle_t *handle;
unsigned int max_blocks;
int ret = 0;
int ret2 = 0;
struct ext4_map_blocks map;
unsigned int credits, blkbits = inode->i_blkbits;
map.m_lblk = offset >> blkbits;
/*
* We can't just convert len to m... | 0 | [
"CWE-362"
] | linux-2.6 | dee1f973ca341c266229faa5a1a5bb268bed3531 | 21,723,509,387,066,707,000,000,000,000,000,000,000 | 46 | ext4: race-condition protection for ext4_convert_unwritten_extents_endio
We assumed that at the time we call ext4_convert_unwritten_extents_endio()
extent in question is fully inside [map.m_lblk, map->m_len] because
it was already split during submission. But this may not be true due to
a race between writeback vs fa... |
static void perf_event_exit_cpu(int cpu)
{
struct swevent_htable *swhash = &per_cpu(swevent_htable, cpu);
perf_event_exit_cpu_context(cpu);
mutex_lock(&swhash->hlist_mutex);
swhash->online = false;
swevent_hlist_release(swhash);
mutex_unlock(&swhash->hlist_mutex);
} | 1 | [
"CWE-416",
"CWE-362"
] | linux | 12ca6ad2e3a896256f086497a7c7406a547ee373 | 161,845,434,958,286,950,000,000,000,000,000,000,000 | 11 | perf: Fix race in swevent hash
There's a race on CPU unplug where we free the swevent hash array
while it can still have events on. This will result in a
use-after-free which is BAD.
Simply do not free the hash array on unplug. This leaves the thing
around and no use-after-free takes place.
When the last swevent die... |
TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryEnableAccessEncrypt_validation_ok_enable_discovery_enable_access_encrypt)
// *INDENT-ON*
{
PubSubReader<HelloWorldType> reader(TEST_TOPIC_NAME);
PubSubWriter<HelloWorldType> writer(TEST_TOPIC_NAME);
std::string governan... | 0 | [
"CWE-284"
] | Fast-DDS | d2aeab37eb4fad4376b68ea4dfbbf285a2926384 | 100,187,482,056,480,450,000,000,000,000,000,000,000 | 9 | check remote permissions (#1387)
* Refs 5346. Blackbox test
Signed-off-by: Iker Luengo <ikerluengo@eprosima.com>
* Refs 5346. one-way string compare
Signed-off-by: Iker Luengo <ikerluengo@eprosima.com>
* Refs 5346. Do not add partition separator on last partition
Signed-off-by: Iker Luengo <ikerluengo@e... |
GF_EXPORT
Bool gf_isom_get_last_producer_time_box(GF_ISOFile *file, GF_ISOTrackID *refTrackID, u64 *ntp, u64 *timestamp, Bool reset_info)
{
if (!file) return GF_FALSE;
if (refTrackID) *refTrackID = 0;
if (ntp) *ntp = 0;
if (timestamp) *timestamp = 0;
if (file->last_producer_ref_time) {
if (refTrackID) *refTrack... | 0 | [
"CWE-476"
] | gpac | ebfa346eff05049718f7b80041093b4c5581c24e | 276,491,464,543,367,600,000,000,000,000,000,000,000 | 19 | fixed #1706 |
static int ntop_interface_name2id(lua_State* vm) {
char *if_name;
ntop->getTrace()->traceEvent(TRACE_DEBUG, "%s() called", __FUNCTION__);
if(lua_type(vm, 1) == LUA_TNIL)
if_name = NULL;
else {
if(ntop_lua_check(vm, __FUNCTION__, 1, LUA_TSTRING)) return(CONST_LUA_ERROR);
if_name = (char*)lua_tostri... | 0 | [
"CWE-284",
"CWE-352"
] | ntopng | f91fbe3d94c8346884271838ae3406ae633f6f15 | 23,009,451,977,071,447,000,000,000,000,000,000,000 | 16 | Check for presence of crsf in admin scripts |
static int vmci_transport_notify_recv_pre_block(
struct vsock_sock *vsk,
size_t target,
struct vsock_transport_recv_notify_data *data)
{
return vmci_trans(vsk)->notify_ops->recv_pre_block(
&vsk->sk, target,
(struct vmci_transport_recv_notify_data *)data);
} | 0 | [
"CWE-20",
"CWE-269"
] | linux | f3d3342602f8bcbf37d7c46641cb9bca7618eb1c | 148,629,589,167,465,420,000,000,000,000,000,000,000 | 9 | net: rework recvmsg handler msg_name and msg_namelen logic
This patch now always passes msg->msg_namelen as 0. recvmsg handlers must
set msg_namelen to the proper size <= sizeof(struct sockaddr_storage)
to return msg_name to the user.
This prevents numerous uninitialized memory leaks we had in the
recvmsg handlers an... |
pget_line (size_t indent, int rfc934_nesting, bool strip_trailing_cr,
bool pass_comments_through)
{
FILE *fp = pfp;
int c;
size_t i;
char *b;
size_t s;
do
{
i = 0;
for (;;)
{
c = getc (fp);
if (c == EOF)
{
if (ferror (fp))
read_fatal ();
return 0;
}
i... | 0 | [
"CWE-59"
] | patch | 44a987e02f04b9d81a0db4a611145cad1093a2d3 | 78,085,164,275,125,030,000,000,000,000,000,000,000 | 90 | Add line number overflow checking
* bootstrap.conf: use intprops module.
* src/common.h: Define LINENUM_MIN and LINENUM_MAX macros.
* src/pch.c (another_hunk): Add line number overflow checking. Based on Robert
C. Seacord's INT32-C document for integer overflow checking and Tobias
Stoeckmann's "integer overflows and ... |
bool __fastcall TOwnConsole::NoInteractiveInput()
{
return false;
}
| 0 | [
"CWE-787"
] | winscp | faa96e8144e6925a380f94a97aa382c9427f688d | 49,085,092,861,757,710,000,000,000,000,000,000,000 | 4 | 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 |
Return current UNIX timestamp */
PHP_FUNCTION(time)
{
RETURN_LONG((long)time(NULL)); | 0 | [] | php-src | c377f1a715476934133f3254d1e0d4bf3743e2d2 | 299,349,299,893,391,900,000,000,000,000,000,000,000 | 4 | Fix bug #68942 (Use after free vulnerability in unserialize() with DateTimeZone) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.