func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
static void fdctrl_handle_partid(FDCtrl *fdctrl, int direction)
{
fdctrl->fifo[0] = 0x41; /* Stepping 1 */
fdctrl_to_result_phase(fdctrl, 1);
} | 0 | [
"CWE-787"
] | qemu | defac5e2fbddf8423a354ff0454283a2115e1367 | 285,560,924,946,572,650,000,000,000,000,000,000,000 | 5 | hw/block/fdc: Prevent end-of-track overrun (CVE-2021-3507)
Per the 82078 datasheet, if the end-of-track (EOT byte in
the FIFO) is more than the number of sectors per side, the
command is terminated unsuccessfully:
* 5.2.5 DATA TRANSFER TERMINATION
The 82078 supports terminal count explicitly through
the TC pin a... |
int exec_spawn(Unit *unit,
ExecCommand *command,
const ExecContext *context,
const ExecParameters *params,
ExecRuntime *runtime,
DynamicCreds *dcreds,
pid_t *ret) {
int socket_fd, r, named_iofds[3] = { -1, -1, -1 }, *fds ... | 0 | [
"CWE-269"
] | systemd | f69567cbe26d09eac9d387c0be0fc32c65a83ada | 12,524,414,429,908,197,000,000,000,000,000,000,000 | 121 | core: expose SUID/SGID restriction as new unit setting RestrictSUIDSGID= |
static bool unix_ex_wire_to_permset(connection_struct *conn, unsigned char wire_perm, SMB_ACL_PERMSET_T *p_permset)
{
if (wire_perm & ~(SMB_POSIX_ACL_READ|SMB_POSIX_ACL_WRITE|SMB_POSIX_ACL_EXECUTE)) {
return False;
}
if (SMB_VFS_SYS_ACL_CLEAR_PERMS(conn, *p_permset) == -1) {
return False;
}
if (wire_perm & ... | 0 | [
"CWE-264"
] | samba | d6c28913f3109d1327a3d1369b6eafd3874b2dca | 332,300,394,359,529,740,000,000,000,000,000,000,000 | 27 | Bug 6488: acl_group_override() call in posix acls references an uninitialized variable.
(cherry picked from commit f92195e3a1baaddda47a5d496f9488c8445b41ad) |
check_tty(const char *tty)
{
/* Check that we're not being set up to take a fall. */
if ((tty == NULL) || (strlen(tty) == 0)) {
return NULL;
}
/* Pull out the meaningful part of the tty's name. */
if (strchr(tty, '/') != NULL) {
if (strncmp(tty, "/dev/", 5) != 0) {
/* Make sure the device node is actually i... | 1 | [
"CWE-22"
] | linux-pam | 9dcead87e6d7f66d34e7a56d11a30daca367dffb | 336,131,573,636,879,400,000,000,000,000,000,000,000 | 21 | pam_timestamp: fix potential directory traversal issue (ticket #27)
pam_timestamp uses values of PAM_RUSER and PAM_TTY as components of
the timestamp pathname it creates, so extra care should be taken to
avoid potential directory traversal issues.
* modules/pam_timestamp/pam_timestamp.c (check_tty): Treat
"." and "..... |
g_tls_connection_base_dtls_connection_iface_init (GDtlsConnectionInterface *iface)
{
iface->handshake = g_tls_connection_base_dtls_handshake;
iface->handshake_async = g_tls_connection_base_dtls_handshake_async;
iface->handshake_finish = g_tls_connection_base_dtls_handshake_finish;
iface->shutdown = g_tls_connec... | 0 | [
"CWE-295"
] | glib-networking | 29513946809590c4912550f6f8620468f9836d94 | 279,657,721,621,242,920,000,000,000,000,000,000,000 | 11 | Return bad identity error if identity is unset
When the server-identity property of GTlsClientConnection is unset, the
documentation sasy we need to fail the certificate verification with
G_TLS_CERTIFICATE_BAD_IDENTITY. This is important because otherwise,
it's easy for applications to fail to specify server identity.... |
R_API RAnalOp* r_core_anal_op(RCore *core, ut64 addr, int mask) {
int len;
ut8 buf[32];
ut8 *ptr;
r_return_val_if_fail (core, NULL);
if (addr == UT64_MAX) {
return NULL;
}
RAnalOp *op = R_NEW0 (RAnalOp);
if (!op) {
return NULL;
}
int delta = (addr - core->offset);
int minopsz = 8;
if (delta > 0 && delt... | 0 | [
"CWE-416"
] | radare2 | 10517e3ff0e609697eb8cde60ec8dc999ee5ea24 | 92,545,681,468,836,070,000,000,000,000,000,000,000 | 49 | aaef on arm/thumb switches causes uaf ##crash
* Reported by peacock-doris via huntr.dev
* Reproducer: poc_uaf_r_reg_get |
gboolean
mono_verifier_is_method_full_trust (MonoMethod *method)
{
return mono_verifier_is_class_full_trust (method->klass); | 0 | [
"CWE-20"
] | mono | 4905ef1130feb26c3150b28b97e4a96752e0d399 | 124,801,800,332,529,750,000,000,000,000,000,000,000 | 4 | 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 |
//! Compute field of diffusion tensors for edge-preserving smoothing \newinstance.
CImg<Tfloat> get_diffusion_tensors(const float sharpness=0.7f, const float anisotropy=0.6f,
const float alpha=0.6f, const float sigma=1.1f, const bool is_sqrt=false) const {
return CIm... | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 140,642,688,021,992,730,000,000,000,000,000,000,000 | 4 | Fix other issues in 'CImg<T>::load_bmp()'. |
static void reds_info_new_channel(RedLinkInfo *link, int connection_id)
{
spice_debug("channel %d:%d, connected successfully, over %s link",
link->link_mess->channel_type,
link->link_mess->channel_id,
red_stream_is_ssl(link->stream) ? "Secure" : "Non Secure");
/* ... | 0 | [] | spice | ca5bbc5692e052159bce1a75f55dc60b36078749 | 335,000,356,845,538,800,000,000,000,000,000,000,000 | 12 | With OpenSSL 1.1: Disable client-initiated renegotiation.
Fixes issue #49
Fixes BZ#1904459
Signed-off-by: Julien Ropé <jrope@redhat.com>
Reported-by: BlackKD
Acked-by: Frediano Ziglio <fziglio@redhat.com> |
constexpr T safeMod(T dividend, T divisor) {
uassert(51259, "can't mod by zero", divisor != 0);
return (divisor == 1 || divisor == -1 ? 0 : dividend % divisor);
} | 0 | [
"CWE-190"
] | mongo | 21d8699ed6c517b45e1613e20231cd8eba894985 | 50,536,692,015,112,600,000,000,000,000,000,000,000 | 4 | SERVER-43699 $mod should not overflow for large negative values |
static int vhost_scsi_check_true(struct se_portal_group *se_tpg)
{
return 1;
} | 0 | [
"CWE-200",
"CWE-119"
] | linux | 59c816c1f24df0204e01851431d3bab3eb76719c | 166,275,992,446,610,990,000,000,000,000,000,000,000 | 4 | vhost/scsi: potential memory corruption
This code in vhost_scsi_make_tpg() is confusing because we limit "tpgt"
to UINT_MAX but the data type of "tpg->tport_tpgt" and that is a u16.
I looked at the context and it turns out that in
vhost_scsi_set_endpoint(), "tpg->tport_tpgt" is used as an offset into
the vs_tpg[] arr... |
static int decode_layout_stateid(struct xdr_stream *xdr, nfs4_stateid *stateid)
{
stateid->type = NFS4_LAYOUT_STATEID_TYPE;
return decode_stateid(xdr, stateid);
} | 0 | [
"CWE-787"
] | linux | b4487b93545214a9db8cbf32e86411677b0cca21 | 42,182,891,012,734,130,000,000,000,000,000,000,000 | 5 | nfs: Fix getxattr kernel panic and memory overflow
Move the buffer size check to decode_attr_security_label() before memcpy()
Only call memcpy() if the buffer is large enough
Fixes: aa9c2669626c ("NFS: Client implementation of Labeled-NFS")
Signed-off-by: Jeffrey Mitchell <jeffrey.mitchell@starlab.io>
[Trond: clean u... |
QPDFObjectHandle::isRectangle()
{
if (! isArray())
{
return false;
}
if (getArrayNItems() != 4)
{
return false;
}
for (int i = 0; i < 4; ++i)
{
if (! getArrayItem(i).isNumber())
{
return false;
}
}
return true;
} | 0 | [
"CWE-787"
] | qpdf | d71f05ca07eb5c7cfa4d6d23e5c1f2a800f52e8e | 60,177,623,948,315,165,000,000,000,000,000,000,000 | 19 | 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 ... |
TEST_P(DownstreamProtocolIntegrationTest, LargeRequestHeadersAccepted) {
// Send one 95 kB header with limit 96 kB and 100 headers.
testLargeRequestHeaders(95, 1, 96, 100);
} | 0 | [
"CWE-770"
] | envoy | 7ca28ff7d46454ae930e193d97b7d08156b1ba59 | 185,007,623,968,964,370,000,000,000,000,000,000,000 | 4 | [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> |
md_analyze_table_alignment(MD_CTX* ctx, OFF beg, OFF end, MD_ALIGN* align, int n_align)
{
static const MD_ALIGN align_map[] = { MD_ALIGN_DEFAULT, MD_ALIGN_LEFT, MD_ALIGN_RIGHT, MD_ALIGN_CENTER };
OFF off = beg;
while(n_align > 0) {
int index = 0; /* index into align_map[] */
while(CH(off)... | 0 | [
"CWE-125",
"CWE-908"
] | md4c | 4fc808d8fe8d8904f8525bb4231d854f45e23a19 | 305,207,834,730,862,940,000,000,000,000,000,000,000 | 23 | md_analyze_line: Avoid reading 1 byte beyond the input size.
Fixes #155. |
int do_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
{
struct inode *inode = file->f_path.dentry->d_inode;
long ret;
if (offset < 0 || len <= 0)
return -EINVAL;
/* Return error if mode is not supported */
if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE))
return -EOPNOTSUPP;
/* P... | 0 | [
"CWE-732"
] | linux-stable | e57712ebebbb9db7d8dcef216437b3171ddcf115 | 83,531,765,481,735,890,000,000,000,000,000,000,000 | 54 | merge fchmod() and fchmodat() guts, kill ancient broken kludge
The kludge in question is undocumented and doesn't work for 32bit
binaries on amd64, sparc64 and s390. Passing (mode_t)-1 as
mode had (since 0.99.14v and contrary to behaviour of any
other Unix, prescriptions of POSIX, SuS and our own manpages)
was kinda-... |
mbfl_identify_encoding2(mbfl_string *string, const mbfl_encoding **elist, int elistsz, int strict)
{
int i, n, num, bad;
unsigned char *p;
mbfl_identify_filter *flist, *filter;
const mbfl_encoding *encoding;
/* flist is an array of mbfl_identify_filter instances */
flist = (mbfl_identify_filter *)mbfl_calloc(eli... | 0 | [
"CWE-119"
] | php-src | 64f42c73efc58e88671ad76b6b6bc8e2b62713e1 | 143,430,619,714,425,700,000,000,000,000,000,000,000 | 81 | Fixed bug #71906: AddressSanitizer: negative-size-param (-1) in mbfl_strcut |
XLogBytePosToRecPtr(uint64 bytepos)
{
uint64 fullsegs;
uint64 fullpages;
uint64 bytesleft;
uint32 seg_offset;
XLogRecPtr result;
fullsegs = bytepos / UsableBytesInSegment;
bytesleft = bytepos % UsableBytesInSegment;
if (bytesleft < XLOG_BLCKSZ - SizeOfXLogLongPHD)
{
/* fits on first page of segment */
... | 0 | [
"CWE-119"
] | postgres | 01824385aead50e557ca1af28640460fa9877d51 | 119,590,873,376,260,800,000,000,000,000,000,000,000 | 32 | Prevent potential overruns of fixed-size buffers.
Coverity identified a number of places in which it couldn't prove that a
string being copied into a fixed-size buffer would fit. We believe that
most, perhaps all of these are in fact safe, or are copying data that is
coming from a trusted source so that any overrun i... |
JVM_RawCallocInCategory(size_t nmemb, size_t size, const char * callsite, jint category)
{
size_t byteSize = nmemb * size;
void * mem = JVM_RawAllocateInCategory(byteSize, callsite, category);
if (mem != NULL) {
memset(mem, 0, byteSize);
}
return mem;
} | 0 | [
"CWE-119"
] | openj9 | 0971f22d88f42cf7332364ad7430e9bd8681c970 | 175,054,552,333,672,500,000,000,000,000,000,000,000 | 11 | Clean up jio_snprintf and jio_vfprintf
Fixes https://bugs.eclipse.org/bugs/show_bug.cgi?id=543659
Signed-off-by: Peter Bain <peter_bain@ca.ibm.com> |
poppler_font_info_scan (PopplerFontInfo *font_info,
int n_pages,
PopplerFontsIter **iter)
{
GooList *items;
g_return_val_if_fail (iter != nullptr, FALSE);
items = font_info->scanner->scan(n_pages);
if (items == nullptr) {
*iter = nullptr;
} else if (items->getLength() == 0) {
*iter = ... | 0 | [
"CWE-476"
] | poppler | f162ecdea0dda5dbbdb45503c1d55d9afaa41d44 | 203,920,437,699,236,580,000,000,000,000,000,000,000 | 21 | Fix crash on missing embedded file
Check whether an embedded file is actually present in the PDF
and show warning in that case.
https://bugs.freedesktop.org/show_bug.cgi?id=106137
https://gitlab.freedesktop.org/poppler/poppler/issues/236 |
//! Return a list with elements being shared copies of images in the list instance \const.
const CImgList<T> get_shared() const {
CImgList<T> res(_width);
cimglist_for(*this,l) res[l].assign(_data[l],true);
return res; | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 160,914,377,919,131,470,000,000,000,000,000,000,000 | 5 | Fix other issues in 'CImg<T>::load_bmp()'. |
static int ext4_fill_super(struct super_block *sb, void *data, int silent)
{
struct dax_device *dax_dev = fs_dax_get_by_bdev(sb->s_bdev);
char *orig_data = kstrdup(data, GFP_KERNEL);
struct buffer_head *bh;
struct ext4_super_block *es = NULL;
struct ext4_sb_info *sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
ext4_fsbl... | 0 | [
"CWE-787"
] | linux | c37e9e013469521d9adb932d17a1795c139b36db | 277,998,543,646,837,060,000,000,000,000,000,000,000 | 1,036 | 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... |
static const char *vgacon_startup(void)
{
const char *display_desc = NULL;
u16 saved1, saved2;
volatile u16 *p;
if (screen_info.orig_video_isVGA == VIDEO_TYPE_VLFB ||
screen_info.orig_video_isVGA == VIDEO_TYPE_EFI) {
no_vga:
#ifdef CONFIG_DUMMY_CONSOLE
conswitchp = &dummy_con;
return conswitchp->co... | 0 | [
"CWE-125"
] | linux | 973c096f6a85e5b5f2a295126ba6928d9a6afd45 | 237,369,146,485,412,130,000,000,000,000,000,000,000 | 186 | vgacon: remove software scrollback support
Yunhai Zhang recently fixed a VGA software scrollback bug in commit
ebfdfeeae8c0 ("vgacon: Fix for missing check in scrollback handling"),
but that then made people look more closely at some of this code, and
there were more problems on the vgacon side, but also the fbcon sof... |
_copyListenStmt(const ListenStmt *from)
{
ListenStmt *newnode = makeNode(ListenStmt);
COPY_STRING_FIELD(conditionname);
return newnode;
} | 0 | [
"CWE-362"
] | postgres | 5f173040e324f6c2eebb90d86cf1b0cdb5890f0a | 163,567,029,842,028,680,000,000,000,000,000,000,000 | 8 | Avoid repeated name lookups during table and index DDL.
If the name lookups come to different conclusions due to concurrent
activity, we might perform some parts of the DDL on a different table
than other parts. At least in the case of CREATE INDEX, this can be
used to cause the permissions checks to be performed aga... |
static int iommu_no_mapping(struct device *dev)
{
int found;
if (iommu_dummy(dev))
return 1;
if (!iommu_identity_mapping)
return 0;
found = identity_mapping(dev);
if (found) {
if (iommu_should_identity_map(dev, 0))
return 1;
else {
/*
* 32 bit DMA is removed from si_domain and fall back
* ... | 0 | [] | linux | d8b8591054575f33237556c32762d54e30774d28 | 19,742,696,743,360,320,000,000,000,000,000,000,000 | 40 | iommu/vt-d: Disable ATS support on untrusted devices
Commit fb58fdcd295b9 ("iommu/vt-d: Do not enable ATS for untrusted
devices") disables ATS support on the devices which have been marked
as untrusted. Unfortunately this is not enough to fix the DMA attack
vulnerabiltiies because IOMMU driver allows translated reques... |
STBIDEF float *stbi_loadf(char const *filename, int *x, int *y, int *comp, int req_comp)
{
float *result;
FILE *f = stbi__fopen(filename, "rb");
if (!f) return stbi__errpf("can't fopen", "Unable to open file");
result = stbi_loadf_from_file(f,x,y,comp,req_comp);
fclose(f);
return result;
} | 0 | [
"CWE-787"
] | stb | 5ba0baaa269b3fd681828e0e3b3ac0f1472eaf40 | 17,113,342,288,356,480,000,000,000,000,000,000,000 | 9 | stb_image: Reject fractional JPEG component subsampling ratios
The component resamplers are not written to support this and I've
never seen it happen in a real (non-crafted) JPEG file so I'm
fine rejecting this as outright corrupt.
Fixes issue #1178. |
unsigned char *zzlInsertAt(unsigned char *zl, unsigned char *eptr, sds ele, double score) {
unsigned char *sptr;
char scorebuf[128];
int scorelen;
size_t offset;
scorelen = d2string(scorebuf,sizeof(scorebuf),score);
if (eptr == NULL) {
zl = ziplistPush(zl,(unsigned char*)ele,sdslen(ele)... | 0 | [
"CWE-190"
] | redis | f6a40570fa63d5afdd596c78083d754081d80ae3 | 160,903,268,671,063,420,000,000,000,000,000,000,000 | 22 | Fix ziplist and listpack overflows and truncations (CVE-2021-32627, CVE-2021-32628)
- fix possible heap corruption in ziplist and listpack resulting by trying to
allocate more than the maximum size of 4GB.
- prevent ziplist (hash and zset) from reaching size of above 1GB, will be
converted to HT encoding, that's n... |
static int flattenSubquery(
Parse *pParse, /* Parsing context */
Select *p, /* The parent or outer SELECT statement */
int iFrom, /* Index in p->pSrc->a[] of the inner subquery */
int isAgg /* True if outer SELECT uses aggregate functions */
){
const char *zSavedAuthContex... | 1 | [
"CWE-476"
] | sqlite | 396afe6f6aa90a31303c183e11b2b2d4b7956b35 | 182,577,294,779,276,200,000,000,000,000,000,000,000 | 392 | Continue to back away from the LEFT JOIN optimization of check-in [41c27bc0ff1d3135]
by disallowing query flattening if the outer query is DISTINCT. Without this fix,
if an index scan is run on the table within the view on the right-hand side of the
LEFT JOIN, stale result registers might be accessed yielding incorrec... |
void checkServerNegotiation(const BSONObj& input, const std::vector<std::string>& expected) {
auto registry = buildRegistry();
MessageCompressorManager manager(®istry);
BSONObjBuilder serverOutput;
manager.serverNegotiate(input, &serverOutput);
checkNegotiationResult(serverOutput.done(), expecte... | 0 | [] | mongo | 5ad69b851801edadbfde8fdf271f4ba7c21170b5 | 273,592,161,910,973,240,000,000,000,000,000,000,000 | 8 | SERVER-31273 Use Source/Sink version of snappy functions
(cherry picked from commit 59ead734faa8aa51f0c53bf2bd39d0a0247ddf99) |
unsigned long do_mmap(struct file *file, unsigned long addr,
unsigned long len, unsigned long prot,
unsigned long flags, vm_flags_t vm_flags,
unsigned long pgoff, unsigned long *populate,
struct list_head *uf)
{
struct mm_struct *mm = current->mm;
int pkey = 0;
*populate = 0;
if (!len)
return -EINVA... | 0 | [
"CWE-476"
] | linux | 0a1d52994d440e21def1c2174932410b4f2a98a1 | 116,791,619,559,429,610,000,000,000,000,000,000,000 | 183 | mm: enforce min addr even if capable() in expand_downwards()
security_mmap_addr() does a capability check with current_cred(), but
we can reach this code from contexts like a VFS write handler where
current_cred() must not be used.
This can be abused on systems without SMAP to make NULL pointer
dereferences exploitab... |
static int wtp_raw_event(struct hid_device *hdev, u8 *data, int size)
{
struct hidpp_device *hidpp = hid_get_drvdata(hdev);
struct wtp_data *wd = hidpp->private_data;
struct hidpp_report *report = (struct hidpp_report *)data;
struct hidpp_touchpad_raw_xy raw;
if (!wd || !hidpp->input)
return 1;
switch (data[0... | 0 | [
"CWE-787"
] | linux | d9d4b1e46d9543a82c23f6df03f4ad697dab361b | 256,698,303,465,062,200,000,000,000,000,000,000,000 | 42 | 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... |
static int atm_change_qos(struct atm_vcc *vcc, struct atm_qos *qos)
{
int error;
/*
* Don't let the QoS change the already connected AAL type nor the
* traffic class.
*/
if (qos->aal != vcc->qos.aal ||
qos->rxtp.traffic_class != vcc->qos.rxtp.traffic_class ||
qos->txtp.traffic_class != vcc->qos.txtp... | 0 | [
"CWE-20",
"CWE-269"
] | linux | f3d3342602f8bcbf37d7c46641cb9bca7618eb1c | 29,023,373,304,817,866,000,000,000,000,000,000,000 | 23 | 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... |
PAM_EXTERN int pam_sm_setcred(pam_handle_t *pamh, int flags, int argc, const char **argv)
{
DBG("pam_sm_setcred() called");
/* Actually, we should return the same value as pam_sm_authenticate(). */
return PAM_SUCCESS;
} | 0 | [] | pam_pkcs11 | a0c9b6ffc020944f03f57e7de66ad4363d52125d | 17,712,071,322,107,585,000,000,000,000,000,000,000 | 6 | fixed wiping secrets with OpenSSL_cleanse()
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting the problems. |
SPL_METHOD(Array, key)
{
if (zend_parse_parameters_none() == FAILURE) {
return;
}
spl_array_iterator_key(getThis(), return_value TSRMLS_CC);
} /* }}} */ | 0 | [] | php-src | a374dfab567ff7f0ab0dc150f14cc891b0340b47 | 308,274,685,092,680,900,000,000,000,000,000,000,000 | 8 | Fix bug #67492: unserialize() SPL ArrayObject / SPLObjectStorage Type Confusion |
brcmf_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
struct cfg80211_mgmt_tx_params *params, u64 *cookie)
{
struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
struct ieee80211_channel *chan = params->chan;
const u8 *buf = params->buf;
size_t len = params->len;
const struct ieee80211_... | 0 | [
"CWE-119",
"CWE-787"
] | linux | 8f44c9a41386729fea410e688959ddaa9d51be7c | 57,552,554,930,544,420,000,000,000,000,000,000,000 | 105 | brcmfmac: fix possible buffer overflow in brcmf_cfg80211_mgmt_tx()
The lower level nl80211 code in cfg80211 ensures that "len" is between
25 and NL80211_ATTR_FRAME (2304). We subtract DOT11_MGMT_HDR_LEN (24) from
"len" so thats's max of 2280. However, the action_frame->data[] buffer is
only BRCMF_FIL_ACTION_FRAME_SI... |
static void check_timers(struct v4l2_loopback_device *dev)
{
if (!dev->ready_for_capture)
return;
if (dev->timeout_jiffies > 0 && !timer_pending(&dev->timeout_timer))
mod_timer(&dev->timeout_timer, jiffies + dev->timeout_jiffies);
if (dev->sustain_framerate && !timer_pending(&dev->sustain_timer))
mod_timer(&d... | 0 | [
"CWE-787"
] | v4l2loopback | 64a216af4c09c9ba9326057d7e78994271827eff | 258,213,869,169,538,670,000,000,000,000,000,000,000 | 10 | add explicit format specifier to printf() invocations
CWE-134 |
SYSCALL_DEFINE2(link, const char __user *, oldname, const char __user *, newname)
{
return do_linkat(AT_FDCWD, oldname, AT_FDCWD, newname, 0);
} | 0 | [
"CWE-416",
"CWE-284"
] | linux | d0cb50185ae942b03c4327be322055d622dc79f6 | 222,431,258,246,204,200,000,000,000,000,000,000,000 | 4 | do_last(): fetch directory ->i_mode and ->i_uid before it's too late
may_create_in_sticky() call is done when we already have dropped the
reference to dir.
Fixes: 30aba6656f61e (namei: allow restricted O_CREAT of FIFOs and regular files)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> |
static int snd_emu0204_ch_switch_resume(struct usb_mixer_elem_list *list)
{
return snd_emu0204_ch_switch_update(list->mixer,
list->kctl->private_value);
} | 0 | [] | sound | 447d6275f0c21f6cc97a88b3a0c601436a4cdf2a | 78,619,989,956,507,840,000,000,000,000,000,000,000 | 5 | ALSA: usb-audio: Add sanity checks for endpoint accesses
Add some sanity check codes before actually accessing the endpoint via
get_endpoint() in order to avoid the invalid access through a
malformed USB descriptor. Mostly just checking bNumEndpoints, but in
one place (snd_microii_spdif_default_get()), the validity o... |
static void erase(VTermState *state, VTermRect rect, int selective)
{
if(state->callbacks && state->callbacks->erase)
if((*state->callbacks->erase)(rect, selective, state->cbdata))
return;
} | 0 | [
"CWE-476"
] | vim | cd929f7ba8cc5b6d6dcf35c8b34124e969fed6b8 | 301,553,778,642,363,870,000,000,000,000,000,000,000 | 6 | patch 8.1.0633: crash when out of memory while opening a terminal window
Problem: Crash when out of memory while opening a terminal window.
Solution: Handle out-of-memory more gracefully. |
ConnectClientToTcpAddr(unsigned int host, int port)
{
int sock;
struct sockaddr_in addr;
int one = 1;
if (!initSockets())
return -1;
addr.sin_family = AF_INET;
addr.sin_port = htons(port);
addr.sin_addr.s_addr = host;
sock = socket(AF_INET, SOCK_STREAM, 0);
if (sock < 0) {
#ifdef WIN32
errno... | 0 | [
"CWE-120",
"CWE-787"
] | libvncserver | 3fd03977c9b35800d73a865f167338cb4d05b0c1 | 75,491,700,901,615,090,000,000,000,000,000,000,000 | 37 | libvncclient: bail out if unix socket name would overflow
Closes #291 |
static ssize_t vfswrap_write(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n)
{
ssize_t result;
START_PROFILE_BYTES(syscall_write, n);
result = sys_write(fsp->fh->fd, data, n);
END_PROFILE(syscall_write);
return result;
} | 0 | [
"CWE-665"
] | samba | 30e724cbff1ecd90e5a676831902d1e41ec1b347 | 161,134,395,103,389,920,000,000,000,000,000,000,000 | 9 | FSCTL_GET_SHADOW_COPY_DATA: Initialize output array to zero
Otherwise num_volumes and the end marker can return uninitialized data
to the client.
Signed-off-by: Christof Schmitt <christof.schmitt@us.ibm.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org> |
check_user_file (const char *filename,
gssize max_file_size)
{
struct stat fileinfo;
if (max_file_size < 0) {
max_file_size = G_MAXSIZE;
}
/* Exists/Readable? */
if (stat (filename, &fileinfo) < 0) {
g_debug ("File does not ... | 0 | [] | gdm | c25ef9245be4e0be2126ef3d075df4401949b570 | 273,361,162,101,003,080,000,000,000,000,000,000,000 | 29 | Store the face and dmrc files in a cache. Refer to bug #565151. |
void ttm_tt_destroy(struct ttm_tt *ttm)
{
if (ttm == NULL)
return;
ttm_tt_unbind(ttm);
if (ttm->state == tt_unbound)
ttm_tt_unpopulate(ttm);
if (!(ttm->page_flags & TTM_PAGE_FLAG_PERSISTENT_SWAP) &&
ttm->swap_storage)
fput(ttm->swap_storage);
ttm->swap_storage = NULL;
ttm->func->destroy(ttm);
} | 0 | [] | linux | 5de5b6ecf97a021f29403aa272cb4e03318ef586 | 174,044,681,019,704,220,000,000,000,000,000,000,000 | 17 | drm/ttm/nouveau: don't call tt destroy callback on alloc failure.
This is confusing, and from my reading of all the drivers only
nouveau got this right.
Just make the API act under driver control of it's own allocation
failing, and don't call destroy, if the page table fails to
create there is nothing to cleanup here... |
int snd_rawmidi_info_select(struct snd_card *card, struct snd_rawmidi_info *info)
{
int ret;
mutex_lock(®ister_mutex);
ret = __snd_rawmidi_info_select(card, info);
mutex_unlock(®ister_mutex);
return ret;
} | 0 | [
"CWE-415"
] | linux | 39675f7a7c7e7702f7d5341f1e0d01db746543a0 | 100,420,064,411,193,840,000,000,000,000,000,000,000 | 9 | ALSA: rawmidi: Change resized buffers atomically
The SNDRV_RAWMIDI_IOCTL_PARAMS ioctl may resize the buffers and the
current code is racy. For example, the sequencer client may write to
buffer while it being resized.
As a simple workaround, let's switch to the resized buffer inside the
stream runtime lock.
Reported... |
static int _nfs4_proc_mknod(struct inode *dir, struct dentry *dentry,
struct iattr *sattr, struct nfs4_label *label, dev_t rdev)
{
struct nfs4_createdata *data;
int mode = sattr->ia_mode;
int status = -ENOMEM;
data = nfs4_alloc_createdata(dir, &dentry->d_name, sattr, NF4SOCK);
if (data == NULL)
goto out;
if... | 0 | [
"CWE-787"
] | linux | b4487b93545214a9db8cbf32e86411677b0cca21 | 80,722,660,698,174,810,000,000,000,000,000,000,000 | 34 | nfs: Fix getxattr kernel panic and memory overflow
Move the buffer size check to decode_attr_security_label() before memcpy()
Only call memcpy() if the buffer is large enough
Fixes: aa9c2669626c ("NFS: Client implementation of Labeled-NFS")
Signed-off-by: Jeffrey Mitchell <jeffrey.mitchell@starlab.io>
[Trond: clean u... |
static void iwl_pcie_irq_set_affinity(struct iwl_trans *trans)
{
int iter_rx_q, i, ret, cpu, offset;
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
i = trans_pcie->shared_vec_mask & IWL_SHARED_IRQ_FIRST_RSS ? 0 : 1;
iter_rx_q = trans_pcie->trans->num_rx_queues - 1 + i;
offset = 1 + i;
for (... | 0 | [
"CWE-476"
] | linux | 8188a18ee2e48c9a7461139838048363bfce3fef | 301,240,825,655,688,980,000,000,000,000,000,000,000 | 23 | iwlwifi: pcie: fix rb_allocator workqueue allocation
We don't handle failures in the rb_allocator workqueue allocation
correctly. To fix that, move the code earlier so the cleanup is
easier and we don't have to undo all the interrupt allocations in
this case.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Sig... |
EXPORTED void mailbox_set_mbtype(struct mailbox *mailbox, uint32_t mbtype)
{
mailbox->h.mbtype = mbtype;
mailbox->header_dirty = 1;
} | 0 | [] | cyrus-imapd | 1d6d15ee74e11a9bd745e80be69869e5fb8d64d6 | 124,551,688,190,426,040,000,000,000,000,000,000,000 | 5 | mailbox.c/reconstruct.c: Add mailbox_mbentry_from_path() |
int uwsgi_run_command_and_wait(char *command, char *arg) {
int waitpid_status = 0;
pid_t pid = fork();
if (pid < 0) {
return -1;
}
if (pid > 0) {
if (waitpid(pid, &waitpid_status, 0) < 0) {
uwsgi_error("uwsgi_run_command_and_wait()/waitpid()");
return -1;
}
return WEXITSTATUS(waitpid_status);
}
... | 0 | [
"CWE-119",
"CWE-703",
"CWE-787"
] | uwsgi | cb4636f7c0af2e97a4eef7a3cdcbd85a71247bfe | 326,468,802,098,642,200,000,000,000,000,000,000,000 | 18 | improve uwsgi_expand_path() to sanitize input, avoiding stack corruption and potential security issue |
void __skb_tstamp_tx(struct sk_buff *orig_skb,
struct skb_shared_hwtstamps *hwtstamps,
struct sock *sk, int tstype)
{
struct sk_buff *skb;
bool tsonly, opt_stats = false;
if (!sk)
return;
tsonly = sk->sk_tsflags & SOF_TIMESTAMPING_OPT_TSONLY;
if (!skb_may_tx_timestamp(sk, tsonly))
return;
if... | 0 | [
"CWE-125"
] | linux | 4ef1b2869447411ad3ef91ad7d4891a83c1a509a | 337,810,479,111,680,900,000,000,000,000,000,000,000 | 42 | tcp: mark skbs with SCM_TIMESTAMPING_OPT_STATS
SOF_TIMESTAMPING_OPT_STATS can be enabled and disabled
while packets are collected on the error queue.
So, checking SOF_TIMESTAMPING_OPT_STATS in sk->sk_tsflags
is not enough to safely assume that the skb contains
OPT_STATS data.
Add a bit in sock_exterr_skb to indicate ... |
rdnNormalize(
slap_mask_t use,
Syntax *syntax,
MatchingRule *mr,
struct berval *val,
struct berval *out,
void *ctx)
{
assert( val != NULL );
assert( out != NULL );
Debug( LDAP_DEBUG_TRACE, ">>> dnNormalize: <%s>\n", val->bv_val ? val->bv_val : "", 0, 0 );
if ( val->bv_len != 0 ) {
LDAPRDN... | 0 | [
"CWE-763"
] | openldap | 5a2017d4e61a6ddc4dcb4415028e0d08eb6bca26 | 88,520,509,224,825,590,000,000,000,000,000,000 | 56 | ITS#9412 fix AVA_Sort on invalid RDN |
static void init_tee(const char *file_name)
{
FILE* new_outfile;
if (opt_outfile)
end_tee();
if (!(new_outfile= my_fopen(file_name, O_APPEND | O_WRONLY, MYF(MY_WME))))
{
tee_fprintf(stdout, "Error logging to file '%s'\n", file_name);
return;
}
OUTFILE = new_outfile;
strmake_buf(outfile, file_n... | 0 | [] | server | 383007c75d6ef5043fa5781956a6a02b24e2b79e | 269,011,644,064,782,840,000,000,000,000,000,000,000 | 16 | mysql cli: fix USE command quoting
* use proper sql quoting rules for USE, while preserving
as much of historical behavior as possible
* short commands (\u) behave as before |
bool FilterManager::handleDataIfStopAll(ActiveStreamFilterBase& filter, Buffer::Instance& data,
bool& filter_streaming) {
if (filter.stoppedAll()) {
ASSERT(!filter.canIterate());
filter_streaming =
filter.iteration_state_ == ActiveStreamFilterBase::IterationStat... | 0 | [
"CWE-416"
] | envoy | 148de954ed3585d8b4298b424aa24916d0de6136 | 5,304,042,760,160,520,000,000,000,000,000,000,000 | 11 | CVE-2021-43825
Response filter manager crash
Signed-off-by: Yan Avlasov <yavlasov@google.com> |
get_other_operator(List *otherOp, Oid otherLeftTypeId, Oid otherRightTypeId,
const char *operatorName, Oid operatorNamespace,
Oid leftTypeId, Oid rightTypeId, bool isCommutator)
{
Oid other_oid;
bool otherDefined;
char *otherName;
Oid otherNamespace;
AclResult aclresult;
other_oid = Operato... | 0 | [
"CWE-94"
] | postgres | b9b21acc766db54d8c337d508d0fe2f5bf2daab0 | 280,618,010,699,548,530,000,000,000,000,000,000,000 | 54 | In extensions, don't replace objects not belonging to the extension.
Previously, if an extension script did CREATE OR REPLACE and there was
an existing object not belonging to the extension, it would overwrite
the object and adopt it into the extension. This is problematic, first
because the overwrite is probably uni... |
static ssize_t show_bank(struct device *s, struct device_attribute *attr,
char *buf)
{
return sprintf(buf, "%llx\n", attr_to_bank(attr)->ctl);
} | 0 | [
"CWE-362"
] | linux | b3b7c4795ccab5be71f080774c45bbbcc75c2aaf | 282,723,329,886,509,400,000,000,000,000,000,000,000 | 5 | x86/MCE: Serialize sysfs changes
The check_interval file in
/sys/devices/system/machinecheck/machinecheck<cpu number>
directory is a global timer value for MCE polling. If it is changed by one
CPU, mce_restart() broadcasts the event to other CPUs to delete and restart
the MCE polling timer and __mcheck_cpu_init_ti... |
PHP_FUNCTION(imagecreatefromgd2part)
{
_php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_GD2PART, "GD2", gdImageCreateFromGd2Part, gdImageCreateFromGd2PartCtx);
} | 0 | [
"CWE-703",
"CWE-189"
] | php-src | 2938329ce19cb8c4197dec146c3ec887c6f61d01 | 301,183,530,430,783,000,000,000,000,000,000,000,000 | 4 | Fixed bug #66356 (Heap Overflow Vulnerability in imagecrop())
And also fixed the bug: arguments are altered after some calls |
static inline uint32_t get_hwc_y(SM501State *state, int crt)
{
uint32_t location = crt ? state->dc_crt_hwc_location
: state->dc_panel_hwc_location;
return (location & 0x07FF0000) >> 16;
} | 0 | [
"CWE-190"
] | qemu | b15a22bbcbe6a78dc3d88fe3134985e4cdd87de4 | 160,459,258,730,664,330,000,000,000,000,000,000,000 | 6 | sm501: Replace hand written implementation with pixman where possible
Besides being faster this should also prevent malicious guests to
abuse 2D engine to overwrite data or cause a crash.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Message-id: 58666389b6cae256e4e972a32c05cf8aa51bffc0.1590089984.git.balaton@eik... |
virDomainVirtioOptionsParseXML(xmlNodePtr driver,
virDomainVirtioOptionsPtr *virtio)
{
int val;
virDomainVirtioOptionsPtr res;
g_autofree char *str = NULL;
if (*virtio || !driver)
return 0;
if (VIR_ALLOC(*virtio) < 0)
return -1;
res = *virtio;
... | 0 | [
"CWE-212"
] | libvirt | a5b064bf4b17a9884d7d361733737fb614ad8979 | 122,095,377,178,446,270,000,000,000,000,000,000,000 | 46 | conf: Don't format http cookies unless VIR_DOMAIN_DEF_FORMAT_SECURE is used
Starting with 3b076391befc3fe72deb0c244ac6c2b4c100b410
(v6.1.0-122-g3b076391be) we support http cookies. Since they may contain
somewhat sensitive information we should not format them into the XML
unless VIR_DOMAIN_DEF_FORMAT_SECURE is assert... |
QPDFObjectHandle::assertNull()
{
assertType("Null", isNull());
} | 0 | [
"CWE-835"
] | qpdf | afe0242b263a9e1a8d51dd81e42ab6de2e5127eb | 115,096,438,296,081,260,000,000,000,000,000,000,000 | 4 | Handle object ID 0 (fixes #99)
This is CVE-2017-9208.
The QPDF library uses object ID 0 internally as a sentinel to
represent a direct object, but prior to this fix, was not blocking
handling of 0 0 obj or 0 0 R as a special case. Creating an object in
the file with 0 0 obj could cause various infinite loops. The PDF... |
parse_queued_messages(void)
{
int old_curwin_id;
int old_curbuf_fnum;
int i;
int save_may_garbage_collect = may_garbage_collect;
static int entered = 0;
int was_safe = get_was_safe_state();
// Do not handle messages while redrawing, because it may cause buffers to
//... | 0 | [
"CWE-125"
] | vim | a4bc2dd7cccf5a4a9f78b58b6f35a45d17164323 | 289,119,868,185,408,700,000,000,000,000,000,000,000 | 91 | patch 8.2.4233: crash when recording and using Select mode
Problem: Crash when recording and using Select mode.
Solution: When deleting the last recorded character check there is something
to delete. |
int cil_gen_levelrange(struct cil_db *db, struct cil_tree_node *parse_current, struct cil_tree_node *ast_node)
{
enum cil_syntax syntax[] = {
CIL_SYN_STRING,
CIL_SYN_STRING,
CIL_SYN_LIST,
CIL_SYN_END
};
int syntax_len = sizeof(syntax)/sizeof(*syntax);
char *key = NULL;
struct cil_levelrange *lvlrange = NUL... | 0 | [
"CWE-125"
] | selinux | 340f0eb7f3673e8aacaf0a96cbfcd4d12a405521 | 256,269,958,880,041,530,000,000,000,000,000,000,000 | 44 | libsepol/cil: Check for statements not allowed in optional blocks
While there are some checks for invalid statements in an optional
block when resolving the AST, there are no checks when building the
AST.
OSS-Fuzz found the following policy which caused a null dereference
in cil_tree_get_next_path().
(blockinherit ... |
void ElectronBrowserClient::CreateWebSocket(
content::RenderFrameHost* frame,
WebSocketFactory factory,
const GURL& url,
const net::SiteForCookies& site_for_cookies,
const absl::optional<std::string>& user_agent,
mojo::PendingRemote<network::mojom::WebSocketHandshakeClient>
handshake_cli... | 0 | [] | electron | e9fa834757f41c0b9fe44a4dffe3d7d437f52d34 | 54,317,120,526,520,250,000,000,000,000,000,000,000 | 35 | fix: ensure ElectronBrowser mojo service is only bound to appropriate render frames (#33344)
* fix: ensure ElectronBrowser mojo service is only bound to authorized render frames
Notes: no-notes
* refactor: extract electron API IPC to its own mojo interface
* fix: just check main frame not primary main frame
... |
lyd_new_path_update(struct lyd_node *node, void *value, LYD_ANYDATA_VALUETYPE value_type, int dflt)
{
struct ly_ctx *ctx = node->schema->module->ctx;
struct lyd_node_anydata *any;
int len;
switch (node->schema->nodetype) {
case LYS_LEAF:
if (value_type > LYD_ANYDATA_STRING) {
LO... | 0 | [
"CWE-119"
] | libyang | 32fb4993bc8bb49e93e84016af3c10ea53964be5 | 333,082,909,937,774,450,000,000,000,000,000,000,000 | 117 | schema tree BUGFIX do not check features while still resolving schema
Fixes #723 |
static Image *ReadPNGImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
printf("Your PNG library is too old: You have libpng-%s\n",
PNG_LIBPNG_VER_STRING);
(void) ThrowMagickException(exception,GetMagickModule(),CoderError,
"PNG library is too old","`%s'",image_info->filename);
return(Im... | 0 | [
"CWE-476"
] | ImageMagick | 816ecab6c532ae086ff4186b3eaf4aa7092d536f | 269,342,324,084,422,970,000,000,000,000,000,000,000 | 11 | https://github.com/ImageMagick/ImageMagick/issues/58 |
LineBufferTask::execute ()
{
try
{
//
// Uncompress the data, if necessary
//
if (_lineBuffer->uncompressedData == 0)
{
size_t uncompressedSize = 0;
int maxY = min (_lineBuffer->maxY, _ifd->maxY);
for (int i = _lineBuffer->min... | 0 | [
"CWE-770"
] | openexr | bc88cdb6c97fbf5bc5d11ad8ca55306da931283a | 20,220,137,591,361,416,000,000,000,000,000,000,000 | 148 | sanity check ScanlineInput bytesPerLine instead of lineOffset size (#863)
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Co-authored-by: Cary Phillips <cary@ilm.com> |
static inline void arch_bprm_mm_init(struct mm_struct *mm,
struct vm_area_struct *vma)
{
mpx_mm_init(mm);
} | 0 | [
"CWE-362"
] | linux | 71b3c126e61177eb693423f2e18a1914205b165e | 94,948,324,681,841,160,000,000,000,000,000,000,000 | 5 | x86/mm: Add barriers and document switch_mm()-vs-flush synchronization
When switch_mm() activates a new PGD, it also sets a bit that
tells other CPUs that the PGD is in use so that TLB flush IPIs
will be sent. In order for that to work correctly, the bit
needs to be visible prior to loading the PGD and therefore
star... |
void blk_mq_freeze_queue(struct request_queue *q)
{
blk_mq_freeze_queue_start(q);
blk_mq_freeze_queue_wait(q);
} | 0 | [
"CWE-362",
"CWE-264"
] | linux | 0048b4837affd153897ed1222283492070027aa9 | 226,714,321,939,606,960,000,000,000,000,000,000,000 | 5 | 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. ... |
rsvg_filter_primitive_render (RsvgNode *node, RsvgFilterPrimitive *primitive, RsvgFilterContext *ctx)
{
primitive->render (node, primitive, ctx);
} | 0 | [
"CWE-369"
] | librsvg | ecf9267a24b2c3c0cd211dbdfa9ef2232511972a | 166,330,703,949,890,970,000,000,000,000,000,000,000 | 4 | bgo#783835 - Don't divide by zero in box_blur_line() for gaussian blurs
We were making the decision to use box blurs, instead of a true
Gaussian kernel, based on the size of *both* x and y dimensions. Do
them individually instead. |
static struct colinfo *get_column_info(int num)
{
return &infos[ get_column_id(num) ];
} | 0 | [
"CWE-552",
"CWE-703"
] | util-linux | 166e87368ae88bf31112a30e078cceae637f4cdb | 302,755,425,521,732,480,000,000,000,000,000,000,000 | 4 | libmount: remove support for deleted mount table entries
The "(deleted)" suffix has been originally used by kernel for deleted
mountpoints. Since kernel commit 9d4d65748a5ca26ea8650e50ba521295549bf4e3
(Dec 2014) kernel does not use this suffix for mount stuff in /proc at
all. Let's remove this support from libmount to... |
static void nap_check(int tile_cnt) {
time_t now;
nap_diff_count += tile_cnt;
if (! take_naps) {
return;
}
now = time(NULL);
if (screen_blank > 0) {
int dt_ev, dt_fbu;
static int ms = 0;
if (ms == 0) {
ms = 2000;
if (getenv("X11VNC_SB_FACTOR")) {
ms = ms * atof(getenv("X11VNC_SB_FACTOR"));
... | 0 | [
"CWE-862",
"CWE-284",
"CWE-732"
] | x11vnc | 69eeb9f7baa14ca03b16c9de821f9876def7a36a | 43,464,303,330,598,970,000,000,000,000,000,000,000 | 58 | scan: limit access to shared memory segments to current user |
tor_tls_free_all(void)
{
if (server_tls_context) {
tor_tls_context_t *ctx = server_tls_context;
server_tls_context = NULL;
tor_tls_context_decref(ctx);
}
if (client_tls_context) {
tor_tls_context_t *ctx = client_tls_context;
client_tls_context = NULL;
tor_tls_context_decref(ctx);
}
if ... | 0 | [
"CWE-264"
] | tor | 638fdedcf16cf7d6f7c586d36f7ef335c1c9714f | 99,512,240,918,484,290,000,000,000,000,000,000,000 | 23 | Don't send a certificate chain on outgoing TLS connections from non-relays |
DwaCompressor::uncompressTile
(const char *inPtr,
int inSize,
Imath::Box2i range,
const char *&outPtr)
{
return uncompress (inPtr, inSize, range, outPtr);
} | 0 | [
"CWE-284"
] | openexr | 49db4a4192482eec9c27669f75db144cf5434804 | 129,515,605,811,437,820,000,000,000,000,000,000,000 | 8 | Add additional input validation in an attempt to resolve issue #232 |
event_gamma_change( double delta )
{
int i;
double gamma_inv;
status.gamma += delta;
if ( status.gamma > 3.0 )
status.gamma = 3.0;
else if ( status.gamma < 0.1 )
status.gamma = 0.1;
sprintf( status.header_buffer, "gamma changed to %.1f", status.gamma );
status.header = sta... | 0 | [
"CWE-120"
] | freetype2-demos | b995299b73ba4cd259f221f500d4e63095508bec | 41,556,721,460,273,256,000,000,000,000,000,000,000 | 21 | Fix Savannah bug #30054.
* src/ftdiff.c, src/ftgrid.c, src/ftmulti.c, src/ftstring.c,
src/ftview.c: Use precision for `%s' where appropriate to avoid
buffer overflows. |
// [internal] Perform box filter with dirichlet boundary conditions.
CImg<T>& _blur_guided(const unsigned int psize) {
const int p1 = (int)psize/2, p2 = (int)psize - p1;
if (_depth!=1) {
CImg<floatT> cumul = get_cumulate('z'), cumul2 = cumul.get_shift(0,0,p2,0,1);
(cumul.shift(0,0,-p... | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 130,334,517,104,973,800,000,000,000,000,000,000,000 | 16 | Fix other issues in 'CImg<T>::load_bmp()'. |
static bool vmxnet3_vmstate_need_pcie_device(void *opaque)
{
VMXNET3State *s = VMXNET3(opaque);
return !(s->compat_flags & VMXNET3_COMPAT_FLAG_DISABLE_PCIE);
} | 0 | [
"CWE-416"
] | qemu | 6c352ca9b4ee3e1e286ea9e8434bd8e69ac7d0d8 | 110,111,937,151,128,420,000,000,000,000,000,000,000 | 6 | net: vmxnet3: check for device_active before write
Vmxnet3 device emulator does not check if the device is active,
before using it for write. It leads to a use after free issue,
if the vmxnet3_io_bar0_write routine is called after the device is
deactivated. Add check to avoid it.
Reported-by: Li Qiang <liqiang6-s@360... |
static void intel_hda_reset(DeviceState *dev)
{
BusChild *kid;
IntelHDAState *d = INTEL_HDA(dev);
HDACodecDevice *cdev;
intel_hda_regs_reset(d);
d->wall_base_ns = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
/* reset codecs */
QTAILQ_FOREACH(kid, &d->codecs.qbus.children, sibling) {
Dev... | 0 | [
"CWE-787"
] | qemu | 79fa99831debc9782087e834382c577215f2f511 | 268,304,366,877,505,480,000,000,000,000,000,000,000 | 18 | hw/audio/intel-hda: Restrict DMA engine to memories (not MMIO devices)
Issue #542 reports a reentrancy problem when the DMA engine accesses
the HDA controller I/O registers. Fix by restricting the DMA engine
to memories regions (forbidding MMIO devices such the HDA controller).
Reported-by: OSS-Fuzz (Issue 28435)
Rep... |
void ConnectionManagerImpl::onConnectionDurationTimeout() {
ENVOY_CONN_LOG(debug, "max connection duration reached", read_callbacks_->connection());
stats_.named_.downstream_cx_max_duration_reached_.inc();
if (!codec_) {
// Attempt to write out buffered data one last time and issue a local close if successful... | 0 | [
"CWE-22"
] | envoy | 5333b928d8bcffa26ab19bf018369a835f697585 | 132,683,521,037,799,500,000,000,000,000,000,000,000 | 12 | Implement handling of escaped slash characters in URL path
Fixes: CVE-2021-29492
Signed-off-by: Yan Avlasov <yavlasov@google.com> |
static int apparmor_path_mkdir(const struct path *dir, struct dentry *dentry,
umode_t mode)
{
return common_perm_create(OP_MKDIR, dir, dentry, AA_MAY_CREATE,
S_IFDIR);
} | 0 | [
"CWE-119",
"CWE-264",
"CWE-369"
] | linux | 30a46a4647fd1df9cf52e43bf467f0d9265096ca | 105,654,681,898,600,500,000,000,000,000,000,000,000 | 6 | apparmor: fix oops, validate buffer size in apparmor_setprocattr()
When proc_pid_attr_write() was changed to use memdup_user apparmor's
(interface violating) assumption that the setprocattr buffer was always
a single page was violated.
The size test is not strictly speaking needed as proc_pid_attr_write()
will reject... |
static uint16_t nvme_abort(NvmeCtrl *n, NvmeRequest *req)
{
uint16_t sqid = le32_to_cpu(req->cmd.cdw10) & 0xffff;
req->cqe.result = 1;
if (nvme_check_sqid(n, sqid)) {
return NVME_INVALID_FIELD | NVME_DNR;
}
return NVME_SUCCESS;
} | 0 | [] | qemu | 736b01642d85be832385063f278fe7cd4ffb5221 | 335,498,423,135,600,800,000,000,000,000,000,000,000 | 11 | hw/nvme: fix CVE-2021-3929
This fixes CVE-2021-3929 "locally" by denying DMA to the iomem of the
device itself. This still allows DMA to MMIO regions of other devices
(e.g. doing P2P DMA to the controller memory buffer of another NVMe
device).
Fixes: CVE-2021-3929
Reported-by: Qiuhao Li <Qiuhao.Li@outlook.com>
Review... |
void MessageCompressorManager::clientFinish(const BSONObj& input) {
auto elem = input.getField("compression");
LOG(3) << "Finishing client-side compreession negotiation";
// We've just called clientBegin, so the list of compressors should be empty.
invariant(_negotiated.empty());
// If the server ... | 0 | [] | mongo | 5ad69b851801edadbfde8fdf271f4ba7c21170b5 | 204,659,458,468,309,430,000,000,000,000,000,000,000 | 24 | SERVER-31273 Use Source/Sink version of snappy functions
(cherry picked from commit 59ead734faa8aa51f0c53bf2bd39d0a0247ddf99) |
int gdImageGetTrueColorPixel (gdImagePtr im, int x, int y)
{
int p = gdImageGetPixel(im, x, y);
if (!im->trueColor) {
return gdTrueColorAlpha(im->red[p], im->green[p], im->blue[p], (im->transparent == p) ? gdAlphaTransparent : im->alpha[p]);
} else {
return p;
}
} | 0 | [
"CWE-119"
] | php-src | e7f2356665c2569191a946b6fc35b437f0ae1384 | 134,397,036,792,275,030,000,000,000,000,000,000,000 | 10 | Fix #66387: Stack overflow with imagefilltoborder
The stack overflow is caused by the recursive algorithm in combination with a
very large negative coordinate passed to gdImageFillToBorder(). As there is
already a clipping for large positive coordinates to the width and height of
the image, it seems to be consequent t... |
static void gic_dist_writel(void *opaque, hwaddr offset,
uint32_t value, MemTxAttrs attrs)
{
GICState *s = (GICState *)opaque;
if (offset == 0xf00) {
int cpu;
int irq;
int mask;
int target_cpu;
cpu = gic_get_current_cpu(s);
irq = value... | 1 | [
"CWE-787"
] | qemu | edfe2eb4360cde4ed5d95bda7777edcb3510f76a | 224,330,149,160,443,950,000,000,000,000,000,000,000 | 40 | hw/intc/arm_gic: Fix interrupt ID in GICD_SGIR register
Per the ARM Generic Interrupt Controller Architecture specification
(document "ARM IHI 0048B.b (ID072613)"), the SGIINTID field is 4 bit,
not 10:
- 4.3 Distributor register descriptions
- 4.3.15 Software Generated Interrupt Register, GICD_SG
- Table 4-2... |
AP_DECLARE(void) ap_set_content_length(request_rec *r, apr_off_t clength)
{
r->clength = clength;
apr_table_setn(r->headers_out, "Content-Length",
apr_off_t_toa(r->pool, clength));
} | 0 | [
"CWE-703"
] | httpd | be0f5335e3e73eb63253b050fdc23f252f5c8ae3 | 120,962,433,732,258,410,000,000,000,000,000,000,000 | 6 | *) SECURITY: CVE-2015-0253 (cve.mitre.org)
core: Fix a crash introduced in with ErrorDocument 400 pointing
to a local URL-path with the INCLUDES filter active, introduced
in 2.4.11. PR 57531. [Yann Ylavic]
Submitted By: ylavic
Committed By: covener
git-svn-id: https://svn.apache.org/repos/asf/http... |
GF_Err split_isomedia_file(GF_ISOFile *mp4, Double split_dur, u64 split_size_kb, char *inName, Double InterleavingTime, Double chunk_start_time, u32 adjust_split_end, char *outName, Bool force_rap_split, const char *split_range_str, u32 fs_dump_flags)
{
Bool chunk_extraction, rap_split, split_until_end;
GF_Err e;
ch... | 0 | [
"CWE-787"
] | gpac | da37ec8582266983d0ec4b7550ec907401ec441e | 322,542,502,427,203,750,000,000,000,000,000,000,000 | 229 | fixed crashes for very long path - cf #1908 |
static ssize_t cm_show_counter(struct kobject *obj, struct attribute *attr,
char *buf)
{
struct cm_counter_group *group;
struct cm_counter_attribute *cm_attr;
group = container_of(obj, struct cm_counter_group, obj);
cm_attr = container_of(attr, struct cm_counter_attribute, attr);
return sprintf(buf, "%... | 0 | [
"CWE-20"
] | linux | b2853fd6c2d0f383dbdf7427e263eb576a633867 | 44,530,422,589,632,730,000,000,000,000,000,000,000 | 12 | IB/core: Don't resolve passive side RoCE L2 address in CMA REQ handler
The code that resolves the passive side source MAC within the rdma_cm
connection request handler was both redundant and buggy, so remove it.
It was redundant since later, when an RC QP is modified to RTR state,
the resolution will take place in th... |
TEST(FormatterTest, FormatFloat) {
EXPECT_EQ("392.500000", format("{0:f}", 392.5f));
} | 0 | [
"CWE-134",
"CWE-119",
"CWE-787"
] | fmt | 8cf30aa2be256eba07bb1cefb998c52326e846e7 | 118,888,828,929,919,230,000,000,000,000,000,000,000 | 3 | Fix segfault on complex pointer formatting (#642) |
static inline int tcp_bound_to_half_wnd(struct tcp_sock *tp, int pktsize)
{
int cutoff;
/* When peer uses tiny windows, there is no use in packetizing
* to sub-MSS pieces for the sake of SWS or making sure there
* are enough packets in the pipe for fast recovery.
*
* On the other hand, for extremely large MS... | 0 | [] | linux | 7bced397510ab569d31de4c70b39e13355046387 | 211,784,602,163,277,400,000,000,000,000,000,000,000 | 21 | net_dma: simple removal
Per commit "77873803363c net_dma: mark broken" net_dma is no longer used
and there is no plan to fix it.
This is the mechanical removal of bits in CONFIG_NET_DMA ifdef guards.
Reverting the remainder of the net_dma induced changes is deferred to
subsequent patches.
Marked for stable due to Ro... |
int jas_stream_read(jas_stream_t *stream, void *buf, int cnt)
{
int n;
int c;
char *bufptr;
if (cnt < 0) {
jas_deprecated("negative count for jas_stream_read");
}
bufptr = buf;
n = 0;
while (n < cnt) {
if ((c = jas_stream_getc(stream)) == EOF) {
return n;
}
*bufptr++ = c;
++n;
}
return n;
} | 0 | [
"CWE-415",
"CWE-190",
"CWE-369"
] | jasper | 634ce8e8a5accc0fa05dd2c20d42b4749d4b2735 | 134,140,787,506,157,700,000,000,000,000,000,000,000 | 23 | Made some changes to the I/O stream library for memory streams.
There were a number of potential problems due to the possibility
of integer overflow.
Changed some integral types to the larger types size_t or ssize_t.
For example, the function mem_resize now takes the buffer size parameter
as a size_t.
Added a new funct... |
sig_to_datum(gnutls_datum_t * r_sig, cdk_pkt_signature_t sig)
{
int err;
cdk_error_t rc;
if (!r_sig || !sig)
return CDK_Inv_Value;
rc = 0;
if (is_RSA(sig->pubkey_algo)) {
err = _gnutls_mpi_dprint(sig->mpi[0], r_sig);
if (err < 0)
rc = map_gnutls_error(err);
} else if (is_DSA(sig->pubkey_algo)) {
err ... | 0 | [
"CWE-119"
] | gnutls | 5140422e0d7319a8e2fe07f02cbcafc4d6538732 | 108,176,411,122,154,400,000,000,000,000,000,000,000 | 22 | opencdk: cdk_pk_get_keyid: fix stack overflow
Issue found using oss-fuzz:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=340
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com> |
char * pgpHexStr(const uint8_t *p, size_t plen)
{
char *t, *str;
str = t = xmalloc(plen * 2 + 1);
static char const hex[] = "0123456789abcdef";
while (plen-- > 0) {
size_t i;
i = *p++;
*t++ = hex[ (i >> 4) & 0xf ];
*t++ = hex[ (i ) & 0xf ];
}
*t = '\0';
return str;
} | 0 | [
"CWE-347",
"CWE-284"
] | rpm | bd36c5dc9fb6d90c46fbfed8c2d67516fc571ec8 | 94,513,024,749,174,570,000,000,000,000,000,000,000 | 14 | Validate and require subkey binding signatures on PGP public keys
All subkeys must be followed by a binding signature by the primary key
as per the OpenPGP RFC, enforce the presence and validity in the parser.
The implementation is as kludgey as they come to work around our
simple-minded parser structure without touc... |
static void rd_release_device_space(struct rd_dev *rd_dev)
{
u32 page_count;
if (!rd_dev->sg_table_array || !rd_dev->sg_table_count)
return;
page_count = rd_release_sgl_table(rd_dev, rd_dev->sg_table_array,
rd_dev->sg_table_count);
pr_debug("CORE_RD[%u] - Released device space for Ramdisk"
" Device ID... | 0 | [
"CWE-200",
"CWE-264"
] | linux | 4442dc8a92b8f9ad8ee9e7f8438f4c04c03a22dc | 208,020,439,156,167,780,000,000,000,000,000,000,000 | 18 | target/rd: Refactor rd_build_device_space + rd_release_device_space
This patch refactors rd_build_device_space() + rd_release_device_space()
into rd_allocate_sgl_table() + rd_release_device_space() so that they
may be used seperatly for setup + release of protection information
scatterlists.
Also add explicit memset ... |
static void event_ping(IRC_SERVER_REC *server, const char *data)
{
char *params, *origin, *target, *str;
params = event_get_params(data, 2, &origin, &target);
str = *target == '\0' ? g_strconcat("PONG :", origin, NULL) :
g_strdup_printf("PONG %s :%s", target, origin);
irc_send_cmd_now(server, str);
g_fre... | 0 | [
"CWE-416"
] | irssi | 43e44d553d44e313003cee87e6ea5e24d68b84a1 | 334,944,771,363,607,400,000,000,000,000,000,000,000 | 11 | Merge branch 'security' into 'master'
Security
Closes GL#12, GL#13, GL#14, GL#15, GL#16
See merge request irssi/irssi!23 |
unsigned short gr_face_n_glyphs(const gr_face* pFace)
{
return pFace->glyphs().numGlyphs();
} | 0 | [
"CWE-476"
] | graphite | db132b4731a9b4c9534144ba3a18e65b390e9ff6 | 306,255,337,381,579,500,000,000,000,000,000,000,000 | 4 | Deprecate and make ineffective gr_face_dumbRendering |
static ssize_t ucma_resolve_route(struct ucma_file *file,
const char __user *inbuf,
int in_len, int out_len)
{
struct rdma_ucm_resolve_route cmd;
struct ucma_context *ctx;
int ret;
if (copy_from_user(&cmd, inbuf, sizeof(cmd)))
return -EFAULT;
ctx = ucma_get_ctx_dev(file, cmd.id);
if (IS_ERR(ctx))
... | 0 | [
"CWE-416",
"CWE-703"
] | linux | cb2595c1393b4a5211534e6f0a0fbad369e21ad8 | 137,903,258,586,068,920,000,000,000,000,000,000,000 | 19 | infiniband: fix a possible use-after-free bug
ucma_process_join() will free the new allocated "mc" struct,
if there is any error after that, especially the copy_to_user().
But in parallel, ucma_leave_multicast() could find this "mc"
through idr_find() before ucma_process_join() frees it, since it
is already published... |
void NumberFormatTest::Test11020_RoundingInScientificNotation() {
UErrorCode status = U_ZERO_ERROR;
DecimalFormatSymbols sym(Locale::getFrance(), status);
DecimalFormat fmt(u"0.05E0", sym, status);
if (!assertSuccess("", status, true, __FILE__, __LINE__)) { return; }
assertSuccess("", status);
U... | 0 | [
"CWE-190"
] | icu | 53d8c8f3d181d87a6aa925b449b51c4a2c922a51 | 71,822,812,785,519,400,000,000,000,000,000,000,000 | 10 | ICU-20246 Fixing another integer overflow in number parsing. |
static bool snd_ctl_remove_numid_conflict(struct snd_card *card,
unsigned int count)
{
struct snd_kcontrol *kctl;
list_for_each_entry(kctl, &card->controls, list) {
if (kctl->id.numid < card->last_numid + 1 + count &&
kctl->id.numid + kctl->count > card->last_numid + 1) {
card->last_numid = kct... | 1 | [
"CWE-190",
"CWE-189"
] | linux | ac902c112d90a89e59916f751c2745f4dbdbb4bd | 243,722,487,310,844,000,000,000,000,000,000,000,000 | 14 | ALSA: control: Handle numid overflow
Each control gets automatically assigned its numids when the control is created.
The allocation is done by incrementing the numid by the amount of allocated
numids per allocation. This means that excessive creation and destruction of
controls (e.g. via SNDRV_CTL_IOCTL_ELEM_ADD/REMO... |
static ZIPARCHIVE_METHOD(extractTo)
{
struct zip *intern;
zval *this = getThis();
zval *zval_files = NULL;
zval **zval_file = NULL;
php_stream_statbuf ssb;
char *pathto;
int pathto_len;
int ret, i;
int nelems;
if (!this) {
RETURN_FALSE;
}
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z", &pa... | 1 | [] | php-src | ce96fd6b0761d98353761bf78d5bfb55291179fd | 200,114,085,739,385,770,000,000,000,000,000,000,000 | 83 | - 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 |
static int io_timeout_cancel(struct io_ring_ctx *ctx, __u64 user_data)
{
struct io_kiocb *req;
int ret = -ENOENT;
list_for_each_entry(req, &ctx->timeout_list, timeout.list) {
if (user_data == req->user_data) {
ret = 0;
break;
}
}
if (ret == -ENOENT)
return ret;
return __io_timeout_cancel(req);
} | 0 | [] | linux | 0f2122045b946241a9e549c2a76cea54fa58a7ff | 59,919,743,255,615,910,000,000,000,000,000,000,000 | 17 | io_uring: don't rely on weak ->files references
Grab actual references to the files_struct. To avoid circular references
issues due to this, we add a per-task note that keeps track of what
io_uring contexts a task has used. When the tasks execs or exits its
assigned files, we cancel requests based on this tracking.
W... |
sc_awp_parse_df(struct sc_pkcs15_card *p15card, struct sc_pkcs15_df *df)
{
struct sc_context *ctx = p15card->card->ctx;
unsigned char *buf = NULL;
size_t buf_len;
int rv;
LOG_FUNC_CALLED(ctx);
if (df->type != SC_PKCS15_PRKDF && df->type != SC_PKCS15_DODF)
LOG_FUNC_RETURN(ctx, SC_ERROR_NOT_SUPPORTED);
if (df-... | 0 | [
"CWE-787"
] | OpenSC | 6903aebfddc466d966c7b865fae34572bf3ed23e | 55,332,694,305,653,860,000,000,000,000,000,000,000 | 30 | Heap-buffer-overflow WRITE
fixes https://oss-fuzz.com/testcase-detail/5088104168554496 |
CImgDisplay& set_button(const unsigned int button, const bool is_pressed=true) {
const unsigned int buttoncode = button==1U?1U:button==2U?2U:button==3U?4U:0U;
if (is_pressed) _button |= buttoncode; else _button &= ~buttoncode;
_is_event = buttoncode?true:false;
if (buttoncode) {
#if cimg_dis... | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 328,553,777,482,816,660,000,000,000,000,000,000,000 | 13 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
parse_json_message(
char *s)
{
int i;
int len = strlen(s);
GPtrArray *message_array = g_ptr_array_sized_new(100);
char *token;
message_t *message = NULL;
gboolean expect_key = TRUE;
char *key = NULL;
int nb_arg = 0;
for (i = 0; i < len && s[i] != '\0'; i++) {
char c = s[i];
... | 0 | [
"CWE-77"
] | amanda | 29bae2e271093cd8d06ea98f73a474c685c5a314 | 279,830,001,740,694,600,000,000,000,000,000,000,000 | 201 | * application-src/ambsdtar.c, application-src/amgtar.c,
application-src/amstar.c: Filter option from COMMAND-OPTIONS
* common-src/ammessage.c: Add message.
git-svn-id: https://svn.code.sf.net/p/amanda/code/amanda/trunk@6483 a8d146d6-cc15-0410-8900-af154a0219e0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.