func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
fr_window_attach (FrWindow *window,
GtkWidget *child,
FrWindowArea area)
{
int position;
g_return_if_fail (window != NULL);
g_return_if_fail (FR_IS_WINDOW (window));
g_return_if_fail (child != NULL);
g_return_if_fail (GTK_IS_WIDGET (child));
switch (area) {
case FR_WINDOW_AREA_MENUBAR:
pos... | 0 | [
"CWE-22"
] | file-roller | b147281293a8307808475e102a14857055f81631 | 249,005,111,616,623,580,000,000,000,000,000,000,000 | 46 | libarchive: sanitize filenames before extracting |
bool DL_Dxf::handleXRecordData(DL_CreationInterface* creationInterface) {
if (groupCode==105) {
return false;
}
if (groupCode==5) {
creationInterface->addXRecord(groupValue);
return true;
}
if (groupCode==280) {
xRecordValues = true;
return true;
}
... | 0 | [
"CWE-191"
] | qcad | 1eeffc5daf5a06cf6213ffc19e95923cdebb2eb8 | 171,582,075,555,138,770,000,000,000,000,000,000,000 | 49 | check vertexIndex which might be -1 for broken DXF |
unsigned long netdev_increment_features(unsigned long all, unsigned long one,
unsigned long mask)
{
/* If device needs checksumming, downgrade to it. */
if (all & NETIF_F_NO_CSUM && !(one & NETIF_F_NO_CSUM))
all ^= NETIF_F_NO_CSUM | (one & NETIF_F_ALL_CSUM);
else if (mask & NETIF_F_ALL_CSUM) {
/* If one dev... | 0 | [
"CWE-399"
] | linux | 6ec82562ffc6f297d0de36d65776cff8e5704867 | 339,770,263,955,882,100,000,000,000,000,000,000,000 | 29 | veth: Dont kfree_skb() after dev_forward_skb()
In case of congestion, netif_rx() frees the skb, so we must assume
dev_forward_skb() also consume skb.
Bug introduced by commit 445409602c092
(veth: move loopback logic to common location)
We must change dev_forward_skb() to always consume skb, and veth to not
double fr... |
VvcSpsUnit::VvcSpsUnit()
: VvcUnitWithProfile(),
sps_id(0),
vps_id(0),
max_sublayers_minus1(0),
chroma_format_idc(0),
pic_width_max_in_luma_samples(0),
pic_height_max_in_luma_samples(0),
bitdepth_minus8(0),
log2_max_pic_order_cnt_lsb(0),
colour_primaries(2),
... | 0 | [
"CWE-22"
] | tsMuxer | 3763dd34755a8944d903aa19578fa22cd3734165 | 209,847,288,454,028,300,000,000,000,000,000,000,000 | 26 | Fix Buffer Overflow
Fixes issue #509. |
R_API char *r_anal_var_get_constraints_readable(RAnalVar *var) {
size_t n = var->constraints.len;
if (!n) {
return NULL;
}
bool low = false, high = false;
RStrBuf sb;
r_strbuf_init (&sb);
size_t i;
for (i = 0; i < n; i += 1) {
RAnalVarConstraint *constr = r_vector_index_ptr (&var->constraints, i);
switch ... | 0 | [
"CWE-416"
] | radare2 | a7ce29647fcb38386d7439696375e16e093d6acb | 211,688,176,753,124,600,000,000,000,000,000,000,000 | 45 | Fix UAF in aaaa on arm/thumb switching ##crash
* Reported by @peacock-doris via huntr.dev
* Reproducer tests_65185
* This is a logic fix, but not the fully safe as changes in the code
can result on UAF again, to properly protect r2 from crashing we
need to break the ABI and add refcounting to RRegItem, which can't... |
static inline Status _badValue(const std::string& reason, int location) {
return Status(ErrorCodes::BadValue, reason, location);
} | 0 | [
"CWE-264"
] | mongo | 23344f8b7506df694f66999693ee3c00dfd6afae | 90,845,835,463,834,600,000,000,000,000,000,000,000 | 3 | 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 struct ldb_request *ldb_build_req_common(TALLOC_CTX *mem_ctx,
struct ldb_context *ldb,
struct ldb_control **controls,
void *context,
ldb_request_callback_t callback,
struct ldb_request *parent)
{
struct ldb_request *req = NULL;
req = talloc_zero(mem_ctx, struct ldb_request);
if (req == NU... | 0 | [
"CWE-476"
] | samba | d8b9bb274b7e7a390cf3bda9cd732cb2227bdbde | 73,748,533,909,616,730,000,000,000,000,000,000,000 | 35 | CVE-2020-10730: lib ldb: Check if ldb_lock_backend_callback called twice
Prevent use after free issues if ldb_lock_backend_callback is called
twice, usually due to ldb_module_done being called twice. This can happen if a
module ignores the return value from function a function that calls
ldb_module_done as part of it'... |
static av_always_inline float flt16_trunc(float pf)
{
union av_intfloat32 pun;
pun.f = pf;
pun.i &= 0xFFFF0000U;
return pun.f;
} | 0 | [
"CWE-703"
] | FFmpeg | 6e42ccb9dbc13836cd52cda594f819d17af9afa2 | 1,482,391,283,458,890,000,000,000,000,000,000,000 | 7 | avcodec/aacdec: Fix pulse position checks in decode_pulses()
Fixes out of array read
Fixes: asan_static-oob_1efed25_1887_cov_2013541199_HeyYa_RA10_AAC_192K_30s.rm
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> |
static inline void untrack_pfn_vma(struct vm_area_struct *vma,
unsigned long pfn, unsigned long size)
{
} | 0 | [
"CWE-264"
] | linux-2.6 | 1a5a9906d4e8d1976b701f889d8f35d54b928f25 | 245,998,064,992,925,950,000,000,000,000,000,000,000 | 4 | 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(... |
qemuProcessRecoverMigrationOut(virQEMUDriverPtr driver,
virDomainObjPtr vm,
const qemuDomainJobObj *job,
virDomainState state,
int reason,
unsigned int *stopFlags)
{... | 0 | [
"CWE-416"
] | libvirt | 1ac703a7d0789e46833f4013a3876c2e3af18ec7 | 277,570,368,626,705,900,000,000,000,000,000,000,000 | 94 | qemu: Add missing lock in qemuProcessHandleMonitorEOF
qemuMonitorUnregister will be called in multiple threads (e.g. threads
in rpc worker pool and the vm event thread). In some cases, it isn't
protected by the monitor lock, which may lead to call g_source_unref
more than one time and a use-after-free problem eventua... |
des (guint32 ks[16][2], unsigned char block[8])
{
guint32 left,right,work;
/* Read input block and place in left/right in big-endian order */
left = ((guint32)block[0] << 24)
| ((guint32)block[1] << 16)
| ((guint32)block[2] << 8)
| (guint32)block[3];
right = ((guint32)block[4] << 24)
| ((guint32)block[5] ... | 0 | [
"CWE-125"
] | libsoup | f8a54ac85eec2008c85393f331cdd251af8266ad | 33,995,691,380,389,453,000,000,000,000,000,000,000 | 89 | NTLM: Avoid a potential heap buffer overflow in v2 authentication
Check the length of the decoded v2 challenge before attempting to
parse it, to avoid reading past it.
Fixes #173 |
static void test_prepare_syntax()
{
MYSQL_STMT *stmt;
int rc;
char query[MAX_TEST_QUERY_LENGTH];
myheader("test_prepare_syntax");
rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_prepare_syntax");
myquery(rc);
rc= mysql_query(mysql, "CREATE TABLE test_prepare_syntax("
"... | 0 | [
"CWE-416"
] | mysql-server | 4797ea0b772d5f4c5889bc552424132806f46e93 | 45,685,139,694,538,320,000,000,000,000,000,000,000 | 27 | BUG#17512527: LIST HANDLING INCORRECT IN MYSQL_PRUNE_STMT_LIST()
Analysis:
---------
Invalid memory access maybe observed when using prepared statements if:
a) The mysql client connection is lost after statement preparation
is complete and
b) There is at least one statement which is in initialized state but
not ... |
void manager_next_dns_server(Manager *m) {
assert(m);
/* If there's currently no DNS server set, then the next
* manager_get_dns_server() will find one */
if (!m->current_dns_server)
return;
/* Change to the next one, but make sure to follow the linked
... | 0 | [
"CWE-416"
] | systemd | 904dcaf9d4933499f8334859f52ea8497f2d24ff | 169,059,558,952,615,070,000,000,000,000,000,000,000 | 22 | resolved: take particular care when detaching DnsServer from its default stream
DnsStream and DnsServer have a symbiotic relationship: one DnsStream is
the current "default" stream of the server (and thus reffed by it), but
each stream also refs the server it is connected to. This cyclic
dependency can result in weird... |
bool write_magic(rzip_control *control)
{
char magic[MAGIC_LEN] = {
'L', 'R', 'Z', 'I', LRZIP_MAJOR_VERSION, LRZIP_MINOR_VERSION
};
/* File size is stored as zero for streaming STDOUT blocks when the
* file size is unknown. In encrypted files, the size is left unknown
* and instead the salt is stored here t... | 0 | [
"CWE-703"
] | lrzip | 4b3942103b57c639c8e0f31d6d5fd7bac53bbdf4 | 202,629,302,871,431,320,000,000,000,000,000,000,000 | 42 | Fix possible race condition between zpaq_decompress_buf() and clear_rulist() function as reported by wcventure. |
static int peer_recv_callback(rdpTransport* transport, wStream* s, void* extra)
{
freerdp_peer* client = (freerdp_peer*) extra;
rdpRdp* rdp = client->context->rdp;
switch (rdp->state)
{
case CONNECTION_STATE_INITIAL:
if (!rdp_server_accept_nego(rdp, s))
return -1;
if (rdp->nego->selected_protocol & PR... | 1 | [
"CWE-476",
"CWE-125"
] | FreeRDP | 0773bb9303d24473fe1185d85a424dfe159aff53 | 111,656,150,449,925,220,000,000,000,000,000,000,000 | 88 | nla: invalidate sec handle after creation
If sec pointer isn't invalidated after creation it is not possible
to check if the upper and lower pointers are valid.
This fixes a segfault in the server part if the client disconnects before
the authentication was finished. |
static int multipath_end_io(struct dm_target *ti, struct request *clone,
int error, union map_info *map_context)
{
struct multipath *m = ti->private;
struct dm_mpath_io *mpio = map_context->ptr;
struct pgpath *pgpath = mpio->pgpath;
struct path_selector *ps;
int r;
r = do_end_io(m, clone, error, mpio);
... | 0 | [
"CWE-284",
"CWE-264"
] | linux | ec8013beddd717d1740cfefb1a9b900deef85462 | 191,085,838,350,381,740,000,000,000,000,000,000,000 | 19 | dm: do not forward ioctls from logical volumes to the underlying device
A logical volume can map to just part of underlying physical volume.
In this case, it must be treated like a partition.
Based on a patch from Alasdair G Kergon.
Cc: Alasdair G Kergon <agk@redhat.com>
Cc: dm-devel@redhat.com
Signed-off-by: Paolo ... |
set_bpp(gx_device *pdev, int bits_per_pixel)
{ gx_device_color_info *ci = &pdev->color_info;
/* Only valid bits-per-pixel are 1, 3, 8, 16, 24, 32 */
int bpp = bits_per_pixel < 3 ? 1 : bits_per_pixel < 8 ? 3 :
(bits_per_pixel >> 3) << 3;
ci->num_components = ((bpp == 1) || (bpp == 8) ? 1 : 3);
ci->depth = ((... | 0 | [
"CWE-120"
] | ghostpdl | 849e74e5ab450dd581942192da7101e0664fa5af | 109,785,218,618,689,100,000,000,000,000,000,000,000 | 13 | Bug 701799: avoid out-of-range array access in mj_color_correct().
Code is obscure, so this fix merely avoids out-of-range access in the simplest
way possible, without understanding what the code is trying to do.
Fixes:
./sanbin/gs -sOutputFile=tmp -sDEVICE=mj6000c ../bug-701799.pdf |
void ath9k_htc_hw_deinit(struct htc_target *target, bool hot_unplug)
{
if (target)
ath9k_htc_disconnect_device(target, hot_unplug);
} | 0 | [
"CWE-400",
"CWE-401"
] | linux | 853acf7caf10b828102d92d05b5c101666a6142b | 105,179,848,520,718,330,000,000,000,000,000,000,000 | 5 | ath9k_htc: release allocated buffer if timed out
In htc_config_pipe_credits, htc_setup_complete, and htc_connect_service
if time out happens, the allocated buffer needs to be released.
Otherwise there will be memory leak.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Kalle Valo <kvalo@code... |
bool Item_field::val_bool_result()
{
if ((null_value= result_field->is_null()))
return false;
return result_field->val_bool();
} | 0 | [
"CWE-416"
] | server | c02ebf3510850ba78a106be9974c94c3b97d8585 | 203,633,282,987,185,100,000,000,000,000,000,000,000 | 6 | MDEV-24176 Preparations
1. moved fix_vcol_exprs() call to open_table()
mysql_alter_table() doesn't do lock_tables() so it cannot win from
fix_vcol_exprs() from there. Tests affected: main.default_session
2. Vanilla cleanups and comments. |
AP_DECLARE(apr_status_t) ap_get_protocol_upgrades(conn_rec *c, request_rec *r,
server_rec *s, int report_all,
const apr_array_header_t **pupgrades)
{
apr_pool_t *pool = r? r->pool : c->pool;
core_server_config ... | 0 | [] | httpd | ecebcc035ccd8d0e2984fe41420d9e944f456b3c | 209,490,222,384,099,870,000,000,000,000,000,000,000 | 40 | Merged r1734009,r1734231,r1734281,r1838055,r1838079,r1840229,r1876664,r1876674,r1876784,r1879078,r1881620,r1887311,r1888871 from trunk:
*) core: Split ap_create_request() from ap_read_request(). [Graham Leggett]
*) core, h2: common ap_parse_request_line() and ap_check_request_header()
code. [Yann Ylavic]
... |
size_t copy_page_from_iter(struct page *page, size_t offset, size_t bytes,
struct iov_iter *i)
{
size_t skip, copy, left, wanted;
const struct iovec *iov;
char __user *buf;
void *kaddr, *to;
if (unlikely(bytes > i->count))
bytes = i->count;
if (unlikely(!bytes))
return 0;
wanted = bytes;
iov = i->iov... | 0 | [
"CWE-17"
] | linux | f0d1bec9d58d4c038d0ac958c9af82be6eb18045 | 14,159,253,334,168,097,000,000,000,000,000,000,000 | 76 | new helper: copy_page_from_iter()
parallel to copy_page_to_iter(). pipe_write() switched to it (and became
->write_iter()).
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> |
extern "C" void *SUB_MALLOC(size_t size)
{
return malloc_wrapper(size, MBED_CALLER_ADDR());
} | 0 | [
"CWE-190"
] | mbed-os | 151ebfcfc9f2383ee11ce3c771c3bf92900d6b43 | 180,290,932,701,339,230,000,000,000,000,000,000,000 | 4 | 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. |
add_interface(pcap_t *p, struct block_cursor *cursor, char *errbuf)
{
struct pcap_ng_sf *ps;
uint64_t tsresol;
uint64_t tsoffset;
int is_binary;
ps = p->priv;
/*
* Count this interface.
*/
ps->ifcount++;
/*
* Grow the array of per-interface information as necessary.
*/
if (ps->ifcount > ps->ifaces_s... | 0 | [
"CWE-20",
"CWE-703",
"CWE-770"
] | libpcap | 87d6bef033062f969e70fa40c43dfd945d5a20ab | 308,281,723,956,979,840,000,000,000,000,000,000,000 | 168 | do sanity checks on PHB header length before allocating memory. There was no fault; but doing the check results in a more consistent error |
static int bmp_read_palette(gdImagePtr im, gdIOCtxPtr infile, int count, int read_four)
{
int i;
int r, g, b, z;
for (i = 0; i < count; i++) {
if (
!gdGetByte(&b, infile) ||
!gdGetByte(&g, infile) ||
!gdGetByte(&r, infile) ||
(read_four && !gdGetByte(&z, infile))
) {
return 1;
}
i... | 0 | [
"CWE-415"
] | libgd | ac16bdf2d41724b5a65255d4c28fb0ec46bc42f5 | 165,782,468,111,929,960,000,000,000,000,000,000,000 | 21 | bmp: check return value in gdImageBmpPtr
Closes #447. |
void __skb_warn_lro_forwarding(const struct sk_buff *skb)
{
net_warn_ratelimited("%s: received packets cannot be forwarded while LRO is enabled\n",
skb->dev->name);
} | 0 | [
"CWE-416"
] | net | 36d5fe6a000790f56039afe26834265db0a3ad4c | 327,848,769,741,830,420,000,000,000,000,000,000,000 | 5 | core, nfqueue, openvswitch: Orphan frags in skb_zerocopy and handle errors
skb_zerocopy can copy elements of the frags array between skbs, but it doesn't
orphan them. Also, it doesn't handle errors, so this patch takes care of that
as well, and modify the callers accordingly. skb_tx_error() is also added to
the caller... |
V8HandleScopeFromJsHandleScope(napi_handle_scope s) {
return reinterpret_cast<HandleScopeWrapper*>(s);
} | 0 | [
"CWE-191"
] | node | 656260b4b65fec3b10f6da3fdc9f11fb941aafb5 | 150,248,591,189,799,420,000,000,000,000,000,000,000 | 3 | napi: fix memory corruption vulnerability
Fixes: https://hackerone.com/reports/784186
CVE-ID: CVE-2020-8174
PR-URL: https://github.com/nodejs-private/node-private/pull/195
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: Michael Dawson <michael_da... |
write_32(IOBUF out, u32 a)
{
iobuf_put(out, a>> 24);
iobuf_put(out, a>> 16);
iobuf_put(out, a>> 8);
return iobuf_put(out, a);
} | 0 | [
"CWE-20"
] | gnupg | 2183683bd633818dd031b090b5530951de76f392 | 132,897,541,424,163,450,000,000,000,000,000,000,000 | 7 | 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 ... |
MagickExport MagickBooleanType GammaImage(Image *image,const double gamma,
ExceptionInfo *exception)
{
#define GammaImageTag "Gamma/Image"
CacheView
*image_view;
MagickBooleanType
status;
MagickOffsetType
progress;
Quantum
*gamma_map;
register ssize_t
i;
ssize_t
y;
/*
... | 0 | [
"CWE-369"
] | ImageMagick | c5fcdea6a6ae27cf3db20c28b176e87b1a584e06 | 166,353,092,229,642,800,000,000,000,000,000,000,000 | 124 | https://github.com/ImageMagick/ImageMagick/issues/1717 |
static int xen_irq_info_pirq_setup(unsigned irq,
evtchn_port_t evtchn,
unsigned pirq,
unsigned gsi,
uint16_t domid,
unsigned char flags)
{
struct irq_info *info = info_for_irq(irq);
info->u.pirq.pirq = pirq;
info->u.pirq.gsi = gsi;
info->u.pirq.domid = domid;
info->u.pirq.flags ... | 0 | [
"CWE-400",
"CWE-703"
] | linux | e99502f76271d6bc4e374fe368c50c67a1fd3070 | 245,680,068,486,408,550,000,000,000,000,000,000,000 | 16 | xen/events: defer eoi in case of excessive number of events
In case rogue guests are sending events at high frequency it might
happen that xen_evtchn_do_upcall() won't stop processing events in
dom0. As this is done in irq handling a crash might be the result.
In order to avoid that, delay further inter-domain events... |
void wrapper_libxsmm_spmdm_compute_generic_thread(
empty_type_wrapper<float>, const libxsmm_spmdm_handle* handle, char transA,
char transB, const float* alpha, libxsmm_CSR_sparseslice* A_sparse,
const float* B, char transC, const float* beta, float* C, int block_id,
int tid, int nthreads) {
return lib... | 0 | [
"CWE-125"
] | tensorflow | e6cf28c72ba2eb949ca950d834dd6d66bb01cfae | 47,174,253,348,008,800,000,000,000,000,000,000,000 | 9 | Validate that matrix dimension sizes in SparseMatMul are positive.
PiperOrigin-RevId: 401149683
Change-Id: Ib33eafc561a39c8741ece80b2edce6d4aae9a57d |
void handleErrorResponse(StartupDetails &details) {
TRACE_POINT();
map<string, string> attributes;
while (true) {
string line;
try {
line = readMessageLine(details);
} catch (const SystemException &e) {
throwPreloaderSpawnException("An error occurred while starting up "
"the preloade... | 0 | [] | passenger | 8c6693e0818772c345c979840d28312c2edd4ba4 | 57,020,419,028,271,680,000,000,000,000,000,000,000 | 76 | Security check socket filenames reported by spawned application processes. |
setup_subexp_call(Node* node, ScanEnv* env)
{
int type;
int r = 0;
type = NTYPE(node);
switch (type) {
case NT_LIST:
do {
r = setup_subexp_call(NCAR(node), env);
} while (r == 0 && IS_NOT_NULL(node = NCDR(node)));
break;
case NT_ALT:
do {
r = setup_subexp_call(NCAR(node), env);... | 0 | [
"CWE-125"
] | php-src | c6e34d91b88638966662caac62c4d0e90538e317 | 69,771,773,339,560,410,000,000,000,000,000,000,000 | 106 | Fix bug #77371 (heap buffer overflow in mb regex functions - compile_string_node) |
xps_decode_font_char(xps_font_t *font, int code)
{
int gid = xps_decode_font_char_imp(font, code);
if (gid == 0)
return code;
return gid;
} | 0 | [
"CWE-125"
] | ghostpdl | d2ab84732936b6e7e5a461dc94344902965e9a06 | 269,719,922,887,834,440,000,000,000,000,000,000,000 | 7 | Bug 698025: validate offsets reading TTF name table in xps |
newVar5(char *var,char *var2, char *var3,char *var4,char *var5)
{
struct SWF_ACTIONPUSHPARAM *v;
v=malloc(sizeof(struct SWF_ACTIONPUSHPARAM));
v->Type = PUSH_VARIABLE; /* VARIABLE */
v->p.String = malloc(strlen(var)+strlen(var2)+strlen(var3)+strlen(var4)+strlen(var5)+1);
strcpy(v->p.String,var);
strcat(v->p.Stri... | 0 | [
"CWE-119",
"CWE-125"
] | libming | da9d86eab55cbf608d5c916b8b690f5b76bca462 | 96,342,347,398,673,710,000,000,000,000,000,000,000 | 14 | decompileAction: Prevent heap buffer overflow and underflow with using OpCode |
inline void FullyConnected(
const FullyConnectedParams& params, const RuntimeShape& input_shape,
const uint8* input_data, const RuntimeShape& filter_shape,
const uint8* filter_data, const RuntimeShape& bias_shape,
const int32* bias_data, const RuntimeShape& output_shape,
int16* output_data, gemmlowp... | 0 | [
"CWE-703",
"CWE-835"
] | tensorflow | dfa22b348b70bb89d6d6ec0ff53973bacb4f4695 | 309,337,754,160,323,160,000,000,000,000,000,000,000 | 9 | Prevent a division by 0 in average ops.
PiperOrigin-RevId: 385184660
Change-Id: I7affd4554f9b336fca29ac68f633232c094d0bd3 |
AsyncWrap* LibuvStreamWrap::GetAsyncWrap() {
return static_cast<AsyncWrap*>(this);
} | 0 | [
"CWE-416"
] | node | 7f178663ebffc82c9f8a5a1b6bf2da0c263a30ed | 68,494,298,958,355,960,000,000,000,000,000,000,000 | 3 | src: use unique_ptr for WriteWrap
This commit attempts to avoid a use-after-free error by using unqiue_ptr
and passing a reference to it.
CVE-ID: CVE-2020-8265
Fixes: https://github.com/nodejs-private/node-private/issues/227
PR-URL: https://github.com/nodejs-private/node-private/pull/238
Reviewed-By: Michael Dawson <... |
bool sp_block_finalize(THD *thd, const LEX_CSTRING *end_label)
{
return sp_block_finalize(thd, Lex_spblock(), end_label);
} | 0 | [
"CWE-703"
] | server | 39feab3cd31b5414aa9b428eaba915c251ac34a2 | 177,511,213,254,340,200,000,000,000,000,000,000,000 | 4 | MDEV-26412 Server crash in Item_field::fix_outer_field for INSERT SELECT
IF an INSERT/REPLACE SELECT statement contained an ON expression in the top
level select and this expression used a subquery with a column reference
that could not be resolved then an attempt to resolve this reference as
an outer reference caused... |
p11_rpc_message_write_byte_buffer (p11_rpc_message *msg,
CK_ULONG count)
{
assert (msg != NULL);
assert (msg->output != NULL);
/* Make sure this is in the right order */
assert (!msg->signature || p11_rpc_message_verify_part (msg, "fy"));
p11_rpc_buffer_add_uint32 (msg->output, ... | 0 | [
"CWE-787"
] | p11-kit | 2617f3ef888e103324a28811886b99ed0a56346d | 88,330,509,090,438,050,000,000,000,000,000,000,000 | 11 | Check attribute length against buffer size
If an attribute's length does not match the length of the byte array
inside it, one length was used for allocation, and the other was used
for memcpy. This additional check will instead return an error on
malformed messages. |
static const char *skip(const char *in) {while (in && *in && (unsigned char)*in<=32) in++; return in;} | 0 | [
"CWE-120",
"CWE-119",
"CWE-787"
] | iperf | 91f2fa59e8ed80dfbf400add0164ee0e508e412a | 45,199,464,583,163,950,000,000,000,000,000,000,000 | 1 | Fix a buffer overflow / heap corruption issue that could occur if a
malformed JSON string was passed on the control channel. This issue,
present in the cJSON library, was already fixed upstream, so was
addressed here in iperf3 by importing a newer version of cJSON (plus
local ESnet modifications).
Discovered and repo... |
method_encode_methodspec (MonoDynamicImage *assembly, MonoMethod *method)
{
MonoDynamicTable *table;
guint32 *values;
guint32 token, mtoken = 0, sig;
MonoMethodInflated *imethod;
MonoMethod *declaring;
table = &assembly->tables [MONO_TABLE_METHODSPEC];
g_assert (method->is_inflated);
imethod = (MonoMethodInfl... | 0 | [
"CWE-20"
] | mono | 4905ef1130feb26c3150b28b97e4a96752e0d399 | 18,943,728,310,283,443,000,000,000,000,000,000,000 | 45 | Handle invalid instantiation of generic methods.
* verify.c: Add new function to internal verifier API to check
method instantiations.
* reflection.c (mono_reflection_bind_generic_method_parameters):
Check the instantiation before returning it.
Fixes #655847 |
int user_path_at_empty(int dfd, const char __user *name, unsigned flags,
struct path *path, int *empty)
{
return filename_lookup(dfd, getname_flags(name, flags, empty),
flags, path, NULL);
} | 0 | [
"CWE-284"
] | linux | 9409e22acdfc9153f88d9b1ed2bd2a5b34d2d3ca | 56,294,185,438,695,880,000,000,000,000,000,000,000 | 6 | vfs: rename: check backing inode being equal
If a file is renamed to a hardlink of itself POSIX specifies that rename(2)
should do nothing and return success.
This condition is checked in vfs_rename(). However it won't detect hard
links on overlayfs where these are given separate inodes on the overlayfs
layer.
Over... |
std::string& attrf(int ncid, int varId, const char * attrName, std::string& alloc)
{
size_t len = 0;
nc_inq_attlen(ncid, varId, attrName, &len);
if(len < 1)
{
alloc.clear();
return alloc;
}
alloc.resize(len);
memset(&alloc[0], 0, ... | 0 | [
"CWE-787"
] | gdal | 767e3a56144f676ca738ef8f700e0e56035bd05a | 34,542,758,954,480,340,000,000,000,000,000,000,000 | 19 | netCDF: avoid buffer overflow. master only. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=15143. Credit to OSS Fuzz |
findtags_state_init(
findtags_state_T *st,
char_u *pat,
int flags,
int mincount)
{
int mtt;
st->tag_fname = alloc(MAXPATHL + 1);
st->fp = NULL;
st->orgpat = ALLOC_ONE(pat_T);
st->orgpat->pat = pat;
st->orgpat->len = (int)STRLEN(pat);
st->orgpat->regmatch.regprog = NULL... | 0 | [
"CWE-416"
] | vim | adce965162dd89bf29ee0e5baf53652e7515762c | 239,005,441,408,733,760,000,000,000,000,000,000,000 | 51 | patch 9.0.0246: using freed memory when 'tagfunc' deletes the buffer
Problem: Using freed memory when 'tagfunc' deletes the buffer.
Solution: Make a copy of the tag name. |
static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, void (*func_p)())
{
zval *imgind;
char *file = NULL;
int file_len = 0;
long quality, basefilter;
gdImagePtr im;
int argc = ZEND_NUM_ARGS();
int q = -1, i;
int f = -1;
gdIOCtx *ctx = NULL;
zval *to_zval = NULL;
php_strea... | 0 | [
"CWE-20"
] | php-src | 1daa4c0090b7cd8178dcaa96287234c69ac6ca18 | 76,720,363,723,816,430,000,000,000,000,000,000,000 | 124 | Fix bug #67730 - Null byte injection possible with imagexxx functions |
tsize_t t2p_write_pdf_xobject_icccs_stream(T2P* t2p, TIFF* output){
tsize_t written=0;
written += t2p_write_pdf_stream(
(tdata_t) t2p->tiff_iccprofile,
(tsize_t) t2p->tiff_iccprofilelength,
output);
return(written);
} | 0 | [
"CWE-787"
] | libtiff | 7be2e452ddcf6d7abca88f41d3761e6edab72b22 | 273,652,284,977,890,840,000,000,000,000,000,000,000 | 11 | tiff2pdf.c: properly calculate datasize when saving to JPEG YCbCr
fixes #220 |
static int bgp_open_receive(struct peer *peer, bgp_size_t size)
{
int ret;
uint8_t version;
uint16_t optlen;
uint16_t holdtime;
uint16_t send_holdtime;
as_t remote_as;
as_t as4 = 0, as4_be;
struct in_addr remote_id;
int mp_capability;
uint8_t notify_data_remote_as[2];
uint8_t notify_data_remote_as4[4];
uint... | 0 | [
"CWE-125"
] | frr | ff6db1027f8f36df657ff2e5ea167773752537ed | 185,326,261,649,936,770,000,000,000,000,000,000,000 | 358 | bgpd: Make sure hdr length is at a minimum of what is expected
Ensure that if the capability length specified is enough data.
Signed-off-by: Donald Sharp <sharpd@nvidia.com> |
jwks_t * r_jwe_get_jwks_privkey(jwe_t * jwe) {
if (jwe != NULL) {
return r_jwks_copy(jwe->jwks_privkey);
} else {
return NULL;
}
} | 0 | [
"CWE-787"
] | rhonabwy | b4c2923a1ba4fabf9b55a89244127e153a3e549b | 99,725,046,567,291,100,000,000,000,000,000,000,000 | 7 | Fix buffer overflow on r_jwe_aesgcm_key_unwrap |
main(int argc, char** argv)
{
if (argc < 2) {
PrintUsageAndExit();
}
// default options
Options.input = NULL;
Options.verbose = false;
Options.hls_version = 0;
Options.pmt_pid = 0x100;
... | 0 | [
"CWE-703"
] | Bento4 | 33331ce2d35d45d855af7441db6116b4a9e2b70f | 129,332,495,704,714,030,000,000,000,000,000,000,000 | 725 | fix #691 |
static void fill_dynamic_entries(ELFOBJ *bin, ut64 loaded_offset, ut64 dyn_size) {
Elf_(Dyn) d = {0};
size_t i;
size_t number_of_entries = get_maximum_number_of_dynamic_entries(dyn_size);
for (i = 0; i < number_of_entries; i++) {
ut64 entry_offset = loaded_offset + i * sizeof (Elf_(Dyn));
if (!fill_dynamic_ent... | 0 | [
"CWE-787"
] | radare2 | 3ecdbf8e21186a9c5a4d3cfa3b1e9fd27045340e | 211,524,705,220,984,830,000,000,000,000,000,000,000 | 107 | Fix 4 byte oobread in msp430 disassembler ##crash
* Only crashes with asan builds
* Add missing =SN register
* Reported by cnitlrt via huntrdev
* BountyID: 1c22055b-b015-47a8-a57b-4982978751d0 |
static int kvm_s390_get_machine_feat(struct kvm *kvm,
struct kvm_device_attr *attr)
{
struct kvm_s390_vm_cpu_feat data;
bitmap_copy((unsigned long *) data.feat,
kvm_s390_available_cpu_feat,
KVM_S390_VM_CPU_FEAT_NR_BITS);
if (copy_to_user((void __user *)attr->addr, &data, sizeof(data)))
return... | 0 | [
"CWE-416"
] | linux | 0774a964ef561b7170d8d1b1bfe6f88002b6d219 | 249,002,563,414,450,200,000,000,000,000,000,000,000 | 16 | KVM: Fix out of range accesses to memslots
Reset the LRU slot if it becomes invalid when deleting a memslot to fix
an out-of-bounds/use-after-free access when searching through memslots.
Explicitly check for there being no used slots in search_memslots(), and
in the caller of s390's approximation variant.
Fixes: 369... |
SWFInput_getUInt32_BE(SWFInput input)
{
unsigned long num = SWFInput_getChar(input) << 24;
num += SWFInput_getChar(input) << 16;
num += SWFInput_getChar(input) << 8;
num += SWFInput_getChar(input);
return num;
} | 0 | [
"CWE-190",
"CWE-703"
] | libming | a009a38dce1d9316cad1ab522b813b1d5ba4c62a | 228,885,756,838,796,730,000,000,000,000,000,000,000 | 8 | Fix left shift of a negative value in SWFInput_readSBits. Check for number before before left-shifting by (number-1). |
static void test_modules()
{
assert_true_rule(
"import \"tests\" \
rule test { \
condition: tests.constants.one + 1 == tests.constants.two \
}",
NULL);
assert_true_rule(
"import \"tests\" \
rule test { \
condition: tests.constants.foo == \"foo\" \
}",
... | 0 | [
"CWE-476",
"CWE-703",
"CWE-125"
] | yara | 3119b232c9c453c98d8fa8b6ae4e37ba18117cd4 | 252,434,651,152,945,200,000,000,000,000,000,000,000 | 140 | re_lexer: Make reading escape sequences more robust (#586)
* Add test for issue #503
* re_lexer: Make reading escape sequences more robust
This commit fixes parsing incomplete escape sequences at the end of a
regular expression and parsing things like \xxy (invalid hex digits)
which before were silently turned... |
long FileIo::write(BasicIo& src)
{
assert(p_->fp_ != 0);
if (static_cast<BasicIo*>(this) == &src) return 0;
if (!src.isopen()) return 0;
if (p_->switchMode(Impl::opWrite) != 0) return 0;
byte buf[4096];
long readCount = 0;
long writeTotal = 0;
whi... | 0 | [
"CWE-190"
] | exiv2 | c73d1e27198a389ce7caf52ac30f8e2120acdafd | 117,841,147,715,865,500,000,000,000,000,000,000,000 | 22 | Avoid negative integer overflow when `filesize < io_->tell()`.
This fixes #791. |
int qcow2_expand_zero_clusters(BlockDriverState *bs)
{
BDRVQcowState *s = bs->opaque;
uint64_t *l1_table = NULL;
uint64_t nb_clusters;
uint8_t *expanded_clusters;
int ret;
int i, j;
nb_clusters = size_to_clusters(s, bs->file->total_sectors *
BDRV_SECTOR_SI... | 0 | [
"CWE-190"
] | qemu | cab60de930684c33f67d4e32c7509b567f8c445b | 311,184,642,186,478,320,000,000,000,000,000,000,000 | 61 | qcow2: Fix new L1 table size check (CVE-2014-0143)
The size in bytes is assigned to an int later, so check that instead of
the number of entries.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> |
void blosc_init(void) {
/* Return if Blosc is already initialized */
if (g_initlib) return;
pthread_mutex_init(&global_comp_mutex, NULL);
/* Create a global context */
g_global_context = (blosc2_context*)my_malloc(sizeof(blosc2_context));
memset(g_global_context, 0, sizeof(blosc2_context));
g_global_cont... | 0 | [
"CWE-787"
] | c-blosc2 | c4c6470e88210afc95262c8b9fcc27e30ca043ee | 246,882,575,883,981,270,000,000,000,000,000,000,000 | 12 | Fixed asan heap buffer overflow when not enough space to write compressed block size. |
TIFFjpeg_output_message(j_common_ptr cinfo)
{
char buffer[JMSG_LENGTH_MAX];
(*cinfo->err->format_message) (cinfo, buffer);
TIFFWarningExt(((JPEGState *) cinfo)->tif->tif_clientdata, "JPEGLib", "%s", buffer);
} | 0 | [
"CWE-369"
] | libtiff | 47f2fb61a3a64667bce1a8398a8fcb1b348ff122 | 240,726,406,820,383,300,000,000,000,000,000,000,000 | 7 | * libtiff/tif_jpeg.c: avoid integer division by zero in
JPEGSetupEncode() when horizontal or vertical sampling is set to 0.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2653 |
static u8 __rawqp1_to_ib_wc_status(u8 qstatus)
{
switch (qstatus) {
case CQ_RES_RAWETH_QP1_STATUS_OK:
return IB_WC_SUCCESS;
case CQ_RES_RAWETH_QP1_STATUS_LOCAL_ACCESS_ERROR:
return IB_WC_LOC_ACCESS_ERR;
case CQ_RES_RAWETH_QP1_STATUS_HW_LOCAL_LENGTH_ERR:
return IB_WC_LOC_LEN_ERR;
case CQ_RES_RAWETH_QP1_STATUS... | 0 | [
"CWE-400",
"CWE-401"
] | linux | 4a9d46a9fe14401f21df69cea97c62396d5fb053 | 303,555,102,015,358,780,000,000,000,000,000,000,000 | 23 | RDMA: Fix goto target to release the allocated memory
In bnxt_re_create_srq(), when ib_copy_to_udata() fails allocated memory
should be released by goto fail.
Fixes: 37cb11acf1f7 ("RDMA/bnxt_re: Add SRQ support for Broadcom adapters")
Link: https://lore.kernel.org/r/20190910222120.16517-1-navid.emamdoost@gmail.com
Si... |
parse_bdf(char *s, int *bus, int *dev, int *func, int base)
{
char *s_bus, *s_dev, *s_func;
char *str, *cp;
int ret = 0;
str = cp = strdup(s);
bus ? *bus = 0 : 0;
dev ? *dev = 0 : 0;
func ? *func = 0 : 0;
s_bus = s_dev = s_func = NULL;
s_dev = strsep(&cp, ":/.");
if (cp) {
s_func = strsep(&cp, ":/.");
if... | 0 | [
"CWE-617",
"CWE-703"
] | acrn-hypervisor | 6199e653418eda58cd698d8769820904453e2535 | 225,797,554,482,391,600,000,000,000,000,000,000,000 | 31 | dm: validate the input in 'pci_emul_mem_handler()'
checking the inputs explicitly instead of using Assert.
Tracked-On: #4003
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Reviewed-by: Shuo Liu <shuo.a.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com> |
MONGO_EXPORT int mongo_cmd_add_user( mongo *conn, const char *db, const char *user, const char *pass ) {
bson user_obj;
bson pass_obj;
char hex_digest[33];
char *ns = bson_malloc( strlen( db ) + strlen( ".system.users" ) + 1 );
int res;
strcpy( ns, db );
strcpy( ns+strlen( db ), ".system.us... | 0 | [
"CWE-190"
] | mongo-c-driver-legacy | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | 42,881,559,922,503,650,000,000,000,000,000,000,000 | 30 | don't mix up int and size_t (first pass to fix that) |
RSA *d2i_RSA_PUBKEY_bio(BIO *bp, RSA **rsa)
{
return ASN1_d2i_bio_of(RSA,RSA_new,d2i_RSA_PUBKEY,bp,rsa);
} | 0 | [
"CWE-310"
] | openssl | 684400ce192dac51df3d3e92b61830a6ef90be3e | 251,852,865,752,545,050,000,000,000,000,000,000,000 | 4 | Fix various certificate fingerprint issues.
By using non-DER or invalid encodings outside the signed portion of a
certificate the fingerprint can be changed without breaking the signature.
Although no details of the signed portion of the certificate can be changed
this can cause problems with some applications: e.g. t... |
//! Unroll pixel values along axis \c y \newinstance.
CImg<T> get_vector() const {
return get_unroll('y'); | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 165,629,102,701,408,320,000,000,000,000,000,000,000 | 3 | Fix other issues in 'CImg<T>::load_bmp()'. |
ms_escher_read_Dg (MSEscherState *state, MSEscherHeader *h)
{
#if 0
guint8 const *data = h->data + COMMON_HEADER_LEN;
guint32 num_shapes = GSF_LE_GET_GUINT32(data);
/* spid_cur = last SPID given to an SP in this DG :-) */
guint32 spid_cur = GSF_LE_GET_GUINT32(data+4);
guint32 drawing_id = h->instance;
/* This... | 0 | [
"CWE-119"
] | gnumeric | b5480b69345b3c6d56ee0ed9c9e9880bb2a08cdc | 169,836,096,389,482,950,000,000,000,000,000,000,000 | 14 | xls: fuzzed file crash. |
kssl_krb5_free_ticket(krb5_context con,
krb5_ticket * kt)
{
if (!krb5_loaded)
load_krb5_dll();
if ( p_krb5_free_ticket )
return(p_krb5_free_ticket(con,kt));
else
return KRB5KRB_ERR_GENERIC;
} | 0 | [
"CWE-20"
] | openssl | cca1cd9a3447dd067503e4a85ebd1679ee78a48e | 184,305,589,531,691,500,000,000,000,000,000,000,000 | 11 | Submitted by: Tomas Hoger <thoger@redhat.com>
Fix for CVE-2010-0433 where some kerberos enabled versions of OpenSSL
could be crashed if the relevant tables were not present (e.g. chrooted). |
void DefragTrackerClearMemory(DefragTracker *dt)
{
DefragTrackerFreeFrags(dt);
SC_ATOMIC_DESTROY(dt->use_cnt);
} | 0 | [
"CWE-358"
] | suricata | 4a04f814b15762eb446a5ead4d69d021512df6f8 | 27,467,649,532,296,500,000,000,000,000,000,000,000 | 5 | defrag - take protocol into account during re-assembly
The IP protocol was not being used to match fragments with
their packets allowing a carefully constructed packet
with a different protocol to be matched, allowing re-assembly
to complete, creating a packet that would not be re-assembled
by the destination host. |
static int device_path_cmp(gconstpointer a, gconstpointer b)
{
const struct btd_device *device = a;
const char *path = b;
const char *dev_path = device_get_path(device);
return strcasecmp(dev_path, path);
} | 0 | [
"CWE-862",
"CWE-863"
] | bluez | b497b5942a8beb8f89ca1c359c54ad67ec843055 | 181,625,174,462,505,040,000,000,000,000,000,000,000 | 8 | adapter: Fix storing discoverable setting
discoverable setting shall only be store when changed via Discoverable
property and not when discovery client set it as that be considered
temporary just for the lifetime of the discovery. |
static int fq_init(struct fq *fq, int flows_cnt)
{
int i;
memset(fq, 0, sizeof(fq[0]));
INIT_LIST_HEAD(&fq->backlogs);
spin_lock_init(&fq->lock);
fq->flows_cnt = max_t(u32, flows_cnt, 1);
fq->perturbation = prandom_u32();
fq->quantum = 300;
fq->limit = 8192;
fq->memory_limit = 16 << 20; /* 16 MBytes */
fq->... | 1 | [
"CWE-330"
] | linux | 55667441c84fa5e0911a0aac44fb059c15ba6da2 | 69,011,727,157,688,110,000,000,000,000,000,000,000 | 22 | net/flow_dissector: switch to siphash
UDP IPv6 packets auto flowlabels are using a 32bit secret
(static u32 hashrnd in net/core/flow_dissector.c) and
apply jhash() over fields known by the receivers.
Attackers can easily infer the 32bit secret and use this information
to identify a device and/or user, since this 32bi... |
handle_server_shutdown_cookie_sha1_mech (DBusAuth *auth)
{
auth->cookie_id = -1;
_dbus_string_set_length (&auth->challenge, 0);
} | 0 | [
"CWE-59"
] | dbus | 47b1a4c41004bf494b87370987b222c934b19016 | 242,996,392,597,810,500,000,000,000,000,000,000,000 | 5 | auth: Reject DBUS_COOKIE_SHA1 for users other than the server owner
The DBUS_COOKIE_SHA1 authentication mechanism aims to prove ownership
of a shared home directory by having the server write a secret "cookie"
into a .dbus-keyrings subdirectory of the desired identity's home
directory with 0700 permissions, and having... |
slice_parse_ref_pic_list_modification_1 (GstH264SliceHdr * slice,
NalReader * nr, guint list, gboolean is_mvc)
{
GstH264RefPicListModification *entries;
guint8 *ref_pic_list_modification_flag, *n_ref_pic_list_modification;
guint32 modification_of_pic_nums_idc;
gsize max_entries;
guint i = 0;
if (list =... | 0 | [
"CWE-787"
] | gst-plugins-bad | 11353b3f6e2f047cc37483d21e6a37ae558896bc | 140,511,572,656,405,660,000,000,000,000,000,000,000 | 50 | codecparsers: h264parser: guard against ref_pic_markings overflow
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1703> |
builtin_bin(PyObject *module, PyObject *number)
/*[clinic end generated code: output=b6fc4ad5e649f4f7 input=53f8a0264bacaf90]*/
{
return PyNumber_ToBase(number, 2);
} | 0 | [
"CWE-125"
] | cpython | dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c | 130,137,353,731,092,180,000,000,000,000,000,000,000 | 5 | bpo-35766: Merge typed_ast back into CPython (GH-11645) |
static void __exit macvlan_cleanup_module(void)
{
rtnl_link_unregister(&macvlan_link_ops);
unregister_netdevice_notifier(&macvlan_notifier_block);
} | 0 | [
"CWE-703",
"CWE-264"
] | linux | 550fd08c2cebad61c548def135f67aba284c6162 | 151,405,351,703,560,860,000,000,000,000,000,000,000 | 5 | net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared
After the last patch, We are left in a state in which only drivers calling
ether_setup have IFF_TX_SKB_SHARING set (we assume that drivers touching real
hardware call ether_setup for their net_devices and don't hold any state in
their skbs. There... |
int ber_write_integer(wStream* s, UINT32 value)
{
ber_write_universal_tag(s, BER_TAG_INTEGER, FALSE);
if (value <= 0xFF)
{
ber_write_length(s, 1);
Stream_Write_UINT8(s, value);
return 2;
}
else if (value < 0xFF80)
{
ber_write_length(s, 2);
Stream_Write_UINT16_BE(s, value);
return 3;
}
else if (valu... | 1 | [
"CWE-476"
] | FreeRDP | 0dc22d5a30a1c7d146b2a835b2032668127c33e9 | 131,426,831,850,260,430,000,000,000,000,000,000,000 | 32 | Fixed a range of BER boundary encoding bugs which would occur when any NLA packet hit the 127 character mark. Removed ber#get_content_length as it was not behaving deterministically. |
static FITS_HDU_LIST *fits_decode_header (FITS_RECORD_LIST *hdr,
long hdr_offset, long dat_offset)
{FITS_HDU_LIST *hdulist;
FITS_DATA *fdat;
char errmsg[80], key[9];
int k, bpp, random_groups;
long mul_axis, data_size, bitpix_supported;
#define FITS_DECODE_CARD(mhdr,mkey,mfdat,mtyp) \
{st... | 0 | [
"CWE-476"
] | gimp | ace45631595e8781a1420842582d67160097163c | 207,198,596,695,855,440,000,000,000,000,000,000,000 | 195 | Bug 676804 - file handling DoS for fit file format
Apply patch from joe@reactionis.co.uk which fixes a buffer overflow on
broken/malicious fits files. |
read_2004_section_header (Bit_Chain *restrict dat, Dwg_Data *restrict dwg)
{
int error;
Bit_Chain sec_dat = { 0 };
sec_dat.opts = dwg->opts & DWG_OPTS_LOGLEVEL;
error = read_2004_compressed_section (dat, dwg, &sec_dat, SECTION_HEADER);
if (error >= DWG_ERR_CRITICAL)
{
LOG_ERROR ("Failed to read com... | 0 | [
"CWE-703",
"CWE-835"
] | libredwg | c6f6668b82bfe595899cc820279ac37bb9ef16f5 | 240,830,171,147,009,730,000,000,000,000,000,000,000 | 51 | cleanup tio.unknown
not needed anymore, we only have UNKNOWN_OBJ or UNKNOWN_ENT with full common
entity_data.
Fixes GH #178 heap_overflow2 |
static int ceph_x_proc_ticket_reply(struct ceph_auth_client *ac,
struct ceph_crypto_key *secret,
void *buf, void *end)
{
void *p = buf;
u8 reply_struct_v;
u32 num;
int ret;
ceph_decode_8_safe(&p, end, reply_struct_v, bad);
if (reply_struct_v != 1)
return -EINVAL;
ceph_decode_32_safe(&p, end, ... | 0 | [
"CWE-399",
"CWE-119"
] | linux | c27a3e4d667fdcad3db7b104f75659478e0c68d8 | 83,984,713,769,038,020,000,000,000,000,000,000,000 | 27 | libceph: do not hard code max auth ticket len
We hard code cephx auth ticket buffer size to 256 bytes. This isn't
enough for any moderate setups and, in case tickets themselves are not
encrypted, leads to buffer overflows (ceph_x_decrypt() errors out, but
ceph_decode_copy() doesn't - it's just a memcpy() wrapper). S... |
test_garbage_database (TestConnection *test,
gconstpointer data)
{
GIOStream *connection;
GError *error = NULL;
#ifdef BACKEND_IS_OPENSSL
g_test_skip ("this is not yet passing with openssl");
return;
#endif
test->database = g_tls_file_database_new (tls_test_file_path ("garbage.pem")... | 0 | [
"CWE-295"
] | glib-networking | 29513946809590c4912550f6f8620468f9836d94 | 259,828,807,596,473,300,000,000,000,000,000,000,000 | 37 | Return bad identity error if identity is unset
When the server-identity property of GTlsClientConnection is unset, the
documentation sasy we need to fail the certificate verification with
G_TLS_CERTIFICATE_BAD_IDENTITY. This is important because otherwise,
it's easy for applications to fail to specify server identity.... |
int dtls1_new(SSL *s)
{
DTLS1_STATE *d1;
if (!ssl3_new(s))
return (0);
if ((d1 = OPENSSL_malloc(sizeof *d1)) == NULL)
return (0);
memset(d1, 0, sizeof *d1);
/* d1->handshake_epoch=0; */
d1->unprocessed_rcds.q = pqueue_new();
d1->processed_rcds.q = pqueue_new();
d1->buf... | 0 | [] | openssl | 819418110b6fff4a7b96f01a5d68f71df3e3b736 | 143,969,333,240,825,830,000,000,000,000,000,000,000 | 46 | Fix Seg fault in DTLSv1_listen
The DTLSv1_listen function is intended to be stateless and processes
the initial ClientHello from many peers. It is common for user code to
loop over the call to DTLSv1_listen until a valid ClientHello is received
with an associated cookie. A defect in the implementation of DTLSv1_listen... |
GF_Err metx_Write(GF_Box *s, GF_BitStream *bs)
{
GF_MetaDataSampleEntryBox *ptr = (GF_MetaDataSampleEntryBox *)s;
GF_Err e = gf_isom_box_write_header(s, bs);
if (e) return e;
gf_bs_write_data(bs, ptr->reserved, 6);
gf_bs_write_u16(bs, ptr->dataReferenceIndex);
if (ptr->type!=GF_ISOM_BOX_TYPE_STPP) {
if (ptr->... | 0 | [
"CWE-125"
] | gpac | bceb03fd2be95097a7b409ea59914f332fb6bc86 | 66,231,233,748,067,440,000,000,000,000,000,000,000 | 46 | fixed 2 possible heap overflows (inc. #1088) |
void* Type_CrdInfo_Dup(struct _cms_typehandler_struct* self, const void *Ptr, cmsUInt32Number n)
{
return (void*) cmsMLUdup((cmsMLU*) Ptr);
cmsUNUSED_PARAMETER(n);
cmsUNUSED_PARAMETER(self);
} | 0 | [] | Little-CMS | 41d222df1bc6188131a8f46c32eab0a4d4cdf1b6 | 251,432,648,465,058,600,000,000,000,000,000,000,000 | 7 | Memory squeezing fix: lcms2 cmsPipeline construction
When creating a new pipeline, lcms would often try to allocate a stage
and pass it to cmsPipelineInsertStage without checking whether the
allocation succeeded. cmsPipelineInsertStage would then assert (or crash)
if it had not.
The fix here is to change cmsPipelineI... |
int change_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd,
unsigned long addr, pgprot_t newprot, unsigned long cp_flags)
{
struct mm_struct *mm = vma->vm_mm;
spinlock_t *ptl;
pmd_t entry;
bool preserve_write;
int ret;
bool prot_numa = cp_flags & MM_CP_PROT_NUMA;
bool uffd_wp = cp_flags & MM_CP_UFFD_WP;
bool ... | 0 | [
"CWE-362"
] | linux | c444eb564fb16645c172d550359cb3d75fe8a040 | 246,165,483,396,336,870,000,000,000,000,000,000,000 | 95 | mm: thp: make the THP mapcount atomic against __split_huge_pmd_locked()
Write protect anon page faults require an accurate mapcount to decide
if to break the COW or not. This is implemented in the THP path with
reuse_swap_page() ->
page_trans_huge_map_swapcount()/page_trans_huge_mapcount().
If the COW triggers while ... |
rgbT2rgba(UINT8 *out, int xsize, int r, int g, int b) {
#ifdef WORDS_BIGENDIAN
UINT32 trns = ((r & 0xff) << 24) | ((g & 0xff) << 16) | ((b & 0xff) << 8) | 0xff;
UINT32 repl = trns & 0xffffff00;
#else
UINT32 trns = (0xff << 24) | ((b & 0xff) << 16) | ((g & 0xff) << 8) | (r & 0xff);
UINT32 repl = trns & 0... | 0 | [
"CWE-120"
] | Pillow | 518ee3722a99d7f7d890db82a20bd81c1c0327fb | 42,450,926,668,185,613,000,000,000,000,000,000,000 | 19 | Use snprintf instead of sprintf |
TIFFjpeg_destroy(JPEGState* sp)
{
return CALLVJPEG(sp, jpeg_destroy(&sp->cinfo.comm));
} | 0 | [
"CWE-369"
] | libtiff | 47f2fb61a3a64667bce1a8398a8fcb1b348ff122 | 313,833,078,785,131,260,000,000,000,000,000,000,000 | 4 | * libtiff/tif_jpeg.c: avoid integer division by zero in
JPEGSetupEncode() when horizontal or vertical sampling is set to 0.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2653 |
static int emulator_pio_in_emulated(int size, unsigned short port, void *val,
unsigned int count, struct kvm_vcpu *vcpu)
{
if (vcpu->arch.pio.count)
goto data_avail;
trace_kvm_pio(0, port, size, 1);
vcpu->arch.pio.port = port;
vcpu->arch.pio.in = 1;
vcpu->arch.pio.count = count;
vcpu->arch.pio.size =... | 0 | [
"CWE-200"
] | kvm | 831d9d02f9522e739825a51a11e3bc5aa531a905 | 48,405,225,507,801,660,000,000,000,000,000,000,000 | 29 | KVM: x86: fix information leak to userland
Structures kvm_vcpu_events, kvm_debugregs, kvm_pit_state2 and
kvm_clock_data are copied to userland with some padding and reserved
fields unitialized. It leads to leaking of contents of kernel stack
memory. We have to initialize them to zero.
In patch v1 Jan Kiszka suggest... |
static void mobi_opf_fill_tag(const MOBIData *m, const MOBIExthHeader *exth, char ***array) {
if (*array == NULL) {
*array = calloc(OPF_META_MAX_TAGS, sizeof(**array));
if (*array == NULL) {
return;
}
}
size_t i = 0;
while (i < OPF_META_MAX_TAGS) {
/* find fir... | 0 | [
"CWE-476"
] | libmobi | c0699c8693c47f14a2e57dec7292e862ac7adf9c | 308,687,093,142,516,920,000,000,000,000,000,000,000 | 30 | Fix undefined behavior when passing null to strdup |
static noinline int push_for_double_split(struct btrfs_trans_handle *trans,
struct btrfs_root *root,
struct btrfs_path *path,
int data_size)
{
int ret;
int progress = 0;
int slot;
u32 nritems;
int space_needed = data_size;
slot = path->slots[0];
if (slot < btrfs_header_nritems(path->nodes[0... | 0 | [
"CWE-362"
] | linux | dbcc7d57bffc0c8cac9dac11bec548597d59a6a5 | 305,200,678,906,293,320,000,000,000,000,000,000,000 | 53 | btrfs: fix race when cloning extent buffer during rewind of an old root
While resolving backreferences, as part of a logical ino ioctl call or
fiemap, we can end up hitting a BUG_ON() when replaying tree mod log
operations of a root, triggering a stack trace like the following:
------------[ cut here ]------------
... |
int security_net_peersid_resolve(u32 nlbl_sid, u32 nlbl_type,
u32 xfrm_sid,
u32 *peer_sid)
{
int rc;
struct context *nlbl_ctx;
struct context *xfrm_ctx;
*peer_sid = SECSID_NULL;
/* handle the common (which also happens to be the set of easy) cases
* right away, these two if statements catch everythin... | 0 | [
"CWE-20"
] | linux | 2172fa709ab32ca60e86179dc67d0857be8e2c98 | 249,083,604,385,987,400,000,000,000,000,000,000,000 | 61 | SELinux: Fix kernel BUG on empty security contexts.
Setting an empty security context (length=0) on a file will
lead to incorrectly dereferencing the type and other fields
of the security context structure, yielding a kernel BUG.
As a zero-length security context is never valid, just reject
all such security contexts... |
void sas_ata_schedule_reset(struct domain_device *dev)
{
struct ata_eh_info *ehi;
struct ata_port *ap;
unsigned long flags;
if (!dev_is_sata(dev))
return;
ap = dev->sata_dev.ap;
ehi = &ap->link.eh_info;
spin_lock_irqsave(ap->lock, flags);
ehi->err_mask |= AC_ERR_TIMEOUT;
ehi->action |= ATA_EH_RESET;
ata_... | 0 | [
"CWE-284"
] | linux | 0558f33c06bb910e2879e355192227a8e8f0219d | 110,821,206,772,494,250,000,000,000,000,000,000,000 | 18 | scsi: libsas: direct call probe and destruct
In commit 87c8331fcf72 ("[SCSI] libsas: prevent domain rediscovery
competing with ata error handling") introduced disco mutex to prevent
rediscovery competing with ata error handling and put the whole
revalidation in the mutex. But the rphy add/remove needs to wait for the
... |
hermesBuiltinGeneratorSetDelegated(void *, Runtime *runtime, NativeArgs args) {
auto *gen = dyn_vmcast_or_null<GeneratorInnerFunction>(
runtime->getCurrentFrame().getPreviousFrame().getCalleeClosure());
if (!gen) {
return runtime->raiseTypeError(
"generatorSetDelegated can only be called as part o... | 0 | [
"CWE-787"
] | hermes | 86543ac47e59c522976b5632b8bf9a2a4583c7d2 | 291,954,936,274,588,920,000,000,000,000,000,000,000 | 10 | Added stack overflow check for hermes::vm:: hermesBuiltinApply
Summary: This adds a missing check for stack overflow.
Reviewed By: tmikov
Differential Revision: D20104955
fbshipit-source-id: 1f37e23d2e28ebcd3aa4176d134b8418e7059ebd |
int cil_resolve_name_call_args(struct cil_call *call, char *name, enum cil_sym_index sym_index, struct cil_symtab_datum **datum)
{
struct cil_list_item *item;
enum cil_sym_index param_index = CIL_SYM_UNKNOWN;
int rc = SEPOL_ERR;
if (call == NULL || name == NULL) {
goto exit;
}
if (call->args == NULL) {
goto... | 0 | [
"CWE-125"
] | selinux | 340f0eb7f3673e8aacaf0a96cbfcd4d12a405521 | 25,990,023,672,445,124,000,000,000,000,000,000,000 | 31 | libsepol/cil: Check for statements not allowed in optional blocks
While there are some checks for invalid statements in an optional
block when resolving the AST, there are no checks when building the
AST.
OSS-Fuzz found the following policy which caused a null dereference
in cil_tree_get_next_path().
(blockinherit ... |
static int reget_buffer_internal(AVCodecContext *avctx, AVFrame *frame)
{
AVFrame tmp;
int ret;
av_assert0(avctx->codec_type == AVMEDIA_TYPE_VIDEO);
if (frame->data[0] && (frame->width != avctx->width || frame->height != avctx->height || frame->format != avctx->pix_fmt)) {
av_log(avctx, AV_LOG... | 0 | [
"CWE-703"
] | FFmpeg | e5c7229999182ad1cef13b9eca050dba7a5a08da | 236,080,759,108,896,600,000,000,000,000,000,000,000 | 39 | avcodec/utils: set AVFrame format unconditional
Fixes inconsistency and out of array accesses
Fixes: 10cdd7e63e7f66e3e66273939e0863dd-asan_heap-oob_1a4ff32_7078_cov_4056274555_mov_h264_aac__mp4box_frag.mp4
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> |
m_df(union DateData *x)
{
if (simple_dat_p(x))
return 0;
else {
get_c_df(x);
return x->c.df;
}
} | 0 | [] | date | 3959accef8da5c128f8a8e2fd54e932a4fb253b0 | 122,052,493,956,822,530,000,000,000,000,000,000,000 | 9 | Add length limit option for methods that parses date strings
`Date.parse` now raises an ArgumentError when a given date string is
longer than 128. You can configure the limit by giving `limit` keyword
arguments like `Date.parse(str, limit: 1000)`. If you pass `limit: nil`,
the limit is disabled.
Not only `Date.parse`... |
static int nft_del_setelem(struct nft_ctx *ctx, struct nft_set *set,
const struct nlattr *attr)
{
struct nlattr *nla[NFTA_SET_ELEM_MAX + 1];
struct nft_set_ext_tmpl tmpl;
struct nft_set_elem elem;
struct nft_set_ext *ext;
struct nft_trans *trans;
u32 flags = 0;
int err;
err = nla_parse_nested_deprecated(... | 0 | [] | net | 520778042ccca019f3ffa136dd0ca565c486cedd | 50,918,523,694,692,920,000,000,000,000,000,000,000 | 79 | netfilter: nf_tables: disallow non-stateful expression in sets earlier
Since 3e135cd499bf ("netfilter: nft_dynset: dynamic stateful expression
instantiation"), it is possible to attach stateful expressions to set
elements.
cd5125d8f518 ("netfilter: nf_tables: split set destruction in deactivate
and destroy phase") in... |
is_in_cmdwin(void)
{
return cmdwin_type != 0 && get_cmdline_type() == NUL;
} | 0 | [
"CWE-122",
"CWE-787"
] | vim | 85b6747abc15a7a81086db31289cf1b8b17e6cb1 | 226,220,444,444,301,830,000,000,000,000,000,000,000 | 4 | patch 8.2.4214: illegal memory access with large 'tabstop' in Ex mode
Problem: Illegal memory access with large 'tabstop' in Ex mode.
Solution: Allocate enough memory. |
int ipc_msg_get_info(int id, struct msg_data **msgds)
{
FILE *f;
int i = 0, maxid, j;
struct msg_data *p;
struct msqid_ds dummy;
struct msqid_ds msgseg;
p = *msgds = xcalloc(1, sizeof(struct msg_data));
p->next = NULL;
f = fopen(_PATH_PROC_SYSV_MSG, "r");
if (!f)
goto msg_fallback;
while (fgetc(f) != '\n... | 0 | [
"CWE-190"
] | util-linux | 1c9143d0c1f979c3daf10e1c37b5b1e916c22a1c | 275,455,096,695,947,800,000,000,000,000,000,000,000 | 101 | sys-utils/ipcutils: be careful when call calloc() for uint64 nmembs
Fix: https://github.com/karelzak/util-linux/issues/1395
Signed-off-by: Karel Zak <kzak@redhat.com> |
static void *stbi__load_gif_main_outofmem(stbi__gif *g, stbi_uc *out, int **delays)
{
STBI_FREE(g->out);
STBI_FREE(g->history);
STBI_FREE(g->background);
if (out) STBI_FREE(out);
if (delays && *delays) STBI_FREE(*delays);
return stbi__errpuc("outofmem", "Out of memory");
} | 0 | [
"CWE-787"
] | stb | 5ba0baaa269b3fd681828e0e3b3ac0f1472eaf40 | 102,244,905,764,790,860,000,000,000,000,000,000,000 | 10 | 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. |
TEST_F(HttpConnectionManagerImplTest, StartAndFinishSpanNormalFlow) {
setup(false, "");
auto* span = new NiceMock<Tracing::MockSpan>();
EXPECT_CALL(*tracer_, startSpan_(_, _, _, _))
.WillOnce(
Invoke([&](const Tracing::Config& config, const HeaderMap&, const StreamInfo::StreamInfo&,
... | 0 | [
"CWE-400"
] | envoy | 0e49a495826ea9e29134c1bd54fdeb31a034f40c | 89,822,062,029,526,650,000,000,000,000,000,000,000 | 157 | 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 aa_read_packet(AVFormatContext *s, AVPacket *pkt)
{
uint8_t dst[TEA_BLOCK_SIZE];
uint8_t src[TEA_BLOCK_SIZE];
int i;
int trailing_bytes;
int blocks;
uint8_t buf[MAX_CODEC_SECOND_SIZE * 2];
int written = 0;
int ret;
AADemuxContext *c = s->priv_data;
uint64_t pos = avio_... | 0 | [
"CWE-665",
"CWE-908"
] | FFmpeg | ed188f6dcdf0935c939ed813cf8745d50742014b | 271,565,684,541,793,000,000,000,000,000,000,000,000 | 73 | avformat/aadec: Check for scanf() failure
Fixes: use of uninitialized variables
Fixes: blank.aa
Found-by: Chamal De Silva <chamal.desilva@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> |
static bool __splice_segment(struct page *page, unsigned int poff,
unsigned int plen, unsigned int *off,
unsigned int *len,
struct splice_pipe_desc *spd, bool linear,
struct sock *sk,
struct pipe_inode_info *pipe)
{
if (!*len)
return true;
/* skip this segment if already pr... | 0 | [
"CWE-703",
"CWE-125"
] | linux | 8605330aac5a5785630aec8f64378a54891937cc | 180,993,713,441,084,880,000,000,000,000,000,000,000 | 34 | tcp: fix SCM_TIMESTAMPING_OPT_STATS for normal skbs
__sock_recv_timestamp can be called for both normal skbs (for
receive timestamps) and for skbs on the error queue (for transmit
timestamps).
Commit 1c885808e456
(tcp: SOF_TIMESTAMPING_OPT_STATS option for SO_TIMESTAMPING)
assumes any skb passed to __sock_recv_timest... |
ElectronBrowserClient::CreateQuotaPermissionContext() {
return base::MakeRefCounted<ElectronQuotaPermissionContext>();
} | 0 | [] | electron | e9fa834757f41c0b9fe44a4dffe3d7d437f52d34 | 24,438,895,872,827,927,000,000,000,000,000,000,000 | 3 | fix: ensure ElectronBrowser mojo service is only bound to appropriate render frames (#33344)
* fix: ensure ElectronBrowser mojo service is only bound to authorized render frames
Notes: no-notes
* refactor: extract electron API IPC to its own mojo interface
* fix: just check main frame not primary main frame
... |
_g_file_info_create_from_entry (struct archive_entry *entry,
ExtractData *extract_data)
{
GFileInfo *info;
info = g_file_info_new ();
/* times */
if (archive_entry_mtime_is_set (entry))
g_file_info_set_attribute_uint64 (info, G_FILE_ATTRIBUTE_TIME_MODIFIED, archive_entry_mtime (entry));
/... | 0 | [
"CWE-22"
] | file-roller | 21dfcdbfe258984db89fb65243a1a888924e45a0 | 66,401,916,975,855,890,000,000,000,000,000,000,000 | 52 | libarchive: do not follow external links when extracting files
Do not extract a file if its parent is a symbolic link to a
directory external to the destination. |
static inline bool kvm_hv_vapic_assist_page_enabled(struct kvm_vcpu *vcpu)
{
return vcpu->arch.hv_vapic & HV_X64_MSR_APIC_ASSIST_PAGE_ENABLE;
} | 0 | [
"CWE-703"
] | linux | ce40cd3fc7fa40a6119e5fe6c0f2bc0eb4541009 | 289,103,151,835,079,300,000,000,000,000,000,000,000 | 4 | kvm: x86: fix kvm_apic_has_events to check for NULL pointer
Malicious (or egregiously buggy) userspace can trigger it, but it
should never happen in normal operation.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.