func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
RZ_API void rz_analysis_fcn_vars_cache_init(RzAnalysis *analysis, RzAnalysisFcnVarsCache *cache, RzAnalysisFunction *fcn) {
cache->bvars = rz_analysis_var_list(analysis, fcn, RZ_ANALYSIS_VAR_KIND_BPV);
cache->rvars = rz_analysis_var_list(analysis, fcn, RZ_ANALYSIS_VAR_KIND_REG);
cache->svars = rz_analysis_var_list(a... | 0 | [
"CWE-703"
] | rizin | 6ce71d8aa3dafe3cdb52d5d72ae8f4b95916f939 | 128,998,823,384,855,660,000,000,000,000,000,000,000 | 13 | Initialize retctx,ctx before freeing the inner elements
In rz_core_analysis_type_match retctx structure was initialized on the
stack only after a "goto out_function", where a field of that structure
was freed. When the goto path is taken, the field is not properly
initialized and it cause cause a crash of Rizin or hav... |
static int register_ftrace_profiler(void)
{
return register_ftrace_graph(&profile_graph_return,
&profile_graph_entry);
} | 0 | [
"CWE-703"
] | linux | 6a76f8c0ab19f215af2a3442870eeb5f0e81998d | 38,420,481,893,739,676,000,000,000,000,000,000,000 | 5 | tracing: Fix possible NULL pointer dereferences
Currently set_ftrace_pid and set_graph_function files use seq_lseek
for their fops. However seq_open() is called only for FMODE_READ in
the fops->open() so that if an user tries to seek one of those file
when she open it for writing, it sees NULL seq_file and then panic... |
static inline bool f2fs_time_over(struct f2fs_sb_info *sbi, int type)
{
unsigned long interval = sbi->interval_time[type] * HZ;
return time_after(jiffies, sbi->last_time[type] + interval);
} | 0 | [
"CWE-476"
] | linux | 4969c06a0d83c9c3dc50b8efcdc8eeedfce896f6 | 119,251,411,122,948,100,000,000,000,000,000,000,000 | 6 | f2fs: support swap file w/ DIO
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> |
tor_log2(uint64_t u64)
{
int r = 0;
if (u64 >= (U64_LITERAL(1)<<32)) {
u64 >>= 32;
r = 32;
}
if (u64 >= (U64_LITERAL(1)<<16)) {
u64 >>= 16;
r += 16;
}
if (u64 >= (U64_LITERAL(1)<<8)) {
u64 >>= 8;
r += 8;
}
if (u64 >= (U64_LITERAL(1)<<4)) {
u64 >>= 4;
r += 4;
}
if (u64... | 0 | [] | tor | 973c18bf0e84d14d8006a9ae97fde7f7fb97e404 | 246,820,184,626,700,340,000,000,000,000,000,000,000 | 29 | Fix assertion failure in tor_timegm.
Fixes bug 6811. |
/* kvm_io_bus_write_cookie - called under kvm->slots_lock */
int kvm_io_bus_write_cookie(struct kvm_vcpu *vcpu, enum kvm_bus bus_idx,
gpa_t addr, int len, const void *val, long cookie)
{
struct kvm_io_bus *bus;
struct kvm_io_range range;
range = (struct kvm_io_range) {
.addr = addr,
.len = len,
};
bus... | 0 | [
"CWE-459"
] | linux | 683412ccf61294d727ead4a73d97397396e69a6b | 111,863,288,651,101,600,000,000,000,000,000,000,000 | 28 | KVM: SEV: add cache flush to solve SEV cache incoherency issues
Flush the CPU caches when memory is reclaimed from an SEV guest (where
reclaim also includes it being unmapped from KVM's memslots). Due to lack
of coherency for SEV encrypted memory, failure to flush results in silent
data corruption if userspace is mal... |
const routerinfo_t *
routerlist_find_my_routerinfo(void)
{
if (!routerlist)
return NULL;
SMARTLIST_FOREACH(routerlist->routers, routerinfo_t *, router,
{
if (router_is_me(router))
return router;
});
return NULL; | 0 | [] | tor | 1afc2ed956a35b40dfd1d207652af5b50c295da7 | 287,017,568,953,558,600,000,000,000,000,000,000,000 | 12 | Fix policies.c instance of the "if (r=(a-b)) return r" pattern
I think this one probably can't underflow, since the input ranges
are small. But let's not tempt fate.
This patch also replaces the "cmp" functions here with just "eq"
functions, since nothing actually checked for anything besides 0 and
nonzero.
Related... |
imap_auth_res_t imap_auth_gss (IMAP_DATA* idata, const char* method)
{
gss_buffer_desc request_buf, send_token;
gss_buffer_t sec_token;
gss_name_t target_name;
gss_ctx_id_t context;
#ifdef DEBUG
gss_OID mech_name;
char server_conf_flags;
#endif
gss_qop_t quality;
int cflags;
OM_uint32 maj_stat, min_st... | 0 | [
"CWE-120"
] | mutt | 3d9028fec8f4d08db2251096307c0bbbebce669a | 96,716,441,041,216,900,000,000,000,000,000,000,000 | 234 | Check outbuf length in mutt_from_base64()
The obuf can be overflowed in auth_cram.c, and possibly auth_gss.c.
Thanks to Jeriko One for the bug report. |
static void update_intel_pt_cfg(struct kvm_vcpu *vcpu)
{
struct vcpu_vmx *vmx = to_vmx(vcpu);
struct kvm_cpuid_entry2 *best = NULL;
int i;
for (i = 0; i < PT_CPUID_LEAVES; i++) {
best = kvm_find_cpuid_entry(vcpu, 0x14, i);
if (!best)
return;
vmx->pt_desc.caps[CPUID_EAX + i*PT_CPUID_REGS_NUM] = best->eax;
... | 0 | [
"CWE-703"
] | linux | 6cd88243c7e03845a450795e134b488fc2afb736 | 263,307,755,494,638,950,000,000,000,000,000,000,000 | 68 | KVM: x86: do not report a vCPU as preempted outside instruction boundaries
If a vCPU is outside guest mode and is scheduled out, it might be in the
process of making a memory access. A problem occurs if another vCPU uses
the PV TLB flush feature during the period when the vCPU is scheduled
out, and a virtual address ... |
void jpc_quantize(jas_matrix_t *data, jpc_fix_t stepsize)
{
int i;
int j;
jpc_fix_t t;
if (stepsize == jpc_inttofix(1)) {
return;
}
for (i = 0; i < jas_matrix_numrows(data); ++i) {
for (j = 0; j < jas_matrix_numcols(data); ++j) {
t = jas_matrix_get(data, i, j);
{
if (t < 0) {
t = jpc_fix_neg(jpc_fix_... | 0 | [
"CWE-189"
] | jasper | 3c55b399c36ef46befcb21e4ebc4799367f89684 | 109,499,543,464,554,720,000,000,000,000,000,000,000 | 26 | At many places in the code, jas_malloc or jas_recalloc was being
invoked with the size argument being computed in a manner that would not
allow integer overflow to be detected. Now, these places in the code
have been modified to use special-purpose memory allocation functions
(e.g., jas_alloc2, jas_alloc3, jas_realloc... |
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason,
LPVOID lpvReserved)
{
switch(fdwReason)
{
case DLL_PROCESS_ATTACH:
OPENSSL_cpuid_setup();
#if defined(_WIN32_WINNT)
{
IMAGE_DOS_HEADER *dos_header = (IMAGE_DOS_HEADER *)hinstDLL;
IMAGE_NT_HEADERS *nt_headers;
if (dos_header->e_magic==IMAGE_D... | 0 | [
"CWE-310"
] | openssl | 270881316664396326c461ec7a124aec2c6cc081 | 19,651,103,481,292,767,000,000,000,000,000,000,000 | 32 | Add and use a constant-time memcmp.
This change adds CRYPTO_memcmp, which compares two vectors of bytes in
an amount of time that's independent of their contents. It also changes
several MAC compares in the code to use this over the standard memcmp,
which may leak information about the size of a matching prefix.
(cher... |
nameserver_ready_callback(evutil_socket_t fd, short events, void *arg) {
struct nameserver *ns = (struct nameserver *) arg;
(void)fd;
EVDNS_LOCK(ns->base);
if (events & EV_WRITE) {
ns->choked = 0;
if (!evdns_transmit(ns->base)) {
nameserver_write_waiting(ns, 0);
}
}
if (events & EV_READ) {
nameserver_... | 0 | [
"CWE-125"
] | libevent | 96f64a022014a208105ead6c8a7066018449d86d | 263,981,852,008,101,160,000,000,000,000,000,000,000 | 16 | evdns: name_parse(): fix remote stack overread
@asn-the-goblin-slayer:
"the name_parse() function in libevent's DNS code is vulnerable to a buffer overread.
971 if (cp != name_out) {
972 if (cp + 1 >= end) return -1;
973 *cp++ = '.';
974 }
975 if (cp + ... |
global_exe(char_u *cmd)
{
linenr_T old_lcount; // b_ml.ml_line_count before the command
buf_T *old_buf = curbuf; // remember what buffer we started in
linenr_T lnum; // line number according to old situation
/*
* Set current position only once for a global command.
* If global_busy is set... | 0 | [
"CWE-416"
] | vim | 37f47958b8a2a44abc60614271d9537e7f14e51a | 249,529,617,472,682,240,000,000,000,000,000,000,000 | 49 | patch 8.2.4253: using freed memory when substitute with function call
Problem: Using freed memory when substitute uses a recursive function call.
Solution: Make a copy of the substitute text. |
static unsigned int unix_poll(struct file * file, struct socket *sock, poll_table *wait)
{
struct sock *sk = sock->sk;
unsigned int mask;
poll_wait(file, sk->sk_sleep, wait);
mask = 0;
/* exceptional events? */
if (sk->sk_err)
mask |= POLLERR;
if (sk->sk_shutdown == SHUTDOWN_MASK)
mask |= POLLHUP;
if (sk-... | 0 | [] | linux-2.6 | 6209344f5a3795d34b7f2c0061f49802283b6bdd | 43,537,616,383,455,610,000,000,000,000,000,000,000 | 34 | net: unix: fix inflight counting bug in garbage collector
Previously I assumed that the receive queues of candidates don't
change during the GC. This is only half true, nothing can be received
from the queues (see comment in unix_gc()), but buffers could be added
through the other half of the socket pair, which may s... |
bool Image::isShortType(uint16_t type) {
return type == Exiv2::unsignedShort
|| type == Exiv2::signedShort
;
} | 0 | [
"CWE-125"
] | exiv2 | 6e3855aed7ba8bb4731fc4087ca7f9078b2f3d97 | 329,922,640,934,566,260,000,000,000,000,000,000,000 | 5 | Fix https://github.com/Exiv2/exiv2/issues/55 |
heap_get_entry(struct heap_queue *heap)
{
uint64_t a_key, b_key, c_key;
int a, b, c;
struct file_info *r, *tmp;
if (heap->used < 1)
return (NULL);
/*
* The first file in the list is the earliest; we'll return this.
*/
r = heap->files[0];
/*
* Move the last item in the heap to the root of the tree
*/... | 0 | [
"CWE-125"
] | libarchive | f9569c086ff29259c73790db9cbf39fe8fb9d862 | 86,309,399,580,050,350,000,000,000,000,000,000,000 | 45 | iso9660: validate directory record length |
void blk_queue_flag_clear(unsigned int flag, struct request_queue *q)
{
clear_bit(flag, &q->queue_flags);
} | 0 | [
"CWE-416"
] | linux | c3e2219216c92919a6bd1711f340f5faa98695e6 | 32,850,046,068,128,354,000,000,000,000,000,000,000 | 4 | block: free sched's request pool in blk_cleanup_queue
In theory, IO scheduler belongs to request queue, and the request pool
of sched tags belongs to the request queue too.
However, the current tags allocation interfaces are re-used for both
driver tags and sched tags, and driver tags is definitely host wide,
and doe... |
vim_findfile_free_visited_list(ff_visited_list_hdr_T **list_headp)
{
ff_visited_list_hdr_T *vp;
while (*list_headp != NULL)
{
vp = (*list_headp)->ffvl_next;
ff_free_visited_list((*list_headp)->ffvl_visited_list);
vim_free((*list_headp)->ffvl_filename);
vim_free(*list_headp);
*list_headp = vp;
}
... | 0 | [
"CWE-122"
] | vim | 615ddd5342b50a6878a907062aa471740bd9a847 | 54,402,251,379,649,770,000,000,000,000,000,000,000 | 15 | patch 8.2.3611: crash when using CTRL-W f without finding a file name
Problem: Crash when using CTRL-W f without finding a file name.
Solution: Bail out when the file name length is zero. |
re_free_registers(OnigRegion* r)
{
/* 0: don't free self */
onig_region_free(r, 0);
} | 0 | [
"CWE-125"
] | oniguruma | 65a9b1aa03c9bc2dc01b074295b9603232cb3b78 | 42,355,445,454,274,737,000,000,000,000,000,000,000 | 5 | onig-5.9.2 |
void lsr1_del(GF_Box *s)
{
GF_LASeRSampleEntryBox *ptr = (GF_LASeRSampleEntryBox *)s;
if (ptr == NULL) return;
gf_isom_sample_entry_predestroy((GF_SampleEntryBox *)s);
if (ptr->slc) gf_odf_desc_del((GF_Descriptor *)ptr->slc);
if (ptr->lsr_config) gf_isom_box_del((GF_Box *) ptr->lsr_config);
if (ptr->descr) gf_is... | 0 | [
"CWE-125"
] | gpac | bceb03fd2be95097a7b409ea59914f332fb6bc86 | 198,020,614,681,090,380,000,000,000,000,000,000,000 | 11 | fixed 2 possible heap overflows (inc. #1088) |
TEST_F(QueryPlannerTest, MaxMinSort) {
addIndex(BSON("a" << 1));
// Run an empty query, sort {a: 1}, max/min arguments.
runQueryFull(BSONObj(),
fromjson("{a: 1}"),
BSONObj(),
0,
0,
BSONObj(),
fromjson("{a:... | 0 | [] | mongo | b0ef26c639112b50648a02d969298650fbd402a4 | 207,247,680,011,754,900,000,000,000,000,000,000,000 | 17 | SERVER-51083 Reject invalid UTF-8 from $regex match expressions |
pdf14_recreate_clist_device(gs_memory_t *mem, gs_gstate * pgs,
gx_device * dev, const gs_pdf14trans_t * pdf14pct)
{
pdf14_clist_device * pdev = (pdf14_clist_device *)dev;
gx_device * target = pdev->target;
pdf14_clist_device * dev_proto;
pdf14_clist_device temp_dev_proto;
int code;
... | 0 | [] | ghostpdl | c432131c3fdb2143e148e8ba88555f7f7a63b25e | 56,940,814,129,880,870,000,000,000,000,000,000,000 | 28 | Bug 699661: Avoid sharing pointers between pdf14 compositors
If a copdevice is triggered when the pdf14 compositor is the device, we make
a copy of the device, then throw an error because, by default we're only allowed
to copy the device prototype - then freeing it calls the finalize, which frees
several pointers shar... |
PosibErr<void> encode_ec(const FilterChar * in, const FilterChar * stop,
CharVector & out, ParmStr orig) const {
for (; in != stop; ++in) {
Chr c = in->chr;
if (c != in->chr) {
char m[70];
snprintf(m, 70, _("The Unicode code point U+%04X is uns... | 0 | [
"CWE-125"
] | aspell | de29341638833ba7717bd6b5e6850998454b044b | 42,606,313,580,689,130,000,000,000,000,000,000,000 | 13 | Don't allow null-terminated UCS-2/4 strings using the original API.
Detect if the encoding is UCS-2/4 and the length is -1 in affected API
functions and refuse to convert the string. If the string ends up
being converted somehow, abort with an error message in DecodeDirect
and ConvDirect. To convert a null terminate... |
copy_remote_config (GKeyFile *config,
GKeyFile *group_config,
const char *remote_name)
{
g_auto(GStrv) keys = NULL;
g_autofree char *group = g_strdup_printf ("remote \"%s\"", remote_name);
int i;
g_key_file_remove_group (config, group, NULL);
keys = g_key_file_get_key... | 0 | [
"CWE-74"
] | flatpak | fb473cad801c6b61706353256cab32330557374a | 322,877,860,970,655,900,000,000,000,000,000,000,000 | 24 | dir: Pass environment via bwrap --setenv when running apply_extra
This means we can systematically pass the environment variables
through bwrap(1), even if it is setuid and thus is filtering out
security-sensitive environment variables. bwrap ends up being
run with an empty environment instead.
As with the previous c... |
CImgList<T>& assign(const CImg<t1>& img1, const CImg<t2>& img2, const CImg<t3>& img3, const bool is_shared=false) {
assign(3);
_data[0].assign(img1,is_shared); _data[1].assign(img2,is_shared); _data[2].assign(img3,is_shared);
return *this;
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 20,575,687,454,152,463,000,000,000,000,000,000,000 | 5 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
static inline struct timer_base *get_timer_this_cpu_base(u32 tflags)
{
struct timer_base *base = this_cpu_ptr(&timer_bases[BASE_STD]);
/*
* If the timer is deferrable and nohz is active then we need to use
* the deferrable base.
*/
if (IS_ENABLED(CONFIG_NO_HZ_COMMON) && base->nohz_active &&
(tflags & TIM... | 0 | [
"CWE-200"
] | tip | dfb4357da6ddbdf57d583ba64361c9d792b0e0b1 | 291,515,475,933,216,700,000,000,000,000,000,000,000 | 13 | time: Remove CONFIG_TIMER_STATS
Currently CONFIG_TIMER_STATS exposes process information across namespaces:
kernel/time/timer_list.c print_timer():
SEQ_printf(m, ", %s/%d", tmp, timer->start_pid);
/proc/timer_list:
#11: <0000000000000000>, hrtimer_wakeup, S:01, do_nanosleep, cron/2570
Given that the trac... |
TEST_P(ConnectTerminationIntegrationTest, TestTimeout) {
enable_timeout_ = true;
initialize();
setUpConnection();
// Wait for the timeout to close the connection.
ASSERT_TRUE(response_->waitForReset());
ASSERT_TRUE(fake_raw_upstream_connection_->waitForHalfClose());
} | 0 | [
"CWE-416"
] | envoy | ce0ae309057a216aba031aff81c445c90c6ef145 | 62,044,511,525,168,590,000,000,000,000,000,000,000 | 10 | CVE-2021-43826
Signed-off-by: Yan Avlasov <yavlasov@google.com> |
seamless_send(const char *command, const char *format, ...)
{
STREAM s;
size_t len;
va_list argp;
char *escaped, buf[1025];
len = snprintf(buf, sizeof(buf) - 1, "%s,%u,", command, seamless_serial);
assert(len < (sizeof(buf) - 1));
va_start(argp, format);
len += vsnprintf(buf + len, sizeof(buf) - len - 1, for... | 0 | [
"CWE-119",
"CWE-125",
"CWE-703",
"CWE-787"
] | rdesktop | 4dca546d04321a610c1835010b5dad85163b65e1 | 130,527,537,594,673,700,000,000,000,000,000,000,000 | 36 | Malicious RDP server security fixes
This commit includes fixes for a set of 21 vulnerabilities in
rdesktop when a malicious RDP server is used.
All vulnerabilities was identified and reported by Eyal Itkin.
* Add rdp_protocol_error function that is used in several fixes
* Refactor of process_bitmap_updates
* Fix ... |
xmlSaveToFd(int fd, const char *encoding, int options)
{
xmlSaveCtxtPtr ret;
ret = xmlNewSaveCtxt(encoding, options);
if (ret == NULL) return(NULL);
ret->buf = xmlOutputBufferCreateFd(fd, ret->handler);
if (ret->buf == NULL) {
xmlFreeSaveCtxt(ret);
return(NULL);
}
return(ret);
} | 0 | [
"CWE-502"
] | libxml2 | c97750d11bb8b6f3303e7131fe526a61ac65bcfd | 162,920,666,620,857,000,000,000,000,000,000,000,000 | 13 | Avoid an out of bound access when serializing malformed strings
For https://bugzilla.gnome.org/show_bug.cgi?id=766414
* xmlsave.c: xmlBufAttrSerializeTxtContent() if an attribute value
is not UTF-8 be more careful when serializing it as we may do an
out of bound access as a result. |
ascii_to_bin(char ch)
{
signed char sch = ch;
int retval;
retval = sch - '.';
if (sch >= 'A') {
retval = sch - ('A' - 12);
if (sch >= 'a')
retval = sch - ('a' - 38);
}
retval &= 0x3f;
return(retval);
} | 0 | [
"CWE-310"
] | php-src | aab49e934de1fff046e659cbec46e3d053b41c34 | 233,778,950,732,806,930,000,000,000,000,000,000,000 | 15 | fix CVE-2012-2143 |
f_getfperm(typval_T *argvars, typval_T *rettv)
{
char_u *fname;
stat_T st;
char_u *perm = NULL;
char_u flags[] = "rwx";
int i;
fname = tv_get_string(&argvars[0]);
rettv->v_type = VAR_STRING;
if (mch_stat((char *)fname, &st) >= 0)
{
perm = vim_strsave((char_u *)"---------");
if (... | 0 | [
"CWE-78"
] | vim | 8c62a08faf89663e5633dc5036cd8695c80f1075 | 50,084,728,938,916,210,000,000,000,000,000,000,000 | 25 | 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. |
int gfs2_truncatei_resume(struct gfs2_inode *ip)
{
int error;
error = trunc_dealloc(ip, i_size_read(&ip->i_inode));
if (!error)
error = trunc_end(ip);
return error;
} | 0 | [
"CWE-119",
"CWE-787"
] | linux | 64dd153c83743af81f20924c6343652d731eeecb | 59,722,285,047,704,100,000,000,000,000,000,000,000 | 8 | GFS2: rewrite fallocate code to write blocks directly
GFS2's fallocate code currently goes through the page cache. Since it's only
writing to the end of the file or to holes in it, it doesn't need to, and it
was causing issues on low memory environments. This patch pulls in some of
Steve's block allocation work, and u... |
Item_timestamp_literal(THD *thd)
:Item_literal(thd)
{ } | 0 | [
"CWE-617"
] | server | 807945f2eb5fa22e6f233cc17b85a2e141efe2c8 | 287,840,621,700,129,130,000,000,000,000,000,000,000 | 3 | 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 ... |
int qcow2_discard_clusters(BlockDriverState *bs, uint64_t offset,
int nb_sectors, enum qcow2_discard_type type)
{
BDRVQcowState *s = bs->opaque;
uint64_t end_offset;
unsigned int nb_clusters;
int ret;
end_offset = offset + (nb_sectors << BDRV_SECTOR_BITS);
/* Round start up and end down */... | 0 | [
"CWE-190"
] | qemu | cab60de930684c33f67d4e32c7509b567f8c445b | 39,002,985,757,260,107,000,000,000,000,000,000,000 | 40 | 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> |
read_string(uschar *s, uschar *name)
{
uschar *yield;
uschar *ss;
if (*s != '\"') return string_copy(s);
ss = s;
yield = string_dequote(&s);
if (s == ss+1 || s[-1] != '\"')
log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN,
"missing quote at end of string value for %s", name);
if (*s != 0) extra_chars_error(s, US"stri... | 0 | [
"CWE-264"
] | exim | e2f5dc151e2e79058e93924e6d35510557f0535d | 24,529,030,766,261,760,000,000,000,000,000,000,000 | 18 | Check configure file permissions even for non-default files if still privileged
(Bug 1044, CVE-2010-4345) |
static int aes_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
const unsigned char *in, size_t len)
{
EVP_AES_KEY *dat = (EVP_AES_KEY *) ctx->cipher_data;
CRYPTO_ofb128_encrypt(in, out, len, &dat->ks,
ctx->iv, &ctx->num, dat->block);
return 1;
} | 0 | [] | openssl | 1a3701f4fe0530a40ec073cd78d02cfcc26c0f8e | 241,831,826,015,542,530,000,000,000,000,000,000,000 | 9 | Sanity check EVP_CTRL_AEAD_TLS_AAD
The various implementations of EVP_CTRL_AEAD_TLS_AAD expect a buffer of at
least 13 bytes long. Add sanity checks to ensure that the length is at
least that. Also add a new constant (EVP_AEAD_TLS1_AAD_LEN) to evp.h to
represent this length. Thanks to Kevin Wojtysiak (Int3 Solutions) ... |
reply_info_parsedelete(struct reply_info* rep, struct alloc_cache* alloc)
{
size_t i;
if(!rep)
return;
/* no need to lock, since not shared in hashtables. */
for(i=0; i<rep->rrset_count; i++) {
ub_packed_rrset_parsedelete(rep->rrsets[i], alloc);
}
free(rep);
} | 0 | [
"CWE-787"
] | unbound | 6c3a0b54ed8ace93d5b5ca7b8078dc87e75cd640 | 68,013,992,344,847,255,000,000,000,000,000,000,000 | 11 | - Fix Out of Bound Write Compressed Names in rdata_copy(),
reported by X41 D-Sec. |
static int v4l_s_priority(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{
struct video_device *vfd;
struct v4l2_fh *vfh;
u32 *p = arg;
vfd = video_devdata(file);
if (!test_bit(V4L2_FL_USES_V4L2_FH, &vfd->flags))
return -ENOTTY;
vfh = file->private_data;
return v4l2_prio_change(... | 0 | [
"CWE-401"
] | linux | fb18802a338b36f675a388fc03d2aa504a0d0899 | 166,114,091,855,720,200,000,000,000,000,000,000,000 | 13 | media: v4l: ioctl: Fix memory leak in video_usercopy
When an IOCTL with argument size larger than 128 that also used array
arguments were handled, two memory allocations were made but alas, only
the latter one of them was released. This happened because there was only
a single local variable to hold such a temporary a... |
static int rds_still_queued(struct rds_sock *rs, struct rds_incoming *inc,
int drop)
{
struct sock *sk = rds_rs_to_sk(rs);
int ret = 0;
unsigned long flags;
write_lock_irqsave(&rs->rs_recv_lock, flags);
if (!list_empty(&inc->i_item)) {
ret = 1;
if (drop) {
/* XXX make sure this i_conn is reliable */... | 0 | [
"CWE-200"
] | linux-2.6 | 06b6a1cf6e776426766298d055bb3991957d90a7 | 46,542,667,231,196,680,000,000,000,000,000,000,000 | 24 | rds: set correct msg_namelen
Jay Fenlason (fenlason@redhat.com) found a bug,
that recvfrom() on an RDS socket can return the contents of random kernel
memory to userspace if it was called with a address length larger than
sizeof(struct sockaddr_in).
rds_recvmsg() also fails to set the addr_len paramater properly befor... |
void big_key_destroy(struct key *key)
{
size_t datalen = (size_t)key->payload.data[big_key_len];
if (datalen > BIG_KEY_FILE_THRESHOLD) {
struct path *path = (struct path *)&key->payload.data[big_key_path];
path_put(path);
path->mnt = NULL;
path->dentry = NULL;
}
kzfree(key->payload.data[big_key_data]);
k... | 0 | [
"CWE-20"
] | linux | 363b02dab09b3226f3bd1420dad9c72b79a42a76 | 334,226,428,836,162,960,000,000,000,000,000,000,000 | 14 | KEYS: Fix race between updating and finding a negative key
Consolidate KEY_FLAG_INSTANTIATED, KEY_FLAG_NEGATIVE and the rejection
error into one field such that:
(1) The instantiation state can be modified/read atomically.
(2) The error can be accessed atomically with the state.
(3) The error isn't stored unione... |
**/
T& atN(const int pos, const int x, const int y, const int z, const int c, const T& out_value) {
return (pos<0 || pos>=(int)_width)?(cimg::temporary(out_value)=out_value):(*this)(pos,x,y,z,c); | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 199,041,156,738,588,970,000,000,000,000,000,000,000 | 3 | Fix other issues in 'CImg<T>::load_bmp()'. |
static int kvaser_usb_leaf_set_opt_mode(const struct kvaser_usb_net_priv *priv)
{
struct kvaser_cmd *cmd;
int rc;
cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
if (!cmd)
return -ENOMEM;
cmd->id = CMD_SET_CTRL_MODE;
cmd->len = CMD_HEADER_LEN + sizeof(struct kvaser_cmd_ctrl_mode);
cmd->u.ctrl_mode.tid = 0xff;
cmd-... | 0 | [
"CWE-200",
"CWE-908"
] | linux | da2311a6385c3b499da2ed5d9be59ce331fa93e9 | 57,024,943,247,487,450,000,000,000,000,000,000,000 | 24 | can: kvaser_usb: kvaser_usb_leaf: Fix some info-leaks to USB devices
Uninitialized Kernel memory can leak to USB devices.
Fix this by using kzalloc() instead of kmalloc().
Signed-off-by: Xiaolong Huang <butterflyhuangxx@gmail.com>
Fixes: 7259124eac7d ("can: kvaser_usb: Split driver into kvaser_usb_core.c and kvaser_... |
static FDrive *get_cur_drv(FDCtrl *fdctrl)
{
FDrive *cur_drv = get_drv(fdctrl, fdctrl->cur_drv);
if (!cur_drv->blk) {
/*
* Kludge: empty drive line selected. Create an anonymous
* BlockBackend to avoid NULL deref with various BlockBackend
* API calls within this model (CVE-20... | 0 | [
"CWE-787"
] | qemu | defac5e2fbddf8423a354ff0454283a2115e1367 | 209,886,228,876,924,460,000,000,000,000,000,000,000 | 16 | hw/block/fdc: Prevent end-of-track overrun (CVE-2021-3507)
Per the 82078 datasheet, if the end-of-track (EOT byte in
the FIFO) is more than the number of sectors per side, the
command is terminated unsuccessfully:
* 5.2.5 DATA TRANSFER TERMINATION
The 82078 supports terminal count explicitly through
the TC pin a... |
Classifier (const char *&ptr, int size)
{
if (size <= 0)
throw IEX_NAMESPACE::InputExc("Error uncompressing DWA data"
" (truncated rule).");
{
// maximum length of string plus one byte for terminating NULL
char suf... | 0 | [
"CWE-125"
] | openexr | e79d2296496a50826a15c667bf92bdc5a05518b4 | 259,403,700,882,642,130,000,000,000,000,000,000,000 | 39 | fix memory leaks and invalid memory accesses
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz> |
int usbredirparser_peer_has_cap(struct usbredirparser *parser_pub, int cap)
{
struct usbredirparser_priv *parser =
(struct usbredirparser_priv *)parser_pub;
return usbredirparser_caps_get_cap(parser, parser->peer_caps, cap);
} | 0 | [] | usbredir | 03c519ff5831ba75120e00ebebbf1d5a1f7220ab | 279,899,019,534,321,830,000,000,000,000,000,000,000 | 6 | Avoid use-after-free in serialization
Serializing parsers with large amounts of buffered write data (e.g. in case of
a slow or blocked write destination) would cause "serialize_data" to reallocate
the state buffer whose default size is 64kB (USBREDIRPARSER_SERIALIZE_BUF_SIZE).
The pointer to the position for the write... |
static void flush_data_end_io(struct request *rq, int error)
{
struct request_queue *q = rq->q;
struct blk_flush_queue *fq = blk_get_flush_queue(q, NULL);
/*
* After populating an empty queue, kick it to avoid stall. Read
* the comment in flush_end_io().
*/
if (blk_flush_complete_seq(rq, fq, REQ_FSEQ_DATA, ... | 0 | [
"CWE-362",
"CWE-264"
] | linux | 0048b4837affd153897ed1222283492070027aa9 | 165,110,105,563,047,040,000,000,000,000,000,000,000 | 12 | blk-mq: fix race between timeout and freeing request
Inside timeout handler, blk_mq_tag_to_rq() is called
to retrieve the request from one tag. This way is obviously
wrong because the request can be freed any time and some
fiedds of the request can't be trusted, then kernel oops
might be triggered[1].
Currently wrt. ... |
TEST(HeaderIsValidTest, AuthorityIsValid) {
EXPECT_TRUE(HeaderUtility::authorityIsValid("strangebutlegal$-%&'"));
EXPECT_FALSE(HeaderUtility::authorityIsValid("illegal{}"));
} | 0 | [] | envoy | 2c60632d41555ec8b3d9ef5246242be637a2db0f | 203,505,037,503,665,930,000,000,000,000,000,000,000 | 4 | 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... |
void sched_set_stop_task(int cpu, struct task_struct *stop)
{
struct sched_param param = { .sched_priority = MAX_RT_PRIO - 1 };
struct task_struct *old_stop = cpu_rq(cpu)->stop;
if (stop) {
/*
* Make it appear like a SCHED_FIFO task, its something
* userspace knows about and won't get confused about.
*
... | 0 | [
"CWE-119"
] | linux | 29d6455178a09e1dc340380c582b13356227e8df | 68,749,749,541,573,670,000,000,000,000,000,000,000 | 29 | sched: panic on corrupted stack end
Until now, hitting this BUG_ON caused a recursive oops (because oops
handling involves do_exit(), which calls into the scheduler, which in
turn raises an oops), which caused stuff below the stack to be
overwritten until a panic happened (e.g. via an oops in interrupt
context, cause... |
std::string heif::BoxHeader::get_type_string() const
{
if (m_type == fourcc("uuid")) {
// 8-4-4-4-12
std::ostringstream sstr;
sstr << std::hex;
sstr << std::setfill('0');
sstr << std::setw(2);
for (int i=0;i<16;i++) {
if (i==4 || i==6 || i==8 || i==10) {
sstr << '-';
}
... | 0 | [
"CWE-703"
] | libheif | 2710c930918609caaf0a664e9c7bc3dce05d5b58 | 1,832,504,342,577,973,600,000,000,000,000,000,000 | 24 | force fraction to a limited resolution to finally solve those pesky numerical edge cases |
xdata_string_match (Dwg_Data *restrict dwg, Dwg_Resbuf *restrict xdata,
int type, char *restrict str)
{
if (xdata->type != type)
return 0;
if (!IS_FROM_TU_DWG (dwg))
{
return strEQ (xdata->value.str.u.data, str);
}
else
{
return memcmp (xdata->value.str.u.wdata, str... | 0 | [
"CWE-787"
] | libredwg | ecf5183d8b3b286afe2a30021353b7116e0208dd | 71,821,908,214,261,120,000,000,000,000,000,000,000 | 14 | dwg_section_wtype: fix fuzzing overflow
with illegal and overlong section names. Fixes GH #349, #352
section names cannot be longer than 24 |
static unsigned int selinux_ip_forward(struct sk_buff *skb,
const struct net_device *indev,
u16 family)
{
int err;
char *addrp;
u32 peer_sid;
struct common_audit_data ad;
struct lsm_network_audit net = {0,};
u8 secmark_active;
u8 netlbl_active;
u8 peerlbl_active;
if (!selinux_policycap_n... | 0 | [
"CWE-349"
] | linux | fb73974172ffaaf57a7c42f35424d9aece1a5af6 | 41,172,280,796,476,710,000,000,000,000,000,000,000 | 57 | selinux: properly handle multiple messages in selinux_netlink_send()
Fix the SELinux netlink_send hook to properly handle multiple netlink
messages in a single sk_buff; each message is parsed and subject to
SELinux access control. Prior to this patch, SELinux only inspected
the first message in the sk_buff.
Cc: stab... |
vm_fault_t vmf_insert_pfn_pmd_prot(struct vm_fault *vmf, pfn_t pfn,
pgprot_t pgprot, bool write)
{
unsigned long addr = vmf->address & PMD_MASK;
struct vm_area_struct *vma = vmf->vma;
pgtable_t pgtable = NULL;
/*
* If we had pmd_special, we could avoid all these restrictions,
* but we need to be consist... | 0 | [
"CWE-362"
] | linux | c444eb564fb16645c172d550359cb3d75fe8a040 | 170,544,210,575,966,800,000,000,000,000,000,000,000 | 32 | 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 ... |
void ovl_dentry_version_inc(struct dentry *dentry)
{
struct ovl_entry *oe = dentry->d_fsdata;
WARN_ON(!mutex_is_locked(&dentry->d_inode->i_mutex));
oe->version++;
} | 0 | [
"CWE-284",
"CWE-264"
] | linux | 69c433ed2ecd2d3264efd7afec4439524b319121 | 121,770,042,709,287,580,000,000,000,000,000,000,000 | 7 | fs: limit filesystem stacking depth
Add a simple read-only counter to super_block that indicates how deep this
is in the stack of filesystems. Previously ecryptfs was the only stackable
filesystem and it explicitly disallowed multiple layers of itself.
Overlayfs, however, can be stacked recursively and also may be s... |
main(const int argc, char **argv)
{
int n_listeners, i, clnt_length, clnt;
struct pollfd *polls;
LISTENER *lstn;
pthread_t thr;
pthread_attr_t attr;
struct sched_param sp;
uid_t user_id;
gid_t group_id;
FILE... | 1 | [] | pound | a0c52c542ca9620a96750f9877b26bf4c84aef1b | 112,728,428,563,010,260,000,000,000,000,000,000,000 | 313 | SSL Compression Disable patch for 2.6f
This patch disables SSL/TLS compression entirely. There is no config option.
This prevents CRIME attacks against SSL. Note that HTTP compression is still
an option.
Test your server at https://www.ssllabs.com/ssldb/
Original patch by Hereward Cooper <coops@fawk.eu>
Openssl 0... |
void PackLinuxElf32mipseb::pack1(OutputFile *fo, Filter &ft)
{
super::pack1(fo, ft);
if (0!=xct_off) // shared library
return;
cprElfHdr3 h3;
memcpy(&h3, stub_mips_r3000_linux_elf_fold, sizeof(Elf32_Ehdr) + 2*sizeof(Elf32_Phdr));
generateElfHdr(fo, &h3, getbrk(phdri, e_phnum) );
} | 0 | [
"CWE-476"
] | upx | ef336dbcc6dc8344482f8cf6c909ae96c3286317 | 51,818,543,814,000,180,000,000,000,000,000,000,000 | 9 | Protect against bad crafted input.
https://github.com/upx/upx/issues/128
modified: p_lx_elf.cpp |
GF_Box *CoLL_box_new()
{
ISOM_DECL_BOX_ALLOC(GF_VPContentLightLevelBox, GF_ISOM_BOX_TYPE_COLL);
return (GF_Box *)tmp;
} | 0 | [
"CWE-401"
] | gpac | 0a85029d694f992f3631e2f249e4999daee15cbf | 214,472,777,521,142,720,000,000,000,000,000,000,000 | 5 | fixed #1785 (fuzz) |
static double KernelBessel_P1(const double x)
{
double p, q;
register long i;
static const double
Pone[] =
{
0.352246649133679798341724373e+5,
0.62758845247161281269005675e+5,
0.313539631109159574238669888e+5,
0.49854832060594338434500455e+4,
0.2111529182853962382105718e+3,
0.12571716929145341558495e... | 0 | [
"CWE-119"
] | php-src | 4bb422343f29f06b7081323844d9b52e1a71e4a5 | 246,706,801,053,815,040,000,000,000,000,000,000,000 | 35 | Fix bug #70976: fix boundary check on gdImageRotateInterpolated |
static int nl80211_get_coalesce(struct sk_buff *skb, struct genl_info *info)
{
struct cfg80211_registered_device *rdev = info->user_ptr[0];
struct sk_buff *msg;
void *hdr;
if (!rdev->wiphy.coalesce)
return -EOPNOTSUPP;
msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
if (!msg)
return -ENOMEM;
hdr = nl8021... | 0 | [
"CWE-120"
] | linux | f88eb7c0d002a67ef31aeb7850b42ff69abc46dc | 239,227,604,774,936,500,000,000,000,000,000,000,000 | 28 | nl80211: validate beacon head
We currently don't validate the beacon head, i.e. the header,
fixed part and elements that are to go in front of the TIM
element. This means that the variable elements there can be
malformed, e.g. have a length exceeding the buffer size, but
most downstream code from this assumes that thi... |
static bool mmu_spte_update(u64 *sptep, u64 new_spte)
{
bool flush = false;
u64 old_spte = mmu_spte_update_no_track(sptep, new_spte);
if (!is_shadow_present_pte(old_spte))
return false;
/*
* For the spte updated out of mmu-lock is safe, since
* we always atomically update it, see the comments in
* spte_ha... | 0 | [
"CWE-476"
] | linux | 9f46c187e2e680ecd9de7983e4d081c3391acc76 | 273,620,766,646,193,680,000,000,000,000,000,000,000 | 34 | KVM: x86/mmu: fix NULL pointer dereference on guest INVPCID
With shadow paging enabled, the INVPCID instruction results in a call
to kvm_mmu_invpcid_gva. If INVPCID is executed with CR0.PG=0, the
invlpg callback is not set and the result is a NULL pointer dereference.
Fix it trivially by checking for mmu->invlpg befo... |
cpl_reap ()
{
struct cpelement *p, *next, *nh, *nt;
/* Build a new list by removing dead coprocs and fix up the coproc_list
pointers when done. */
nh = nt = next = (struct cpelement *)0;
for (p = coproc_list.head; p; p = next)
{
next = p->next;
if (p->coproc->c_flags & COPROC_DEAD)
{
c... | 0 | [] | bash | 955543877583837c85470f7fb8a97b7aa8d45e6c | 315,226,303,470,965,320,000,000,000,000,000,000,000 | 42 | bash-4.4-rc2 release |
notify_create(isc_mem_t *mctx, unsigned int flags, dns_notify_t **notifyp) {
dns_notify_t *notify;
REQUIRE(notifyp != NULL && *notifyp == NULL);
notify = isc_mem_get(mctx, sizeof(*notify));
if (notify == NULL)
return (ISC_R_NOMEMORY);
notify->mctx = NULL;
isc_mem_attach(mctx, ¬ify->mctx);
notify->flags =... | 0 | [
"CWE-327"
] | bind9 | f09352d20a9d360e50683cd1d2fc52ccedcd77a0 | 251,157,082,690,053,460,000,000,000,000,000,000,000 | 24 | 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. |
SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock,
const struct __kernel_timespec __user *, tp)
{
const struct k_clock *kc = clockid_to_kclock(which_clock);
struct timespec64 new_tp;
if (!kc || !kc->clock_set)
return -EINVAL;
if (get_timespec64(&new_tp, tp))
return -EFAULT;
return kc->clock_set(... | 0 | [
"CWE-190"
] | linux | 78c9c4dfbf8c04883941445a195276bb4bb92c76 | 100,130,907,723,773,100,000,000,000,000,000,000,000 | 14 | posix-timers: Sanitize overrun handling
The posix timer overrun handling is broken because the forwarding functions
can return a huge number of overruns which does not fit in an int. As a
consequence timer_getoverrun(2) and siginfo::si_overrun can turn into
random number generators.
The k_clock::timer_forward() callb... |
static int encode_compound_hdr(struct xdr_stream *xdr, struct compound_hdr *hdr)
{
__be32 *p;
dprintk("encode_compound: tag=%.*s\n", (int)hdr->taglen, hdr->tag);
BUG_ON(hdr->taglen > NFS4_MAXTAGLEN);
RESERVE_SPACE(12+(XDR_QUADLEN(hdr->taglen)<<2));
WRITE32(hdr->taglen);
WRITEMEM(hdr->tag, hdr->taglen);
WRITE32(... | 0 | [
"CWE-703"
] | linux | dc0b027dfadfcb8a5504f7d8052754bf8d501ab9 | 338,325,630,211,529,700,000,000,000,000,000,000,000 | 13 | NFSv4: Convert the open and close ops to use fmode
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> |
static intel_engine_mask_t virtual_submission_mask(struct virtual_engine *ve)
{
struct i915_request *rq;
intel_engine_mask_t mask;
rq = READ_ONCE(ve->request);
if (!rq)
return 0;
/* The rq is ready for submission; rq->execution_mask is now stable. */
mask = rq->execution_mask;
if (unlikely(!mask)) {
/* Inv... | 0 | [] | linux | bc8a76a152c5f9ef3b48104154a65a68a8b76946 | 146,276,551,557,867,070,000,000,000,000,000,000,000 | 24 | 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... |
g_signal_pipe(void (*func)(int))
{
#if defined(_WIN32)
#else
signal(SIGPIPE, func);
#endif
} | 0 | [] | xrdp | d8f9e8310dac362bb9578763d1024178f94f4ecc | 97,671,916,946,157,550,000,000,000,000,000,000,000 | 7 | move temp files from /tmp to /tmp/.xrdp |
static void server_info_free(AvahiSDNSServerBrowser *b, AvahiDNSServerInfo *i) {
assert(b);
assert(i);
avahi_record_unref(i->srv_record);
if (i->host_name_resolver)
avahi_s_host_name_resolver_free(i->host_name_resolver);
AVAHI_LLIST_REMOVE(AvahiDNSServerInfo, info, b->info, i);
assert... | 0 | [] | avahi | 9d31939e55280a733d930b15ac9e4dda4497680c | 146,893,504,943,925,360,000,000,000,000,000,000,000 | 15 | Fix NULL pointer crashes from #175
avahi-daemon is crashing when running "ping .local".
The crash is due to failing assertion from NULL pointer.
Add missing NULL pointer checks to fix it.
Introduced in #175 - merge commit 8f75a045709a780c8cf92a6a21e9d35b593bdecd |
void mobi_buffer_add16(MOBIBuffer *buf, const uint16_t data) {
if (buf->offset + 2 > buf->maxlen) {
debug_print("%s", "Buffer full\n");
buf->error = MOBI_BUFFER_END;
return;
}
unsigned char *buftr = buf->data + buf->offset;
*buftr++ = (uint8_t)((uint32_t)(data & 0xff00U) >> 8);
... | 0 | [
"CWE-787"
] | libmobi | ab5bf0e37e540eac682a14e628853b918626e72b | 146,560,258,394,659,230,000,000,000,000,000,000,000 | 11 | fix oob write bug inside libmobi |
**/
T& atXYZ(const int x, const int y, const int z, const int c, const T& out_value) {
return (x<0 || y<0 || z<0 || x>=width() || y>=height() || z>=depth())?
(cimg::temporary(out_value)=out_value):(*this)(x,y,z,c); | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 16,331,344,258,858,840,000,000,000,000,000,000,000 | 4 | Fix other issues in 'CImg<T>::load_bmp()'. |
static int setup_exec_directory(
const ExecContext *context,
const ExecParameters *params,
uid_t uid,
gid_t gid,
ExecDirectoryType type,
int *exit_status) {
static const int exit_status_table[_EXEC_DIRECTORY_TYPE_MA... | 0 | [
"CWE-269"
] | systemd | f69567cbe26d09eac9d387c0be0fc32c65a83ada | 222,656,357,433,471,480,000,000,000,000,000,000,000 | 170 | core: expose SUID/SGID restriction as new unit setting RestrictSUIDSGID= |
static int nfs4_get_referral(struct inode *dir, const struct qstr *name, struct nfs_fattr *fattr, struct nfs_fh *fhandle)
{
int status = -ENOMEM;
struct page *page = NULL;
struct nfs4_fs_locations *locations = NULL;
page = alloc_page(GFP_KERNEL);
if (page == NULL)
goto out;
locations = kmalloc(sizeof(struct nf... | 0 | [
"CWE-703"
] | linux | dc0b027dfadfcb8a5504f7d8052754bf8d501ab9 | 215,028,196,051,439,760,000,000,000,000,000,000,000 | 35 | NFSv4: Convert the open and close ops to use fmode
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> |
Utility::QueryParams Utility::parseAndDecodeQueryString(absl::string_view url) {
size_t start = url.find('?');
if (start == std::string::npos) {
QueryParams params;
return params;
}
start++;
return parseParameters(url, start, /*decode_params=*/true);
} | 0 | [] | envoy | 3b5acb2f43548862dadb243de7cf3994986a8e04 | 269,929,959,691,029,640,000,000,000,000,000,000,000 | 10 | http, url: Bring back chromium_url and http_parser_parse_url (#198)
* Revert GURL as HTTP URL parser utility
This reverts:
1. commit c9c4709c844b90b9bb2935d784a428d667c9df7d
2. commit d828958b591a6d79f4b5fa608ece9962b7afbe32
3. commit 2d69e30c51f2418faf267aaa6c1126fce9948c62
Signed-off-by: Dhi Aurrahman <dio@tetrat... |
static inline bool isMountable(const RemoteFsDevice::Details &d)
{
return RemoteFsDevice::constSshfsProtocol==d.url.scheme() ||
RemoteFsDevice::constSambaProtocol==d.url.scheme() || RemoteFsDevice::constSambaAvahiProtocol==d.url.scheme();
} | 1 | [
"CWE-20",
"CWE-22"
] | cantata | afc4f8315d3e96574925fb530a7004cc9e6ce3d3 | 125,245,340,217,985,500,000,000,000,000,000,000,000 | 5 | Remove internal Samba shre mounting code, this had some privilege escalation issues, and is not well tested |
static int nested_vmx_check_entry_msr_switch_controls(struct kvm_vcpu *vcpu,
struct vmcs12 *vmcs12)
{
if (nested_vmx_check_msr_switch(vcpu, vmcs12->vm_entry_msr_load_count,
vmcs12->vm_entry_msr_load_addr))
ret... | 0 | [
"CWE-863"
] | kvm | acff78477b9b4f26ecdf65733a4ed77fe837e9dc | 291,610,839,009,262,800,000,000,000,000,000,000,000 | 9 | KVM: x86: nVMX: close leak of L0's x2APIC MSRs (CVE-2019-3887)
The nested_vmx_prepare_msr_bitmap() function doesn't directly guard the
x2APIC MSR intercepts with the "virtualize x2APIC mode" MSR. As a
result, we discovered the potential for a buggy or malicious L1 to get
access to L0's x2APIC MSRs, via an L2, as follo... |
static bool ValueToJson(const Value &value, json *ret) {
json obj;
#ifdef TINYGLTF_USE_RAPIDJSON
switch (value.Type()) {
case REAL_TYPE:
obj.SetDouble(value.Get<double>());
break;
case INT_TYPE:
obj.SetInt(value.Get<int>());
break;
case BOOL_TYPE:
obj.SetBool(value.Get<bool... | 0 | [
"CWE-20"
] | tinygltf | 52ff00a38447f06a17eab1caa2cf0730a119c751 | 178,750,753,286,829,900,000,000,000,000,000,000,000 | 93 | Do not expand file path since its not necessary for glTF asset path(URI) and for security reason(`wordexp`). |
GF_Err gf_isom_reset_tables(GF_ISOFile *movie, Bool reset_sample_count)
{
#ifndef GPAC_DISABLE_ISOM_FRAGMENTS
u32 i;
if (!movie || !movie->moov || !movie->moov->mvex) return GF_BAD_PARAM;
for (i=0; i<gf_list_count(movie->moov->trackList); i++) {
GF_TrackBox *trak = (GF_TrackBox *)gf_list_get(movie->moov->trackLis... | 0 | [
"CWE-787"
] | gpac | f0a41d178a2dc5ac185506d9fa0b0a58356b16f7 | 3,770,549,252,385,062,000,000,000,000,000,000,000 | 50 | fixed #2120 |
njs_array_prototype_unshift(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs,
njs_index_t unused)
{
double idx;
int64_t from, to, length;
njs_int_t ret;
njs_uint_t n;
njs_array_t *array, *keys;
njs_value_t *this, entry;
this = njs_argument(args, 0);
length = 0;
... | 0 | [
"CWE-416",
"CWE-703"
] | njs | 81af26364c21c196dd21fb5e14c7fa9ce7debd17 | 293,987,815,128,453,300,000,000,000,000,000,000,000 | 132 | Fixed Object.defineProperty() when a recursive descriptor is provided.
This closes #481 issue on Github. |
static void stop_discovery_complete(uint8_t status, uint16_t length,
const void *param, void *user_data)
{
struct btd_adapter *adapter = user_data;
struct discovery_client *client;
DBG("status 0x%02x", status);
client = discovery_complete(adapter, status);
if (client)
discovery_remove(client);
if (statu... | 0 | [
"CWE-862",
"CWE-863"
] | bluez | b497b5942a8beb8f89ca1c359c54ad67ec843055 | 302,098,321,082,468,580,000,000,000,000,000,000,000 | 25 | 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. |
void security_xfrm_policy_free(struct xfrm_sec_ctx *ctx)
{
security_ops->xfrm_policy_free_security(ctx);
} | 0 | [] | linux-2.6 | ee18d64c1f632043a02e6f5ba5e045bb26a5465f | 124,544,913,500,248,940,000,000,000,000,000,000,000 | 4 | KEYS: Add a keyctl to install a process's session keyring on its parent [try #6]
Add a keyctl to install a process's session keyring onto its parent. This
replaces the parent's session keyring. Because the COW credential code does
not permit one process to change another process's credentials directly, the
change is... |
static void __net_exit ip6_tnl_exit_net(struct net *net)
{
struct ip6_tnl_net *ip6n = net_generic(net, ip6_tnl_net_id);
rtnl_lock();
ip6_tnl_destroy_tunnels(ip6n);
rtnl_unlock();
} | 0 | [] | linux-2.6 | d5aa407f59f5b83d2c50ec88f5bf56d40f1f8978 | 304,078,919,684,989,300,000,000,000,000,000,000,000 | 8 | tunnels: fix netns vs proto registration ordering
Same stuff as in ip_gre patch: receive hook can be called before netns
setup is done, oopsing in net_generic().
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net> |
_PUBLIC_ int fdprintf(int fd, const char *format, ...)
{
va_list ap;
int ret;
va_start(ap, format);
ret = vfdprintf(fd, format, ap);
va_end(ap);
return ret;
} | 0 | [] | samba | 63d98ed90466295d0e946f79868d3d7aad6e7589 | 295,642,331,694,742,360,000,000,000,000,000,000,000 | 10 | CVE-2013-4476: lib-util: split out file_save_mode() from file_save()
file_save_mode() writes files with specified mode.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10234
Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org> |
p11_rpc_buffer_get_ulong_value (p11_buffer *buffer,
size_t *offset,
void *value,
CK_ULONG *value_length)
{
uint64_t val;
if (!p11_rpc_buffer_get_uint64 (buffer, offset, &val))
return false;
if (value) {
CK_ULONG ulong_value = val;
memcpy (value, &ulong_value, sizeof (CK_ULONG));
}
if (value_le... | 0 | [
"CWE-787"
] | p11-kit | 2617f3ef888e103324a28811886b99ed0a56346d | 324,843,255,244,802,700,000,000,000,000,000,000,000 | 20 | 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. |
Wrapped_Selector_Obj Parser::parse_negated_selector()
{
lex< pseudo_not >();
std::string name(lexed);
ParserState nsource_position = pstate;
Selector_List_Obj negated = parse_selector_list(true);
if (!lex< exactly<')'> >()) {
error("negated selector is missing ')'");
}
name.erase(n... | 0 | [
"CWE-125"
] | libsass | eb15533b07773c30dc03c9d742865604f47120ef | 186,680,505,781,414,650,000,000,000,000,000,000,000 | 12 | Fix memory leak in `parse_ie_keyword_arg`
`kwd_arg` would never get freed when there was a parse error in
`parse_ie_keyword_arg`.
Closes #2656 |
match_pattern (string, pat, mtype, sp, ep)
char *string, *pat;
int mtype;
char **sp, **ep;
{
#if defined (HANDLE_MULTIBYTE)
int ret;
size_t n;
wchar_t *wstring, *wpat;
char **indices;
size_t slen, plen, mslen, mplen;
#endif
if (string == 0 || pat == 0 || *pat == 0)
return (0);
#if defin... | 0 | [] | bash | 955543877583837c85470f7fb8a97b7aa8d45e6c | 4,104,366,810,315,428,000,000,000,000,000,000,000 | 43 | bash-4.4-rc2 release |
static int copy_vm86_regs_to_user(struct vm86_regs __user *user,
const struct kernel_vm86_regs *regs)
{
int ret = 0;
/*
* kernel_vm86_regs is missing gs, so copy everything up to
* (but not including) orig_eax, and then rest including orig_eax.
*/
ret += copy_to_user(user, regs, offsetof(struct kernel_v... | 0 | [
"CWE-264"
] | linux-2.6 | 1a5a9906d4e8d1976b701f889d8f35d54b928f25 | 290,256,878,993,151,050,000,000,000,000,000,000,000 | 16 | 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(... |
virtual void requestShutdown() {
m_use_error = false;
m_errors.reset();
} | 0 | [
"CWE-94"
] | hhvm | 95f96e7287effe2fcdfb9a5338d1a7e4f55b083b | 181,249,564,563,168,100,000,000,000,000,000,000,000 | 4 | Fix libxml_disable_entity_loader()
This wasn't calling requestInit and setting the libxml handler no null.
So the first time an error came along it would reset the handler from
no-op to reading again.
This is a much better fix, we set our custom handler in requestInit and
when libxml_disable_entity_loader we store th... |
_c_public_ int c_shquote_parse_next(char **outp,
size_t *n_outp,
const char **inp,
size_t *n_inp) {
const char *in = *inp;
size_t n_in = *n_inp;
char *out = *outp;
size_t n_out = *... | 0 | [
"CWE-787"
] | c-shquote | 7fd15f8e272136955f7ffc37df29fbca9ddceca1 | 251,230,512,536,298,250,000,000,000,000,000,000,000 | 83 | strnspn: fix buffer overflow
Fix the strnspn and strncspn functions to use a properly sized buffer.
It used to be 1 byte too short. Checking for `0xff` in a string will
thus write `0xff` once byte beyond the stack space of the local buffer.
Note that the public API does not allow to pass `0xff` to those
functions. Th... |
explicit EmptyOp(OpKernelConstruction* ctx) : OpKernel(ctx) {
OP_REQUIRES_OK(ctx, ctx->GetAttr("init", &init_));
} | 0 | [
"CWE-369"
] | tensorflow | e86605c0a336c088b638da02135ea6f9f6753618 | 129,171,147,606,770,870,000,000,000,000,000,000,000 | 3 | Fix FPE in inpace update ops.
PiperOrigin-RevId: 388303197
Change-Id: Ib48309b6213ffe53eba81004b00e889d653e4b83 |
static void jslLexRegex() {
lex->tokenValue = jsvNewFromEmptyString();
if (!lex->tokenValue) {
lex->tk = LEX_EOF;
return;
}
JsvStringIterator it;
jsvStringIteratorNew(&it, lex->tokenValue, 0);
jsvStringIteratorAppend(&it, '/');
// strings...
jslGetNextCh();
while (lex->currCh && lex->currCh!='... | 0 | [
"CWE-787"
] | Espruino | bed844f109b6c222816740555068de2e101e8018 | 249,596,758,797,806,570,000,000,000,000,000,000,000 | 42 | remove strncpy usage as it's effectively useless, replace with an assertion since fn is only used internally (fix #1426) |
tape_pad_output (int out_file_des, int offset)
{
size_t pad;
if (archive_format == arf_newascii || archive_format == arf_crcascii)
pad = (4 - (offset % 4)) % 4;
else if (archive_format == arf_tar || archive_format == arf_ustar)
pad = (512 - (offset % 512)) % 512;
else if (archive_format != arf_oldascii... | 0 | [
"CWE-190"
] | cpio | dd96882877721703e19272fe25034560b794061b | 200,874,735,956,092,870,000,000,000,000,000,000,000 | 16 | Rewrite dynamic string support.
* src/dstring.c (ds_init): Take a single argument.
(ds_free): New function.
(ds_resize): Take a single argument. Use x2nrealloc to expand
the storage.
(ds_reset,ds_append,ds_concat,ds_endswith): New function.
(ds_fgetstr): Rewrite. In particular, this fixes integer overflow.
* src/dst... |
static int sctp_setsockopt_auto_asconf(struct sock *sk, char __user *optval,
unsigned int optlen)
{
int val;
struct sctp_sock *sp = sctp_sk(sk);
if (optlen < sizeof(int))
return -EINVAL;
if (get_user(val, (int __user *)optval))
return -EFAULT;
if (!sctp_is_ep_boundall(sk) && val)
return -EINVAL;
if ((... | 1 | [
"CWE-362",
"CWE-703"
] | linux | 2d45a02d0166caf2627fe91897c6ffc3b19514c4 | 42,732,621,308,894,550,000,000,000,000,000,000,000 | 25 | sctp: fix ASCONF list handling
->auto_asconf_splist is per namespace and mangled by functions like
sctp_setsockopt_auto_asconf() which doesn't guarantee any serialization.
Also, the call to inet_sk_copy_descendant() was backuping
->auto_asconf_list through the copy but was not honoring
->do_auto_asconf, which could l... |
static void rds_conn_path_reset(struct rds_conn_path *cp)
{
struct rds_connection *conn = cp->cp_conn;
rdsdebug("connection %pI6c to %pI6c reset\n",
&conn->c_laddr, &conn->c_faddr);
rds_stats_inc(s_conn_reset);
rds_send_path_reset(cp);
cp->cp_flags = 0;
/* Do not clear next_rx_seq here, else we cannot disti... | 0 | [
"CWE-401"
] | linux | 5f9562ebe710c307adc5f666bf1a2162ee7977c0 | 214,140,896,395,837,360,000,000,000,000,000,000,000 | 16 | rds: memory leak in __rds_conn_create()
__rds_conn_create() did not release conn->c_path when loop_trans != 0 and
trans->t_prefer_loopback != 0 and is_outgoing == 0.
Fixes: aced3ce57cd3 ("RDS tcp loopback connection can hang")
Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
Reviewed-by: Sharath Srinivasan <sharath.srini... |
static u64 mem_cgroup_read(struct cgroup *cont, struct cftype *cft)
{
struct mem_cgroup *memcg = mem_cgroup_from_cont(cont);
u64 val;
int type, name;
type = MEMFILE_TYPE(cft->private);
name = MEMFILE_ATTR(cft->private);
switch (type) {
case _MEM:
if (name == RES_USAGE)
val = mem_cgroup_usage(memcg, false);... | 0 | [
"CWE-264"
] | linux-2.6 | 1a5a9906d4e8d1976b701f889d8f35d54b928f25 | 189,054,926,257,050,680,000,000,000,000,000,000,000 | 27 | 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 tipc_crypto_work_rx(struct work_struct *work)
{
struct delayed_work *dwork = to_delayed_work(work);
struct tipc_crypto *rx = container_of(dwork, struct tipc_crypto, work);
struct tipc_crypto *tx = tipc_net(rx->net)->crypto_tx;
unsigned long delay = msecs_to_jiffies(5000);
bool resched = false;
u8 key;... | 0 | [
"CWE-20"
] | linux | fa40d9734a57bcbfa79a280189799f76c88f7bb0 | 219,905,428,189,842,940,000,000,000,000,000,000,000 | 53 | tipc: fix size validations for the MSG_CRYPTO type
The function tipc_crypto_key_rcv is used to parse MSG_CRYPTO messages
to receive keys from other nodes in the cluster in order to decrypt any
further messages from them.
This patch verifies that any supplied sizes in the message body are
valid for the received message... |
lou_version(void) {
static char *version = PACKAGE_VERSION;
return version;
} | 0 | [
"CWE-787"
] | liblouis | fb2bfce4ed49ac4656a8f7e5b5526e4838da1dde | 4,408,214,648,562,198,000,000,000,000,000,000,000 | 4 | Fix yet another buffer overflow in the braille table parser
Reported by Henri Salo
Fixes #592 |
static char *format_duration(u64 dur, u32 timescale, char *szDur)
{
u32 h, m, s, ms;
if ((dur==(u64) -1) || (dur==(u32) -1)) {
strcpy(szDur, "Unknown");
return szDur;
}
dur = (u64) (( ((Double) (s64) dur)/timescale)*1000);
h = (u32) (dur / 3600000);
m = (u32) (dur/ 60000) - h*60;
s = (u32) (dur/1000) - h*... | 0 | [
"CWE-476",
"CWE-401"
] | gpac | 289ffce3e0d224d314f5f92a744d5fe35999f20b | 188,631,698,787,093,130,000,000,000,000,000,000,000 | 32 | fixed #1767 (fuzz) |
CodingReturnValue LeptonCodec::ThreadState::vp8_decode_thread(unsigned int thread_id,
UncompressedComponents *const colldata) {
Sirikata::Array1d<uint32_t, (uint32_t)ColorChannel::NumBlockTypes> component_size_in_blocks;
BlockBasedImagePerChannel<fal... | 1 | [
"CWE-1187"
] | lepton | 82167c144a322cc956da45407f6dce8d4303d346 | 63,154,372,217,943,760,000,000,000,000,000,000,000 | 42 | fix #87 : always check that threads_required set up the appropriate number of threads---fire off nop functions on unused threads for consistency |
const char *am_post_mkform_multipart(request_rec *r, const char *post_data)
{
const char *mime_part;
const char *boundary;
char *l1;
char *post_form = "";
/* Replace CRLF by LF */
post_data = am_strip_cr(r, post_data);
if ((boundary = am_xstrtok(r, post_data, "\n", &l1)) == NULL) {
... | 0 | [] | mod_auth_mellon | 6bdda9170a8f1757dabc5b109958657417728018 | 333,985,584,956,038,900,000,000,000,000,000,000,000 | 64 | 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. |
TEST(IndexBoundsBuilderTest, TranslateLtCode) {
auto testIndex = buildSimpleIndexEntry();
BSONObj obj = BSON("a" << BSON("$lt" << BSONCode("function(){ return 0; }")));
auto expr = parseMatchExpression(obj);
BSONElement elt = obj.firstElement();
OrderedIntervalList oil;
IndexBoundsBuilder::Bound... | 0 | [
"CWE-754"
] | mongo | f8f55e1825ee5c7bdb3208fc7c5b54321d172732 | 338,303,307,825,955,680,000,000,000,000,000,000,000 | 15 | SERVER-44377 generate correct plan for indexed inequalities to null |
void CLASS smal_decode_segment(unsigned seg[2][2], int holes)
{
uchar hist[3][13] = {{7, 7, 0, 0, 63, 55, 47, 39, 31, 23, 15, 7, 0},
{7, 7, 0, 0, 63, 55, 47, 39, 31, 23, 15, 7, 0},
{3, 3, 0, 0, 63, 47, 31, 15, 0}};
int low, high = 0xff, carry = 0, nbits = 8;
int pix, ... | 0 | [
"CWE-476",
"CWE-119"
] | LibRaw | d7c3d2cb460be10a3ea7b32e9443a83c243b2251 | 308,697,786,530,749,130,000,000,000,000,000,000,000 | 77 | Secunia SA75000 advisory: several buffer overruns |
static void init_meminfo(RedMemSlotInfo *mem_info)
{
memslot_info_init(mem_info, 1 /* groups */, 1 /* slots */, 1, 1, 0);
memslot_info_add_slot(mem_info, 0, 0, 0 /* delta */, 0 /* start */, ~0ul /* end */, 0 /* generation */);
} | 0 | [
"CWE-193"
] | spice | a4a16ac42d2f19a17e36556546aa94d5cd83745f | 136,043,993,123,007,240,000,000,000,000,000,000,000 | 5 | memslot: Fix off-by-one error in group/slot boundary check
RedMemSlotInfo keeps an array of groups, and each group contains an
array of slots. Unfortunately, these checks are off by 1, they check
that the index is greater or equal to the number of elements in the
array, while these arrays are 0 based. The check should... |
CImg<T> get_closing(const unsigned int sx, const unsigned int sy, const unsigned int sz=1) const {
if (is_empty() || (sx<=1 && sy<=1 && sz<=1)) return *this;
const int sx1 = (int)(sx - 1)/2, sy1 = (int)(sy - 1)/2, sz1 = (int)(sz - 1)/2;
CImg<T> res;
if (_depth>1) { // 3D
get_resize(w... | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 138,630,787,600,552,420,000,000,000,000,000,000,000 | 19 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.