func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
g_vfs_daemon_init (GVfsDaemon *daemon)
{
GError *error;
gint max_threads = 1; /* TODO: handle max threads */
daemon->thread_pool = g_thread_pool_new (job_handler_callback,
daemon,
max_threads,
FALSE, NULL);
/* TODO: verify thread_pool != NULL in a nicer way */
g_assert (daemon->thread... | 1 | [
"CWE-276"
] | gvfs | e3808a1b4042761055b1d975333a8243d67b8bfe | 17,821,737,996,076,360,000,000,000,000,000,000,000 | 59 | gvfsdaemon: Check that the connecting client is the same user
Otherwise, an attacker who learns the abstract socket address from
netstat(8) or similar could connect to it and issue D-Bus method
calls.
Signed-off-by: Simon McVittie <smcv@collabora.com> |
ResetReindexPending(void)
{
pendingReindexedIndexes = NIL;
} | 0 | [
"CWE-362"
] | postgres | 5f173040e324f6c2eebb90d86cf1b0cdb5890f0a | 305,335,500,435,057,000,000,000,000,000,000,000,000 | 4 | 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... |
int manager_open_serialization(Manager *m, FILE **_f) {
const char *path;
int fd = -1;
FILE *f;
assert(_f);
path = MANAGER_IS_SYSTEM(m) ? "/run/systemd" : "/tmp";
fd = open_tmpfile_unlinkable(path, O_RDWR|O_CLOEXEC);
if (fd < 0)
return -errno;
... | 0 | [
"CWE-20"
] | systemd | 531ac2b2349da02acc9c382849758e07eb92b020 | 68,108,211,312,650,960,000,000,000,000,000,000,000 | 24 | If the notification message length is 0, ignore the message (#4237)
Fixes #4234.
Signed-off-by: Jorge Niedbalski <jnr@metaklass.org> |
void Item_singlerow_subselect::reset()
{
Item_subselect::reset();
if (value)
{
for(uint i= 0; i < engine->cols(); i++)
row[i]->set_null();
}
} | 0 | [
"CWE-89"
] | server | 3c209bfc040ddfc41ece8357d772547432353fd2 | 270,599,540,168,321,970,000,000,000,000,000,000,000 | 9 | MDEV-25994: Crash with union of my_decimal type in ORDER BY clause
When single-row subquery fails with "Subquery reutrns more than 1 row"
error, it will raise an error and return NULL.
On the other hand, Item_singlerow_subselect sets item->maybe_null=0
for table-less subqueries like "(SELECT not_null_value)" (*)
Th... |
NTSTATUS mitkdc_task_init(struct task_server *task)
{
struct tevent_req *subreq;
const char * const *kdc_cmd;
struct interface *ifaces;
char *kdc_config = NULL;
struct kdc_server *kdc;
krb5_error_code code;
NTSTATUS status;
kadm5_ret_t ret;
kadm5_config_params config;
void *server_handle;
int dbglvl = 0;
t... | 1 | [
"CWE-288"
] | samba | 827dc6a61e6bd01531da0cc8e10f1e54ad400359 | 99,836,057,865,585,400,000,000,000,000,000,000,000 | 209 | CVE-2022-32744 s4:kdc: Rename keytab_name -> kpasswd_keytab_name
This makes explicitly clear the purpose of this keytab.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15074
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org> |
static int handle_triple_fault(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
{
kvm_run->exit_reason = KVM_EXIT_SHUTDOWN;
return 0;
} | 0 | [
"CWE-20"
] | linux-2.6 | 16175a796d061833aacfbd9672235f2d2725df65 | 113,636,860,370,233,430,000,000,000,000,000,000,000 | 5 | KVM: VMX: Don't allow uninhibited access to EFER on i386
vmx_set_msr() does not allow i386 guests to touch EFER, but they can still
do so through the default: label in the switch. If they set EFER_LME, they
can oops the host.
Fix by having EFER access through the normal channel (which will check for
EFER_LME) even o... |
int arch_prctl_spec_ctrl_set(struct task_struct *task, unsigned long which,
unsigned long ctrl)
{
switch (which) {
case PR_SPEC_STORE_BYPASS:
return ssb_prctl_set(task, ctrl);
case PR_SPEC_INDIRECT_BRANCH:
return ib_prctl_set(task, ctrl);
default:
return -ENODEV;
}
} | 0 | [] | linux | a2059825986a1c8143fd6698774fa9d83733bb11 | 28,698,905,945,959,380,000,000,000,000,000,000,000 | 12 | x86/speculation: Enable Spectre v1 swapgs mitigations
The previous commit added macro calls in the entry code which mitigate the
Spectre v1 swapgs issue if the X86_FEATURE_FENCE_SWAPGS_* features are
enabled. Enable those features where applicable.
The mitigations may be disabled with "nospectre_v1" or "mitigations... |
static int scan_prefix(compiler_common *common, PCRE2_SPTR cc, fast_forward_char_data *chars, int max_chars, sljit_u32 *rec_count)
{
/* Recursive function, which scans prefix literals. */
BOOL last, any, class, caseless;
int len, repeat, len_save, consumed = 0;
sljit_u32 chr; /* Any unicode character. */
sljit_u8 *byte... | 0 | [
"CWE-125"
] | php-src | 8947fd9e9fdce87cd6c59817b1db58e789538fe9 | 282,745,801,254,307,700,000,000,000,000,000,000,000 | 401 | Fix #78338: Array cross-border reading in PCRE
We backport r1092 from pcre2. |
s64 __ktime_divns(const ktime_t kt, s64 div)
{
int sft = 0;
s64 dclc;
u64 tmp;
dclc = ktime_to_ns(kt);
tmp = dclc < 0 ? -dclc : dclc;
/* Make sure the divisor is less than 2^32: */
while (div >> 32) {
sft++;
div >>= 1;
}
tmp >>= sft;
do_div(tmp, (unsigned long) div);
return dclc < 0 ? -tmp : tmp;
} | 0 | [
"CWE-200"
] | tip | dfb4357da6ddbdf57d583ba64361c9d792b0e0b1 | 108,102,182,122,729,370,000,000,000,000,000,000,000 | 18 | 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... |
inline int length() const { return cur_len_; } | 0 | [] | envoy | 3b5acb2f43548862dadb243de7cf3994986a8e04 | 104,873,615,213,707,430,000,000,000,000,000,000,000 | 1 | 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... |
unsigned int gg_login_hash(const unsigned char *password, unsigned int seed)
{
unsigned int x, y, z;
y = seed;
for (x = 0; *password; password++) {
x = (x & 0xffffff00) | *password;
y ^= x;
y += x;
x <<= 8;
y ^= x;
x <<= 8;
y -= x;
x <<= 8;
y ^= x;
z = y & 0x1F;
y = (y << z) | (y >> (32 - z)... | 0 | [
"CWE-310"
] | libgadu | 23644f1fb8219031b3cac93289a588b05f90226b | 111,678,130,739,634,380,000,000,000,000,000,000,000 | 23 | Poprawka ograniczania długości opisu. |
LoadCommand* Binary::add(const SegmentCommand& segment) {
/*
* To add a new segment in a Mach-O file, we need to:
*
* 1. Allocate space for a new Load command: LC_SEGMENT_64 / LC_SEGMENT
* which must include the sections
* 2. Allocate space for the content of the provided segment
*
* For #1, t... | 0 | [
"CWE-703"
] | LIEF | 7acf0bc4224081d4f425fcc8b2e361b95291d878 | 11,438,396,368,192,998,000,000,000,000,000,000,000 | 157 | Resolve #764 |
TPM2B_Marshal(TPM2B *source, BYTE **buffer, INT32 *size)
{
UINT16 written = 0;
written += UINT16_Marshal(&(source->size), buffer, size);
written += Array_Marshal(source->buffer, source->size, buffer, size);
return written;
} | 1 | [
"CWE-787"
] | libtpms | 3ef9b26cb9f28bd64d738bff9505a20d4eb56acd | 273,534,893,471,155,440,000,000,000,000,000,000,000 | 7 | tpm2: Add maxSize parameter to TPM2B_Marshal for sanity checks
Add maxSize parameter to TPM2B_Marshal and assert on it checking
the size of the data intended to be marshaled versus the maximum
buffer size.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> |
struct soc_device *soc_device_register(struct soc_device_attribute *soc_dev_attr)
{
struct soc_device *soc_dev;
const struct attribute_group **soc_attr_groups;
int ret;
if (!soc_bus_type.p) {
if (early_soc_dev_attr)
return ERR_PTR(-EBUSY);
early_soc_dev_attr = soc_dev_attr;
return NULL;
}
soc_dev = kza... | 0 | [
"CWE-787"
] | linux | aa838896d87af561a33ecefea1caa4c15a68bc47 | 95,416,730,785,952,890,000,000,000,000,000,000,000 | 55 | drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions
Convert the various sprintf fmaily calls in sysfs device show functions
to sysfs_emit and sysfs_emit_at for PAGE_SIZE buffer safety.
Done with:
$ spatch -sp-file sysfs_emit_dev.cocci --in-place --max-width=80 .
And cocci script:
$ cat s... |
static EVP_MD * php_openssl_get_evp_md_from_algo(zend_long algo) { /* {{{ */
EVP_MD *mdtype;
switch (algo) {
case OPENSSL_ALGO_SHA1:
mdtype = (EVP_MD *) EVP_sha1();
break;
case OPENSSL_ALGO_MD5:
mdtype = (EVP_MD *) EVP_md5();
break;
case OPENSSL_ALGO_MD4:
mdtype = (EVP_MD *) EVP_md4();
break;... | 0 | [
"CWE-326"
] | php-src | 0216630ea2815a5789a24279a1211ac398d4de79 | 121,270,264,812,658,000,000,000,000,000,000,000,000 | 44 | Fix bug #79601 (Wrong ciphertext/tag in AES-CCM encryption for a 12 bytes IV) |
static int kvp_key_add_or_modify(int pool, __u8 *key, int key_size, __u8 *value,
int value_size)
{
int i;
int num_records;
struct kvp_record *record;
int num_blocks;
if ((key_size > HV_KVP_EXCHANGE_MAX_KEY_SIZE) ||
(value_size > HV_KVP_EXCHANGE_MAX_VALUE_SIZE))
return 1;
/*
* First update the in-memory... | 0 | [] | char-misc | 95a69adab9acfc3981c504737a2b6578e4d846ef | 273,665,752,814,809,250,000,000,000,000,000,000,000 | 53 | tools: hv: Netlink source address validation allows DoS
The source code without this patch caused hypervkvpd to exit when it processed
a spoofed Netlink packet which has been sent from an untrusted local user.
Now Netlink messages with a non-zero nl_pid source address are ignored
and a warning is printed into the sysl... |
Stats::Scope& listenerScope() override { return *scope_; } | 0 | [
"CWE-400"
] | envoy | dfddb529e914d794ac552e906b13d71233609bf7 | 211,039,481,440,939,620,000,000,000,000,000,000,000 | 1 | listener: Add configurable accepted connection limits (#153)
Add support for per-listener limits on accepted connections.
Signed-off-by: Tony Allen <tony@allen.gg> |
ListenerFactoryContextBaseImpl& parentFactoryContext() { return *listener_factory_context_base_; } | 0 | [
"CWE-400"
] | envoy | dfddb529e914d794ac552e906b13d71233609bf7 | 185,905,105,289,410,300,000,000,000,000,000,000,000 | 1 | listener: Add configurable accepted connection limits (#153)
Add support for per-listener limits on accepted connections.
Signed-off-by: Tony Allen <tony@allen.gg> |
static void *AcquireBlock(size_t size)
{
size_t
i;
void
*block;
/*
Find free block.
*/
size=(size_t) (size+sizeof(size_t)+6*sizeof(size_t)-1) & -(4U*sizeof(size_t));
i=AllocationPolicy(size);
block=memory_pool.blocks[i];
while ((block != (void *) NULL) && (SizeOfBlock(block) < size))
b... | 0 | [
"CWE-369"
] | ImageMagick | 70aa86f5d5d8aa605a918ed51f7574f433a18482 | 249,819,838,563,059,980,000,000,000,000,000,000,000 | 51 | possible divide by zero + clear buffers |
static void route4_bind_class(void *fh, u32 classid, unsigned long cl, void *q,
unsigned long base)
{
struct route4_filter *f = fh;
if (f && f->res.classid == classid) {
if (cl)
__tcf_bind_filter(q, &f->res, base);
else
__tcf_unbind_filter(q, &f->res);
}
} | 0 | [
"CWE-416",
"CWE-200"
] | linux | ef299cc3fa1a9e1288665a9fdc8bff55629fd359 | 204,378,942,938,555,720,000,000,000,000,000,000,000 | 12 | net_sched: cls_route: remove the right filter from hashtable
route4_change() allocates a new filter and copies values from
the old one. After the new filter is inserted into the hash
table, the old filter should be removed and freed, as the final
step of the update.
However, the current code mistakenly removes the ne... |
void sysfs_slab_release(struct kmem_cache *s)
{
if (slab_state >= FULL)
kobject_put(&s->kobj); | 0 | [] | linux | fd4d9c7d0c71866ec0c2825189ebd2ce35bd95b8 | 320,799,860,075,855,900,000,000,000,000,000,000,000 | 5 | mm: slub: add missing TID bump in kmem_cache_alloc_bulk()
When kmem_cache_alloc_bulk() attempts to allocate N objects from a percpu
freelist of length M, and N > M > 0, it will first remove the M elements
from the percpu freelist, then call ___slab_alloc() to allocate the next
element and repopulate the percpu freelis... |
void Http2Session::Goaway(uint32_t code,
int32_t lastStreamID,
const uint8_t* data,
size_t len) {
if (is_destroyed())
return;
Http2Scope h2scope(this);
// the last proc stream id is the most recently created Http2Stream.
if (last... | 0 | [
"CWE-416"
] | node | a3c33d4ce78f74d1cf1765704af5b427aa3840a6 | 148,322,487,850,715,660,000,000,000,000,000,000,000 | 15 | http2: update handling of rst_stream with error code NGHTTP2_CANCEL
The PR updates the handling of rst_stream frames and adds all streams
to the pending list on receiving rst frames with the error code
NGHTTP2_CANCEL.
The changes will remove dependency on the stream state that may allow
bypassing the checks in certai... |
DEFUN(movLW, PREV_WORD, "Move to the previous word")
{
char *lb;
Line *pline, *l;
int ppos;
int i, n = searchKeyNum();
if (Currentbuf->firstLine == NULL)
return;
for (i = 0; i < n; i++) {
pline = Currentbuf->currentLine;
ppos = Currentbuf->pos;
if (prev_nonnull_line(Currentbuf->currentLin... | 0 | [
"CWE-59",
"CWE-241"
] | w3m | 18dcbadf2771cdb0c18509b14e4e73505b242753 | 199,074,212,185,973,600,000,000,000,000,000,000,000 | 51 | Make temporary directory safely when ~/.w3m is unwritable |
static int rfcomm_sock_getname(struct socket *sock, struct sockaddr *addr, int *len, int peer)
{
struct sockaddr_rc *sa = (struct sockaddr_rc *) addr;
struct sock *sk = sock->sk;
BT_DBG("sock %p, sk %p", sock, sk);
memset(sa, 0, sizeof(*sa));
sa->rc_family = AF_BLUETOOTH;
sa->rc_channel = rfcomm_pi(sk)->channe... | 0 | [
"CWE-20",
"CWE-269"
] | linux | f3d3342602f8bcbf37d7c46641cb9bca7618eb1c | 5,989,027,315,880,496,000,000,000,000,000,000,000 | 18 | net: rework recvmsg handler msg_name and msg_namelen logic
This patch now always passes msg->msg_namelen as 0. recvmsg handlers must
set msg_namelen to the proper size <= sizeof(struct sockaddr_storage)
to return msg_name to the user.
This prevents numerous uninitialized memory leaks we had in the
recvmsg handlers an... |
void WatchdogException(struct pt_regs *regs)
{
printk (KERN_EMERG "PowerPC Book-E Watchdog Exception\n");
WatchdogHandler(regs);
} | 0 | [] | linux | 5d176f751ee3c6eededd984ad409bff201f436a7 | 187,390,577,420,074,900,000,000,000,000,000,000,000 | 5 | powerpc: tm: Enable transactional memory (TM) lazily for userspace
Currently the MSR TM bit is always set if the hardware is TM capable.
This adds extra overhead as it means the TM SPRS (TFHAR, TEXASR and
TFAIR) must be swapped for each process regardless of if they use TM.
For processes that don't use TM the TM MSR ... |
static void fixup_low_keys(struct btrfs_path *path,
struct btrfs_disk_key *key, int level)
{
int i;
struct extent_buffer *t;
int ret;
for (i = level; i < BTRFS_MAX_LEVEL; i++) {
int tslot = path->slots[i];
if (!path->nodes[i])
break;
t = path->nodes[i];
ret = tree_mod_log_insert_key(t, tslot, MOD... | 0 | [
"CWE-362"
] | linux | dbcc7d57bffc0c8cac9dac11bec548597d59a6a5 | 111,793,823,149,640,720,000,000,000,000,000,000,000 | 22 | btrfs: fix race when cloning extent buffer during rewind of an old root
While resolving backreferences, as part of a logical ino ioctl call or
fiemap, we can end up hitting a BUG_ON() when replaying tree mod log
operations of a root, triggering a stack trace like the following:
------------[ cut here ]------------
... |
static const char* tunnel_authorization_response_fields_present_to_string(UINT16 fieldsPresent)
{
return fields_present_to_string(fieldsPresent, tunnel_authorization_response_fields_present,
ARRAYSIZE(tunnel_authorization_response_fields_present));
} | 0 | [
"CWE-125"
] | FreeRDP | 6b485b146a1b9d6ce72dfd7b5f36456c166e7a16 | 257,509,036,205,991,550,000,000,000,000,000,000,000 | 5 | Fixed oob read in irp_write and similar |
gdm_display_real_prepare (GdmDisplay *self)
{
g_return_val_if_fail (GDM_IS_DISPLAY (self), FALSE);
g_debug ("GdmDisplay: prepare display");
_gdm_display_set_status (self, GDM_DISPLAY_PREPARED);
return TRUE;
} | 0 | [
"CWE-754"
] | gdm | 4e6e5335d29c039bed820c43bfd1c19cb62539ff | 180,998,420,471,556,080,000,000,000,000,000,000,000 | 10 | display: Use autoptr to handle errors in look for existing users
It will make things just cleaner |
void dns_server_reset_features_all(DnsServer *s) {
DnsServer *i;
LIST_FOREACH(servers, i, s)
dns_server_reset_features(i);
} | 0 | [
"CWE-416"
] | systemd | 904dcaf9d4933499f8334859f52ea8497f2d24ff | 11,557,303,546,008,690,000,000,000,000,000,000,000 | 6 | resolved: take particular care when detaching DnsServer from its default stream
DnsStream and DnsServer have a symbiotic relationship: one DnsStream is
the current "default" stream of the server (and thus reffed by it), but
each stream also refs the server it is connected to. This cyclic
dependency can result in weird... |
static int __compat_put_timespec(const struct timespec *ts, struct old_timespec32 __user *cts)
{
return (!access_ok(cts, sizeof(*cts)) ||
__put_user(ts->tv_sec, &cts->tv_sec) ||
__put_user(ts->tv_nsec, &cts->tv_nsec)) ? -EFAULT : 0;
} | 0 | [
"CWE-20"
] | linux | 594cc251fdd0d231d342d88b2fdff4bc42fb0690 | 123,117,836,072,004,940,000,000,000,000,000,000,000 | 6 | make 'user_access_begin()' do 'access_ok()'
Originally, the rule used to be that you'd have to do access_ok()
separately, and then user_access_begin() before actually doing the
direct (optimized) user access.
But experience has shown that people then decide not to do access_ok()
at all, and instead rely on it being i... |
e1000e_set_ics(E1000ECore *core, int index, uint32_t val)
{
trace_e1000e_irq_write_ics(val);
e1000e_set_interrupt_cause(core, val);
} | 0 | [
"CWE-835"
] | qemu | 4154c7e03fa55b4cf52509a83d50d6c09d743b77 | 5,928,812,701,810,742,000,000,000,000,000,000,000 | 5 | 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.... |
GF_Err stbl_AddChunkOffset(GF_MediaBox *mdia, u32 sampleNumber, u32 StreamDescIndex, u64 offset, u32 nb_pack)
{
GF_SampleTableBox *stbl;
GF_ChunkOffsetBox *stco;
GF_SampleToChunkBox *stsc;
GF_ChunkLargeOffsetBox *co64;
GF_StscEntry *ent;
u32 i, k, *newOff, new_chunk_idx=0;
u64 *newLarge;
s32 insert_idx = -1;
... | 0 | [
"CWE-120",
"CWE-787"
] | gpac | 77ed81c069e10b3861d88f72e1c6be1277ee7eae | 18,239,218,717,088,660,000,000,000,000,000,000,000 | 195 | fixed #1774 (fuzz) |
void preloadBuffer(const UChar8* preloadText) {
size_t ucharCount;
int errorCode;
copyString8to32(buf32, preloadText, buflen + 1, ucharCount, errorCode);
recomputeCharacterWidths(buf32, charWidths, ucharCount);
len = ucharCount;
pos = ucharCount;
} | 0 | [
"CWE-200"
] | mongo | 035cf2afc04988b22cb67f4ebfd77e9b344cb6e0 | 175,024,438,534,204,140,000,000,000,000,000,000,000 | 8 | SERVER-25335 avoid group and other permissions when creating .dbshell history file |
gdk_pixbuf__xbm_image_load_increment (gpointer data,
const guchar *buf,
guint size,
GError **error)
{
XBMData *context = (XBMData *) data;
g_return_val_if_fail (data != NULL, FALSE)... | 0 | [
"CWE-189"
] | gdk-pixbuf | 4f0f465f991cd454d03189497f923eb40c170c22 | 142,133,394,336,956,980,000,000,000,000,000,000,000 | 21 | Avoid an integer overflow in the xbm loader
At the same time, reject some silly input, such as negative
width or height.
https://bugzilla.gnome.org/show_bug.cgi?id=672811 |
void ImportEPUB::ProcessFontFiles(const QList<Resource *> &resources,
const QHash<QString, QString> &updates,
const QHash<QString, QString> &encrypted_files)
{
if (encrypted_files.empty()) {
return;
}
QList<FontResource *> font_res... | 0 | [
"CWE-22"
] | Sigil | 04e2f280cc4a0766bedcc7b9eb56449ceecc2ad4 | 76,825,915,197,055,520,000,000,000,000,000,000,000 | 47 | further harden against malicious epubs and produce error message |
static int snd_pcm_action_single(const struct action_ops *ops,
struct snd_pcm_substream *substream,
snd_pcm_state_t state)
{
int res;
res = ops->pre_action(substream, state);
if (res < 0)
return res;
res = ops->do_action(substream, state);
if (res == 0)
ops->post_action(substream, state);
else if ... | 0 | [
"CWE-125"
] | linux | 92ee3c60ec9fe64404dc035e7c41277d74aa26cb | 281,968,562,073,650,160,000,000,000,000,000,000,000 | 16 | ALSA: pcm: Fix races among concurrent hw_params and hw_free calls
Currently we have neither proper check nor protection against the
concurrent calls of PCM hw_params and hw_free ioctls, which may result
in a UAF. Since the existing PCM stream lock can't be used for
protecting the whole ioctl operations, we need a new... |
static bool vrend_hw_switch_query_context(struct vrend_context *ctx)
{
if (vrend_state.use_async_fence_cb) {
if (!ctx)
return false;
if (ctx == vrend_state.current_sync_thread_ctx)
return true;
if (ctx->ctx_id != 0 && ctx->in_error)
return false;
vrend_clicbs->ma... | 0 | [
"CWE-787"
] | virglrenderer | 95e581fd181b213c2ed7cdc63f2abc03eaaa77ec | 272,368,505,316,270,140,000,000,000,000,000,000,000 | 19 | vrend: Add test to resource OOB write and fix it
v2: Also check that no depth != 1 has been send when none is due
Closes: #250
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com> |
std::string queueloader::get_filename(const std::string& str) {
std::string fn = ctrl->get_dlpath();
if (fn[fn.length()-1] != NEWSBEUTER_PATH_SEP[0])
fn.append(NEWSBEUTER_PATH_SEP);
char buf[1024];
snprintf(buf, sizeof(buf), "%s", str.c_str());
char * base = basename(buf);
if (!base || strlen(base) == 0) {
c... | 1 | [
"CWE-78"
] | newsbeuter | 26f5a4350f3ab5507bb8727051c87bb04660f333 | 107,680,217,014,226,120,000,000,000,000,000,000,000 | 18 | Work around shell code in podcast names (#598) |
static void convert_32s2u_C1R(const OPJ_INT32* pSrc, OPJ_BYTE* pDst,
OPJ_SIZE_T length)
{
OPJ_SIZE_T i;
for (i = 0; i < (length & ~(OPJ_SIZE_T)3U); i += 4U) {
OPJ_UINT32 src0 = (OPJ_UINT32)pSrc[i + 0];
OPJ_UINT32 src1 = (OPJ_UINT32)pSrc[i + 1];
OPJ_UINT32 sr... | 0 | [
"CWE-787"
] | openjpeg | e5285319229a5d77bf316bb0d3a6cbd3cb8666d9 | 338,979,602,305,112,670,000,000,000,000,000,000,000 | 28 | pgxtoimage(): fix write stack buffer overflow (#997) |
daemon_msg_auth_req(struct daemon_slpars *pars, uint32 plen)
{
char errbuf[PCAP_ERRBUF_SIZE]; // buffer for network errors
char errmsgbuf[PCAP_ERRBUF_SIZE]; // buffer for errors to send to the client
int status;
struct rpcap_auth auth; // RPCAP authentication header
char sendbuf[RPCAP_NETBUF_SIZE]; // temporary... | 0 | [
"CWE-703",
"CWE-918"
] | libpcap | 33834cb2a4d035b52aa2a26742f832a112e90a0a | 34,326,012,738,690,104,000,000,000,000,000,000,000 | 194 | In the open request, reject capture sources that are URLs.
You shouldn't be able to ask a server to open a remote device on some
*other* server; just open it yourself.
This addresses Include Security issue F13: [libpcap] Remote Packet
Capture Daemon Allows Opening Capture URLs. |
archive_string_conversion_from_charset(struct archive *a, const char *charset,
int best_effort)
{
int flag = SCONV_FROM_CHARSET;
if (best_effort)
flag |= SCONV_BEST_EFFORT;
return (get_sconv_object(a, charset, get_current_charset(a), flag));
} | 0 | [
"CWE-476"
] | libarchive | 42a3408ac7df1e69bea9ea12b72e14f59f7400c0 | 146,617,012,706,925,230,000,000,000,000,000,000,000 | 9 | archive_strncat_l(): allocate and do not convert if length == 0
This ensures e.g. that archive_mstring_copy_mbs_len_l() does not set
aes_set = AES_SET_MBS with aes_mbs.s == NULL.
Resolves possible null-pointer dereference reported by OSS-Fuzz.
Reported-By: OSS-Fuzz issue 286 |
int __sys_recvmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen,
unsigned int flags, struct timespec *timeout)
{
int fput_needed, err, datagrams;
struct socket *sock;
struct mmsghdr __user *entry;
struct compat_mmsghdr __user *compat_entry;
struct msghdr msg_sys;
struct timespec64 end_time;
struct... | 0 | [
"CWE-362"
] | linux | 6d8c50dcb029872b298eea68cc6209c866fd3e14 | 157,711,095,143,079,860,000,000,000,000,000,000,000 | 110 | socket: close race condition between sock_close() and sockfs_setattr()
fchownat() doesn't even hold refcnt of fd until it figures out
fd is really needed (otherwise is ignored) and releases it after
it resolves the path. This means sock_close() could race with
sockfs_setattr(), which leads to a NULL pointer dereferenc... |
static void Ins_SRP2( INS_ARG )
{
CUR.GS.rp2 = (Int)(args[0]);
} | 0 | [
"CWE-125"
] | ghostpdl | c7c55972758a93350882c32147801a3485b010fe | 317,617,670,120,891,500,000,000,000,000,000,000,000 | 4 | Bug 698024: bounds check zone pointer in Ins_MIRP() |
static void uas_shutdown(struct device *dev)
{
struct usb_interface *intf = to_usb_interface(dev);
struct usb_device *udev = interface_to_usbdev(intf);
struct Scsi_Host *shost = usb_get_intfdata(intf);
struct uas_dev_info *devinfo = (struct uas_dev_info *)shost->hostdata;
if (system_state != SYSTEM_RESTART)
ret... | 0 | [
"CWE-125"
] | linux | 786de92b3cb26012d3d0f00ee37adf14527f35c4 | 41,250,628,005,460,165,000,000,000,000,000,000,000 | 15 | USB: uas: fix bug in handling of alternate settings
The uas driver has a subtle bug in the way it handles alternate
settings. The uas_find_uas_alt_setting() routine returns an
altsetting value (the bAlternateSetting number in the descriptor), but
uas_use_uas_driver() then treats that value as an index to the
intf->al... |
string_replace_with_callback (const char *string,
char *(*callback)(void *data, const char *text),
void *callback_data,
int *errors)
{
int length, length_value, index_string, index_result;
char *result, *result2, *key, *va... | 0 | [
"CWE-20"
] | weechat | efb795c74fe954b9544074aafcebb1be4452b03a | 195,072,093,278,838,860,000,000,000,000,000,000,000 | 81 | core: do not call shell to execute command in hook_process (fix security problem when a plugin/script gives untrusted command) (bug #37764) |
NO_INLINE JsVar *jspePostfixExpression() {
JsVar *a;
// TODO: should be in jspeUnaryExpression
if (lex->tk==LEX_PLUSPLUS || lex->tk==LEX_MINUSMINUS) {
int op = lex->tk;
JSP_ASSERT_MATCH(op);
a = jspePostfixExpression();
if (JSP_SHOULD_EXECUTE) {
JsVar *one = jsvNewFromInteger(1);
JsVar... | 0 | [
"CWE-787"
] | Espruino | e069be2ecc5060ef47391716e4de94999595b260 | 8,073,462,984,330,933,000,000,000,000,000,000,000 | 19 | Fix potential corruption issue caused by `delete [].__proto__` (fix #2142) |
int ssl3_get_client_certificate(SSL *s)
{
int i, ok, al, ret = -1;
X509 *x = NULL;
unsigned long l, nc, llen, n;
const unsigned char *p, *q;
unsigned char *d;
STACK_OF(X509) *sk = NULL;
n = s->method->ssl_get_message(s,
SSL3_ST_SR_CERT_A,
... | 1 | [
"CWE-125"
] | openssl | 52e623c4cb06fffa9d5e75c60b34b4bc130b12e9 | 140,613,349,966,135,560,000,000,000,000,000,000,000 | 156 | Fix small OOB reads.
In ssl3_get_client_certificate, ssl3_get_server_certificate and
ssl3_get_certificate_request check we have enough room
before reading a length.
Thanks to Shi Lei (Gear Team, Qihoo 360 Inc.) for reporting these bugs.
CVE-2016-6306
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: M... |
int64_t qmp_guest_file_open(const char *path, bool has_mode, const char *mode, Error **err)
{
FILE *fh;
int fd;
int64_t ret = -1, handle;
if (!has_mode) {
mode = "r";
}
slog("guest-file-open called, filepath: %s, mode: %s", path, mode);
fh = fopen(path, mode);
if (!fh) {
... | 1 | [
"CWE-264"
] | qemu | c689b4f1bac352dcfd6ecb9a1d45337de0f1de67 | 19,460,503,677,627,909,000,000,000,000,000,000,000 | 39 | qga: set umask 0077 when daemonizing (CVE-2013-2007)
The qemu guest agent creates a bunch of files with insecure permissions
when started in daemon mode. For example:
-rw-rw-rw- 1 root root /var/log/qemu-ga.log
-rw-rw-rw- 1 root root /var/run/qga.state
-rw-rw-rw- 1 root root /var/log/qga-fsfreeze-hook.log
In a... |
static int snd_timer_user_gparams(struct file *file,
struct snd_timer_gparams __user *_gparams)
{
struct snd_timer_gparams gparams;
struct snd_timer *t;
int err;
if (copy_from_user(&gparams, _gparams, sizeof(gparams)))
return -EFAULT;
mutex_lock(®ister_mutex);
t = snd_timer_find(&gparams.tid);
if (!t... | 0 | [
"CWE-200",
"CWE-362"
] | linux | ee8413b01045c74340aa13ad5bdf905de32be736 | 152,895,939,008,705,220,000,000,000,000,000,000,000 | 28 | ALSA: timer: Fix double unlink of active_list
ALSA timer instance object has a couple of linked lists and they are
unlinked unconditionally at snd_timer_stop(). Meanwhile
snd_timer_interrupt() unlinks it, but it calls list_del() which leaves
the element list itself unchanged. This ends up with unlinking twice,
and i... |
static int empty_dir(struct inode *inode)
{
unsigned int offset;
struct buffer_head *bh;
struct ext4_dir_entry_2 *de, *de1;
struct super_block *sb;
int err = 0;
sb = inode->i_sb;
if (inode->i_size < EXT4_DIR_REC_LEN(1) + EXT4_DIR_REC_LEN(2) ||
!(bh = ext4_bread(NULL, inode, 0, 0, &err))) {
if (err)
EX... | 0 | [
"CWE-20"
] | linux | c9b92530a723ac5ef8e352885a1862b18f31b2f5 | 238,320,405,731,921,230,000,000,000,000,000,000,000 | 85 | ext4: make orphan functions be no-op in no-journal mode
Instead of checking whether the handle is valid, we check if journal
is enabled. This avoids taking the s_orphan_lock mutex in all cases
when there is no journal in use, including the error paths where
ext4_orphan_del() is called with a handle set to NULL.
Signe... |
rf64_write_tailer (SF_PRIVATE *psf)
{
/* Reset the current header buffer length to zero. */
psf->header.ptr [0] = 0 ;
psf->header.indx = 0 ;
if (psf->bytewidth > 0 && psf->sf.seekable == SF_TRUE)
{ psf->datalength = psf->sf.frames * psf->bytewidth * psf->sf.channels ;
psf->dataend = psf->dataoffset + psf->datal... | 0 | [
"CWE-476"
] | libsndfile | 6f3266277bed16525f0ac2f0f03ff4626f1923e5 | 156,533,627,646,915,930,000,000,000,000,000,000,000 | 28 | Fix max channel count bug
The code was allowing files to be written with a channel count of exactly
`SF_MAX_CHANNELS` but was failing to read some file formats with the same
channel count. |
void StreamTcpPseudoPacketCreateStreamEndPacket(ThreadVars *tv, StreamTcpThread *stt, Packet *p, TcpSession *ssn, PacketQueue *pq)
{
SCEnter();
if (p->flags & PKT_PSEUDO_STREAM_END) {
SCReturn;
}
/* no need for a pseudo packet if there is nothing left to reassemble */
if (ssn->server.seg_l... | 0 | [] | suricata | 843d0b7a10bb45627f94764a6c5d468a24143345 | 9,532,805,427,145,807,000,000,000,000,000,000,000 | 63 | stream: support RST getting lost/ignored
In case of a valid RST on a SYN, the state is switched to 'TCP_CLOSED'.
However, the target of the RST may not have received it, or may not
have accepted it. Also, the RST may have been injected, so the supposed
sender may not actually be aware of the RST that was sent in it's ... |
static void handle_wl_output_mode(void *data, struct wl_output *output,
uint32_t flags, int32_t width, int32_t height, int32_t refresh) {
// Who cares
} | 0 | [
"CWE-703"
] | swaylock | 1d1c75b6316d21933069a9d201f966d84099f6ca | 208,605,364,177,085,270,000,000,000,000,000,000,000 | 4 | Add support for ext-session-lock-v1
This is a new protocol to lock the session [1]. It should be more
reliable than layer-shell + input-inhibitor.
[1]: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/131 |
KEY_CheckKeyLength(uint32_t key_id)
{
Key *key;
key = get_key_by_id(key_id);
if (!key)
return 0;
switch (key->class) {
case NTP_MAC:
return key->data.ntp_mac.length >= MIN_SECURE_KEY_LENGTH;
default:
return 1;
}
} | 0 | [
"CWE-59"
] | chrony | e18903a6b56341481a2e08469c0602010bf7bfe3 | 22,885,825,468,540,683,000,000,000,000,000,000,000 | 16 | switch to new util file functions
Replace all fopen(), rename(), and unlink() calls with the new util
functions. |
static void cmd_inquiry(IDEState *s, uint8_t *buf)
{
int max_len = buf[4];
buf[0] = 0x05; /* CD-ROM */
buf[1] = 0x80; /* removable */
buf[2] = 0x00; /* ISO */
buf[3] = 0x21; /* ATAPI-2 (XXX: put ATAPI-4 ?) */
buf[4] = 31; /* additional length */
buf[5] = 0; /* reserved */
buf[6] = 0; /*... | 0 | [] | qemu | ce560dcf20c14194db5ef3b9fc1ea592d4e68109 | 303,769,312,568,046,140,000,000,000,000,000,000,000 | 17 | ATAPI: STARTSTOPUNIT only eject/load media if powercondition is 0
The START STOP UNIT command will only eject/load media if
power condition is zero.
If power condition is !0 then LOEJ and START will be ignored.
From MMC (sbc contains similar wordings too)
The Power Conditions field requests the block device to be ... |
int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx)
{
X509 *err_cert;
int err,depth;
err_cert=X509_STORE_CTX_get_current_cert(ctx);
err= X509_STORE_CTX_get_error(ctx);
depth= X509_STORE_CTX_get_error_depth(ctx);
if (!verify_quiet || !ok)
{
BIO_printf(bio_err,"depth=%d ",depth);
if (err_cert)
... | 0 | [] | openssl | a70da5b3ecc3160368529677006801c58cb369db | 84,637,427,452,457,550,000,000,000,000,000,000,000 | 68 | New functions to check a hostname email or IP address against a
certificate. Add options to s_client, s_server and x509 utilities
to print results of checks. |
do_resources_recurs (WinLibrary *fi, WinResource *base, WinResource *type_wr,
WinResource *name_wr, WinResource *lang_wr,
const char *type, const char *name, const char *lang, DoResourceCallback cb)
{
int c, rescnt;
WinResource *wr;
/* get a list of all resources a... | 0 | [] | icoutils | a8c8543731ed255e6f8bb81c662155f98710ac20 | 138,487,623,016,309,200,000,000,000,000,000,000,000 | 36 | wrestool: read_library() moves memory around, check it doesn't overwrite header data |
EXPORTED int mailbox_open_iwl(const char *name, struct mailbox **mailboxptr)
{
return mailbox_open_advanced(name, LOCK_SHARED, LOCK_EXCLUSIVE,
NULL, mailboxptr);
} | 0 | [] | cyrus-imapd | 1d6d15ee74e11a9bd745e80be69869e5fb8d64d6 | 308,568,166,508,064,360,000,000,000,000,000,000,000 | 5 | mailbox.c/reconstruct.c: Add mailbox_mbentry_from_path() |
undo_read(bufinfo_T *bi, char_u *buffer, size_t size)
{
#ifdef FEAT_CRYPT
if (bi->bi_buffer != NULL)
{
int size_todo = (int)size;
char_u *p = buffer;
while (size_todo > 0)
{
size_t n;
if (bi->bi_used >= bi->bi_avail)
{
n = fread(bi->bi_buffer, 1, (size_t)CRYPT_BUF_SIZE, bi->bi_fp);
if (... | 0 | [
"CWE-190"
] | vim | 3eb1637b1bba19519885dd6d377bd5596e91d22c | 129,500,758,764,281,720,000,000,000,000,000,000,000 | 41 | patch 8.0.0377: possible overflow when reading corrupted undo file
Problem: Possible overflow when reading corrupted undo file.
Solution: Check if allocated size is not too big. (King) |
intrusive_ptr<Expression> ExpressionDateToParts::optimize() {
_date = _date->optimize();
if (_timeZone) {
_timeZone = _timeZone->optimize();
}
if (_iso8601) {
_iso8601 = _iso8601->optimize();
}
if (ExpressionConstant::allNullOrConstant({_date, _iso8601, _timeZone})) {
//... | 0 | [] | mongo | 1772b9a0393b55e6a280a35e8f0a1f75c014f301 | 304,320,830,742,354,780,000,000,000,000,000,000,000 | 17 | SERVER-49404 Enforce additional checks in $arrayToObject |
static int mov_read_sbgp(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
AVStream *st;
MOVStreamContext *sc;
unsigned int i, entries;
uint8_t version;
uint32_t grouping_type;
MOVSbgp *table, **tablep;
int *table_count;
if (c->fc->nb_streams < 1)
return 0;
st = c->fc->streams... | 0 | [
"CWE-703"
] | FFmpeg | c953baa084607dd1d84c3bfcce3cf6a87c3e6e05 | 299,806,781,581,892,020,000,000,000,000,000,000,000 | 57 | avformat/mov: Check count sums in build_open_gop_key_points()
Fixes: ffmpeg.md
Fixes: Out of array access
Fixes: CVE-2022-2566
Found-by: Andy Nguyen <theflow@google.com>
Found-by: 3pvd <3pvd@google.com>
Reviewed-by: Andy Nguyen <theflow@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> |
static size_t PCLDeltaCompressImage(const size_t length,
const unsigned char *previous_pixels,const unsigned char *pixels,
unsigned char *compress_pixels)
{
int
delta,
j,
replacement;
register ssize_t
i,
x;
register unsigned char
*q;
q=compress_pixels;
for (x=0; x < (ssize_t) le... | 0 | [
"CWE-401"
] | ImageMagick | c0fe488e7052f68d4eb7768805a857ef6fef928d | 178,281,003,676,363,270,000,000,000,000,000,000,000 | 70 | https://github.com/ImageMagick/ImageMagick/issues/1520 |
trace_get_syscall_nr(struct task_struct *task, struct pt_regs *regs)
{
if (unlikely(arch_trace_is_compat_syscall(regs)))
return -1;
return syscall_get_nr(task, regs);
} | 0 | [
"CWE-125",
"CWE-476",
"CWE-119",
"CWE-264"
] | linux | 086ba77a6db00ed858ff07451bedee197df868c9 | 239,718,463,646,162,030,000,000,000,000,000,000,000 | 7 | tracing/syscalls: Ignore numbers outside NR_syscalls' range
ARM has some private syscalls (for example, set_tls(2)) which lie
outside the range of NR_syscalls. If any of these are called while
syscall tracing is being performed, out-of-bounds array access will
occur in the ftrace and perf sys_{enter,exit} handlers.
... |
static void mmput_async_fn(struct work_struct *work)
{
struct mm_struct *mm = container_of(work, struct mm_struct, async_put_work);
__mmput(mm);
} | 0 | [
"CWE-416",
"CWE-703"
] | linux | 2b7e8665b4ff51c034c55df3cff76518d1a9ee3a | 170,588,262,403,942,580,000,000,000,000,000,000,000 | 5 | fork: fix incorrect fput of ->exe_file causing use-after-free
Commit 7c051267931a ("mm, fork: make dup_mmap wait for mmap_sem for
write killable") made it possible to kill a forking task while it is
waiting to acquire its ->mmap_sem for write, in dup_mmap().
However, it was overlooked that this introduced an new erro... |
Alter_drop *clone(MEM_ROOT *mem_root) const
{ return new (mem_root) Alter_drop(*this); } | 0 | [
"CWE-416"
] | server | 4681b6f2d8c82b4ec5cf115e83698251963d80d5 | 105,404,184,828,675,020,000,000,000,000,000,000,000 | 2 | MDEV-26281 ASAN use-after-poison when complex conversion is involved in blob
the bug was that in_vector array in Item_func_in was allocated in the
statement arena, not in the table->expr_arena.
revert part of the 5acd391e8b2d. Instead, change the arena correctly
in fix_all_session_vcol_exprs().
Remove TABLE_ARENA, t... |
static int cqspi_indirect_read_execute(struct spi_nor *nor,
u8 *rxbuf, const unsigned n_rx)
{
struct cqspi_flash_pdata *f_pdata = nor->priv;
struct cqspi_st *cqspi = f_pdata->cqspi;
void __iomem *reg_base = cqspi->iobase;
void __iomem *ahb_base = cqspi->ahb_base;
unsigned int remaining = n_rx;
unsigned... | 0 | [
"CWE-119",
"CWE-787"
] | linux | 193e87143c290ec16838f5368adc0e0bc94eb931 | 288,452,690,763,751,200,000,000,000,000,000,000,000 | 75 | mtd: spi-nor: Off by one in cqspi_setup_flash()
There are CQSPI_MAX_CHIPSELECT elements in the ->f_pdata array so the >
should be >=.
Fixes: 140623410536 ('mtd: spi-nor: Add driver for Cadence Quad SPI Flash Controller')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Marek Vasut <marex@denx.de>
... |
static void io_req_complete_state(struct io_kiocb *req, long res,
unsigned int cflags)
{
io_clean_op(req);
req->result = res;
req->compl.cflags = cflags;
req->flags |= REQ_F_COMPLETE_INLINE;
} | 0 | [
"CWE-667"
] | linux | 3ebba796fa251d042be42b929a2d916ee5c34a49 | 102,641,515,523,356,360,000,000,000,000,000,000,000 | 8 | io_uring: ensure that SQPOLL thread is started for exit
If we create it in a disabled state because IORING_SETUP_R_DISABLED is
set on ring creation, we need to ensure that we've kicked the thread if
we're exiting before it's been explicitly disabled. Otherwise we can run
into a deadlock where exit is waiting go park t... |
TEST_F(QuicServerTransportTest, ReceiveCloseAfterLocalError) {
auto qLogger = std::make_shared<FileQLogger>(VantagePoint::Server);
server->getNonConstConn().qLogger = qLogger;
ShortHeader header(
ProtectionType::KeyPhaseZero,
*server->getConn().serverConnectionId,
clientNextAppDataPacketNum++);... | 0 | [
"CWE-617",
"CWE-703"
] | mvfst | a67083ff4b8dcbb7ee2839da6338032030d712b0 | 268,087,804,122,680,670,000,000,000,000,000,000,000 | 69 | Close connection if we derive an extra 1-rtt write cipher
Summary: Fixes CVE-2021-24029
Reviewed By: mjoras, lnicco
Differential Revision: D26613890
fbshipit-source-id: 19bb2be2c731808144e1a074ece313fba11f1945 |
static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
u8 type, u8 code, int offset, __be32 info)
{
const struct ipv6hdr *hdr = (const struct ipv6hdr *)skb->data;
const struct dccp_hdr *dh = (struct dccp_hdr *)(skb->data + offset);
struct dccp_sock *dp;
struct ipv6_pinfo *np;
struct sock *sk;
... | 0 | [
"CWE-362"
] | linux-2.6 | f6d8bd051c391c1c0458a30b2a7abcd939329259 | 250,197,168,998,727,440,000,000,000,000,000,000,000 | 149 | inet: add RCU protection to inet->opt
We lack proper synchronization to manipulate inet->opt ip_options
Problem is ip_make_skb() calls ip_setup_cork() and
ip_setup_cork() possibly makes a copy of ipc->opt (struct ip_options),
without any protection against another thread manipulating inet->opt.
Another thread can ch... |
static void mg_send_u16(struct mg_connection *c, uint16_t value) {
mg_send(c, &value, sizeof(value));
} | 0 | [
"CWE-552"
] | mongoose | c65c8fdaaa257e0487ab0aaae9e8f6b439335945 | 57,639,774,569,107,490,000,000,000,000,000,000,000 | 3 | Protect against the directory traversal in mg_upload() |
static netdev_features_t xenvif_fix_features(struct net_device *dev,
netdev_features_t features)
{
struct xenvif *vif = netdev_priv(dev);
if (!vif->can_sg)
features &= ~NETIF_F_SG;
if (!vif->gso && !vif->gso_prefix)
features &= ~NETIF_F_TSO;
if (!vif->csum)
features &= ~NETIF_F_IP_CSUM;
return features;
} | 0 | [
"CWE-20"
] | linux | 48856286b64e4b66ec62b94e504d0b29c1ade664 | 129,730,241,710,149,850,000,000,000,000,000,000,000 | 14 | xen/netback: shutdown the ring if it contains garbage.
A buggy or malicious frontend should not be able to confuse netback.
If we spot anything which is not as it should be then shutdown the
device and don't try to continue with the ring in a potentially
hostile state. Well behaved and non-hostile frontends will not b... |
String *Item_field::str_result(String *str)
{
if ((null_value=result_field->is_null()))
return 0;
str->set_charset(str_value.charset());
return result_field->val_str(str,&str_value);
} | 0 | [] | server | b000e169562697aa072600695d4f0c0412f94f4f | 275,652,936,467,834,450,000,000,000,000,000,000,000 | 7 | Bug#26361149 MYSQL SERVER CRASHES AT: COL IN(IFNULL(CONST, COL), NAME_CONST('NAME', NULL))
based on:
commit f7316aa0c9a
Author: Ajo Robert <ajo.robert@oracle.com>
Date: Thu Aug 24 17:03:21 2017 +0530
Bug#26361149 MYSQL SERVER CRASHES AT: COL IN(IFNULL(CONST,
COL), NAME_CONST('NAME'... |
xmlRegStateAddTrans(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr state,
xmlRegAtomPtr atom, xmlRegStatePtr target,
int counter, int count) {
int nrtrans;
if (state == NULL) {
ERROR("add state: state is NULL");
return;
}
if (target == NULL) {
ERROR("add state: target is NULL");
retur... | 0 | [
"CWE-119"
] | libxml2 | cbb271655cadeb8dbb258a64701d9a3a0c4835b4 | 193,353,388,381,091,450,000,000,000,000,000,000,000 | 77 | Bug 757711: heap-buffer-overflow in xmlFAParsePosCharGroup <https://bugzilla.gnome.org/show_bug.cgi?id=757711>
* xmlregexp.c:
(xmlFAParseCharRange): Only advance to the next character if
there is no error. Advancing to the next character in case of
an error while parsing regexp leads to an out of bounds access. |
UnicodeStringTest::TestCountChar32(void) {
{
UnicodeString s=UNICODE_STRING("\\U0002f999\\U0001d15f\\u00c4\\u1ed0", 32).unescape();
// test countChar32()
// note that this also calls and tests u_countChar32(length>=0)
if(
s.countChar32()!=4 ||
s.countChar32(1... | 0 | [
"CWE-190",
"CWE-787"
] | icu | b7d08bc04a4296982fcef8b6b8a354a9e4e7afca | 150,443,622,598,826,220,000,000,000,000,000,000,000 | 73 | ICU-20958 Prevent SEGV_MAPERR in append
See #971 |
soup_cookie_jar_set_property (GObject *object, guint prop_id,
const GValue *value, GParamSpec *pspec)
{
SoupCookieJarPrivate *priv =
soup_cookie_jar_get_instance_private (SOUP_COOKIE_JAR (object));
switch (prop_id) {
case PROP_READ_ONLY:
priv->read_only = g_value_get_boolean (value);
break;
case PRO... | 0 | [
"CWE-125"
] | libsoup | db2b0d5809d5f8226d47312b40992cadbcde439f | 251,258,238,240,798,140,000,000,000,000,000,000,000 | 18 | cookie-jar: bail if hostname is an empty string
There are several other ways to fix the problem with this function, but
skipping over all of the code is probably the simplest.
Fixes #3 |
static int ZEND_FASTCALL ZEND_BW_NOT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
bitwise_not_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
} | 0 | [] | php-src | ce96fd6b0761d98353761bf78d5bfb55291179fd | 284,507,229,651,348,770,000,000,000,000,000,000,000 | 10 | - fix #39863, do not accept paths with NULL in them. See http://news.php.net/php.internals/50191, trunk will have the patch later (adding a macro and/or changing (some) APIs. Patch by Rasmus |
id3_skip (SF_PRIVATE * psf)
{ unsigned char buf [10] ;
memset (buf, 0, sizeof (buf)) ;
psf_binheader_readf (psf, "pb", 0, buf, 10) ;
if (buf [0] == 'I' && buf [1] == 'D' && buf [2] == '3')
{ int offset = buf [6] & 0x7f ;
offset = (offset << 7) | (buf [7] & 0x7f) ;
offset = (offset << 7) | (buf [8] & 0x7f) ;
... | 0 | [
"CWE-119",
"CWE-787"
] | libsndfile | f457b7b5ecfe91697ed01cfc825772c4d8de1236 | 65,484,225,225,491,810,000,000,000,000,000,000,000 | 29 | src/id3.c : Improve error handling |
static void __tty_hangup(struct tty_struct *tty, int exit_session)
{
struct file *cons_filp = NULL;
struct file *filp, *f = NULL;
struct tty_file_private *priv;
int closecount = 0, n;
int refs;
if (!tty)
return;
spin_lock(&redirect_lock);
if (redirect && file_tty(redirect) == tty) {
f = redirect;
re... | 0 | [
"CWE-200",
"CWE-362"
] | linux | 5c17c861a357e9458001f021a7afa7aab9937439 | 248,612,011,983,953,160,000,000,000,000,000,000,000 | 86 | tty: Fix unsafe ldisc reference via ioctl(TIOCGETD)
ioctl(TIOCGETD) retrieves the line discipline id directly from the
ldisc because the line discipline id (c_line) in termios is untrustworthy;
userspace may have set termios via ioctl(TCSETS*) without actually
changing the line discipline via ioctl(TIOCSETD).
However... |
base64_to_byte_array (gunichar2 *start, gint ilength, MonoBoolean allowWhitespaceOnly)
{
gint ignored;
gint i;
gunichar2 c;
gunichar2 last, prev_last, prev2_last;
gint olength;
MonoArray *result;
guchar *res_ptr;
gint a [4], b [4];
MonoException *exc;
ignored = 0;
last = prev_last = 0, prev2_last = 0;
for ... | 0 | [
"CWE-264"
] | mono | 035c8587c0d8d307e45f1b7171a0d337bb451f1e | 227,876,953,970,605,480,000,000,000,000,000,000,000 | 86 | Allow only primitive types/enums in RuntimeHelpers.InitializeArray (). |
yystrlen (const char *yystr)
{
YYSIZE_T yylen;
for (yylen = 0; yystr[yylen]; yylen++)
continue;
return yylen;
} | 1 | [
"CWE-19"
] | ntp | fe46889f7baa75fc8e6c0fcde87706d396ce1461 | 279,845,132,198,429,670,000,000,000,000,000,000,000 | 7 | [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. |
static void copy_option(uint8_t *buf, uint16_t code, uint16_t len,
uint8_t *msg)
{
buf[0] = code >> 8;
buf[1] = code & 0xff;
buf[2] = len >> 8;
buf[3] = len & 0xff;
if (len > 0 && msg)
memcpy(&buf[4], msg, len);
} | 0 | [] | connman | a74524b3e3fad81b0fd1084ffdf9f2ea469cd9b1 | 301,681,738,139,554,800,000,000,000,000,000,000,000 | 10 | gdhcp: Avoid leaking stack data via unitiialized variable
Fixes: CVE-2021-26676 |
xsltSetLoaderFunc(xsltDocLoaderFunc f) {
if (f == NULL)
xsltDocDefaultLoader = xsltDocDefaultLoaderFunc;
else
xsltDocDefaultLoader = f;
} | 0 | [] | libxslt | e03553605b45c88f0b4b2980adfbbb8f6fca2fd6 | 245,773,274,450,095,570,000,000,000,000,000,000,000 | 6 | Fix security framework bypass
xsltCheckRead and xsltCheckWrite return -1 in case of error but callers
don't check for this condition and allow access. With a specially
crafted URL, xsltCheckRead could be tricked into returning an error
because of a supposedly invalid URL that would still be loaded
succesfully later on... |
static int wait_for_thread(thread_t thread)
{
return pthread_join(thread, NULL) == 0;
} | 0 | [
"CWE-330"
] | openssl | 1b0fe00e2704b5e20334a16d3c9099d1ba2ef1be | 247,550,686,047,382,650,000,000,000,000,000,000,000 | 4 | drbg: ensure fork-safety without using a pthread_atfork handler
When the new OpenSSL CSPRNG was introduced in version 1.1.1,
it was announced in the release notes that it would be fork-safe,
which the old CSPRNG hadn't been.
The fork-safety was implemented using a fork count, which was
incremented by a pthread_atfork... |
static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
zval *array_ptr = &EX_T(opline->result.u.var).tmp_var;
zval *expr_ptr;
zval *offset=_get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
#if 0 || IS_CV == IS_VAR || IS_CV == IS_CV
... | 0 | [] | php-src | ce96fd6b0761d98353761bf78d5bfb55291179fd | 47,009,062,418,023,820,000,000,000,000,000,000,000 | 78 | - fix #39863, do not accept paths with NULL in them. See http://news.php.net/php.internals/50191, trunk will have the patch later (adding a macro and/or changing (some) APIs. Patch by Rasmus |
int Curl_strncasecompare(const char *first, const char *second, size_t max)
{
while(*first && *second && max) {
if(Curl_raw_toupper(*first) != Curl_raw_toupper(*second)) {
break;
}
max--;
first++;
second++;
}
if(0 == max)
return 1; /* they are equal this far */
return Curl_raw_tou... | 0 | [] | curl | 852aa5ad351ea53e5f01d2f44b5b4370c2bf5425 | 161,226,856,599,520,340,000,000,000,000,000,000,000 | 15 | url: check sasl additional parameters for connection reuse.
Also move static function safecmp() as non-static Curl_safecmp() since
its purpose is needed at several places.
Bug: https://curl.se/docs/CVE-2022-22576.html
CVE-2022-22576
Closes #8746 |
void ValidateInputs(OpKernelContext* ctx,
const CSRSparseMatrix& sparse_matrix,
const Tensor& permutation_indices, int* batch_size,
int64* num_rows) {
OP_REQUIRES(ctx, sparse_matrix.dtype() == DataTypeToEnum<T>::value,
errors::Inval... | 1 | [
"CWE-476"
] | tensorflow | e6a7c7cc18c3aaad1ae0872cb0a959f5c923d2bd | 336,558,180,459,502,140,000,000,000,000,000,000,000 | 44 | Remove `OP_REQUIRES` call from helper function.
Since `OP_REQUIRES` macro expands to a `return;` (among other), calling it in a helper function only ends the helper function's execution earlier, but the kernel will still run from start to end. Thus, all the expected validations are actually broken/useless as the code ... |
static int rsi_usb_load_data_master_write(struct rsi_hw *adapter,
u32 base_address,
u32 instructions_sz, u16 block_size,
u8 *ta_firmware)
{
u16 num_blocks;
u32 cur_indx, i;
u8 temp_buf[256];
int status;
num_blocks = instructions_sz / block_size;
rsi_dbg(INFO_ZONE, "num_blocks: %d\n", num_blo... | 0 | [
"CWE-415"
] | wireless-drivers | 8b51dc7291473093c821195c4b6af85fadedbc2f | 326,048,552,812,324,320,000,000,000,000,000,000,000 | 41 | rsi: fix a double free bug in rsi_91x_deinit()
`dev` (struct rsi_91x_usbdev *) field of adapter
(struct rsi_91x_usbdev *) is allocated and initialized in
`rsi_init_usb_interface`. If any error is detected in information
read from the device side, `rsi_init_usb_interface` will be
freed. However, in the higher level e... |
static void lis_close(struct tls_listener *listener)
{
if (listener->is_registered) {
pjsip_tpmgr_unregister_tpfactory(listener->tpmgr, &listener->factory);
listener->is_registered = PJ_FALSE;
}
if (listener->ssock) {
pj_ssl_sock_close(listener->ssock);
listener->ssock = NULL;
}
} | 0 | [
"CWE-362",
"CWE-703"
] | pjproject | d5f95aa066f878b0aef6a64e60b61e8626e664cd | 338,626,231,057,090,300,000,000,000,000,000,000,000 | 12 | Merge pull request from GHSA-cv8x-p47p-99wr
* - Avoid SSL socket parent/listener getting destroyed during handshake by increasing parent's reference count.
- Add missing SSL socket close when the newly accepted SSL socket is discarded in SIP TLS transport.
* - Fix silly mistake: accepted active socket created without... |
static int test_GENERAL_NAME_cmp(void)
{
size_t i, j;
GENERAL_NAME **namesa = OPENSSL_malloc(sizeof(*namesa)
* OSSL_NELEM(gennames));
GENERAL_NAME **namesb = OPENSSL_malloc(sizeof(*namesb)
* OSSL_NELEM(gennames));
int ... | 0 | [
"CWE-476"
] | openssl | 97ab3c4b538840037812c8d9164d09a1f4bf11a1 | 62,915,723,312,988,620,000,000,000,000,000,000,000 | 52 | Add a test for GENERAL_NAME_cmp
Based on a boringssl test contributed by David Benjamin
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> |
handle_image (void *data, unsigned int datasize,
EFI_LOADED_IMAGE *li,
EFI_IMAGE_ENTRY_POINT *entry_point,
EFI_PHYSICAL_ADDRESS *alloc_address,
UINTN *alloc_pages)
{
EFI_STATUS efi_status;
char *buffer;
int i;
EFI_IMAGE_SECTION_HEADER *Section;
char *base, *end;
UINT32 size;
PE_COFF_L... | 0 | [
"CWE-787"
] | shim | 159151b6649008793d6204a34d7b9c41221fb4b0 | 37,439,915,958,794,330,000,000,000,000,000,000,000 | 319 | Also avoid CVE-2022-28737 in verify_image()
PR 446 ("Add verify_image") duplicates some of the code affected by
Chris Coulson's defense in depth patch against CVE-2022-28737 ("pe:
Perform image verification earlier when loading grub").
This patch makes the same change to the new function.
Signed-off-by: Peter Jones ... |
mvcur(int yold, int xold, int ynew, int xnew)
{
return NCURSES_SP_NAME(mvcur) (CURRENT_SCREEN, yold, xold, ynew, xnew);
} | 0 | [] | ncurses | 790a85dbd4a81d5f5d8dd02a44d84f01512ef443 | 283,981,859,131,734,900,000,000,000,000,000,000,000 | 4 | ncurses 6.2 - patch 20200531
+ correct configure version-check/warnng for g++ to allow for 10.x
+ re-enable "bel" in konsole-base (report by Nia Huang)
+ add linux-s entry (patch by Alexandre Montaron).
+ drop long-obsolete convert_configure.pl
+ add test/test_parm.c, for checking tparm changes.
+ improve parameter-ch... |
can_clear_with(NCURSES_SP_DCLx ARG_CH_T ch)
{
if (!back_color_erase && SP_PARM->_coloron) {
#if NCURSES_EXT_FUNCS
int pair;
if (!SP_PARM->_default_color)
return FALSE;
if (!(isDefaultColor(SP_PARM->_default_fg) &&
isDefaultColor(SP_PARM->_default_bg)))
return FALSE;
if ((pair = GetPair(CHDEREF... | 0 | [] | ncurses | 790a85dbd4a81d5f5d8dd02a44d84f01512ef443 | 13,862,017,367,073,534,000,000,000,000,000,000,000 | 28 | ncurses 6.2 - patch 20200531
+ correct configure version-check/warnng for g++ to allow for 10.x
+ re-enable "bel" in konsole-base (report by Nia Huang)
+ add linux-s entry (patch by Alexandre Montaron).
+ drop long-obsolete convert_configure.pl
+ add test/test_parm.c, for checking tparm changes.
+ improve parameter-ch... |
static int i2r_IPAddrBlocks(const X509V3_EXT_METHOD *method,
void *ext, BIO *out, int indent)
{
const IPAddrBlocks *addr = ext;
int i;
for (i = 0; i < sk_IPAddressFamily_num(addr); i++) {
IPAddressFamily *f = sk_IPAddressFamily_value(addr, i);
const unsigned int a... | 0 | [
"CWE-119",
"CWE-787"
] | openssl | 068b963bb7afc57f5bdd723de0dd15e7795d5822 | 199,205,484,802,727,830,000,000,000,000,000,000,000 | 67 | Avoid out-of-bounds read
Fixes CVE 2017-3735
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
(Merged from https://github.com/openssl/openssl/pull/4276)
(cherry picked from commit b23171744b01e473ebbfd6edad70c1c3825ffbcd) |
char *ip6_string(char *p, const char *addr, const char *fmt)
{
int i;
for (i = 0; i < 8; i++) {
p = hex_byte_pack(p, *addr++);
p = hex_byte_pack(p, *addr++);
if (fmt[0] == 'I' && i != 7)
*p++ = ':';
}
*p = '\0';
return p;
} | 0 | [
"CWE-200"
] | linux | ad67b74d2469d9b82aaa572d76474c95bc484d57 | 225,582,408,543,093,700,000,000,000,000,000,000,000 | 14 | printk: hash addresses printed with %p
Currently there exist approximately 14 000 places in the kernel where
addresses are being printed using an unadorned %p. This potentially
leaks sensitive information regarding the Kernel layout in memory. Many
of these calls are stale, instead of fixing every call lets hash the
a... |
static ssize_t TIFFReadCustomStream(unsigned char *data,const size_t count,
void *user_data)
{
PhotoshopProfile
*profile;
size_t
total;
ssize_t
remaining;
if (count == 0)
return(0);
profile=(PhotoshopProfile *) user_data;
remaining=(MagickOffsetType) profile->length-profile->offset;
i... | 0 | [
"CWE-770"
] | ImageMagick | 32a3eeb9e0da083cbc05909e4935efdbf9846df9 | 338,616,658,694,561,800,000,000,000,000,000,000,000 | 22 | https://github.com/ImageMagick/ImageMagick/issues/736 |
system_command()
{
char *cmd;
++c_token;
cmd = try_to_get_string();
do_system(cmd);
free(cmd);
} | 0 | [
"CWE-415"
] | gnuplot | 052cbd17c3cbbc602ee080b2617d32a8417d7563 | 237,445,037,548,121,860,000,000,000,000,000,000,000 | 8 | successive failures of "set print <foo>" could cause double-free
Bug #2312 |
static void blk_mq_run_work_fn(struct work_struct *work)
{
struct blk_mq_hw_ctx *hctx;
hctx = container_of(work, struct blk_mq_hw_ctx, run_work.work);
__blk_mq_run_hw_queue(hctx);
} | 0 | [
"CWE-362",
"CWE-264"
] | linux | 0048b4837affd153897ed1222283492070027aa9 | 306,938,426,392,193,500,000,000,000,000,000,000,000 | 8 | 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. ... |
executing_line_number ()
{
if (executing && showing_function_line == 0 &&
(variable_context == 0 || interactive_shell == 0) &&
currently_executing_command)
{
#if defined (COND_COMMAND)
if (currently_executing_command->type == cm_cond)
return currently_executing_command->value.Cond->line;
#endif... | 0 | [] | bash | 863d31ae775d56b785dc5b0105b6d251515d81d5 | 306,993,517,462,164,440,000,000,000,000,000,000,000 | 24 | commit bash-20120224 snapshot |
static ssize_t objs_per_slab_show(struct kmem_cache *s, char *buf)
{
return sprintf(buf, "%d\n", oo_objects(s->oo));
} | 0 | [
"CWE-189"
] | linux | f8bd2258e2d520dff28c855658bd24bdafb5102d | 149,421,529,791,126,130,000,000,000,000,000,000,000 | 4 | remove div_long_long_rem
x86 is the only arch right now, which provides an optimized for
div_long_long_rem and it has the downside that one has to be very careful that
the divide doesn't overflow.
The API is a little akward, as the arguments for the unsigned divide are
signed. The signed version also doesn't handle ... |
TEST(Url, ParsingFails) {
Utility::Url url;
EXPECT_FALSE(url.initialize("", false));
EXPECT_FALSE(url.initialize("foo", false));
EXPECT_FALSE(url.initialize("http://", false));
EXPECT_FALSE(url.initialize("random_scheme://host.com/path", false));
EXPECT_FALSE(url.initialize("http://www.foo.com", true));
E... | 0 | [] | envoy | 3b5acb2f43548862dadb243de7cf3994986a8e04 | 110,821,334,231,473,080,000,000,000,000,000,000,000 | 9 | 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.