func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
void Magick::Image::kuwahara(const double radius_,const double sigma_)
{
MagickCore::Image
*newImage;
GetPPException;
newImage=KuwaharaImage(constImage(),radius_,sigma_,exceptionInfo);
replaceImage(newImage);
ThrowImageException;
} | 0 | [
"CWE-416"
] | ImageMagick | 8c35502217c1879cb8257c617007282eee3fe1cc | 10,529,324,205,195,072,000,000,000,000,000,000,000 | 10 | Added missing return to avoid use after free. |
int ring_buffer_read_page(struct ring_buffer *buffer,
void **data_page, size_t len, int cpu, int full)
{
struct ring_buffer_per_cpu *cpu_buffer = buffer->buffers[cpu];
struct ring_buffer_event *event;
struct buffer_data_page *bpage;
struct buffer_page *reader;
unsigned long missed_events;
unsigned long flags... | 0 | [
"CWE-190"
] | linux-stable | 59643d1535eb220668692a5359de22545af579f6 | 323,280,461,428,730,700,000,000,000,000,000,000,000 | 162 | ring-buffer: Prevent overflow of size in ring_buffer_resize()
If the size passed to ring_buffer_resize() is greater than MAX_LONG - BUF_PAGE_SIZE
then the DIV_ROUND_UP() will return zero.
Here's the details:
# echo 18014398509481980 > /sys/kernel/debug/tracing/buffer_size_kb
tracing_entries_write() processes this... |
gopher_request_parse(const HttpRequest * req, char *type_id, char *request)
{
::Parser::Tokenizer tok(req->url.path());
if (request)
*request = 0;
tok.skip('/'); // ignore failures? path could be ab-empty
if (tok.atEnd()) {
*type_id = GOPHER_DIRECTORY;
return;
}
stati... | 0 | [
"CWE-400"
] | squid | 780c4ea1b4c9d2fb41f6962aa6ed73ae57f74b2b | 1,466,017,337,050,980,200,000,000,000,000,000,000 | 26 | Improve handling of Gopher responses (#1022) |
void st_select_lex_node::exclude_from_tree()
{
if ((*prev= next))
next->prev= prev;
} | 0 | [
"CWE-476"
] | server | 3a52569499e2f0c4d1f25db1e81617a9d9755400 | 86,542,485,225,291,460,000,000,000,000,000,000,000 | 5 | MDEV-25636: Bug report: abortion in sql/sql_parse.cc:6294
The asserion failure was caused by this query
select /*id=1*/ from t1
where
col= ( select /*id=2*/ from ... where corr_cond1
union
select /*id=4*/ from ... where corr_cond2)
Here,
- select with id=2 was correlated due to corr_cond1.... |
static int udf_read_inode(struct inode *inode, bool hidden_inode)
{
struct buffer_head *bh = NULL;
struct fileEntry *fe;
struct extendedFileEntry *efe;
uint16_t ident;
struct udf_inode_info *iinfo = UDF_I(inode);
struct udf_sb_info *sbi = UDF_SB(inode->i_sb);
struct kernel_lb_addr *iloc = &iinfo->i_location;
un... | 1 | [
"CWE-703",
"CWE-189"
] | linux | 23b133bdc452aa441fcb9b82cbf6dd05cfd342d0 | 18,602,679,416,514,621,000,000,000,000,000,000,000 | 289 | udf: Check length of extended attributes and allocation descriptors
Check length of extended attributes and allocation descriptors when
loading inodes from disk. Otherwise corrupted filesystems could confuse
the code and make the kernel oops.
Reported-by: Carl Henrik Lunde <chlunde@ping.uio.no>
CC: stable@vger.kernel... |
static void FVMenuMakeNamelist(GWindow gw, struct gmenuitem *UNUSED(mi), GEvent *UNUSED(e)) {
FontView *fv = (FontView *) GDrawGetUserData(gw);
char buffer[1025];
char *filename, *temp;
FILE *file;
snprintf(buffer, sizeof(buffer),"%s/%s.nam", getFontForgeUserDir(Config), fv->b.sf->fontname );
t... | 0 | [
"CWE-119",
"CWE-787"
] | fontforge | 626f751752875a0ddd74b9e217b6f4828713573c | 145,852,791,495,108,670,000,000,000,000,000,000,000 | 23 | Warn users before discarding their unsaved scripts (#3852)
* Warn users before discarding their unsaved scripts
This closes #3846. |
static bool ldb_dn_casefold_internal(struct ldb_dn *dn)
{
unsigned int i;
int ret;
if ( ! dn || dn->invalid) return false;
if (dn->valid_case) return true;
if (( ! dn->components) && ( ! ldb_dn_explode(dn))) {
return false;
}
for (i = 0; i < dn->comp_num; i++) {
const struct ldb_schema_attribute *a;
d... | 0 | [
"CWE-200"
] | samba | 7f51ec8c4ed9ba1f53d722e44fb6fb3cde933b72 | 43,292,155,826,848,390,000,000,000,000,000,000,000 | 45 | CVE-2015-5330: ldb_dn: simplify and fix ldb_dn_escape_internal()
Previously we relied on NUL terminated strings and jumped back and
forth between copying escaped bytes and memcpy()ing un-escaped chunks.
This simple version is easier to reason about and works with
unterminated strings. It may also be faster as it avoid... |
ofputil_append_table_features_reply(const struct ofputil_table_features *tf,
struct ovs_list *replies)
{
struct ofpbuf *reply = ofpbuf_from_list(ovs_list_back(replies));
enum ofp_version version = ofpmp_version(replies);
size_t start_ofs = reply->size;
struct ofp13_ta... | 0 | [
"CWE-617",
"CWE-703"
] | ovs | 4af6da3b275b764b1afe194df6499b33d2bf4cde | 116,240,107,240,788,980,000,000,000,000,000,000,000 | 35 | ofp-group: Don't assert-fail decoding bad OF1.5 group mod type or command.
When decoding a group mod, the current code validates the group type and
command after the whole group mod has been decoded. The OF1.5 decoder,
however, tries to use the type and command earlier, when it might still be
invalid. This caused an... |
int ssl3_get_cert_verify(SSL *s)
{
EVP_PKEY *pkey=NULL;
unsigned char *p;
int al,ok,ret=0;
long n;
int type=0,i,j;
X509 *peer;
n=s->method->ssl_get_message(s,
SSL3_ST_SR_CERT_VRFY_A,
SSL3_ST_SR_CERT_VRFY_B,
-1,
514, /* 514? */
&ok);
if (!ok) return((int)n);
if (s->session->peer != NULL)
{
pee... | 0 | [] | openssl | ee2ffc279417f15fef3b1073c7dc81a908991516 | 57,563,789,598,529,570,000,000,000,000,000,000,000 | 186 | Add Next Protocol Negotiation. |
archive_write_vtable(void)
{
static struct archive_vtable av;
static int inited = 0;
if (!inited) {
av.archive_close = _archive_write_close;
av.archive_filter_bytes = _archive_filter_bytes;
av.archive_filter_code = _archive_filter_code;
av.archive_filter_name = _archive_filter_name;
av.archive_filter_coun... | 0 | [
"CWE-703",
"CWE-189"
] | libarchive | 22531545514043e04633e1c015c7540b9de9dbe4 | 42,581,944,998,480,100,000,000,000,000,000,000,000 | 19 | Limit write requests to at most INT_MAX.
This prevents a certain common programming error (passing -1 to write)
from leading to other problems deeper in the library. |
void snd_rawmidi_set_ops(struct snd_rawmidi *rmidi, int stream,
const struct snd_rawmidi_ops *ops)
{
struct snd_rawmidi_substream *substream;
list_for_each_entry(substream, &rmidi->streams[stream].substreams, list)
substream->ops = ops;
} | 0 | [
"CWE-416"
] | linux | c1f6e3c818dd734c30f6a7eeebf232ba2cf3181d | 136,582,006,214,671,900,000,000,000,000,000,000,000 | 8 | 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 ... |
void comps_mrtree_values_walk(COMPS_MRTree * rt, void* udata,
void (*walk_f)(void*, void*)) {
COMPS_HSList *tmplist, *tmp_subnodes;
COMPS_HSListItem *it, *it2;
tmplist = comps_hslist_create();
comps_hslist_init(tmplist, NULL, NULL, NULL);
comps_hslist_append(tmplist, rt... | 0 | [
"CWE-416",
"CWE-862"
] | libcomps | e3a5d056633677959ad924a51758876d415e7046 | 282,274,465,235,388,870,000,000,000,000,000,000,000 | 25 | Fix UAF in comps_objmrtree_unite function
The added field is not used at all in many places and it is probably the
left-over of some copy-paste. |
BuilderPtr createBuilder(Protobuf::Arena* arena) {
google::api::expr::runtime::InterpreterOptions options;
// Security-oriented defaults
options.enable_comprehension = false;
options.enable_regex = true;
options.regex_max_program_size = 100;
options.enable_string_conversion = false;
options.enable_string... | 0 | [] | envoy | 2c60632d41555ec8b3d9ef5246242be637a2db0f | 319,739,424,864,180,840,000,000,000,000,000,000,000 | 26 | http: header map security fixes for duplicate headers (#197)
Previously header matching did not match on all headers for
non-inline headers. This patch changes the default behavior to
always logically match on all headers. Multiple individual
headers will be logically concatenated with ',' similar to what
is done with... |
static void cmd_window_shrink(const char *data)
{
int count;
count = *data == '\0' ? 1 : atoi(data);
if (!mainwindow_shrink(WINDOW_MAIN(active_win), count, FALSE)) {
printformat_window(active_win, MSGLEVEL_CLIENTNOTICE,
TXT_WINDOW_TOO_SMALL);
}
} | 0 | [
"CWE-476"
] | irssi | 5b5bfef03596d95079c728f65f523570dd7b03aa | 163,824,655,830,251,240,000,000,000,000,000,000,000 | 10 | check the error condition of mainwindow_create |
void Tags::SimpleTag::Clear() {
delete[] m_tag_name;
m_tag_name = NULL;
delete[] m_tag_string;
m_tag_string = NULL;
} | 0 | [
"CWE-20"
] | libvpx | 34d54b04e98dd0bac32e9aab0fbda0bf501bc742 | 153,580,045,192,283,380,000,000,000,000,000,000,000 | 7 | update libwebm to libwebm-1.0.0.27-358-gdbf1d10
changelog:
https://chromium.googlesource.com/webm/libwebm/+log/libwebm-1.0.0.27-351-g9f23fbc..libwebm-1.0.0.27-358-gdbf1d10
Change-Id: I28a6b3ae02a53fb1f2029eee11e9449afb94c8e3 |
static int pcrypt_init_instance(struct crypto_instance *inst,
struct crypto_alg *alg)
{
if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME,
"pcrypt(%s)", alg->cra_driver_name) >= CRYPTO_MAX_ALG_NAME)
return -ENAMETOOLONG;
memcpy(inst->alg.cra_name, alg->cra_name, CRYPTO_MAX_ALG_NAME);
inst->a... | 0 | [
"CWE-399",
"CWE-763"
] | linux | d76c68109f37cb85b243a1cf0f40313afd2bae68 | 330,460,831,834,426,520,000,000,000,000,000,000,000 | 15 | crypto: pcrypt - fix freeing pcrypt instances
pcrypt is using the old way of freeing instances, where the ->free()
method specified in the 'struct crypto_template' is passed a pointer to
the 'struct crypto_instance'. But the crypto_instance is being
kfree()'d directly, which is incorrect because the memory was actual... |
void pauseClients(mstime_t end) {
if (!server.clients_paused || end > server.clients_pause_end_time)
server.clients_pause_end_time = end;
server.clients_paused = 1;
} | 0 | [
"CWE-254"
] | redis | 874804da0c014a7d704b3d285aa500098a931f50 | 157,556,290,005,179,170,000,000,000,000,000,000,000 | 5 | Security: Cross Protocol Scripting protection.
This is an attempt at mitigating problems due to cross protocol
scripting, an attack targeting services using line oriented protocols
like Redis that can accept HTTP requests as valid protocol, by
discarding the invalid parts and accepting the payloads sent, for
example, ... |
int cil_gen_pirqcon(struct cil_db *db, struct cil_tree_node *parse_current, struct cil_tree_node *ast_node)
{
enum cil_syntax syntax[] = {
CIL_SYN_STRING,
CIL_SYN_STRING,
CIL_SYN_STRING | CIL_SYN_LIST,
CIL_SYN_END
};
int syntax_len = sizeof(syntax)/sizeof(*syntax);
int rc = SEPOL_ERR;
struct cil_pirqcon *p... | 0 | [
"CWE-125"
] | selinux | 340f0eb7f3673e8aacaf0a96cbfcd4d12a405521 | 31,601,645,004,357,280,000,000,000,000,000,000,000 | 49 | libsepol/cil: Check for statements not allowed in optional blocks
While there are some checks for invalid statements in an optional
block when resolving the AST, there are no checks when building the
AST.
OSS-Fuzz found the following policy which caused a null dereference
in cil_tree_get_next_path().
(blockinherit ... |
unsigned long long encoding_order() const { return encoding_order_; } | 0 | [
"CWE-20"
] | libvpx | f00890eecdf8365ea125ac16769a83aa6b68792d | 162,581,165,132,043,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 |
static int discard_single_l2(BlockDriverState *bs, uint64_t offset,
unsigned int nb_clusters, enum qcow2_discard_type type)
{
BDRVQcowState *s = bs->opaque;
uint64_t *l2_table;
int l2_index;
int ret;
int i;
ret = get_cluster_table(bs, offset, &l2_table, &l2_index);
if (ret < 0) {
... | 0 | [
"CWE-190"
] | qemu | cab60de930684c33f67d4e32c7509b567f8c445b | 230,082,339,970,395,600,000,000,000,000,000,000,000 | 58 | qcow2: Fix new L1 table size check (CVE-2014-0143)
The size in bytes is assigned to an int later, so check that instead of
the number of entries.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> |
bit_out(PG_FUNCTION_ARGS)
{
#if 1
/* same as varbit output */
return varbit_out(fcinfo);
#else
/*
* This is how one would print a hex string, in case someone wants to
* write a formatting function.
*/
VarBit *s = PG_GETARG_VARBIT_P(0);
char *result,
*r;
bits8 *sp;
int i,
len,
bitl... | 0 | [
"CWE-703",
"CWE-189"
] | postgres | 31400a673325147e1205326008e32135a78b4d8a | 189,836,717,702,682,150,000,000,000,000,000,000,000 | 43 | Predict integer overflow to avoid buffer overruns.
Several functions, mostly type input functions, calculated an allocation
size such that the calculation wrapped to a small positive value when
arguments implied a sufficiently-large requirement. Writes past the end
of the inadvertent small allocation followed shortly... |
bool qemu_ram_is_shared(RAMBlock *rb)
{
return rb->flags & RAM_SHARED;
} | 0 | [
"CWE-125"
] | qemu | 04bf2526ce87f21b32c9acba1c5518708c243ad0 | 2,755,434,434,870,656,300,000,000,000,000,000,000 | 4 | exec: use qemu_ram_ptr_length to access guest ram
When accessing guest's ram block during DMA operation, use
'qemu_ram_ptr_length' to get ram block pointer. It ensures
that DMA operation of given length is possible; And avoids
any OOB memory access situations.
Reported-by: Alex <broscutamaker@gmail.com>
Signed-off-by... |
static void i40e_napi_disable_all(struct i40e_vsi *vsi)
{
int q_idx;
if (!vsi->netdev)
return;
for (q_idx = 0; q_idx < vsi->num_q_vectors; q_idx++) {
struct i40e_q_vector *q_vector = vsi->q_vectors[q_idx];
if (q_vector->rx.ring || q_vector->tx.ring)
napi_disable(&q_vector->napi);
}
} | 0 | [
"CWE-400",
"CWE-401"
] | linux | 27d461333459d282ffa4a2bdb6b215a59d493a8f | 18,490,999,198,826,898,000,000,000,000,000,000,000 | 14 | i40e: prevent memory leak in i40e_setup_macvlans
In i40e_setup_macvlans if i40e_setup_channel fails the allocated memory
for ch should be released.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> |
cmdopts_t *cmdopts_parse(int argc, char **argv)
{
enum {
CMDOPT_HELP = 0,
CMDOPT_VERBOSE,
CMDOPT_QUIET,
CMDOPT_INFILE,
CMDOPT_INFMT,
CMDOPT_INOPT,
CMDOPT_OUTFILE,
CMDOPT_OUTFMT,
CMDOPT_OUTOPT,
CMDOPT_VERSION,
CMDOPT_DEBUG,
CMDOPT_CMPTNO,
CMDOPT_SRGB,
CMDOPT_MAXMEM,
CMDOPT_LIST_ENABLED_COD... | 0 | [
"CWE-703",
"CWE-401"
] | jasper | d99636fad60629785efd1ef72da772a8ef68f54c | 249,546,126,772,683,740,000,000,000,000,000,000,000 | 170 | fix memory leaks in function cmdopts_parse |
parse_FIN_TIMEOUT(char *arg, struct ofpbuf *ofpacts,
enum ofputil_protocol *usable_protocols OVS_UNUSED)
{
struct ofpact_fin_timeout *oft = ofpact_put_FIN_TIMEOUT(ofpacts);
char *key, *value;
while (ofputil_parse_key_value(&arg, &key, &value)) {
char *error;
if (!strcmp(k... | 0 | [
"CWE-125"
] | ovs | 9237a63c47bd314b807cda0bd2216264e82edbe8 | 181,151,667,895,732,800,000,000,000,000,000,000,000 | 24 | ofp-actions: Avoid buffer overread in BUNDLE action decoding.
Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9052
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org> |
static void *get_match_data(int id)
{
assert((size_t) id < ARRAY_SIZE(infos));
return infos[id].match_data;
} | 0 | [
"CWE-552",
"CWE-703"
] | util-linux | 166e87368ae88bf31112a30e078cceae637f4cdb | 277,028,747,721,775,660,000,000,000,000,000,000,000 | 5 | 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... |
FLAC__bool canonicalize_until_specification(utils__SkipUntilSpecification *spec, const char *inbasefilename, unsigned sample_rate, FLAC__uint64 skip, FLAC__uint64 total_samples_in_input)
{
/* convert from mm:ss.sss to sample number if necessary */
flac__utils_canonicalize_skip_until_specification(spec, sample_rate);
... | 0 | [] | flac | c06a44969c1145242a22f75fc8fb2e8b54c55303 | 188,763,600,889,554,430,000,000,000,000,000,000,000 | 44 | flac : Fix for https://sourceforge.net/p/flac/bugs/425/
* flac/encode.c : Validate num_tracks field of cuesheet.
* libFLAC/stream_encoder.c : Add check for a NULL pointer.
* flac/encode.c : Improve bounds checking.
Closes: https://sourceforge.net/p/flac/bugs/425/ |
static inline void write_reg(struct pcd_unit *cd, int reg, int val)
{
pi_write_regr(cd->pi, 0, reg, val);
} | 0 | [
"CWE-476"
] | linux | f0d1762554014ce0ae347b9f0d088f2c157c8c72 | 18,274,214,872,776,694,000,000,000,000,000,000,000 | 4 | paride/pcd: Fix potential NULL pointer dereference and mem leak
Syzkaller report this:
pcd: pcd version 1.07, major 46, nice 0
pcd0: Autoprobe failed
pcd: No CD-ROM drive found
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] SMP... |
qqueueMultiEnqObjNonDirect(qqueue_t *pThis, multi_submit_t *pMultiSub)
{
int iCancelStateSave;
int i;
DEFiRet;
ISOBJ_TYPE_assert(pThis, qqueue);
assert(pMultiSub != NULL);
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &iCancelStateSave);
d_pthread_mutex_lock(pThis->mut);
for(i = 0 ; i < pMultiSub->nElem ; ++... | 0 | [
"CWE-772"
] | rsyslog | dfa88369d4ca4290db56b843f9eabdae1bfe0fd5 | 280,399,155,712,499,230,000,000,000,000,000,000,000 | 26 | bugfix: memory leak when $RepeatedMsgReduction on was used
bug tracker: http://bugzilla.adiscon.com/show_bug.cgi?id=225 |
static struct sk_buff *__first_packet_length(struct sock *sk,
struct sk_buff_head *rcvq,
int *total)
{
struct sk_buff *skb;
while ((skb = skb_peek(rcvq)) != NULL) {
if (udp_lib_checksum_complete(skb)) {
__UDP_INC_STATS(sock_net(sk), UDP_MIB_CSUMERRORS,
IS_UDPLITE(sk));
__UDP_INC_STAT... | 0 | [
"CWE-362"
] | net | 85f1bd9a7b5a79d5baa8bf44af19658f7bf77bfa | 244,926,521,485,795,200,000,000,000,000,000,000,000 | 26 | udp: consistently apply ufo or fragmentation
When iteratively building a UDP datagram with MSG_MORE and that
datagram exceeds MTU, consistently choose UFO or fragmentation.
Once skb_is_gso, always apply ufo. Conversely, once a datagram is
split across multiple skbs, do not consider ufo.
Sendpage already maintains th... |
static void post_kvm_run_save(struct kvm_vcpu *vcpu)
{
struct kvm_run *kvm_run = vcpu->run;
kvm_run->if_flag = static_call(kvm_x86_get_if_flag)(vcpu);
kvm_run->cr8 = kvm_get_cr8(vcpu);
kvm_run->apic_base = kvm_get_apic_base(vcpu);
kvm_run->ready_for_interrupt_injection =
pic_in_kernel(vcpu->kvm) ||
kvm_vcpu_... | 0 | [
"CWE-459"
] | linux | 683412ccf61294d727ead4a73d97397396e69a6b | 105,760,001,121,853,820,000,000,000,000,000,000,000 | 15 | 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... |
checksum_init(struct archive_read *a, int a_sum_alg, int e_sum_alg)
{
struct xar *xar;
xar = (struct xar *)(a->format->data);
_checksum_init(&(xar->a_sumwrk), a_sum_alg);
_checksum_init(&(xar->e_sumwrk), e_sum_alg);
} | 0 | [
"CWE-125"
] | libarchive | fa7438a0ff4033e4741c807394a9af6207940d71 | 311,161,846,825,986,830,000,000,000,000,000,000,000 | 8 | Do something sensible for empty strings to make fuzzers happy. |
bool AuthorizationSession::isUsingLocalhostBypass() {
return getAuthorizationManager().isAuthEnabled() && _externalState->shouldAllowLocalhost();
} | 0 | [
"CWE-613"
] | mongo | db19e7ce84cfd702a4ba9983ee2ea5019f470f82 | 116,993,788,036,968,030,000,000,000,000,000,000,000 | 3 | SERVER-38984 Validate unique User ID on UserCache hit
(cherry picked from commit e55d6e2292e5dbe2f97153251d8193d1cc89f5d7) |
f_tabpagenr(typval_T *argvars UNUSED, typval_T *rettv)
{
int nr = 1;
char_u *arg;
if (argvars[0].v_type != VAR_UNKNOWN)
{
arg = tv_get_string_chk(&argvars[0]);
nr = 0;
if (arg != NULL)
{
if (STRCMP(arg, "$") == 0)
nr = tabpage_index(NULL) - 1;
else
semsg(_(e_invexpr2), arg);
}
}... | 0 | [
"CWE-78"
] | vim | 8c62a08faf89663e5633dc5036cd8695c80f1075 | 299,359,035,323,088,750,000,000,000,000,000,000,000 | 21 | patch 8.1.0881: can execute shell commands in rvim through interfaces
Problem: Can execute shell commands in rvim through interfaces.
Solution: Disable using interfaces in restricted mode. Allow for writing
file with writefile(), histadd() and a few others. |
static const char* format() { return "%d"; } | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 275,486,428,162,393,300,000,000,000,000,000,000,000 | 1 | Fix other issues in 'CImg<T>::load_bmp()'. |
fr_archive_libarchive_get_capabilities (FrArchive *archive,
const char *mime_type,
gboolean check_command)
{
FrArchiveCap capabilities;
capabilities = FR_ARCHIVE_CAN_STORE_MANY_FILES;
/* write-only formats */
if (strcmp (mime_type, "application/x-7z-compressed") == 0) {
capabilities |= FR_ARCHIVE_... | 0 | [
"CWE-22"
] | file-roller | b147281293a8307808475e102a14857055f81631 | 56,606,747,550,623,960,000,000,000,000,000,000,000 | 36 | libarchive: sanitize filenames before extracting |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
// TODO(chowdhery): Generalize for any batch size
TF_LITE_ENSURE(context, (kBatchSize == 1));
auto* op_data = static_cast<OpData*>(node->user_data);
// These two functions correspond to two blocks in the Object Detection model.
// In future, we wou... | 0 | [
"CWE-125",
"CWE-787"
] | tensorflow | 1970c2158b1ffa416d159d03c3370b9a462aee35 | 1,677,202,305,707,929,700,000,000,000,000,000,000 | 22 | [tflite]: Insert `nullptr` checks when obtaining tensors.
As part of ongoing refactoring, `tflite::GetInput`, `tflite::GetOutput`, `tflite::GetTemporary` and `tflite::GetIntermediates` will return `nullptr` in some cases. Hence, we insert the `nullptr` checks on all usages.
We also insert `nullptr` checks on usages o... |
int git_path_apply_relative(git_buf *target, const char *relpath)
{
return git_buf_joinpath(target, git_buf_cstr(target), relpath) ||
git_path_resolve_relative(target, 0);
} | 0 | [
"CWE-20",
"CWE-706"
] | libgit2 | 3f7851eadca36a99627ad78cbe56a40d3776ed01 | 286,820,053,204,864,770,000,000,000,000,000,000,000 | 5 | Disallow NTFS Alternate Data Stream attacks, even on Linux/macOS
A little-known feature of NTFS is that it offers to store metadata in
so-called "Alternate Data Streams" (inspired by Apple's "resource
forks") that are copied together with the file they are associated with.
These Alternate Data Streams can be accessed ... |
void publish_superblock(const OSDSuperblock &block) {
Mutex::Locker l(publish_lock);
superblock = block;
} | 0 | [
"CWE-287",
"CWE-284"
] | ceph | 5ead97120e07054d80623dada90a5cc764c28468 | 113,308,321,307,708,100,000,000,000,000,000,000,000 | 4 | auth/cephx: add authorizer challenge
Allow the accepting side of a connection to reject an initial authorizer
with a random challenge. The connecting side then has to respond with an
updated authorizer proving they are able to decrypt the service's challenge
and that the new authorizer was produced for this specific ... |
std::string RGWFormPost::get_current_filename() const
{
try {
const auto& field = current_data_part->fields.at("Content-Disposition");
const auto iter = field.params.find("filename");
if (std::end(field.params) != iter) {
return prefix + iter->second;
}
} catch (std::out_of_range&) {
/* N... | 0 | [
"CWE-617"
] | ceph | f44a8ae8aa27ecef69528db9aec220f12492810e | 310,389,334,759,479,200,000,000,000,000,000,000,000 | 15 | rgw: RGWSwiftWebsiteHandler::is_web_dir checks empty subdir_name
checking for empty name avoids later assertion in RGWObjectCtx::set_atomic
Fixes: CVE-2021-3531
Reviewed-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 7196a469b4470f3c8628489df9a41ec8b... |
png_write_destroy(png_structrp png_ptr)
{
png_debug(1, "in png_write_destroy");
/* Free any memory zlib uses */
if ((png_ptr->flags & PNG_FLAG_ZSTREAM_INITIALIZED) != 0)
deflateEnd(&png_ptr->zstream);
/* Free our memory. png_free checks NULL for us. */
png_free_buffer_list(png_ptr, &png_ptr->zbu... | 0 | [
"CWE-120"
] | libpng | 81f44665cce4cb1373f049a76f3904e981b7a766 | 276,244,088,632,641,200,000,000,000,000,000,000,000 | 31 | [libpng16] Reject attempt to write over-length PLTE chunk |
static inline struct bcm_sock *bcm_sk(const struct sock *sk)
{
return (struct bcm_sock *)sk;
} | 0 | [
"CWE-362"
] | linux | d5f9023fa61ee8b94f37a93f08e94b136cf1e463 | 103,021,449,375,162,420,000,000,000,000,000,000,000 | 4 | can: bcm: delay release of struct bcm_op after synchronize_rcu()
can_rx_register() callbacks may be called concurrently to the call to
can_rx_unregister(). The callbacks and callback data, though, are
protected by RCU and the struct sock reference count.
So the callback data is really attached to the life of sk, mean... |
int ath6kl_wmi_deletekey_cmd(struct wmi *wmi, u8 if_idx, u8 key_index)
{
struct sk_buff *skb;
struct wmi_delete_cipher_key_cmd *cmd;
int ret;
if (key_index > WMI_MAX_KEY_INDEX)
return -EINVAL;
skb = ath6kl_wmi_get_new_buf(sizeof(*cmd));
if (!skb)
return -ENOMEM;
cmd = (struct wmi_delete_cipher_key_cmd *) ... | 0 | [
"CWE-125"
] | linux | 5d6751eaff672ea77642e74e92e6c0ac7f9709ab | 127,371,124,511,099,380,000,000,000,000,000,000,000 | 21 | ath6kl: add some bounds checking
The "ev->traffic_class" and "reply->ac" variables come from the network
and they're used as an offset into the wmi->stream_exist_for_ac[] array.
Those variables are u8 so they can be 0-255 but the stream_exist_for_ac[]
array only has WMM_NUM_AC (4) elements. We need to add a couple bo... |
certificateListValidate( Syntax *syntax, struct berval *in )
{
BerElementBuffer berbuf;
BerElement *ber = (BerElement *)&berbuf;
ber_tag_t tag;
ber_len_t len, wrapper_len;
char *wrapper_start;
int wrapper_ok = 0;
ber_int_t version = SLAP_X509_V1;
struct berval bvdn, bvtu;
ber_init2( ber, in, LBER_USE_DER );
... | 0 | [
"CWE-617"
] | openldap | 3539fc33212b528c56b716584f2c2994af7c30b0 | 2,457,868,130,697,505,600,000,000,000,000,000,000 | 113 | ITS#9454 fix issuerAndThisUpdateCheck |
int CLASS ljpeg_diff (ushort *huff)
{
int len, diff;
len = gethuff(huff);
if (len == 16 && (!dng_version || dng_version >= 0x1010000))
return -32768;
diff = getbits(len);
if ((diff & (1 << (len-1))) == 0)
diff -= (1 << len) - 1;
return diff;
} | 1 | [
"CWE-703"
] | LibRaw | 11909cc59e712e09b508dda729b99aeaac2b29ad | 300,829,675,917,557,220,000,000,000,000,000,000,000 | 12 | cumulated data checks patch |
static size_t init_iov_iter(struct vhost_virtqueue *vq, struct iov_iter *iter,
size_t hdr_size, int out)
{
/* Skip header. TODO: support TSO. */
size_t len = iov_length(vq->iov, out);
iov_iter_init(iter, WRITE, vq->iov, out, len);
iov_iter_advance(iter, hdr_size);
return iov_iter_count(iter);
} | 0 | [
"CWE-787"
] | linux | 42d84c8490f9f0931786f1623191fcab397c3d64 | 295,434,088,159,125,480,000,000,000,000,000,000,000 | 11 | vhost: Check docket sk_family instead of call getname
Doing so, we save one call to get data we already have in the struct.
Also, since there is no guarantee that getname use sockaddr_ll
parameter beyond its size, we add a little bit of security here.
It should do not do beyond MAX_ADDR_LEN, but syzbot found that
ax2... |
m_min(union DateData *x)
{
if (simple_dat_p(x))
return 0;
else {
get_c_time(x);
#ifndef USE_PACK
return x->c.min;
#else
return EX_MIN(x->c.pc);
#endif
}
} | 0 | [] | date | 3959accef8da5c128f8a8e2fd54e932a4fb253b0 | 55,498,702,004,187,710,000,000,000,000,000,000,000 | 13 | Add length limit option for methods that parses date strings
`Date.parse` now raises an ArgumentError when a given date string is
longer than 128. You can configure the limit by giving `limit` keyword
arguments like `Date.parse(str, limit: 1000)`. If you pass `limit: nil`,
the limit is disabled.
Not only `Date.parse`... |
void X509Certificate::SubjectAltName(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args);
X509Certificate* cert;
ASSIGN_OR_RETURN_UNWRAP(&cert, args.Holder());
BIOPointer bio(BIO_new(BIO_s_mem()));
Local<Value> ret;
if (GetInfoString<NID_subject_alt_name>(env, bio, ce... | 1 | [
"CWE-295"
] | node | 466e5415a2b7b3574ab5403acb87e89a94a980d1 | 288,495,394,799,217,720,000,000,000,000,000,000,000 | 9 | crypto,tls: implement safe x509 GeneralName format
This change introduces JSON-compatible escaping rules for strings that
include X.509 GeneralName components (see RFC 5280). This non-standard
format avoids ambiguities and prevents injection attacks that could
previously lead to X.509 certificates being accepted even ... |
cursorUp0(Buffer *buf, int n)
{
if (buf->cursorY > 0)
cursorUpDown(buf, -1);
else {
buf->topLine = lineSkip(buf, buf->topLine, -n, FALSE);
if (buf->currentLine->prev != NULL)
buf->currentLine = buf->currentLine->prev;
arrangeLine(buf);
}
} | 0 | [
"CWE-119"
] | w3m | 0c3f5d0e0d9269ad47b8f4b061d7818993913189 | 187,481,138,488,837,320,000,000,000,000,000,000,000 | 11 | Prevent array index out of bounds for symbol
Bug-Debian: https://github.com/tats/w3m/issues/38 |
Item *get_field_item_for_having(THD *thd, Item *item, st_select_lex *sel)
{
DBUG_ASSERT(item->type() == Item::FIELD_ITEM ||
(item->type() == Item::REF_ITEM &&
((Item_ref *) item)->ref_type() == Item_ref::VIEW_REF));
Item_field *field_item= NULL;
table_map map= sel->master_unit()->der... | 0 | [
"CWE-416"
] | server | c02ebf3510850ba78a106be9974c94c3b97d8585 | 180,059,819,921,486,280,000,000,000,000,000,000,000 | 33 | MDEV-24176 Preparations
1. moved fix_vcol_exprs() call to open_table()
mysql_alter_table() doesn't do lock_tables() so it cannot win from
fix_vcol_exprs() from there. Tests affected: main.default_session
2. Vanilla cleanups and comments. |
parse_wbxml_attribute_list (proto_tree *tree, tvbuff_t *tvb,
guint32 offset, guint32 str_tbl, guint8 level, guint8 *codepage_attr)
{
guint32 tvb_len = tvb_reported_length (tvb);
guint32 off = offset;
guint32 len;
guint str_len;
guint32 ent;
guint32 idx;
guint8 peek;
DebugLog(("parse_wbxml_attr (l... | 1 | [
"CWE-399",
"CWE-119",
"CWE-787"
] | wireshark | b8e0d416898bb975a02c1b55883342edc5b4c9c0 | 295,408,458,814,432,540,000,000,000,000,000,000,000 | 175 | WBXML: add a basic sanity check for offset overflow
This is a naive approach allowing to detact that something went wrong,
without the need to replace all proto_tree_add_text() calls as what was
done in master-2.0 branch.
Bug: 12408
Change-Id: Ia14905005e17ae322c2fc639ad5e491fa08b0108
Reviewed-on: https://code.wiresh... |
Item_sp_variable::Item_sp_variable(char *sp_var_name_str,
uint sp_var_name_length)
:m_thd(0)
#ifndef DBUG_OFF
, m_sp(0)
#endif
{
m_name.str= sp_var_name_str;
m_name.length= sp_var_name_length;
} | 0 | [] | server | b000e169562697aa072600695d4f0c0412f94f4f | 121,194,776,050,879,800,000,000,000,000,000,000,000 | 10 | Bug#26361149 MYSQL SERVER CRASHES AT: COL IN(IFNULL(CONST, COL), NAME_CONST('NAME', NULL))
based on:
commit f7316aa0c9a
Author: Ajo Robert <ajo.robert@oracle.com>
Date: Thu Aug 24 17:03:21 2017 +0530
Bug#26361149 MYSQL SERVER CRASHES AT: COL IN(IFNULL(CONST,
COL), NAME_CONST('NAME'... |
zsetmaxlength(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
os_ptr op1 = op - 1;
uint new_size;
int code;
check_type(*op1, t_dictionary);
check_dict_write(*op1);
check_type(*op, t_integer);
if (op->value.intval < 0)
return_error(gs_error_rangecheck);
new_size = (uint) op->value.intva... | 0 | [] | ghostpdl | d683d1e6450d74619e6277efeebfc222d9a5cb91 | 31,523,964,705,613,200,000,000,000,000,000,000,000 | 20 | Bug 700585: Obliterate "superexec". We don't need it, nor do any known apps.
We were under the impression that the Windows driver 'PScript5.dll' used
superexec, but after testing with our extensive suite of PostScript file,
and analysis of the PScript5 "Adobe CoolType ProcSet, it does not appear
that this operator is ... |
static struct dentry *proc_pident_instantiate(struct inode *dir,
struct dentry *dentry, struct task_struct *task, const void *ptr)
{
const struct pid_entry *p = ptr;
struct inode *inode;
struct proc_inode *ei;
struct dentry *error = ERR_PTR(-ENOENT);
inode = proc_pid_make_inode(dir->i_sb, task);
if (!inode)
g... | 0 | [
"CWE-20",
"CWE-362",
"CWE-416"
] | linux | 86acdca1b63e6890540fa19495cfc708beff3d8b | 278,427,519,088,017,580,000,000,000,000,000,000,000 | 29 | fix autofs/afs/etc. magic mountpoint breakage
We end up trying to kfree() nd.last.name on open("/mnt/tmp", O_CREAT)
if /mnt/tmp is an autofs direct mount. The reason is that nd.last_type
is bogus here; we want LAST_BIND for everything of that kind and we
get LAST_NORM left over from finding parent directory.
So make... |
static int update_frame_pool(AVCodecContext *avctx, AVFrame *frame)
{
FramePool *pool = avctx->internal->pool;
int i, ret;
switch (avctx->codec_type) {
case AVMEDIA_TYPE_VIDEO: {
AVPicture picture;
int size[4] = { 0 };
int w = frame->width;
int h = frame->height;
... | 0 | [
"CWE-703"
] | FFmpeg | e5c7229999182ad1cef13b9eca050dba7a5a08da | 231,873,141,463,303,600,000,000,000,000,000,000,000 | 103 | avcodec/utils: set AVFrame format unconditional
Fixes inconsistency and out of array accesses
Fixes: 10cdd7e63e7f66e3e66273939e0863dd-asan_heap-oob_1a4ff32_7078_cov_4056274555_mov_h264_aac__mp4box_frag.mp4
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> |
fill_yin_import(struct lys_module *module, struct lyxml_elem *yin, struct lys_import *imp, struct unres_schema *unres)
{
struct ly_ctx *ctx = module->ctx;
struct lyxml_elem *child, *next, exts;
const char *value;
int r, c_ext = 0;
void *reallocated;
/* init */
memset(&exts, 0, sizeof exts);... | 0 | [
"CWE-252"
] | libyang | a3917d95d516e3de267d3cfa5d4d3715a90e8777 | 264,509,654,321,598,330,000,000,000,000,000,000,000 | 111 | yin parser BUGFIX invalid memory access
... in case there were some unresolved
extensions.
Fixes #1454
Fixes #1455 |
const char *cgit_repobasename(const char *reponame)
{
/* I assume we don't need to store more than one repo basename */
static char rvbuf[1024];
int p;
const char *rv;
strncpy(rvbuf, reponame, sizeof(rvbuf));
if (rvbuf[sizeof(rvbuf)-1])
die("cgit_repobasename: truncated repository name '%s'", reponame);
p = st... | 0 | [] | cgit | 513b3863d999f91b47d7e9f26710390db55f9463 | 116,488,985,960,441,050,000,000,000,000,000,000,000 | 24 | ui-shared: prevent malicious filename from injecting headers |
static pid_t path_to_tid(const char *filename)
{
char *path = mnt_resolve_path(filename, NULL);
char *p, *end = NULL;
pid_t tid = 0;
if (!path)
goto done;
p = strrchr(path, '/');
if (!p)
goto done;
*p = '\0';
p = strrchr(path, '/');
if (!p)
goto done;
p++;
errno = 0;
tid = strtol(p, &end, 10);
if (... | 0 | [
"CWE-552",
"CWE-703"
] | util-linux | 166e87368ae88bf31112a30e078cceae637f4cdb | 163,809,905,119,203,160,000,000,000,000,000,000,000 | 28 | libmount: remove support for deleted mount table entries
The "(deleted)" suffix has been originally used by kernel for deleted
mountpoints. Since kernel commit 9d4d65748a5ca26ea8650e50ba521295549bf4e3
(Dec 2014) kernel does not use this suffix for mount stuff in /proc at
all. Let's remove this support from libmount to... |
static void mt_post_parse(struct mt_device *td, struct mt_application *app)
{
if (!app->have_contact_count)
app->quirks &= ~MT_QUIRK_CONTACT_CNT_ACCURATE;
} | 0 | [
"CWE-787"
] | linux | 35556bed836f8dc07ac55f69c8d17dce3e7f0e25 | 213,504,921,520,913,400,000,000,000,000,000,000,000 | 5 | HID: core: Sanitize event code and type when mapping input
When calling into hid_map_usage(), the passed event code is
blindly stored as is, even if it doesn't fit in the associated bitmap.
This event code can come from a variety of sources, including devices
masquerading as input devices, only a bit more "programmab... |
void ip6_datagram_recv_common_ctl(struct sock *sk, struct msghdr *msg,
struct sk_buff *skb)
{
struct ipv6_pinfo *np = inet6_sk(sk);
bool is_ipv6 = skb->protocol == htons(ETH_P_IPV6);
if (np->rxopt.bits.rxinfo) {
struct in6_pktinfo src_info;
if (is_ipv6) {
src_info.ipi6_ifindex = IP6CB(skb)->iif;
src... | 0 | [
"CWE-416",
"CWE-284",
"CWE-264"
] | linux | 45f6fad84cc305103b28d73482b344d7f5b76f39 | 24,915,365,189,467,420,000,000,000,000,000,000,000 | 24 | ipv6: add complete rcu protection around np->opt
This patch addresses multiple problems :
UDP/RAW sendmsg() need to get a stable struct ipv6_txoptions
while socket is not locked : Other threads can change np->opt
concurrently. Dmitry posted a syzkaller
(http://github.com/google/syzkaller) program desmonstrating
use-a... |
TEST(ComparisonsTest, GreaterEqualBroadcastTwoD) {
ComparisonOpModel model({1, 1, 2, 4}, {1, 1, 1, 4}, TensorType_INT32,
BuiltinOperator_GREATER_EQUAL);
model.PopulateTensor<int>(model.input1(), {-1, 9, 7, 3, 2, 4, 2, 8});
model.PopulateTensor<int>(model.input2(), {7, 1, 2, 4});
model.... | 0 | [
"CWE-20",
"CWE-703"
] | tensorflow | a989426ee1346693cc015792f11d715f6944f2b8 | 29,464,992,245,024,786,000,000,000,000,000,000,000 | 11 | Improve to cover scale value greater than one
PiperOrigin-RevId: 433050921 |
static av_cold int png_dec_end(AVCodecContext *avctx)
{
PNGDecContext *s = avctx->priv_data;
ff_thread_release_buffer(avctx, &s->previous_picture);
av_frame_free(&s->previous_picture.f);
ff_thread_release_buffer(avctx, &s->last_picture);
av_frame_free(&s->last_picture.f);
ff_thread_release_buff... | 0 | [
"CWE-787"
] | FFmpeg | e371f031b942d73e02c090170975561fabd5c264 | 230,432,350,633,735,260,000,000,000,000,000,000,000 | 19 | avcodec/pngdec: Fix off by 1 size in decode_zbuf()
Fixes out of array access
Fixes: 444/fuzz-2-ffmpeg_VIDEO_AV_CODEC_ID_PNG_fuzzer
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> |
listener_ref_entry_remove_for_connection (GSListener *listener,
int entry_type,
const char *connection)
{
gboolean removed;
GHashTable *hash;
GHashTableIter iter;
GSListenerRefEntry *entry;
... | 0 | [] | gnome-screensaver | 284c9924969a49dbf2d5fae1d680d3310c4df4a3 | 249,454,865,529,782,370,000,000,000,000,000,000,000 | 37 | Remove session inhibitors if the originator falls of the bus
This fixes a problem where totem leaves inhibitors behind, see
bug 600488. |
Item_args(THD *thd, Item *a, Item *b, Item *c, Item *d, Item* e)
{
arg_count= 5;
if ((args= (Item**) thd_alloc(thd, sizeof(Item*) * 5)))
{
arg_count= 5;
args[0]= a; args[1]= b; args[2]= c; args[3]= d; args[4]= e;
}
} | 0 | [
"CWE-617"
] | server | 2e7891080667c59ac80f788eef4d59d447595772 | 82,753,295,150,051,950,000,000,000,000,000,000,000 | 9 | MDEV-25635 Assertion failure when pushing from HAVING into WHERE of view
This bug could manifest itself after pushing a where condition over a
mergeable derived table / view / CTE DT into a grouping view / derived
table / CTE V whose item list contained set functions with constant
arguments such as MIN(2), SUM(1) etc.... |
static void module_enable_ro(const struct module *mod, bool after_init)
{
if (!rodata_enabled)
return;
set_vm_flush_reset_perms(mod->core_layout.base);
set_vm_flush_reset_perms(mod->init_layout.base);
frob_text(&mod->core_layout, set_memory_ro);
frob_rodata(&mod->core_layout, set_memory_ro);
frob_text(&mod->i... | 0 | [
"CWE-362",
"CWE-347"
] | linux | 0c18f29aae7ce3dadd26d8ee3505d07cc982df75 | 279,466,930,942,693,550,000,000,000,000,000,000,000 | 16 | module: limit enabling module.sig_enforce
Irrespective as to whether CONFIG_MODULE_SIG is configured, specifying
"module.sig_enforce=1" on the boot command line sets "sig_enforce".
Only allow "sig_enforce" to be set when CONFIG_MODULE_SIG is configured.
This patch makes the presence of /sys/module/module/parameters/s... |
inline float option(const char *const name, const int argc, const char *const *const argv,
const float defaut, const char *const usage=0) {
const char *const s = cimg::option(name,argc,argv,(char*)0);
const float res = s?(float)cimg::atof(s):defaut;
char *const tmp = new c... | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 1,862,267,556,708,188,400,000,000,000,000,000,000 | 10 | Fix other issues in 'CImg<T>::load_bmp()'. |
__napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb)
{
struct sk_buff *p;
for (p = napi->gro_list; p; p = p->next) {
unsigned long diffs;
diffs = (unsigned long)p->dev ^ (unsigned long)skb->dev;
diffs |= p->vlan_tci ^ skb->vlan_tci;
diffs |= compare_ether_header(skb_mac_header(p),
sk... | 0 | [
"CWE-264"
] | linux | 8909c9ad8ff03611c9c96c9a92656213e4bb495b | 141,571,400,101,607,210,000,000,000,000,000,000,000 | 17 | net: don't allow CAP_NET_ADMIN to load non-netdev kernel modules
Since a8f80e8ff94ecba629542d9b4b5f5a8ee3eb565c any process with
CAP_NET_ADMIN may load any module from /lib/modules/. This doesn't mean
that CAP_NET_ADMIN is a superset of CAP_SYS_MODULE as modules are
limited to /lib/modules/**. However, CAP_NET_ADMIN... |
nautilus_file_can_delete (NautilusFile *file)
{
g_return_val_if_fail (NAUTILUS_IS_FILE (file), FALSE);
/* Nonexistent files can't be deleted. */
if (nautilus_file_is_gone (file)) {
return FALSE;
}
/* Self-owned files can't be deleted */
if (nautilus_file_is_self_owned (file)) {
return FALSE;
}
return fil... | 0 | [] | nautilus | 7632a3e13874a2c5e8988428ca913620a25df983 | 165,813,872,639,937,200,000,000,000,000,000,000,000 | 16 | Check for trusted desktop file launchers.
2009-02-24 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-directory-async.c:
Check for trusted desktop file launchers.
* libnautilus-private/nautilus-file-private.h:
* libnautilus-private/nautilus-file.c:
* libnautilus-... |
GF_Err mfra_box_read(GF_Box *s, GF_BitStream *bs)
{
return gf_isom_box_array_read(s, bs);
} | 0 | [
"CWE-476",
"CWE-787"
] | gpac | b8f8b202d4fc23eb0ab4ce71ae96536ca6f5d3f8 | 80,865,340,448,554,350,000,000,000,000,000,000,000 | 4 | fixed #1757 |
static int cap_quotactl(int cmds, int type, int id, struct super_block *sb)
{
return 0;
} | 0 | [] | linux-2.6 | ee18d64c1f632043a02e6f5ba5e045bb26a5465f | 97,053,277,109,538,180,000,000,000,000,000,000,000 | 4 | KEYS: Add a keyctl to install a process's session keyring on its parent [try #6]
Add a keyctl to install a process's session keyring onto its parent. This
replaces the parent's session keyring. Because the COW credential code does
not permit one process to change another process's credentials directly, the
change is... |
void Compute(OpKernelContext* ctx) override {
const Tensor& max_num_elements_t = ctx->input(1);
OP_REQUIRES(
ctx, TensorShapeUtils::IsScalar(max_num_elements_t.shape()),
errors::InvalidArgument(
"max_num_elements expected to be a scalar ",
"but got shape: ", max_num_ele... | 0 | [
"CWE-617",
"CWE-369"
] | tensorflow | 8a6e874437670045e6c7dc6154c7412b4a2135e2 | 50,389,202,651,924,010,000,000,000,000,000,000,000 | 19 | Validate num_elements input in tf.raw_ops.TensorListReserve
PiperOrigin-RevId: 383954564
Change-Id: I454bd78eff85bc4f16ddb7e608596971cca47f8f |
static int finish_read (lua_State *L, int status, lua_KContext ctx) {
int rc;
struct ssh_userdata *sshu = NULL;
sshu = (struct ssh_userdata *) nseU_checkudata(L, 1, SSH2_UDATA, "ssh2");
if (lua_toboolean(L, -2)) {
size_t n = 0;
size_t l = 0;
lua_getuservalue(L, 1);
lua_... | 0 | [
"CWE-415"
] | nmap | 350bbe0597d37ad67abe5fef8fba984707b4e9ad | 138,444,982,053,474,660,000,000,000,000,000,000,000 | 41 | Avoid a crash (double-free) when SSH connection fails |
static void iova_entry_free(unsigned long data)
{
struct page *freelist = (struct page *)data;
dma_free_pagelist(freelist);
} | 0 | [] | linux | d8b8591054575f33237556c32762d54e30774d28 | 231,984,909,868,012,000,000,000,000,000,000,000,000 | 6 | iommu/vt-d: Disable ATS support on untrusted devices
Commit fb58fdcd295b9 ("iommu/vt-d: Do not enable ATS for untrusted
devices") disables ATS support on the devices which have been marked
as untrusted. Unfortunately this is not enough to fix the DMA attack
vulnerabiltiies because IOMMU driver allows translated reques... |
static int nfs4_xdr_dec_open_downgrade(struct rpc_rqst *rqstp,
struct xdr_stream *xdr,
struct nfs_closeres *res)
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
if (status)
goto out;
status = decode_sequence(xdr, &res->seq_res, rqstp);
if (status)
goto ou... | 0 | [
"CWE-703",
"CWE-189"
] | linux | bf118a342f10dafe44b14451a1392c3254629a1f | 262,500,261,606,272,160,000,000,000,000,000,000,000 | 24 | NFSv4: include bitmap in nfsv4 get acl data
The NFSv4 bitmap size is unbounded: a server can return an arbitrary
sized bitmap in an FATTR4_WORD0_ACL request. Replace using the
nfs4_fattr_bitmap_maxsz as a guess to the maximum bitmask returned by a server
with the inclusion of the bitmap (xdr length plus bitmasks) and... |
int _gnutls_dh_set_peer_public(gnutls_session_t session, bigint_t public)
{
dh_info_st *dh;
int ret;
switch (gnutls_auth_get_type(session)) {
case GNUTLS_CRD_ANON:
{
anon_auth_info_t info;
info = _gnutls_get_auth_info(session, GNUTLS_CRD_ANON);
if (info == NULL)
return gnutls_assert_val(GNUTLS_E_INT... | 0 | [
"CWE-400"
] | gnutls | 1ffb827e45721ef56982d0ffd5c5de52376c428e | 23,717,673,742,512,913,000,000,000,000,000,000,000 | 52 | handshake: set a maximum number of warning messages that can be received per handshake
That is to avoid DoS due to the assymetry of cost of sending an alert vs the cost
of processing. |
static uint16_t nvme_identify_ctrl(NvmeCtrl *n, NvmeRequest *req)
{
trace_pci_nvme_identify_ctrl();
return nvme_c2h(n, (uint8_t *)&n->id_ctrl, sizeof(n->id_ctrl), req);
} | 0 | [] | qemu | 736b01642d85be832385063f278fe7cd4ffb5221 | 248,993,711,646,208,350,000,000,000,000,000,000,000 | 6 | hw/nvme: fix CVE-2021-3929
This fixes CVE-2021-3929 "locally" by denying DMA to the iomem of the
device itself. This still allows DMA to MMIO regions of other devices
(e.g. doing P2P DMA to the controller memory buffer of another NVMe
device).
Fixes: CVE-2021-3929
Reported-by: Qiuhao Li <Qiuhao.Li@outlook.com>
Review... |
restore_page_device(i_ctx_t *i_ctx_p, const gs_gstate * pgs_old, const gs_gstate * pgs_new)
{
gx_device *dev_old = gs_currentdevice(pgs_old);
gx_device *dev_new;
gx_device *dev_t1;
gx_device *dev_t2;
bool samepagedevice = obj_eq(dev_old->memory, &gs_int_gstate(pgs_old)->pagedevice,
&gs_int_g... | 1 | [] | ghostpdl | 643b24dbd002fb9c131313253c307cf3951b3d47 | 182,176,212,764,962,530,000,000,000,000,000,000,000 | 49 | Bug 699718(2): Improve/augment stack size checking
Improve the rebustness of the previous solution (previously it could trigger an
error when there *was* stack capacity available).
Remove redundant check: we don't need to check if the *current* stack size is
sufficient, before checking the maximum permitted stack siz... |
qb_rb_chunk_write(struct qb_ringbuffer_s * rb, const void *data, size_t len)
{
char *dest = qb_rb_chunk_alloc(rb, len);
int32_t res = 0;
if (rb == NULL) {
return -EINVAL;
}
if (dest == NULL) {
return -errno;
}
memcpy(dest, data, len);
res = qb_rb_chunk_commit(rb, len);
if (res < 0) {
return res;
}
... | 0 | [
"CWE-59"
] | libqb | e322e98dc264bc5911d6fe1d371e55ac9f95a71e | 144,116,698,468,274,740,000,000,000,000,000,000,000 | 22 | ipc: use O_EXCL on SHM files, and randomize the names
Signed-off-by: Christine Caulfield <ccaulfie@redhat.com> |
pango_ot_info_finalizer (void *object)
{
FT_Face face = object;
PangoOTInfo *info = face->generic.data;
info->face = NULL;
g_object_unref (info);
} | 0 | [] | pango | 336bb3201096bdd0494d29926dd44e8cca8bed26 | 322,704,783,941,843,060,000,000,000,000,000,000,000 | 8 | [HB] Remove all references to the old code! |
xsltParseStylesheetKey(xsltStylesheetPtr style, xmlNodePtr key) {
xmlChar *prop = NULL;
xmlChar *use = NULL;
xmlChar *match = NULL;
xmlChar *name = NULL;
xmlChar *nameURI = NULL;
if ((style == NULL) || (key == NULL) || (key->type != XML_ELEMENT_NODE))
return;
/*
* Get arguments
... | 0 | [] | libxslt | e03553605b45c88f0b4b2980adfbbb8f6fca2fd6 | 179,171,251,181,576,100,000,000,000,000,000,000,000 | 76 | Fix security framework bypass
xsltCheckRead and xsltCheckWrite return -1 in case of error but callers
don't check for this condition and allow access. With a specially
crafted URL, xsltCheckRead could be tricked into returning an error
because of a supposedly invalid URL that would still be loaded
succesfully later on... |
helptags_cb(char_u *fname, void *cookie)
{
do_helptags(fname, *(int *)cookie);
} | 0 | [
"CWE-78"
] | vim | 8c62a08faf89663e5633dc5036cd8695c80f1075 | 302,827,238,369,564,850,000,000,000,000,000,000,000 | 4 | patch 8.1.0881: can execute shell commands in rvim through interfaces
Problem: Can execute shell commands in rvim through interfaces.
Solution: Disable using interfaces in restricted mode. Allow for writing
file with writefile(), histadd() and a few others. |
static const unsigned char *valid_star(const unsigned char *p, size_t len,
unsigned int flags)
{
const unsigned char *star = 0;
size_t i;
int state = LABEL_START;
int dots = 0;
for (i = 0; i < len; ++i) {
/*
* Locate first and only legal wildca... | 0 | [
"CWE-125"
] | openssl | bb4d2ed4091408404e18b3326e3df67848ef63d0 | 222,734,929,986,210,740,000,000,000,000,000,000,000 | 60 | Fix append_ia5 function to not assume NUL terminated strings
ASN.1 strings may not be NUL terminated. Don't assume they are.
CVE-2021-3712
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org> |
png_free_data(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 mask,
int num)
{
png_debug(1, "in png_free_data");
if (png_ptr == NULL || info_ptr == NULL)
return;
#ifdef PNG_TEXT_SUPPORTED
/* Free text item num or (if num == -1) all text items */
if (info_ptr->text != NULL &&
... | 1 | [
"CWE-476"
] | libpng | 812768d7a9c973452222d454634496b25ed415eb | 10,081,378,136,238,390,000,000,000,000,000,000,000 | 187 | [libpng16] Fixed a potential null pointer dereference in png_set_text_2()
(bug report and patch by Patrick Keshishian). |
l_noret luaG_runerror (lua_State *L, const char *fmt, ...) {
CallInfo *ci = L->ci;
const char *msg;
va_list argp;
luaC_checkGC(L); /* error message uses memory */
va_start(argp, fmt);
msg = luaO_pushvfstring(L, fmt, argp); /* format message */
va_end(argp);
if (isLua(ci)) /* if Lua function, add sour... | 1 | [
"CWE-787"
] | lua | 42d40581dd919fb134c07027ca1ce0844c670daf | 23,560,794,294,652,280,000,000,000,000,000,000,000 | 12 | Save stack space while handling errors
Because error handling (luaG_errormsg) uses slots from EXTRA_STACK,
and some errors can recur (e.g., string overflow while creating an
error message in 'luaG_runerror', or a C-stack overflow before calling
the message handler), the code should use stack slots with parsimony.
Thi... |
virDomainChrSourceDefOnceInit(void)
{
if (!VIR_CLASS_NEW(virDomainChrSourceDef, virClassForObject()))
return -1;
return 0;
} | 0 | [
"CWE-212"
] | libvirt | a5b064bf4b17a9884d7d361733737fb614ad8979 | 179,015,427,716,471,180,000,000,000,000,000,000,000 | 7 | conf: Don't format http cookies unless VIR_DOMAIN_DEF_FORMAT_SECURE is used
Starting with 3b076391befc3fe72deb0c244ac6c2b4c100b410
(v6.1.0-122-g3b076391be) we support http cookies. Since they may contain
somewhat sensitive information we should not format them into the XML
unless VIR_DOMAIN_DEF_FORMAT_SECURE is assert... |
is_valid_cls_ident (const char *p)
{
/*
* FIXME: we need the full unicode glib support for this.
* Check: http://www.unicode.org/unicode/reports/tr15/Identifier.java
* We do the lame thing for now.
*/
if (!isalpha (*p))
return 0;
++p;
while (*p) {
if (!isalnum (*p) && *p != '_')
return 0;
++p;
}
... | 0 | [
"CWE-20"
] | mono | 4905ef1130feb26c3150b28b97e4a96752e0d399 | 234,377,307,825,117,540,000,000,000,000,000,000,000 | 17 | Handle invalid instantiation of generic methods.
* verify.c: Add new function to internal verifier API to check
method instantiations.
* reflection.c (mono_reflection_bind_generic_method_parameters):
Check the instantiation before returning it.
Fixes #655847 |
int platform_add_devices(struct platform_device **devs, int num)
{
int i, ret = 0;
for (i = 0; i < num; i++) {
ret = platform_device_register(devs[i]);
if (ret) {
while (--i >= 0)
platform_device_unregister(devs[i]);
break;
}
}
return ret;
} | 0 | [
"CWE-362",
"CWE-284"
] | linux | 6265539776a0810b7ce6398c27866ddb9c6bd154 | 184,284,054,174,887,500,000,000,000,000,000,000,000 | 15 | driver core: platform: fix race condition with driver_override
The driver_override implementation is susceptible to race condition when
different threads are reading vs storing a different driver override.
Add locking to avoid race condition.
Fixes: 3d713e0e382e ("driver core: platform: add device binding path 'drive... |
ManagedResourceImpl(uint64_t max, Runtime::Loader& runtime, const std::string& runtime_key,
Stats::Gauge& open_gauge, Stats::Gauge& remaining)
: BasicResourceLimitImpl(max, runtime, runtime_key), open_gauge_(open_gauge),
remaining_(remaining) {
remaining_.set(max);
... | 0 | [
"CWE-400"
] | envoy | dfddb529e914d794ac552e906b13d71233609bf7 | 265,573,258,798,352,300,000,000,000,000,000,000,000 | 6 | listener: Add configurable accepted connection limits (#153)
Add support for per-listener limits on accepted connections.
Signed-off-by: Tony Allen <tony@allen.gg> |
TEST_P(JSITest, DecoratorTest) {
struct Count {
// init here is just to show that a With type does not need to be
// default constructible.
explicit Count(int init) : count(init) {}
// Test optional before method.
void after() {
++count;
}
int count;
};
static constexpr int k... | 0 | [
"CWE-843",
"CWE-125"
] | hermes | fe52854cdf6725c2eaa9e125995da76e6ceb27da | 182,816,151,026,452,100,000,000,000,000,000,000,000 | 41 | [CVE-2020-1911] Look up HostObject computed properties on the right object in the prototype chain.
Summary:
The change in the hermes repository fixes the security vulnerability
CVE-2020-1911. This vulnerability only affects applications which
allow evaluation of uncontrolled, untrusted JavaScript code not
shipped wit... |
restore_backup_configuration_without_messages (const char *backup_filename, const char *intended_filename)
{
backup_filename = gnome_rr_config_get_backup_filename ();
rename (backup_filename, intended_filename);
} | 0 | [] | gnome-settings-daemon | be513b3c7d80d0b7013d79ce46d7eeca929705cc | 39,037,144,302,192,846,000,000,000,000,000,000,000 | 5 | Implement autoconfiguration of the outputs
This is similar in spirit to 'xrandr --auto', but we disfavor selecting clone modes.
Instead, we lay out the outputs left-to-right.
Signed-off-by: Federico Mena Quintero <federico@novell.com> |
static void dualshock4_send_output_report(struct sony_sc *sc)
{
struct hid_device *hdev = sc->hdev;
u8 *buf = sc->output_report_dmabuf;
int offset;
/*
* NOTE: The lower 6 bits of buf[1] field of the Bluetooth report
* control the interval at which Dualshock 4 reports data:
* 0x00 - 1ms
* 0x01 - 1ms
* 0x0... | 0 | [
"CWE-787"
] | linux | d9d4b1e46d9543a82c23f6df03f4ad697dab361b | 333,048,026,103,738,200,000,000,000,000,000,000,000 | 61 | HID: Fix assumption that devices have inputs
The syzbot fuzzer found a slab-out-of-bounds write bug in the hid-gaff
driver. The problem is caused by the driver's assumption that the
device must have an input report. While this will be true for all
normal HID input devices, a suitably malicious device can violate the... |
int LoadEXRImageFromFile(EXRImage *exr_image, const EXRHeader *exr_header,
const char *filename, const char **err) {
if (exr_image == NULL) {
tinyexr::SetErrorMessage("Invalid argument for LoadEXRImageFromFile", err);
return TINYEXR_ERROR_INVALID_ARGUMENT;
}
#ifdef _WIN32
FILE *f... | 0 | [
"CWE-20",
"CWE-190"
] | tinyexr | a685e3332f61cd4e59324bf3f669d36973d64270 | 224,278,154,716,955,400,000,000,000,000,000,000,000 | 42 | Make line_no with too large value(2**20) invalid. Fixes #124 |
int snd_seq_create_kernel_client(struct snd_card *card, int client_index,
const char *name_fmt, ...)
{
struct snd_seq_client *client;
va_list args;
if (snd_BUG_ON(in_interrupt()))
return -EBUSY;
if (card && client_index >= SNDRV_SEQ_CLIENTS_PER_CARD)
return -EINVAL;
if (card == NULL && client_index >= S... | 0 | [
"CWE-703"
] | linux | 030e2c78d3a91dd0d27fef37e91950dde333eba1 | 45,075,001,071,410,050,000,000,000,000,000,000,000 | 48 | ALSA: seq: Fix missing NULL check at remove_events ioctl
snd_seq_ioctl_remove_events() calls snd_seq_fifo_clear()
unconditionally even if there is no FIFO assigned, and this leads to
an Oops due to NULL dereference. The fix is just to add a proper NULL
check.
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Tested-by... |
drop_role_if_exists(const char *rolename)
{
header(_("dropping role \"%s\""), rolename);
psql_command("postgres", "DROP ROLE IF EXISTS \"%s\"", rolename);
} | 0 | [
"CWE-119"
] | postgres | 01824385aead50e557ca1af28640460fa9877d51 | 47,217,603,609,161,030,000,000,000,000,000,000,000 | 5 | Prevent potential overruns of fixed-size buffers.
Coverity identified a number of places in which it couldn't prove that a
string being copied into a fixed-size buffer would fit. We believe that
most, perhaps all of these are in fact safe, or are copying data that is
coming from a trusted source so that any overrun i... |
int slap_parse_user( struct berval *id, struct berval *user,
struct berval *realm, struct berval *mech )
{
char u;
assert( id != NULL );
assert( !BER_BVISNULL( id ) );
assert( user != NULL );
assert( realm != NULL );
assert( mech != NULL );
u = id->bv_val[ 0 ];
if ( u != 'u' && u != 'U' ) {
/* called w... | 1 | [
"CWE-763"
] | openldap | d169e7958a3e0dc70f59c8374bf8a59833b7bdd8 | 310,456,797,360,823,830,000,000,000,000,000,000,000 | 77 | ITS#9413 fix slap_parse_user |
int kvm_apic_compare_prio(struct kvm_vcpu *vcpu1, struct kvm_vcpu *vcpu2)
{
return vcpu1->arch.xtp - vcpu2->arch.xtp;
} | 0 | [
"CWE-399"
] | kvm | 5b40572ed5f0344b9dbee486a17c589ce1abe1a3 | 22,863,025,860,642,860,000,000,000,000,000,000,000 | 4 | KVM: Ensure all vcpus are consistent with in-kernel irqchip settings
If some vcpus are created before KVM_CREATE_IRQCHIP, then
irqchip_in_kernel() and vcpu->arch.apic will be inconsistent, leading
to potential NULL pointer dereferences.
Fix by:
- ensuring that no vcpus are installed when KVM_CREATE_IRQCHIP is called
... |
static uint8_t esp_pdma_read(ESPState *s)
{
uint8_t val;
if (s->do_cmd) {
val = esp_cmdfifo_pop(s);
} else {
val = esp_fifo_pop(s);
}
return val;
} | 1 | [
"CWE-476"
] | qemu | c5fef9112b15c4b5494791cdf8bbb40bc1938dd3 | 274,997,480,733,764,100,000,000,000,000,000,000,000 | 12 | esp: consolidate esp_cmdfifo_pop() into esp_fifo_pop()
Each FIFO currently has its own pop functions with the only difference being
the capacity check. The original reason for this was that the fifo8
implementation doesn't have a formal API for retrieving the FIFO capacity,
however there are multiple examples within Q... |
GF_Err fpar_Read(GF_Box *s, GF_BitStream *bs)
{
u32 i;
GF_Err e;
FilePartitionBox *ptr = (FilePartitionBox *)s;
ISOM_DECREASE_SIZE(ptr, ((ptr->version ? 4 : 2) + 12) );
ptr->itemID = gf_bs_read_int(bs, ptr->version ? 32 : 16);
ptr->packet_payload_size = gf_bs_read_u16(bs);
gf_bs_read_u8(bs);
ptr->FEC_encoding... | 0 | [
"CWE-416"
] | gpac | 6063b1a011c3f80cee25daade18154e15e4c058c | 141,450,894,482,499,320,000,000,000,000,000,000,000 | 31 | fix UAF in audio_sample_entry_Read (#1440) |
const char* CMSEXPORT cmsIT8GetPatchName(cmsHANDLE hIT8, int nPatch, char* buffer)
{
cmsIT8* it8 = (cmsIT8*) hIT8;
TABLE* t;
char* Data;
_cmsAssert(hIT8 != NULL);
t = GetTable(it8);
Data = GetData(it8, nPatch, t->SampleID);
if (!Data) return NULL;
if (!buffer) return Data;
strncp... | 0 | [] | Little-CMS | 65e2f1df3495edc984f7e0d7b7b24e29d851e240 | 162,273,905,076,053,900,000,000,000,000,000,000,000 | 18 | Fix some warnings from static analysis |
static void nhml_node_start(void *sax_cbck, const char *node_name, const char *name_space, const GF_XMLAttribute *attributes, u32 nb_attributes)
{
XMLBreaker *breaker = (XMLBreaker *)sax_cbck;
char *node_id;
u32 i;
node_id = NULL;
for (i=0; i<nb_attributes; i++) {
GF_XMLAttribute *att = (GF_XMLAttribute *) &attr... | 0 | [
"CWE-787"
] | gpac | 74695dea7278e78af3db467e586233fe8773c07e | 56,366,146,166,202,250,000,000,000,000,000,000,000 | 32 | fixed #1910 #1911 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.