func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
struct powercap_zone *powercap_register_zone(
struct powercap_zone *power_zone,
struct powercap_control_type *control_type,
const char *name,
struct powercap_zone *parent,
const struct powercap_zone_ops *ops,
int nr_constraints,
const struct powercap_zone_constraint_ops *const_ops)
{
int result;
... | 0 | [] | linux | 949dd0104c496fa7c14991a23c03c62e44637e71 | 212,365,183,296,266,870,000,000,000,000,000,000,000 | 100 | powercap: restrict energy meter to root access
Remove non-privileged user access to power data contained in
/sys/class/powercap/intel-rapl*/*/energy_uj
Non-privileged users currently have read access to power data and can
use this data to form a security attack. Some privileged
drivers/applications need read access t... |
int SSL_set_session(SSL *s, SSL_SESSION *session)
{
int ret = 0;
const SSL_METHOD *meth;
if (session != NULL) {
meth = s->ctx->method->get_ssl_method(session->ssl_version);
if (meth == NULL)
meth = s->method->get_ssl_method(session->ssl_version);
if (meth == NULL) {
... | 0 | [
"CWE-362"
] | openssl | 939b4960276b040fc0ed52232238fcc9e2e9ec21 | 218,451,218,180,577,870,000,000,000,000,000,000,000 | 52 | Fix race condition in NewSessionTicket
If a NewSessionTicket is received by a multi-threaded client when
attempting to reuse a previous ticket then a race condition can occur
potentially leading to a double free of the ticket data.
CVE-2015-1791
This also fixes RT#3808 where a session ID is changed for a session alr... |
static int raw_setsockopt(struct sock *sk, int level, int optname,
char __user *optval, unsigned int optlen)
{
return -EOPNOTSUPP;
} | 0 | [
"CWE-276"
] | linux | e69dbd4619e7674c1679cba49afd9dd9ac347eef | 172,243,941,882,102,630,000,000,000,000,000,000,000 | 5 | ieee802154: enforce CAP_NET_RAW for raw sockets
When creating a raw AF_IEEE802154 socket, CAP_NET_RAW needs to be
checked first.
Signed-off-by: Ori Nimron <orinimron123@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Stefan Schmidt <stefan@datenfreihafen.org>
Signed-off-by: David S... |
static void ok_stdlib_free(void *user_data, void *memory) {
(void)user_data;
free(memory);
} | 0 | [
"CWE-787"
] | ok-file-formats | a9cc1711dd4ed6a215038f1c5c03af0ef52c3211 | 289,181,882,838,471,900,000,000,000,000,000,000,000 | 4 | ok_jpg: Fix invalid DHT (#11) |
Binary::it_sections Binary::sections() {
return sections_;
} | 0 | [
"CWE-703"
] | LIEF | 7acf0bc4224081d4f425fcc8b2e361b95291d878 | 20,384,129,792,034,782,000,000,000,000,000,000,000 | 3 | Resolve #764 |
static int __init setup_schedstats(char *str)
{
int ret = 0;
if (!str)
goto out;
if (!strcmp(str, "enable")) {
set_schedstats(true);
ret = 1;
} else if (!strcmp(str, "disable")) {
set_schedstats(false);
ret = 1;
}
out:
if (!ret)
pr_warn("Unable to parse schedstats=\n");
return ret;
} | 0 | [
"CWE-119"
] | linux | 29d6455178a09e1dc340380c582b13356227e8df | 286,433,310,480,342,970,000,000,000,000,000,000,000 | 19 | sched: panic on corrupted stack end
Until now, hitting this BUG_ON caused a recursive oops (because oops
handling involves do_exit(), which calls into the scheduler, which in
turn raises an oops), which caused stuff below the stack to be
overwritten until a panic happened (e.g. via an oops in interrupt
context, cause... |
nghttp2_stream *nghttp2_session_find_stream(nghttp2_session *session,
int32_t stream_id) {
if (stream_id == 0) {
return &session->root;
}
return nghttp2_session_get_stream_raw(session, stream_id);
} | 0 | [] | nghttp2 | 0a6ce87c22c69438ecbffe52a2859c3a32f1620f | 25,794,259,143,994,883,000,000,000,000,000,000,000 | 8 | Add nghttp2_option_set_max_outbound_ack |
int InstanceKlass::find_method_by_name(const Array<Method*>* methods,
const Symbol* name,
int* end_ptr) {
assert(end_ptr != NULL, "just checking");
int start = quick_search(methods, name);
int end = start + 1;
if (start != -1) {
w... | 0 | [] | jdk17u | f8eb9abe034f7c6bea4da05a9ea42017b3f80730 | 200,296,582,015,805,660,000,000,000,000,000,000,000 | 14 | 8270386: Better verification of scan methods
Reviewed-by: coleenp
Backport-of: ac329cef45979bd0159ecd1347e36f7129bb2ce4 |
static char *lxc_cgroup_get_hierarchy_abs_path_data(const char *subsystem, struct cgfs_data *d)
{
struct cgroup_process_info *info = d->info;
struct cgroup_mount_point *mp = NULL;
info = find_info_for_subsystem(info, subsystem);
if (!info)
return NULL;
if (info->designated_mount_point) {
mp = info->designated... | 0 | [
"CWE-59",
"CWE-61"
] | lxc | 592fd47a6245508b79fe6ac819fe6d3b2c1289be | 298,730,983,105,356,860,000,000,000,000,000,000,000 | 17 | CVE-2015-1335: Protect container mounts against symlinks
When a container starts up, lxc sets up the container's inital fstree
by doing a bunch of mounting, guided by the container configuration
file. The container config is owned by the admin or user on the host,
so we do not try to guard against bad entries. Howev... |
TEST_F(QueryPlannerTest, ElemMatchIndexedNestedNor) {
addIndex(BSON("bar.baz" << 1));
runQuery(fromjson("{foo: 1, $and: [{bar: {$elemMatch: {$nor: [{baz: 2}, {baz: 3}]}}}]}"));
assertNumSolutions(1U);
assertSolutionExists("{cscan: {dir: 1}}");
} | 0 | [
"CWE-834"
] | mongo | 94d0e046baa64d1aa1a6af97e2d19bb466cc1ff5 | 131,385,666,474,999,590,000,000,000,000,000,000 | 7 | SERVER-38164 $or pushdown optimization does not correctly handle $not within an $elemMatch |
static inline void fpstate_init_fxstate(struct fxregs_state *fx)
{
fx->cwd = 0x37f;
fx->mxcsr = MXCSR_DEFAULT;
} | 0 | [
"CWE-119",
"CWE-732",
"CWE-787"
] | linux | 59c4bd853abcea95eccc167a7d7fd5f1a5f47b98 | 24,459,175,482,407,420,000,000,000,000,000,000,000 | 5 | x86/fpu: Don't cache access to fpu_fpregs_owner_ctx
The state/owner of the FPU is saved to fpu_fpregs_owner_ctx by pointing
to the context that is currently loaded. It never changed during the
lifetime of a task - it remained stable/constant.
After deferred FPU registers loading until return to userland was
implement... |
static int sisusb_setidxregmask(struct sisusb_usb_data *sisusb,
int port, u8 idx, u8 data, u8 mask)
{
int ret;
u8 tmp;
ret = sisusb_write_memio_byte(sisusb, SISUSB_TYPE_IO, port, idx);
ret |= sisusb_read_memio_byte(sisusb, SISUSB_TYPE_IO, port + 1, &tmp);
tmp &= ~(mask);
tmp |= (data & mask);
ret |= sisusb_wr... | 0 | [
"CWE-476"
] | linux | 9a5729f68d3a82786aea110b1bfe610be318f80a | 304,816,735,397,262,200,000,000,000,000,000,000,000 | 13 | USB: sisusbvga: fix oops in error path of sisusb_probe
The pointer used to log a failure of usb_register_dev() must
be set before the error is logged.
v2: fix that minor is not available before registration
Signed-off-by: oliver Neukum <oneukum@suse.com>
Reported-by: syzbot+a0cbdbd6d169020c8959@syzkaller.appspotmail... |
int tls1_set_sigalgs(CERT *c, const int *psig_nids, size_t salglen, int client)
{
uint16_t *sigalgs, *sptr;
size_t i;
if (salglen & 1)
return 0;
if ((sigalgs = OPENSSL_malloc((salglen / 2) * sizeof(*sigalgs))) == NULL) {
SSLerr(SSL_F_TLS1_SET_SIGALGS, ERR_R_MALLOC_FAILURE);
retu... | 0 | [
"CWE-476"
] | openssl | 5235ef44b93306a14d0b6c695b13c64b16e1fdec | 108,221,199,969,758,140,000,000,000,000,000,000,000 | 45 | Fix SSL_check_chain()
The function SSL_check_chain() can be used by applications to check that
a cert and chain is compatible with the negotiated parameters. This could
be useful (for example) from the certificate callback. Unfortunately this
function was applying TLSv1.2 sig algs rules and did not work correctly if
T... |
static int add_new_disk(struct mddev *mddev, mdu_disk_info_t *info)
{
char b[BDEVNAME_SIZE], b2[BDEVNAME_SIZE];
struct md_rdev *rdev;
dev_t dev = MKDEV(info->major,info->minor);
if (mddev_is_clustered(mddev) &&
!(info->state & ((1 << MD_DISK_CLUSTER_ADD) | (1 << MD_DISK_CANDIDATE)))) {
pr_err("%s: Cannot add t... | 0 | [
"CWE-200"
] | linux | b6878d9e03043695dbf3fa1caa6dfc09db225b16 | 213,970,416,245,319,120,000,000,000,000,000,000,000 | 181 | md: use kzalloc() when bitmap is disabled
In drivers/md/md.c get_bitmap_file() uses kmalloc() for creating a
mdu_bitmap_file_t called "file".
5769 file = kmalloc(sizeof(*file), GFP_NOIO);
5770 if (!file)
5771 return -ENOMEM;
This structure is copied to user space at the end of the fun... |
static URI_INLINE UriBool URI_FUNC(PushPathSegment)(
URI_TYPE(ParserState) * state, const URI_CHAR * first,
const URI_CHAR * afterLast, UriMemoryManager * memory) {
URI_TYPE(PathSegment) * segment = memory->calloc(memory, 1, sizeof(URI_TYPE(PathSegment)));
if (segment == NULL) {
return URI_FALSE; /* Raises mall... | 0 | [
"CWE-125"
] | uriparser | cef25028de5ff872c2e1f0a6c562eb3ea9ecbce4 | 67,349,601,496,821,550,000,000,000,000,000,000,000 | 28 | Fix uriParse*Ex* out-of-bounds read |
Word wasi_unstable_fd_closeHandler(void*, Word) { throw WasmException("wasi_unstable fd_close"); } | 0 | [
"CWE-476"
] | envoy | 8788a3cf255b647fd14e6b5e2585abaaedb28153 | 172,256,957,790,021,740,000,000,000,000,000,000,000 | 1 | 1.4 - Do not call into the VM unless the VM Context has been created. (#24)
* Ensure that the in VM Context is created before onDone is called.
Signed-off-by: John Plevyak <jplevyak@gmail.com>
* Update as per offline discussion.
Signed-off-by: John Plevyak <jplevyak@gmail.com>
* Set in_vm_context_created_ in onNet... |
sds genRedisInfoString(const char *section) {
sds info = sdsempty();
time_t uptime = server.unixtime-server.stat_starttime;
int j;
struct rusage self_ru, c_ru;
int allsections = 0, defsections = 0, everything = 0, modules = 0;
int sections = 0;
if (section == NULL) section = "default";
... | 0 | [
"CWE-770"
] | redis | 5674b0057ff2903d43eaff802017eddf37c360f8 | 13,430,573,553,345,370,000,000,000,000,000,000,000 | 605 | Prevent unauthenticated client from easily consuming lots of memory (CVE-2021-32675)
This change sets a low limit for multibulk and bulk length in the
protocol for unauthenticated connections, so that they can't easily
cause redis to allocate massive amounts of memory by sending just a few
characters on the network.
T... |
read_viminfo_filemark(vir_T *virp, int force)
{
char_u *str;
xfmark_T *namedfm_p = get_namedfm();
xfmark_T *fm;
int i;
// We only get here if line[0] == '\'' or '-'.
// Illegal mark names are ignored (for future expansion).
str = virp->vir_line + 1;
if (
#ifndef EBCDIC
*str <= 127... | 0 | [
"CWE-416"
] | vim | 9f1a39a5d1cd7989ada2d1cb32f97d84360e050f | 194,858,547,901,076,300,000,000,000,000,000,000,000 | 54 | patch 8.2.4040: keeping track of allocated lines is too complicated
Problem: Keeping track of allocated lines in user functions is too
complicated.
Solution: Instead of freeing individual lines keep them all until the end. |
void nfs_pageio_init_write(struct nfs_pageio_descriptor *pgio,
struct inode *inode, int ioflags,
const struct nfs_pgio_completion_ops *compl_ops)
{
nfs_pageio_init(pgio, inode, &nfs_pageio_write_ops, compl_ops,
NFS_SERVER(inode)->wsize, ioflags);
} | 0 | [] | linux | c7559663e42f4294ffe31fe159da6b6a66b35d61 | 212,596,702,532,395,230,000,000,000,000,000,000,000 | 7 | NFS: Allow nfs_updatepage to extend a write under additional circumstances
Currently nfs_updatepage allows a write to be extended to cover a full
page only if we don't have a byte range lock lock on the file... but if
we have a write delegation on the file or if we have the whole file
locked for writing then we should... |
static bool validate_runtime_directory(pam_handle_t *handle, const char *path, uid_t uid) {
struct stat st;
assert(path);
/* Just some extra paranoia: let's not set $XDG_RUNTIME_DIR if the directory we'd set it to isn't actually set
* up properly for us. */
if (lstat(path, &s... | 0 | [
"CWE-863"
] | systemd | 83d4ab55336ff8a0643c6aa627b31e351a24040a | 234,599,359,696,375,700,000,000,000,000,000,000,000 | 29 | pam-systemd: use secure_getenv() rather than getenv()
And explain why in a comment. |
int init()
{
return init_dynamic_array(&file_names, sizeof(File_name_record),
100, 100);
} | 0 | [
"CWE-284",
"CWE-295"
] | mysql-server | 3bd5589e1a5a93f9c224badf983cd65c45215390 | 140,326,708,863,855,180,000,000,000,000,000,000,000 | 5 | WL#6791 : Redefine client --ssl option to imply enforced encryption
# Changed the meaning of the --ssl=1 option of all client binaries
to mean force ssl, not try ssl and fail over to eunecrypted
# Added a new MYSQL_OPT_SSL_ENFORCE mysql_options()
option to specify that an ssl connection is required.
# Added a new macr... |
static int piv_match_card_continued(sc_card_t *card)
{
int i;
int type = -1;
piv_private_data_t *priv = NULL;
int saved_type = card->type;
/* Since we send an APDU, the card's logout function may be called...
* however it may be in dirty memory */
card->ops->logout = NULL;
/* piv_match_card may be called wi... | 1 | [
"CWE-125"
] | OpenSC | 8fe377e93b4b56060e5bbfb6f3142ceaeca744fa | 279,949,965,953,748,440,000,000,000,000,000,000,000 | 150 | fixed out of bounds reads
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting and suggesting security fixes. |
static int replmd_replicated_apply_search_callback(struct ldb_request *req,
struct ldb_reply *ares)
{
struct replmd_replicated_request *ar = talloc_get_type(req->context,
struct replmd_replicated_request);
int ret;
if (!ares) {
return ldb_module_done(ar->req, NULL, NULL,
LDB_ERR_OPERATIO... | 0 | [
"CWE-200"
] | samba | 0a3aa5f908e351201dc9c4d4807b09ed9eedff77 | 250,697,033,432,985,300,000,000,000,000,000,000,000 | 184 | 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... |
void gf_isom_cenc_get_default_info_internal(GF_TrackBox *trak, u32 sampleDescriptionIndex, u32 *container_type, Bool *default_IsEncrypted, u8 *crypt_byte_block, u8 *skip_byte_block, const u8 **key_info, u32 *key_info_size)
{
GF_ProtectionSchemeInfoBox *sinf;
//setup all default as not encrypted
if (default_IsEncry... | 1 | [
"CWE-476"
] | gpac | 3b84ffcbacf144ce35650df958432f472b6483f8 | 294,092,012,517,353,470,000,000,000,000,000,000,000 | 93 | fixed #1735 |
GF_Err tfhd_box_size(GF_Box *s)
{
GF_TrackFragmentHeaderBox *ptr = (GF_TrackFragmentHeaderBox *)s;
ptr->size += 4;
//The rest depends on the flags
if (ptr->flags & GF_ISOM_TRAF_BASE_OFFSET) ptr->size += 8;
if (ptr->flags & GF_ISOM_TRAF_SAMPLE_DESC) ptr->size += 4;
if (ptr->flags & GF_ISOM_TRAF_SAMPLE_DUR) ptr->s... | 0 | [
"CWE-787"
] | gpac | 388ecce75d05e11fc8496aa4857b91245007d26e | 26,634,209,588,716,246,000,000,000,000,000,000,000 | 13 | fixed #1587 |
TEST(AsyncSSLSocketTest, WriteError) {
// Start listening on a local port
WriteCallbackBase writeCallback;
WriteErrorCallback readCallback(&writeCallback);
HandshakeCallback handshakeCallback(&readCallback);
SSLServerAcceptCallback acceptCallback(&handshakeCallback);
TestSSLServer server(&acceptCallback);
... | 0 | [
"CWE-125"
] | folly | c321eb588909646c15aefde035fd3133ba32cdee | 196,868,828,322,721,170,000,000,000,000,000,000,000 | 25 | Handle close_notify as standard writeErr in AsyncSSLSocket.
Summary: Fixes CVE-2019-11934
Reviewed By: mingtaoy
Differential Revision: D18020613
fbshipit-source-id: db82bb250e53f0d225f1280bd67bc74abd417836 |
GF_Err pdin_box_size(GF_Box *s)
{
GF_ProgressiveDownloadBox *ptr = (GF_ProgressiveDownloadBox *)s;
ptr->size += 8*ptr->count;
return GF_OK; | 0 | [
"CWE-787"
] | gpac | 388ecce75d05e11fc8496aa4857b91245007d26e | 158,133,442,371,709,200,000,000,000,000,000,000,000 | 6 | fixed #1587 |
selaGetCombName(SELA *sela,
l_int32 size,
l_int32 direction)
{
char *selname;
char combname[L_BUF_SIZE];
l_int32 i, nsels, sx, sy, found;
SEL *sel;
PROCNAME("selaGetCombName");
if (!sela)
return (char *)ERROR_PTR("sela not defined", procName, NULL);
... | 1 | [
"CWE-119",
"CWE-787"
] | leptonica | ee301cb2029db8a6289c5295daa42bba7715e99a | 264,890,769,183,215,360,000,000,000,000,000,000,000 | 41 | 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(). |
static int generate_key(void)
{
sc_apdu_t apdu;
u8 sbuf[4];
u8 p2;
int r;
switch (opt_mod_length) {
case 512:
p2 = 0x40;
break;
case 768:
p2 = 0x60;
break;
case 1024:
p2 = 0x80;
break;
case 2048:
p2 = 0x00;
break;
default:
fprintf(stderr, "Invalid modulus length.\n");
return 2;
}
sc_for... | 0 | [
"CWE-415",
"CWE-119"
] | OpenSC | 360e95d45ac4123255a4c796db96337f332160ad | 360,811,893,345,981,960,000,000,000,000,000,000 | 56 | fixed out of bounds writes
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting the problems. |
load_cu_tu_indexes (void *file)
{
/* If we have already loaded (or tried to load) the CU and TU indexes
then do not bother to repeat the task. */
if (cu_tu_indexes_read == -1)
{
cu_tu_indexes_read = true;
if (load_debug_section_with_follow (dwp_cu_index, file))
if (! process_cu_tu_index (&de... | 0 | [
"CWE-703"
] | binutils-gdb | 695c6dfe7e85006b98c8b746f3fd5f913c94ebff | 250,311,829,986,159,740,000,000,000,000,000,000,000 | 19 | PR29370, infinite loop in display_debug_abbrev
The PR29370 testcase is a fuzzed object file with multiple
.trace_abbrev sections. Multiple .trace_abbrev or .debug_abbrev
sections are not a violation of the DWARF standard. The DWARF5
standard even gives an example of multiple .debug_abbrev sections
contained in group... |
static inline void membarrier_arch_switch_mm(struct mm_struct *prev,
struct mm_struct *next,
struct task_struct *tsk)
{
} | 0 | [
"CWE-362",
"CWE-703",
"CWE-667"
] | linux | 04f5866e41fb70690e28397487d8bd8eea7d712a | 313,424,038,846,831,400,000,000,000,000,000,000,000 | 5 | coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping
The core dumping code has always run without holding the mmap_sem for
writing, despite that is the only way to ensure that the entire vma
layout will not change from under it. Only using some signal
serialization on the processes bel... |
MagickExport MagickBooleanType IsHistogramImage(const Image *image,
ExceptionInfo *exception)
{
#define MaximumUniqueColors 1024
assert(image != (Image *) NULL);
assert(image->signature == MagickCoreSignature);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image-... | 0 | [
"CWE-190"
] | ImageMagick | 94691f00839dbdf43edb1508af945ab19b388573 | 137,413,537,204,316,000,000,000,000,000,000,000,000 | 11 | https://github.com/ImageMagick/ImageMagick/issues/1750 |
static int compare_DomainInfo(struct lsa_DomainInfo *e1, struct lsa_DomainInfo *e2)
{
return strcasecmp_m(e1->name.string, e2->name.string);
} | 0 | [
"CWE-200"
] | samba | 0a3aa5f908e351201dc9c4d4807b09ed9eedff77 | 303,975,819,140,272,740,000,000,000,000,000,000,000 | 4 | 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... |
struct posix_acl *reiserfs_get_acl(struct inode *inode, int type)
{
char *name, *value;
struct posix_acl *acl;
int size;
int retval;
switch (type) {
case ACL_TYPE_ACCESS:
name = XATTR_NAME_POSIX_ACL_ACCESS;
break;
case ACL_TYPE_DEFAULT:
name = XATTR_NAME_POSIX_ACL_DEFAULT;
break;
default:
BUG();
}
... | 0 | [
"CWE-862",
"CWE-285"
] | linux | 073931017b49d9458aa351605b43a7e34598caef | 322,527,631,168,190,500,000,000,000,000,000,000,000 | 45 | posix_acl: Clear SGID bit when setting file permissions
When file permissions are modified via chmod(2) and the user is not in
the owning group or capable of CAP_FSETID, the setgid bit is cleared in
inode_change_ok(). Setting a POSIX ACL via setxattr(2) sets the file
permissions as well as the new ACL, but doesn't cl... |
add_nsec(dns_db_t *db, dns_dbversion_t *version, dns_name_t *name,
dns_dbnode_t *node, dns_ttl_t ttl, bool bottom,
dns_diff_t *diff)
{
dns_fixedname_t fixed;
dns_name_t *next;
dns_rdata_t rdata = DNS_RDATA_INIT;
isc_result_t result;
unsigned char nsecbuffer[DNS_NSEC_BUFFERSIZE];
next = dns_fixedname_initname... | 0 | [
"CWE-327"
] | bind9 | f09352d20a9d360e50683cd1d2fc52ccedcd77a0 | 179,025,996,790,226,630,000,000,000,000,000,000,000 | 20 | Update keyfetch_done compute_tag check
If in keyfetch_done the compute_tag fails (because for example the
algorithm is not supported), don't crash, but instead ignore the
key. |
static inline void xfrm_dev_state_delete(struct xfrm_state *x)
{
struct xfrm_state_offload *xso = &x->xso;
if (xso->dev)
xso->dev->xfrmdev_ops->xdo_dev_state_delete(x);
} | 0 | [
"CWE-416"
] | linux | dbb2483b2a46fbaf833cfb5deb5ed9cace9c7399 | 248,631,688,424,413,420,000,000,000,000,000,000,000 | 7 | xfrm: clean up xfrm protocol checks
In commit 6a53b7593233 ("xfrm: check id proto in validate_tmpl()")
I introduced a check for xfrm protocol, but according to Herbert
IPSEC_PROTO_ANY should only be used as a wildcard for lookup, so
it should be removed from validate_tmpl().
And, IPSEC_PROTO_ANY is expected to only m... |
static int ext4_remove_blocks(handle_t *handle, struct inode *inode,
struct ext4_extent *ex,
struct partial_cluster *partial,
ext4_lblk_t from, ext4_lblk_t to)
{
struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
unsigned short ee_len = ext4_ext_get_actual_len(ex);
ext4_fsblk_t last_pblk, pb... | 0 | [
"CWE-200",
"CWE-908"
] | linux | 592acbf16821288ecdc4192c47e3774a4c48bb64 | 116,864,302,612,341,930,000,000,000,000,000,000,000 | 119 | ext4: zero out the unused memory region in the extent tree block
This commit zeroes out the unused memory region in the buffer_head
corresponding to the extent metablock after writing the extent header
and the corresponding extent node entries.
This is done to prevent random uninitialized data from getting into
the f... |
static struct sock *first_unix_socket(int *i)
{
for (*i = 0; *i <= UNIX_HASH_SIZE; (*i)++) {
if (!hlist_empty(&unix_socket_table[*i]))
return __sk_head(&unix_socket_table[*i]);
}
return NULL;
} | 0 | [] | linux-2.6 | 6209344f5a3795d34b7f2c0061f49802283b6bdd | 187,756,313,556,978,000,000,000,000,000,000,000,000 | 8 | net: unix: fix inflight counting bug in garbage collector
Previously I assumed that the receive queues of candidates don't
change during the GC. This is only half true, nothing can be received
from the queues (see comment in unix_gc()), but buffers could be added
through the other half of the socket pair, which may s... |
int addattr32(struct nlmsghdr *n, int maxlen, int type, __u32 data)
{
return addattr_l(n, maxlen, type, &data, sizeof(__u32));
} | 0 | [] | iproute2 | 8c50b728b226f6254251282697ce38a72639a6fc | 174,497,323,385,390,300,000,000,000,000,000,000,000 | 4 | libnetlink: fix use-after-free of message buf
In __rtnl_talk_iov() main loop, err is a pointer to memory in dynamically
allocated 'buf' that is used to store netlink messages. If netlink message
is an error message, buf is deallocated before returning with error code.
However, on return err->error code is checked one ... |
single_addr_policy_eq(const addr_policy_t *a, const addr_policy_t *b)
{
int r;
#define CMP_FIELD(field) do { \
if (a->field != b->field) { \
return 0; \
} \
} while (0)
CMP_FIELD(policy_type);... | 0 | [] | tor | 1afc2ed956a35b40dfd1d207652af5b50c295da7 | 330,732,591,266,794,970,000,000,000,000,000,000,000 | 20 | Fix policies.c instance of the "if (r=(a-b)) return r" pattern
I think this one probably can't underflow, since the input ranges
are small. But let's not tempt fate.
This patch also replaces the "cmp" functions here with just "eq"
functions, since nothing actually checked for anything besides 0 and
nonzero.
Related... |
static void read_block_list(unsigned int *block_list, long long start,
unsigned int offset, int blocks)
{
int res;
TRACE("read_block_list: blocks %d\n", blocks);
if(swap) {
char *block_ptr = malloc(blocks * sizeof(unsigned int));
if(block_ptr == NULL)
MEM_ERROR();
res = read_inode_data(block_ptr, &st... | 0 | [
"CWE-200",
"CWE-59",
"CWE-22"
] | squashfs-tools | e0485802ec72996c20026da320650d8362f555bd | 317,040,278,040,095,460,000,000,000,000,000,000,000 | 24 | Unsquashfs: additional write outside destination directory exploit fix
An issue on github (https://github.com/plougher/squashfs-tools/issues/72)
showed how some specially crafted Squashfs filesystems containing
invalid file names (with '/' and '..') can cause Unsquashfs to write
files outside of the destination direct... |
void **nedpindependent_calloc(nedpool *p, size_t elemsno, size_t elemsize, void **chunks) THROWSPEC
{
void **ret;
threadcache *tc;
int mymspace;
GetThreadCache(&p, &tc, &mymspace, &elemsize);
GETMSPACE(m, p, tc, mymspace, elemsno*elemsize,
ret=mspace_independent_calloc(m, elemsno, elemsize, chunks));
re... | 0 | [
"CWE-119",
"CWE-787"
] | git | 34fa79a6cde56d6d428ab0d3160cb094ebad3305 | 207,830,871,311,547,030,000,000,000,000,000,000,000 | 10 | prefer memcpy to strcpy
When we already know the length of a string (e.g., because
we just malloc'd to fit it), it's nicer to use memcpy than
strcpy, as it makes it more obvious that we are not going to
overflow the buffer (because the size we pass matches the
size in the allocation).
This also eliminates calls to st... |
delegpt_count_addr(struct delegpt* dp, size_t* numaddr, size_t* numres,
size_t* numavail)
{
struct delegpt_addr* a;
*numaddr = 0;
*numres = 0;
*numavail = 0;
for(a = dp->target_list; a; a = a->next_target) {
(*numaddr)++;
}
for(a = dp->result_list; a; a = a->next_result) {
(*numres)++;
}
for(a = dp->usab... | 0 | [
"CWE-400"
] | unbound | ba0f382eee814e56900a535778d13206b86b6d49 | 99,436,130,460,925,270,000,000,000,000,000,000,000 | 17 | - CVE-2020-12662 Unbound can be tricked into amplifying an incoming
query into a large number of queries directed to a target.
- CVE-2020-12663 Malformed answers from upstream name servers can be
used to make Unbound unresponsive. |
static void xmessage_fork(struct proclistlist *pll){
char message[5000];
set_pid_priority(0,SCHED_FIFO,sched_get_priority_min(SCHED_FIFO),"Unable to set SCHED_FIFO for %d (\"%s\"). (%s)", "the xmessage fork");
setenv("DISPLAY",":0.0",1);
if( ! xmessage_found)
sprintf(message,"xmessage \"WARNING! das_watc... | 0 | [
"CWE-119",
"CWE-787"
] | das_watchdog | bd20bb02e75e2c0483832b52f2577253febfb690 | 142,165,689,359,650,190,000,000,000,000,000,000,000 | 19 | Fix memory overflow if the name of an environment is larger than 500 characters. Bug found by Adam Sampson. |
snmp_pdu_create(int command)
{
netsnmp_pdu *pdu;
pdu = (netsnmp_pdu *) calloc(1, sizeof(netsnmp_pdu));
if (pdu) {
pdu->version = SNMP_DEFAULT_VERSION;
pdu->command = command;
pdu->errstat = SNMP_DEFAULT_ERRSTAT;
pdu->errindex = SNMP_DEFAULT_ERRINDEX;
pdu->security... | 0 | [
"CWE-415"
] | net-snmp | 5f881d3bf24599b90d67a45cae7a3eb099cd71c9 | 238,123,378,349,906,960,000,000,000,000,000,000,000 | 22 | libsnmp, USM: Introduce a reference count in struct usmStateReference
This patch fixes https://sourceforge.net/p/net-snmp/bugs/2956/. |
static inline int qeth_get_initial_mtu_for_card(struct qeth_card *card)
{
switch (card->info.type) {
case QETH_CARD_TYPE_UNKNOWN:
return 1500;
case QETH_CARD_TYPE_IQD:
return card->info.max_mtu;
case QETH_CARD_TYPE_OSD:
switch (card->info.link_type) {
case QETH_LINK_TYPE_HSTR:
case QETH_LINK_TYPE_LANE_TR:... | 0 | [
"CWE-200",
"CWE-119"
] | linux | 6fb392b1a63ae36c31f62bc3fc8630b49d602b62 | 282,978,682,433,772,230,000,000,000,000,000,000,000 | 22 | qeth: avoid buffer overflow in snmp ioctl
Check user-defined length in snmp ioctl request and allow request
only if it fits into a qeth command buffer.
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Reviewed-by: Heiko Carstens <heicars2@linux.vnet.ibm.c... |
int filter_packet( unsigned char *h80211, int caplen )
{
int z, mi_b, mi_s, mi_d, ext=0, qos;
if(caplen <= 0)
return( 1 );
z = ( ( h80211[1] & 3 ) != 3 ) ? 24 : 30;
if ( ( h80211[0] & 0x80 ) == 0x80 )
{
qos = 1; /* 802.11e QoS */
z+=2;
}
if( (h80211[0] & 0x0C) == 0... | 0 | [
"CWE-787"
] | aircrack-ng | 091b153f294b9b695b0b2831e65936438b550d7b | 233,064,629,795,807,400,000,000,000,000,000,000,000 | 69 | Aireplay-ng: Fixed tcp_test stack overflow (Closes #14 on GitHub).
git-svn-id: http://svn.aircrack-ng.org/trunk@2417 28c6078b-6c39-48e3-add9-af49d547ecab |
static int isofs_remount(struct super_block *sb, int *flags, char *data)
{
sync_filesystem(sb);
if (!(*flags & MS_RDONLY))
return -EROFS;
return 0;
} | 0 | [
"CWE-20",
"CWE-399"
] | linux | 410dd3cf4c9b36f27ed4542ee18b1af5e68645a4 | 5,176,987,662,408,762,000,000,000,000,000,000,000 | 7 | isofs: Fix unbounded recursion when processing relocated directories
We did not check relocated directory in any way when processing Rock
Ridge 'CL' tag. Thus a corrupted isofs image can possibly have a CL
entry pointing to another CL entry leading to possibly unbounded
recursion in kernel code and thus stack overflow... |
static void renameTokenFree(sqlite3 *db, RenameToken *pToken){
RenameToken *pNext;
RenameToken *p;
for(p=pToken; p; p=pNext){
pNext = p->pNext;
sqlite3DbFree(db, p);
}
} | 0 | [
"CWE-674",
"CWE-787"
] | sqlite | 38096961c7cd109110ac21d3ed7dad7e0cb0ae06 | 57,470,462,241,538,980,000,000,000,000,000,000,000 | 8 | Avoid infinite recursion in the ALTER TABLE code when a view contains an unused CTE that references, directly or indirectly, the view itself.
FossilOrigin-Name: 1d2e53a39b87e364685e21de137655b6eee725e4c6d27fc90865072d7c5892b5 |
void ip_mc_drop_socket(struct sock *sk)
{
struct inet_sock *inet = inet_sk(sk);
struct ip_mc_socklist *iml;
struct net *net = sock_net(sk);
if (inet->mc_list == NULL)
return;
rtnl_lock();
while ((iml = rtnl_dereference(inet->mc_list)) != NULL) {
struct in_device *in_dev;
inet->mc_list = iml->next_rcu;
... | 0 | [
"CWE-399",
"CWE-703",
"CWE-369"
] | linux | a8c1f65c79cbbb2f7da782d4c9d15639a9b94b27 | 173,323,430,447,303,200,000,000,000,000,000,000,000 | 24 | igmp: Avoid zero delay when receiving odd mixture of IGMP queries
Commit 5b7c84066733c5dfb0e4016d939757b38de189e4 ('ipv4: correct IGMP
behavior on v3 query during v2-compatibility mode') added yet another
case for query parsing, which can result in max_delay = 0. Substitute
a value of 1, as in the usual v3 case.
Rep... |
_pattern_add_rsvg_color_stops (cairo_pattern_t * pattern,
GPtrArray * stops, guint32 current_color_rgb, guint8 opacity)
{
gsize i;
RsvgGradientStop *stop;
RsvgNode *node;
guint32 rgba;
for (i = 0; i < stops->len; i++) {
node = (RsvgNode *) g_ptr_array_index (s... | 0 | [] | librsvg | 34c95743ca692ea0e44778e41a7c0a129363de84 | 245,231,612,811,423,400,000,000,000,000,000,000,000 | 21 | Store node type separately in RsvgNode
The node name (formerly RsvgNode:type) cannot be used to infer
the sub-type of RsvgNode that we're dealing with, since for unknown
elements we put type = node-name. This lead to a (potentially exploitable)
crash e.g. when the element name started with "fe" which tricked
the old c... |
void CLASS ahd_interpolate_r_and_b_in_rgb_and_convert_to_cielab(int top, int left, ushort (*inout_rgb)[TS][3], short (*out_lab)[TS][3], const float (&xyz_cam)[3][4])
{
unsigned row, col;
int c, val;
ushort (*pix)[4];
ushort (*rix)[3];
short (*lix)[3];
float xyz[3];
const unsigned num_pix_per_row = 4*width... | 0 | [
"CWE-703"
] | LibRaw | 11909cc59e712e09b508dda729b99aeaac2b29ad | 42,242,585,473,794,170,000,000,000,000,000,000,000 | 67 | cumulated data checks patch |
static int cardos_init(sc_card_t *card)
{
cardos_data_t * priv = NULL;
unsigned long flags = 0;
size_t data_field_length;
sc_apdu_t apdu;
u8 rbuf[2];
int r;
SC_FUNC_CALLED(card->ctx, SC_LOG_DEBUG_VERBOSE);
priv = calloc(1, sizeof(cardos_data_t));
if (!priv)
LOG_FUNC_RETURN(card->ctx, SC_ERROR_OUT_OF_MEMORY... | 0 | [] | OpenSC | 1252aca9f10771ef5ba8405e73cf2da50827958f | 135,725,401,098,783,670,000,000,000,000,000,000,000 | 140 | cardos: Correctly calculate the left bytes to avoid buffer overrun
Thanks oss-fuzz
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=29912 |
stringHash (const widechar * c)
{
/*hash function for strings */
unsigned long int makeHash = (((unsigned long int) c[0] << 8) +
(unsigned long int) c[1]) % HASHNUM;
return (int) makeHash;
} | 0 | [] | liblouis | dc97ef791a4fae9da11592c79f9f79e010596e0c | 99,126,421,807,288,770,000,000,000,000,000,000,000 | 7 | Merge branch 'table_resolver' |
int DetectEngineContentInspection(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
const Signature *s, const SigMatchData *smd,
Flow *f,
uint8_t *buffer, uint32_t buffer_len,
u... | 0 | [] | suricata | b9579fbe7dd408200ef03cbe20efddb624b73885 | 170,548,247,985,561,400,000,000,000,000,000,000,000 | 494 | detect: avoid needless recursive scanning
Don't recursively inspect a detect list if the recursion
doesn't increase chance of success. |
_public_ int sd_bus_open_system_remote(sd_bus **ret, const char *host) {
_cleanup_(bus_freep) sd_bus *b = NULL;
int r;
assert_return(host, -EINVAL);
assert_return(ret, -EINVAL);
r = sd_bus_new(&b);
if (r < 0)
return r;
r = bus_set_address_system... | 0 | [
"CWE-416"
] | systemd | 1068447e6954dc6ce52f099ed174c442cb89ed54 | 267,804,504,922,910,930,000,000,000,000,000,000,000 | 27 | sd-bus: introduce API for re-enqueuing incoming messages
When authorizing via PolicyKit we want to process incoming method calls
twice: once to process and figure out that we need PK authentication,
and a second time after we aquired PK authentication to actually execute
the operation. With this new call sd_bus_enqueu... |
Item_bool_rowready_func2* Eq_creator::create_swap(THD *thd, Item *a, Item *b) const
{
return new(thd->mem_root) Item_func_eq(thd, b, a);
} | 0 | [
"CWE-617"
] | server | 807945f2eb5fa22e6f233cc17b85a2e141efe2c8 | 286,250,761,033,775,670,000,000,000,000,000,000,000 | 4 | MDEV-26402: A SEGV in Item_field::used_tables/update_depend_map_for_order...
When doing condition pushdown from HAVING into WHERE,
Item_equal::create_pushable_equalities() calls
item->set_extraction_flag(IMMUTABLE_FL) for constant items.
Then, Item::cleanup_excluding_immutables_processor() checks for this flag
to see ... |
_get_gdef (hb_face_t *face)
{
return HB_LIKELY (face->ot_layout.gdef) ? *face->ot_layout.gdef : Null(GDEF);
} | 0 | [
"CWE-119"
] | pango | 797d46714d27f147277fdd5346648d838c68fb8c | 64,293,567,345,289,010,000,000,000,000,000,000,000 | 4 | [HB/GDEF] Fix bug in building synthetic GDEF table |
static void svm_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event)
{
struct vcpu_svm *svm = to_svm(vcpu);
svm->spec_ctrl = 0;
svm->virt_spec_ctrl = 0;
init_vmcb(vcpu);
if (!init_event)
__svm_vcpu_reset(vcpu);
} | 0 | [
"CWE-703"
] | linux | 6cd88243c7e03845a450795e134b488fc2afb736 | 246,057,598,318,677,400,000,000,000,000,000,000,000 | 12 | KVM: x86: do not report a vCPU as preempted outside instruction boundaries
If a vCPU is outside guest mode and is scheduled out, it might be in the
process of making a memory access. A problem occurs if another vCPU uses
the PV TLB flush feature during the period when the vCPU is scheduled
out, and a virtual address ... |
static void nl80211_gtk_rekey_notify(struct cfg80211_registered_device *rdev,
struct net_device *netdev, const u8 *bssid,
const u8 *replay_ctr, gfp_t gfp)
{
struct sk_buff *msg;
struct nlattr *rekey_attr;
void *hdr;
msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp);
if (!msg)
return;
hdr = nl80211hdr... | 0 | [
"CWE-120"
] | linux | f88eb7c0d002a67ef31aeb7850b42ff69abc46dc | 180,451,415,842,823,200,000,000,000,000,000,000,000 | 42 | nl80211: validate beacon head
We currently don't validate the beacon head, i.e. the header,
fixed part and elements that are to go in front of the TIM
element. This means that the variable elements there can be
malformed, e.g. have a length exceeding the buffer size, but
most downstream code from this assumes that thi... |
struct sctp_chunk *sctp_make_heartbeat(const struct sctp_association *asoc,
const struct sctp_transport *transport)
{
struct sctp_chunk *retval;
sctp_sender_hb_info_t hbinfo;
retval = sctp_make_chunk(asoc, SCTP_CID_HEARTBEAT, 0, sizeof(hbinfo));
if (!retval)
goto nodata;
hbinfo.param_hdr.type = SCTP_PAR... | 0 | [] | linux | 196d67593439b03088913227093e374235596e33 | 28,416,378,382,258,650,000,000,000,000,000,000,000 | 27 | sctp: Add support to per-association statistics via a new SCTP_GET_ASSOC_STATS call
The current SCTP stack is lacking a mechanism to have per association
statistics. This is an implementation modeled after OpenSolaris'
SCTP_GET_ASSOC_STATS.
Userspace part will follow on lksctp if/when there is a general ACK on
this.
... |
static bool dce80_construct(
uint8_t num_virtual_links,
struct dc *dc,
struct dce110_resource_pool *pool)
{
unsigned int i;
struct dc_context *ctx = dc->ctx;
struct dc_bios *bp;
ctx->dc_bios->regs = &bios_regs;
pool->base.res_cap = &res_cap;
pool->base.funcs = &dce80_res_pool_funcs;
/*********************... | 0 | [
"CWE-400",
"CWE-703",
"CWE-401"
] | linux | 055e547478a11a6360c7ce05e2afc3e366968a12 | 221,627,944,943,620,000,000,000,000,000,000,000,000 | 179 | drm/amd/display: memory leak
In dcn*_clock_source_create when dcn20_clk_src_construct fails allocated
clk_src needs release.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com> |
_my_mbstowcs (int16x * dst, uschar * src, int len)
{
int i;
int16x val;
for (i = 0; i < len; i++)
{
val = *src;
SSVAL (dst, 0, val);
dst++;
src++;
if (val == 0)
break;
}
return i;
} | 0 | [
"CWE-125"
] | exim | 57aa14b216432be381b6295c312065b2fd034f86 | 128,102,016,411,553,140,000,000,000,000,000,000,000 | 16 | Fix SPA authenticator, checking client-supplied data before using it. Bug 2571 |
child_set_env(char ***envp, u_int *envsizep, const char *name,
const char *value)
{
char **env;
u_int envsize;
u_int i, namelen;
if (strchr(name, '=') != NULL) {
error("Invalid environment variable \"%.100s\"", name);
return;
}
/*
* If we're passed an uninitialized list, allocate a single null
* entry ... | 0 | [] | openssh-portable | f3cbe43e28fe71427d41cfe3a17125b972710455 | 18,526,467,214,539,763,000,000,000,000,000,000,000 | 54 | upstream: need initgroups() before setresgid(); reported by anton@,
ok deraadt@
OpenBSD-Commit-ID: 6aa003ee658b316960d94078f2a16edbc25087ce |
int ieee80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
const u8 *peer, u8 action_code, u8 dialog_token,
u16 status_code, u32 peer_capability,
bool initiator, const u8 *extra_ies,
size_t extra_ies_len)
{
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
int ret;
if (!(wiph... | 0 | [] | linux | 79c92ca42b5a3e0ea172ea2ce8df8e125af237da | 162,537,787,586,054,870,000,000,000,000,000,000,000 | 60 | mac80211: handle deauthentication/disassociation from TDLS peer
When receiving a deauthentication/disassociation frame from a TDLS
peer, a station should not disconnect the current AP, but only
disable the current TDLS link if it's enabled.
Without this change, a TDLS issue can be reproduced by following the
steps as... |
explicit WebFrameRenderer(content::RenderFrame* render_frame)
: content::RenderFrameObserver(render_frame) {
DCHECK(render_frame);
} | 0 | [] | electron | e9fa834757f41c0b9fe44a4dffe3d7d437f52d34 | 156,073,870,586,722,070,000,000,000,000,000,000,000 | 4 | 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
... |
static void test_bug5126()
{
MYSQL_STMT *stmt;
MYSQL_BIND my_bind[2];
int32 c1, c2;
const char *stmt_text;
int rc;
myheader("test_bug5126");
stmt_text= "DROP TABLE IF EXISTS t1";
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
myquery(rc);
stmt_text= "CREATE TABLE t1 (a mediumint, b in... | 0 | [
"CWE-284",
"CWE-295"
] | mysql-server | 3bd5589e1a5a93f9c224badf983cd65c45215390 | 179,616,582,976,768,800,000,000,000,000,000,000,000 | 46 | WL#6791 : Redefine client --ssl option to imply enforced encryption
# Changed the meaning of the --ssl=1 option of all client binaries
to mean force ssl, not try ssl and fail over to eunecrypted
# Added a new MYSQL_OPT_SSL_ENFORCE mysql_options()
option to specify that an ssl connection is required.
# Added a new macr... |
flatpak_context_set_system_bus_policy (FlatpakContext *context,
const char *name,
FlatpakPolicy policy)
{
g_hash_table_insert (context->system_bus_policy, g_strdup (name), GINT_TO_POINTER (policy));
} | 0 | [
"CWE-20"
] | flatpak | 902fb713990a8f968ea4350c7c2a27ff46f1a6c4 | 276,377,453,540,086,220,000,000,000,000,000,000,000 | 6 | Use seccomp to filter out TIOCSTI ioctl
This would otherwise let the sandbox add input to the controlling tty. |
get_scriptlocal_funcname(char_u *funcname)
{
char sid_buf[25];
int off;
char_u *newname;
char_u *p = funcname;
if (funcname == NULL)
return NULL;
if (STRNCMP(funcname, "s:", 2) != 0
&& STRNCMP(funcname, "<SID>", 5) != 0)
{
ufunc_T *ufunc;
// The function name does not have a scr... | 0 | [
"CWE-416"
] | vim | 91c7cbfe31bbef57d5fcf7d76989fc159f73ef15 | 135,431,176,694,501,800,000,000,000,000,000,000,000 | 45 | patch 9.0.0225: using freed memory with multiple line breaks in expression
Problem: Using freed memory with multiple line breaks in expression.
Solution: Free eval_tofree later. |
handle_ctrl_proto(netdissect_options *ndo,
u_int proto, const u_char *pptr, int length)
{
const char *typestr;
u_int code, len;
int (*pfunc)(netdissect_options *, const u_char *, int);
int x, j;
const u_char *tptr;
tptr=pptr;
typestr = tok2str(ppptype2str, "unknown ctrl-p... | 0 | [
"CWE-119"
] | tcpdump | 0f95d441e4b5d7512cc5c326c8668a120e048eda | 85,166,252,343,424,300,000,000,000,000,000,000,000 | 164 | Do bounds checking when unescaping PPP.
Clean up a const issue while we're at it. |
int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size)
{
struct tcp_sock *tp = tcp_sk(sk);
struct ubuf_info *uarg = NULL;
struct sk_buff *skb;
struct sockcm_cookie sockc;
int flags, err, copied = 0;
int mss_now = 0, size_goal, copied_syn = 0;
bool process_backlog = false;
bool zc = false;
lon... | 0 | [
"CWE-190"
] | net | 3b4929f65b0d8249f19a50245cd88ed1a2f78cff | 206,440,625,892,593,300,000,000,000,000,000,000,000 | 256 | tcp: limit payload size of sacked skbs
Jonathan Looney reported that TCP can trigger the following crash
in tcp_shifted_skb() :
BUG_ON(tcp_skb_pcount(skb) < pcount);
This can happen if the remote peer has advertized the smallest
MSS that linux TCP accepts : 48
An skb can hold 17 fragments, and each fragment can ho... |
file_regfree(file_regex_t *rx)
{
if (rx->rc == 0)
regfree(&rx->rx);
#ifdef USE_C_LOCALE
(void)uselocale(rx->old_lc_ctype);
freelocale(rx->c_lc_ctype);
#else
(void)setlocale(LC_CTYPE, rx->old_lc_ctype);
#endif
} | 0 | [
"CWE-787"
] | file | d65781527c8134a1202b2649695d48d5701ac60b | 41,129,661,707,178,652,000,000,000,000,000,000,000 | 11 | PR/62: spinpx: limit size of file_printable. |
ends_in_white(linenr_T lnum)
{
char_u *s = ml_get(lnum);
size_t l;
if (*s == NUL)
return FALSE;
// Don't use STRLEN() inside VIM_ISWHITE(), SAS/C complains: "macro
// invocation may call function multiple times".
l = STRLEN(s) - 1;
return VIM_ISWHITE(s[l]);
} | 0 | [
"CWE-125"
] | vim | 78d52883e10d71f23ab72a3d8b9733b00da8c9ad | 2,263,606,525,353,412,000,000,000,000,000,000,000 | 12 | patch 8.2.5013: after text formatting cursor may be in an invalid position
Problem: After text formatting the cursor may be in an invalid position.
Solution: Correct the cursor position after formatting. |
camel_ews_store_check_all_cb (CamelEwsStore *ews_store,
GParamSpec *spec,
CamelEwsSettings *ews_settings)
{
if (!ews_store->priv->listen_notifications)
return;
camel_ews_store_handle_notifications (ews_store, ews_settings);
} | 0 | [
"CWE-295"
] | evolution-ews | 915226eca9454b8b3e5adb6f2fff9698451778de | 69,266,889,079,835,790,000,000,000,000,000,000,000 | 9 | I#27 - SSL Certificates are not validated
This depends on https://gitlab.gnome.org/GNOME/evolution-data-server/commit/6672b8236139bd6ef41ecb915f4c72e2a052dba5 too.
Closes https://gitlab.gnome.org/GNOME/evolution-ews/issues/27 |
tiffsep1_print_page(gx_device_printer * pdev, gp_file * file)
{
tiffsep1_device * const tfdev = (tiffsep1_device *)pdev;
int num_std_colorants = tfdev->devn_params.num_std_colorant_names;
int num_order = tfdev->devn_params.num_separation_order_names;
int num_spot = tfdev->devn_params.separations.num_sep... | 0 | [
"CWE-476"
] | ghostpdl | aadb53eb834b3def3ef68d78865ff87a68901804 | 261,596,565,875,629,340,000,000,000,000,000,000,000 | 275 | Tiffsep and Tiffsep1 - abort on multi-page input wtithout %d OutputFile
Bug #701821 "Segmentation fault at tiff//libtiff/tif_dirinfo.c:513 in TIFFFindField"
The tiffsep and tiffsep1 only set 'code' to an error when an attempt is
made to write a second output file without using %d in the OutputFile
specification.
Thi... |
dump_pq_desc_dbg(struct ioat2_dma_chan *ioat, struct ioat_ring_ent *desc, struct ioat_ring_ent *ext)
{
struct device *dev = to_dev(&ioat->base);
struct ioat_pq_descriptor *pq = desc->pq;
struct ioat_pq_ext_descriptor *pq_ex = ext ? ext->pq_ex : NULL;
struct ioat_raw_descriptor *descs[] = { (void *) pq, (void *) pq_... | 0 | [] | linux | 7bced397510ab569d31de4c70b39e13355046387 | 272,509,236,260,880,100,000,000,000,000,000,000,000 | 25 | 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... |
g_socket_client_proxy_connect_callback (GObject *object,
GAsyncResult *result,
gpointer user_data)
{
GSocketClientAsyncConnectData *data = user_data;
g_object_unref (data->connection);
data->connection = g_proxy_connect_finish (G_PROXY (object),
result,
&data->last_error);... | 1 | [
"CWE-754"
] | glib | d553d92d6e9f53cbe5a34166fcb919ba652c6a8e | 210,290,834,379,990,440,000,000,000,000,000,000,000 | 22 | gsocketclient: Fix criticals
This ensures the parent GTask is kept alive as long as an enumeration
is running and trying to connect.
Closes #1646
Closes #1649 |
lys_node_module(const struct lys_node *node)
{
if (!node) {
return NULL;
}
return node->module->type ? ((struct lys_submodule *)node->module)->belongsto : node->module;
} | 0 | [
"CWE-119"
] | libyang | 32fb4993bc8bb49e93e84016af3c10ea53964be5 | 102,644,060,603,787,230,000,000,000,000,000,000,000 | 8 | schema tree BUGFIX do not check features while still resolving schema
Fixes #723 |
j2k_decode_entry(Imaging im, ImagingCodecState state) {
JPEG2KDECODESTATE *context = (JPEG2KDECODESTATE *)state->context;
opj_stream_t *stream = NULL;
opj_image_t *image = NULL;
opj_codec_t *codec = NULL;
opj_dparameters_t params;
OPJ_COLOR_SPACE color_space;
j2k_unpacker_t unpack = NULL;
... | 1 | [
"CWE-125"
] | Pillow | 3bf5eddb89afdf690eceaa52bc4d3546ba9a5f87 | 208,514,606,862,703,140,000,000,000,000,000,000,000 | 256 | Fix OOB Read in Jpeg2KDecode CVE-2021-25287,CVE-2021-25288
* For J2k images with multiple bands, it's legal in to have different
widths for each band, e.g. 1 byte for L, 4 bytes for A
* This dates to Pillow 2.4.0 |
static json_t * check_attestation_android_safetynet(json_t * j_params, cbor_item_t * auth_data, cbor_item_t * att_stmt, const unsigned char * client_data) {
json_t * j_error = json_array(), * j_return;
unsigned char pubkey_export[1024] = {0}, cert_export[32] = {0}, cert_export_b64[64], client_data_hash[32], * nonce... | 0 | [
"CWE-787"
] | glewlwyd | 4c5597c155bfbaf6491cf6b83479d241ae66940a | 198,986,280,868,368,920,000,000,000,000,000,000,000 | 241 | Fix possible buffer overflow |
void resetData(std::vector<char>&& data) {
ancillaryData_.swap(data);
} | 0 | [
"CWE-125"
] | folly | c321eb588909646c15aefde035fd3133ba32cdee | 105,340,351,868,482,670,000,000,000,000,000,000,000 | 3 | Handle close_notify as standard writeErr in AsyncSSLSocket.
Summary: Fixes CVE-2019-11934
Reviewed By: mingtaoy
Differential Revision: D18020613
fbshipit-source-id: db82bb250e53f0d225f1280bd67bc74abd417836 |
void rfbSendServerCutText(char *str, int len)
{
rfbClientPtr cl, nextCl;
rfbServerCutTextMsg sct;
if (rfbViewOnly || rfbAuthDisableCBSend || !str || len <= 0)
return;
for (cl = rfbClientHead; cl; cl = nextCl) {
nextCl = cl->next;
if (cl->state != RFB_NORMAL || cl->viewOnly)
continue;
if ... | 0 | [
"CWE-787"
] | turbovnc | cea98166008301e614e0d36776bf9435a536136e | 205,160,863,882,391,000,000,000,000,000,000,000,000 | 38 | Server: Fix two issues identified by ASan
1. If the TLSPlain and X509Plain security types were both disabled, then
rfbOptPamAuth() would overflow the name field in the secTypes
structure when testing the "none" security type, since the name of
that security type has less than five characters. This issue was
... |
ldns_wire2rr(ldns_rr **rr_p, const uint8_t *wire, size_t max,
size_t *pos, ldns_pkt_section section)
{
ldns_rdf *owner = NULL;
ldns_rr *rr = ldns_rr_new();
ldns_status status;
status = ldns_wire2dname(&owner, wire, max, pos);
LDNS_STATUS_CHECK_GOTO(status, status_error);
ldns_rr_set_owner(rr, owner... | 0 | [
"CWE-415"
] | ldns | 070b4595981f48a21cc6b4f5047fdc2d09d3da91 | 211,378,838,782,946,500,000,000,000,000,000,000,000 | 46 | CAA and URI |
void CoreUserInputHandler::handleKill(const BufferInfo &bufferInfo, const QString &msg)
{
Q_UNUSED(bufferInfo)
QString nick = msg.section(' ', 0, 0, QString::SectionSkipEmpty);
QString pass = msg.section(' ', 1, -1, QString::SectionSkipEmpty);
QList<QByteArray> params;
params << serverEncode(nick) <... | 0 | [
"CWE-399"
] | quassel | b5e38970ffd55e2dd9f706ce75af9a8d7730b1b8 | 229,624,296,069,188,200,000,000,000,000,000,000,000 | 9 | Improve the message-splitting algorithm for PRIVMSG and CTCP
This introduces a new message splitting algorithm based on
QTextBoundaryFinder. It works by first starting with the entire
message to be sent, encoding it, and checking to see if it is over
the maximum message length. If it is, it uses QTBF to find the
wor... |
bool Item_func_set_user_var::send(Protocol *protocol, String *str_arg)
{
if (result_field)
{
check(1);
update();
return protocol->store(result_field);
}
return Item::send(protocol, str_arg);
} | 0 | [
"CWE-120"
] | server | eca207c46293bc72dd8d0d5622153fab4d3fccf1 | 159,700,683,336,894,470,000,000,000,000,000,000,000 | 10 | MDEV-25317 Assertion `scale <= precision' failed in decimal_bin_size And Assertion `scale >= 0 && precision > 0 && scale <= precision' failed in decimal_bin_size_inline/decimal_bin_size.
Precision should be kept below DECIMAL_MAX_SCALE for computations.
It can be bigger in Item_decimal. I'd fix this too but it changes... |
verify_callback(int state, X509_STORE_CTX *x509ctx)
{
static uschar txt[256];
X509_NAME_oneline(X509_get_subject_name(x509ctx->current_cert),
CS txt, sizeof(txt));
if (state == 0)
{
log_write(0, LOG_MAIN, "SSL verify error: depth=%d error=%s cert=%s",
x509ctx->error_depth,
X509_verify_cert_error_string(... | 0 | [] | exim | 7be682ca5ebd9571a01b762195b11c34cd231830 | 253,016,481,701,297,300,000,000,000,000,000,000,000 | 38 | TLS SNI support for OpenSSL ($tls_sni) |
void ixgbe_disable_tx_rx(struct ixgbe_adapter *adapter)
{
struct ixgbe_hw *hw = &adapter->hw;
/* disable transmit and receive for all vfs */
IXGBE_WRITE_REG(hw, IXGBE_VFTE(0), 0);
IXGBE_WRITE_REG(hw, IXGBE_VFTE(1), 0);
IXGBE_WRITE_REG(hw, IXGBE_VFRE(0), 0);
IXGBE_WRITE_REG(hw, IXGBE_VFRE(1), 0);
} | 0 | [
"CWE-20"
] | linux | 63e39d29b3da02e901349f6cd71159818a4737a6 | 6,077,222,965,987,653,000,000,000,000,000,000,000 | 11 | ixgbe: fix large MTU request from VF
Check that the MTU value requested by the VF is in the supported
range of MTUs before attempting to set the VF large packet enable,
otherwise reject the request. This also avoids unnecessary
register updates in the case of the 82599 controller.
Fixes: 872844ddb9e4 ("ixgbe: Enable ... |
static void test_selecttmp()
{
MYSQL_STMT *stmt;
int rc, i;
const char *query= "select a, (select count(distinct t1.b) as sum from t1, t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) from t3";
myheader("test_select_tmp");
rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1, ... | 0 | [
"CWE-284",
"CWE-295"
] | mysql-server | 3bd5589e1a5a93f9c224badf983cd65c45215390 | 146,460,000,585,120,460,000,000,000,000,000,000,000 | 45 | WL#6791 : Redefine client --ssl option to imply enforced encryption
# Changed the meaning of the --ssl=1 option of all client binaries
to mean force ssl, not try ssl and fail over to eunecrypted
# Added a new MYSQL_OPT_SSL_ENFORCE mysql_options()
option to specify that an ssl connection is required.
# Added a new macr... |
print_resolved_levels (
const FriBidiRun *pp
)
{
fribidi_assert (pp);
MSG (" Res. levels: ");
for_run_list (pp, pp)
{
register FriBidiStrIndex i;
for (i = RL_LEN (pp); i; i--)
MSG2 ("%c", fribidi_char_from_level (RL_LEVEL (pp)));
}
MSG ("\n");
} | 0 | [
"CWE-120",
"CWE-787"
] | fribidi | 034c6e9a1d296286305f4cfd1e0072b879f52568 | 137,045,160,451,450,800,000,000,000,000,000,000,000 | 15 | Truncate isolate_level to FRIBIDI_BIDI_MAX_EXPLICIT_LEVEL |
static irqreturn_t xemaclite_interrupt(int irq, void *dev_id)
{
bool tx_complete = false;
struct net_device *dev = dev_id;
struct net_local *lp = netdev_priv(dev);
void __iomem *base_addr = lp->base_addr;
u32 tx_status;
/* Check if there is Rx Data available */
if ((xemaclite_readl(base_addr + XEL_RSR_OFFSET) &... | 0 | [
"CWE-703",
"CWE-824"
] | linux | d0d62baa7f505bd4c59cd169692ff07ec49dde37 | 276,459,149,433,119,850,000,000,000,000,000,000,000 | 45 | net: xilinx_emaclite: Do not print real IOMEM pointer
Printing kernel pointers is discouraged because they might leak kernel
memory layout. This fixes smatch warning:
drivers/net/ethernet/xilinx/xilinx_emaclite.c:1191 xemaclite_of_probe() warn:
argument 4 to %08lX specifier is cast from pointer
Signed-off-by: YueH... |
static bool _ber_read_OID_String_impl(TALLOC_CTX *mem_ctx, DATA_BLOB blob,
char **OID, size_t *bytes_eaten)
{
int i;
uint8_t *b;
unsigned int v;
char *tmp_oid = NULL;
if (blob.length < 2) return false;
b = blob.data;
tmp_oid = talloc_asprintf(mem_ctx, "%u", b[0]/40);
if (!tmp_oid) goto nomem;
tmp... | 0 | [
"CWE-399"
] | samba | 9d989c9dd7a5b92d0c5d65287935471b83b6e884 | 191,445,838,197,072,720,000,000,000,000,000,000,000 | 38 | CVE-2015-7540: lib: util: Check *every* asn1 return call and early return.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=9187
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Sep... |
static void __init sun8i_pll1_clk_setup(struct device_node *node)
{
sunxi_factors_clk_setup(node, &sun8i_a23_pll1_data);
} | 0 | [
"CWE-476"
] | linux | fcdf445ff42f036d22178b49cf64e92d527c1330 | 64,734,988,290,533,820,000,000,000,000,000,000,000 | 4 | clk-sunxi: fix a missing-check bug in sunxi_divs_clk_setup()
In sunxi_divs_clk_setup(), 'derived_name' is allocated by kstrndup().
It returns NULL when fails. 'derived_name' should be checked.
Signed-off-by: Gen Zhang <blackgod016574@gmail.com>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> |
static float _cimg_lanczos(const float x) {
if (x<=-2 || x>=2) return 0;
const float a = (float)cimg::PI*x, b = 0.5f*a;
return (float)(x?std::sin(a)*std::sin(b)/(a*b):1);
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 306,651,108,435,283,540,000,000,000,000,000,000,000 | 5 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
static int entersafe_gen_key(sc_card_t *card, sc_entersafe_gen_key_data *data)
{
int r;
size_t len = data->key_length >> 3;
sc_apdu_t apdu;
u8 rbuf[300];
u8 sbuf[4],*p;
SC_FUNC_CALLED(card->ctx, SC_LOG_DEBUG_VERBOSE);
/* MSE */
sc_format_apdu(card, &apdu, SC_APDU_CASE_3_SHORT, 0x22, 0x01, 0xB8);
apdu.lc=0x04... | 0 | [
"CWE-125"
] | OpenSC | 8fe377e93b4b56060e5bbfb6f3142ceaeca744fa | 306,360,648,436,064,700,000,000,000,000,000,000,000 | 78 | fixed out of bounds reads
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting and suggesting security fixes. |
HRESULT Http::HrGetDepth(ULONG *ulDepth)
{
std::string strDepth;
/*
* Valid input: [0, 1, infinity]
*/
auto hr = HrGetHeaderValue("Depth", &strDepth);
if (hr != hrSuccess)
*ulDepth = 0; /* Default is no subfolders. Default should become a parameter. It is action dependent. */
else if (strDepth == "infinity")... | 0 | [
"CWE-770"
] | kopano-core | 512457466b87039c6a8d25887fdaca6173619546 | 217,517,827,692,339,950,000,000,000,000,000,000,000 | 18 | Set limit on header size to prevent bad alloc
This sets a hard limit of 64 KiB to the header to prevent a memory
allocation exception from being thrown during the parsing of the request
headers. |
static ssize_t lbs_dev_info(struct file *file, char __user *userbuf,
size_t count, loff_t *ppos)
{
struct lbs_private *priv = file->private_data;
size_t pos = 0;
unsigned long addr = get_zeroed_page(GFP_KERNEL);
char *buf = (char *)addr;
ssize_t res;
if (!buf)
return -ENOMEM;
pos += snprintf(buf+pos, le... | 0 | [
"CWE-703",
"CWE-189"
] | linux | a497e47d4aec37aaf8f13509f3ef3d1f6a717d88 | 248,101,563,516,842,050,000,000,000,000,000,000,000 | 21 | libertas: potential oops in debugfs
If we do a zero size allocation then it will oops. Also we can't be
sure the user passes us a NUL terminated string so I've added a
terminator.
This code can only be triggered by root.
Reported-by: Nico Golde <nico@ngolde.de>
Reported-by: Fabian Yamaguchi <fabs@goesec.de>
Signed-... |
static void io_assign_current_work(struct io_worker *worker,
struct io_wq_work *work)
{
if (work) {
io_flush_signals();
cond_resched();
}
spin_lock(&worker->lock);
worker->cur_work = work;
spin_unlock(&worker->lock);
} | 0 | [
"CWE-200"
] | linux | 713b9825a4c47897f66ad69409581e7734a8728e | 326,222,747,249,956,070,000,000,000,000,000,000,000 | 12 | io-wq: fix cancellation on create-worker failure
WARNING: CPU: 0 PID: 10392 at fs/io_uring.c:1151 req_ref_put_and_test
fs/io_uring.c:1151 [inline]
WARNING: CPU: 0 PID: 10392 at fs/io_uring.c:1151 req_ref_put_and_test
fs/io_uring.c:1146 [inline]
WARNING: CPU: 0 PID: 10392 at fs/io_uring.c:1151
io_req_complete_post+0xf5... |
static bool exec_context_needs_term(const ExecContext *c) {
assert(c);
/* Return true if the execution context suggests we should set $TERM to something useful. */
if (is_terminal_input(c->std_input))
return true;
if (is_terminal_output(c->std_output))
... | 0 | [
"CWE-269"
] | systemd | f69567cbe26d09eac9d387c0be0fc32c65a83ada | 123,646,592,299,733,250,000,000,000,000,000,000,000 | 16 | core: expose SUID/SGID restriction as new unit setting RestrictSUIDSGID= |
void run() {
intrusive_ptr<ExpressionContextForTest> expCtx(new ExpressionContextForTest());
BSONObj specObject = BSON("" << spec());
BSONElement specElement = specObject.firstElement();
VariablesParseState vps = expCtx->variablesParseState;
ASSERT_THROWS(Expression::parseOpe... | 0 | [
"CWE-835"
] | mongo | 0a076417d1d7fba3632b73349a1fd29a83e68816 | 134,567,147,319,982,970,000,000,000,000,000,000,000 | 7 | SERVER-38070 fix infinite loop in agg expression |
static void b43_periodic_every30sec(struct b43_wldev *dev)
{
/* Update device statistics. */
b43_calculate_link_quality(dev);
} | 0 | [
"CWE-134"
] | wireless | 9538cbaab6e8b8046039b4b2eb6c9d614dc782bd | 55,562,263,783,833,990,000,000,000,000,000,000,000 | 5 | b43: stop format string leaking into error msgs
The module parameter "fwpostfix" is userspace controllable, unfiltered,
and is used to define the firmware filename. b43_do_request_fw() populates
ctx->errors[] on error, containing the firmware filename. b43err()
parses its arguments as a format string. For systems with... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.