func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
static char *base64enc(const char *str)
{
unsigned len = strlen(str);
if (len > sizeof(G.wget_buf)/4*3 - 10) /* paranoia */
len = sizeof(G.wget_buf)/4*3 - 10;
bb_uuencode(G.wget_buf, str, len, bb_uuenc_tbl_base64);
return G.wget_buf;
} | 0 | [
"CWE-120"
] | busybox | 8e2174e9bd836e53c8b9c6e00d1bc6e2a718686e | 166,454,812,566,517,870,000,000,000,000,000,000,000 | 8 | wget: check chunk length for overflowing off_t
function old new delta
retrieve_file_data 428 465 +37
wget_main 2386 2389 +3
-----------------------------------------------------... |
store_arg (VerifyContext *ctx, guint32 arg)
{
ILStackDesc *value;
if (arg >= ctx->max_args) {
CODE_NOT_VERIFIABLE (ctx, g_strdup_printf ("Method doesn't have argument %d at 0x%04x", arg + 1, ctx->ip_offset));
if (check_underflow (ctx, 1))
stack_pop (ctx);
return;
}
if (check_underflow (ctx, 1)) {
value... | 0 | [
"CWE-20"
] | mono | 4905ef1130feb26c3150b28b97e4a96752e0d399 | 212,561,406,337,886,870,000,000,000,000,000,000,000 | 20 | Handle invalid instantiation of generic methods.
* verify.c: Add new function to internal verifier API to check
method instantiations.
* reflection.c (mono_reflection_bind_generic_method_parameters):
Check the instantiation before returning it.
Fixes #655847 |
static void xml_print_section_header(WriterContext *wctx)
{
XMLContext *xml = wctx->priv;
const struct section *section = wctx->section[wctx->level];
const struct section *parent_section = wctx->level ?
wctx->section[wctx->level-1] : NULL;
if (wctx->level == 0) {
const char *qual = " xm... | 0 | [
"CWE-476"
] | FFmpeg | 837cb4325b712ff1aab531bf41668933f61d75d2 | 318,993,522,870,551,800,000,000,000,000,000,000,000 | 39 | ffprobe: Fix null pointer dereference with color primaries
Found-by: AD-lab of venustech
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> |
MODRET set_accessdenymsg(cmd_rec *cmd) {
config_rec *c = NULL;
CHECK_ARGS(cmd, 1);
CHECK_CONF(cmd, CONF_ROOT|CONF_VIRTUAL|CONF_GLOBAL|CONF_ANON);
c = add_config_param_str(cmd->argv[0], 1, cmd->argv[1]);
c->flags |= CF_MERGEDOWN;
return PR_HANDLED(cmd);
} | 0 | [
"CWE-59",
"CWE-61"
] | proftpd | ecff21e0d0e84f35c299ef91d7fda088e516d4ed | 60,267,173,127,053,965,000,000,000,000,000,000,000 | 11 | Backporting recursive handling of DefaultRoot path, when AllowChrootSymlinks
is off, to 1.3.5 branch. |
void avahi_server_prepare_response(AvahiServer *s, AvahiInterface *i, AvahiEntry *e, int unicast_response, int auxiliary) {
assert(s);
assert(i);
assert(e);
avahi_record_list_push(s->record_list, e->record, e->flags & AVAHI_PUBLISH_UNIQUE, unicast_response, auxiliary);
} | 0 | [
"CWE-399"
] | avahi | 3093047f1aa36bed8a37fa79004bf0ee287929f4 | 40,595,081,593,476,940,000,000,000,000,000,000,000 | 7 | Don't get confused by UDP packets with a source port that is zero
This is a fix for rhbz 475394.
Problem identified by Hugo Dias. |
call_all_filters (P11KitIter *iter,
CK_BBOOL *matches)
{
Callback *cb;
CK_RV rv;
*matches = CK_TRUE;
for (cb = iter->callbacks; cb != NULL; cb = cb->next) {
rv = (cb->func) (iter, matches, cb->callback_data);
if (rv != CKR_OK || !*matches)
return rv;
}
return CKR_OK;
} | 0 | [
"CWE-190"
] | p11-kit | 5307a1d21a50cacd06f471a873a018d23ba4b963 | 131,645,326,659,577,620,000,000,000,000,000,000,000 | 16 | Check for arithmetic overflows before allocating |
static void virtio_gpu_set_scanout(VirtIOGPU *g,
struct virtio_gpu_ctrl_command *cmd)
{
struct virtio_gpu_simple_resource *res;
struct virtio_gpu_scanout *scanout;
pixman_format_code_t format;
uint32_t offset;
int bpp;
struct virtio_gpu_set_scanout ss;
VIR... | 1 | [] | qemu | 2fe760554eb3769d70f608a158474f728ba45ba6 | 294,520,715,718,970,930,000,000,000,000,000,000,000 | 93 | virtio-gpu: check max_outputs only
The scanout id should not be above the configured num_scanouts.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 1463653560-26958-5-git-send-email-marcandre.lureau@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> |
search_in_range(regex_t* reg, const UChar* str, const UChar* end,
const UChar* start, const UChar* range, /* match start range */
const UChar* data_range, /* subject string range */
OnigRegion* region,
OnigOptionType option, OnigMatchParam* mp)
{
int r;
... | 1 | [
"CWE-125"
] | oniguruma | bfc36d3d8139b8be4d3df630d625c58687b0c7d4 | 86,072,992,598,080,850,000,000,000,000,000,000,000 | 351 | fix #164: Integer overflow related to reg->dmax in search_in_range() |
static void print_stuff(BIO *bio, SSL *s, int full)
{
X509 *peer=NULL;
char *p;
static const char *space=" ";
char buf[BUFSIZ];
STACK_OF(X509) *sk;
STACK_OF(X509_NAME) *sk2;
const SSL_CIPHER *c;
X509_NAME *xn;
int j,i;
#ifndef OPENSSL_NO_COMP
const COMP_METHOD *comp, *expansion;
#endif
if (f... | 0 | [] | openssl | ee2ffc279417f15fef3b1073c7dc81a908991516 | 65,152,738,241,483,780,000,000,000,000,000,000,000 | 145 | Add Next Protocol Negotiation. |
unsigned int STDCALL mysql_field_count(MYSQL *mysql)
{
return mysql->field_count;
} | 0 | [] | mysql-server | 3d8134d2c9b74bc8883ffe2ef59c168361223837 | 130,546,430,071,579,070,000,000,000,000,000,000,000 | 4 | Bug#25988681: USE-AFTER-FREE IN MYSQL_STMT_CLOSE()
Description: If mysql_stmt_close() encountered error,
it recorded error in prepared statement
but then frees memory assigned to prepared
statement. If mysql_stmt_error() is used
to get error information, it will resu... |
static int ntop_get_interface_find_flow_by_key(lua_State* vm) {
NetworkInterfaceView *ntop_interface = getCurrentInterface(vm);
u_int32_t key;
Flow *f;
patricia_tree_t *ptree = get_allowed_nets(vm);
ntop->getTrace()->traceEvent(TRACE_INFO, "%s() called", __FUNCTION__);
if(ntop_lua_check(vm, __FUNCTION__, ... | 0 | [
"CWE-254"
] | ntopng | 2e0620be3410f5e22c9aa47e261bc5a12be692c6 | 286,851,180,804,639,700,000,000,000,000,000,000,000 | 22 | Added security fix to avoid escalating privileges to non-privileged users
Many thanks to Dolev Farhi for reporting it |
OFCondition DcmSCP::receiveSTORERequestDataset(T_ASC_PresentationContextID *presID,
T_DIMSE_C_StoreRQ &reqMessage,
const OFString &filename)
{
if (m_assoc == NULL)
return DIMSE_ILLEGALASSOCIATION;
if (filename.empty())... | 0 | [
"CWE-264"
] | dcmtk | beaf5a5c24101daeeafa48c375120b16197c9e95 | 294,007,411,987,668,200,000,000,000,000,000,000,000 | 54 | Make sure to handle setuid() return code properly.
In some tools the return value of setuid() is not checked. In the worst
case this could lead to privilege escalation since the process does not
give up its root privileges and continue as root. |
void Free(TfLiteContext* context, void* buffer) {
#if defined(TFLITE_WITH_MULTITHREADED_EIGEN)
eigen_support::DecrementUsageCounter(context);
#endif
delete reinterpret_cast<OpData*>(buffer);
} | 0 | [
"CWE-125",
"CWE-787"
] | tensorflow | 1970c2158b1ffa416d159d03c3370b9a462aee35 | 219,579,713,552,505,980,000,000,000,000,000,000,000 | 6 | [tflite]: Insert `nullptr` checks when obtaining tensors.
As part of ongoing refactoring, `tflite::GetInput`, `tflite::GetOutput`, `tflite::GetTemporary` and `tflite::GetIntermediates` will return `nullptr` in some cases. Hence, we insert the `nullptr` checks on all usages.
We also insert `nullptr` checks on usages o... |
static int axff_init(struct hid_device *hid)
{
struct axff_device *axff;
struct hid_report *report;
struct hid_input *hidinput = list_first_entry(&hid->inputs, struct hid_input, list);
struct list_head *report_list =&hid->report_enum[HID_OUTPUT_REPORT].report_list;
struct input_dev *dev = hidinput->input;
int fie... | 1 | [
"CWE-787"
] | linux | d9d4b1e46d9543a82c23f6df03f4ad697dab361b | 225,711,192,569,096,600,000,000,000,000,000,000,000 | 51 | HID: Fix assumption that devices have inputs
The syzbot fuzzer found a slab-out-of-bounds write bug in the hid-gaff
driver. The problem is caused by the driver's assumption that the
device must have an input report. While this will be true for all
normal HID input devices, a suitably malicious device can violate the... |
long keyctl_keyring_unlink(key_serial_t id, key_serial_t ringid)
{
key_ref_t keyring_ref, key_ref;
struct key *keyring, *key;
long ret;
keyring_ref = lookup_user_key(ringid, 0, KEY_NEED_WRITE);
if (IS_ERR(keyring_ref)) {
ret = PTR_ERR(keyring_ref);
goto error;
}
key_ref = lookup_user_key(id, KEY_LOOKUP_FOR... | 0 | [
"CWE-347"
] | linux | ee8f844e3c5a73b999edf733df1c529d6503ec2f | 161,405,844,546,164,550,000,000,000,000,000,000,000 | 32 | KEYS: Disallow keyrings beginning with '.' to be joined as session keyrings
This fixes CVE-2016-9604.
Keyrings whose name begin with a '.' are special internal keyrings and so
userspace isn't allowed to create keyrings by this name to prevent
shadowing. However, the patch that added the guard didn't fix
KEYCTL_JOIN_... |
s32 M4V_LoadObject(GF_M4VParser *m4v)
{
u32 v, bpos, found;
char m4v_cache[M4V_CACHE_SIZE];
u64 end, cache_start, load_size;
if (!m4v) return 0;
bpos = 0;
found = 0;
load_size = 0;
end = 0;
cache_start = 0;
v = 0xffffffff;
while (!end) {
/*refill cache*/
if (bpos == (u32) load_size) {
if (!gf_bs_avail... | 0 | [
"CWE-119",
"CWE-787"
] | gpac | 90dc7f853d31b0a4e9441cba97feccf36d8b69a4 | 319,220,104,571,498,000,000,000,000,000,000,000,000 | 36 | fix some exploitable overflows (#994, #997) |
void ServerConnectionImpl::sendProtocolError(absl::string_view details) {
if (!Runtime::runtimeFeatureEnabled("envoy.reloadable_features.early_errors_via_hcm")) {
sendProtocolErrorOld(details);
return;
}
// We do this here because we may get a protocol error before we have a logical stream.
if (!active_... | 0 | [
"CWE-770"
] | envoy | 7ca28ff7d46454ae930e193d97b7d08156b1ba59 | 94,850,817,051,470,260,000,000,000,000,000,000,000 | 28 | [http1] Include request URL in request header size computation, and reject partial headers that exceed configured limits (#145)
Signed-off-by: antonio <avd@google.com> |
GC_INNER void GC_merge_unmapped(void)
{
struct hblk * h, *next;
hdr * hhdr, *nexthdr;
word size, nextsize;
int i;
for (i = 0; i <= N_HBLK_FLS; ++i) {
h = GC_hblkfreelist[i];
while (h != 0) {
GET_HDR(h, hhdr);
size = hhdr->hb_sz;
next = (struct hblk *)((word)h + s... | 0 | [
"CWE-119"
] | bdwgc | 7292c02fac2066d39dd1bcc37d1a7054fd1e32ee | 108,199,851,826,755,250,000,000,000,000,000,000,000 | 59 | Fix malloc routines to prevent size value wrap-around
See issue #135 on Github.
* allchblk.c (GC_allochblk, GC_allochblk_nth): Use
OBJ_SZ_TO_BLOCKS_CHECKED instead of OBJ_SZ_TO_BLOCKS.
* malloc.c (GC_alloc_large): Likewise.
* alloc.c (GC_expand_hp_inner): Type of "bytes" local variable changed
from word to size_t; ca... |
static int do_open(struct inode *inode, struct file *filp)
{
nfs_fscache_open_file(inode, filp);
return 0;
} | 0 | [
"CWE-909"
] | linux | ac795161c93699d600db16c1a8cc23a65a1eceaf | 320,931,377,911,246,420,000,000,000,000,000,000,000 | 5 | NFSv4: Handle case where the lookup of a directory fails
If the application sets the O_DIRECTORY flag, and tries to open a
regular file, nfs_atomic_open() will punt to doing a regular lookup.
If the server then returns a regular file, we will happily return a
file descriptor with uninitialised open state.
The fix is ... |
Nef_polyhedron_2<T,Items,Mark> operator!() const
{ return complement(); } | 0 | [
"CWE-269"
] | cgal | 618b409b0fbcef7cb536a4134ae3a424ef5aae45 | 76,844,797,178,447,940,000,000,000,000,000,000,000 | 2 | Fix Nef_2 and Nef_S2 IO |
static void temp_split_chan_free(TEMP_SPLIT_CHAN_REC *rec)
{
g_string_free(rec->nicks, TRUE);
g_free(rec);
} | 0 | [
"CWE-416"
] | irssi | a6cae91cecba2e8cf11ed779c5da5a229472575c | 90,880,036,688,011,500,000,000,000,000,000,000,000 | 5 | Merge pull request #812 from ailin-nemui/tape-netsplit
revert netsplit print optimisation
(cherry picked from commit 7de1378dab8081932d9096e19ae3d0921e560230) |
static inline void __pmd_populate(pmd_t *pmdp, phys_addr_t pte,
pmdval_t prot)
{
set_pmd(pmdp, __pmd(pte | prot));
} | 0 | [] | linux | 1d18c47c735e8adfe531fc41fae31e98f86b68fe | 158,533,554,503,023,450,000,000,000,000,000,000,000 | 5 | arm64: MMU fault handling and page table management
This patch adds support for the handling of the MMU faults (exception
entry code introduced by a previous patch) and page table management.
The user translation table is pointed to by TTBR0 and the kernel one
(swapper_pg_dir) by TTBR1. There is no translation inform... |
expat_start_cb(void *userData, const XML_Char *name, const XML_Char **atts)
{
struct expat_userData *ud = (struct expat_userData *)userData;
struct archive_read *a = ud->archive;
struct xmlattr_list list;
int r;
r = expat_xmlattr_setup(a, &list, atts);
if (r == ARCHIVE_OK)
r = xml_start(a, (const char *)name, ... | 0 | [
"CWE-125"
] | libarchive | fa7438a0ff4033e4741c807394a9af6207940d71 | 289,407,519,525,717,230,000,000,000,000,000,000,000 | 13 | Do something sensible for empty strings to make fuzzers happy. |
hcom_client_destroy_stream
(
IN p_hsm_com_stream_hdl_t p_stream_hdl,
IN p_hsm_com_client_hdl_t p_client_hdl
)
{
return HSM_COM_OK;
}
| 0 | [
"CWE-362"
] | opa-fm | c5759e7b76f5bf844be6c6641cc1b356bbc83869 | 147,060,265,271,798,470,000,000,000,000,000,000,000 | 8 | Fix scripts and code that use well-known tmp files. |
static void adjust_sit_entry_set(struct sit_entry_set *ses,
struct list_head *head)
{
struct sit_entry_set *next = ses;
if (list_is_last(&ses->set_list, head))
return;
list_for_each_entry_continue(next, head, set_list)
if (ses->entry_cnt <= next->entry_cnt)
break;
list_move_tail(&ses->set_list, &nex... | 0 | [
"CWE-20"
] | linux | 638164a2718f337ea224b747cf5977ef143166a4 | 78,231,890,096,580,670,000,000,000,000,000,000,000 | 14 | f2fs: fix potential panic during fstrim
As Ju Hyung Park reported:
"When 'fstrim' is called for manual trim, a BUG() can be triggered
randomly with this patch.
I'm seeing this issue on both x86 Desktop and arm64 Android phone.
On x86 Desktop, this was caused during Ubuntu boot-up. I have a
cronjob installed which c... |
static double mp_argkth(_cimg_math_parser& mp) {
const unsigned int i_end = (unsigned int)mp.opcode[2];
const double val = mp_kth(mp);
for (unsigned int i = 4; i<i_end; ++i) if (val==_mp_arg(i)) return i - 3.0;
return 1; | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 198,807,910,316,716,760,000,000,000,000,000,000,000 | 6 | Fix other issues in 'CImg<T>::load_bmp()'. |
keystr_from_desc(KEYDB_SEARCH_DESC *desc)
{
switch(desc->mode)
{
case KEYDB_SEARCH_MODE_LONG_KID:
case KEYDB_SEARCH_MODE_SHORT_KID:
return keystr(desc->u.kid);
case KEYDB_SEARCH_MODE_FPR20:
{
u32 keyid[2];
keyid[0] = buf32_to_u32 (desc->u.fpr+12);
keyid[1] = buf32_to_u32 (desc->u.fpr+... | 0 | [
"CWE-20"
] | gnupg | 2183683bd633818dd031b090b5530951de76f392 | 284,787,143,669,807,600,000,000,000,000,000,000,000 | 24 | Use inline functions to convert buffer data to scalars.
* common/host2net.h (buf16_to_ulong, buf16_to_uint): New.
(buf16_to_ushort, buf16_to_u16): New.
(buf32_to_size_t, buf32_to_ulong, buf32_to_uint, buf32_to_u32): New.
--
Commit 91b826a38880fd8a989318585eb502582636ddd8 was not enough to
avoid all sign extension on ... |
static int ud_interception(struct vcpu_svm *svm)
{
int er;
er = emulate_instruction(&svm->vcpu, 0, 0, EMULTYPE_TRAP_UD);
if (er != EMULATE_DONE)
kvm_queue_exception(&svm->vcpu, UD_VECTOR);
return 1;
} | 0 | [
"CWE-400"
] | linux-2.6 | 9581d442b9058d3699b4be568b6e5eae38a41493 | 267,662,824,422,250,260,000,000,000,000,000,000,000 | 9 | KVM: Fix fs/gs reload oops with invalid ldt
kvm reloads the host's fs and gs blindly, however the underlying segment
descriptors may be invalid due to the user modifying the ldt after loading
them.
Fix by using the safe accessors (loadsegment() and load_gs_index()) instead
of home grown unsafe versions.
This is CVE-... |
static int get_name_from_EF_DatiPersonali(unsigned char *EFdata,
char name[], int name_len)
{
/*
* Bytes 0-5 contain the ASCII encoding of the following TLV
* structure's total size, in base 16.
*/
const unsigned int EF_personaldata_maxlen = 400;
const unsigned int tlv_length_size = 6;
char *file = (char*)&... | 0 | [
"CWE-125"
] | OpenSC | 8fe377e93b4b56060e5bbfb6f3142ceaeca744fa | 272,023,431,911,177,900,000,000,000,000,000,000,000 | 83 | fixed out of bounds reads
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting and suggesting security fixes. |
static int replmd_get_la_entry_source(struct ldb_module *module,
struct la_entry *la_entry,
TALLOC_CTX *mem_ctx,
const struct dsdb_attribute **ret_attr,
struct ldb_message **source_msg)
{
struct drsuapi_DsReplicaLinkedAttribute *la = la_entry->la;
struct ldb_context *ldb = ldb_... | 0 | [
"CWE-200"
] | samba | 0a3aa5f908e351201dc9c4d4807b09ed9eedff77 | 266,658,532,942,984,100,000,000,000,000,000,000,000 | 105 | CVE-2022-32746 ldb: Make use of functions for appending to an ldb_message
This aims to minimise usage of the error-prone pattern of searching for
a just-added message element in order to make modifications to it (and
potentially finding the wrong element).
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15009
Signed... |
static void collect_signal(int sig, struct sigpending *list, siginfo_t *info)
{
struct sigqueue *q, *first = NULL;
/*
* Collect the siginfo appropriate to this signal. Check if
* there is another siginfo for the same signal.
*/
list_for_each_entry(q, &list->list, list) {
if (q->info.si_signo == sig) {
if... | 0 | [] | linux-2.6 | da48524eb20662618854bb3df2db01fc65f3070c | 289,047,936,380,660,820,000,000,000,000,000,000,000 | 35 | Prevent rt_sigqueueinfo and rt_tgsigqueueinfo from spoofing the signal code
Userland should be able to trust the pid and uid of the sender of a
signal if the si_code is SI_TKILL.
Unfortunately, the kernel has historically allowed sigqueueinfo() to
send any si_code at all (as long as it was negative - to distinguish i... |
void d_invalidate(struct dentry *dentry)
{
/*
* If it's already been dropped, return OK.
*/
spin_lock(&dentry->d_lock);
if (d_unhashed(dentry)) {
spin_unlock(&dentry->d_lock);
return;
}
spin_unlock(&dentry->d_lock);
/* Negative dentries can be dropped without further checks */
if (!dentry->d_inode) {
... | 0 | [
"CWE-401",
"CWE-254"
] | linux | cde93be45a8a90d8c264c776fab63487b5038a65 | 154,602,080,773,092,340,000,000,000,000,000,000,000 | 42 | dcache: Handle escaped paths in prepend_path
A rename can result in a dentry that by walking up d_parent
will never reach it's mnt_root. For lack of a better term
I call this an escaped path.
prepend_path is called by four different functions __d_path,
d_absolute_path, d_path, and getcwd.
__d_path only wants to see... |
**/
const CImg<T>& save_bmp(const char *const filename) const {
return _save_bmp(0,filename); | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 140,137,956,549,025,800,000,000,000,000,000,000,000 | 3 | Fix other issues in 'CImg<T>::load_bmp()'. |
void CLASS parse_ciff (int offset, int length, int depth)
{
int tboff, nrecs, c, type, len, save, wbi=-1;
ushort key[] = { 0x410, 0x45f3 };
fseek (ifp, offset+length-4, SEEK_SET);
tboff = get4() + offset;
fseek (ifp, tboff, SEEK_SET);
nrecs = get2();
if ((nrecs | depth) > 127) return;
while (nrecs--) {... | 0 | [
"CWE-189"
] | LibRaw | 4606c28f494a750892c5c1ac7903e62dd1c6fdb5 | 184,341,348,398,808,230,000,000,000,000,000,000,000 | 104 | 0.16.1: fix for dcraw ljpeg_start() vulnerability |
static int __init x25_init(void)
{
int rc = proto_register(&x25_proto, 0);
if (rc != 0)
goto out;
rc = sock_register(&x25_family_ops);
if (rc != 0)
goto out_proto;
dev_add_pack(&x25_packet_type);
rc = register_netdevice_notifier(&x25_dev_notifier);
if (rc != 0)
goto out_sock;
printk(KERN_INFO "X.25 f... | 0 | [
"CWE-20",
"CWE-269"
] | linux | f3d3342602f8bcbf37d7c46641cb9bca7618eb1c | 190,320,690,031,527,300,000,000,000,000,000,000,000 | 33 | 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... |
bool exact_str_match(const char *str1, const char *str2, uint32_t len)
{
volatile uint32_t match = 0;
// Access through volatile ptrs to prevent compiler optimizations that
// might leak timing information.
const char volatile * volatile str1_v = str1;
const char volatile * volatile str2_v = str2;
... | 0 | [
"CWE-354"
] | keepkey-firmware | 769714fcb569e7a4faff9530a2d9ac1f9d6e5680 | 31,142,955,797,790,675,000,000,000,000,000,000,000 | 21 | firmware: stronger recovery state machine checks |
gst_date_time_get_time_zone_offset (const GstDateTime * datetime)
{
g_return_val_if_fail (datetime != NULL, 0.0);
g_return_val_if_fail (gst_date_time_has_time (datetime), 0.0);
return (g_date_time_get_utc_offset (datetime->datetime) /
G_USEC_PER_SEC) / 3600.0;
} | 0 | [
"CWE-125"
] | gstreamer | 9398b7f1a75b38844ae7050b5a7967e4cdebe24f | 184,937,881,657,676,570,000,000,000,000,000,000,000 | 8 | datetime: fix potential out-of-bound read on malformed datetime string
https://bugzilla.gnome.org/show_bug.cgi?id=777263 |
HttpTransact::build_error_response(State *s, HTTPStatus status_code, const char *reason_phrase_or_null,
const char *error_body_type, const char *format, ...)
{
va_list ap;
const char *reason_phrase;
char *url_string;
char body_language[256], body_type[256];
if (NULL == erro... | 0 | [
"CWE-119"
] | trafficserver | 8b5f0345dade6b2822d9b52c8ad12e63011a5c12 | 124,518,262,358,957,430,000,000,000,000,000,000,000 | 200 | Fix the internal buffer sizing. Thanks to Sudheer for helping isolating this bug |
static MagickBooleanType WriteBMPImage(const ImageInfo *image_info,Image *image,
ExceptionInfo *exception)
{
BMPInfo
bmp_info;
const char
*option;
const StringInfo
*profile;
MagickBooleanType
have_color_info,
status;
MagickOffsetType
scene;
MemoryInfo
*pixel_info;
regis... | 0 | [
"CWE-190",
"CWE-703"
] | ImageMagick | 4cc6ec8a4197d4c008577127736bf7985d632323 | 252,502,903,487,970,240,000,000,000,000,000,000,000 | 651 | Prevent buffer overflow in BMP coder (bug report from pwchen of tencent). |
int tcf_unregister_action(struct tc_action_ops *act)
{
struct tc_action_ops *a, **ap;
int err = -ENOENT;
write_lock(&act_mod_lock);
for (ap = &act_base; (a = *ap) != NULL; ap = &a->next)
if (a == act)
break;
if (a) {
*ap = a->next;
a->next = NULL;
err = 0;
}
write_unlock(&act_mod_lock);
return err;
... | 0 | [
"CWE-200"
] | linux-2.6 | 9ef1d4c7c7aca1cd436612b6ca785b726ffb8ed8 | 278,366,126,620,496,300,000,000,000,000,000,000,000 | 17 | [NETLINK]: Missing initializations in dumped data
Mostly missing initialization of padding fields of 1 or 2 bytes length,
two instances of uninitialized nlmsgerr->msg of 16 bytes length.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net> |
yyerror(
const char *msg
)
{
int retval;
struct FILE_INFO * ip_ctx;
ip_ctx = lex_current();
ip_ctx->errpos = ip_ctx->tokpos;
msyslog(LOG_ERR, "line %d column %d %s",
ip_ctx->errpos.nline, ip_ctx->errpos.ncol, msg);
if (!lex_from_file()) {
/* Save the error message in the correct buffer */
retval = snpri... | 0 | [
"CWE-19"
] | ntp | fe46889f7baa75fc8e6c0fcde87706d396ce1461 | 119,040,580,025,164,930,000,000,000,000,000,000,000 | 27 | [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. |
void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const void *data)
{
struct rtattr *rta;
int size = RTA_LENGTH(attrlen);
rta = (struct rtattr*)skb_put(skb, RTA_ALIGN(size));
rta->rta_type = attrtype;
rta->rta_len = size;
memcpy(RTA_DATA(rta), data, attrlen);
} | 1 | [
"CWE-200"
] | linux-2.6 | b3563c4fbff906991a1b4ef4609f99cca2a0de6a | 179,618,876,772,476,500,000,000,000,000,000,000,000 | 10 | [NETLINK]: Clear padding in netlink messages
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net> |
xfs_buf_set_empty(
struct xfs_buf *bp,
size_t numblks)
{
if (bp->b_pages)
_xfs_buf_free_pages(bp);
bp->b_pages = NULL;
bp->b_page_count = 0;
bp->b_addr = NULL;
bp->b_length = numblks;
bp->b_io_length = numblks;
ASSERT(bp->b_map_count == 1);
bp->b_bn = XFS_BUF_DADDR_NULL;
bp->b_maps[0].bm_bn = XFS_BUF_... | 0 | [
"CWE-20",
"CWE-703"
] | linux | eb178619f930fa2ba2348de332a1ff1c66a31424 | 80,237,100,478,786,910,000,000,000,000,000,000,000 | 18 | xfs: fix _xfs_buf_find oops on blocks beyond the filesystem end
When _xfs_buf_find is passed an out of range address, it will fail
to find a relevant struct xfs_perag and oops with a null
dereference. This can happen when trying to walk a filesystem with a
metadata inode that has a partially corrupted extent map (i.e.... |
static gint textview_tag_cmp_list(gconstpointer a, gconstpointer b)
{
gint id_a = GPOINTER_TO_INT(a);
gint id_b = GPOINTER_TO_INT(b);
const gchar *tag_a = tags_get_tag(id_a);
const gchar *tag_b = tags_get_tag(id_b);
if (tag_a == NULL)
return tag_b == NULL ? 0:1;
if (tag_b == NULL)
return 1;
return g_utf... | 0 | [
"CWE-601"
] | claws | ac286a71ed78429e16c612161251b9ea90ccd431 | 190,797,709,640,169,730,000,000,000,000,000,000,000 | 15 | harden link checker before accepting click |
int crypto_init(cert_policy *policy)
{
/* arg is ignored for OPENSSL */
(void)policy;
OpenSSL_add_all_algorithms();
ERR_load_crypto_strings();
return 0;
} | 0 | [] | pam_pkcs11 | cc51b3e2720ea862d500cab2ea517518ff39a497 | 320,330,180,451,443,800,000,000,000,000,000,000,000 | 8 | verify using a nonce from the system, not the card
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting the problem. |
xfs_acl_exists(struct inode *inode, unsigned char *name)
{
int len = sizeof(struct xfs_acl);
return (xfs_attr_get(XFS_I(inode), name, NULL, &len,
ATTR_ROOT|ATTR_KERNOVAL) == 0);
} | 0 | [
"CWE-190",
"CWE-189"
] | linux | 093019cf1b18dd31b2c3b77acce4e000e2cbc9ce | 206,220,015,618,821,300,000,000,000,000,000,000,000 | 7 | xfs: fix acl count validation in xfs_acl_from_disk()
Commit fa8b18ed didn't prevent the integer overflow and possible
memory corruption. "count" can go negative and bypass the check.
Signed-off-by: Xi Wang <xi.wang@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ben Myers <bpm@sgi.com> |
void CLASS adobe_coeff(const char *t_make, const char *t_model
#ifdef LIBRAW_LIBRARY_BUILD
,
int internal_only
#endif
)
{
// clang-format off
static const struct
{
const char *prefix;
int t_black, t_maximum, trans[12];
} table[] = {
{ "AgfaPhoto DC-833m"... | 0 | [
"CWE-119",
"CWE-125"
] | LibRaw | f1394822a0152ceed77815eafa5cac4e8baab10a | 132,174,152,896,103,890,000,000,000,000,000,000,000 | 1,584 | SECUNIA advisory 76000 #1 (wrong fuji width set via tiff tag |
osd_stat_t get_osd_stat() {
Mutex::Locker l(stat_lock);
++seq;
osd_stat.up_from = up_epoch;
osd_stat.seq = ((uint64_t)osd_stat.up_from << 32) + seq;
return osd_stat;
} | 0 | [
"CWE-287",
"CWE-284"
] | ceph | 5ead97120e07054d80623dada90a5cc764c28468 | 103,082,157,659,115,350,000,000,000,000,000,000,000 | 7 | auth/cephx: add authorizer challenge
Allow the accepting side of a connection to reject an initial authorizer
with a random challenge. The connecting side then has to respond with an
updated authorizer proving they are able to decrypt the service's challenge
and that the new authorizer was produced for this specific ... |
static void mtk3301_event_hook(struct gps_device_t *session, event_t event)
{
/*
0 NMEA_SEN_GLL, GPGLL interval - Geographic Position - Latitude longitude
1 NMEA_SEN_RMC, GPRMC interval - Recommended Minimum Specific GNSS Sentence
2 NMEA_SEN_VTG, GPVTG interval - Course Over Ground and Ground Speed
3 NMEA_... | 0 | [] | gpsd | 08edc49d8f63c75bfdfb480b083b0d960310f94f | 60,137,269,397,207,770,000,000,000,000,000,000,000 | 33 | Address Savannah bug #38511:
ais_context->bitlen <= sizeof(ais_context->bits)/8 is not checked |
ves_icall_Type_get_IsGenericInstance (MonoReflectionType *type)
{
MonoClass *klass;
MONO_ARCH_SAVE_REGS;
if (type->type->byref)
return FALSE;
klass = mono_class_from_mono_type (type->type);
return klass->generic_class != NULL;
} | 0 | [
"CWE-264"
] | mono | 035c8587c0d8d307e45f1b7171a0d337bb451f1e | 147,120,119,768,931,020,000,000,000,000,000,000,000 | 11 | Allow only primitive types/enums in RuntimeHelpers.InitializeArray (). |
has_tablespace_privilege_id_id(PG_FUNCTION_ARGS)
{
Oid roleid = PG_GETARG_OID(0);
Oid tablespaceoid = PG_GETARG_OID(1);
text *priv_type_text = PG_GETARG_TEXT_P(2);
AclMode mode;
AclResult aclresult;
mode = convert_tablespace_priv_string(priv_type_text);
aclresult = pg_tablespace_aclcheck(tablespaceoid,... | 0 | [
"CWE-264"
] | postgres | fea164a72a7bfd50d77ba5fb418d357f8f2bb7d0 | 322,294,383,189,189,280,000,000,000,000,000,000,000 | 14 | Shore up ADMIN OPTION restrictions.
Granting a role without ADMIN OPTION is supposed to prevent the grantee
from adding or removing members from the granted role. Issuing SET ROLE
before the GRANT bypassed that, because the role itself had an implicit
right to add or remove members. Plug that hole by recognizing tha... |
ns__client_put_cb(void *client0) {
ns_client_t *client = client0;
ns_client_log(client, DNS_LOGCATEGORY_SECURITY, NS_LOGMODULE_CLIENT,
ISC_LOG_DEBUG(3), "freeing client");
/*
* Call this first because it requires a valid client.
*/
ns_query_free(client);
client->magic = 0;
client->shuttingdown = tr... | 0 | [
"CWE-617"
] | bind9 | 15996f0cb15631b95a801e3e88928494a69ad6ee | 100,088,880,941,741,340,000,000,000,000,000,000,000 | 50 | ns_client_error() could assert if rcode was overridden to NOERROR
The client->rcode_override was originally created to force the server
to send SERVFAIL in some cases when it would normally have sent FORMERR.
More recently, it was used in a3ba95116ed04594ea59a8124bf781b30367a7a2
commit (part of GL #2790) to force the... |
void ConnectionManagerImpl::onEvent(Network::ConnectionEvent event) {
if (event == Network::ConnectionEvent::LocalClose) {
stats_.named_.downstream_cx_destroy_local_.inc();
}
if (event == Network::ConnectionEvent::RemoteClose ||
event == Network::ConnectionEvent::LocalClose) {
if (event == Network:... | 0 | [
"CWE-22"
] | envoy | 5333b928d8bcffa26ab19bf018369a835f697585 | 243,602,081,409,380,300,000,000,000,000,000,000,000 | 27 | Implement handling of escaped slash characters in URL path
Fixes: CVE-2021-29492
Signed-off-by: Yan Avlasov <yavlasov@google.com> |
static int mov_read_ctts(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
AVStream *st;
MOVStreamContext *sc;
unsigned int i, entries, ctts_count = 0;
if (c->fc->nb_streams < 1)
return 0;
st = c->fc->streams[c->fc->nb_streams-1];
sc = st->priv_data;
avio_r8(pb); /* version */
av... | 0 | [
"CWE-703"
] | FFmpeg | c953baa084607dd1d84c3bfcce3cf6a87c3e6e05 | 185,737,113,003,521,550,000,000,000,000,000,000,000 | 65 | 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 int
iscsi_set_param(struct iscsi_transport *transport, struct iscsi_uevent *ev)
{
char *data = (char*)ev + sizeof(*ev);
struct iscsi_cls_conn *conn;
struct iscsi_cls_session *session;
int err = 0, value = 0;
session = iscsi_session_lookup(ev->u.set_param.sid);
conn = iscsi_conn_lookup(ev->u.set_param.s... | 1 | [
"CWE-787"
] | linux | ec98ea7070e94cc25a422ec97d1421e28d97b7ee | 311,844,682,747,568,030,000,000,000,000,000,000,000 | 25 | scsi: iscsi: Ensure sysfs attributes are limited to PAGE_SIZE
As the iSCSI parameters are exported back through sysfs, it should be
enforcing that they never are more than PAGE_SIZE (which should be more
than enough) before accepting updates through netlink.
Change all iSCSI sysfs attributes to use sysfs_emit().
Cc:... |
static int _mysql_begin_txn(void *conn, const sasl_utils_t *utils)
{
return _mysql_exec(conn,
#if MYSQL_VERSION_ID >= 40011
"START TRANSACTION",
#else
"BEGIN",
#endif
NULL, 0, NULL, utils);
} | 0 | [
"CWE-89"
] | cyrus-sasl | 9eff746c9daecbcc0041b09a5a51ba30738cdcbc | 206,343,360,007,147,400,000,000,000,000,000,000,000 | 10 | CVE-2022-24407 Escape password for SQL insert/update commands.
Signed-off-by: Klaus Espenlaub <klaus@espenlaub.com> |
write_vector_vector(BitWriter& w,
int nitems1, std::vector<T>& vec1, int T::*nitems2,
int bits, std::vector<int> T::*vec2)
{
// nitems1 times, write nitems2 (from the ith element of vec1) items
// from the vec2 vector field of the ith item of vec1.
for (int i1 = 0; i1 < nitems1; ++i1)
{
for... | 1 | [
"CWE-787"
] | qpdf | d71f05ca07eb5c7cfa4d6d23e5c1f2a800f52e8e | 224,053,345,177,998,430,000,000,000,000,000,000,000 | 15 | 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 ... |
} | 0 | [
"CWE-787"
] | linux | c37e9e013469521d9adb932d17a1795c139b36db | 270,755,014,519,744,040,000,000,000,000,000,000,000 | 1 | ext4: add more inode number paranoia checks
If there is a directory entry pointing to a system inode (such as a
journal inode), complain and declare the file system to be corrupted.
Also, if the superblock's first inode number field is too small,
refuse to mount the file system.
This addresses CVE-2018-10882.
https... |
_archive_write_filter_count(struct archive *_a)
{
struct archive_write *a = (struct archive_write *)_a;
struct archive_write_filter *p = a->filter_first;
int count = 0;
while(p) {
count++;
p = p->next_filter;
}
return count;
} | 0 | [
"CWE-703",
"CWE-189"
] | libarchive | 22531545514043e04633e1c015c7540b9de9dbe4 | 88,102,693,618,421,830,000,000,000,000,000,000,000 | 11 | Limit write requests to at most INT_MAX.
This prevents a certain common programming error (passing -1 to write)
from leading to other problems deeper in the library. |
get_parent_dir (const char *current_dir)
{
char *dir;
char *new_dir;
char *retval;
if (current_dir == NULL)
return NULL;
if (strcmp (current_dir, "/") == 0)
return g_strdup ("/");
dir = g_strdup (current_dir);
dir[strlen (dir) - 1] = 0;
new_dir = _g_path_remove_level (dir);
g_free (dir);
if (new_dir[st... | 0 | [
"CWE-22"
] | file-roller | b147281293a8307808475e102a14857055f81631 | 137,305,247,151,280,390,000,000,000,000,000,000,000 | 25 | libarchive: sanitize filenames before extracting |
static void des1_1_decrypt(struct ssh_cipher_struct *cipher, void *in,
void *out, unsigned long len) {
gcry_cipher_decrypt(cipher->key[0], out, len, in, len);
} | 0 | [
"CWE-310"
] | libssh | e99246246b4061f7e71463f8806b9dcad65affa0 | 59,512,563,994,483,870,000,000,000,000,000,000,000 | 4 | security: fix for vulnerability CVE-2014-0017
When accepting a new connection, a forking server based on libssh forks
and the child process handles the request. The RAND_bytes() function of
openssl doesn't reset its state after the fork, but simply adds the
current process id (getpid) to the PRNG state, which is not g... |
static int nested_ept_init_mmu_context(struct kvm_vcpu *vcpu)
{
int r = kvm_init_shadow_ept_mmu(vcpu, &vcpu->arch.mmu,
nested_vmx_ept_caps & VMX_EPT_EXECUTE_ONLY_BIT);
vcpu->arch.mmu.set_cr3 = vmx_set_cr3;
vcpu->arch.mmu.get_cr3 = nested_ept_get_cr3;
vcpu->arch.mmu.inject_page_fault = nested... | 0 | [
"CWE-20"
] | linux | bfd0a56b90005f8c8a004baf407ad90045c2b11e | 147,300,576,208,450,780,000,000,000,000,000,000,000 | 13 | nEPT: Nested INVEPT
If we let L1 use EPT, we should probably also support the INVEPT instruction.
In our current nested EPT implementation, when L1 changes its EPT table
for L2 (i.e., EPT12), L0 modifies the shadow EPT table (EPT02), and in
the course of this modification already calls INVEPT. But if last level
of sh... |
PHP_MINFO_FUNCTION(exif)
{
php_info_print_table_start();
php_info_print_table_row(2, "EXIF Support", "enabled");
php_info_print_table_row(2, "Supported EXIF Version", "0220");
php_info_print_table_row(2, "Supported filetypes", "JPEG, TIFF");
if (zend_hash_str_exists(&module_registry, "mbstring", sizeof("mbstring"... | 0 | [
"CWE-125"
] | php-src | b82437eeddadf6a3a8c0f492acb6861682cd4d93 | 264,025,903,351,127,160,000,000,000,000,000,000,000 | 18 | Fix bug #77563 - Uninitialized read in exif_process_IFD_in_MAKERNOTE
Also fix for bug #77659 |
ptaaWriteStream(FILE *fp,
PTAA *ptaa,
l_int32 type)
{
l_int32 i, n;
PTA *pta;
PROCNAME("ptaaWriteStream");
if (!fp)
return ERROR_INT("stream not defined", procName, 1);
if (!ptaa)
return ERROR_INT("ptaa not defined", procName, 1);
n = ptaaGe... | 0 | [
"CWE-119",
"CWE-787"
] | leptonica | ee301cb2029db8a6289c5295daa42bba7715e99a | 13,779,196,231,023,665,000,000,000,000,000,000,000 | 25 | Security fixes: expect final changes for release 1.75.3.
* Fixed a debian security issue with fscanf() reading a string with
possible buffer overflow.
* There were also a few similar situations with sscanf(). |
void CLASS Nikon_NRW_WBtag (int wb, int skip)
{
#define icWB imgdata.color.WB_Coeffs
int r, g0, g1, b;
if (skip) get4(); // skip wb "CCT", it is not unique
r = get4();
g0 = get4();
g1 = get4();
b = get4();
if (r && g0 && g1 && b) {
icWB[wb][0] = r << 1;
icWB[wb][1] = g0;
icWB[wb][2] = b << 1;... | 0 | [
"CWE-400"
] | LibRaw | e67a9862d10ebaa97712f532eca1eb5e2e410a22 | 241,062,630,862,268,470,000,000,000,000,000,000,000 | 18 | Fixed Secunia Advisory SA86384
- possible infinite loop in unpacked_load_raw()
- possible infinite loop in parse_rollei()
- possible infinite loop in parse_sinar_ia()
Credits: Laurent Delosieres, Secunia Research at Flexera |
static void __init set_cmos(int *ints, int dummy, int dummy2)
{
int current_drive = 0;
if (ints[0] != 2) {
DPRINT("wrong number of parameters for CMOS\n");
return;
}
current_drive = ints[1];
if (current_drive < 0 || current_drive >= 8) {
DPRINT("bad drive for set_cmos\n");
return;
}
#if N_FDC > 1
if (cu... | 0 | [
"CWE-416"
] | linux | 233087ca063686964a53c829d547c7571e3f67bf | 59,421,829,054,635,370,000,000,000,000,000,000,000 | 20 | floppy: disable FDRAWCMD by default
Minh Yuan reported a concurrency use-after-free issue in the floppy code
between raw_cmd_ioctl and seek_interrupt.
[ It turns out this has been around, and that others have reported the
KASAN splats over the years, but Minh Yuan had a reproducer for it and
so gets primary credi... |
//! Wait for any event occuring on the display \c disp1.
static void wait(CImgDisplay& disp1) {
disp1._is_event = false;
while (!disp1._is_closed && !disp1._is_event) wait_all(); | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 159,381,256,715,030,910,000,000,000,000,000,000,000 | 4 | Fix other issues in 'CImg<T>::load_bmp()'. |
url_decode(const char *url, const ParsedURL *base, wc_ces doc_charset)
{
if (!DecodeURL)
return (char *)url;
return url_unquote_conv((char *)url,
url_to_charset(url, base, doc_charset));
} | 0 | [
"CWE-119"
] | w3m | ba9d78faeba9024c3e8840579c3b0e959ae2cb0f | 23,212,406,376,257,462,000,000,000,000,000,000,000 | 7 | Prevent global-buffer-overflow in parseURL()
Bug-Debian: https://github.com/tats/w3m/issues/41 |
static WERROR dcesrv_dssetup_DsRoleDnsNameToFlatName(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
struct dssetup_DsRoleDnsNameToFlatName *r)
{
DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
} | 0 | [
"CWE-200"
] | samba | 0a3aa5f908e351201dc9c4d4807b09ed9eedff77 | 304,446,153,182,391,280,000,000,000,000,000,000,000 | 5 | CVE-2022-32746 ldb: Make use of functions for appending to an ldb_message
This aims to minimise usage of the error-prone pattern of searching for
a just-added message element in order to make modifications to it (and
potentially finding the wrong element).
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15009
Signed... |
_gnutls_ecc_ansi_x963_export (gnutls_ecc_curve_t curve, bigint_t x, bigint_t y,
gnutls_datum_t * out)
{
int numlen = gnutls_ecc_curve_get_size (curve);
int byte_size, ret;
size_t size;
if (numlen == 0)
return gnutls_assert_val (GNUTLS_E_INVALID_REQUEST);
out->size = 1 + 2 *... | 0 | [
"CWE-310"
] | gnutls | 7429872b74c8216bbf15e241e47aba94369ef083 | 305,384,819,760,373,400,000,000,000,000,000,000,000 | 59 | when exporting curve coordinates to X9.63 format, perform additional sanity checks on input
Reported by Sean Burford. |
usm_lookup_alg_type(const char *str, usm_alg_type_t *types)
{
int i, l;
l = strlen(str);
for (i = 0; types[i].label; ++i) {
if (0 == strncasecmp(types[i].label, str, l))
return types[i].value;
}
return -1;
} | 0 | [
"CWE-415"
] | net-snmp | 5f881d3bf24599b90d67a45cae7a3eb099cd71c9 | 281,078,154,989,959,700,000,000,000,000,000,000,000 | 11 | libsnmp, USM: Introduce a reference count in struct usmStateReference
This patch fixes https://sourceforge.net/p/net-snmp/bugs/2956/. |
optimize_straight_join(JOIN *join, table_map join_tables)
{
JOIN_TAB *s;
uint idx= join->const_tables;
bool disable_jbuf= join->thd->variables.join_cache_level == 0;
double record_count= 1.0;
double read_time= 0.0;
uint use_cond_selectivity=
join->thd->variables.optimizer_use_condition_se... | 0 | [] | server | ff77a09bda884fe6bf3917eb29b9d3a2f53f919b | 305,473,592,357,532,400,000,000,000,000,000,000,000 | 43 | MDEV-22464 Server crash on UPDATE with nested subquery
Uninitialized ref_pointer_array[] because setup_fields() got empty
fields list. mysql_multi_update() for some reason does that by
substituting the fields list with empty total_list for the
mysql_select() call (looks like wrong merge since total_list is not
used a... |
load_image (const gchar *filename,
GError **load_error)
{
FILE *f;
struct stat st;
PSDimage img_a;
PSDlayer **lyr_a;
gint32 image_id = -1;
GError *error = NULL;
/* ----- Open PSD file ----- */
if (g_stat (f... | 0 | [
"CWE-190"
] | gimp | 88eccea84aa375197cc04a2a0e2e29debb56bfa5 | 8,044,114,206,218,488,000,000,000,000,000,000,000 | 117 | Harden the PSD plugin against integer overflows.
Issues discovered by Stefan Cornelius, Secunia Research, advisory SA37232
and CVE identifier CVE-2009-3909. Fixes bug #600741.
(cherry picked from commit 9cc8d78ff33b7a36852b74e64b427489cad44d0e) |
ptaSetPt(PTA *pta,
l_int32 index,
l_float32 x,
l_float32 y)
{
PROCNAME("ptaSetPt");
if (!pta)
return ERROR_INT("pta not defined", procName, 1);
if (index < 0 || index >= pta->n)
return ERROR_INT("invalid index", procName, 1);
pta->x[index] = x;
... | 0 | [
"CWE-119",
"CWE-787"
] | leptonica | ee301cb2029db8a6289c5295daa42bba7715e99a | 203,623,128,618,703,400,000,000,000,000,000,000,000 | 16 | Security fixes: expect final changes for release 1.75.3.
* Fixed a debian security issue with fscanf() reading a string with
possible buffer overflow.
* There were also a few similar situations with sscanf(). |
void __cpu_copy_user_page(void *kto, const void *kfrom, unsigned long vaddr)
{
copy_page(kto, kfrom);
__flush_dcache_area(kto, PAGE_SIZE);
} | 0 | [] | linux | 1d18c47c735e8adfe531fc41fae31e98f86b68fe | 247,419,506,205,758,000,000,000,000,000,000,000,000 | 5 | arm64: MMU fault handling and page table management
This patch adds support for the handling of the MMU faults (exception
entry code introduced by a previous patch) and page table management.
The user translation table is pointed to by TTBR0 and the kernel one
(swapper_pg_dir) by TTBR1. There is no translation inform... |
if (iTask.status != SCSI_STATUS_GOOD) {
error_report("iSCSI READ10/16 failed at lba %" PRIu64 ": %s",
lba, iTask.err_str);
r = iTask.err_code;
} | 0 | [
"CWE-125"
] | qemu | ff0507c239a246fd7215b31c5658fc6a3ee1e4c5 | 29,008,075,477,626,320,000,000,000,000,000,000,000 | 5 | block/iscsi:fix heap-buffer-overflow in iscsi_aio_ioctl_cb
There is an overflow, the source 'datain.data[2]' is 100 bytes,
but the 'ss' is 252 bytes.This may cause a security issue because
we can access a lot of unrelated memory data.
The len for sbp copy data should take the minimum of mx_sb_len and
sb_len_wr, no... |
cfolder_write (cfolder_t *cf, GDataOutputStream *out,
GCancellable *cancellable, GError **error)
{
if ((!W4 (cf->offsetdata)) ||
(!W2 (cf->ndatab)) ||
(!W2 (cf->typecomp)))
return FALSE;
return TRUE;
} | 0 | [
"CWE-787"
] | gcab | c512f6ff0c82a1139b36db2b28f93edc01c74b4b | 287,714,781,792,404,400,000,000,000,000,000,000,000 | 10 | trivial: Allocate cdata_t on the heap
Using a 91kB stack allocation for one object isn't awesome, and it also allows
us to use g_autoptr() to simplify gcab_folder_extract() |
uint64_t xbzrle_mig_pages_overflow(void)
{
return acct_info.xbzrle_overflows;
} | 0 | [
"CWE-20"
] | qemu | 0be839a2701369f669532ea5884c15bead1c6e08 | 167,697,976,072,942,830,000,000,000,000,000,000,000 | 4 | migration: fix parameter validation on ram load
During migration, the values read from migration stream during ram load
are not validated. Especially offset in host_from_stream_offset() and
also the length of the writes in the callers of said function.
To fix this, we need to make sure that the [offset, offset + leng... |
static struct extent_map *btrfs_new_extent_direct(struct inode *inode,
u64 start, u64 len)
{
struct btrfs_root *root = BTRFS_I(inode)->root;
struct extent_map *em;
struct btrfs_key ins;
u64 alloc_hint;
int ret;
alloc_hint = get_extent_allocation_hint(inode, start, len);
ret = btrfs_reserve_extent(root, ... | 0 | [
"CWE-200"
] | linux | 0305cd5f7fca85dae392b9ba85b116896eb7c1c7 | 120,060,264,247,340,330,000,000,000,000,000,000,000 | 32 | Btrfs: fix truncation of compressed and inlined extents
When truncating a file to a smaller size which consists of an inline
extent that is compressed, we did not discard (or made unusable) the
data between the new file size and the old file size, wasting metadata
space and allowing for the truncated data to be leaked... |
compl_shows_dir_forward(void)
{
return compl_shows_dir == FORWARD;
} | 0 | [
"CWE-125"
] | vim | f12129f1714f7d2301935bb21d896609bdac221c | 239,198,631,578,554,560,000,000,000,000,000,000,000 | 4 | patch 9.0.0020: with some completion reading past end of string
Problem: With some completion reading past end of string.
Solution: Check the length of the string. |
static int dns_resolver_cmp(const struct key *key,
const struct key_match_data *match_data)
{
int slen, dlen, ret = 0;
const char *src = key->description, *dsp = match_data->raw_data;
kenter("%s,%s", src, dsp);
if (!src || !dsp)
goto no_match;
if (strcasecmp(src, dsp) == 0)
goto matched;
slen = str... | 0 | [
"CWE-476"
] | linux | c06cfb08b88dfbe13be44a69ae2fdc3a7c902d81 | 236,268,936,725,155,530,000,000,000,000,000,000,000 | 31 | KEYS: Remove key_type::match in favour of overriding default by match_preparse
A previous patch added a ->match_preparse() method to the key type. This is
allowed to override the function called by the iteration algorithm.
Therefore, we can just set a default that simply checks for an exact match of
the key descripti... |
check_user_password(std::string const& user_password,
QPDF::EncryptionData const& data)
{
if (data.getV() < 5)
{
return check_user_password_V4(user_password, data);
}
else
{
return check_user_password_V5(user_password, data);
}
} | 0 | [
"CWE-125"
] | qpdf | dea704f0ab7f625e1e7b3f9a1110b45b63157317 | 138,299,003,511,579,540,000,000,000,000,000,000,000 | 12 | Pad keys to avoid memory errors (fixes #147) |
flatpak_dir_update_appstream_oci (FlatpakDir *self,
const char *remote,
const char *arch,
gboolean *out_changed,
FlatpakProgress *progress,
... | 0 | [
"CWE-74"
] | flatpak | fb473cad801c6b61706353256cab32330557374a | 151,428,637,371,412,640,000,000,000,000,000,000,000 | 76 | dir: Pass environment via bwrap --setenv when running apply_extra
This means we can systematically pass the environment variables
through bwrap(1), even if it is setuid and thus is filtering out
security-sensitive environment variables. bwrap ends up being
run with an empty environment instead.
As with the previous c... |
int diff_tree_sha1(const unsigned char *old, const unsigned char *new, const char *base, struct diff_options *opt)
{
void *tree1, *tree2;
struct tree_desc t1, t2;
unsigned long size1, size2;
int retval;
tree1 = read_object_with_reference(old, tree_type, &size1, NULL);
if (!tree1)
die("unable to read source tre... | 0 | [
"CWE-119"
] | git | fd55a19eb1d49ae54008d932a65f79cd6fda45c9 | 16,717,994,426,349,950,000,000,000,000,000,000,000 | 25 | Fix buffer overflow in git diff
If PATH_MAX on your system is smaller than a path stored, it may cause
buffer overflow and stack corruption in diff_addremove() and diff_change()
functions when running git-diff
Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com> |
void cpu_physical_memory_unmap(void *buffer, hwaddr len,
int is_write, hwaddr access_len)
{
return address_space_unmap(&address_space_memory, buffer, len, is_write, access_len);
} | 0 | [] | qemu | c3c1bb99d1c11978d9ce94d1bdcf0705378c1459 | 167,659,735,028,837,900,000,000,000,000,000,000,000 | 5 | exec: Respect as_tranlsate_internal length clamp
address_space_translate_internal will clamp the *plen length argument
based on the size of the memory region being queried. The iommu walker
logic in addresss_space_translate was ignoring this by discarding the
post fn call value of *plen. Fix by just always using *plen... |
static int snd_pcm_oss_get_odelay(struct snd_pcm_oss_file *pcm_oss_file)
{
struct snd_pcm_substream *substream;
struct snd_pcm_runtime *runtime;
snd_pcm_sframes_t delay;
int err;
substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_PLAYBACK];
if (substream == NULL)
return -EINVAL;
err = snd_pcm_oss_make_ready(s... | 0 | [
"CWE-362"
] | linux | 8423f0b6d513b259fdab9c9bf4aaa6188d054c2d | 233,014,476,899,069,760,000,000,000,000,000,000,000 | 23 | ALSA: pcm: oss: Fix race at SNDCTL_DSP_SYNC
There is a small race window at snd_pcm_oss_sync() that is called from
OSS PCM SNDCTL_DSP_SYNC ioctl; namely the function calls
snd_pcm_oss_make_ready() at first, then takes the params_lock mutex
for the rest. When the stream is set up again by another thread
between them, ... |
MagickExport void SetOpenCLDeviceEnabled(MagickCLDevice device,
const MagickBooleanType value)
{
if (device == (MagickCLDevice) NULL)
return;
device->enabled=value;
} | 0 | [
"CWE-476"
] | ImageMagick | cca91aa1861818342e3d072bb0fad7dc4ffac24a | 270,377,946,910,977,020,000,000,000,000,000,000,000 | 7 | https://github.com/ImageMagick/ImageMagick/issues/790 |
static u32 get_box_reg_idx(u32 boxCode, u32 parent_type, u32 start_from)
{
u32 i=0, count = gf_isom_get_num_supported_boxes();
const char *parent_name = parent_type ? gf_4cc_to_str(parent_type) : NULL;
if (!start_from) start_from = 1;
for (i=start_from; i<count; i++) {
u32 start_par_from;
if (box_registry[i]... | 0 | [
"CWE-476"
] | gpac | d527325a9b72218612455a534a508f9e1753f76e | 286,365,032,110,614,100,000,000,000,000,000,000,000 | 40 | fixed #1768 |
Header::screenWindowCenter () const
{
return static_cast <const V2fAttribute &>
((*this)["screenWindowCenter"]).value();
} | 0 | [
"CWE-125"
] | openexr | e79d2296496a50826a15c667bf92bdc5a05518b4 | 128,159,109,937,701,500,000,000,000,000,000,000,000 | 5 | fix memory leaks and invalid memory accesses
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz> |
static inline void fuse_page_descs_length_init(struct fuse_page_desc *descs,
unsigned int index,
unsigned int nr_pages)
{
int i;
for (i = index; i < index + nr_pages; i++)
descs[i].length = PAGE_SIZE - descs[i].offset;
} | 0 | [
"CWE-459"
] | linux | 5d069dbe8aaf2a197142558b6fb2978189ba3454 | 194,460,512,338,418,820,000,000,000,000,000,000,000 | 9 | fuse: fix bad inode
Jan Kara's analysis of the syzbot report (edited):
The reproducer opens a directory on FUSE filesystem, it then attaches
dnotify mark to the open directory. After that a fuse_do_getattr() call
finds that attributes returned by the server are inconsistent, and calls
make_bad_inode() which,... |
static void handle_rsp(struct bt_att_chan *chan, uint8_t opcode, uint8_t *pdu,
ssize_t pdu_len)
{
struct bt_att *att = chan->att;
struct att_send_op *op = chan->pending_req;
uint8_t req_opcode;
uint8_t rsp_opcode;
uint8_t *rsp_pdu = NULL;
uint16_t rsp_pdu_len = 0;
/*
* If no request is pending, then t... | 0 | [
"CWE-415"
] | bluez | 1cd644db8c23a2f530ddb93cebed7dacc5f5721a | 111,226,963,461,468,450,000,000,000,000,000,000,000 | 63 | shared/att: Fix possible crash on disconnect
If there are pending request while disconnecting they would be notified
but clients may endup being freed in the proccess which will then be
calling bt_att_cancel to cancal its requests causing the following
trace:
Invalid read of size 4
at 0x1D894C: enable_ccc_callback... |
ssize_t fake_sendfile(struct smbXsrv_connection *xconn, files_struct *fsp,
off_t startpos, size_t nread)
{
size_t bufsize;
size_t tosend = nread;
char *buf;
if (nread == 0) {
return 0;
}
bufsize = MIN(nread, 65536);
if (!(buf = SMB_MALLOC_ARRAY(char, bufsize))) {
return -1;
}
while (tosend > 0)... | 0 | [
"CWE-200"
] | samba | 3ddc9344c2fa7461336899fbddb0bb80995e9170 | 92,910,449,062,219,430,000,000,000,000,000,000,000 | 55 | CVE-2022-32742: s3: smbd: Harden the smbreq_bufrem() macro.
Fixes the raw.write.bad-write test.
NB. We need the two (==0) changes in source3/smbd/smb2_reply.c
as the gcc optimizer now knows that the return from
smbreq_bufrem() can never be less than zero.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15085
Remove... |
static void virtio_net_set_queue_pairs(VirtIONet *n)
{
int i;
int r;
if (n->nic->peer_deleted) {
return;
}
for (i = 0; i < n->max_queue_pairs; i++) {
if (i < n->curr_queue_pairs) {
r = peer_attach(n, i);
assert(!r);
} else {
r = peer_deta... | 0 | [
"CWE-703"
] | qemu | abe300d9d894f7138e1af7c8e9c88c04bfe98b37 | 279,990,984,840,638,500,000,000,000,000,000,000,000 | 19 | virtio-net: fix map leaking on error during receive
Commit bedd7e93d0196 ("virtio-net: fix use after unmap/free for sg")
tries to fix the use after free of the sg by caching the virtqueue
elements in an array and unmap them at once after receiving the
packets, But it forgot to unmap the cached elements on error which
... |
static bool bin_raw_strings(RCore *r, int mode, int va) {
RBinFile *bf = r_bin_cur (r->bin);
bool new_bf = false;
if (bf && strstr (bf->file, "malloc://")) {
//sync bf->buf to search string on it
r_io_read_at (r->io, 0, bf->buf->buf, bf->size);
}
if (!r->file) {
eprintf ("Core file not open\n");
return fal... | 0 | [
"CWE-125"
] | radare2 | 1f37c04f2a762500222dda2459e6a04646feeedf | 268,963,925,879,904,760,000,000,000,000,000,000,000 | 59 | Fix #9904 - crash in r2_hoobr_r_read_le32 (over 9000 entrypoints) and read_le oobread (#9923) |
tcp_src_prompt(packet_info *pinfo, gchar *result)
{
guint32 port = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, hf_tcp_srcport, pinfo->curr_layer_num));
g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "source (%u%s)", port, UTF8_RIGHTWARDS_ARROW);
} | 0 | [
"CWE-354"
] | wireshark | 7f3fe6164a68b76d9988c4253b24d43f498f1753 | 243,029,606,365,869,700,000,000,000,000,000,000,000 | 6 | TCP: do not use an unknown status when the checksum is 0xffff
Otherwise it triggers an assert when adding the column as the field is
defined as BASE_NONE and not BASE_DEC or BASE_HEX. Thus an unknown value
(not in proto_checksum_vals[)array) cannot be represented.
Mark the checksum as bad even if we process the packet... |
QPDFTokenizer::resolveLiteral()
{
if ((this->m->val.length() > 0) && (this->m->val.at(0) == '/'))
{
this->m->type = tt_name;
// Deal with # in name token. Note: '/' by itself is a
// valid name, so don't strip leading /. That way we
// don't have to deal with the empty string a... | 0 | [
"CWE-787"
] | qpdf | d71f05ca07eb5c7cfa4d6d23e5c1f2a800f52e8e | 319,835,364,647,418,940,000,000,000,000,000,000,000 | 78 | 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 cpu_to_allnodes_group(int cpu, const cpumask_t *cpu_map,
struct sched_group **sg, cpumask_t *nodemask)
{
int group;
*nodemask = node_to_cpumask(cpu_to_node(cpu));
cpus_and(*nodemask, *nodemask, *cpu_map);
group = first_cpu(*nodemask);
if (sg)
*sg = &per_cpu(sched_group_allnodes, group);
return... | 0 | [] | linux-2.6 | 8f1bc385cfbab474db6c27b5af1e439614f3025c | 223,363,132,403,835,480,000,000,000,000,000,000,000 | 13 | sched: fair: weight calculations
In order to level the hierarchy, we need to calculate load based on the
root view. That is, each task's load is in the same unit.
A
/ \
B 1
/ \
2 3
To compute 1's load we do:
weight(1)
--------------
rq_weight(A)
To ... |
int snd_card_file_remove(struct snd_card *card, struct file *file)
{
struct snd_monitor_file *mfile, *found = NULL;
spin_lock(&card->files_lock);
list_for_each_entry(mfile, &card->files_list, list) {
if (mfile->file == file) {
list_del(&mfile->list);
spin_lock(&shutdown_lock);
list_del(&mfile->shutdown_l... | 0 | [
"CWE-416"
] | linux | 2a3f7221acddfe1caa9ff09b3a8158c39b2fdeac | 329,988,677,987,295,100,000,000,000,000,000,000,000 | 28 | ALSA: core: Fix card races between register and disconnect
There is a small race window in the card disconnection code that
allows the registration of another card with the very same card id.
This leads to a warning in procfs creation as caught by syzkaller.
The problem is that we delete snd_cards and snd_cards_lock ... |
do_cast (VerifyContext *ctx, int token, const char *opcode) {
ILStackDesc *value;
MonoType *type;
gboolean is_boxed;
gboolean do_box;
if (!check_underflow (ctx, 1))
return;
if (!(type = get_boxable_mono_type (ctx, token, opcode)))
return;
if (type->byref) {
ADD_VERIFY_ERROR (ctx, g_strdup_printf ("Inval... | 0 | [
"CWE-20"
] | mono | cf1ec146f7c6acdc6697032b3aaafc68ffacdcac | 160,525,137,702,328,040,000,000,000,000,000,000,000 | 38 | Handle invalid instantiation of generic methods.
* verify.c: Add new function to internal verifier API to check
method instantiations.
* reflection.c (mono_reflection_bind_generic_method_parameters):
Check the instantiation before returning it.
Fixes #655847 |
int kdb_parse(const char *cmdstr)
{
static char *argv[MAXARGC];
static int argc;
static char cbuf[CMD_BUFLEN+2];
char *cp;
char *cpp, quoted;
kdbtab_t *tp;
int escaped, ignore_errors = 0, check_grep = 0;
/*
* First tokenize the command string.
*/
cp = (char *)cmdstr;
if (KDB_FLAG(CMD_INTERRUPT)) {
/* ... | 0 | [
"CWE-787"
] | linux | eadb2f47a3ced5c64b23b90fd2a3463f63726066 | 1,554,047,275,265,906,800,000,000,000,000,000,000 | 168 | lockdown: also lock down previous kgdb use
KGDB and KDB allow read and write access to kernel memory, and thus
should be restricted during lockdown. An attacker with access to a
serial port (for example, via a hypervisor console, which some cloud
vendors provide over the network) could trigger the debugger so it is
i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.