func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
c_pdf14trans_is_friendly(const gs_composite_t * composite_action, byte cmd0, byte cmd1)
{
gs_pdf14trans_t *pct0 = (gs_pdf14trans_t *)composite_action;
int op0 = pct0->params.pdf14_op;
if (op0 == PDF14_PUSH_DEVICE || op0 == PDF14_END_TRANS_GROUP) {
/* Halftone commands are always passed to the targe... | 0 | [
"CWE-416"
] | ghostpdl | 90fd0c7ca3efc1ddff64a86f4104b13b3ac969eb | 144,266,376,562,114,820,000,000,000,000,000,000,000 | 17 | Bug 697456. Dont create new ctx when pdf14 device reenabled
This bug had yet another weird case where the user created a
file that pushed the pdf14 device twice. We were in that case,
creating a new ctx and blowing away the original one with out
proper clean up. To avoid, only create a new one when we need it. |
char **lxc_string_split_and_trim(const char *string, char _sep)
{
char *token, *str;
char sep[2] = { _sep, '\0' };
char **result = NULL;
size_t result_capacity = 0;
size_t result_count = 0;
int r, saved_errno;
size_t i = 0;
size_t len;
if (!string)
return calloc(1, sizeof(char *));
len = strlen(string);
... | 0 | [
"CWE-417"
] | lxc | c1cf54ebf251fdbad1e971679614e81649f1c032 | 106,159,670,805,265,480,000,000,000,000,000,000,000 | 48 | CVE 2018-6556: verify netns fd in lxc-user-nic
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com> |
u32 gf_isom_get_sample_size(GF_ISOFile *the_file, u32 trackNumber, u32 sampleNumber)
{
u32 size = 0;
GF_TrackBox *trak = gf_isom_get_track_from_file(the_file, trackNumber);
if (!trak || !sampleNumber) return 0;
#ifndef GPAC_DISABLE_ISOM_FRAGMENTS
if (sampleNumber<=trak->sample_count_at_seg_start) return 0;
sampleN... | 0 | [
"CWE-476"
] | gpac | ebfa346eff05049718f7b80041093b4c5581c24e | 159,605,504,398,858,450,000,000,000,000,000,000,000 | 12 | fixed #1706 |
static bool find_numa_distance(int distance)
{
int i;
if (distance == node_distance(0, 0))
return true;
for (i = 0; i < sched_domains_numa_levels; i++) {
if (sched_domains_numa_distance[i] == distance)
return true;
}
return false;
} | 0 | [
"CWE-200"
] | linux | 4efbc454ba68def5ef285b26ebfcfdb605b52755 | 158,542,716,875,841,200,000,000,000,000,000,000,000 | 14 | sched: Fix information leak in sys_sched_getattr()
We're copying the on-stack structure to userspace, but forgot to give
the right number of bytes to copy. This allows the calling process to
obtain up to PAGE_SIZE bytes from the stack (and possibly adjacent
kernel memory).
This fix copies only as much as we actually ... |
addBackwardRuleWithMultipleCells(widechar *cells, int count,
TranslationTableOffset *newRuleOffset, TranslationTableRule *newRule,
TranslationTableHeader *table) {
/* direction = 1, newRule->dotslen > 1 */
TranslationTableRule *currentRule = NULL;
TranslationTableOffset *currentOffsetPtr = &table->backRules[_lou... | 0 | [
"CWE-787"
] | liblouis | fb2bfce4ed49ac4656a8f7e5b5526e4838da1dde | 275,959,736,564,531,350,000,000,000,000,000,000,000 | 22 | Fix yet another buffer overflow in the braille table parser
Reported by Henri Salo
Fixes #592 |
static void kvm_replace_gfn_node(struct kvm_memslots *slots,
struct kvm_memory_slot *old,
struct kvm_memory_slot *new)
{
int idx = slots->node_idx;
WARN_ON_ONCE(old->base_gfn != new->base_gfn);
rb_replace_node(&old->gfn_node[idx], &new->gfn_node[idx],
&slots->gfn_tree); | 0 | [
"CWE-459"
] | linux | 683412ccf61294d727ead4a73d97397396e69a6b | 44,286,961,266,446,040,000,000,000,000,000,000,000 | 11 | KVM: SEV: add cache flush to solve SEV cache incoherency issues
Flush the CPU caches when memory is reclaimed from an SEV guest (where
reclaim also includes it being unmapped from KVM's memslots). Due to lack
of coherency for SEV encrypted memory, failure to flush results in silent
data corruption if userspace is mal... |
void killchild(gpointer key, gpointer value, gpointer user_data) {
pid_t *pid=value;
int *parent=user_data;
kill(*pid, SIGTERM);
*parent=1;
} | 0 | [
"CWE-119"
] | nbd | 4ed24fe0d64c7cc9963c57b52cad1555ad7c6b60 | 284,573,697,891,263,550,000,000,000,000,000,000,000 | 7 | r134: CVE-2005-3534 |
_asn1_set_right (asn1_node node, asn1_node right)
{
if (node == NULL)
return node;
node->right = right;
if (right)
right->left = node;
return node;
} | 0 | [
"CWE-119"
] | libtasn1 | 5520704d075802df25ce4ffccc010ba1641bd484 | 261,882,507,907,542,360,000,000,000,000,000,000,000 | 9 | asn1_find_node: added safety check on asn1_find_node()
This prevents a stack overflow in asn1_find_node() which
is triggered by too long variable names in the definitions
files. That means that applications have to deliberately
pass a too long 'name' constant to asn1_write_value()
and friends. Reported by Jakub Jiras... |
void signal_setup_done(int failed, struct ksignal *ksig, int stepping)
{
if (failed)
force_sigsegv(ksig->sig, current);
else
signal_delivered(ksig->sig, &ksig->info, &ksig->ka,
signal_pt_regs(), stepping);
} | 0 | [
"CWE-399"
] | linux | b9e146d8eb3b9ecae5086d373b50fa0c1f3e7f0f | 23,956,309,378,026,943,000,000,000,000,000,000,000 | 8 | kernel/signal.c: stop info leak via the tkill and the tgkill syscalls
This fixes a kernel memory contents leak via the tkill and tgkill syscalls
for compat processes.
This is visible in the siginfo_t->_sifields._rt.si_sigval.sival_ptr field
when handling signals delivered from tkill.
The place of the infoleak:
int ... |
cert_parse(
const u_char *asn1cert, /* X509 certificate */
long len, /* certificate length */
tstamp_t fstamp /* filestamp */
)
{
X509 *cert; /* X509 certificate */
X509_EXTENSION *ext; /* X509v3 extension */
struct cert_info *ret; /* certificate info/value */
BIO *bp;
char pathbuf[MAXFILENAME];
const u_ch... | 0 | [
"CWE-20"
] | ntp | c4cd4aaf418f57f7225708a93bf48afb2bc9c1da | 56,311,803,295,492,970,000,000,000,000,000,000,000 | 181 | CVE-2014-9297 |
AP_DECLARE(int) ap_directory_walk(request_rec *r)
{
ap_conf_vector_t *now_merged = NULL;
core_server_config *sconf =
ap_get_core_module_config(r->server->module_config);
ap_conf_vector_t **sec_ent = (ap_conf_vector_t **) sconf->sec_dir->elts;
int num_sec = sconf->sec_dir->nelts;
walk_cache_t... | 0 | [] | httpd | eb986059aa5aa0b6c1d52714ea83e3dd758afdd1 | 167,359,709,377,899,480,000,000,000,000,000,000,000 | 789 | Merge r1889036 from trunk:
legacy default slash-matching behavior w/ 'MergeSlashes OFF'
Submitted By: Ruediger Pluem
Reviewed By: covener, rpluem, ylavic
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1889038 13f79535-47bb-0310-9956-ffa450edef68 |
vips_foreign_load_gif_is_a( const char *filename )
{
unsigned char buf[4];
if( vips__get_bytes( filename, buf, 4 ) == 4 &&
vips_foreign_load_gif_is_a_buffer( buf, 4 ) )
return( 1 );
return( 0 );
} | 0 | [
"CWE-416"
] | libvips | ce684dd008532ea0bf9d4a1d89bacb35f4a83f4d | 128,734,454,527,929,370,000,000,000,000,000,000,000 | 10 | fetch map after DGifGetImageDesc()
Earlier refactoring broke GIF map fetch. |
int snd_rawmidi_drain_input(struct snd_rawmidi_substream *substream)
{
snd_rawmidi_input_trigger(substream, 0);
reset_runtime_ptrs(substream->runtime, true);
return 0;
} | 0 | [
"CWE-416"
] | linux | c1f6e3c818dd734c30f6a7eeebf232ba2cf3181d | 308,299,594,305,151,800,000,000,000,000,000,000,000 | 6 | ALSA: rawmidi: Fix racy buffer resize under concurrent accesses
The rawmidi core allows user to resize the runtime buffer via ioctl,
and this may lead to UAF when performed during concurrent reads or
writes: the read/write functions unlock the runtime lock temporarily
during copying form/to user-space, and that's the ... |
static int selinux_mmap_addr(unsigned long addr)
{
int rc = 0;
if (addr < CONFIG_LSM_MMAP_MIN_ADDR) {
u32 sid = current_sid();
rc = avc_has_perm(sid, sid, SECCLASS_MEMPROTECT,
MEMPROTECT__MMAP_ZERO, NULL);
}
return rc;
} | 0 | [
"CWE-682"
] | linux-stable | 0c461cb727d146c9ef2d3e86214f498b78b7d125 | 305,481,491,284,520,300,000,000,000,000,000,000,000 | 12 | selinux: fix off-by-one in setprocattr
SELinux tries to support setting/clearing of /proc/pid/attr attributes
from the shell by ignoring terminating newlines and treating an
attribute value that begins with a NUL or newline as an attempt to
clear the attribute. However, the test for clearing attributes has
always bee... |
static const char *str_callback(RNum *user, ut64 off, int *ok) {
const RList *list;
RFlag *f = (RFlag*)user;
RFlagItem *item;
if (ok) {
*ok = 0;
}
if (f) {
list = r_flag_get_list (f, off);
item = r_list_get_top (list);
if (item) {
if (ok) {
*ok = true;
}
return item->name;
}
}
return NULL... | 0 | [
"CWE-125",
"CWE-787"
] | radare2 | 52b1526443c1f433087928291d1c3d37a5600515 | 115,028,192,434,325,950,000,000,000,000,000,000,000 | 19 | Fix crash in wasm disassembler |
static av_cold int cdxl_decode_init(AVCodecContext *avctx)
{
CDXLVideoContext *c = avctx->priv_data;
c->new_video_size = 0;
c->avctx = avctx;
return 0;
} | 0 | [
"CWE-119",
"CWE-787"
] | FFmpeg | e1b60aad77c27ed5d4dfc11e5e6a05a38c70489d | 195,660,041,929,209,240,000,000,000,000,000,000,000 | 9 | avcodec/cdxl: Check format parameter
Fixes out of array access
Fixes: 1378/clusterfuzz-testcase-minimized-5715088008806400
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> |
static struct btrfs_device *add_missing_dev(struct btrfs_fs_devices *fs_devices,
u64 devid, u8 *dev_uuid)
{
struct btrfs_device *device;
unsigned int nofs_flag;
/*
* We call this under the chunk_mutex, so we want to use NOFS for this
* allocation, however we don't want to change btrfs_alloc_device() to... | 0 | [
"CWE-476",
"CWE-703"
] | linux | e4571b8c5e9ffa1e85c0c671995bd4dcc5c75091 | 114,863,264,412,249,530,000,000,000,000,000,000,000 | 27 | btrfs: fix NULL pointer dereference when deleting device by invalid id
[BUG]
It's easy to trigger NULL pointer dereference, just by removing a
non-existing device id:
# mkfs.btrfs -f -m single -d single /dev/test/scratch1 \
/dev/test/scratch2
# mount /dev/test/scratch1 /mnt/btrfs
# btrfs device remove 3 /... |
TypeIdV1& type_id()
{
return type_id_;
} | 0 | [
"CWE-284"
] | Fast-DDS | d2aeab37eb4fad4376b68ea4dfbbf285a2926384 | 23,120,743,510,989,103,000,000,000,000,000,000,000 | 4 | check remote permissions (#1387)
* Refs 5346. Blackbox test
Signed-off-by: Iker Luengo <ikerluengo@eprosima.com>
* Refs 5346. one-way string compare
Signed-off-by: Iker Luengo <ikerluengo@eprosima.com>
* Refs 5346. Do not add partition separator on last partition
Signed-off-by: Iker Luengo <ikerluengo@e... |
size_t EC_GROUP_set_seed(EC_GROUP *group, const unsigned char *p, size_t len)
{
OPENSSL_free(group->seed);
group->seed = NULL;
group->seed_len = 0;
if (!len || !p)
return 1;
if ((group->seed = OPENSSL_malloc(len)) == NULL)
return 0;
memcpy(group->seed, p, len);
group->seed_... | 0 | [] | openssl | 7c1709c2da5414f5b6133d00a03fc8c5bf996c7a | 332,928,587,335,350,360,000,000,000,000,000,000,000 | 16 | [crypto/ec] for ECC parameters with NULL or zero cofactor, compute it
The cofactor argument to EC_GROUP_set_generator is optional, and SCA
mitigations for ECC currently use it. So the library currently falls
back to very old SCA-vulnerable code if the cofactor is not present.
This PR allows EC_GROUP_set_generator to ... |
static int check_target(struct ip6t_entry *e, struct net *net, const char *name)
{
struct xt_entry_target *t = ip6t_get_target(e);
struct xt_tgchk_param par = {
.net = net,
.table = name,
.entryinfo = e,
.target = t->u.kernel.target,
.targinfo = t->data,
.hook_mask = e->comefrom,
.family ... | 0 | [
"CWE-200"
] | linux-2.6 | 6a8ab060779779de8aea92ce3337ca348f973f54 | 295,445,535,498,256,950,000,000,000,000,000,000,000 | 24 | ipv6: netfilter: ip6_tables: fix infoleak to userspace
Structures ip6t_replace, compat_ip6t_replace, and xt_get_revision are
copied from userspace. Fields of these structs that are
zero-terminated strings are not checked. When they are used as argument
to a format string containing "%s" in request_module(), some sen... |
CImg<T>& draw_rectangle(const int x0, const int y0, const int z0, const int c0,
const int x1, const int y1, const int z1, const int c1,
const T val, const float opacity=1) {
if (is_empty()) return *this;
const int
nx0 = x0<x1?x0:x1, nx1 = x... | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 255,497,235,805,592,100,000,000,000,000,000,000,000 | 35 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
void vrend_set_framebuffer_state(struct vrend_context *ctx,
uint32_t nr_cbufs, uint32_t surf_handle[PIPE_MAX_COLOR_BUFS],
uint32_t zsurf_handle)
{
struct vrend_surface *surf, *zsurf;
int i;
int old_num;
GLenum status;
GLint new_height = -1... | 0 | [
"CWE-787"
] | virglrenderer | cbc8d8b75be360236cada63784046688aeb6d921 | 36,118,614,182,348,234,000,000,000,000,000,000,000 | 97 | vrend: check transfer bounds for negative values too and report error
Closes #138
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com> |
int wc_RsaSSL_VerifyInline(byte* in, word32 inLen, byte** out, RsaKey* key)
{
WC_RNG* rng;
#ifdef WC_RSA_BLINDING
rng = key->rng;
#else
rng = NULL;
#endif
return RsaPrivateDecryptEx(in, inLen, in, inLen, out, key,
RSA_PUBLIC_DECRYPT, RSA_BLOCK_TYPE_1, WC_RSA_PKCSV15_PAD,
WC_HASH_TYPE_NON... | 0 | [
"CWE-310",
"CWE-787"
] | wolfssl | fb2288c46dd4c864b78f00a47a364b96a09a5c0f | 123,354,998,761,752,330,000,000,000,000,000,000,000 | 12 | RSA-PSS: Handle edge case with encoding message to hash
When the key is small relative to the digest (1024-bit key, 64-byte
hash, 61-byte salt length), the internal message to hash is larger than
the output size.
Allocate a buffer for the message when this happens. |
void RemoteFsDevice::umountStatus(const QString &mp, int pid, int st)
{
if (pid==getpid() && mp==mountPoint(details, false)) {
messageSent=false;
if (0!=st) {
emit error(tr("Failed to disconnect from \"%1\"").arg(details.name));
setStatusMessage(QString());
} else {
... | 0 | [
"CWE-20",
"CWE-22"
] | cantata | afc4f8315d3e96574925fb530a7004cc9e6ce3d3 | 212,561,863,251,472,400,000,000,000,000,000,000,000 | 15 | Remove internal Samba shre mounting code, this had some privilege escalation issues, and is not well tested |
static bool IsEnabledImpl() {
const char* tf_env_var_val = getenv(EnvVar::kName);
if (tf_env_var_val != nullptr) {
absl::string_view tf_env_var_val_str(tf_env_var_val);
if (tf_env_var_val_str == "0") {
return false;
}
return true;
}
return EnvVar::kDefaultFlag;
} | 0 | [
"CWE-20"
] | tensorflow | 14755416e364f17fb1870882fa778c7fec7f16e3 | 173,063,809,863,559,330,000,000,000,000,000,000,000 | 11 | Prevent CHECK-fail in LSTM/GRU with zero-length input.
PiperOrigin-RevId: 346239181
Change-Id: I5f233dbc076aab7bb4e31ba24f5abd4eaf99ea4f |
xmlResolveResourceFromCatalog(const char *URL, const char *ID,
xmlParserCtxtPtr ctxt) {
xmlChar *resource = NULL;
xmlCatalogAllow pref;
/*
* If the resource doesn't exists as a file,
* try to load it from the resource pointed in the catalogs
*/
pref = xmlCat... | 0 | [
"CWE-134"
] | libxml2 | 4472c3a5a5b516aaf59b89be602fbce52756c3e9 | 243,529,527,212,612,240,000,000,000,000,000,000,000 | 60 | Fix some format string warnings with possible format string vulnerability
For https://bugzilla.gnome.org/show_bug.cgi?id=761029
Decorate every method in libxml2 with the appropriate
LIBXML_ATTR_FORMAT(fmt,args) macro and add some cleanups
following the reports. |
static void statement (LexState *ls) {
int line = ls->linenumber; /* may be needed for error messages */
enterlevel(ls);
switch (ls->t.token) {
case ';': { /* stat -> ';' (empty statement) */
luaX_next(ls); /* skip ';' */
break;
}
case TK_IF: { /* stat -> ifstat */
ifstat(ls, lin... | 0 | [
"CWE-125"
] | lua | 1f3c6f4534c6411313361697d98d1145a1f030fa | 203,953,371,752,346,040,000,000,000,000,000,000,000 | 71 | Bug: Lua can generate wrong code when _ENV is <const> |
bit_read_BE (Bit_Chain *restrict dat, double *restrict x, double *restrict y,
double *restrict z)
{
if (dat->version >= R_2000 && bit_read_B (dat))
{
*x = 0.0;
*y = 0.0;
*z = 1.0;
}
else
{
*x = bit_read_BD (dat);
*y = bit_read_BD (dat);
*z = bit_read_BD (... | 0 | [
"CWE-703",
"CWE-125"
] | libredwg | 95cc9300430d35feb05b06a9badf678419463dbe | 38,298,152,499,939,160,000,000,000,000,000,000,000 | 16 | encode: protect from stack under-flow
From GH #178 fuzzing |
void afterSubobject(NimbleProtocolReader* iprot) {
borrowFieldPtrs(iprot);
decoderState = iprot->borrowState();
} | 0 | [
"CWE-703",
"CWE-770"
] | fbthrift | 3f156207e8a6583d88999487e954320dc18955e6 | 54,574,478,118,910,570,000,000,000,000,000,000,000 | 4 | Better handling of truncated data when reading containers
Summary:
Currently we read the container size and blindly pre-allocate the container of that size. This allows malicious attacker to send few bytes message and cause server to allocate GBs of memory.
This diff changes the logic to check if we have at least 1b/... |
static int cac_parse_properties_object(sc_card_t *card, u8 type,
u8 *data, size_t data_len, cac_properties_object_t *object)
{
size_t len;
u8 *val, *val_end, tag;
int parsed = 0;
if (data_len < 11)
return -1;
/* Initilize: non-PKI applet */
object->privatekey = 0;
val = data;
val_end = data + data_len;... | 0 | [
"CWE-415",
"CWE-119"
] | OpenSC | 360e95d45ac4123255a4c796db96337f332160ad | 127,154,831,880,463,780,000,000,000,000,000,000,000 | 77 | fixed out of bounds writes
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting the problems. |
_copyCreateEventTrigStmt(const CreateEventTrigStmt *from)
{
CreateEventTrigStmt *newnode = makeNode(CreateEventTrigStmt);
COPY_STRING_FIELD(trigname);
COPY_SCALAR_FIELD(eventname);
COPY_NODE_FIELD(whenclause);
COPY_NODE_FIELD(funcname);
return newnode;
} | 0 | [
"CWE-362"
] | postgres | 5f173040e324f6c2eebb90d86cf1b0cdb5890f0a | 31,006,944,905,477,820,000,000,000,000,000,000,000 | 11 | 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... |
void Item_maxmin_subselect::no_rows_in_result()
{
/*
Subquery predicates outside of the SELECT list must be evaluated in order
to possibly filter the special result row generated for implicit grouping
if the subquery is in the HAVING clause.
If the predicate is constant, we need its actual value in th... | 0 | [
"CWE-89"
] | server | 3c209bfc040ddfc41ece8357d772547432353fd2 | 178,050,245,135,283,940,000,000,000,000,000,000,000 | 16 | MDEV-25994: Crash with union of my_decimal type in ORDER BY clause
When single-row subquery fails with "Subquery reutrns more than 1 row"
error, it will raise an error and return NULL.
On the other hand, Item_singlerow_subselect sets item->maybe_null=0
for table-less subqueries like "(SELECT not_null_value)" (*)
Th... |
static struct Qdisc *qdisc_leaf(struct Qdisc *p, u32 classid)
{
unsigned long cl;
struct Qdisc *leaf;
struct Qdisc_class_ops *cops = p->ops->cl_ops;
if (cops == NULL)
return NULL;
cl = cops->get(p, classid);
if (cl == 0)
return NULL;
leaf = cops->leaf(p, cl);
cops->put(p, cl);
return leaf;
} | 0 | [
"CWE-200"
] | linux-2.6 | 9ef1d4c7c7aca1cd436612b6ca785b726ffb8ed8 | 305,713,564,778,789,850,000,000,000,000,000,000,000 | 16 | [NETLINK]: Missing initializations in dumped data
Mostly missing initialization of padding fields of 1 or 2 bytes length,
two instances of uninitialized nlmsgerr->msg of 16 bytes length.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net> |
zfs_copy_ace_2_oldace(vtype_t obj_type, zfs_acl_t *aclp, ace_t *acep,
zfs_oldace_t *z_acl, int aclcnt, size_t *size)
{
int i;
zfs_oldace_t *aceptr = z_acl;
for (i = 0; i != aclcnt; i++, aceptr++) {
aceptr->z_access_mask = acep[i].a_access_mask;
aceptr->z_type = acep[i].a_type;
aceptr->z_flags = acep[i].a_... | 0 | [
"CWE-200",
"CWE-732"
] | zfs | 716b53d0a14c72bda16c0872565dd1909757e73f | 325,994,571,046,515,160,000,000,000,000,000,000,000 | 21 | FreeBSD: Fix UNIX permissions checking
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Matt Macy <mmacy@FreeBSD.org>
Closes #10727 |
_public_ int sd_bus_open(sd_bus **ret) {
return sd_bus_open_with_description(ret, NULL);
} | 0 | [
"CWE-416"
] | systemd | 1068447e6954dc6ce52f099ed174c442cb89ed54 | 173,565,968,193,126,600,000,000,000,000,000,000,000 | 3 | 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... |
vxlan_fdb_external_learn_add(struct net_device *dev,
struct switchdev_notifier_vxlan_fdb_info *fdb_info)
{
struct vxlan_dev *vxlan = netdev_priv(dev);
struct netlink_ext_ack *extack;
u32 hash_index;
int err;
hash_index = fdb_head_index(vxlan, fdb_info->eth_addr, fdb_info->vni);
extack = switchdev_notifie... | 0 | [] | net | 6c8991f41546c3c472503dff1ea9daaddf9331c2 | 257,330,203,303,816,180,000,000,000,000,000,000,000 | 25 | net: ipv6_stub: use ip6_dst_lookup_flow instead of ip6_dst_lookup
ipv6_stub uses the ip6_dst_lookup function to allow other modules to
perform IPv6 lookups. However, this function skips the XFRM layer
entirely.
All users of ipv6_stub->ip6_dst_lookup use ip_route_output_flow (via the
ip_route_output_key and ip_route_o... |
Tag::~Tag() {} | 0 | [
"CWE-20"
] | libvpx | f00890eecdf8365ea125ac16769a83aa6b68792d | 250,567,853,767,610,200,000,000,000,000,000,000,000 | 1 | update libwebm to libwebm-1.0.0.27-352-g6ab9fcf
https://chromium.googlesource.com/webm/libwebm/+log/af81f26..6ab9fcf
Change-Id: I9d56e1fbaba9b96404b4fbabefddc1a85b79c25d |
JANET_CORE_FN(cfun_array_clear,
"(array/clear arr)",
"Empties an array, setting it's count to 0 but does not free the backing capacity. "
"Returns the modified array.") {
janet_fixarity(argc, 1);
JanetArray *array = janet_getarray(argv, 0);
array->count = 0;
ret... | 0 | [
"CWE-787"
] | janet | 7fda7709ff15ab4b4cdea57619365eb2798f15c4 | 277,680,918,566,787,660,000,000,000,000,000,000,000 | 9 | fix negative count passed to cfun_array_new_filled |
int devm_device_add_group(struct device *dev, const struct attribute_group *grp)
{
union device_attr_group_devres *devres;
int error;
devres = devres_alloc(devm_attr_group_remove,
sizeof(*devres), GFP_KERNEL);
if (!devres)
return -ENOMEM;
error = sysfs_create_group(&dev->kobj, grp);
if (error) {
de... | 0 | [
"CWE-787"
] | linux | aa838896d87af561a33ecefea1caa4c15a68bc47 | 109,291,733,200,369,430,000,000,000,000,000,000,000 | 20 | drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions
Convert the various sprintf fmaily calls in sysfs device show functions
to sysfs_emit and sysfs_emit_at for PAGE_SIZE buffer safety.
Done with:
$ spatch -sp-file sysfs_emit_dev.cocci --in-place --max-width=80 .
And cocci script:
$ cat s... |
static struct sctp_association *__sctp_endpoint_lookup_assoc(
const struct sctp_endpoint *ep,
const union sctp_addr *paddr,
struct sctp_transport **transport)
{
struct sctp_association *asoc = NULL;
struct sctp_transport *t = NULL;
struct sctp_hashbucket *head;
struct sctp_ep_common *epb;
struct hlist_node *nod... | 0 | [] | linux-2.6 | 5e739d1752aca4e8f3e794d431503bfca3162df4 | 336,502,175,594,983,700,000,000,000,000,000,000,000 | 35 | sctp: fix potential panics in the SCTP-AUTH API.
All of the SCTP-AUTH socket options could cause a panic
if the extension is disabled and the API is envoked.
Additionally, there were some additional assumptions that
certain pointers would always be valid which may not
always be the case.
This patch hardens the API a... |
bool LosslessScan::ParseMCU(void)
{
#if ACCUSOFT_CODE
int i;
struct Line *top[4],*prev[4];
int lines = 8; // total number of MCU lines processed.
for(i = 0;i < m_ucCount;i++) {
class Component *comp = ComponentOf(i);
UBYTE idx = comp->IndexOf();
top[i] = m_pLineCtrl->CurrentLin... | 0 | [
"CWE-119",
"CWE-703"
] | libjpeg | ef4a29a62ab48b8dc235f4af52cfd6319eda9a6a | 83,782,109,713,994,280,000,000,000,000,000,000,000 | 41 | Added out-of-bounds checks for lossless symbol decoding and AC context
indices. Worked around some gcc warnings. Bumped to 1.64. |
int tcp_v4_rcv(struct sk_buff *skb)
{
const struct iphdr *iph;
struct tcphdr *th;
struct sock *sk;
int ret;
struct net *net = dev_net(skb->dev);
if (skb->pkt_type != PACKET_HOST)
goto discard_it;
/* Count it even if it's bad */
TCP_INC_STATS_BH(net, TCP_MIB_INSEGS);
if (!pskb_may_pull(skb, sizeof(struct t... | 0 | [
"CWE-362"
] | linux-2.6 | f6d8bd051c391c1c0458a30b2a7abcd939329259 | 335,690,163,790,241,120,000,000,000,000,000,000,000 | 143 | inet: add RCU protection to inet->opt
We lack proper synchronization to manipulate inet->opt ip_options
Problem is ip_make_skb() calls ip_setup_cork() and
ip_setup_cork() possibly makes a copy of ipc->opt (struct ip_options),
without any protection against another thread manipulating inet->opt.
Another thread can ch... |
static int __init vmx_init(void)
{
void *va;
int r;
vmx_io_bitmap_a = alloc_page(GFP_KERNEL | __GFP_HIGHMEM);
if (!vmx_io_bitmap_a)
return -ENOMEM;
vmx_io_bitmap_b = alloc_page(GFP_KERNEL | __GFP_HIGHMEM);
if (!vmx_io_bitmap_b) {
r = -ENOMEM;
goto out;
}
vmx_msr_bitmap = alloc_page(GFP_KERNEL | __GFP_H... | 0 | [
"CWE-20"
] | linux-2.6 | 16175a796d061833aacfbd9672235f2d2725df65 | 336,182,528,555,265,200,000,000,000,000,000,000,000 | 76 | KVM: VMX: Don't allow uninhibited access to EFER on i386
vmx_set_msr() does not allow i386 guests to touch EFER, but they can still
do so through the default: label in the switch. If they set EFER_LME, they
can oops the host.
Fix by having EFER access through the normal channel (which will check for
EFER_LME) even o... |
get_opclass(Oid opclass, Oid actual_datatype)
{
List *result = NIL;
HeapTuple ht_opc;
Form_pg_opclass opc_rec;
ht_opc = SearchSysCache1(CLAOID, ObjectIdGetDatum(opclass));
if (!HeapTupleIsValid(ht_opc))
elog(ERROR, "cache lookup failed for opclass %u", opclass);
opc_rec = (Form_pg_opclass) GETSTRUCT(ht_opc)... | 0 | [
"CWE-362"
] | postgres | 5f173040e324f6c2eebb90d86cf1b0cdb5890f0a | 146,222,036,042,149,600,000,000,000,000,000,000,000 | 23 | Avoid repeated name lookups during table and index DDL.
If the name lookups come to different conclusions due to concurrent
activity, we might perform some parts of the DDL on a different table
than other parts. At least in the case of CREATE INDEX, this can be
used to cause the permissions checks to be performed aga... |
static void settings_init(void) {
settings.use_cas = true;
settings.access = 0700;
settings.port = 11211;
settings.udpport = 11211;
/* By default this string should be NULL for getaddrinfo() */
settings.inter = NULL;
settings.maxbytes = 64 * 1024 * 1024; /* default is 64MB */
settings.ma... | 0 | [
"CWE-190"
] | memcached | bd578fc34b96abe0f8d99c1409814a09f51ee71c | 222,330,617,286,890,720,000,000,000,000,000,000,000 | 46 | CVE reported by cisco talos |
clear_lval(lval_T *lp)
{
vim_free(lp->ll_exp_name);
vim_free(lp->ll_newkey);
} | 0 | [
"CWE-122",
"CWE-787"
] | vim | 605ec91e5a7330d61be313637e495fa02a6dc264 | 337,494,165,305,603,340,000,000,000,000,000,000,000 | 5 | patch 8.2.3847: illegal memory access when using a lambda with an error
Problem: Illegal memory access when using a lambda with an error.
Solution: Avoid skipping over the NUL after a string. |
OFBool DcmSCP::addStatusDetail(DcmDataset **statusDetail,
const DcmElement *elem)
{
DCMNET_TRACE("Add element to status detail");
// If no element was passed, return to the caller.
if( elem == NULL )
return OFFalse;
DcmAttributeTag *at;
DcmLongString *lo;
// Create the c... | 0 | [
"CWE-264"
] | dcmtk | beaf5a5c24101daeeafa48c375120b16197c9e95 | 26,264,034,003,869,986,000,000,000,000,000,000,000 | 67 | Make sure to handle setuid() return code properly.
In some tools the return value of setuid() is not checked. In the worst
case this could lead to privilege escalation since the process does not
give up its root privileges and continue as root. |
void worker_stop_accept(void* arg)
{
struct worker* worker = (struct worker*)arg;
listen_stop_accept(worker->front);
if(worker->thread_num == 0)
daemon_remote_stop_accept(worker->daemon->rc);
} | 0 | [
"CWE-613",
"CWE-703"
] | unbound | f6753a0f1018133df552347a199e0362fc1dac68 | 33,762,652,130,840,306,000,000,000,000,000,000,000 | 7 | - Fix the novel ghost domain issues CVE-2022-30698 and CVE-2022-30699. |
int fat_alloc_new_dir(struct inode *dir, struct timespec *ts)
{
struct super_block *sb = dir->i_sb;
struct msdos_sb_info *sbi = MSDOS_SB(sb);
struct buffer_head *bhs[MAX_BUF_PER_PAGE];
struct msdos_dir_entry *de;
sector_t blknr;
__le16 date, time;
int err, cluster;
err = fat_alloc_clusters(dir, &cluster, 1);
... | 0 | [] | linux-2.6 | c483bab099cb89e92b7cad94a52fcdaf37e56657 | 336,015,034,083,447,450,000,000,000,000,000,000,000 | 60 | fat: fix VFAT compat ioctls on 64-bit systems
If you compile and run the below test case in an msdos or vfat directory on
an x86-64 system with -m32 you'll get garbage in the kernel_dirent struct
followed by a SIGSEGV.
The patch fixes this.
Reported and initial fix by Bart Oldeman
#include <sys/types.h>
#include <s... |
R_API RList *r_bin_get_symbols(RBin *bin) {
RBinObject *o = r_bin_cur_object (bin);
return o? o->symbols: NULL;
} | 0 | [
"CWE-125"
] | radare2 | d31c4d3cbdbe01ea3ded16a584de94149ecd31d9 | 182,743,036,774,022,600,000,000,000,000,000,000,000 | 4 | Fix #8748 - Fix oobread on string search |
void expectUnhealthyTransition(size_t index, bool first_check) {
EXPECT_CALL(*this, onHostStatus(_, HealthTransition::Changed));
EXPECT_CALL(*test_sessions_[index]->timeout_timer_, disableTimer());
EXPECT_CALL(*test_sessions_[index]->interval_timer_, enableTimer(_, _));
if (first_check) {
EXPECT... | 0 | [
"CWE-476"
] | envoy | 9b1c3962172a972bc0359398af6daa3790bb59db | 251,524,057,321,974,960,000,000,000,000,000,000,000 | 9 | healthcheck: fix grpc inline removal crashes (#749)
Signed-off-by: Matt Klein <mklein@lyft.com>
Signed-off-by: Pradeep Rao <pcrao@google.com> |
LUALIB_API int luaL_typerror(lua_State *L, int narg, const char *xname)
{
lj_err_argtype(L, narg, xname);
return 0; /* unreachable */
} | 0 | [
"CWE-125"
] | LuaJIT | 53f82e6e2e858a0a62fd1a2ff47e9866693382e6 | 50,832,374,708,764,460,000,000,000,000,000,000,000 | 5 | Fix frame traversal for __gc handler frames.
Reported by Changochen. |
reset_last_sourcing(void)
{
VIM_CLEAR(last_sourcing_name);
last_sourcing_lnum = 0;
} | 0 | [
"CWE-416"
] | vim | 9f1a39a5d1cd7989ada2d1cb32f97d84360e050f | 7,052,406,951,873,496,000,000,000,000,000,000,000 | 5 | 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. |
Item *Item_sum::result_item(THD *thd, Field *field)
{
return new (thd->mem_root) Item_field(thd, field);
} | 0 | [
"CWE-120"
] | server | eca207c46293bc72dd8d0d5622153fab4d3fccf1 | 23,613,481,453,974,965,000,000,000,000,000,000,000 | 4 | 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... |
void URI_FUNC(ResetUri)(URI_TYPE(Uri) * uri) {
memset(uri, 0, sizeof(URI_TYPE(Uri)));
} | 1 | [
"CWE-476"
] | uriparser | f58c25069cf4a986fe17a80c5b38687e31feb539 | 89,098,036,514,261,260,000,000,000,000,000,000,000 | 3 | ResetUri: Protect against NULL |
int apply_event_filter(struct trace_event_file *file, char *filter_string)
{
struct trace_event_call *call = file->event_call;
struct event_filter *filter = NULL;
int err;
if (!strcmp(strstrip(filter_string), "0")) {
filter_disable(file);
filter = event_filter(file);
if (!filter)
return 0;
event_clear... | 0 | [
"CWE-787"
] | linux | 70303420b5721c38998cf987e6b7d30cc62d4ff1 | 265,324,813,928,365,000,000,000,000,000,000,000,000 | 50 | tracing: Check for no filter when processing event filters
The syzkaller detected a out-of-bounds issue with the events filter code,
specifically here:
prog[N].pred = NULL; /* #13 */
prog[N].target = 1; /* TRUE */
prog[N+1].pred = NULL;
prog[N+1].target = 0; /* FALSE */
-> prog[N-1].target = N;
prog[N-1].w... |
static void qeth_set_multiple_write_queues(struct qeth_card *card)
{
if ((atomic_read(&card->qdio.state) != QETH_QDIO_UNINITIALIZED) &&
(card->qdio.no_out_queues == 1)) {
qeth_free_qdio_buffers(card);
card->qdio.default_out_queue = 2;
}
card->qdio.no_out_queues = 4;
} | 0 | [
"CWE-200",
"CWE-119"
] | linux | 6fb392b1a63ae36c31f62bc3fc8630b49d602b62 | 330,901,080,349,105,430,000,000,000,000,000,000,000 | 9 | 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... |
void * calloc(size_t n, size_t lb)
{
# if defined(GC_LINUX_THREADS) /* && !defined(USE_PROC_FOR_LIBRARIES) */
/* libpthread allocated some memory that is only pointed to by */
/* mmapped thread stacks. Make sure it's not collectable. */
{
static GC_bool lib_bounds_set = FALSE;... | 1 | [
"CWE-189"
] | bdwgc | e10c1eb9908c2774c16b3148b30d2f3823d66a9a | 84,839,787,246,431,150,000,000,000,000,000,000,000 | 25 | Fix calloc() overflow
* malloc.c (calloc): Check multiplication overflow in calloc(),
assuming REDIRECT_MALLOC. |
sds sdsnewlen(const void *init, size_t initlen) {
return _sdsnewlen(init, initlen, 0);
} | 0 | [
"CWE-190"
] | redis | d32f2e9999ce003bad0bd2c3bca29f64dcce4433 | 223,531,851,796,901,300,000,000,000,000,000,000,000 | 3 | Fix integer overflow (CVE-2021-21309). (#8522)
On 32-bit systems, setting the proto-max-bulk-len config parameter to a high value may result with integer overflow and a subsequent heap overflow when parsing an input bulk (CVE-2021-21309).
This fix has two parts:
Set a reasonable limit to the config parameter.
A... |
static int filter_pred_none(struct filter_pred *pred, void *event)
{
return 0;
} | 0 | [
"CWE-787"
] | linux | 70303420b5721c38998cf987e6b7d30cc62d4ff1 | 23,105,648,616,278,880,000,000,000,000,000,000,000 | 4 | tracing: Check for no filter when processing event filters
The syzkaller detected a out-of-bounds issue with the events filter code,
specifically here:
prog[N].pred = NULL; /* #13 */
prog[N].target = 1; /* TRUE */
prog[N+1].pred = NULL;
prog[N+1].target = 0; /* FALSE */
-> prog[N-1].target = N;
prog[N-1].w... |
static RETSIGTYPE sigusr2_handler(UNUSED(int val))
{
if (!am_server)
output_summary();
close_all();
if (got_xfer_error)
_exit(RERR_PARTIAL);
_exit(0);
} | 0 | [
"CWE-59"
] | rsync | 962f8b90045ab331fc04c9e65f80f1a53e68243b | 192,218,789,645,629,200,000,000,000,000,000,000,000 | 9 | Complain if an inc-recursive path is not right for its dir.
This ensures that a malicious sender can't use a just-sent
symlink as a trasnfer path. |
static INLINE BOOL zgfx_GetBits(ZGFX_CONTEXT* _zgfx, UINT32 _nbits)
{
if (!_zgfx)
return FALSE;
while (_zgfx->cBitsCurrent < _nbits)
{
_zgfx->BitsCurrent <<= 8;
if (_zgfx->pbInputCurrent < _zgfx->pbInputEnd)
_zgfx->BitsCurrent += *(_zgfx->pbInputCurrent)++;
_zgfx->cBitsCurrent += 8;
}
_zgfx->cBitsRe... | 1 | [
"CWE-119",
"CWE-125",
"CWE-787"
] | FreeRDP | 17c363a5162fd4dc77b1df54e48d7bd9bf6b3be7 | 29,702,721,187,793,083,000,000,000,000,000,000,000 | 20 | Fixed CVE-2018-8784
Thanks to Eyal Itkin from Check Point Software Technologies. |
GF_Err video_sample_entry_Size(GF_Box *s)
{
GF_Err e;
GF_MPEGVisualSampleEntryBox *ptr = (GF_MPEGVisualSampleEntryBox *)s;
gf_isom_video_sample_entry_size((GF_VisualSampleEntryBox *)s);
if (ptr->esd) {
e = gf_isom_box_size((GF_Box *)ptr->esd);
if (e) return e;
ptr->size += ptr->esd->size;
} else if (ptr->c... | 0 | [
"CWE-416"
] | gpac | 6063b1a011c3f80cee25daade18154e15e4c058c | 55,570,288,851,325,000,000,000,000,000,000,000,000 | 156 | fix UAF in audio_sample_entry_Read (#1440) |
void bn_mul_high(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, BN_ULONG *l, int n2,
BN_ULONG *t)
{
int i,n;
int c1,c2;
int neg,oneg,zero;
BN_ULONG ll,lc,*lp,*mp;
# ifdef BN_COUNT
fprintf(stderr," bn_mul_high %d * %d\n",n2,n2);
# endif
n=n2/2;
/* Calculate (al-ah)*(bh-bl) */
neg=zero=0;
c1=bn_cmp_words(&(a[0]... | 0 | [
"CWE-20"
] | openssl | 7e4cae1d2f555cbe9226b377aff4b56c9f7ddd4d | 25,483,107,158,354,393,000,000,000,000,000,000,000 | 184 | PR: 2111
Submitted by: Martin Olsson <molsson@opera.com>
Check for bn_wexpand errors in bn_mul.c |
xfs_ioctl_setattr_get_trans(
struct xfs_inode *ip,
struct xfs_dquot *pdqp)
{
struct xfs_mount *mp = ip->i_mount;
struct xfs_trans *tp;
int error = -EROFS;
if (xfs_is_readonly(mp))
goto out_error;
error = -EIO;
if (xfs_is_shutdown(mp))
goto out_error;
error = xfs_trans_alloc_ichange(ip, NULL, NULL, pdqp... | 0 | [
"CWE-125"
] | linux | 983d8e60f50806f90534cc5373d0ce867e5aaf79 | 206,272,192,104,042,630,000,000,000,000,000,000,000 | 27 | xfs: map unwritten blocks in XFS_IOC_{ALLOC,FREE}SP just like fallocate
The old ALLOCSP/FREESP ioctls in XFS can be used to preallocate space at
the end of files, just like fallocate and RESVSP. Make the behavior
consistent with the other ioctls.
Reported-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Darric... |
static int remove_collection(const mbentry_t *mbentry,
void *rock __attribute__((unused)))
{
int r;
/* Delete mailbox -
Pretend we're an admin since we already deleted the parent */
if (mboxlist_delayed_delete_isenabled()) {
r = mboxlist_delayed_deletemailbox(mbe... | 0 | [] | cyrus-imapd | 6703ff881b6056e0c045a7b795ce8ba1bbb87027 | 112,182,028,114,602,830,000,000,000,000,000,000,000 | 25 | http_dav.c: add 'private' Cache-Control directive for cacheable responses that require authentication |
int nfs4_proc_bind_one_conn_to_session(struct rpc_clnt *clnt,
struct rpc_xprt *xprt,
struct nfs_client *clp,
const struct cred *cred)
{
int status;
struct nfs41_bind_conn_to_session_args args = {
.client = clp,
.dir = NFS4_CDFC4_FORE_OR_BOTH,
.retries = 0,
};
struct nfs41_bind_conn_to_session_res res;
... | 0 | [
"CWE-787"
] | linux | b4487b93545214a9db8cbf32e86411677b0cca21 | 133,308,015,479,002,950,000,000,000,000,000,000,000 | 63 | 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 destroy_all_async(struct usb_dev_state *ps)
{
destroy_async(ps, &ps->async_pending);
} | 0 | [
"CWE-200"
] | linux | 681fef8380eb818c0b845fca5d2ab1dcbab114ee | 310,436,445,099,079,600,000,000,000,000,000,000,000 | 4 | USB: usbfs: fix potential infoleak in devio
The stack object “ci” has a total size of 8 bytes. Its last 3 bytes
are padding bytes which are not initialized and leaked to userland
via “copy_to_user”.
Signed-off-by: Kangjie Lu <kjlu@gatech.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
inline int nci_request(struct nci_dev *ndev,
void (*req)(struct nci_dev *ndev,
const void *opt),
const void *opt, __u32 timeout)
{
int rc;
if (!test_bit(NCI_UP, &ndev->flags))
return -ENETDOWN;
/* Serialize all requests */
mutex_lock(&ndev->req_lock);
rc = __nci_request(ndev, req, opt,... | 1 | [
"CWE-362"
] | linux | 86cdf8e38792545161dbe3350a7eced558ba4d15 | 66,021,090,386,999,140,000,000,000,000,000,000,000 | 17 | NFC: reorganize the functions in nci_request
There is a possible data race as shown below:
thread-A in nci_request() | thread-B in nci_close_device()
| mutex_lock(&ndev->req_lock);
test_bit(NCI_UP, &ndev->flags); |
... | test_and_clear_bit(NCI_UP, &nde... |
int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
{
return -EINVAL;
} | 0 | [
"CWE-20"
] | linux | d26c25a9d19b5976b319af528886f89cf455692d | 327,872,029,017,546,900,000,000,000,000,000,000,000 | 4 | arm64: KVM: Tighten guest core register access from userspace
We currently allow userspace to access the core register file
in about any possible way, including straddling multiple
registers and doing unaligned accesses.
This is not the expected use of the ABI, and nobody is actually
using it that way. Let's tighten ... |
int ff_init_poc(H264Context *h, int pic_field_poc[2], int *pic_poc)
{
const int max_frame_num = 1 << h->sps.log2_max_frame_num;
int field_poc[2];
h->frame_num_offset = h->prev_frame_num_offset;
if (h->frame_num < h->prev_frame_num)
h->frame_num_offset += max_frame_num;
if (h->sps.poc_type ... | 0 | [
"CWE-703"
] | FFmpeg | 29ffeef5e73b8f41ff3a3f2242d356759c66f91f | 83,489,965,703,607,675,000,000,000,000,000,000,000 | 77 | avcodec/h264: do not trust last_pic_droppable when marking pictures as done
This simplifies the code and fixes a deadlock
Fixes Ticket2927
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> |
test_instancing_limit (gconstpointer data)
{
const char *basename = data;
char *filename = get_test_filename (basename);
RsvgHandle *handle;
GError *error = NULL;
cairo_surface_t *surf;
cairo_t *cr;
handle = rsvg_handle_new_from_file (filename, &error);
g_free (filename);
g_assert (... | 0 | [
"CWE-400"
] | librsvg | 572f95f739529b865e2717664d6fefcef9493135 | 294,200,281,494,057,840,000,000,000,000,000,000,000 | 21 | (#515) - Add a limit for the number of loaded elements
This fixes the last part of #515, an enormous SVG file with millions
of elements, which causes out-of-memory.
To avoid unbounded memory consumption, we'll set a hard limit on the
number of loaded elements. The largest legitimate file I have is a
map rendering wi... |
ccid_set_debug_level (int level)
{
int old = debug_level;
if (level != -1)
debug_level = level;
return old;
} | 0 | [
"CWE-20"
] | gnupg | 2183683bd633818dd031b090b5530951de76f392 | 180,606,181,590,802,500,000,000,000,000,000,000,000 | 7 | Use inline functions to convert buffer data to scalars.
* common/host2net.h (buf16_to_ulong, buf16_to_uint): New.
(buf16_to_ushort, buf16_to_u16): New.
(buf32_to_size_t, buf32_to_ulong, buf32_to_uint, buf32_to_u32): New.
--
Commit 91b826a38880fd8a989318585eb502582636ddd8 was not enough to
avoid all sign extension on ... |
static int win_chr_write(CharDriverState *chr, const uint8_t *buf, int len1)
{
WinCharState *s = chr->opaque;
DWORD len, ret, size, err;
len = len1;
ZeroMemory(&s->osend, sizeof(s->osend));
s->osend.hEvent = s->hsend;
while (len > 0) {
if (s->hsend)
ret = WriteFile(s->hcom, ... | 0 | [
"CWE-416"
] | qemu | a4afa548fc6dd9842ed86639b4d37d4d1c4ad480 | 36,226,680,267,830,634,000,000,000,000,000,000,000 | 33 | char: move front end handlers in CharBackend
Since the hanlders are associated with a CharBackend, rather than the
CharDriverState, it is more appropriate to store in CharBackend. This
avoids the handler copy dance in qemu_chr_fe_set_handlers() then
mux_chr_update_read_handler(), by storing the CharBackend pointer
dir... |
vlv_copy_down_controls(TALLOC_CTX *mem_ctx, struct ldb_control **controls)
{
struct ldb_control **new_controls;
unsigned int i, j, num_ctrls;
if (controls == NULL) {
return NULL;
}
for (num_ctrls = 0; controls[num_ctrls]; num_ctrls++);
new_controls = talloc_array(mem_ctx, struct ldb_control *, num_ctrls);
i... | 0 | [
"CWE-416"
] | samba | 32c333def9ad5a1c67abee320cf5f3c4f2cb1e5c | 320,611,622,156,129,770,000,000,000,000,000,000,000 | 49 | CVE-2020-10760 dsdb: Ensure a proper talloc tree for saved controls
Otherwise a paged search on the GC port will fail as the ->data was
not kept around for the second page of searches.
An example command to produce this is
bin/ldbsearch --paged -H ldap://$SERVER:3268 -U$USERNAME%$PASSWORD
This shows up later in the... |
xmlParserEntityCheck(xmlParserCtxtPtr ctxt, size_t size,
xmlEntityPtr ent, size_t replacement)
{
size_t consumed = 0;
if ((ctxt == NULL) || (ctxt->options & XML_PARSE_HUGE))
return (0);
if (ctxt->lastError.code == XML_ERR_ENTITY_LOOP)
return (1);
if (replacement != ... | 1 | [] | libxml2 | be2a7edaf289c5da74a4f9ed3a0b6c733e775230 | 323,471,597,696,691,200,000,000,000,000,000,000,000 | 75 | Fix for CVE-2014-3660
Issues related to the billion laugh entity expansion which happened to
escape the initial set of fixes |
int b43_ssb_probe(struct ssb_device *sdev, const struct ssb_device_id *id)
{
struct b43_bus_dev *dev;
struct b43_wl *wl;
int err;
int first = 0;
dev = b43_bus_dev_ssb_init(sdev);
if (!dev)
return -ENOMEM;
wl = ssb_get_devtypedata(sdev);
if (!wl) {
/* Probing the first core. Must setup common struct b43_wl... | 0 | [
"CWE-134"
] | wireless | 9538cbaab6e8b8046039b4b2eb6c9d614dc782bd | 28,167,292,147,626,206,000,000,000,000,000,000,000 | 40 | 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... |
static int smsusb_submit_urb(struct smsusb_device_t *dev,
struct smsusb_urb_t *surb)
{
if (!surb->cb) {
/* This function can sleep */
surb->cb = smscore_getbuffer(dev->coredev);
if (!surb->cb) {
pr_err("smscore_getbuffer(...) returned NULL\n");
return -ENOMEM;
}
}
usb_fill_bulk_urb(
&surb->u... | 0 | [
"CWE-476"
] | linux | 31e0456de5be379b10fea0fa94a681057114a96e | 177,080,639,499,702,420,000,000,000,000,000,000,000 | 25 | media: usb: siano: Fix general protection fault in smsusb
The syzkaller USB fuzzer found a general-protection-fault bug in the
smsusb part of the Siano DVB driver. The fault occurs during probe
because the driver assumes without checking that the device has both
IN and OUT endpoints and the IN endpoint is ep1.
By sl... |
ExpandBufnames(
char_u *pat,
int *num_file,
char_u ***file,
int options)
{
int count = 0;
buf_T *buf;
int round;
char_u *p;
int attempt;
char_u *patc = NULL;
#ifdef FEAT_VIMINFO
bufmatch_T *matches = NULL;
#endif
int fuzzy;
fuzmatch_str_T *fuzmatch = NULL;
... | 0 | [
"CWE-476"
] | vim | 8e4b76da1d7e987d43ca960dfbc372d1c617466f | 338,249,200,744,661,300,000,000,000,000,000,000,000 | 208 | patch 8.2.4901: NULL pointer access when using invalid pattern
Problem: NULL pointer access when using invalid pattern.
Solution: Check for failed regexp program. |
_tiffReadProc(thandle_t fd, void* buf, tmsize_t size)
{
size_t size_io = (size_t) size;
if ((tmsize_t) size_io != size)
{
errno=EINVAL;
return (tmsize_t) -1;
}
return ((tmsize_t) read((int) fd, buf, size_io));
} | 0 | [
"CWE-369"
] | libtiff | 3c5eb8b1be544e41d2c336191bc4936300ad7543 | 18,158,144,961,461,160,000,000,000,000,000,000,000 | 10 | * libtiff/tif_{unix,vms,win32}.c (_TIFFmalloc): ANSI C does not
require malloc() to return NULL pointer if requested allocation
size is zero. Assure that _TIFFmalloc does. |
const char *mnt_fs_get_root(struct libmnt_fs *fs)
{
return fs ? fs->root : NULL;
} | 0 | [
"CWE-552",
"CWE-703"
] | util-linux | 166e87368ae88bf31112a30e078cceae637f4cdb | 236,723,573,494,461,000,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... |
int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count)
{
int idx, err;
struct snd_pcm_str *pstr = &pcm->streams[stream];
struct snd_pcm_substream *substream, *prev;
#if IS_ENABLED(CONFIG_SND_PCM_OSS)
mutex_init(&pstr->oss.setup_mutex);
#endif
pstr->stream = stream;
pstr->pcm = pcm;
pstr->s... | 0 | [
"CWE-125"
] | linux | 92ee3c60ec9fe64404dc035e7c41277d74aa26cb | 257,023,573,138,160,980,000,000,000,000,000,000,000 | 65 | ALSA: pcm: Fix races among concurrent hw_params and hw_free calls
Currently we have neither proper check nor protection against the
concurrent calls of PCM hw_params and hw_free ioctls, which may result
in a UAF. Since the existing PCM stream lock can't be used for
protecting the whole ioctl operations, we need a new... |
fr_window_use_progress_dialog (FrWindow *window,
gboolean value)
{
window->priv->use_progress_dialog = value;
} | 0 | [
"CWE-22"
] | file-roller | b147281293a8307808475e102a14857055f81631 | 39,953,555,661,142,623,000,000,000,000,000,000,000 | 5 | libarchive: sanitize filenames before extracting |
TfLiteRegistration* Register_AVERAGE_POOL_REF() {
static TfLiteRegistration r = {pooling::Init, pooling::Free,
pooling::GenericPrepare<pooling::kAverage>,
pooling::AverageEval<pooling::kReference>};
return &r;
} | 0 | [
"CWE-703",
"CWE-835"
] | tensorflow | dfa22b348b70bb89d6d6ec0ff53973bacb4f4695 | 196,131,541,731,057,560,000,000,000,000,000,000,000 | 6 | Prevent a division by 0 in average ops.
PiperOrigin-RevId: 385184660
Change-Id: I7affd4554f9b336fca29ac68f633232c094d0bd3 |
static SC_HTMLState sc_html_read_line(SC_HTMLParser *parser)
{
gchar buf[SC_HTMLBUFSIZE];
gchar buf2[SC_HTMLBUFSIZE];
gint index;
gint n;
if (parser->fp == NULL)
return SC_HTML_EOF;
n = fread(buf, 1, sizeof(buf), parser->fp);
if (n == 0) {
parser->state = SC_HTML_EOF;
return SC_HTML_EOF;
} else
buf[n]... | 1 | [] | claws | 5f52f113ac9fd054f10752febbfac340c38cddbe | 51,910,942,544,197,390,000,000,000,000,000,000,000 | 36 | Fix bug #3201 "Fix memory corruption in sc_html_read_line()"
Previously fread() could fill the whole buffer
in which case buf[n] = '\0' messed up the stack.
Introduced in d0c64a09 + 4ab3585743. |
void perf_callchain_user(struct perf_callchain_entry *entry,
struct pt_regs *regs)
{
if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) {
/* We don't support guest os callchain now */
return;
}
perf_callchain_store(entry, regs->pc);
if (!compat_user_mode(regs)) {
/* AARCH64 mode */
struct frame_tail... | 0 | [
"CWE-284",
"CWE-264"
] | linux | 8fff105e13041e49b82f92eef034f363a6b1c071 | 53,147,571,223,655,850,000,000,000,000,000,000,000 | 32 | arm64: perf: reject groups spanning multiple HW PMUs
The perf core implicitly rejects events spanning multiple HW PMUs, as in
these cases the event->ctx will differ. However this validation is
performed after pmu::event_init() is called in perf_init_event(), and
thus pmu::event_init() may be called with a group leader... |
void RemoveSubscriptionSID(Upnp_SID sid, service_info *service)
{
subscription *finger = service->subscriptionList;
subscription *previous = NULL;
while (finger) {
if (!strcmp(sid, finger->sid)) {
if (previous) {
previous->next = finger->next;
} else {
service->subscriptionList = finger->next;
}
... | 0 | [
"CWE-476"
] | pupnp | c805c1de1141cb22f74c0d94dd5664bda37398e0 | 308,857,782,096,118,500,000,000,000,000,000,000,000 | 22 | Fixes #177: NULL pointer dereference in FindServiceControlURLPath
Also fixes its dual bug in FindServiceEventURLPath. |
int slave_start_workers(Relay_log_info *rli, ulong n, bool *mts_inited)
{
uint i;
int error= 0;
mysql_mutex_assert_owner(&rli->run_lock);
if (n == 0 && rli->mts_recovery_group_cnt == 0)
{
reset_dynamic(&rli->workers);
goto end;
}
*mts_inited= true;
/*
The requested through argument numbe... | 0 | [
"CWE-284",
"CWE-295"
] | mysql-server | 3bd5589e1a5a93f9c224badf983cd65c45215390 | 309,514,238,999,771,750,000,000,000,000,000,000,000 | 102 | 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... |
**/
CImg<T>& sqr() {
if (is_empty()) return *this;
cimg_pragma_openmp(parallel for cimg_openmp_if(size()>=524288))
cimg_rof(*this,ptrd,T) { const T val = *ptrd; *ptrd = (T)(val*val); };
return *this; | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 69,864,419,314,921,680,000,000,000,000,000,000,000 | 6 | Fix other issues in 'CImg<T>::load_bmp()'. |
hyphenGetNewState(HyphenDict *dict, HyphenHashTab *hashTab, const CharsString *string) {
hyphenHashInsert(hashTab, string, dict->numStates);
/* predicate is true if dict->numStates is a power of two */
if (!(dict->numStates & (dict->numStates - 1)))
dict->states =
realloc(dict->states, (dict->numStates << 1) *... | 0 | [
"CWE-787"
] | liblouis | fb2bfce4ed49ac4656a8f7e5b5526e4838da1dde | 137,056,355,487,358,700,000,000,000,000,000,000,000 | 13 | Fix yet another buffer overflow in the braille table parser
Reported by Henri Salo
Fixes #592 |
static void hugetlb_free_pmd_range(struct mmu_gather *tlb, pud_t *pud,
unsigned long addr, unsigned long end,
unsigned long floor, unsigned long ceiling)
{
pmd_t *pmd;
unsigned long next;
unsigned long start;
start = addr;
pmd = pmd_offset(pud, addr);
do {
next = pmd_addr_end(addr, end);
if (pm... | 0 | [
"CWE-119"
] | linux | 1be7107fbe18eed3e319a6c3e83c78254b693acb | 229,842,052,313,461,000,000,000,000,000,000,000,000 | 36 | mm: larger stack guard gap, between vmas
Stack guard page is a useful feature to reduce a risk of stack smashing
into a different mapping. We have been using a single page gap which
is sufficient to prevent having stack adjacent to a different mapping.
But this seems to be insufficient in the light of the stack usage ... |
path_table_add_entry(struct path_table *pathtbl, struct isoent *ent)
{
ent->ptnext = NULL;
*pathtbl->last = ent;
pathtbl->last = &(ent->ptnext);
pathtbl->cnt ++;
} | 0 | [
"CWE-190"
] | libarchive | 3014e19820ea53c15c90f9d447ca3e668a0b76c6 | 67,662,572,727,100,190,000,000,000,000,000,000,000 | 7 | Issue 711: Be more careful about verifying filename lengths when writing ISO9660 archives
* Don't cast size_t to int, since this can lead to overflow
on machines where sizeof(int) < sizeof(size_t)
* Check a + b > limit by writing it as
a > limit || b > limit || a + b > limit
to avoid problems when a + b wraps... |
TEST_F(QueryPlannerTest, CanCompoundBoundsWhenSharedPrefixIsMultikeyButHasElemMatch) {
MultikeyPaths multikeyPaths{{0U}, {0U}};
addIndex(BSON("a.b" << 1 << "a.c" << 1), multikeyPaths);
runQuery(fromjson("{a: {$elemMatch: {b: 2, c: 3}}}"));
assertNumSolutions(2U);
assertSolutionExists("{cscan: {dir:... | 0 | [
"CWE-834"
] | mongo | 94d0e046baa64d1aa1a6af97e2d19bb466cc1ff5 | 114,229,068,084,762,480,000,000,000,000,000,000,000 | 11 | SERVER-38164 $or pushdown optimization does not correctly handle $not within an $elemMatch |
int iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn,
enum iscsi_param param, char *buf)
{
struct iscsi_conn *conn = cls_conn->dd_data;
int len;
switch(param) {
case ISCSI_PARAM_PING_TMO:
len = sprintf(buf, "%u\n", conn->ping_timeout);
break;
case ISCSI_PARAM_RECV_TMO:
len = sprintf(buf, "%u\n", con... | 1 | [
"CWE-787"
] | linux | ec98ea7070e94cc25a422ec97d1421e28d97b7ee | 116,125,597,782,879,350,000,000,000,000,000,000,000 | 97 | scsi: iscsi: Ensure sysfs attributes are limited to PAGE_SIZE
As the iSCSI parameters are exported back through sysfs, it should be
enforcing that they never are more than PAGE_SIZE (which should be more
than enough) before accepting updates through netlink.
Change all iSCSI sysfs attributes to use sysfs_emit().
Cc:... |
static bool StreamTcpPacketIsOutdatedAck(TcpSession *ssn, Packet *p)
{
if (ssn->state < TCP_ESTABLISHED)
return false;
if (p->payload_len != 0)
return false;
if ((p->tcph->th_flags & (TH_ACK | TH_SYN | TH_FIN | TH_RST)) != TH_ACK)
return false;
/* lets see if this is a packet th... | 0 | [] | suricata | 50e2b973eeec7172991bf8f544ab06fb782b97df | 143,879,127,857,066,200,000,000,000,000,000,000,000 | 43 | stream/tcp: handle RST with MD5 or AO header
Special handling for RST packets if they have an TCP MD5 or AO header option.
The options hash can't be validated. The end host might be able to validate
it, as it can have a key/password that was communicated out of band.
The sender could use this to move the TCP state to... |
void async_request(TALLOC_CTX *mem_ctx, struct winbindd_child *child,
struct winbindd_request *request,
struct winbindd_response *response,
void (*continuation)(void *private_data, BOOL success),
void *private_data)
{
struct winbindd_async_request *state;
SMB_ASSERT(continuation != NULL);
state... | 0 | [] | samba | c93d42969451949566327e7fdbf29bfcee2c8319 | 290,522,069,479,937,880,000,000,000,000,000,000,000 | 32 | Back-port of Volkers fix.
Fix a race condition in winbind leading to a crash
When SIGCHLD handling is delayed for some reason, sending a request to a child
can fail early because the child has died already. In this case
async_main_request_sent() directly called the continuation function without
pr... |
static __always_inline unsigned long __vmcs_readl(unsigned long field)
{
unsigned long value;
asm volatile (__ex_clear(ASM_VMX_VMREAD_RDX_RAX, "%0")
: "=a"(value) : "d"(field) : "cc");
return value;
} | 0 | [
"CWE-284"
] | linux | 727ba748e110b4de50d142edca9d6a9b7e6111d8 | 267,939,969,978,982,920,000,000,000,000,000,000,000 | 8 | kvm: nVMX: Enforce cpl=0 for VMX instructions
VMX instructions executed inside a L1 VM will always trigger a VM exit
even when executed with cpl 3. This means we must perform the
privilege check in software.
Fixes: 70f3aac964ae("kvm: nVMX: Remove superfluous VMX instruction fault checks")
Cc: stable@vger.kernel.org
S... |
longlong Item_master_pos_wait::val_int()
{
DBUG_ASSERT(fixed == 1);
THD* thd = current_thd;
String *log_name = args[0]->val_str(&value);
int event_count= 0;
null_value=0;
if (thd->slave_thread || !log_name || !log_name->length())
{
null_value = 1;
return 0;
}
#ifdef HAVE_REPLICATION
longlong ... | 0 | [
"CWE-120"
] | server | eca207c46293bc72dd8d0d5622153fab4d3fccf1 | 35,712,549,849,842,540,000,000,000,000,000,000,000 | 57 | 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... |
code_to_mbclen(OnigCodePoint code)
{
if (code < 256) {
if (EncLen_SJIS[(int )code] == 1)
return 1;
else
return 0;
}
else if (code <= 0xffff) {
return 2;
}
else
return ONIGERR_INVALID_CODE_POINT_VALUE;
} | 0 | [
"CWE-125"
] | oniguruma | 65a9b1aa03c9bc2dc01b074295b9603232cb3b78 | 149,782,663,480,953,950,000,000,000,000,000,000,000 | 14 | onig-5.9.2 |
TIFFWriteDirectoryTagRationalArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, float* value)
{
if (dir==NULL)
{
(*ndir)++;
return(1);
}
return(TIFFWriteDirectoryTagCheckedRationalArray(tif,ndir,dir,tag,count,value));
} | 0 | [
"CWE-617"
] | libtiff | de144fd228e4be8aa484c3caf3d814b6fa88c6d9 | 4,500,289,181,016,443,300,000,000,000,000,000,000 | 9 | TIFFWriteDirectorySec: avoid assertion. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2795. CVE-2018-10963 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.