func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
int DynamicMetadataMapWrapper::luaGet(lua_State* state) {
const char* filter_name = luaL_checkstring(state, 2);
const auto& metadata = streamInfo().dynamicMetadata().filter_metadata();
const auto filter_it = metadata.find(filter_name);
if (filter_it == metadata.end()) {
return 0;
}
Filters::Common::Lua... | 0 | [] | envoy | 2c60632d41555ec8b3d9ef5246242be637a2db0f | 103,663,324,996,254,320,000,000,000,000,000,000,000 | 11 | 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... |
TEST_P(ProxyProtocolTest, V1TooLong) {
constexpr uint8_t buffer[] = {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '};
connect(false);
write("PROXY TCP4 1.2.3.4 2.3.4.5 100 100");
for (size_t i = 0; i < 256; i += sizeof(buffer)) {
write(buffer, sizeof(buffer));
}
expectProxyProtoError();
} | 0 | [
"CWE-400"
] | envoy | dfddb529e914d794ac552e906b13d71233609bf7 | 102,937,517,857,086,200,000,000,000,000,000,000,000 | 9 | listener: Add configurable accepted connection limits (#153)
Add support for per-listener limits on accepted connections.
Signed-off-by: Tony Allen <tony@allen.gg> |
ZEND_VM_HANDLER(153, ZEND_UNSET_CV, CV, UNUSED)
{
USE_OPLINE
zval *var = EX_VAR(opline->op1.var);
if (Z_REFCOUNTED_P(var)) {
zend_refcounted *garbage = Z_COUNTED_P(var);
ZVAL_UNDEF(var);
SAVE_OPLINE();
if (!GC_DELREF(garbage)) {
rc_dtor_func(garbage);
} else {
gc_check_possible_root(garbage);
}
... | 0 | [
"CWE-787"
] | php-src | f1ce8d5f5839cb2069ea37ff424fb96b8cd6932d | 234,563,647,213,233,250,000,000,000,000,000,000,000 | 21 | 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. |
bool AuthorizationSessionImpl::isAuthorizedToChangeAsUser(const UserName& userName,
ActionType actionType) {
User* user = lookupUser(userName);
if (!user) {
return false;
}
ResourcePattern resourceSearchList[resourceSearchListCapacity];
... | 0 | [
"CWE-613"
] | mongo | e55d6e2292e5dbe2f97153251d8193d1cc89f5d7 | 82,974,613,886,714,090,000,000,000,000,000,000,000 | 16 | SERVER-38984 Validate unique User ID on UserCache hit |
static int put_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user *up)
{
struct v4l2_plane32 __user *uplane32;
struct v4l2_plane __user *uplane;
compat_caddr_t p;
int num_planes;
int ret;
if (!access_ok(VERIFY_WRITE, up, sizeof(*up)) ||
put_user(kp->index, &up->index) ||
put_user(kp->typ... | 1 | [
"CWE-787"
] | linux | a1dfb4c48cc1e64eeb7800a27c66a6f7e88d075a | 142,818,376,030,884,630,000,000,000,000,000,000,000 | 63 | media: v4l2-compat-ioctl32.c: refactor compat ioctl32 logic
The 32-bit compat v4l2 ioctl handling is implemented based on its 64-bit
equivalent. It converts 32-bit data structures into its 64-bit
equivalents and needs to provide the data to the 64-bit ioctl in user
space memory which is commonly allocated using
compat... |
double XMLRPC_GetValueDouble(XMLRPC_VALUE value) {
return ((value && value->type == xmlrpc_double) ? value->d : 0);
} | 0 | [
"CWE-119"
] | php-src | 88412772d295ebf7dd34409534507dc9bcac726e | 275,089,696,100,565,950,000,000,000,000,000,000,000 | 3 | Fix bug #68027 - fix date parsing in XMLRPC lib |
inline void invert_endianness(char* const, const cimg_ulong) {} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 7,338,540,998,985,290,000,000,000,000,000,000,000 | 1 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
static bool nested_vmx_exit_handled_io(struct kvm_vcpu *vcpu,
struct vmcs12 *vmcs12)
{
unsigned long exit_qualification;
gpa_t bitmap, last_bitmap;
unsigned int port;
int size;
u8 b;
if (nested_cpu_has(vmcs12, CPU_BASED_UNCOND_IO_EXITING))
return 1;
if (!nested_cpu_has(vmcs12, CPU_BASED_USE_IO_BIT... | 0 | [
"CWE-20"
] | linux | bfd0a56b90005f8c8a004baf407ad90045c2b11e | 329,583,790,775,951,700,000,000,000,000,000,000,000 | 45 | nEPT: Nested INVEPT
If we let L1 use EPT, we should probably also support the INVEPT instruction.
In our current nested EPT implementation, when L1 changes its EPT table
for L2 (i.e., EPT12), L0 modifies the shadow EPT table (EPT02), and in
the course of this modification already calls INVEPT. But if last level
of sh... |
buf32_to_uint (const void *buffer)
{
const unsigned char *p = buffer;
return (((unsigned int)p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]);
} | 0 | [
"CWE-20"
] | gnupg | 2183683bd633818dd031b090b5530951de76f392 | 72,613,169,319,725,590,000,000,000,000,000,000,000 | 6 | 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 ... |
void readErr(const AsyncSocketException& ex) noexcept override {
LOG(ERROR) << ex.what();
} | 0 | [
"CWE-125"
] | folly | c321eb588909646c15aefde035fd3133ba32cdee | 256,599,696,308,773,980,000,000,000,000,000,000,000 | 3 | Handle close_notify as standard writeErr in AsyncSSLSocket.
Summary: Fixes CVE-2019-11934
Reviewed By: mingtaoy
Differential Revision: D18020613
fbshipit-source-id: db82bb250e53f0d225f1280bd67bc74abd417836 |
flatpak_run_add_a11y_dbus_args (FlatpakBwrap *app_bwrap,
FlatpakBwrap *proxy_arg_bwrap,
FlatpakContext *context,
FlatpakRunFlags flags)
{
g_autoptr(GDBusConnection) session_bus = NULL;
g_autofree char *a11y_address =... | 0 | [
"CWE-668"
] | flatpak | cd2142888fc4c199723a0dfca1f15ea8788a5483 | 224,389,846,626,952,240,000,000,000,000,000,000,000 | 74 | Don't expose /proc when running apply_extra
As shown by CVE-2019-5736, it is sometimes possible for the sandbox
app to access outside files using /proc/self/exe. This is not
typically an issue for flatpak as the sandbox runs as the user which
has no permissions to e.g. modify the host files.
However, when installing ... |
Perl_warn_nocontext(const char *pat, ...)
{
dTHX;
va_list args;
PERL_ARGS_ASSERT_WARN_NOCONTEXT;
va_start(args, pat);
vwarn(pat, &args);
va_end(args);
} | 0 | [
"CWE-119",
"CWE-703",
"CWE-787"
] | perl5 | 34716e2a6ee2af96078d62b065b7785c001194be | 332,208,413,932,167,550,000,000,000,000,000,000,000 | 9 | Perl_my_setenv(); handle integer wrap
RT #133204
Wean this function off int/I32 and onto UV/Size_t.
Also, replace all malloc-ish calls with a wrapper that does
overflow checks,
In particular, it was doing (nlen + vlen + 2) which could wrap when
the combined length of the environment variable name and value
exceeded ... |
static void _delayed_cleanup(void *rock)
{
const char *mboxname = (const char *)rock;
struct mailbox *mailbox = NULL;
/* don't do the potentially expensive work of repacking mailboxes
* if we are in the middle of a shutdown */
if (in_shutdown) goto done;
int r = mailbox_open_exclusive(mboxnam... | 0 | [] | cyrus-imapd | 1d6d15ee74e11a9bd745e80be69869e5fb8d64d6 | 110,958,649,072,041,100,000,000,000,000,000,000,000 | 25 | mailbox.c/reconstruct.c: Add mailbox_mbentry_from_path() |
compile_lock_unlock(
lval_T *lvp,
char_u *name_end,
exarg_T *eap,
int deep,
void *coookie)
{
cctx_T *cctx = coookie;
int cc = *name_end;
char_u *p = lvp->ll_name;
int ret = OK;
size_t len;
char_u *buf;
isntype_T isn = ISN_EXEC;
if (cctx->ctx_skip == SKIP_Y... | 1 | [
"CWE-703",
"CWE-122"
] | vim | d1d8f6bacb489036d0fd479c9dd3c0102c988889 | 135,643,367,648,085,300,000,000,000,000,000,000,000 | 62 | patch 9.0.0211: invalid memory access when compiling :lockvar
Problem: Invalid memory access when compiling :lockvar.
Solution: Don't read past the end of the line. |
v3d_flush_l2t(struct v3d_dev *v3d, int core)
{
/* While there is a busy bit (V3D_L2TCACTL_L2TFLS), we don't
* need to wait for completion before dispatching the job --
* L2T accesses will be stalled until the flush has completed.
* However, we do need to make sure we don't try to trigger a
* new flush while th... | 0 | [
"CWE-400",
"CWE-401"
] | linux | 29cd13cfd7624726d9e6becbae9aa419ef35af7f | 200,358,680,831,574,180,000,000,000,000,000,000,000 | 15 | drm/v3d: Fix memory leak in v3d_submit_cl_ioctl
In the impelementation of v3d_submit_cl_ioctl() there are two memory
leaks. One is when allocation for bin fails, and the other is when bin
initialization fails. If kcalloc fails to allocate memory for bin then
render->base should be put. Also, if v3d_job_init() fails to... |
static void free_resources()
{
if (md_result_file && md_result_file != stdout)
my_fclose(md_result_file, MYF(0));
my_free(opt_password);
if (my_hash_inited(&ignore_table))
my_hash_free(&ignore_table);
if (extended_insert)
dynstr_free(&extended_row);
if (insert_pat_inited)
dynstr_free(&insert_p... | 0 | [
"CWE-295"
] | mysql-server | b3e9211e48a3fb586e88b0270a175d2348935424 | 12,718,440,942,600,085,000,000,000,000,000,000,000 | 15 | WL#9072: Backport WL#8785 to 5.5 |
xmlAddRef(xmlValidCtxtPtr ctxt, xmlDocPtr doc, const xmlChar *value,
xmlAttrPtr attr) {
xmlRefPtr ret;
xmlRefTablePtr table;
xmlListPtr ref_list;
if (doc == NULL) {
return(NULL);
}
if (value == NULL) {
return(NULL);
}
if (attr == NULL) {
return(NULL);
}
... | 1 | [
"CWE-416"
] | libxml2 | 652dd12a858989b14eed4e84e453059cd3ba340e | 52,142,536,819,327,650,000,000,000,000,000,000,000 | 90 | [CVE-2022-23308] Use-after-free of ID and IDREF attributes
If a document is parsed with XML_PARSE_DTDVALID and without
XML_PARSE_NOENT, the value of ID attributes has to be normalized after
potentially expanding entities in xmlRemoveID. Otherwise, later calls
to xmlGetID can return a pointer to previously freed memory... |
void __perf_event_task_sched_out(struct task_struct *task,
struct task_struct *next)
{
int ctxn;
if (atomic_read(&nr_switch_events))
perf_event_switch(task, next, false);
for_each_task_context_nr(ctxn)
perf_event_context_sched_out(task, ctxn, next);
/*
* if cgroup events exist on this CPU, then we nee... | 0 | [
"CWE-401"
] | tip | 7bdb157cdebbf95a1cd94ed2e01b338714075d00 | 10,060,170,711,090,891,000,000,000,000,000,000,000 | 19 | perf/core: Fix a memory leak in perf_event_parse_addr_filter()
As shown through runtime testing, the "filename" allocation is not
always freed in perf_event_parse_addr_filter().
There are three possible ways that this could happen:
- It could be allocated twice on subsequent iterations through the loop,
- or leake... |
_outRowMarkClause(StringInfo str, const RowMarkClause *node)
{
WRITE_NODE_TYPE("ROWMARKCLAUSE");
WRITE_UINT_FIELD(rti);
WRITE_ENUM_FIELD(strength, LockClauseStrength);
WRITE_BOOL_FIELD(noWait);
WRITE_BOOL_FIELD(pushedDown);
} | 0 | [
"CWE-362"
] | postgres | 5f173040e324f6c2eebb90d86cf1b0cdb5890f0a | 106,962,973,134,143,000,000,000,000,000,000,000,000 | 9 | Avoid repeated name lookups during table and index DDL.
If the name lookups come to different conclusions due to concurrent
activity, we might perform some parts of the DDL on a different table
than other parts. At least in the case of CREATE INDEX, this can be
used to cause the permissions checks to be performed aga... |
void Writef(SAVESTREAM* f, const char* frm, ...)
{
char Buffer[4096];
va_list args;
va_start(args, frm);
vsnprintf(Buffer, 4095, frm, args);
Buffer[4095] = 0;
WriteStr(f, Buffer);
va_end(args);
} | 0 | [] | Little-CMS | 65e2f1df3495edc984f7e0d7b7b24e29d851e240 | 236,081,948,490,576,470,000,000,000,000,000,000,000 | 12 | Fix some warnings from static analysis |
static void nbt_name_socket_recv(struct nbt_name_socket *nbtsock)
{
TALLOC_CTX *tmp_ctx = talloc_new(nbtsock);
NTSTATUS status;
enum ndr_err_code ndr_err;
struct socket_address *src;
DATA_BLOB blob;
size_t nread, dsize;
struct nbt_name_packet *packet;
struct nbt_name_request *req;
status = socket_pending(nbts... | 1 | [
"CWE-834"
] | samba | 3cc0f1eeda5f133532dda31eef9fc1b394127e50 | 175,937,496,058,538,000,000,000,000,000,000,000,000 | 82 | CVE-2020-14303: s4 nbt: fix busy loop on empty UDP packet
An empty UDP packet put the nbt server into a busy loop that consumes
100% of a cpu.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14417
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Karolin Seeger <kseeger@samba.org>
Autobuild... |
static inline void ok_jpg_idct_1d_row_8(int h, const int *in, uint8_t *out) {
static const int out_shift = 19;
int t0, t1, t2;
int p0, p1, p2, p3;
int q0, q1, q2, q3;
for (int y = 0; y < h; y++) {
// Quick check to avoid mults
if (in[1] == 0 && in[2] == 0 && in[3] == 0 && in[4] == ... | 0 | [
"CWE-787"
] | ok-file-formats | a9cc1711dd4ed6a215038f1c5c03af0ef52c3211 | 312,691,349,882,511,430,000,000,000,000,000,000,000 | 29 | ok_jpg: Fix invalid DHT (#11) |
static void textview_add_part(TextView *textview, MimeInfo *mimeinfo)
{
GtkAllocation allocation;
GtkTextView *text;
GtkTextBuffer *buffer;
GtkTextIter iter, start_iter;
gchar buf[BUFFSIZE];
GPtrArray *headers = NULL;
const gchar *name;
gchar *content_type;
gint charcount;
START_TIMING("");
cm_return_if_fa... | 0 | [
"CWE-601"
] | claws | ac286a71ed78429e16c612161251b9ea90ccd431 | 68,522,932,821,365,640,000,000,000,000,000,000,000 | 156 | harden link checker before accepting click |
parse_efm_option(char_u *efm)
{
efm_T *fmt_ptr = NULL;
efm_T *fmt_first = NULL;
efm_T *fmt_last = NULL;
char_u *fmtstr = NULL;
int len;
int sz;
// Each part of the format string is copied and modified from errorformat
// to regex prog. Only a few % characters are allowed.
// Get... | 0 | [
"CWE-416"
] | vim | 4f1b083be43f351bc107541e7b0c9655a5d2c0bb | 4,848,993,403,496,642,000,000,000,000,000,000,000 | 53 | patch 9.0.0322: crash when no errors and 'quickfixtextfunc' is set
Problem: Crash when no errors and 'quickfixtextfunc' is set.
Solution: Do not handle errors if there aren't any. |
switch_prio(struct intel_engine_cs *engine, const struct i915_request *rq)
{
if (list_is_last(&rq->sched.link, &engine->active.requests))
return INT_MIN;
return rq_prio(list_next_entry(rq, sched.link));
} | 0 | [] | linux | bc8a76a152c5f9ef3b48104154a65a68a8b76946 | 52,338,356,390,899,370,000,000,000,000,000,000,000 | 7 | drm/i915/gen9: Clear residual context state on context switch
Intel ID: PSIRT-TA-201910-001
CVEID: CVE-2019-14615
Intel GPU Hardware prior to Gen11 does not clear EU state
during a context switch. This can result in information
leakage between contexts.
For Gen8 and Gen9, hardware provides a mechanism for
fast clear... |
static inline struct kiocb *aio_get_req(struct kioctx *ctx)
{
struct kiocb *req;
if (!get_reqs_available(ctx)) {
user_refill_reqs_available(ctx);
if (!get_reqs_available(ctx))
return NULL;
}
req = kmem_cache_alloc(kiocb_cachep, GFP_KERNEL|__GFP_ZERO);
if (unlikely(!req))
goto out_put;
percpu_ref_get(&... | 0 | [] | linux-stable | c4f4b82694fe48b02f7a881a1797131a6dad1364 | 51,301,871,074,473,640,000,000,000,000,000,000,000 | 22 | AIO: properly check iovec sizes
In Linus's tree, the iovec code has been reworked massively, but in
older kernels the AIO layer should be checking this before passing the
request on to other layers.
Many thanks to Ben Hawkes of Google Project Zero for pointing out the
issue.
Reported-by: Ben Hawkes <hawkes@google.co... |
set_lan_param_wait(struct ipmi_intf * intf, uint8_t chan,
int param, uint8_t * data, int len)
{
struct lan_param * p;
int retry = 10; /* 10 retries */
lprintf(LOG_DEBUG, "Waiting for Set LAN Parameter to complete...");
if (verbose > 1)
printbuf(data, len, "SET DATA");
for (;;) {
p = get_lan_param(intf,... | 0 | [
"CWE-120"
] | ipmitool | d45572d71e70840e0d4c50bf48218492b79c1a10 | 331,480,396,033,927,150,000,000,000,000,000,000,000 | 42 | lanp: Fix buffer overflows in get_lan_param_select
Partial fix for CVE-2020-5208, see
https://github.com/ipmitool/ipmitool/security/advisories/GHSA-g659-9qxw-p7cp
The `get_lan_param_select` function is missing a validation check on the
response’s `data_len`, which it then returns to caller functions, where
stack buff... |
get_mapclear_arg(expand_T *xp UNUSED, int idx)
{
if (idx == 0)
return (char_u *)"<buffer>";
return NULL;
} | 0 | [
"CWE-78"
] | vim | 8c62a08faf89663e5633dc5036cd8695c80f1075 | 127,692,227,159,825,990,000,000,000,000,000,000,000 | 6 | patch 8.1.0881: can execute shell commands in rvim through interfaces
Problem: Can execute shell commands in rvim through interfaces.
Solution: Disable using interfaces in restricted mode. Allow for writing
file with writefile(), histadd() and a few others. |
const void *dup_iter(struct iov_iter *new, struct iov_iter *old, gfp_t flags)
{
*new = *old;
if (unlikely(iov_iter_is_pipe(new))) {
WARN_ON(1);
return NULL;
}
if (unlikely(iov_iter_is_discard(new) || iov_iter_is_xarray(new)))
return NULL;
if (iov_iter_is_bvec(new))
return new->bvec = kmemdup(new->bvec,
... | 0 | [
"CWE-665",
"CWE-284"
] | linux | 9d2231c5d74e13b2a0546fee6737ee4446017903 | 9,695,670,227,787,770,000,000,000,000,000,000,000 | 19 | lib/iov_iter: initialize "flags" in new pipe_buffer
The functions copy_page_to_iter_pipe() and push_pipe() can both
allocate a new pipe_buffer, but the "flags" member initializer is
missing.
Fixes: 241699cd72a8 ("new iov_iter flavour: pipe-backed")
To: Alexander Viro <viro@zeniv.linux.org.uk>
To: linux-fsdevel@vger.k... |
OidFunctionCall4Coll(Oid functionId, Oid collation, Datum arg1, Datum arg2,
Datum arg3, Datum arg4)
{
FmgrInfo flinfo;
FunctionCallInfoData fcinfo;
Datum result;
fmgr_info(functionId, &flinfo);
InitFunctionCallInfoData(fcinfo, &flinfo, 4, collation, NULL, NULL);
fcinfo.arg[0] = arg1;
fcinfo.arg[1] = ar... | 0 | [
"CWE-264"
] | postgres | 537cbd35c893e67a63c59bc636c3e888bd228bc7 | 274,033,923,662,218,920,000,000,000,000,000,000,000 | 28 | 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 ... |
static inline void ept_sync_context(u64 eptp)
{
if (enable_ept) {
if (cpu_has_vmx_invept_context())
__invept(VMX_EPT_EXTENT_CONTEXT, eptp, 0);
else
ept_sync_global();
}
} | 0 | [
"CWE-400"
] | linux-2.6 | 9581d442b9058d3699b4be568b6e5eae38a41493 | 103,001,995,902,521,770,000,000,000,000,000,000,000 | 9 | KVM: Fix fs/gs reload oops with invalid ldt
kvm reloads the host's fs and gs blindly, however the underlying segment
descriptors may be invalid due to the user modifying the ldt after loading
them.
Fix by using the safe accessors (loadsegment() and load_gs_index()) instead
of home grown unsafe versions.
This is CVE-... |
static void add_pending_object_with_mode(struct rev_info *revs, struct object *obj, const char *name, unsigned mode)
{
if (revs->no_walk && (obj->flags & UNINTERESTING))
die("object ranges do not make sense when not walking revisions");
if (revs->reflog_info && obj->type == OBJ_COMMIT &&
add_reflog_for_walk(revs... | 0 | [
"CWE-119"
] | git | fd55a19eb1d49ae54008d932a65f79cd6fda45c9 | 120,834,399,528,139,760,000,000,000,000,000,000,000 | 10 | Fix buffer overflow in git diff
If PATH_MAX on your system is smaller than a path stored, it may cause
buffer overflow and stack corruption in diff_addremove() and diff_change()
functions when running git-diff
Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com> |
ofputil_format_version_name(struct ds *msg, enum ofp_version version)
{
ds_put_cstr(msg, ofputil_version_to_string(version));
} | 0 | [
"CWE-772"
] | ovs | 77ad4225d125030420d897c873e4734ac708c66b | 186,829,360,771,517,870,000,000,000,000,000,000,000 | 4 | ofp-util: Fix memory leaks on error cases in ofputil_decode_group_mod().
Found by libFuzzer.
Reported-by: Bhargava Shastry <bshastry@sec.t-labs.tu-berlin.de>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org> |
gdImageDestroy (gdImagePtr im)
{
int i;
if (im->pixels)
{
for (i = 0; (i < im->sy); i++)
{
gdFree (im->pixels[i]);
}
gdFree (im->pixels);
}
if (im->tpixels)
{
for (i = 0; (i < im->sy); i++)
{
gdFree (im->tpixels[i]);
}
gdFree (im->tpixels);
}
if (im->polyInts)
... | 0 | [
"CWE-119"
] | php-src | feba44546c27b0158f9ac20e72040a224b918c75 | 243,741,327,058,724,840,000,000,000,000,000,000,000 | 29 | Fixed bug #22965 (Crash in gd lib's ImageFillToBorder()). |
__releases(&keyring_serialise_link_sem)
{
BUG_ON(index_key->type == NULL);
kenter("%d,%s,", keyring->serial, index_key->type->name);
if (index_key->type == &key_type_keyring)
up_write(&keyring_serialise_link_sem);
if (edit && !edit->dead_leaf) {
key_payload_reserve(keyring,
keyring->datalen - KEYQUOT... | 1 | [
"CWE-119",
"CWE-787"
] | linux | ca4da5dd1f99fe9c59f1709fb43e818b18ad20e0 | 31,557,457,625,386,580,000,000,000,000,000,000,000 | 15 | KEYS: ensure we free the assoc array edit if edit is valid
__key_link_end is not freeing the associated array edit structure
and this leads to a 512 byte memory leak each time an identical
existing key is added with add_key().
The reason the add_key() system call returns okay is that
key_create_or_update() calls __ke... |
static int vq_log_access_ok(struct vhost_dev *d, struct vhost_virtqueue *vq,
void __user *log_base)
{
struct vhost_memory *mp;
size_t s = vhost_has_feature(d, VIRTIO_RING_F_EVENT_IDX) ? 2 : 0;
mp = rcu_dereference_protected(vq->dev->memory,
lockdep_is_held(&vq->mutex));
return vq_memory_access_ok... | 0 | [] | linux-2.6 | bd97120fc3d1a11f3124c7c9ba1d91f51829eb85 | 216,868,168,050,489,570,000,000,000,000,000,000,000 | 14 | vhost: fix length for cross region descriptor
If a single descriptor crosses a region, the
second chunk length should be decremented
by size translated so far, instead it includes
the full descriptor length.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: D... |
cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h,
uint32_t offs, cdf_property_info_t **info, size_t *count, size_t *maxcount)
{
const cdf_section_header_t *shp;
cdf_section_header_t sh;
const uint8_t *p, *q, *e;
int16_t s16;
int32_t s32;
uint32_t u32;
int64_t s64;
uint64_t u64;
cdf_tim... | 1 | [
"CWE-703",
"CWE-189"
] | file | 0641e56be1af003aa02c7c6b0184466540637233 | 37,267,751,515,960,885,000,000,000,000,000,000,000 | 197 | Prevent wrap around (Remi Collet at redhat) |
ptr_t GC_unix_get_mem(size_t bytes)
{
# if defined(MMAP_SUPPORTED)
/* By default, we try both sbrk and mmap, in that order. */
static GC_bool sbrk_failed = FALSE;
ptr_t result = 0;
if (!sbrk_failed) result = GC_unix_sbrk_get_mem(bytes);
if (0 == result) {
sbrk_failed = TRUE;
resu... | 0 | [
"CWE-119"
] | bdwgc | 7292c02fac2066d39dd1bcc37d1a7054fd1e32ee | 232,541,686,956,514,940,000,000,000,000,000,000,000 | 21 | 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... |
MagickExport void XFontBrowserWidget(Display *display,XWindows *windows,
const char *action,char *reply)
{
#define BackButtonText "Back"
#define CancelButtonText "Cancel"
#define FontnameText "Name:"
#define FontPatternText "Pattern:"
#define ResetButtonText "Reset"
char
back_pattern[MaxTextExtent],
*... | 0 | [] | ImageMagick6 | ad492c7ed4cf1cf285a7f6e2ee5a1e7cf24e73b2 | 141,847,976,755,257,970,000,000,000,000,000,000,000 | 1,148 | https://github.com/ImageMagick/ImageMagick/issues/3335 |
is_device_installed(gx_device *dev, const char *name)
{
while (dev) {
if (!strcmp(dev->dname, name)) {
return true;
}
dev = dev->child;
}
return false;
} | 0 | [] | ghostpdl | c9b362ba908ca4b1d7c72663a33229588012d7d9 | 171,414,785,133,527,000,000,000,000,000,000,000,000 | 10 | Bug 699670: disallow copying of the epo device
The erasepage optimisation (epo) subclass device shouldn't be allowed to be
copied because the subclass private data, child and parent pointers end up
being shared between the original device and the copy.
Add an epo_finish_copydevice which NULLs the three offending poin... |
TEST_F(QueryPlannerTest, TwoNestedElemMatchBounds) {
addIndex(BSON("a.d.e" << 1 << "a.b.c" << 1));
runQuery(
fromjson("{a: {$elemMatch: {d: {$elemMatch: {e: {$lte: 1}}},"
"b: {$elemMatch: {c: {$gte: 1}}}}}}"));
assertNumSolutions(2U);
assertSolutionExists("{cscan: {dir: 1}}");
... | 0 | [
"CWE-834"
] | mongo | 94d0e046baa64d1aa1a6af97e2d19bb466cc1ff5 | 186,154,329,297,090,880,000,000,000,000,000,000,000 | 13 | SERVER-38164 $or pushdown optimization does not correctly handle $not within an $elemMatch |
free_autopickup_exceptions()
{
struct autopickup_exception *ape;
int pass;
for (pass = AP_LEAVE; pass <= AP_GRAB; ++pass) {
while((ape = iflags.autopickup_exceptions[pass]) != 0) {
free(ape->pattern);
iflags.autopickup_exceptions[pass] = ape->next;
free(ape);
}
}
} | 0 | [
"CWE-269"
] | NetHack | 612755bfb5c412079795c68ba392df5d93874ed8 | 37,839,690,884,799,580,000,000,000,000,000,000,000 | 13 | escapes() revamp
Partial rewrite of escapes(), mostly changing its if-then-else
logic so that end-of-string can be checked once instead for each case.
The previous version had a bug if the input string ended with backslash
and one decimal digit (due to being lumped together with the handling
for trailing \X or \O... |
void SslIntegrationTestBase::TearDown() {
HttpIntegrationTest::cleanupUpstreamAndDownstream();
codec_client_.reset();
context_manager_.reset();
} | 0 | [
"CWE-400"
] | envoy | 0e49a495826ea9e29134c1bd54fdeb31a034f40c | 18,250,008,054,471,818,000,000,000,000,000,000,000 | 5 | http/2: add stats and stream flush timeout (#139)
This commit adds a new stream flush timeout to guard against a
remote server that does not open window once an entire stream has
been buffered for flushing. Additional stats have also been added
to better understand the codecs view of active streams as well as
amount o... |
static int fbo_emulate_request_sense(struct tcmu_device *dev, uint8_t *cdb,
struct iovec *iovec, size_t iov_cnt,
uint8_t *sense)
{
struct fbo_state *state = tcmu_get_dev_private(dev);
uint8_t buf[18];
if (cdb[1] & 0x01)
return tcmu_set_sense_data(sense, ILLEGAL_REQUEST,
ASC_INVALID_FIELD... | 0 | [
"CWE-200"
] | tcmu-runner | 8cf8208775022301adaa59c240bb7f93742d1329 | 61,565,263,538,578,770,000,000,000,000,000,000,000 | 33 | removed all check_config callback implementations to avoid security issues
see github issue #194
qcow.c contained an information leak, could test for existance of any
file in the system
file_example.c and file_optical.c allow also to test for existance of
any file, plus to temporarily create empty new files anywhere... |
long long getInstantaneousMetric(int metric) {
int j;
long long sum = 0;
for (j = 0; j < STATS_METRIC_SAMPLES; j++)
sum += server.inst_metric[metric].samples[j];
return sum / STATS_METRIC_SAMPLES;
} | 0 | [
"CWE-770"
] | redis | 5674b0057ff2903d43eaff802017eddf37c360f8 | 293,988,763,242,437,260,000,000,000,000,000,000,000 | 8 | Prevent unauthenticated client from easily consuming lots of memory (CVE-2021-32675)
This change sets a low limit for multibulk and bulk length in the
protocol for unauthenticated connections, so that they can't easily
cause redis to allocate massive amounts of memory by sending just a few
characters on the network.
T... |
u32 gf_isom_get_constant_sample_size(GF_ISOFile *the_file, u32 trackNumber)
{
GF_TrackBox *trak;
trak = gf_isom_get_track_from_file(the_file, trackNumber);
if (!trak || !trak->Media || !trak->Media->information || !trak->Media->information->sampleTable || !trak->Media->information->sampleTable->SampleSize) return 0;... | 0 | [
"CWE-476"
] | gpac | ebfa346eff05049718f7b80041093b4c5581c24e | 79,083,077,288,632,720,000,000,000,000,000,000,000 | 7 | fixed #1706 |
static inline unsigned long zap_pmd_range(struct mmu_gather *tlb,
struct vm_area_struct *vma, pud_t *pud,
unsigned long addr, unsigned long end,
struct zap_details *details)
{
pmd_t *pmd;
unsigned long next;
pmd = pmd_offset(pud, addr);
do {
next = pmd_addr_end(addr, end);
if (pmd_trans_huge(*pmd))... | 0 | [
"CWE-264"
] | linux-2.6 | 1a5a9906d4e8d1976b701f889d8f35d54b928f25 | 79,337,938,379,353,060,000,000,000,000,000,000,000 | 35 | mm: thp: fix pmd_bad() triggering in code paths holding mmap_sem read mode
In some cases it may happen that pmd_none_or_clear_bad() is called with
the mmap_sem hold in read mode. In those cases the huge page faults can
allocate hugepmds under pmd_none_or_clear_bad() and that can trigger a
false positive from pmd_bad(... |
static void CL_GenerateQKey(void)
{
int len = 0;
unsigned char buff[ QKEY_SIZE ];
fileHandle_t f;
len = FS_SV_FOpenFileRead( QKEY_FILE, &f );
FS_FCloseFile( f );
if( len == QKEY_SIZE ) {
Com_Printf( "QKEY found.\n" );
return;
}
else {
if( len > 0 ) {
Com_Printf( "QKEY file size != %d, regenerating\n",... | 0 | [
"CWE-269"
] | ioq3 | 376267d534476a875d8b9228149c4ee18b74a4fd | 246,107,634,174,971,730,000,000,000,000,000,000,000 | 32 | Don't load .pk3s as .dlls, and don't load user config files from .pk3s. |
virDomainObjParseXML(xmlDocPtr xml,
xmlXPathContextPtr ctxt,
virDomainXMLOptionPtr xmlopt,
unsigned int flags)
{
long val;
xmlNodePtr config;
xmlNodePtr oldnode;
virDomainObjPtr obj;
size_t i;
int n;
int state;
int reason = 0... | 0 | [
"CWE-212"
] | libvirt | a5b064bf4b17a9884d7d361733737fb614ad8979 | 276,909,084,547,811,760,000,000,000,000,000,000,000 | 100 | conf: Don't format http cookies unless VIR_DOMAIN_DEF_FORMAT_SECURE is used
Starting with 3b076391befc3fe72deb0c244ac6c2b4c100b410
(v6.1.0-122-g3b076391be) we support http cookies. Since they may contain
somewhat sensitive information we should not format them into the XML
unless VIR_DOMAIN_DEF_FORMAT_SECURE is assert... |
static char *am_optional_metadata(apr_pool_t *p, request_rec *r)
{
am_dir_cfg_rec *cfg = am_get_dir_cfg(r);
int count = 0;
char *org_data = NULL;
char *org_name = NULL;
char *org_display_name = NULL;
char *org_url = NULL;
count += apr_hash_count(cfg->sp_org_name);
count += apr_hash_coun... | 0 | [] | mod_auth_mellon | 6bdda9170a8f1757dabc5b109958657417728018 | 149,998,363,629,080,700,000,000,000,000,000,000,000 | 27 | Fix segmentation fault when receiving badly formed logout message.
If the logout message is badly formed, we won't get the entityID in
`logout->parent.remote_providerID`. If we call `apr_hash_get()` with a
null pointer, it will cause a segmentation fault.
Add a check to validate that the entityID is correctly set. |
xmlParsePubidLiteral(xmlParserCtxtPtr ctxt) {
xmlChar *buf = NULL;
int len = 0;
int size = XML_PARSER_BUFFER_SIZE;
xmlChar cur;
xmlChar stop;
int count = 0;
xmlParserInputState oldstate = ctxt->instate;
SHRINK;
if (RAW == '"') {
NEXT;
stop = '"';
} else if (RAW == '\'')... | 0 | [
"CWE-125"
] | libxml2 | 77404b8b69bc122d12231807abf1a837d121b551 | 140,540,689,144,593,200,000,000,000,000,000,000,000 | 63 | Make sure the parser returns when getting a Stop order
patch backported from chromiun bug fixes, assuming author is Chris |
push_handle_free (PushHandle *handle)
{
if (handle->in)
{
g_input_stream_close_async (handle->in, 0, NULL, NULL, NULL);
g_object_unref (handle->in);
}
g_object_unref (handle->backend);
g_object_unref (handle->job);
soup_uri_free (handle->uri);
g_slice_free (PushHandle, handle);
} | 0 | [] | gvfs | f81ff2108ab3b6e370f20dcadd8708d23f499184 | 308,132,058,049,829,560,000,000,000,000,000,000,000 | 12 | dav: don't unescape the uri twice
path_equal tries to unescape path before comparing. Unfortunately
this function is used also for already unescaped paths. Therefore
unescaping can fail. This commit reverts changes which was done in
commit 50af53d and unescape just uris, which aren't unescaped yet.
https://bugzilla.g... |
static void php_csr_free(zend_rsrc_list_entry *rsrc TSRMLS_DC)
{
X509_REQ * csr = (X509_REQ*)rsrc->ptr;
X509_REQ_free(csr);
} | 0 | [
"CWE-200"
] | php-src | 270a406ac94b5fc5cc9ef59fc61e3b4b95648a3e | 95,337,070,757,928,920,000,000,000,000,000,000,000 | 5 | Fix bug #61413 ext\openssl\tests\openssl_encrypt_crash.phpt fails 5.3 only |
int x86_decode_insn(struct x86_emulate_ctxt *ctxt, void *insn, int insn_len)
{
int rc = X86EMUL_CONTINUE;
int mode = ctxt->mode;
int def_op_bytes, def_ad_bytes, goffset, simd_prefix;
bool op_prefix = false;
bool has_seg_override = false;
struct opcode opcode;
ctxt->memop.type = OP_NONE;
ctxt->memopp = NULL;
c... | 1 | [
"CWE-476",
"CWE-284"
] | linux | d9092f52d7e61dd1557f2db2400ddb430e85937e | 190,016,248,246,993,300,000,000,000,000,000,000,000 | 268 | kvm: x86: Check memopp before dereference (CVE-2016-8630)
Commit 41061cdb98 ("KVM: emulate: do not initialize memopp") removes a
check for non-NULL under incorrect assumptions. An undefined instruction
with a ModR/M byte with Mod=0 and R/M-5 (e.g. 0xc7 0x15) will attempt
to dereference a null pointer here.
Fixes: 410... |
const TfLiteRegistration* FindOp(tflite::BuiltinOperator op,
int version) const override {
return constant_return_;
} | 0 | [
"CWE-20",
"CWE-787"
] | tensorflow | d58c96946b2880991d63d1dacacb32f0a4dfa453 | 1,429,113,576,787,051,400,000,000,000,000,000,000 | 4 | [tflite] Ensure inputs and outputs don't overlap.
If a model uses the same tensor for both an input and an output then this can result in data loss and memory corruption. This should not happen.
PiperOrigin-RevId: 332522916
Change-Id: If0905b142415a9dfceaf2d181872f2a8fb88f48a |
int parse_timestamp(char *argv[], int *opt, struct tstamp *tse,
const char *def_timestamp)
{
char timestamp[9];
if (argv[++(*opt)]) {
switch (strlen(argv[*opt])) {
case 5:
strncpy(timestamp, argv[(*opt)++], 5);
timestamp[5] = '\0';
strcat(timestamp, ":00");
break;
case 8:
strncpy(... | 0 | [
"CWE-125"
] | sysstat | fbc691eaaa10d0bcea6741d5a223dc3906106548 | 288,432,733,975,018,540,000,000,000,000,000,000,000 | 29 | Fix #196 and #199: Out of bound reads security issues
Check args before calling memmove() and memset() in remap_struct()
function to avoid out of bound reads which would possibly lead to
unknown code execution and/or sadf command crash.
Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com> |
nfs4_proc_layoutcommit(struct nfs4_layoutcommit_data *data, bool sync)
{
struct rpc_message msg = {
.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_LAYOUTCOMMIT],
.rpc_argp = &data->args,
.rpc_resp = &data->res,
.rpc_cred = data->cred,
};
struct rpc_task_setup task_setup_data = {
.task = &data->task,
.rpc_cli... | 0 | [
"CWE-787"
] | linux | b4487b93545214a9db8cbf32e86411677b0cca21 | 282,808,764,552,367,970,000,000,000,000,000,000,000 | 42 | 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... |
static void svm_handle_exit_irqoff(struct kvm_vcpu *vcpu)
{
if (to_svm(vcpu)->vmcb->control.exit_code == SVM_EXIT_INTR)
vcpu->arch.at_instruction_boundary = true;
} | 0 | [
"CWE-703"
] | linux | 6cd88243c7e03845a450795e134b488fc2afb736 | 92,291,810,461,839,920,000,000,000,000,000,000,000 | 5 | KVM: x86: do not report a vCPU as preempted outside instruction boundaries
If a vCPU is outside guest mode and is scheduled out, it might be in the
process of making a memory access. A problem occurs if another vCPU uses
the PV TLB flush feature during the period when the vCPU is scheduled
out, and a virtual address ... |
START_TEST(test_all_users_waiting_to_send)
{
in_addr_t ip;
ip = inet_addr("127.0.0.1");
init_users(ip, 27);
fail_unless(all_users_waiting_to_send() == 1);
users[0].conn = CONN_DNS_NULL;
users[0].active = 1;
fail_unless(all_users_waiting_to_send() == 1);
users[0].last_pkt = time(NULL);
users[0].outpacket.l... | 0 | [] | iodine | b715be5cf3978fbe589b03b09c9398d0d791f850 | 267,023,886,654,537,580,000,000,000,000,000,000,000 | 27 | 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... |
template<typename t>
CImg<T>& operator<<=(const t value) {
if (is_empty()) return *this;
cimg_pragma_openmp(parallel for cimg_openmp_if(size()>=65536))
cimg_rof(*this,ptrd,T) *ptrd = (T)(((longT)*ptrd) << (int)value);
return *this; | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 151,678,076,412,590,570,000,000,000,000,000,000,000 | 6 | Fix other issues in 'CImg<T>::load_bmp()'. |
void X509Certificate::PublicKey(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args);
X509Certificate* cert;
ASSIGN_OR_RETURN_UNWRAP(&cert, args.Holder());
EVPKeyPointer pkey(X509_get_pubkey(cert->get()));
ManagedEVPPKey epkey(std::move(pkey));
std::shared_ptr<KeyObje... | 0 | [
"CWE-295"
] | node | 466e5415a2b7b3574ab5403acb87e89a94a980d1 | 205,488,268,932,207,460,000,000,000,000,000,000,000 | 14 | crypto,tls: implement safe x509 GeneralName format
This change introduces JSON-compatible escaping rules for strings that
include X.509 GeneralName components (see RFC 5280). This non-standard
format avoids ambiguities and prevents injection attacks that could
previously lead to X.509 certificates being accepted even ... |
static void pngflush(png_struct *p) {
#ifdef DOFLUSH
fflush(png_get_io_ptr(p));
#else
(void)p;
#endif
} | 0 | [
"CWE-415",
"CWE-787"
] | png2webp | 8f21ad79b0cd98fc22d5b49734543101946abbff | 262,495,444,855,699,380,000,000,000,000,000,000,000 | 7 | v1.0.5: fix buffer overrun when reading bad WebPs |
void CompactProtocolReader::readFieldBeginWithState(StructReadState& state) {
int8_t byte;
readByte(byte);
readFieldBeginWithStateImpl(state, state.fieldId, byte);
} | 0 | [
"CWE-703",
"CWE-770"
] | fbthrift | c9a903e5902834e95bbd4ab0e9fa53ba0189f351 | 69,356,619,170,020,230,000,000,000,000,000,000,000 | 5 | Better handling of truncated data when reading strings
Summary:
Currently we read string size and blindly pre-allocate it. This allows malicious attacker to send a few bytes message and cause server to allocate huge amount of memory (>1GB).
This diff changes the logic to check if we have enough data in the buffer bef... |
rfbBool rfbInitClient(rfbClient* client,int* argc,char** argv) {
int i,j;
if(argv && argc && *argc) {
if(client->programName==0)
client->programName=argv[0];
for (i = 1; i < *argc; i++) {
j = i;
if (strcmp(argv[i], "-listen") == 0) {
listenForIncomingConnections(client);
break;
}... | 0 | [
"CWE-400",
"CWE-703"
] | libvncserver | bef41f6ec4097a8ee094f90a1b34a708fbd757ec | 40,210,280,811,369,256,000,000,000,000,000,000,000 | 80 | libvncclient: free vncRec memory in rfbClientCleanup()
Otherwise we leak memory. Spotted by Ramin Farajpour Cami
<ramin.blackhat@gmail.com>, thanks! |
cib_tls_close(cib_t * cib)
{
cib_remote_opaque_t *private = cib->variant_opaque;
#ifdef HAVE_GNUTLS_GNUTLS_H
if (private->command.encrypted) {
if (private->command.session) {
gnutls_bye(*(private->command.session), GNUTLS_SHUT_RDWR);
gnutls_deinit(*(private->command.session));
... | 0 | [
"CWE-399"
] | pacemaker | 564f7cc2a51dcd2f28ab12a13394f31be5aa3c93 | 296,787,261,485,493,630,000,000,000,000,000,000,000 | 45 | High: core: Internal tls api improvements for reuse with future LRMD tls backend. |
and_cclass(CClassNode* dest, CClassNode* cc, ScanEnv* env)
{
OnigEncoding enc = env->enc;
int r, not1, not2;
BBuf *buf1, *buf2, *pbuf = 0;
BitSetRef bsr1, bsr2;
BitSet bs1, bs2;
not1 = IS_NCCLASS_NOT(dest);
bsr1 = dest->bs;
buf1 = dest->mbuf;
not2 = IS_NCCLASS_NOT(cc);
bsr2 = cc->bs;
buf2 = cc->m... | 0 | [
"CWE-476"
] | Onigmo | 00cc7e28a3ed54b3b512ef3b58ea737a57acf1f9 | 198,072,814,426,471,470,000,000,000,000,000,000,000 | 56 | Fix SEGV in onig_error_code_to_str() (Fix #132)
When onig_new(ONIG_SYNTAX_PERL) fails with ONIGERR_INVALID_GROUP_NAME,
onig_error_code_to_str() crashes.
onig_scan_env_set_error_string() should have been used when returning
ONIGERR_INVALID_GROUP_NAME. |
static void lite_font_init( wmfAPI* API, wmfAPI_Options* options)
{
wmfFontData
*font_data;
(void) options;
API->fonts = 0;
/* Allocate wmfFontData data structure */
API->font_data = wmf_malloc(API,sizeof(wmfFontData));
if (ERR (API))
return;
font_data = (wmfFontData*)API->font_data;
/* Assi... | 0 | [
"CWE-772"
] | ImageMagick | b2b48d50300a9fbcd0aa0d9230fd6d7a08f7671e | 296,795,363,480,000,500,000,000,000,000,000,000,000 | 28 | https://github.com/ImageMagick/ImageMagick/issues/544 |
TEST_P(ConnectTerminationIntegrationTest, BasicAllowPost) {
allow_post_ = true;
initialize();
// Use POST request.
connect_headers_.setMethod("POST");
connect_headers_.removeProtocol();
setUpConnection();
sendBidirectionalDataAndCleanShutdown();
} | 0 | [
"CWE-416"
] | envoy | ce0ae309057a216aba031aff81c445c90c6ef145 | 177,025,723,050,140,270,000,000,000,000,000,000,000 | 11 | CVE-2021-43826
Signed-off-by: Yan Avlasov <yavlasov@google.com> |
diff_get_corresponding_line_int(
buf_T *buf1,
linenr_T lnum1)
{
int idx1;
int idx2;
diff_T *dp;
int baseline = 0;
idx1 = diff_buf_idx(buf1);
idx2 = diff_buf_idx(curbuf);
if (idx1 == DB_COUNT || idx2 == DB_COUNT || curtab->tp_first_diff == NULL)
return lnum1;
if (curtab->tp_... | 0 | [
"CWE-787"
] | vim | c101abff4c6756db4f5e740fde289decb9452efa | 108,652,984,607,219,770,000,000,000,000,000,000,000 | 53 | patch 8.2.5164: invalid memory access after diff buffer manipulations
Problem: Invalid memory access after diff buffer manipulations.
Solution: Use zero offset when change removes all lines in a diff block. |
static int acl_parse_ver(const char **text, struct acl_pattern *pattern, int *opaque, char **err)
{
pattern->ptr.str = strdup(*text);
if (!pattern->ptr.str) {
memprintf(err, "out of memory while loading pattern");
return 0;
}
pattern->len = strlen(*text);
return 1;
} | 0 | [] | haproxy | aae75e3279c6c9bd136413a72dafdcd4986bb89a | 254,432,597,454,653,600,000,000,000,000,000,000,000 | 10 | BUG/CRITICAL: using HTTP information in tcp-request content may crash the process
During normal HTTP request processing, request buffers are realigned if
there are less than global.maxrewrite bytes available after them, in
order to leave enough room for rewriting headers after the request. This
is done in http_wait_fo... |
TEST_F(HttpConnectionManagerImplTest, UpstreamWatermarkCallbacks) {
setup(false, "");
setUpEncoderAndDecoder(false, false);
sendRequestHeadersAndData();
// Mimic the upstream connection backing up. The router would call
// onDecoderFilterAboveWriteBufferHighWatermark which should readDisable the stream and i... | 0 | [
"CWE-400"
] | envoy | 0e49a495826ea9e29134c1bd54fdeb31a034f40c | 15,402,002,235,362,306,000,000,000,000,000,000,000 | 39 | http/2: add stats and stream flush timeout (#139)
This commit adds a new stream flush timeout to guard against a
remote server that does not open window once an entire stream has
been buffered for flushing. Additional stats have also been added
to better understand the codecs view of active streams as well as
amount o... |
HTTPSession::onWriteSuccess(uint64_t bytesWritten) {
DestructorGuard dg(this);
bytesWritten_ += bytesWritten;
transportInfo_.totalBytes += bytesWritten;
CHECK(writeTimeout_.isScheduled());
if (pendingWrites_.empty()) {
VLOG(10) << "Cancel write timer on last successful write";
writeTimeout_.cancelTime... | 0 | [
"CWE-20"
] | proxygen | 0600ebe59c3e82cd012def77ca9ca1918da74a71 | 47,084,132,666,643,270,000,000,000,000,000,000,000 | 57 | Check that a secondary auth manager is set before dereferencing.
Summary: CVE-2018-6343
Reviewed By: mingtaoy
Differential Revision: D12994423
fbshipit-source-id: 9229ec11da8085f1fa153595e8e5353e19d06fb7 |
void notify_removers() {
// Notify all removers. This is because they are
// waiting for specific keys to appear in the map
// so we don't know which one to wake up.
not_empty_.notify_all();
} | 0 | [
"CWE-20",
"CWE-476"
] | tensorflow | d7de67733925de196ec8863a33445b73f9562d1d | 171,157,553,024,382,160,000,000,000,000,000,000,000 | 6 | Prevent a CHECK-fail due to empty tensor input in `map_stage_op.cc`
PiperOrigin-RevId: 387737906
Change-Id: Idc52df0c71c7ed6e2dd633b651a581932f277c8a |
static int vmx_vcpu_setup(struct vcpu_vmx *vmx)
{
#ifdef CONFIG_X86_64
unsigned long a;
#endif
int i;
/* I/O */
vmcs_write64(IO_BITMAP_A, __pa(vmx_io_bitmap_a));
vmcs_write64(IO_BITMAP_B, __pa(vmx_io_bitmap_b));
if (enable_shadow_vmcs) {
vmcs_write64(VMREAD_BITMAP, __pa(vmx_vmread_bitmap));
vmcs_write64(VMW... | 0 | [
"CWE-399"
] | linux | 54a20552e1eae07aa240fa370a0293e006b5faed | 285,812,305,160,140,860,000,000,000,000,000,000,000 | 102 | KVM: x86: work around infinite loop in microcode when #AC is delivered
It was found that a guest can DoS a host by triggering an infinite
stream of "alignment check" (#AC) exceptions. This causes the
microcode to enter an infinite loop where the core never receives
another interrupt. The host kernel panics pretty qu... |
extern "C" void *malloc_wrapper(size_t size, void *caller)
{
void *ptr = NULL;
#ifdef MBED_MEM_TRACING_ENABLED
mbed_mem_trace_lock();
#endif
#ifdef MBED_HEAP_STATS_ENABLED
malloc_stats_mutex->lock();
alloc_info_t *alloc_info = NULL;
if (size <= SIZE_MAX - sizeof(alloc_info_t)) {
alloc_info =... | 0 | [
"CWE-190"
] | mbed-os | 151ebfcfc9f2383ee11ce3c771c3bf92900d6b43 | 101,788,159,327,881,560,000,000,000,000,000,000,000 | 36 | Add integer overflow check to the malloc wrappers
Add a check that the combined size of the buffer to allocate and
alloc_info_t does not exceed the maximum integer value representable
by size_t. |
_outBitmapOrPath(StringInfo str, const BitmapOrPath *node)
{
WRITE_NODE_TYPE("BITMAPORPATH");
_outPathInfo(str, (const Path *) node);
WRITE_NODE_FIELD(bitmapquals);
WRITE_FLOAT_FIELD(bitmapselectivity, "%.4f");
} | 0 | [
"CWE-362"
] | postgres | 5f173040e324f6c2eebb90d86cf1b0cdb5890f0a | 35,929,144,245,364,650,000,000,000,000,000,000,000 | 9 | Avoid repeated name lookups during table and index DDL.
If the name lookups come to different conclusions due to concurrent
activity, we might perform some parts of the DDL on a different table
than other parts. At least in the case of CREATE INDEX, this can be
used to cause the permissions checks to be performed aga... |
pkinit_init_pkcs11(pkinit_identity_crypto_context ctx)
{
krb5_error_code retval = ENOMEM;
#ifndef WITHOUT_PKCS11
ctx->p11_module_name = strdup(PKCS11_MODNAME);
if (ctx->p11_module_name == NULL)
return retval;
ctx->p11_module = NULL;
ctx->slotid = PK_NOSLOT;
ctx->token_label = NULL;
... | 0 | [
"CWE-476"
] | krb5 | f249555301940c6df3a2cdda13b56b5674eebc2e | 164,805,720,117,584,570,000,000,000,000,000,000,000 | 20 | PKINIT null pointer deref [CVE-2013-1415]
Don't dereference a null pointer when cleaning up.
The KDC plugin for PKINIT can dereference a null pointer when a
malformed packet causes processing to terminate early, leading to
a crash of the KDC process. An attacker would need to have a valid
PKINIT certificate or have ... |
xmlXIncludeCopyRange(xmlXIncludeCtxtPtr ctxt, xmlDocPtr target,
xmlDocPtr source, xmlXPathObjectPtr range) {
/* pointers to generated nodes */
xmlNodePtr list = NULL, last = NULL, listParent = NULL;
xmlNodePtr tmp, tmp2;
/* pointers to traversal nodes */
xmlNodePtr start, cur, end;
... | 0 | [
"CWE-416"
] | libxml2 | 1098c30a040e72a4654968547f415be4e4c40fe7 | 340,024,361,186,170,870,000,000,000,000,000,000,000 | 199 | Fix user-after-free with `xmllint --xinclude --dropdtd`
The --dropdtd option can leave dangling pointers in entity reference
nodes. Make sure to skip these nodes when processing XIncludes.
This also avoids scanning entity declarations and even modifying
them inadvertently during XInclude processing.
Move from a bloc... |
CallResult<bool> JSObject::getOwnComputedDescriptor(
Handle<JSObject> selfHandle,
Runtime *runtime,
Handle<> nameValHandle,
ComputedPropertyDescriptor &desc) {
auto converted = toPropertyKeyIfObject(runtime, nameValHandle);
if (LLVM_UNLIKELY(converted == ExecutionStatus::EXCEPTION)) {
return Exe... | 0 | [
"CWE-843",
"CWE-125"
] | hermes | fe52854cdf6725c2eaa9e125995da76e6ceb27da | 318,661,896,243,185,950,000,000,000,000,000,000,000 | 12 | [CVE-2020-1911] Look up HostObject computed properties on the right object in the prototype chain.
Summary:
The change in the hermes repository fixes the security vulnerability
CVE-2020-1911. This vulnerability only affects applications which
allow evaluation of uncontrolled, untrusted JavaScript code not
shipped wit... |
static void xudc_write32_be(void __iomem *addr, u32 offset, u32 val)
{
iowrite32be(val, addr + offset);
} | 0 | [
"CWE-20",
"CWE-129"
] | linux | 7f14c7227f342d9932f9b918893c8814f86d2a0d | 20,890,272,840,358,471,000,000,000,000,000,000,000 | 4 | USB: gadget: validate endpoint index for xilinx udc
Assure that host may not manipulate the index to point
past endpoint array.
Signed-off-by: Szymon Heidrich <szymon.heidrich@gmail.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
int wc_RsaPSS_VerifyCheck(byte* in, word32 inLen, byte* out, word32 outLen,
const byte* digest, word32 digestLen,
enum wc_HashType hash, int mgf,
RsaKey* key)
{
int ret = 0, verify, saltLen, hLen, bits = 0;
hLen = wc_HashGetDigestSiz... | 0 | [
"CWE-310",
"CWE-787"
] | wolfssl | fb2288c46dd4c864b78f00a47a364b96a09a5c0f | 44,905,014,409,109,820,000,000,000,000,000,000,000 | 31 | RSA-PSS: Handle edge case with encoding message to hash
When the key is small relative to the digest (1024-bit key, 64-byte
hash, 61-byte salt length), the internal message to hash is larger than
the output size.
Allocate a buffer for the message when this happens. |
drop_database_if_exists(const char *dbname)
{
header(_("dropping database \"%s\""), dbname);
psql_command("postgres", "DROP DATABASE IF EXISTS \"%s\"", dbname);
} | 0 | [
"CWE-119"
] | postgres | 01824385aead50e557ca1af28640460fa9877d51 | 25,779,774,856,698,550,000,000,000,000,000,000,000 | 5 | Prevent potential overruns of fixed-size buffers.
Coverity identified a number of places in which it couldn't prove that a
string being copied into a fixed-size buffer would fit. We believe that
most, perhaps all of these are in fact safe, or are copying data that is
coming from a trusted source so that any overrun i... |
xmlNodePtr xml_add_schedresponse(xmlNodePtr root, xmlNsPtr dav_ns,
xmlChar *recipient, xmlChar *status)
{
xmlNodePtr resp, recip;
resp = xmlNewChild(root, NULL, BAD_CAST "response", NULL);
recip = xmlNewChild(resp, NULL, BAD_CAST "recipient", NULL);
if (dav_ns) xml_add_href(recip, dav_ns, (const ... | 0 | [
"CWE-787"
] | cyrus-imapd | a5779db8163b99463e25e7c476f9cbba438b65f3 | 259,006,264,814,303,930,000,000,000,000,000,000,000 | 16 | HTTP: don't overrun buffer when parsing strings with sscanf() |
address_compare (EContact *ecard1,
EContact *ecard2,
EContactField field)
{
const gchar *address1, *address2;
gboolean equal;
address1 = e_contact_get_const (ecard1, field);
address2 = e_contact_get_const (ecard2, field);
if (address1 && address2)
equal = !strcmp (address1, ad... | 0 | [] | evolution-data-server | 34bad61738e2127736947ac50e0c7969cc944972 | 125,523,811,544,702,240,000,000,000,000,000,000,000 | 17 | Bug 796174 - strcat() considered unsafe for buffer overflow |
_Pickle_GetState(PyObject *module)
{
return (PickleState *)PyModule_GetState(module);
} | 0 | [
"CWE-190",
"CWE-369"
] | cpython | a4ae828ee416a66d8c7bf5ee71d653c2cc6a26dd | 64,409,727,957,374,620,000,000,000,000,000,000,000 | 4 | closes bpo-34656: Avoid relying on signed overflow in _pickle memos. (GH-9261) |
int Arg_comparator::compare_native()
{
THD *thd= current_thd;
if (!(*a)->val_native_with_conversion(thd, &m_native1,
compare_type_handler()))
{
if (!(*b)->val_native_with_conversion(thd, &m_native2,
compare_type_handler()))
... | 0 | [
"CWE-617"
] | server | 807945f2eb5fa22e6f233cc17b85a2e141efe2c8 | 44,715,551,295,058,860,000,000,000,000,000,000,000 | 18 | MDEV-26402: A SEGV in Item_field::used_tables/update_depend_map_for_order...
When doing condition pushdown from HAVING into WHERE,
Item_equal::create_pushable_equalities() calls
item->set_extraction_flag(IMMUTABLE_FL) for constant items.
Then, Item::cleanup_excluding_immutables_processor() checks for this flag
to see ... |
SYSCALL_DEFINE1(exit, int, error_code)
{
do_exit((error_code&0xff)<<8);
} | 0 | [
"CWE-200",
"CWE-284"
] | linux | 6c85501f2fabcfc4fc6ed976543d252c4eaf4be9 | 85,942,578,398,519,830,000,000,000,000,000,000,000 | 4 | fix infoleak in waitid(2)
kernel_waitid() can return a PID, an error or 0. rusage is filled in the first
case and waitid(2) rusage should've been copied out exactly in that case, *not*
whenever kernel_waitid() has not returned an error. Compat variant shares that
braino; none of kernel_wait4() callers do, so the bel... |
virDomainSetMetadata(virDomainPtr domain,
int type,
const char *metadata,
const char *key,
const char *uri,
unsigned int flags)
{
virConnectPtr conn;
VIR_DOMAIN_DEBUG(domain,
"type=%d, ... | 0 | [
"CWE-254"
] | libvirt | 506e9d6c2d4baaf580d489fff0690c0ff2ff588f | 56,034,529,472,827,050,000,000,000,000,000,000,000 | 59 | virDomainGetTime: Deny on RO connections
We have a policy that if API may end up talking to a guest agent
it should require RW connection. We don't obey the rule in
virDomainGetTime().
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> |
int nft_validate_data_load(const struct nft_ctx *ctx, enum nft_registers reg,
const struct nft_data *data,
enum nft_data_types type)
{
int err;
switch (reg) {
case NFT_REG_VERDICT:
if (data == NULL || type != NFT_DATA_VERDICT)
return -EINVAL;
if (data->verdict == NFT_GOTO || data->verdict == NFT... | 0 | [
"CWE-19"
] | nf | a2f18db0c68fec96631c10cad9384c196e9008ac | 302,750,533,944,285,000,000,000,000,000,000,000,000 | 30 | netfilter: nf_tables: fix flush ruleset chain dependencies
Jumping between chains doesn't mix well with flush ruleset. Rules
from a different chain and set elements may still refer to us.
[ 353.373791] ------------[ cut here ]------------
[ 353.373845] kernel BUG at net/netfilter/nf_tables_api.c:1159!
[ 353.373896... |
ModuleExport size_t RegisterPSDImage(void)
{
MagickInfo
*entry;
entry=AcquireMagickInfo("PSD","PSB","Adobe Large Document Format");
entry->decoder=(DecodeImageHandler *) ReadPSDImage;
entry->encoder=(EncodeImageHandler *) WritePSDImage;
entry->magick=(IsImageFormatHandler *) IsPSD;
entry->flags|=CoderD... | 0 | [
"CWE-772"
] | ImageMagick | d4e8b9722577547177a2daecee98ea9e5fe54968 | 269,835,955,450,076,140,000,000,000,000,000,000,000 | 21 | Fixed memory leak reported in #462. |
Repetition(const std::shared_ptr<Ope> &ope, size_t min, size_t max)
: ope_(ope), min_(min), max_(max) {} | 0 | [
"CWE-125"
] | cpp-peglib | b3b29ce8f3acf3a32733d930105a17d7b0ba347e | 166,049,266,410,593,820,000,000,000,000,000,000,000 | 2 | Fix #122 |
inline T hypot(const T x, const T y, const T z) {
return std::sqrt(x*x + y*y + z*z);
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 104,112,492,835,473,020,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. |
void ipxitf_down(struct ipx_interface *intrfc)
{
spin_lock_bh(&ipx_interfaces_lock);
__ipxitf_down(intrfc);
spin_unlock_bh(&ipx_interfaces_lock);
} | 0 | [
"CWE-416"
] | linux | ee0d8d8482345ff97a75a7d747efc309f13b0d80 | 314,395,366,266,803,900,000,000,000,000,000,000,000 | 6 | ipx: call ipxitf_put() in ioctl error path
We should call ipxitf_put() if the copy_to_user() fails.
Reported-by: 李强 <liqiang6-s@360.cn>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net> |
struct dentry *lock_rename(struct dentry *p1, struct dentry *p2)
{
struct dentry *p;
if (p1 == p2) {
mutex_lock_nested(&p1->d_inode->i_mutex, I_MUTEX_PARENT);
return NULL;
}
mutex_lock(&p1->d_inode->i_sb->s_vfs_rename_mutex);
for (p = p1; p->d_parent != p; p = p->d_parent) {
if (p->d_parent == p2) {
mu... | 0 | [
"CWE-120"
] | linux-2.6 | d70b67c8bc72ee23b55381bd6a884f4796692f77 | 216,054,640,570,691,600,000,000,000,000,000,000,000 | 31 | [patch] vfs: fix lookup on deleted directory
Lookup can install a child dentry for a deleted directory. This keeps
the directory dentry alive, and the inode pinned in the cache and on
disk, even after all external references have gone away.
This isn't a big problem normally, since memory pressure or umount
will clea... |
hb_set_intersect (hb_set_t *set,
const hb_set_t *other)
{
if (unlikely (hb_object_is_immutable (set)))
return;
set->intersect (*other);
} | 1 | [
"CWE-787"
] | harfbuzz | d3e09bf4654fe5478b6dbf2b26ebab6271317d81 | 18,484,642,144,351,567,000,000,000,000,000,000,000 | 8 | [set] Make all operators null-safe again
Changed my mind.
Also for hb_map_clear().
Part of https://github.com/harfbuzz/harfbuzz/pull/3162 |
signed_with_key(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
dns_rdatatype_t type, dst_key_t *key)
{
isc_result_t result;
dns_rdataset_t rdataset;
dns_rdata_t rdata = DNS_RDATA_INIT;
dns_rdata_rrsig_t rrsig;
dns_rdataset_init(&rdataset);
result = dns_db_findrdataset(db, node, version, dns_rdatat... | 0 | [
"CWE-327"
] | bind9 | f09352d20a9d360e50683cd1d2fc52ccedcd77a0 | 60,155,723,772,639,080,000,000,000,000,000,000,000 | 31 | Update keyfetch_done compute_tag check
If in keyfetch_done the compute_tag fails (because for example the
algorithm is not supported), don't crash, but instead ignore the
key. |
static stf_status ikev2_parent_outI1_common(struct msg_digest *md,
struct state *st)
{
struct connection *c = st->st_connection;
int numvidtosend = 0;
/* set up reply */
init_pbs(&reply_stream, reply_buffer, sizeof(reply_buffer),
"reply packet");
/* HDR out */
{
struct isakmp_hdr hdr;
zero(&hdr... | 0 | [
"CWE-20"
] | libreswan | 2899351224fe2940aec37d7656e1e392c0fe07f0 | 316,878,063,956,977,500,000,000,000,000,000,000,000 | 143 | SECURITY: Properly handle IKEv2 I1 notification packet without KE payload |
TEST_F(RouterTest, UpstreamPerTryTimeoutExcludesNewStream) {
InSequence s;
NiceMock<Http::MockRequestEncoder> encoder;
Http::ResponseDecoder* response_decoder = nullptr;
Http::ConnectionPool::Callbacks* pool_callbacks;
EXPECT_CALL(cm_.thread_local_cluster_.conn_pool_, newStream(_, _))
.WillOnce(Invoke(... | 0 | [
"CWE-703"
] | envoy | 18871dbfb168d3512a10c78dd267ff7c03f564c6 | 292,759,407,642,811,570,000,000,000,000,000,000,000 | 59 | [1.18] CVE-2022-21655
Crash with direct_response
Signed-off-by: Otto van der Schaaf <ovanders@redhat.com> |
cmsBool _cmsRegisterMultiProcessElementPlugin(cmsContext id, cmsPluginBase* Data)
{
return RegisterTypesPlugin(id, Data,MPEPlugin);
} | 0 | [
"CWE-125"
] | Little-CMS | 5ca71a7bc18b6897ab21d815d15e218e204581e2 | 71,410,058,903,488,770,000,000,000,000,000,000,000 | 4 | Added an extra check to MLU bounds
Thanks to Ibrahim el-sayed for spotting the bug |
int tcf_action_exec(struct sk_buff *skb, struct tc_action *act,
struct tcf_result *res)
{
struct tc_action *a;
int ret = -1;
if (skb->tc_verd & TC_NCLS) {
skb->tc_verd = CLR_TC_NCLS(skb->tc_verd);
D2PRINTK("(%p)tcf_action_exec: cleared TC_NCLS in %s out %s\n",
skb, skb->input_dev ... | 0 | [
"CWE-200"
] | linux-2.6 | 9ef1d4c7c7aca1cd436612b6ca785b726ffb8ed8 | 123,764,204,150,066,640,000,000,000,000,000,000,000 | 38 | [NETLINK]: Missing initializations in dumped data
Mostly missing initialization of padding fields of 1 or 2 bytes length,
two instances of uninitialized nlmsgerr->msg of 16 bytes length.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.