func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
void vmx_disable_intercept_for_msr(struct kvm_vcpu *vcpu, u32 msr, int type)
{
struct vcpu_vmx *vmx = to_vmx(vcpu);
unsigned long *msr_bitmap = vmx->vmcs01.msr_bitmap;
if (!cpu_has_vmx_msr_bitmap())
return;
vmx_msr_bitmap_l01_changed(vmx);
/*
* Mark the desired intercept state in shadow bitmap, this is need... | 0 | [
"CWE-703"
] | linux | 6cd88243c7e03845a450795e134b488fc2afb736 | 139,647,362,065,274,940,000,000,000,000,000,000,000 | 43 | 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 ... |
format_NOTE(const struct ofpact_note *a,
const struct ofpact_format_params *fp)
{
ds_put_format(fp->s, "%snote:%s", colors.param, colors.end);
format_hex_arg(fp->s, a->data, a->length);
} | 0 | [
"CWE-416"
] | ovs | 77cccc74deede443e8b9102299efc869a52b65b2 | 57,958,456,040,213,450,000,000,000,000,000,000,000 | 6 | ofp-actions: Fix use-after-free while decoding RAW_ENCAP.
While decoding RAW_ENCAP action, decode_ed_prop() might re-allocate
ofpbuf if there is no enough space left. However, function
'decode_NXAST_RAW_ENCAP' continues to use old pointer to 'encap'
structure leading to write-after-free and incorrect decoding.
==3... |
void *SSL_CTX_get_ex_data(const SSL_CTX *s, int idx)
{
return (CRYPTO_get_ex_data(&s->ex_data, idx));
} | 0 | [
"CWE-310"
] | openssl | 56f1acf5ef8a432992497a04792ff4b3b2c6f286 | 321,281,580,268,713,300,000,000,000,000,000,000,000 | 4 | Disable SSLv2 default build, default negotiation and weak ciphers.
SSLv2 is by default disabled at build-time. Builds that are not
configured with "enable-ssl2" will not support SSLv2. Even if
"enable-ssl2" is used, users who want to negotiate SSLv2 via the
version-flexible SSLv23_method() will need to explicitly ca... |
static int __kvm_write_guest_page(struct kvm_memory_slot *memslot, gfn_t gfn,
const void *data, int offset, int len)
{
int r;
unsigned long addr;
addr = gfn_to_hva_memslot(memslot, gfn);
if (kvm_is_error_hva(addr))
return -EFAULT;
r = __copy_to_user((void __user *)addr + offset, data, len);
if (r)... | 0 | [
"CWE-416"
] | linux | 0774a964ef561b7170d8d1b1bfe6f88002b6d219 | 196,831,685,759,873,300,000,000,000,000,000,000,000 | 15 | 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... |
void Lex_select_lock::set_to(SELECT_LEX *sel)
{
if (defined_lock)
{
if (sel->master_unit() &&
sel == sel->master_unit()->fake_select_lex)
sel->master_unit()->set_lock_to_the_last_select(*this);
else
{
sel->parent_lex->safe_to_cache_query= 0;
if (update_lock)
{
sel... | 0 | [
"CWE-703"
] | server | 39feab3cd31b5414aa9b428eaba915c251ac34a2 | 114,224,371,726,128,300,000,000,000,000,000,000,000 | 23 | 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... |
void jslGetTokenString(char *str, size_t len) {
if (lex->tk == LEX_ID) {
espruino_snprintf(str, len, "ID:%s", jslGetTokenValueAsString());
} else if (lex->tk == LEX_STR) {
espruino_snprintf(str, len, "String:'%s'", jslGetTokenValueAsString());
} else
jslTokenAsString(lex->tk, str, len);
} | 0 | [
"CWE-787"
] | Espruino | bed844f109b6c222816740555068de2e101e8018 | 235,366,169,233,064,900,000,000,000,000,000,000,000 | 8 | remove strncpy usage as it's effectively useless, replace with an assertion since fn is only used internally (fix #1426) |
static inline void shift_rfc5988(php_http_buffer_t *buf, char *key_str, size_t key_len, const char *ass, size_t asl, unsigned flags TSRMLS_DC)
{
char *str;
size_t len;
if (buf->used) {
php_http_buffer_append(buf, ass, asl);
}
prepare_key(flags, key_str, key_len, &str, &len TSRMLS_CC);
php_http_buffer_appends(... | 0 | [
"CWE-399",
"CWE-704"
] | ext-http | 17137d4ab1ce81a2cee0fae842340a344ef3da83 | 275,206,803,156,550,630,000,000,000,000,000,000,000 | 15 | fix bug #73055 |
free_scrollback(term_T *term)
{
int i;
for (i = 0; i < term->tl_scrollback.ga_len; ++i)
vim_free(((sb_line_T *)term->tl_scrollback.ga_data + i)->sb_cells);
ga_clear(&term->tl_scrollback);
} | 0 | [
"CWE-476"
] | vim | cd929f7ba8cc5b6d6dcf35c8b34124e969fed6b8 | 312,922,041,371,954,400,000,000,000,000,000,000,000 | 8 | patch 8.1.0633: crash when out of memory while opening a terminal window
Problem: Crash when out of memory while opening a terminal window.
Solution: Handle out-of-memory more gracefully. |
adapter_notify_cb (Adapter1 *adapter,
GParamSpec *pspec,
BluetoothClient *client)
{
BluetoothClientPrivate *priv = BLUETOOTH_CLIENT_GET_PRIVATE(client);
const char *property = g_param_spec_get_name (pspec);
GtkTreeIter iter;
gboolean notify = TRUE;
gboolean is_default;
if (get_iter_from_proxy... | 0 | [] | gnome-bluetooth | 6b5086d42ea64d46277f3c93b43984f331d12f89 | 70,889,206,541,459,330,000,000,000,000,000,000,000 | 68 | lib: Fix Discoverable being reset when turned off
Work-around race in bluetoothd which would reset the discoverable
flag if a timeout change was requested before discoverable finished
being set to off:
See https://bugzilla.redhat.com/show_bug.cgi?id=1602985 |
int ha_myisam::repair(THD* thd, HA_CHECK_OPT *check_opt)
{
int error;
MI_CHECK param;
ha_rows start_records;
if (!file) return HA_ADMIN_INTERNAL_ERROR;
myisamchk_init(¶m);
param.thd = thd;
param.op_name= "repair";
param.testflag= ((check_opt->flags & ~(T_EXTEND)) |
T_SILENT | T... | 0 | [
"CWE-362"
] | mysql-server | 4e5473862e6852b0f3802b0cd0c6fa10b5253291 | 62,985,902,012,740,840,000,000,000,000,000,000,000 | 48 | Bug#24388746: PRIVILEGE ESCALATION AND RACE CONDITION USING CREATE TABLE
During REPAIR TABLE of a MyISAM table, a temporary data file (.TMD)
is created. When repair finishes, this file is renamed to the original
.MYD file. The problem was that during this rename, we copied the
stats from the old file to the new file w... |
int audit_alloc(struct task_struct *tsk)
{
struct audit_context *context;
enum audit_state state;
char *key = NULL;
if (likely(!audit_ever_enabled))
return 0; /* Return if not auditing. */
state = audit_filter_task(tsk, &key);
if (state == AUDIT_DISABLED) {
clear_tsk_thread_flag(tsk, TIF_SYSCALL_AUDIT);... | 0 | [
"CWE-362"
] | linux | 43761473c254b45883a64441dd0bc85a42f3645c | 96,829,008,710,694,400,000,000,000,000,000,000,000 | 26 | audit: fix a double fetch in audit_log_single_execve_arg()
There is a double fetch problem in audit_log_single_execve_arg()
where we first check the execve(2) argumnets for any "bad" characters
which would require hex encoding and then re-fetch the arguments for
logging in the audit record[1]. Of course this leaves a... |
dp_packet_l4_checksum_bad(struct dp_packet *p)
{
#ifdef DPDK_NETDEV
return (p->mbuf.ol_flags & PKT_RX_L4_CKSUM_MASK) ==
PKT_RX_L4_CKSUM_BAD;
#else
return 0 && p;
#endif
} | 0 | [
"CWE-400"
] | ovs | 35c280072c1c3ed58202745b7d27fbbd0736999b | 227,417,134,869,167,140,000,000,000,000,000,000,000 | 9 | flow: Support extra padding length.
Although not required, padding can be optionally added until
the packet length is MTU bytes. A packet with extra padding
currently fails sanity checks.
Vulnerability: CVE-2020-35498
Fixes: fa8d9001a624 ("miniflow_extract: Properly handle small IP packets.")
Reported-by: Joakim Hind... |
void freeClientReplyValue(void *o) {
zfree(o);
} | 0 | [
"CWE-770"
] | redis | 5674b0057ff2903d43eaff802017eddf37c360f8 | 317,160,971,918,723,350,000,000,000,000,000,000,000 | 3 | Prevent unauthenticated client from easily consuming lots of memory (CVE-2021-32675)
This change sets a low limit for multibulk and bulk length in the
protocol for unauthenticated connections, so that they can't easily
cause redis to allocate massive amounts of memory by sending just a few
characters on the network.
T... |
describeCommand(int argc, const char *argv[], const Options &options) {
string result = "'";
result.append(argv[options.programArgStart]);
result.append("'");
if (argc > options.programArgStart + 1) {
result.append(" (with params '");
int i = options.programArgStart + 1;
while (i < argc) {
if (i != optio... | 0 | [
"CWE-284",
"CWE-732"
] | passenger | 4e97fdb86d0a0141ec9a052c6e691fcd07bb45c8 | 71,602,705,402,680,930,000,000,000,000,000,000,000 | 22 | ExecHelperMain: fix privilege lowering code |
perf_cgroup_css_alloc(struct cgroup_subsys_state *parent_css)
{
struct perf_cgroup *jc;
jc = kzalloc(sizeof(*jc), GFP_KERNEL);
if (!jc)
return ERR_PTR(-ENOMEM);
jc->info = alloc_percpu(struct perf_cgroup_info);
if (!jc->info) {
kfree(jc);
return ERR_PTR(-ENOMEM);
}
return &jc->css;
} | 0 | [
"CWE-284",
"CWE-264"
] | linux | f63a8daa5812afef4f06c962351687e1ff9ccb2b | 306,553,044,513,129,330,000,000,000,000,000,000,000 | 16 | perf: Fix event->ctx locking
There have been a few reported issues wrt. the lack of locking around
changing event->ctx. This patch tries to address those.
It avoids the whole rwsem thing; and while it appears to work, please
give it some thought in review.
What I did fail at is sensible runtime checks on the use of
... |
void json_append_escaped(string_t *dest, const char *src)
{
json_append_escaped_data(dest, (const unsigned char*)src, strlen(src));
} | 0 | [] | core | 973769d74433de3c56c4ffdf4f343cb35d98e4f7 | 8,305,653,047,797,594,000,000,000,000,000,000,000 | 4 | lib: json - Escape invalid UTF-8 as unicode bytes
This prevents dovecot from crashing if invalid UTF-8 input
is given. |
static void FNAME(update_pte)(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp,
u64 *spte, const void *pte)
{
pt_element_t gpte = *(const pt_element_t *)pte;
FNAME(prefetch_gpte)(vcpu, sp, spte, gpte, false);
} | 0 | [] | linux | b1bd5cba3306691c771d558e94baa73e8b0b96b7 | 276,804,415,627,937,200,000,000,000,000,000,000,000 | 7 | KVM: X86: MMU: Use the correct inherited permissions to get shadow page
When computing the access permissions of a shadow page, use the effective
permissions of the walk up to that point, i.e. the logic AND of its parents'
permissions. Two guest PxE entries that point at the same table gfn need to
be shadowed with di... |
static void *atalk_seq_route_next(struct seq_file *seq, void *v, loff_t *pos)
{
struct atalk_route *r;
++*pos;
if (v == SEQ_START_TOKEN) {
r = NULL;
if (atalk_routes)
r = atalk_routes;
goto out;
}
r = v;
r = r->next;
out:
return r;
} | 0 | [
"CWE-416"
] | linux | 6377f787aeb945cae7abbb6474798de129e1f3ac | 332,589,669,967,964,270,000,000,000,000,000,000,000 | 16 | appletalk: Fix use-after-free in atalk_proc_exit
KASAN report this:
BUG: KASAN: use-after-free in pde_subdir_find+0x12d/0x150 fs/proc/generic.c:71
Read of size 8 at addr ffff8881f41fe5b0 by task syz-executor.0/2806
CPU: 0 PID: 2806 Comm: syz-executor.0 Not tainted 5.0.0-rc7+ #45
Hardware name: QEMU Standard PC (i440... |
e1000e_on_tx_done_update_stats(E1000ECore *core, struct NetTxPkt *tx_pkt)
{
static const int PTCregs[6] = { PTC64, PTC127, PTC255, PTC511,
PTC1023, PTC1522 };
size_t tot_len = net_tx_pkt_get_total_len(tx_pkt);
e1000x_increase_size_stats(core->mac, PTCregs, tot_len);
... | 0 | [
"CWE-835"
] | qemu | 4154c7e03fa55b4cf52509a83d50d6c09d743b77 | 11,080,143,991,240,895,000,000,000,000,000,000,000 | 28 | net: e1000e: fix an infinite loop issue
This issue is like the issue in e1000 network card addressed in
this commit:
e1000: eliminate infinite loops on out-of-bounds transfer start.
Signed-off-by: Li Qiang <liqiang6-s@360.cn>
Reviewed-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.... |
PALETTE_UPDATE* update_read_palette(rdpUpdate* update, wStream* s)
{
int i;
PALETTE_ENTRY* entry;
PALETTE_UPDATE* palette_update = calloc(1, sizeof(PALETTE_UPDATE));
if (!palette_update)
goto fail;
if (Stream_GetRemainingLength(s) < 6)
goto fail;
Stream_Seek_UINT16(s); /* pad2Octets (2 bytes) */
Stream_Re... | 0 | [
"CWE-119",
"CWE-787"
] | FreeRDP | 445a5a42c500ceb80f8fa7f2c11f3682538033f3 | 184,844,355,000,507,500,000,000,000,000,000,000,000 | 36 | Fixed CVE-2018-8786
Thanks to Eyal Itkin from Check Point Software Technologies. |
static int show_map(struct seq_file *m, void *v)
{
struct vm_area_struct *vma = v;
struct proc_maps_private *priv = m->private;
struct task_struct *task = priv->task;
show_map_vma(m, vma);
if (m->count < m->size) /* vma is copied successfully */
m->version = (vma != get_gate_vma(task->mm))
? vma->vm_start ... | 0 | [
"CWE-264"
] | linux-2.6 | 1a5a9906d4e8d1976b701f889d8f35d54b928f25 | 243,866,402,119,498,970,000,000,000,000,000,000,000 | 13 | 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 int dw3101_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
int num)
{
struct dvb_usb_device *d = i2c_get_adapdata(adap);
int ret;
int i;
if (!d)
return -ENODEV;
if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
return -EAGAIN;
switch (num) {
case 2: {
/* read */
/* first writ... | 0 | [
"CWE-476",
"CWE-119"
] | linux | 606142af57dad981b78707234cfbd15f9f7b7125 | 338,314,184,765,585,700,000,000,000,000,000,000,000 | 79 | [media] dw2102: don't do DMA on stack
On Kernel 4.9, WARNINGs about doing DMA on stack are hit at
the dw2102 driver: one in su3000_power_ctrl() and the other in tt_s2_4600_frontend_attach().
Both were due to the use of buffers on the stack as parameters to
dvb_usb_generic_rw() and the resulting attempt to do DMA with... |
void LibRaw::identify_process_dng_fields()
{
if (!dng_version) return;
int c;
{
/* copy DNG data from per-IFD field to color.dng */
int iifd = find_ifd_by_offset(data_offset);
int pifd = find_ifd_by_offset(thumb_offset);
#define CFAROUND(value, filters) \
filter... | 1 | [
"CWE-787"
] | LibRaw | 4feaed4dea636cee4fee010f615881ccf76a096d | 208,600,525,321,410,370,000,000,000,000,000,000,000 | 344 | limit loops to MIN(colors,4) in dng fields parser |
static int psi_memory_open(struct inode *inode, struct file *file)
{
return single_open(file, psi_memory_show, NULL);
} | 0 | [
"CWE-787"
] | linux | 6fcca0fa48118e6d63733eb4644c6cd880c15b8f | 259,776,371,159,277,740,000,000,000,000,000,000,000 | 4 | sched/psi: Fix OOB write when writing 0 bytes to PSI files
Issuing write() with count parameter set to 0 on any file under
/proc/pressure/ will cause an OOB write because of the access to
buf[buf_size-1] when NUL-termination is performed. Fix this by checking
for buf_size to be non-zero.
Signed-off-by: Suren Baghdasa... |
static void setup_min_unmapped_ratio(void)
{
pg_data_t *pgdat;
struct zone *zone;
for_each_online_pgdat(pgdat)
pgdat->min_unmapped_pages = 0;
for_each_zone(zone)
zone->zone_pgdat->min_unmapped_pages += (zone->managed_pages *
sysctl_min_unmapped_ratio) / 100;
} | 0 | [] | linux | 400e22499dd92613821374c8c6c88c7225359980 | 121,223,267,701,591,520,000,000,000,000,000,000,000 | 12 | mm: don't warn about allocations which stall for too long
Commit 63f53dea0c98 ("mm: warn about allocations which stall for too
long") was a great step for reducing possibility of silent hang up
problem caused by memory allocation stalls. But this commit reverts it,
for it is possible to trigger OOM lockup and/or soft... |
static void printFlowsStats() {
int thread_id;
u_int32_t total_flows = 0;
FILE *out = results_file ? results_file : stdout;
if(enable_payload_analyzer)
ndpi_report_payload_stats();
for(thread_id = 0; thread_id < num_threads; thread_id++)
total_flows += ndpi_thread_info[thread_id].workflow->num_alloc... | 0 | [
"CWE-125"
] | nDPI | b7e666e465f138ae48ab81976726e67deed12701 | 161,763,489,491,147,400,000,000,000,000,000,000,000 | 402 | Added fix to avoid potential heap buffer overflow in H.323 dissector
Modified HTTP report information to make it closer to the HTTP field names |
transformConstraintAttrs(CreateStmtContext *cxt, List *constraintList)
{
Constraint *lastprimarycon = NULL;
bool saw_deferrability = false;
bool saw_initially = false;
ListCell *clist;
#define SUPPORTS_ATTRS(node) \
((node) != NULL && \
((node)->contype == CONSTR_PRIMARY || \
(node)->contype == C... | 0 | [
"CWE-362"
] | postgres | 5f173040e324f6c2eebb90d86cf1b0cdb5890f0a | 157,156,633,598,768,790,000,000,000,000,000,000,000 | 110 | Avoid repeated name lookups during table and index DDL.
If the name lookups come to different conclusions due to concurrent
activity, we might perform some parts of the DDL on a different table
than other parts. At least in the case of CREATE INDEX, this can be
used to cause the permissions checks to be performed aga... |
static void test_bug1180()
{
MYSQL_STMT *stmt;
int rc;
MYSQL_BIND my_bind[1];
ulong length[1];
char szData[11];
char query[MAX_TEST_QUERY_LENGTH];
myheader("test_select_bug");
rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_select");
myquery(rc);
rc= mysql_query(mysql, "CREATE TABLE test_select... | 0 | [
"CWE-284",
"CWE-295"
] | mysql-server | 3bd5589e1a5a93f9c224badf983cd65c45215390 | 251,982,225,102,621,520,000,000,000,000,000,000,000 | 82 | WL#6791 : Redefine client --ssl option to imply enforced encryption
# Changed the meaning of the --ssl=1 option of all client binaries
to mean force ssl, not try ssl and fail over to eunecrypted
# Added a new MYSQL_OPT_SSL_ENFORCE mysql_options()
option to specify that an ssl connection is required.
# Added a new macr... |
bool MYSQL_BIN_LOG::open(const char *log_name,
enum_log_type log_type_arg,
const char *new_name,
enum cache_type io_cache_type_arg,
bool no_auto_events_arg,
ulong max_size_arg,
... | 0 | [
"CWE-264"
] | mysql-server | 48bd8b16fe382be302c6f0b45931be5aa6f29a0e | 251,088,183,811,312,130,000,000,000,000,000,000,000 | 197 | Bug#24388753: PRIVILEGE ESCALATION USING MYSQLD_SAFE
[This is the 5.5/5.6 version of the bugfix].
The problem was that it was possible to write log files ending
in .ini/.cnf that later could be parsed as an options file.
This made it possible for users to specify startup options
without the permissions to do so.
Thi... |
RZ_IPI bool rz_core_analysis_var_rename(RzCore *core, const char *name, const char *newname) {
RzAnalysisOp *op = rz_core_analysis_op(core, core->offset, RZ_ANALYSIS_OP_MASK_BASIC);
if (!name) {
RzAnalysisVar *var = op ? rz_analysis_get_used_function_var(core->analysis, op->addr) : NULL;
if (var) {
name = var-... | 0 | [
"CWE-703"
] | rizin | 6ce71d8aa3dafe3cdb52d5d72ae8f4b95916f939 | 302,815,416,389,437,000,000,000,000,000,000,000,000 | 29 | 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 kvm_vcpu_mmap(struct file *file, struct vm_area_struct *vma)
{
struct kvm_vcpu *vcpu = file->private_data;
unsigned long pages = vma_pages(vma);
if ((kvm_page_in_dirty_ring(vcpu->kvm, vma->vm_pgoff) ||
kvm_page_in_dirty_ring(vcpu->kvm, vma->vm_pgoff + pages - 1)) &&
((vma->vm_flags & VM_EXEC)... | 0 | [
"CWE-459"
] | linux | 683412ccf61294d727ead4a73d97397396e69a6b | 50,079,052,136,909,240,000,000,000,000,000,000,000 | 13 | 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... |
static void oidc_copy_tokens_to_request_state(request_rec *r,
oidc_session_t *session, const char **s_id_token, const char **s_claims) {
const char *id_token = NULL, *claims = NULL;
oidc_session_get(r, session, OIDC_IDTOKEN_CLAIMS_SESSION_KEY, &id_token);
oidc_session_get(r, session, OIDC_CLAIMS_SESSION_KEY, &cl... | 0 | [
"CWE-20"
] | mod_auth_openidc | 612e309bfffd6f9b8ad7cdccda3019fc0865f3b4 | 312,808,217,966,622,180,000,000,000,000,000,000,000 | 22 | don't echo query params on invalid requests to redirect URI; closes #212
thanks @LukasReschke; I'm sure there's some OWASP guideline that warns
against this |
char const* qpdf_get_user_password(qpdf_data qpdf)
{
QTC::TC("qpdf", "qpdf-c called qpdf_get_user_password");
qpdf->tmp_string = qpdf->qpdf->getTrimmedUserPassword();
return qpdf->tmp_string.c_str();
} | 0 | [
"CWE-787"
] | qpdf | d71f05ca07eb5c7cfa4d6d23e5c1f2a800f52e8e | 296,674,275,479,653,930,000,000,000,000,000,000,000 | 6 | Fix sign and conversion warnings (major)
This makes all integer type conversions that have potential data loss
explicit with calls that do range checks and raise an exception. After
this commit, qpdf builds with no warnings when -Wsign-conversion
-Wconversion is used with gcc or clang or when -W3 -Wd4800 is used
with ... |
static int wc_ecc_import_raw_private(ecc_key* key, const char* qx,
const char* qy, const char* d, int curve_id, int encType)
{
int err = MP_OKAY;
/* if d is NULL, only import as public key using Qx,Qy */
if (key == NULL || qx == NULL || qy == NULL) {
return BAD_FUNC_ARG;
}
/* mak... | 0 | [
"CWE-200"
] | wolfssl | 9b9568d500f31f964af26ba8d01e542e1f27e5ca | 79,105,090,728,500,955,000,000,000,000,000,000,000 | 94 | Change ECDSA signing to use blinding. |
process_copy_pass (void)
{
dynamic_string input_name = DYNAMIC_STRING_INITIALIZER;
/* Name of file from stdin. */
dynamic_string output_name = DYNAMIC_STRING_INITIALIZER;
/* Name of new file. */
size_t dirname_len; /* Length of `directory_name'. ... | 0 | [
"CWE-190"
] | cpio | dd96882877721703e19272fe25034560b794061b | 39,048,161,276,941,516,000,000,000,000,000,000,000 | 284 | 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... |
OPJ_BOOL OPJ_CALLCONV opj_codec_set_threads(opj_codec_t *p_codec,
int num_threads)
{
if (p_codec && (num_threads >= 0)) {
opj_codec_private_t * l_codec = (opj_codec_private_t *) p_codec;
return l_codec->opj_set_threads(l_codec->m_codec, (OPJ_UINT32)num_threads);
}
return OPJ_FALSE;
... | 0 | [
"CWE-20"
] | openjpeg | 4edb8c83374f52cd6a8f2c7c875e8ffacccb5fa5 | 68,202,357,936,966,140,000,000,000,000,000,000,000 | 10 | Add support for generation of PLT markers in encoder
* -PLT switch added to opj_compress
* Add a opj_encoder_set_extra_options() function that
accepts a PLT=YES option, and could be expanded later
for other uses.
-------
Testing with a Sentinel2 10m band, T36JTT_20160914T074612_B02.jp2,
coming from S2A_MSIL1C_20... |
name_add(regex_t* reg, UChar* name, UChar* name_end, int backref, ScanEnv* env)
{
int r;
int alloc;
NameEntry* e;
NameTable* t = (NameTable* )reg->name_table;
if (name_end - name <= 0)
return ONIGERR_EMPTY_GROUP_NAME;
e = name_find(reg, name, name_end);
if (IS_NULL(e)) {
#ifdef USE_ST_LIBRARY
if... | 0 | [
"CWE-400",
"CWE-399",
"CWE-674"
] | oniguruma | 4097828d7cc87589864fecf452f2cd46c5f37180 | 298,910,835,391,922,200,000,000,000,000,000,000,000 | 111 | fix #147: Stack Exhaustion Problem caused by some parsing functions in regcomp.c making recursive calls to themselves. |
Status AttrValueHasType(const AttrValue& attr_value, StringPiece type) {
int num_set = 0;
#define VALIDATE_FIELD(name, type_string, oneof_case) \
do { \
if (attr_value.has_list()) { ... | 0 | [
"CWE-369",
"CWE-674"
] | tensorflow | e07e1c3d26492c06f078c7e5bf2d138043e199c1 | 316,030,032,876,330,760,000,000,000,000,000,000,000 | 97 | Prevent memory overflow in ParseAttrValue from nested tensors.
PiperOrigin-RevId: 370108442
Change-Id: I84d64a5e8895a6aeffbf4749841b4c54d51b5889 |
static void dp8393x_register_types(void)
{
type_register_static(&dp8393x_info);
} | 0 | [] | qemu | 915976bd98a9286efe6f2e573cb4f1360603adf9 | 96,368,186,639,526,600,000,000,000,000,000,000,000 | 4 | hw/net/dp8393x: fix integer underflow in dp8393x_do_transmit_packets()
An integer underflow could occur during packet transmission due to 'tx_len' not
being updated if SONIC_TFC register is set to zero. Check for negative 'tx_len'
when removing existing FCS.
RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1899722
S... |
static int mboxlist_do_find(struct find_rock *rock, const strarray_t *patterns)
{
const char *userid = rock->userid;
int isadmin = rock->isadmin;
int crossdomains = config_getswitch(IMAPOPT_CROSSDOMAINS);
char inbox[MAX_MAILBOX_BUFFER];
size_t inboxlen = 0;
size_t prefixlen, len;
size_t dom... | 1 | [
"CWE-20"
] | cyrus-imapd | 6bd33275368edfa71ae117de895488584678ac79 | 219,678,618,987,335,300,000,000,000,000,000,000,000 | 210 | mboxlist: fix uninitialised memory use where pattern is "Other Users" |
qboolean FS_SV_FileExists( const char *file )
{
char *testpath;
testpath = FS_BuildOSPath( fs_homepath->string, file, "");
testpath[strlen(testpath)-1] = '\0';
return FS_FileInPathExists(testpath);
} | 0 | [
"CWE-269"
] | ioq3 | 376267d534476a875d8b9228149c4ee18b74a4fd | 207,469,401,182,169,160,000,000,000,000,000,000,000 | 9 | Don't load .pk3s as .dlls, and don't load user config files from .pk3s. |
check_NOTE(const struct ofpact_note *a OVS_UNUSED,
const struct ofpact_check_params *cp OVS_UNUSED)
{
return 0;
} | 0 | [
"CWE-416"
] | ovs | 77cccc74deede443e8b9102299efc869a52b65b2 | 312,748,632,885,792,720,000,000,000,000,000,000,000 | 5 | ofp-actions: Fix use-after-free while decoding RAW_ENCAP.
While decoding RAW_ENCAP action, decode_ed_prop() might re-allocate
ofpbuf if there is no enough space left. However, function
'decode_NXAST_RAW_ENCAP' continues to use old pointer to 'encap'
structure leading to write-after-free and incorrect decoding.
==3... |
static inline uint8 number_storage_requirement(uint32 n)
{
return n < 256 ? 1 : n < 65536 ? 2 : n < 16777216 ? 3 : 4;
} | 0 | [
"CWE-416",
"CWE-703"
] | server | 08c7ab404f69d9c4ca6ca7a9cf7eec74c804f917 | 140,035,964,875,572,610,000,000,000,000,000,000,000 | 4 | MDEV-24176 Server crashes after insert in the table with virtual
column generated using date_format() and if()
vcol_info->expr is allocated on expr_arena at parsing stage. Since
expr item is allocated on expr_arena all its containee items must be
allocated on expr_arena too. Otherwise fix_session_expr() will
encounter... |
gpa_t kvm_mmu_gva_to_gpa_fetch(struct kvm_vcpu *vcpu, gva_t gva, u32 *error)
{
u32 access = (kvm_x86_ops->get_cpl(vcpu) == 3) ? PFERR_USER_MASK : 0;
access |= PFERR_FETCH_MASK;
return vcpu->arch.walk_mmu->gva_to_gpa(vcpu, gva, access, error);
} | 0 | [
"CWE-200"
] | kvm | 831d9d02f9522e739825a51a11e3bc5aa531a905 | 291,755,666,404,237,870,000,000,000,000,000,000,000 | 6 | 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... |
struct file_list *send_file_list(int f, int argc, char *argv[])
{
static const char *lastdir;
static int lastdir_len = -1;
int len, dirlen;
STRUCT_STAT st;
char *p, *dir;
struct file_list *flist;
struct timeval start_tv, end_tv;
int64 start_write;
int use_ff_fd = 0;
int disable_buffering, reenable_multiplex =... | 0 | [] | rsync | b7231c7d02cfb65d291af74ff66e7d8c507ee871 | 179,186,535,337,555,200,000,000,000,000,000,000,000 | 368 | Some extra file-list safety checks. |
static int kvm_mmu_unprotect_page_virt(struct kvm_vcpu *vcpu, gva_t gva)
{
gpa_t gpa;
int r;
if (vcpu->arch.mmu->direct_map)
return 0;
gpa = kvm_mmu_gva_to_gpa_read(vcpu, gva, NULL);
r = kvm_mmu_unprotect_page(vcpu->kvm, gpa >> PAGE_SHIFT);
return r;
} | 0 | [
"CWE-476"
] | linux | 9f46c187e2e680ecd9de7983e4d081c3391acc76 | 200,887,416,653,273,530,000,000,000,000,000,000,000 | 14 | 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... |
void quota_release_context(quota_ctx_t *qctx)
{
errcode_t err;
dict_t *dict;
enum quota_type qtype;
quota_ctx_t ctx;
if (!qctx)
return;
ctx = *qctx;
for (qtype = 0; qtype < MAXQUOTAS; qtype++) {
dict = ctx->quota_dict[qtype];
ctx->quota_dict[qtype] = 0;
if (dict) {
dict_free_nodes(dict);
free(dic... | 0 | [
"CWE-787"
] | e2fsprogs | 8dbe7b475ec5e91ed767239f0e85880f416fc384 | 246,781,047,687,746,060,000,000,000,000,000,000,000 | 30 | libsupport: add checks to prevent buffer overrun bugs in quota code
A maliciously corrupted file systems can trigger buffer overruns in
the quota code used by e2fsck. To fix this, add sanity checks to the
quota header fields as well as to block number references in the quota
tree.
Addresses: CVE-2019-5094
Addresses:... |
void abytewriter::reset( void )
{
// set position of current byte
cbyte = 0;
} | 0 | [
"CWE-1187"
] | lepton | 82167c144a322cc956da45407f6dce8d4303d346 | 229,936,151,320,007,880,000,000,000,000,000,000,000 | 5 | fix #87 : always check that threads_required set up the appropriate number of threads---fire off nop functions on unused threads for consistency |
rotateContigSamples16bits(uint16 rotation, uint16 spp, uint16 bps, uint32 width,
uint32 length, uint32 col, uint8 *src, uint8 *dst)
{
int ready_bits = 0;
uint32 row, rowsize, bit_offset;
uint32 src_byte = 0, src_bit = 0;
uint16 matchbits = 0, maskbits = 0;
uint16 buf... | 0 | [
"CWE-125"
] | libtiff | 21d39de1002a5e69caa0574b2cc05d795d6fbfad | 116,067,321,049,433,450,000,000,000,000,000,000,000 | 81 | * tools/tiffcrop.c: fix multiple uint32 overflows in
writeBufferToSeparateStrips(), writeBufferToContigTiles() and
writeBufferToSeparateTiles() that could cause heap buffer overflows.
Reported by Henri Salo from Nixu Corporation.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2592 |
bool st_select_lex::collect_grouping_fields(THD *thd)
{
grouping_tmp_fields.empty();
for (ORDER *ord= group_list.first; ord; ord= ord->next)
{
Item *item= *ord->item;
if (item->type() != Item::FIELD_ITEM &&
!(item->type() == Item::REF_ITEM &&
item->real_type() == Item::FIELD_ITEM &&
... | 0 | [
"CWE-703"
] | server | 39feab3cd31b5414aa9b428eaba915c251ac34a2 | 168,032,292,614,605,800,000,000,000,000,000,000,000 | 23 | 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... |
R_API void r_bin_java_print_local_variable_table_attr_summary(RBinJavaAttrInfo *attr) {
RBinJavaLocalVariableAttribute *lvattr;
RListIter *iter, *iter_tmp;
if (attr == NULL) {
eprintf ("Attempting to print an invalid RBinJavaAttrInfo *LocalVariableTable.\n");
return;
}
Eprintf ("Local Variable Table Attribute ... | 0 | [
"CWE-787"
] | radare2 | 9650e3c352f675687bf6c6f65ff2c4a3d0e288fa | 263,220,474,737,828,040,000,000,000,000,000,000,000 | 15 | Fix oobread segfault in java arith8.class ##crash
* Reported by Cen Zhang via huntr.dev |
int removeServiceTable(IXML_Node *node, service_table *in)
{
IXML_Node *root = NULL;
IXML_Node *currentUDN = NULL;
DOMString UDN = NULL;
IXML_NodeList *deviceList = NULL;
service_info *current_service = NULL;
service_info *start_search = NULL;
service_info *prev_service = NULL;
long unsigned int NumOfDevices = ... | 0 | [
"CWE-476"
] | pupnp | c805c1de1141cb22f74c0d94dd5664bda37398e0 | 31,963,404,102,913,016,000,000,000,000,000,000,000 | 71 | Fixes #177: NULL pointer dereference in FindServiceControlURLPath
Also fixes its dual bug in FindServiceEventURLPath. |
decodeJsonStructure(void *dst, const UA_DataType *type, CtxJson *ctx,
ParseCtx *parseCtx, UA_Boolean moveToken) {
(void) moveToken;
/* Check the recursion limit */
if(ctx->depth > UA_JSON_ENCODING_MAX_RECURSION)
return UA_STATUSCODE_BADENCODINGERROR;
ctx->depth++;
uintp... | 1 | [
"CWE-703",
"CWE-787"
] | open62541 | c800e2987b10bb3af6ef644b515b5d6392f8861d | 168,823,190,153,558,730,000,000,000,000,000,000,000 | 43 | fix(json): Check max recursion depth in more places |
void kvm_after_handle_nmi(struct kvm_vcpu *vcpu)
{
percpu_write(current_vcpu, NULL);
} | 0 | [
"CWE-200"
] | kvm | 831d9d02f9522e739825a51a11e3bc5aa531a905 | 146,110,685,887,026,970,000,000,000,000,000,000,000 | 4 | 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... |
sg_proc_init(void)
{
int num_leaves = ARRAY_SIZE(sg_proc_leaf_arr);
int k;
sg_proc_sgp = proc_mkdir(sg_proc_sg_dirname, NULL);
if (!sg_proc_sgp)
return 1;
for (k = 0; k < num_leaves; ++k) {
const struct sg_proc_leaf *leaf = &sg_proc_leaf_arr[k];
umode_t mask = leaf->fops->write ? S_IRUGO | S_IWUSR : S_IRUGO... | 0 | [
"CWE-190",
"CWE-189"
] | linux | fdc81f45e9f57858da6351836507fbcf1b7583ee | 110,120,547,400,095,540,000,000,000,000,000,000,000 | 15 | sg_start_req(): use import_iovec()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> |
static void WriteBinaryGltfStream(std::ostream &stream,
const std::string &content,
const std::vector<unsigned char> &binBuffer) {
const std::string header = "glTF";
const int version = 2;
const uint32_t content_size = uint32_t(content.size());
... | 1 | [
"CWE-20"
] | tinygltf | 52ff00a38447f06a17eab1caa2cf0730a119c751 | 135,689,357,842,700,160,000,000,000,000,000,000,000 | 55 | Do not expand file path since its not necessary for glTF asset path(URI) and for security reason(`wordexp`). |
static void context_stop(struct context *ctx)
{
u32 reg;
int i;
reg_write(ctx->ohci, CONTROL_CLEAR(ctx->regs), CONTEXT_RUN);
flush_writes(ctx->ohci);
for (i = 0; i < 10; i++) {
reg = reg_read(ctx->ohci, CONTROL_SET(ctx->regs));
if ((reg & CONTEXT_ACTIVE) == 0)
return;
mdelay(1);
}
fw_error("Error: DM... | 0 | [
"CWE-399"
] | linux-2.6 | 8c0c0cc2d9f4c523fde04bdfe41e4380dec8ee54 | 303,007,408,349,644,500,000,000,000,000,000,000,000 | 17 | firewire: ohci: handle receive packets with a data length of zero
Queueing to receive an ISO packet with a payload length of zero
silently does nothing in dualbuffer mode, and crashes the kernel in
packet-per-buffer mode. Return an error in dualbuffer mode, because
the DMA controller won't let us do what we want, and... |
void LinkResolver::check_klass_accessability(Klass* ref_klass, Klass* sel_klass,
bool fold_type_to_class, TRAPS) {
Klass* base_klass = sel_klass;
if (fold_type_to_class) {
if (sel_klass->is_objArray_klass()) {
base_klass = ObjArrayKlass::cast(sel_klass)->bottom... | 0 | [] | jdk11u | 132745902a4601dc64b2c8ca112ca30292feccb4 | 215,721,962,804,756,770,000,000,000,000,000,000,000 | 40 | 8281866: Enhance MethodHandle invocations
Reviewed-by: mbaesken
Backport-of: d974d9da365f787f67971d88c79371c8b0769f75 |
static void packet_cached_dev_assign(struct packet_sock *po,
struct net_device *dev)
{
rcu_assign_pointer(po->cached_dev, dev);
} | 0 | [
"CWE-416",
"CWE-362"
] | linux | 84ac7260236a49c79eede91617700174c2c19b0c | 218,965,569,062,198,500,000,000,000,000,000,000,000 | 5 | packet: fix race condition in packet_set_ring
When packet_set_ring creates a ring buffer it will initialize a
struct timer_list if the packet version is TPACKET_V3. This value
can then be raced by a different thread calling setsockopt to
set the version to TPACKET_V1 before packet_set_ring has finished.
This leads to... |
static int nfsiod_start(void)
{
struct workqueue_struct *wq;
dprintk("RPC: creating workqueue nfsiod\n");
wq = create_singlethread_workqueue("nfsiod");
if (wq == NULL)
return -ENOMEM;
nfsiod_workqueue = wq;
return 0;
} | 0 | [
"CWE-703"
] | linux | dc0b027dfadfcb8a5504f7d8052754bf8d501ab9 | 234,156,717,711,477,700,000,000,000,000,000,000,000 | 10 | NFSv4: Convert the open and close ops to use fmode
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> |
void htp_tx_req_set_parsed_uri(htp_tx_t *tx, htp_uri_t *parsed_uri) {
if ((tx == NULL) || (parsed_uri == NULL)) return;
if (tx->parsed_uri != NULL) {
htp_uri_free(tx->parsed_uri);
}
tx->parsed_uri = parsed_uri;
} | 0 | [] | libhtp | c7c03843cd6b1cbf44eb435d160ba53aec948828 | 192,533,385,259,873,860,000,000,000,000,000,000,000 | 9 | Harden decompress code against memory stress
Under severe memory pressure the decompress code can fail to setup
properly. Add checks before dereferencing pointers. |
PHP_FUNCTION(xml_set_notation_decl_handler)
{
xml_parser *parser;
zval *pind, **hdl;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rZ", &pind, &hdl) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(parser,xml_parser *, &pind, -1, "XML Parser", le_xml_parser);
xml_set_handler(&parser->notationDeclHandler, h... | 0 | [
"CWE-787"
] | php-src | 7d163e8a0880ae8af2dd869071393e5dc07ef271 | 63,683,478,054,789,840,000,000,000,000,000,000,000 | 14 | truncate results at depth of 255 to prevent corruption |
static void read_transfer_data(struct iovec *iov,
unsigned int num_iovs,
char *data,
enum pipe_format format,
uint64_t offset,
uint32_t src_stride,
... | 0 | [
"CWE-787"
] | virglrenderer | cbc8d8b75be360236cada63784046688aeb6d921 | 300,782,802,078,788,750,000,000,000,000,000,000,000 | 42 | vrend: check transfer bounds for negative values too and report error
Closes #138
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com> |
static void process_echoes(struct tty_struct *tty)
{
struct n_tty_data *ldata = tty->disc_data;
size_t echoed;
if (ldata->echo_mark == ldata->echo_tail)
return;
mutex_lock(&ldata->output_lock);
ldata->echo_commit = ldata->echo_mark;
echoed = __process_echoes(tty);
mutex_unlock(&ldata->output_lock);
if (ech... | 0 | [
"CWE-362"
] | tty | 4291086b1f081b869c6d79e5b7441633dc3ace00 | 29,189,615,472,229,900,000,000,000,000,000,000,000 | 16 | n_tty: Fix n_tty_write crash when echoing in raw mode
The tty atomic_write_lock does not provide an exclusion guarantee for
the tty driver if the termios settings are LECHO & !OPOST. And since
it is unexpected and not allowed to call TTY buffer helpers like
tty_insert_flip_string concurrently, this may lead to crashe... |
epass2003_delete_file(struct sc_card *card, const sc_path_t * path)
{
int r;
u8 sbuf[2];
struct sc_apdu apdu;
LOG_FUNC_CALLED(card->ctx);
r = sc_select_file(card, path, NULL);
epass2003_hook_path((struct sc_path *)path, 1);
if (r == SC_SUCCESS) {
sbuf[0] = path->value[path->len - 2];
sbuf[1] = path->value[... | 0 | [
"CWE-415",
"CWE-119"
] | OpenSC | 360e95d45ac4123255a4c796db96337f332160ad | 58,054,746,795,082,830,000,000,000,000,000,000,000 | 29 | fixed out of bounds writes
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting the problems. |
void start_tty(struct tty_struct *tty)
{
unsigned long flags;
spin_lock_irqsave(&tty->ctrl_lock, flags);
if (!tty->stopped || tty->flow_stopped) {
spin_unlock_irqrestore(&tty->ctrl_lock, flags);
return;
}
tty->stopped = 0;
if (tty->link && tty->link->packet) {
tty->ctrl_status &= ~TIOCPKT_STOP;
tty->ctrl_... | 0 | [
"CWE-703"
] | linux | c290f8358acaeffd8e0c551ddcc24d1206143376 | 300,435,058,531,045,880,000,000,000,000,000,000,000 | 20 | TTY: drop driver reference in tty_open fail path
When tty_driver_lookup_tty fails in tty_open, we forget to drop a
reference to the tty driver. This was added by commit 4a2b5fddd5 (Move
tty lookup/reopen to caller).
Fix that by adding tty_driver_kref_put to the fail path.
I will refactor the code later. This is for ... |
c_pdf14trans_clist_read_update(gs_composite_t * pcte, gx_device * cdev,
gx_device * tdev, gs_gstate * pgs, gs_memory_t * mem)
{
pdf14_device * p14dev = (pdf14_device *)tdev;
gs_pdf14trans_t * pdf14pct = (gs_pdf14trans_t *) pcte;
gs_devn_params * pclist_devn_params;
gx_device_clist_reader... | 1 | [] | ghostpdl | c432131c3fdb2143e148e8ba88555f7f7a63b25e | 137,527,666,574,466,730,000,000,000,000,000,000,000 | 116 | 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... |
TEST(IndexBoundsBuilderTest, TranslateLtMinKeyDoesNotGenerateBounds) {
auto testIndex = buildSimpleIndexEntry();
BSONObj obj = BSON("a" << BSON("$lt" << MINKEY));
auto expr = parseMatchExpression(obj);
BSONElement elt = obj.firstElement();
OrderedIntervalList oil;
IndexBoundsBuilder::BoundsTight... | 0 | [
"CWE-754"
] | mongo | f8f55e1825ee5c7bdb3208fc7c5b54321d172732 | 231,986,574,425,272,450,000,000,000,000,000,000,000 | 12 | SERVER-44377 generate correct plan for indexed inequalities to null |
static void gf_dump_vrml_node(GF_SceneDumper *sdump, GF_Node *node, Bool in_list, char *fieldContainer)
{
u32 i, count, to_dump, sub_el, ID;
u32 *def_fields;
Bool isDEF, isScript, isProto, hasISed;
char *name;
GF_Node *base;
GF_FieldInfo field, base_field;
if (!node) {
gf_fprintf(sdump->trace, "NULL");
retu... | 0 | [
"CWE-476"
] | gpac | 0102c5d4db7fdbf08b5b591b2a6264de33867a07 | 52,318,019,310,306,200,000,000,000,000,000,000,000 | 336 | fixed #2232 |
static int cardos_have_2048bit_package(sc_card_t *card)
{
sc_apdu_t apdu;
u8 rbuf[SC_MAX_APDU_BUFFER_SIZE];
int r;
const u8 *p = rbuf, *q, *pp;
size_t len, tlen = 0, ilen = 0;
sc_format_apdu(card, &apdu, SC_APDU_CASE_2_SHORT, 0xca, 0x01, 0x88);
apdu.resp = rbuf;
apdu.resplen =... | 0 | [] | OpenSC | 1252aca9f10771ef5ba8405e73cf2da50827958f | 331,177,212,470,604,600,000,000,000,000,000,000,000 | 35 | cardos: Correctly calculate the left bytes to avoid buffer overrun
Thanks oss-fuzz
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=29912 |
static int jas_cmshapmat_apply(jas_cmpxform_t *pxform, jas_cmreal_t *in,
jas_cmreal_t *out, int cnt)
{
jas_cmshapmat_t *shapmat = &pxform->data.shapmat;
jas_cmreal_t *src;
jas_cmreal_t *dst;
jas_cmreal_t a0;
jas_cmreal_t a1;
jas_cmreal_t a2;
jas_cmreal_t b0;
jas_cmreal_t b1;
jas_cmreal_t b2;
src = in;
dst ... | 0 | [
"CWE-189"
] | jasper | 3c55b399c36ef46befcb21e4ebc4799367f89684 | 245,150,048,846,893,800,000,000,000,000,000,000,000 | 79 | At many places in the code, jas_malloc or jas_recalloc was being
invoked with the size argument being computed in a manner that would not
allow integer overflow to be detected. Now, these places in the code
have been modified to use special-purpose memory allocation functions
(e.g., jas_alloc2, jas_alloc3, jas_realloc... |
static int arcmsr_hbaA_handle_isr(struct AdapterControlBlock *acb)
{
uint32_t outbound_intstatus;
struct MessageUnit_A __iomem *reg = acb->pmuA;
outbound_intstatus = readl(®->outbound_intstatus) &
acb->outbound_int_enable;
if (!(outbound_intstatus & ARCMSR_MU_OUTBOUND_HANDLE_INT))
return IRQ_NONE;
do {
wr... | 0 | [
"CWE-119",
"CWE-787"
] | linux | 7bc2b55a5c030685b399bb65b6baa9ccc3d1f167 | 251,616,999,119,351,700,000,000,000,000,000,000,000 | 23 | scsi: arcmsr: Buffer overflow in arcmsr_iop_message_xfer()
We need to put an upper bound on "user_len" so the memcpy() doesn't
overflow.
Cc: <stable@vger.kernel.org>
Reported-by: Marco Grassi <marco.gra@gmail.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Sig... |
crypto_policy_set_null_cipher_hmac_sha1_80(crypto_policy_t *p) {
/*
* corresponds to RFC 4568
*/
p->cipher_type = NULL_CIPHER;
p->cipher_key_len = 0;
p->auth_type = HMAC_SHA1;
p->auth_key_len = 20;
p->auth_tag_len = 10;
p->sec_serv = sec_serv_auth;... | 0 | [
"CWE-119"
] | libsrtp | 704a31774db0dd941094fd2b47c21638b8dc3de2 | 102,914,733,773,779,600,000,000,000,000,000,000,000 | 14 | Prevent potential DoS attack due to lack of bounds checking on RTP header CSRC count and extension header length. Credit goes to Randell Jesup and the Firefox team for reporting this issue. |
static int ext3_quota_on_mount(struct super_block *sb, int type)
{
return dquot_quota_on_mount(sb, EXT3_SB(sb)->s_qf_names[type],
EXT3_SB(sb)->s_jquota_fmt, type);
} | 0 | [
"CWE-20"
] | linux | 8d0c2d10dd72c5292eda7a06231056a4c972e4cc | 190,467,741,216,650,480,000,000,000,000,000,000,000 | 5 | ext3: Fix format string issues
ext3_msg() takes the printk prefix as the second parameter and the
format string as the third parameter. Two callers of ext3_msg omit the
prefix and pass the format string as the second parameter and the first
parameter to the format string as the third parameter. In both cases
this stri... |
PHP_FUNCTION(openssl_x509_export_to_file)
{
X509 * cert;
zval ** zcert;
zend_bool notext = 1;
BIO * bio_out;
long certresource;
char * filename;
int filename_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zs|b", &zcert, &filename, &filename_len, ¬ext) == FAILURE) {
return;
}
RETVAL_FALSE;
... | 0 | [
"CWE-200"
] | php-src | 270a406ac94b5fc5cc9ef59fc61e3b4b95648a3e | 131,372,209,987,980,330,000,000,000,000,000,000,000 | 41 | Fix bug #61413 ext\openssl\tests\openssl_encrypt_crash.phpt fails 5.3 only |
static void convert_pseudo_ld_imm64(struct bpf_verifier_env *env)
{
struct bpf_insn *insn = env->prog->insnsi;
int insn_cnt = env->prog->len;
int i;
for (i = 0; i < insn_cnt; i++, insn++)
if (insn->code == (BPF_LD | BPF_IMM | BPF_DW))
insn->src_reg = 0;
} | 0 | [
"CWE-200"
] | linux | 0d0e57697f162da4aa218b5feafe614fb666db07 | 134,190,417,557,111,930,000,000,000,000,000,000,000 | 10 | bpf: don't let ldimm64 leak map addresses on unprivileged
The patch fixes two things at once:
1) It checks the env->allow_ptr_leaks and only prints the map address to
the log if we have the privileges to do so, otherwise it just dumps 0
as we would when kptr_restrict is enabled on %pK. Given the latter is
of... |
static int do_brk(unsigned long addr, unsigned long len, struct list_head *uf)
{
return do_brk_flags(addr, len, 0, uf);
} | 0 | [
"CWE-119"
] | linux | 1be7107fbe18eed3e319a6c3e83c78254b693acb | 113,974,223,146,474,800,000,000,000,000,000,000,000 | 4 | mm: larger stack guard gap, between vmas
Stack guard page is a useful feature to reduce a risk of stack smashing
into a different mapping. We have been using a single page gap which
is sufficient to prevent having stack adjacent to a different mapping.
But this seems to be insufficient in the light of the stack usage ... |
int emulator_write_emulated(struct x86_emulate_ctxt *ctxt,
unsigned long addr,
const void *val,
unsigned int bytes,
struct x86_exception *exception)
{
return emulator_read_write(ctxt, addr, (void *)val, bytes,
exception, &write_emultor);
} | 0 | [] | kvm | 0769c5de24621141c953fbe1f943582d37cb4244 | 109,388,364,876,272,470,000,000,000,000,000,000,000 | 9 | KVM: x86: extend "struct x86_emulate_ops" with "get_cpuid"
In order to be able to proceed checks on CPU-specific properties
within the emulator, function "get_cpuid" is introduced.
With "get_cpuid" it is possible to virtually call the guests
"cpuid"-opcode without changing the VM's context.
[mtosatti: cleanup/beautif... |
mcs_connect_finalize(STREAM mcs_data)
{
unsigned int i;
logger(Protocol, Debug, "%s()", __func__);
mcs_send_connect_initial(mcs_data);
if (!mcs_recv_connect_response(mcs_data))
goto error;
mcs_send_edrq();
mcs_send_aurq();
if (!mcs_recv_aucf(&g_mcs_userid))
goto error;
mcs_send_cjrq(g_mcs_userid + MCS_U... | 0 | [
"CWE-119",
"CWE-125",
"CWE-703",
"CWE-787"
] | rdesktop | 4dca546d04321a610c1835010b5dad85163b65e1 | 85,504,576,242,404,580,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 ... |
void std_format(const T &value, std::basic_string<Char> &result) {
std::basic_ostringstream<Char> os;
os << value;
result = os.str();
} | 0 | [
"CWE-134",
"CWE-119",
"CWE-787"
] | fmt | 8cf30aa2be256eba07bb1cefb998c52326e846e7 | 333,607,371,075,167,200,000,000,000,000,000,000,000 | 5 | Fix segfault on complex pointer formatting (#642) |
bool BindElectronApiIPC(
mojo::PendingAssociatedReceiver<electron::mojom::ElectronApiIPC> receiver,
content::RenderFrameHost* frame_host) {
auto* contents = content::WebContents::FromRenderFrameHost(frame_host);
if (contents) {
auto* prefs = WebContentsPreferences::From(contents);
if (frame_host->Ge... | 0 | [] | electron | 6d9f3a494596d6b3e30938af9deb2c79f1c7f797 | 323,241,315,332,534,800,000,000,000,000,000,000,000 | 16 | fix: ensure ElectronBrowser mojo service is only bound to appropriate render frames (#34191)
fix: ensure ElectronBrowser mojo service is only bound to appropriate render frames (#33367)
* Make ElectronBrowser mojo interface frame associated. (#32815)
Co-authored-by: Marek Haranczyk <marek@openfin.co>
* fix: e... |
void sspi_CredentialsFree(CREDENTIALS* credentials)
{
if (!credentials)
return;
free(credentials);
} | 0 | [
"CWE-476",
"CWE-125"
] | FreeRDP | 0773bb9303d24473fe1185d85a424dfe159aff53 | 232,510,140,098,877,200,000,000,000,000,000,000,000 | 7 | 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. |
PJ_DEF(pj_status_t) pj_stun_msg_init( pj_stun_msg *msg,
unsigned msg_type,
pj_uint32_t magic,
const pj_uint8_t tsx_id[12])
{
PJ_ASSERT_RETURN(msg && msg_type, PJ_EINVAL);
msg->hdr.type = (pj_uint16_t) msg_type;
msg->hdr.length = 0;
msg->hdr.magic = magic;
msg->attr_cou... | 0 | [
"CWE-191"
] | pjproject | 15663e3f37091069b8c98a7fce680dc04bc8e865 | 287,812,399,032,477,070,000,000,000,000,000,000,000 | 35 | Merge pull request from GHSA-2qpg-f6wf-w984 |
GF_Err avcc_box_dump(GF_Box *a, FILE * trace)
{
u32 i, count;
GF_AVCConfigurationBox *p = (GF_AVCConfigurationBox *) a;
const char *name;
switch (p->type) {
case GF_ISOM_BOX_TYPE_MVCC:
name = "MVC";
break;
case GF_ISOM_BOX_TYPE_SVCC:
name = "SVC";
break;
case GF_ISOM_BOX_TYPE_AVCE:
name = "DV-AVC";
b... | 0 | [
"CWE-787"
] | gpac | ea1eca00fd92fa17f0e25ac25652622924a9a6a0 | 4,252,061,124,145,479,000,000,000,000,000,000,000 | 91 | fixed #2138 |
XML_SetExternalEntityRefHandlerArg(XML_Parser parser, void *arg)
{
if (parser == NULL)
return;
if (arg)
parser->m_externalEntityRefHandlerArg = (XML_Parser)arg;
else
parser->m_externalEntityRefHandlerArg = parser;
} | 0 | [
"CWE-611"
] | libexpat | 11f8838bf99ea0a6f0b76f9760c43704d00c4ff6 | 138,549,424,081,242,180,000,000,000,000,000,000,000 | 9 | xmlparse.c: Fix extraction of namespace prefix from XML name (#186) |
start_input_ppm(j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
{
ppm_source_ptr source = (ppm_source_ptr)sinfo;
int c;
unsigned int w, h, maxval;
boolean need_iobuffer, use_raw_buffer, need_rescale;
if (getc(source->pub.input_file) != 'P')
ERREXIT(cinfo, JERR_PPM_NOT);
c = getc(source->pub.input_file);... | 0 | [
"CWE-125"
] | libjpeg-turbo | 3de15e0c344d11d4b90f4a47136467053eb2d09a | 301,562,356,398,217,470,000,000,000,000,000,000,000 | 172 | rdppm.c: Fix buf overrun caused by bad binary PPM
This extends the fix in 1e81b0c3ea26f4ea8f56de05367469333de64a9f to
include binary PPM files with maximum values < 255, thus preventing a
malformed binary PPM input file with those specifications from
triggering an overrun of the rescale array and potentially crashing
... |
static int cac_init(sc_card_t *card)
{
int r;
unsigned long flags;
SC_FUNC_CALLED(card->ctx, SC_LOG_DEBUG_VERBOSE);
r = cac_find_and_initialize(card, 1);
if (r < 0) {
SC_FUNC_RETURN(card->ctx, SC_LOG_DEBUG_NORMAL, SC_ERROR_INVALID_CARD);
}
flags = SC_ALGORITHM_RSA_RAW;
_sc_card_add_rsa_alg(card, 1024, flag... | 0 | [
"CWE-415",
"CWE-119"
] | OpenSC | 360e95d45ac4123255a4c796db96337f332160ad | 149,625,049,952,492,630,000,000,000,000,000,000,000 | 21 | fixed out of bounds writes
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting the problems. |
OPJ_FLOAT32 opj_j2k_get_tp_stride (opj_tcp_t * p_tcp)
{
return (OPJ_FLOAT32) ((p_tcp->m_nb_tile_parts - 1) * 14);
} | 0 | [] | openjpeg | 0fa5a17c98c4b8f9ee2286f4f0a50cf52a5fccb0 | 160,588,478,966,315,700,000,000,000,000,000,000,000 | 4 | [trunk] Correct potential double free on malloc failure in opj_j2k_copy_default_tcp_and_create_tcp (fixes issue 492) |
TEST(TensorSliceReaderTest, MissingTensorData) {
const string fname =
io::JoinPath(testing::TmpDir(), "missing_data_checkpoint");
TensorSliceWriter writer(fname, CreateTableTensorSliceBuilder);
const int32 data[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
TF_ASSERT_OK(writer.Add("test", TensorShape({4, 5}),
... | 0 | [
"CWE-345"
] | tensorflow | 368af875869a204b4ac552b9ddda59f6a46a56ec | 18,922,027,442,449,296,000,000,000,000,000,000,000 | 26 | Avoid buffer overflow when loading tensors with insufficient data from checkpoints.
`CopyDataFromTensorSliceToTensorSlice` does not (and cannot conveniently)
provide any bounds checking on its own, so the size is instead checked prior
to passing unvalidated data to that function.
PiperOrigin-RevId: 392971286
Change-I... |
dns_msg_authadd(struct dns_msg* msg, struct regional* region,
struct ub_packed_rrset_key* rrset, time_t now)
{
if(!(msg->rep->rrsets[msg->rep->rrset_count++] =
packed_rrset_copy_region(rrset, region, now)))
return 0;
msg->rep->ns_numrrsets++;
return 1;
} | 0 | [
"CWE-400"
] | unbound | ba0f382eee814e56900a535778d13206b86b6d49 | 332,824,993,613,311,160,000,000,000,000,000,000,000 | 9 | - CVE-2020-12662 Unbound can be tricked into amplifying an incoming
query into a large number of queries directed to a target.
- CVE-2020-12663 Malformed answers from upstream name servers can be
used to make Unbound unresponsive. |
void git_index_reuc_clear(git_index *index)
{
size_t i;
assert(index);
for (i = 0; i < index->reuc.length; ++i)
index_entry_reuc_free(git__swap(index->reuc.contents[i], NULL));
git_vector_clear(&index->reuc);
} | 0 | [
"CWE-415",
"CWE-190"
] | libgit2 | 3db1af1f370295ad5355b8f64b865a2a357bcac0 | 334,806,581,850,930,960,000,000,000,000,000,000,000 | 11 | index: error out on unreasonable prefix-compressed path lengths
When computing the complete path length from the encoded
prefix-compressed path, we end up just allocating the complete path
without ever checking what the encoded path length actually is. This can
easily lead to a denial of service by just encoding an un... |
static BOOL printer_update_to_config(const rdpSettings* settings, const WCHAR* name, size_t length,
const BYTE* data, size_t datalen)
{
BOOL rc = FALSE;
char* path = get_printer_config_path(settings, name, length);
rc = printer_write_setting(path, PRN_CONF_DATA, data, datalen);
... | 0 | [
"CWE-125"
] | FreeRDP | 6b485b146a1b9d6ce72dfd7b5f36456c166e7a16 | 130,251,786,154,530,150,000,000,000,000,000,000,000 | 9 | Fixed oob read in irp_write and similar |
call_func_retnr(
char_u *func,
int argc,
typval_T *argv)
{
typval_T rettv;
varnumber_T retval;
if (call_vim_function(func, argc, argv, &rettv) == FAIL)
return -1;
retval = tv_get_number_chk(&rettv, NULL);
clear_tv(&rettv);
return retval;
} | 0 | [
"CWE-122",
"CWE-787"
] | vim | 605ec91e5a7330d61be313637e495fa02a6dc264 | 294,725,008,687,447,680,000,000,000,000,000,000,000 | 15 | patch 8.2.3847: illegal memory access when using a lambda with an error
Problem: Illegal memory access when using a lambda with an error.
Solution: Avoid skipping over the NUL after a string. |
COMPAT_SYSCALL_DEFINE2(ftruncate, unsigned int, fd, compat_ulong_t, length)
{
return do_sys_ftruncate(fd, length, 1);
} | 0 | [
"CWE-17"
] | linux | eee5cc2702929fd41cce28058dc6d6717f723f87 | 297,805,516,037,175,550,000,000,000,000,000,000,000 | 4 | get rid of s_files and files_lock
The only thing we need it for is alt-sysrq-r (emergency remount r/o)
and these days we can do just as well without going through the
list of files.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> |
bufadd(struct buffer *buf, char c)
{
if (buf->len >= buf->cap) {
buf->cap = buf->cap ? buf->cap * 2 : 1 << 8;
buf->data = realloc(buf->data, buf->cap);
if (!buf->data)
fatal("realloc:");
}
buf->data[buf->len++] = c;
} | 0 | [
"CWE-476",
"CWE-284"
] | samurai | e84b6d99c85043fa1ba54851ee500540ec206918 | 52,907,546,277,685,360,000,000,000,000,000,000,000 | 10 | util: Check for NULL string in writefile
This check was there previously, but was removed in f549b757 with
the addition of a check during parse that every rule has rspfile
if and only if it has rspfile_content. However, this fails to
consider the possibility of those variables coming from the edge
or global environmen... |
string_free_split_command (char **split_command)
{
int i;
if (split_command)
{
for (i = 0; split_command[i]; i++)
free (split_command[i]);
free (split_command);
}
} | 0 | [
"CWE-20"
] | weechat | efb795c74fe954b9544074aafcebb1be4452b03a | 226,501,720,893,238,100,000,000,000,000,000,000,000 | 11 | core: do not call shell to execute command in hook_process (fix security problem when a plugin/script gives untrusted command) (bug #37764) |
InterpretButton(XtermWidget xw, XButtonEvent *event)
{
Bool result = False;
if (ShiftOverride(xw, event->state, (int) event->button)) {
TRACE(("...shift-button #%d overrides mouse-protocol\n", event->button));
result = True;
}
return result;
} | 0 | [
"CWE-399"
] | xterm-snapshots | 82ba55b8f994ab30ff561a347b82ea340ba7075c | 37,421,675,447,365,685,000,000,000,000,000,000,000 | 10 | snapshot of project "xterm", label xterm-365d |
_gnutls_verify_crl2 (gnutls_x509_crl_t crl,
const gnutls_x509_crt_t * trusted_cas,
int tcas_size, unsigned int flags, unsigned int *output)
{
/* CRL is ignored for now */
gnutls_datum_t crl_signed_data = { NULL, 0 };
gnutls_datum_t crl_signature = { NULL, 0 };
gnutls_x509_crt_t issuer;
int ret, re... | 0 | [
"CWE-264"
] | gnutls | c8dcbedd1fdc312f5b1a70fcfbc1afe235d800cd | 160,424,864,574,213,730,000,000,000,000,000,000,000 | 99 | Corrected bit disable (was flipping instead).
Initialy reported by Daniel Kahn Gillmor on 9/1/2008. Many thanks to
moog@sysdev.oucs.ox.ac.uk for bringing this into my attention. |
static void nfs4_xdr_enc_exchange_id(struct rpc_rqst *req,
struct xdr_stream *xdr,
const void *data)
{
const struct nfs41_exchange_id_args *args = data;
struct compound_hdr hdr = {
.minorversion = args->client->cl_mvops->minor_version,
};
encode_compound_hdr(xdr, req, &hdr);
encode_exchange_id... | 0 | [
"CWE-787"
] | linux | b4487b93545214a9db8cbf32e86411677b0cca21 | 106,405,697,812,051,760,000,000,000,000,000,000,000 | 13 | nfs: Fix getxattr kernel panic and memory overflow
Move the buffer size check to decode_attr_security_label() before memcpy()
Only call memcpy() if the buffer is large enough
Fixes: aa9c2669626c ("NFS: Client implementation of Labeled-NFS")
Signed-off-by: Jeffrey Mitchell <jeffrey.mitchell@starlab.io>
[Trond: clean u... |
ia64_patch_gate (void)
{
# define START(name) ((unsigned long) __start_gate_##name##_patchlist)
# define END(name) ((unsigned long)__end_gate_##name##_patchlist)
patch_fsyscall_table(START(fsyscall), END(fsyscall));
patch_brl_fsys_bubble_down(START(brl_fsys_bubble_down), END(brl_fsys_bubble_down));
ia64_patch_vtop(... | 0 | [
"CWE-119",
"CWE-787"
] | linux | 4dcc29e1574d88f4465ba865ed82800032f76418 | 35,006,297,404,223,280,000,000,000,000,000,000,000 | 10 | [IA64] Workaround for RSE issue
Problem: An application violating the architectural rules regarding
operation dependencies and having specific Register Stack Engine (RSE)
state at the time of the violation, may result in an illegal operation
fault and invalid RSE state. Such faults may initiate a cascade of
repeated ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.