func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
void split_fullpath(const char *fullpath, char *dirname, char *basename, const size_t buf_len) {
if (buf_len == 0) {
return;
}
char *p = strrchr(fullpath, separator);
if (p) {
p += 1;
if (dirname) {
size_t dirlen = min(buf_len - 1, (size_t) (p - fullpath));
... | 0 | [
"CWE-476"
] | libmobi | c0699c8693c47f14a2e57dec7292e862ac7adf9c | 276,422,246,627,642,830,000,000,000,000,000,000,000 | 33 | Fix undefined behavior when passing null to strdup |
png_write_flush(png_structrp png_ptr)
{
png_debug(1, "in png_write_flush");
if (png_ptr == NULL)
return;
/* We have already written out all of the data */
if (png_ptr->row_number >= png_ptr->num_rows)
return;
png_compress_IDAT(png_ptr, NULL, 0, Z_SYNC_FLUSH);
png_ptr->flush_rows = 0;
... | 0 | [
"CWE-120"
] | libpng | 81f44665cce4cb1373f049a76f3904e981b7a766 | 156,586,885,740,673,560,000,000,000,000,000,000,000 | 15 | [libpng16] Reject attempt to write over-length PLTE chunk |
dns_zone_getsignatures(dns_zone_t *zone) {
REQUIRE(DNS_ZONE_VALID(zone));
return (zone->signatures);
} | 0 | [
"CWE-327"
] | bind9 | f09352d20a9d360e50683cd1d2fc52ccedcd77a0 | 268,731,329,923,388,470,000,000,000,000,000,000,000 | 4 | Update keyfetch_done compute_tag check
If in keyfetch_done the compute_tag fails (because for example the
algorithm is not supported), don't crash, but instead ignore the
key. |
static MagickBooleanType TIFFWritePhotoshopLayers(Image* image,
const ImageInfo *image_info,ExceptionInfo *exception)
{
BlobInfo
*blob;
CustomStreamInfo
*custom_stream;
Image
*next;
ImageInfo
*clone_info;
MagickBooleanType
status;
PhotoshopProfile
profile;
PSDInfo
info;... | 0 | [
"CWE-125"
] | ImageMagick | 60e52517ff86a451a85cac3eaba2016e80668297 | 32,731,245,545,351,710,000,000,000,000,000,000,000 | 90 | https://github.com/ImageMagick/ImageMagick/issues/765 |
void Magick::Image::thumbnail(const Geometry &geometry_)
{
MagickCore::Image
*newImage;
size_t
height=rows(),
width=columns();
ssize_t
x=0,
y=0;
ParseMetaGeometry(static_cast<std::string>(geometry_).c_str(),&x,&y,&width,
&height);
GetPPException;
newImage=ThumbnailImage(constImag... | 0 | [
"CWE-416"
] | ImageMagick | 8c35502217c1879cb8257c617007282eee3fe1cc | 160,424,818,516,781,640,000,000,000,000,000,000,000 | 21 | Added missing return to avoid use after free. |
static size_t mz_zip_mem_read_func(void *pOpaque, mz_uint64 file_ofs,
void *pBuf, size_t n) {
mz_zip_archive *pZip = (mz_zip_archive *)pOpaque;
size_t s = (file_ofs >= pZip->m_archive_size)
? 0
: (size_t)MZ_MIN(pZip->m_archive_size - file_ofs, n);... | 0 | [
"CWE-20",
"CWE-190"
] | tinyexr | a685e3332f61cd4e59324bf3f669d36973d64270 | 206,787,331,559,325,740,000,000,000,000,000,000,000 | 9 | Make line_no with too large value(2**20) invalid. Fixes #124 |
static void bochs_close(BlockDriverState *bs)
{
BDRVBochsState *s = bs->opaque;
g_free(s->catalog_bitmap);
} | 0 | [
"CWE-369"
] | qemu | 8e53abbc20d08ae3ec30c2054e1161314ad9501d | 276,936,075,725,372,650,000,000,000,000,000,000,000 | 5 | bochs: Check extent_size header field (CVE-2014-0142)
This fixes two possible division by zero crashes: In bochs_open() and in
seek_to_sector().
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Stefan Hajnoczi <st... |
static int snd_compr_free(struct inode *inode, struct file *f)
{
struct snd_compr_file *data = f->private_data;
struct snd_compr_runtime *runtime = data->stream.runtime;
switch (runtime->state) {
case SNDRV_PCM_STATE_RUNNING:
case SNDRV_PCM_STATE_DRAINING:
case SNDRV_PCM_STATE_PAUSED:
data->stream.ops->trigger... | 0 | [
"CWE-703"
] | linux | 6217e5ede23285ddfee10d2e4ba0cc2d4c046205 | 109,199,202,157,076,140,000,000,000,000,000,000,000 | 21 | ALSA: compress: fix an integer overflow check
I previously added an integer overflow check here but looking at it now,
it's still buggy.
The bug happens in snd_compr_allocate_buffer(). We multiply
".fragments" and ".fragment_size" and that doesn't overflow but then we
save it in an unsigned int so it truncates the h... |
filter_register (struct backend *next, size_t index, const char *filename,
void *dl, struct nbdkit_filter *(*filter_init) (void))
{
struct backend_filter *f;
const struct nbdkit_filter *filter;
f = calloc (1, sizeof *f);
if (f == NULL) {
perror ("strdup");
exit (EXIT_FAILURE);
}
f... | 0 | [
"CWE-406"
] | nbdkit | a6b88b195a959b17524d1c8353fd425d4891dc5f | 256,462,895,919,626,400,000,000,000,000,000,000,000 | 53 | server: Fix regression for NBD_OPT_INFO before NBD_OPT_GO
Most known NBD clients do not bother with NBD_OPT_INFO (except for
clients like 'qemu-nbd --list' that don't ever intend to connect), but
go straight to NBD_OPT_GO. However, it's not too hard to hack up qemu
to add in an extra client step (whether info on the ... |
json_object *crypt_jobj_new_uint64(uint64_t value)
{
/* 18446744073709551615 */
char num[21];
int r;
json_object *jobj;
r = snprintf(num, sizeof(num), "%" PRIu64, value);
if (r < 0 || (size_t)r >= sizeof(num))
return NULL;
jobj = json_object_new_string(num);
return jobj;
} | 0 | [
"CWE-787"
] | cryptsetup | 52f5cb8cedf22fb3e14c744814ec8af7614146c7 | 307,245,552,969,064,930,000,000,000,000,000,000,000 | 14 | Check segment gaps regardless of heap space.
Segments are validated in hdr_validate_segments. Gaps in segment keys
are detected when collecting offsets. But if an invalid segment is very
large, larger than count, it could happen that cryptsetup is unable to
allocate enough memory, not giving a clue about what actually... |
ar6000_ap_mode_profile_commit(struct ar6_softc *ar)
{
WMI_CONNECT_CMD p;
unsigned long flags;
/* No change in AP's profile configuration */
if(ar->ap_profile_flag==0) {
A_PRINTF("COMMIT: No change in profile!!!\n");
return -ENODATA;
}
if(!ar->arSsidLen) {
A_PRINTF("SSI... | 0 | [
"CWE-703",
"CWE-264"
] | linux | 550fd08c2cebad61c548def135f67aba284c6162 | 301,472,744,407,814,160,000,000,000,000,000,000,000 | 61 | net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared
After the last patch, We are left in a state in which only drivers calling
ether_setup have IFF_TX_SKB_SHARING set (we assume that drivers touching real
hardware call ether_setup for their net_devices and don't hold any state in
their skbs. There... |
bool enumerate_field_refs_processor(void *arg)
{ return orig_item->enumerate_field_refs_processor(arg); } | 0 | [
"CWE-617"
] | server | 2e7891080667c59ac80f788eef4d59d447595772 | 109,467,889,550,941,940,000,000,000,000,000,000,000 | 2 | 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 struct kvm *kvm_create_vm(unsigned long type)
{
struct kvm *kvm = kvm_arch_alloc_vm();
struct kvm_memslots *slots;
int r = -ENOMEM;
int i, j;
if (!kvm)
return ERR_PTR(-ENOMEM);
KVM_MMU_LOCK_INIT(kvm);
mmgrab(current->mm);
kvm->mm = current->mm;
kvm_eventfd_init(kvm);
mutex_init(&kvm->lock);
mutex... | 0 | [
"CWE-476"
] | linux | 5593473a1e6c743764b08e3b6071cb43b5cfa6c4 | 135,581,622,670,372,140,000,000,000,000,000,000,000 | 121 | KVM: avoid NULL pointer dereference in kvm_dirty_ring_push
kvm_vcpu_release() will call kvm_dirty_ring_free(), freeing
ring->dirty_gfns and setting it to NULL. Afterwards, it calls
kvm_arch_vcpu_destroy().
However, if closing the file descriptor races with KVM_RUN in such away
that vcpu->arch.st.preempted == 0, the ... |
static int ceph_x_handle_reply(struct ceph_auth_client *ac, int result,
void *buf, void *end)
{
struct ceph_x_info *xi = ac->private;
struct ceph_x_reply_header *head = buf;
struct ceph_x_ticket_handler *th;
int len = end - buf;
int op;
int ret;
if (result)
return result; /* XXX hmm? */
if (xi->s... | 0 | [
"CWE-399",
"CWE-119"
] | linux | c27a3e4d667fdcad3db7b104f75659478e0c68d8 | 173,617,033,676,158,800,000,000,000,000,000,000,000 | 54 | libceph: do not hard code max auth ticket len
We hard code cephx auth ticket buffer size to 256 bytes. This isn't
enough for any moderate setups and, in case tickets themselves are not
encrypted, leads to buffer overflows (ceph_x_decrypt() errors out, but
ceph_decode_copy() doesn't - it's just a memcpy() wrapper). S... |
static void tcp_sndbuf_expand(struct sock *sk)
{
const struct tcp_sock *tp = tcp_sk(sk);
const struct tcp_congestion_ops *ca_ops = inet_csk(sk)->icsk_ca_ops;
int sndmem, per_mss;
u32 nr_segs;
/* Worst case is non GSO/TSO : each frame consumes one skb
* and skb->head is kmalloced using power of two area of memor... | 0 | [
"CWE-190"
] | net | 3b4929f65b0d8249f19a50245cd88ed1a2f78cff | 151,335,634,557,808,660,000,000,000,000,000,000,000 | 30 | tcp: limit payload size of sacked skbs
Jonathan Looney reported that TCP can trigger the following crash
in tcp_shifted_skb() :
BUG_ON(tcp_skb_pcount(skb) < pcount);
This can happen if the remote peer has advertized the smallest
MSS that linux TCP accepts : 48
An skb can hold 17 fragments, and each fragment can ho... |
QPDFWriter::adjustAESStreamLength(size_t& length)
{
if (this->encrypted && (! this->cur_data_key.empty()) &&
this->encrypt_use_aes)
{
// Stream length will be padded with 1 to 16 bytes to end up
// as a multiple of 16. It will also be prepended by 16 bits
// of random data.
length += 32 - (length & 0xf);
... | 0 | [
"CWE-399",
"CWE-835"
] | qpdf | 8249a26d69f72b9cda584c14cc3f12769985e481 | 163,577,536,631,719,240,000,000,000,000,000,000,000 | 11 | Fix infinite loop in QPDFWriter (fixes #143) |
append_uid (KBNODE keyblock, KBNODE node, int *n_sigs,
const char *fname, u32 *keyid )
{
KBNODE n, n_where=NULL;
(void)fname;
(void)keyid;
assert(node->pkt->pkttype == PKT_USER_ID );
/* find the position */
for( n = keyblock; n; n_where = n, n = n->next ) {
if( n->pkt->pkttype ==... | 0 | [
"CWE-20"
] | gnupg | f0b33b6fb8e0586e9584a7a409dcc31263776a67 | 106,000,170,867,421,290,000,000,000,000,000,000,000 | 42 | gpg: Import only packets which are allowed in a keyblock.
* g10/import.c (valid_keyblock_packet): New.
(read_block): Store only valid packets.
--
A corrupted key, which for example included a mangled public key
encrypted packet, used to corrupt the keyring. This change skips all
packets which are not allowed in a ke... |
void blk_queue_flag_set(unsigned int flag, struct request_queue *q)
{
unsigned long flags;
spin_lock_irqsave(q->queue_lock, flags);
queue_flag_set(flag, q);
spin_unlock_irqrestore(q->queue_lock, flags);
} | 0 | [
"CWE-416",
"CWE-703"
] | linux | 54648cf1ec2d7f4b6a71767799c45676a138ca24 | 185,209,654,127,252,550,000,000,000,000,000,000,000 | 8 | block: blk_init_allocated_queue() set q->fq as NULL in the fail case
We find the memory use-after-free issue in __blk_drain_queue()
on the kernel 4.14. After read the latest kernel 4.18-rc6 we
think it has the same problem.
Memory is allocated for q->fq in the blk_init_allocated_queue().
If the elevator init function... |
static void IndefItems_AddData(IndefItems* items, word32 length)
{
items->len[items->idx].len += length;
} | 0 | [
"CWE-125",
"CWE-345"
] | wolfssl | f93083be72a3b3d956b52a7ec13f307a27b6e093 | 159,084,982,800,381,380,000,000,000,000,000,000,000 | 4 | OCSP: improve handling of OCSP no check extension |
static int index_reuc_on_dup(void **old, void *new)
{
index_entry_reuc_free(*old);
*old = new;
return GIT_EEXISTS;
} | 0 | [
"CWE-415",
"CWE-190"
] | libgit2 | 3db1af1f370295ad5355b8f64b865a2a357bcac0 | 301,729,871,414,348,950,000,000,000,000,000,000,000 | 6 | index: error out on unreasonable prefix-compressed path lengths
When computing the complete path length from the encoded
prefix-compressed path, we end up just allocating the complete path
without ever checking what the encoded path length actually is. This can
easily lead to a denial of service by just encoding an un... |
static inline struct sk_buff *dev_dequeue_skb(struct net_device *dev,
struct Qdisc *q)
{
struct sk_buff *skb;
if ((skb = dev->gso_skb))
dev->gso_skb = NULL;
else
skb = q->dequeue(q);
return skb;
} | 0 | [
"CWE-399"
] | linux-2.6 | 2ba2506ca7ca62c56edaa334b0fe61eb5eab6ab0 | 179,429,601,436,077,300,000,000,000,000,000,000,000 | 12 | [NET]: Add preemption point in qdisc_run
The qdisc_run loop is currently unbounded and runs entirely in a
softirq. This is bad as it may create an unbounded softirq run.
This patch fixes this by calling need_resched and breaking out if
necessary.
It also adds a break out if the jiffies value changes since that woul... |
static int __net_init ip4_frags_ns_ctl_register(struct net *net)
{
struct ctl_table *table;
struct ctl_table_header *hdr;
table = ip4_frags_ns_ctl_table;
if (!net_eq(net, &init_net)) {
table = kmemdup(table, sizeof(ip4_frags_ns_ctl_table), GFP_KERNEL);
if (table == NULL)
goto err_alloc;
table[0].data = &... | 0 | [] | linux | 3ef0eb0db4bf92c6d2510fe5c4dc51852746f206 | 63,502,380,787,593,810,000,000,000,000,000,000,000 | 33 | net: frag, move LRU list maintenance outside of rwlock
Updating the fragmentation queues LRU (Least-Recently-Used) list,
required taking the hash writer lock. However, the LRU list isn't
tied to the hash at all, so we can use a separate lock for it.
Original-idea-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Je... |
dir_globs(long argc, const VALUE *argv, int flags)
{
VALUE ary = rb_ary_new();
long i;
for (i = 0; i < argc; ++i) {
int status;
VALUE str = argv[i];
FilePathValue(str);
status = push_glob(ary, str, flags);
if (status) GLOB_JUMP_TAG(status);
}
return ary;
} | 0 | [
"CWE-22"
] | ruby | 143eb22f1877815dd802f7928959c5f93d4c7bb3 | 213,928,910,463,016,330,000,000,000,000,000,000,000 | 15 | merge revision(s) 62989:
dir.c: check NUL bytes
* dir.c (GlobPathValue): should be used in rb_push_glob only.
other methods should use FilePathValue.
https://hackerone.com/reports/302338
* dir.c (rb_push_glob): expand GlobPathValue
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@63015 b2dd03c... |
static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
zend_op_array *new_op_array=NULL;
int return_value_used;
zend_free_op free_op1;
zval *inc_filename = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
zval tmp_inc_filename;
zend_... | 1 | [] | php-src | ce96fd6b0761d98353761bf78d5bfb55291179fd | 229,853,817,987,111,740,000,000,000,000,000,000,000 | 129 | - fix #39863, do not accept paths with NULL in them. See http://news.php.net/php.internals/50191, trunk will have the patch later (adding a macro and/or changing (some) APIs. Patch by Rasmus |
process_anchor(struct parsed_tag *tag, char *tagbuf)
{
if (parsedtag_need_reconstruct(tag)) {
parsedtag_set_value(tag, ATTR_HSEQ, Sprintf("%d", cur_hseq++)->ptr);
return parsedtag2str(tag);
}
else {
Str tmp = Sprintf("<a hseq=\"%d\"", cur_hseq++);
Strcat_charp(tmp, tagbuf + 2);
return tmp;
}
} | 0 | [
"CWE-476"
] | w3m | 59b91cd8e30c86f23476fa81ae005cabff49ebb6 | 277,972,200,298,322,200,000,000,000,000,000,000,000 | 12 | Prevent segfault with malformed input type
Bug-Debian: https://github.com/tats/w3m/issues/7 |
static MagickBooleanType ReadPSDChannelRLE(Image *image,const PSDInfo *psd_info,
const ssize_t type,MagickOffsetType *sizes,ExceptionInfo *exception)
{
MagickBooleanType
status;
size_t
length,
row_size;
ssize_t
count,
y;
unsigned char
*compact_pixels,
*pixels;
if (image->debu... | 0 | [
"CWE-835"
] | ImageMagick | 73d59a74e0b0a864c1a9581b8a4bdbee427125e2 | 216,135,069,202,904,640,000,000,000,000,000,000,000 | 73 | Different fix for #869. |
TEST_F(QueryPlannerTest, InvalidUtf8CodePointDoesNotLeadToInvalidIndexBoundsInvariantFailure) {
params.options &= ~QueryPlannerParams::INCLUDE_COLLSCAN;
addIndex(BSON("a" << 1));
// This UTF-8 is encoded correctly in the sense that it maps to a sequence of code points. The
// code point 0x110000 is con... | 0 | [] | mongo | 64095239f41e9f3841d8be9088347db56d35c891 | 2,842,056,339,844,703,000,000,000,000,000,000,000 | 14 | SERVER-51083 Reject invalid UTF-8 from $regex match expressions |
ArgParser::checkCompletion()
{
// See if we're being invoked from bash completion.
std::string bash_point_env;
if (QUtil::get_env("COMP_LINE", &bash_line) &&
QUtil::get_env("COMP_POINT", &bash_point_env))
{
int p = QUtil::string_to_int(bash_point_env.c_str());
if ((p > 0) && (p <... | 1 | [
"CWE-787"
] | qpdf | d71f05ca07eb5c7cfa4d6d23e5c1f2a800f52e8e | 207,211,761,520,230,840,000,000,000,000,000,000,000 | 71 | Fix sign and conversion warnings (major)
This makes all integer type conversions that have potential data loss
explicit with calls that do range checks and raise an exception. After
this commit, qpdf builds with no warnings when -Wsign-conversion
-Wconversion is used with gcc or clang or when -W3 -Wd4800 is used
with ... |
xmlSchemaCheckAGPropsCorrect(xmlSchemaParserCtxtPtr pctxt,
xmlSchemaAttributeGroupPtr attrGr)
{
/*
* SPEC ag-props-correct
* (1) "The values of the properties of an attribute group definition
* must be as described in the property tableau in The Attribute
* Group Definition Schema Component ($... | 0 | [
"CWE-134"
] | libxml2 | 4472c3a5a5b516aaf59b89be602fbce52756c3e9 | 87,791,261,220,757,720,000,000,000,000,000,000,000 | 87 | 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. |
struct dce_i2c_hw *dcn10_i2c_hw_create(
struct dc_context *ctx,
uint32_t inst)
{
struct dce_i2c_hw *dce_i2c_hw =
kzalloc(sizeof(struct dce_i2c_hw), GFP_KERNEL);
if (!dce_i2c_hw)
return NULL;
dcn1_i2c_hw_construct(dce_i2c_hw, ctx, inst,
&i2c_hw_regs[inst], &i2c_shifts, &i2c_masks);
return dce_i2c_hw... | 0 | [
"CWE-400",
"CWE-401"
] | linux | 104c307147ad379617472dd91a5bcb368d72bd6d | 108,288,315,226,002,430,000,000,000,000,000,000,000 | 15 | drm/amd/display: prevent memory leak
In dcn*_create_resource_pool the allocated memory should be released if
construct pool fails.
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com> |
undef_method(mrb_state *mrb, struct RClass *c, mrb_sym a)
{
if (!mrb_obj_respond_to(mrb, c, a)) {
mrb_name_error(mrb, a, "undefined method '%S' for class '%S'", mrb_sym2str(mrb, a), mrb_obj_value(c));
}
else {
mrb_method_t m;
MRB_METHOD_FROM_PROC(m, NULL);
mrb_define_method_raw(mrb, c, a, m);
}... | 0 | [
"CWE-476",
"CWE-415"
] | mruby | faa4eaf6803bd11669bc324b4c34e7162286bfa3 | 142,716,815,791,215,140,000,000,000,000,000,000,000 | 12 | `mrb_class_real()` did not work for `BasicObject`; fix #4037 |
static int l2cap_build_conf_req(struct sock *sk, void *data)
{
struct l2cap_pinfo *pi = l2cap_pi(sk);
struct l2cap_conf_req *req = data;
struct l2cap_conf_rfc rfc = { .mode = L2CAP_MODE_ERTM };
void *ptr = req->data;
BT_DBG("sk %p", sk);
if (pi->num_conf_req || pi->num_conf_rsp)
goto done;
switch (pi->mode)... | 0 | [
"CWE-200",
"CWE-119",
"CWE-787"
] | linux | f2fcfcd670257236ebf2088bbdf26f6a8ef459fe | 72,887,840,264,586,600,000,000,000,000,000,000,000 | 70 | Bluetooth: Add configuration support for ERTM and Streaming mode
Add support to config_req and config_rsp to configure ERTM and Streaming
mode. If the remote device specifies ERTM or Streaming mode, then the
same mode is proposed. Otherwise ERTM or Basic mode is used. And in case
of a state 2 device, the remote device... |
static void vmx_reset_x2apic_msrs(struct kvm_vcpu *vcpu, u8 mode)
{
unsigned long *msr_bitmap = to_vmx(vcpu)->vmcs01.msr_bitmap;
unsigned long read_intercept;
int msr;
read_intercept = (mode & MSR_BITMAP_MODE_X2APIC_APICV) ? 0 : ~0;
for (msr = 0x800; msr <= 0x8ff; msr += BITS_PER_LONG) {
unsigned int read_idx ... | 0 | [
"CWE-787"
] | linux | 04c4f2ee3f68c9a4bf1653d15f1a9a435ae33f7a | 54,995,621,047,685,820,000,000,000,000,000,000,000 | 16 | KVM: VMX: Don't use vcpu->run->internal.ndata as an array index
__vmx_handle_exit() uses vcpu->run->internal.ndata as an index for
an array access. Since vcpu->run is (can be) mapped to a user address
space with a writer permission, the 'ndata' could be updated by the
user process at anytime (the user process can set... |
void CLASS kodak_rgb_load_raw()
{
#ifdef LIBRAW_LIBRARY_BUILD
if (!image)
throw LIBRAW_EXCEPTION_IO_CORRUPT;
#endif
short buf[768], *bp;
int row, col, len, c, i, rgb[3], ret;
ushort *ip = image[0];
for (row = 0; row < height; row++)
{
#ifdef LIBRAW_LIBRARY_BUILD
checkCancel();
#endif
for (col =... | 0 | [
"CWE-190"
] | LibRaw | 4554e24ce24beaef5d0ef48372801cfd91039076 | 35,910,089,345,388,956,000,000,000,000,000,000,000 | 32 | parse_qt: possible integer overflow |
vte_sequence_handler_set_window_title (VteTerminal *terminal, GValueArray *params)
{
vte_sequence_handler_set_title_internal(terminal, params, FALSE, TRUE);
} | 0 | [] | vte | 58bc3a942f198a1a8788553ca72c19d7c1702b74 | 189,375,982,337,635,400,000,000,000,000,000,000,000 | 4 | fix bug #548272
svn path=/trunk/; revision=2365 |
jas_cmxform_t *jas_cmxform_create(jas_cmprof_t *inprof, jas_cmprof_t *outprof,
jas_cmprof_t *prfprof, int op, int intent, int optimize)
{
jas_cmxform_t *xform;
jas_cmpxformseq_t *inpxformseq;
jas_cmpxformseq_t *outpxformseq;
jas_cmpxformseq_t *altoutpxformseq;
jas_cmpxformseq_t *prfpxformseq;
int prfintent;
/... | 0 | [
"CWE-189"
] | jasper | 3c55b399c36ef46befcb21e4ebc4799367f89684 | 35,260,110,134,532,950,000,000,000,000,000,000,000 | 98 | At many places in the code, jas_malloc or jas_recalloc was being
invoked with the size argument being computed in a manner that would not
allow integer overflow to be detected. Now, these places in the code
have been modified to use special-purpose memory allocation functions
(e.g., jas_alloc2, jas_alloc3, jas_realloc... |
TEE_Result tee_obj_set_type(struct tee_obj *o, uint32_t obj_type,
size_t max_key_size)
{
TEE_Result res = TEE_SUCCESS;
const struct tee_cryp_obj_type_props *type_props;
/* Can only set type for newly allocated objs */
if (o->attr)
return TEE_ERROR_BAD_STATE;
/*
* Verify that maxKeySize is supported an... | 0 | [
"CWE-119",
"CWE-787"
] | optee_os | a637243270fc1faae16de059091795c32d86e65e | 78,218,838,531,344,960,000,000,000,000,000,000,000 | 84 | svc: check for allocation overflow in crypto calls
Without checking for overflow there is a risk of allocating a buffer
with size smaller than anticipated and as a consequence of that it might
lead to a heap based overflow with attacker controlled data written
outside the boundaries of the buffer.
Fixes: OP-TEE-2018-... |
X509_CRL *X509_STORE_CTX_get0_current_crl(X509_STORE_CTX *ctx)
{
return ctx->current_crl;
} | 0 | [
"CWE-119"
] | openssl | 370ac320301e28bb615cee80124c042649c95d14 | 105,377,095,779,028,950,000,000,000,000,000,000,000 | 4 | Fix length checks in X509_cmp_time to avoid out-of-bounds reads.
Also tighten X509_cmp_time to reject more than three fractional
seconds in the time; and to reject trailing garbage after the offset.
CVE-2015-1789
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org> |
bool Item_cache_temporal::get_date(MYSQL_TIME *ltime, ulonglong fuzzydate)
{
ErrConvInteger str(value);
if (!has_value())
{
bzero((char*) ltime,sizeof(*ltime));
return (null_value= true);
}
unpack_time(value, ltime, mysql_timestamp_type());
return 0;
} | 0 | [
"CWE-416"
] | server | c02ebf3510850ba78a106be9974c94c3b97d8585 | 230,507,080,006,317,200,000,000,000,000,000,000,000 | 13 | 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. |
ldbm_config_lookthroughlimit_set(void *arg, void *value, char *errorbuf __attribute__((unused)), int phase __attribute__((unused)), int apply)
{
struct ldbminfo *li = (struct ldbminfo *)arg;
int retval = LDAP_SUCCESS;
int val = (int)((uintptr_t)value);
/* Do whatever we can to make sure the data is ok.... | 0 | [
"CWE-399",
"CWE-203"
] | 389-ds-base | cc0f69283abc082488824702dae485b8eae938bc | 296,235,045,193,552,200,000,000,000,000,000,000,000 | 14 | Issue 4480 - Unexpected info returned to ldap request (#4491)
Bug description:
If the bind entry does not exist, the bind result info
reports that 'No such entry'. It should not give any
information if the target entry exists or not
Fix description:
Does not return any additional information d... |
midi_synth_load_patch(int dev, int format, const char __user *addr,
int count, int pmgr_flag)
{
int orig_dev = synth_devs[dev]->midi_dev;
struct sysex_info sysex;
int i;
unsigned long left, src_offs, eox_seen = 0;
int first_byte = 1;
int hdr_size = (unsig... | 0 | [
"CWE-703",
"CWE-189"
] | linux | b769f49463711205d57286e64cf535ed4daf59e9 | 75,340,502,713,665,020,000,000,000,000,000,000,000 | 74 | sound/oss: remove offset from load_patch callbacks
Was: [PATCH] sound/oss/midi_synth: prevent underflow, use of
uninitialized value, and signedness issue
The offset passed to midi_synth_load_patch() can be essentially
arbitrary. If it's greater than the header length, this will result in
a copy_from_user(dst, src, n... |
get_thread_alone_check_flag(void)
{
#ifdef RUBY_USE_NATIVE_THREAD
return 0;
#else
set_tcltk_version();
if (tcltk_version.major < 8) {
/* Tcl/Tk 7.x */
return 1;
} else if (tcltk_version.major == 8) {
if (tcltk_version.minor < 5) {
/* Tcl/Tk 8.0 - 8.4 */
return 1;
} else if (tcltk_ve... | 0 | [] | tk | ebd0fc80d62eeb7b8556522256f8d035e013eb65 | 306,750,029,310,784,700,000,000,000,000,000,000,000 | 32 | tcltklib.c: check argument
* ext/tk/tcltklib.c (ip_cancel_eval_core): check argument type and
length.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
CairoOutputDev::getFilterForSurface(cairo_surface_t *image,
GBool interpolate)
{
if (interpolate)
return CAIRO_FILTER_BILINEAR;
int orig_width = cairo_image_surface_get_width (image);
int orig_height = cairo_image_surface_get_height (image);
if (orig_width == 0 || orig_height == 0)
return CAIRO_... | 0 | [] | poppler | abf167af8b15e5f3b510275ce619e6fdb42edd40 | 61,909,713,537,886,610,000,000,000,000,000,000,000 | 20 | Implement tiling/patterns in SplashOutputDev
Fixes bug 13518 |
cr_input_increment_col_num (CRInput * a_this, glong a_increment)
{
g_return_val_if_fail (a_this && PRIVATE (a_this), CR_BAD_PARAM_ERROR);
PRIVATE (a_this)->col += a_increment;
return CR_OK;
} | 0 | [
"CWE-125"
] | libcroco | 898e3a8c8c0314d2e6b106809a8e3e93cf9d4394 | 120,723,875,833,070,800,000,000,000,000,000,000,000 | 8 | input: check end of input before reading a byte
When reading bytes we weren't check that the index wasn't
out of bound and this could produce an invalid read which
could deal to a security bug. |
QPDFWriter::~QPDFWriter()
{
} | 0 | [
"CWE-125"
] | qpdf | 1868a10f8b06631362618bfc85ca8646da4b4b71 | 264,933,741,254,097,900,000,000,000,000,000,000,000 | 3 | Replace all atoi calls with QUtil::string_to_int
The latter catches underflow/overflow. |
int intel_guc_init(struct intel_guc *guc)
{
struct intel_gt *gt = guc_to_gt(guc);
int ret;
ret = intel_uc_fw_init(&guc->fw);
if (ret)
goto out;
ret = intel_guc_log_create(&guc->log);
if (ret)
goto err_fw;
ret = intel_guc_ads_create(guc);
if (ret)
goto err_log;
GEM_BUG_ON(!guc->ads_vma);
ret = intel_... | 0 | [
"CWE-20",
"CWE-190"
] | linux | c784e5249e773689e38d2bc1749f08b986621a26 | 200,918,285,132,651,530,000,000,000,000,000,000,000 | 54 | drm/i915/guc: Update to use firmware v49.0.1
The latest GuC firmware includes a number of interface changes that
require driver updates to match.
* Starting from Gen11, the ID to be provided to GuC needs to contain
the engine class in bits [0..2] and the instance in bits [3..6].
NOTE: this patch breaks pointer d... |
modify_param_name (param_token *name)
{
const char *delim1 = memchr (name->b, '*', name->e - name->b);
const char *delim2 = memrchr (name->b, '*', name->e - name->b);
int result;
if (delim1 == NULL)
{
result = NOT_RFC2231;
}
else if (delim1 == delim2)
{
if ((name->e - 1) == delim1)
... | 0 | [
"CWE-119"
] | wget | d892291fb8ace4c3b734ea5125770989c215df3f | 22,900,056,416,222,650,000,000,000,000,000,000,000 | 30 | Fix stack overflow in HTTP protocol handling (CVE-2017-13089)
* src/http.c (skip_short_body): Return error on negative chunk size
Reported-by: Antti Levomäki, Christian Jalio, Joonas Pihlaja from Forcepoint
Reported-by: Juhani Eronen from Finnish National Cyber Security Centre |
Factory* factory() { return reinterpret_cast<Factory*>(this); } | 0 | [
"CWE-20",
"CWE-119"
] | node | 530af9cb8e700e7596b3ec812bad123c9fa06356 | 88,687,677,086,448,660,000,000,000,000,000,000,000 | 1 | v8: Interrupts must not mask stack overflow.
Backport of https://codereview.chromium.org/339883002 |
http_read_buffered(http_t *http, /* I - HTTP connection */
char *buffer, /* I - Buffer */
size_t length) /* I - Maximum bytes to read */
{
ssize_t bytes; /* Bytes read */
DEBUG_printf(("http_read_buffered(http=%p, buffer=%p, length=" CUPS_LLFMT ") used=%d", (void *)http, ... | 0 | [
"CWE-120"
] | cups | f24e6cf6a39300ad0c3726a41a4aab51ad54c109 | 315,079,820,597,815,120,000,000,000,000,000,000,000 | 30 | Fix multiple security/disclosure issues:
- CVE-2019-8696 and CVE-2019-8675: Fixed SNMP buffer overflows (rdar://51685251)
- Fixed IPP buffer overflow (rdar://50035411)
- Fixed memory disclosure issue in the scheduler (rdar://51373853)
- Fixed DoS issues in the scheduler (rdar://51373929) |
static void _php_mb_regex_globals_dtor(zend_mb_regex_globals *pglobals)
{
} | 0 | [
"CWE-125"
] | php-src | e617f03066ce81d26f56c06d6bd7787c7de08703 | 225,075,023,471,239,760,000,000,000,000,000,000,000 | 3 | Fix #77367: Negative size parameter in mb_split
When adding the last element to the result value of `mb_split`, the
`chunk_pos` may point beyond the end of the string, in which case the
unsigned `n` would underflow. Therefore, we check whether this is the
case in the first place, and only calculate `n` otherwise. Si... |
virtual_active(void)
{
unsigned int cur_ve_flags = get_ve_flags();
// While an operator is being executed we return "virtual_op", because
// VIsual_active has already been reset, thus we can't check for "block"
// being used.
if (virtual_op != MAYBE)
return virtual_op;
return (cur_ve_flags == ... | 0 | [
"CWE-120"
] | vim | 7ce5b2b590256ce53d6af28c1d203fb3bc1d2d97 | 215,425,668,355,769,130,000,000,000,000,000,000,000 | 14 | patch 8.2.4969: changing text in Visual mode may cause invalid memory access
Problem: Changing text in Visual mode may cause invalid memory access.
Solution: Check the Visual position after making a change. |
notify_of_job_status ()
{
register int job, termsig;
char *dir;
sigset_t set, oset;
WAIT s;
if (jobs == 0 || js.j_jobslots == 0)
return;
if (old_ttou != 0)
{
sigemptyset (&set);
sigaddset (&set, SIGCHLD);
sigaddset (&set, SIGTTOU);
sigemptyset (&oset);
sigprocmask (SI... | 0 | [] | bash | 955543877583837c85470f7fb8a97b7aa8d45e6c | 28,852,047,032,088,685,000,000,000,000,000,000,000 | 137 | bash-4.4-rc2 release |
static MagickBooleanType DecodeImage(Image *image, unsigned char *pixels,
const size_t length)
{
#define RLE_MODE_NONE -1
#define RLE_MODE_COPY 0
#define RLE_MODE_RUN 1
int data = 0, count = 0;
unsigned char *p;
int mode = RLE_MODE_NONE;
for (p = pixels; p < pixels + length; p++) {
... | 0 | [
"CWE-787"
] | ImageMagick | 7b93db1807ef8abf0c81df8b0fd047e5fb3f1c3f | 274,558,006,865,292,350,000,000,000,000,000,000,000 | 35 | https://github.com/ImageMagick/ImageMagick/issues/121 |
move_copy_file_callback_new (GFile *file,
gboolean overwrite,
GdkPoint *position)
{
MoveFileCopyFallback *fallback;
fallback = g_new (MoveFileCopyFallback, 1);
fallback->file = file;
fallback->overwrite = overwrite;
if (position) {
fallback->has_position = TRUE;
fallback->position = *position;... | 0 | [] | nautilus | ca2fd475297946f163c32dcea897f25da892b89d | 223,998,197,566,491,740,000,000,000,000,000,000,000 | 18 | Add nautilus_file_mark_desktop_file_trusted(), this now adds a #! line if
2009-02-24 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-file-operations.c:
* libnautilus-private/nautilus-file-operations.h:
Add nautilus_file_mark_desktop_file_trusted(), this now
adds a #! line if th... |
}
static JSValue js_sys_discard_opts(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
{
gf_opts_discard_changes();
return JS_UNDEFINED; | 0 | [
"CWE-787"
] | gpac | ea1eca00fd92fa17f0e25ac25652622924a9a6a0 | 222,666,510,300,066,060,000,000,000,000,000,000,000 | 5 | fixed #2138 |
static int push_insn(int t, int w, int e, struct bpf_verifier_env *env,
bool loop_ok)
{
int *insn_stack = env->cfg.insn_stack;
int *insn_state = env->cfg.insn_state;
if (e == FALLTHROUGH && insn_state[t] >= (DISCOVERED | FALLTHROUGH))
return 0;
if (e == BRANCH && insn_state[t] >= (DISCOVERED | BRANCH))
... | 0 | [] | linux | 294f2fc6da27620a506e6c050241655459ccd6bd | 252,708,016,994,494,100,000,000,000,000,000,000,000 | 46 | bpf: Verifer, adjust_scalar_min_max_vals to always call update_reg_bounds()
Currently, for all op verification we call __red_deduce_bounds() and
__red_bound_offset() but we only call __update_reg_bounds() in bitwise
ops. However, we could benefit from calling __update_reg_bounds() in
BPF_ADD, BPF_SUB, and BPF_MUL case... |
int crypto_has_skcipher2(const char *alg_name, u32 type, u32 mask)
{
return crypto_type_has_alg(alg_name, &crypto_skcipher_type2,
type, mask);
} | 0 | [
"CWE-476",
"CWE-703"
] | linux | 9933e113c2e87a9f46a40fde8dafbf801dca1ab9 | 68,480,279,992,258,210,000,000,000,000,000,000,000 | 5 | crypto: skcipher - Add missing API setkey checks
The API setkey checks for key sizes and alignment went AWOL during the
skcipher conversion. This patch restores them.
Cc: <stable@vger.kernel.org>
Fixes: 4e6c3df4d729 ("crypto: skcipher - Add low-level skcipher...")
Reported-by: Baozeng <sploving1@gmail.com>
Signed-of... |
static struct kmem_cache *create_kmalloc_cache(struct kmem_cache *s,
const char *name, int size, gfp_t gfp_flags)
{
unsigned int flags = 0;
if (gfp_flags & SLUB_DMA)
flags = SLAB_CACHE_DMA;
down_write(&slub_lock);
if (!kmem_cache_open(s, gfp_flags, name, size, ARCH_KMALLOC_MINALIGN,
flags, NULL))
go... | 0 | [
"CWE-189"
] | linux | f8bd2258e2d520dff28c855658bd24bdafb5102d | 181,901,673,479,579,960,000,000,000,000,000,000,000 | 22 | remove div_long_long_rem
x86 is the only arch right now, which provides an optimized for
div_long_long_rem and it has the downside that one has to be very careful that
the divide doesn't overflow.
The API is a little akward, as the arguments for the unsigned divide are
signed. The signed version also doesn't handle ... |
static size_t session_get_num_active_streams(nghttp2_session *session) {
return nghttp2_map_size(&session->streams) - session->num_closed_streams -
session->num_idle_streams;
} | 0 | [] | nghttp2 | 0a6ce87c22c69438ecbffe52a2859c3a32f1620f | 258,878,627,823,723,950,000,000,000,000,000,000,000 | 4 | Add nghttp2_option_set_max_outbound_ack |
static st32 getlistmask(char *input) {
st32 tempres, res = 0;
int i, j, start, end;
char *temp = NULL;
char *otemp = NULL;
char *temp2 = malloc (strlen (input) + 1);
if (!temp2) {
res = -1;
goto end;
}
temp = (char *)malloc (strlen (input) + 1);
if (!temp) {
res = -1;
goto end;
}
otemp = temp;
while... | 0 | [
"CWE-125",
"CWE-787"
] | radare2 | e5c14c167b0dcf0a53d76bd50bacbbcc0dfc1ae7 | 6,672,148,596,384,306,000,000,000,000,000,000,000 | 66 | Fix #12417/#12418 (arm assembler heap overflows) |
void* Init(TfLiteContext* context, const char* buffer, size_t length) {
auto* data = new OpData;
data->requires_broadcast = false;
return data;
} | 0 | [
"CWE-125",
"CWE-787"
] | tensorflow | 1970c2158b1ffa416d159d03c3370b9a462aee35 | 104,827,864,636,776,960,000,000,000,000,000,000,000 | 5 | [tflite]: Insert `nullptr` checks when obtaining tensors.
As part of ongoing refactoring, `tflite::GetInput`, `tflite::GetOutput`, `tflite::GetTemporary` and `tflite::GetIntermediates` will return `nullptr` in some cases. Hence, we insert the `nullptr` checks on all usages.
We also insert `nullptr` checks on usages o... |
static MagickBooleanType IsDIB(const unsigned char *magick,const size_t length)
{
if (length < 2)
return(MagickFalse);
if (memcmp(magick,"\050\000",2) == 0)
return(MagickTrue);
return(MagickFalse);
} | 0 | [
"CWE-787"
] | ImageMagick6 | ae71c12bbaa34d942e036824ff389c22b7dacade | 47,482,509,972,095,290,000,000,000,000,000,000,000 | 8 | https://github.com/ImageMagick/ImageMagick/issues/1178 |
int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs,
struct file *filp)
{
int ret;
struct iattr newattrs;
/* Not pretty: "inode->i_size" shouldn't really be signed. But it is. */
if (length < 0)
return -EINVAL;
newattrs.ia_size = length;
newattrs.ia_valid = ATTR_SIZE | time_attrs;
... | 0 | [
"CWE-284"
] | linux | 54d5ca871e72f2bb172ec9323497f01cd5091ec7 | 131,405,682,447,111,010,000,000,000,000,000,000,000 | 30 | vfs: add vfs_select_inode() helper
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Cc: <stable@vger.kernel.org> # v4.2+ |
business_compare (EContact *contact1,
EContact *contact2)
{
gint phone_ids[2] = { E_CONTACT_PHONE_BUSINESS, E_CONTACT_PHONE_BUSINESS_2 };
const gchar *phone1, *phone2;
gint i;
for (i = 0; i < 2; i++) {
gboolean equal;
phone1 = e_contact_get (contact1, phone_ids[i]);
phone2 = e_contact_get (... | 0 | [] | evolution-data-server | 34bad61738e2127736947ac50e0c7969cc944972 | 160,137,197,670,823,350,000,000,000,000,000,000,000 | 23 | Bug 796174 - strcat() considered unsafe for buffer overflow |
int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a, ASN1_BIT_STRING *signature,
void *asn, EVP_PKEY *pkey)
{
EVP_MD_CTX ctx;
const EVP_MD *type;
unsigned char *buf_in=NULL;
int ret= -1,i,inl;
if (!pkey)
{
ASN1err(ASN1_F_ASN1_ITEM_VERIFY, ERR_R_PASSED_NULL_PARAMETER);
return -1;
}
if (signatu... | 0 | [
"CWE-310"
] | openssl | ec2fede9467ae1a65f452d3a39f7fbc4891d9285 | 229,436,882,192,258,560,000,000,000,000,000,000,000 | 64 | Fix various certificate fingerprint issues.
By using non-DER or invalid encodings outside the signed portion of a
certificate the fingerprint can be changed without breaking the signature.
Although no details of the signed portion of the certificate can be changed
this can cause problems with some applications: e.g. t... |
_PG_init(void)
{
/* Be sure we do initialization only once (should be redundant now) */
static bool inited = false;
const int **version_ptr;
if (inited)
return;
/* Be sure we don't run Python 2 and 3 in the same session (might crash) */
version_ptr = (const int **) find_rendezvous_variable("plpython_python_ve... | 0 | [
"CWE-264"
] | postgres | 537cbd35c893e67a63c59bc636c3e888bd228bc7 | 165,134,948,890,091,530,000,000,000,000,000,000,000 | 45 | Prevent privilege escalation in explicit calls to PL validators.
The primary role of PL validators is to be called implicitly during
CREATE FUNCTION, but they are also normal functions that a user can call
explicitly. Add a permissions check to each validator to ensure that a
user cannot use explicit validator calls ... |
find_file_callback (char *filename, void *data1, void *data2)
{
char **pdir = (char **) data1;
FILE **pfile = (FILE **) data2;
int is_done = 0;
assert (filename && *filename);
assert (pdir);
assert (pfile);
if ((*pfile = fopen (filename, LT_READTEXT_MODE)))
{
char *dirend = strr... | 0 | [] | libtool | e91f7b960032074a55fc91273c1917e3082b5338 | 193,011,104,002,551,000,000,000,000,000,000,000,000 | 24 | Don't load module.la from current directory by default.
* libltdl/ltdl.c (try_dlopen): Do not attempt to load an
unqualified module.la file from the current directory (by
default) since doing so is insecure and is not compliant with
the documentation.
* tests/testsuite.at: Qualify access to module.la file in
current d... |
static bool isMask(ut32 value) {
return value && ((value + 1) & value) == 0;
} | 0 | [
"CWE-119",
"CWE-787"
] | radare2 | df167c7db545953bb7f71c72e98e7a3ca0c793bf | 212,027,797,325,380,940,000,000,000,000,000,000,000 | 3 | Fix #12376 - crash in: rasm2 -a arm -b 64 '0 ,0,0,0,0,0,0,' |
void handle_connection_in_main_thread(THD *thd)
{
mysql_mutex_assert_owner(&LOCK_thread_count);
thread_cache_size=0; // Safety
threads.append(thd);
mysql_mutex_unlock(&LOCK_thread_count);
thd->start_utime= microsecond_interval_timer();
do_handle_one_connection(thd);
} | 0 | [
"CWE-362"
] | server | 347eeefbfc658c8531878218487d729f4e020805 | 333,207,912,212,781,340,000,000,000,000,000,000,000 | 9 | don't use my_copystat in the server
it was supposed to be used in command-line tools only.
Different fix for 4e5473862e:
Bug#24388746: PRIVILEGE ESCALATION AND RACE CONDITION USING CREATE TABLE |
forward_key_events (GSWindow *window)
{
window->priv->key_events = g_list_reverse (window->priv->key_events);
while (window->priv->key_events != NULL) {
GdkEventKey *event = window->priv->key_events->data;
gtk_window_propagate_key_event (GTK_WINDOW (window), event);
... | 0 | [] | gnome-screensaver | a5f66339be6719c2b8fc478a1d5fc6545297d950 | 336,515,566,775,849,600,000,000,000,000,000,000,000 | 14 | Ensure keyboard grab and unlock dialog exist after monitor removal
gnome-screensaver currently doesn't deal with monitors getting
removed properly. If the unlock dialog is on the removed monitor
then the unlock dialog and its associated keyboard grab are not
moved to an existing monitor when the monitor removal is pr... |
static int pfkey_migrate(struct sock *sk, struct sk_buff *skb,
const struct sadb_msg *hdr, void * const *ext_hdrs)
{
int i, len, ret, err = -EINVAL;
u8 dir;
struct sadb_address *sa;
struct sadb_x_kmaddress *kma;
struct sadb_x_policy *pol;
struct sadb_x_ipsecrequest *rq;
struct xfrm_selector sel;
struct xfrm... | 0 | [
"CWE-416"
] | linux | dbb2483b2a46fbaf833cfb5deb5ed9cace9c7399 | 186,743,840,014,088,300,000,000,000,000,000,000,000 | 91 | xfrm: clean up xfrm protocol checks
In commit 6a53b7593233 ("xfrm: check id proto in validate_tmpl()")
I introduced a check for xfrm protocol, but according to Herbert
IPSEC_PROTO_ANY should only be used as a wildcard for lookup, so
it should be removed from validate_tmpl().
And, IPSEC_PROTO_ANY is expected to only m... |
long kvm_arch_vcpu_ioctl(struct file *filp,
unsigned int ioctl, unsigned long arg)
{
struct kvm_vcpu *vcpu = filp->private_data;
void __user *argp = (void __user *)arg;
int r;
union {
struct kvm_lapic_state *lapic;
struct kvm_xsave *xsave;
struct kvm_xcrs *xcrs;
void *buffer;
} u;
u.buffer = NULL;
s... | 0 | [
"CWE-369"
] | linux | 0185604c2d82c560dab2f2933a18f797e74ab5a8 | 121,280,345,454,437,000,000,000,000,000,000,000,000 | 271 | KVM: x86: Reload pit counters for all channels when restoring state
Currently if userspace restores the pit counters with a count of 0
on channels 1 or 2 and the guest attempts to read the count on those
channels, then KVM will perform a mod of 0 and crash. This will ensure
that 0 values are converted to 65536 as per... |
int Field::store_hex_hybrid(const char *str, size_t length)
{
DBUG_ASSERT(result_type() != STRING_RESULT);
ulonglong nr;
if (length > 8)
{
nr= flags & UNSIGNED_FLAG ? ULONGLONG_MAX : LONGLONG_MAX;
goto warn;
}
nr= (ulonglong) longlong_from_hex_hybrid(str, length);
if ((length == 8) && !(flags & U... | 0 | [
"CWE-416",
"CWE-703"
] | server | 08c7ab404f69d9c4ca6ca7a9cf7eec74c804f917 | 44,820,126,120,007,100,000,000,000,000,000,000,000 | 23 | MDEV-24176 Server crashes after insert in the table with virtual
column generated using date_format() and if()
vcol_info->expr is allocated on expr_arena at parsing stage. Since
expr item is allocated on expr_arena all its containee items must be
allocated on expr_arena too. Otherwise fix_session_expr() will
encounter... |
int btrfs_del_items(struct btrfs_trans_handle *trans, struct btrfs_root *root,
struct btrfs_path *path, int slot, int nr)
{
struct extent_buffer *leaf;
struct btrfs_item *item;
int last_off;
int dsize = 0;
int ret = 0;
int wret;
int i;
u32 nritems;
struct btrfs_map_token token;
btrfs_init_map_token(&to... | 0 | [
"CWE-416",
"CWE-362"
] | linux | 5f5bc6b1e2d5a6f827bc860ef2dc5b6f365d1339 | 226,934,234,121,446,100,000,000,000,000,000,000,000 | 110 | Btrfs: make xattr replace operations atomic
Replacing a xattr consists of doing a lookup for its existing value, delete
the current value from the respective leaf, release the search path and then
finally insert the new value. This leaves a time window where readers (getxattr,
listxattrs) won't see any value for the x... |
static int snd_microii_spdif_mask_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
ucontrol->value.iec958.status[0] = 0x0f;
ucontrol->value.iec958.status[1] = 0xff;
ucontrol->value.iec958.status[2] = 0x00;
ucontrol->value.iec958.status[3] = 0x00;
return 0;
} | 0 | [] | sound | 447d6275f0c21f6cc97a88b3a0c601436a4cdf2a | 134,896,661,674,078,270,000,000,000,000,000,000,000 | 10 | ALSA: usb-audio: Add sanity checks for endpoint accesses
Add some sanity check codes before actually accessing the endpoint via
get_endpoint() in order to avoid the invalid access through a
malformed USB descriptor. Mostly just checking bNumEndpoints, but in
one place (snd_microii_spdif_default_get()), the validity o... |
nautilus_file_can_trash (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 file... | 0 | [] | nautilus | 7632a3e13874a2c5e8988428ca913620a25df983 | 70,170,919,095,616,380,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-... |
void inet_csk_reqsk_queue_prune(struct sock *parent,
const unsigned long interval,
const unsigned long timeout,
const unsigned long max_rto)
{
struct inet_connection_sock *icsk = inet_csk(parent);
struct request_sock_queue *queue = &icsk->icsk_accept_queue;
struct listen_sock *lopt = queue->listen_opt;
... | 0 | [
"CWE-362"
] | linux-2.6 | f6d8bd051c391c1c0458a30b2a7abcd939329259 | 182,875,659,014,820,300,000,000,000,000,000,000,000 | 94 | 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 void __fib6_update_sernum_upto_root(struct fib6_info *rt,
int sernum)
{
struct fib6_node *fn = rcu_dereference_protected(rt->fib6_node,
lockdep_is_held(&rt->fib6_table->tb6_lock));
/* paired with smp_rmb() in rt6_get_cookie_safe() */
smp_wmb();
while (fn) {
fn->fn_sernum = sernum;
fn = rcu_d... | 0 | [
"CWE-755"
] | linux | 7b09c2d052db4b4ad0b27b97918b46a7746966fa | 103,524,551,454,836,200,000,000,000,000,000,000,000 | 14 | ipv6: fix a typo in fib6_rule_lookup()
Yi Ren reported an issue discovered by syzkaller, and bisected
to the cited commit.
Many thanks to Yi, this trivial patch does not reflect the patient
work that has been done.
Fixes: d64a1f574a29 ("ipv6: honor RT6_LOOKUP_F_DST_NOREF in rule lookup logic")
Signed-off-by: Eric Du... |
int rose_rt_ioctl(unsigned int cmd, void __user *arg)
{
struct rose_route_struct rose_route;
struct net_device *dev;
int err;
switch (cmd) {
case SIOCADDRT:
if (copy_from_user(&rose_route, arg, sizeof(struct rose_route_struct)))
return -EFAULT;
if ((dev = rose_ax25_dev_find(rose_route.device)) == NULL)
... | 0 | [] | linux | 148ca04518070910739dfc4eeda765057856403d | 206,912,049,425,079,080,000,000,000,000,000,000,000 | 38 | net: rose: fix UAF bug caused by rose_t0timer_expiry
There are UAF bugs caused by rose_t0timer_expiry(). The
root cause is that del_timer() could not stop the timer
handler that is running and there is no synchronization.
One of the race conditions is shown below:
(thread 1) | (thread 2)
... |
static int generate_cached_repolist(const char *path, const char *cached_rc)
{
struct strbuf locked_rc = STRBUF_INIT;
int result = 0;
int idx;
FILE *f;
strbuf_addf(&locked_rc, "%s.lock", cached_rc);
f = fopen(locked_rc.buf, "wx");
if (!f) {
/* Inform about the error unless the lockfile already existed,
* s... | 0 | [] | cgit | 1c581a072651524f3b0d91f33e22a42c4166dd96 | 27,919,292,025,001,150,000,000,000,000,000,000,000 | 33 | ui-blob: Do not accept mimetype from user |
bool LibarchivePlugin::list()
{
qCDebug(ARK) << "Listing archive contents";
if (!initializeReader()) {
return false;
}
qCDebug(ARK) << "Detected compression filter:" << archive_filter_name(m_archiveReader.data(), 0);
QString compMethod = convertCompressionName(QString::fromUtf8(archive_fil... | 0 | [
"CWE-59",
"CWE-61"
] | ark | 8bf8c5ef07b0ac5e914d752681e470dea403a5bd | 194,721,500,001,481,650,000,000,000,000,000,000,000 | 64 | Pass the ARCHIVE_EXTRACT_SECURE_SYMLINKS flag to libarchive
There are archive types which allow to first create a symlink and then
later on dereference it. If the symlink points outside of the archive,
this results in writing outside of the destination directory.
With the ARCHIVE_EXTRACT_SECURE_SYMLINKS option set, l... |
bool CModule::AddTimer(CTimer* pTimer) {
if ((!pTimer) ||
(!pTimer->GetName().empty() && FindTimer(pTimer->GetName()))) {
delete pTimer;
return false;
}
if (!m_sTimers.insert(pTimer).second)
// Was already added
return true;
m_pManager->AddCron(pTimer);
retu... | 0 | [
"CWE-20",
"CWE-264"
] | znc | 8de9e376ce531fe7f3c8b0aa4876d15b479b7311 | 247,632,175,835,143,200,000,000,000,000,000,000,000 | 14 | Fix remote code execution and privilege escalation vulnerability.
To trigger this, need to have a user already.
Thanks for Jeriko One <jeriko.one@gmx.us> for finding and reporting this.
CVE-2019-12816 |
void ssl_set_bio( ssl_context *ssl,
int (*f_recv)(void *, unsigned char *, size_t), void *p_recv,
int (*f_send)(void *, const unsigned char *, size_t), void *p_send )
{
ssl->f_recv = f_recv;
ssl->f_send = f_send;
ssl->p_recv = p_recv;
ssl->p_send = p_send;
} | 0 | [
"CWE-310"
] | polarssl | 4582999be608c9794d4518ae336b265084db9f93 | 293,051,099,369,418,700,000,000,000,000,000,000,000 | 9 | Fixed timing difference resulting from badly formatted padding. |
GF_Err vvcc_box_size(GF_Box *s)
{
u32 i, count, j, subcount;
GF_VVCConfigurationBox *ptr = (GF_VVCConfigurationBox *)s;
if (!ptr->config) {
ptr->size = 0;
return GF_OK;
}
ptr->size += 1;
if (ptr->config->ptl_present) {
ptr->size += 3;
//size PTL
if (!ptr->config->general_constraint_info)
ptr->confi... | 0 | [
"CWE-617",
"CWE-703"
] | gpac | 9ea93a2ec8f555ceed1ee27294cf94822f14f10f | 60,742,674,506,143,570,000,000,000,000,000,000,000 | 47 | fixed #2165 |
static void scrub_wr_bio_end_io(struct bio *bio)
{
struct scrub_bio *sbio = bio->bi_private;
struct btrfs_fs_info *fs_info = sbio->dev->fs_info;
sbio->status = bio->bi_status;
sbio->bio = bio;
btrfs_init_work(&sbio->work, btrfs_scrubwrc_helper,
scrub_wr_bio_end_io_worker, NULL, NULL);
btrfs_queue_work(fs_in... | 0 | [
"CWE-476",
"CWE-284"
] | linux | 09ba3bc9dd150457c506e4661380a6183af651c1 | 263,443,030,945,956,920,000,000,000,000,000,000,000 | 12 | btrfs: merge btrfs_find_device and find_device
Both btrfs_find_device() and find_device() does the same thing except
that the latter does not take the seed device onto account in the device
scanning context. We can merge them.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.c... |
Field *make_field(TABLE_SHARE *share, MEM_ROOT *mem_root,
uchar *ptr, uchar *null_pos, uchar null_bit,
const LEX_CSTRING *field_name_arg) const
{
return ::make_field(share, mem_root, ptr,
(uint32)length, null_pos, null_bit,
... | 0 | [
"CWE-416",
"CWE-703"
] | server | 08c7ab404f69d9c4ca6ca7a9cf7eec74c804f917 | 222,148,315,976,860,800,000,000,000,000,000,000,000 | 10 | MDEV-24176 Server crashes after insert in the table with virtual
column generated using date_format() and if()
vcol_info->expr is allocated on expr_arena at parsing stage. Since
expr item is allocated on expr_arena all its containee items must be
allocated on expr_arena too. Otherwise fix_session_expr() will
encounter... |
static int set_is_seen(struct ctl_table_set *set)
{
return ¤t_user_ns()->set == set;
} | 0 | [
"CWE-416",
"CWE-362"
] | linux | 040757f738e13caaa9c5078bca79aa97e11dde88 | 240,758,686,933,947,420,000,000,000,000,000,000,000 | 4 | ucount: Remove the atomicity from ucount->count
Always increment/decrement ucount->count under the ucounts_lock. The
increments are there already and moving the decrements there means the
locking logic of the code is simpler. This simplification in the
locking logic fixes a race between put_ucounts and get_ucounts t... |
char *Sys_GetClipboardData( void )
{
char *data = NULL;
char *cliptext;
if ( OpenClipboard( NULL ) != 0 ) {
HANDLE hClipboardData;
if ( ( hClipboardData = GetClipboardData( CF_TEXT ) ) != 0 ) {
if ( ( cliptext = GlobalLock( hClipboardData ) ) != 0 ) {
data = Z_Malloc( GlobalSize( hClipboardData ) + 1 );... | 0 | [
"CWE-59"
] | ioq3 | b5acc31a4da72cc3a4a6d88facb15b6214d745c6 | 287,003,193,337,251,200,000,000,000,000,000,000,000 | 21 | CVE-2012-3345 |
string stringerror()
{
return strerror(errno);
} | 0 | [
"CWE-399"
] | pdns | 881b5b03a590198d03008e4200dd00cc537712f3 | 280,268,231,980,222,570,000,000,000,000,000,000,000 | 4 | Reject qname's wirelength > 255, `chopOff()` handle dot inside labels |
trap_to_sighandler (sig)
int sig;
{
if (sigmodes[sig] & (SIG_IGNORED|SIG_HARD_IGNORE))
return (SIG_IGN);
else if (sigmodes[sig] & SIG_TRAPPED)
return (trap_handler);
else
return (SIG_DFL);
} | 0 | [] | bash | 955543877583837c85470f7fb8a97b7aa8d45e6c | 185,985,199,532,232,840,000,000,000,000,000,000,000 | 10 | bash-4.4-rc2 release |
rl_reset_after_signal ()
{
if (rl_prep_term_function)
(*rl_prep_term_function) (_rl_meta_flag);
rl_set_signals ();
} | 0 | [] | bash | 955543877583837c85470f7fb8a97b7aa8d45e6c | 279,230,460,548,641,930,000,000,000,000,000,000,000 | 6 | bash-4.4-rc2 release |
CImg<T>& distance(const T& value, const CImg<t>& metric_mask) {
if (is_empty()) return *this;
bool is_value = false;
cimg_for(*this,ptr,T) *ptr = *ptr==value?is_value=true,0:(T)999999999;
if (!is_value) return fill(cimg::type<T>::max());
const ulongT wh = (ulongT)_width*_height;
... | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 234,760,750,290,024,900,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. |
SSL_CIPHER *ssl3_choose_cipher(SSL *s, STACK_OF(SSL_CIPHER) *clnt,
STACK_OF(SSL_CIPHER) *srvr)
{
SSL_CIPHER *c,*ret=NULL;
STACK_OF(SSL_CIPHER) *prio, *allow;
int i,ii,ok;
#if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_EC)
unsigned int j;
int ec_ok, ec_nid;
unsigned char ec_search1 = 0, ec_search2 =... | 0 | [
"CWE-310"
] | openssl | ca989269a2876bae79393bd54c3e72d49975fc75 | 10,894,775,339,008,966,000,000,000,000,000,000,000 | 280 | Use version in SSL_METHOD not SSL structure.
When deciding whether to use TLS 1.2 PRF and record hash algorithms
use the version number in the corresponding SSL_METHOD structure
instead of the SSL structure. The SSL structure version is sometimes
inaccurate. Note: OpenSSL 1.0.2 and later effectively do this already.
(... |
static int fts3BestIndexMethod(sqlite3_vtab *pVTab, sqlite3_index_info *pInfo){
Fts3Table *p = (Fts3Table *)pVTab;
int i; /* Iterator variable */
int iCons = -1; /* Index of constraint to use */
int iLangidCons = -1; /* Index of langid=x constraint, if present... | 0 | [
"CWE-787"
] | sqlite | c72f2fb7feff582444b8ffdc6c900c69847ce8a9 | 332,767,026,361,013,880,000,000,000,000,000,000,000 | 121 | More improvements to shadow table corruption detection in FTS3.
FossilOrigin-Name: 51525f9c3235967bc00a090e84c70a6400698c897aa4742e817121c725b8c99d |
char* xvasprintf(const char *format, va_list p)
{
int r;
char *string_ptr;
#if 1
// GNU extension
r = vasprintf(&string_ptr, format, p);
#else
// Bloat for systems that haven't got the GNU extension.
va_list p2;
va_copy(p2, p);
r = vsnprintf(NULL, 0, format, p);
string_ptr = xmalloc... | 0 | [
"CWE-20"
] | libreport | 1951e7282043dfe1268d492aea056b554baedb75 | 131,568,424,600,334,030,000,000,000,000,000,000,000 | 22 | lib: fix races in dump directory handling code
Florian Weimer <fweimer@redhat.com>:
dd_opendir() should keep a file handle (opened with O_DIRECTORY) and
use openat() and similar functions to access files in it.
...
The file system manipulation functions should guard against hard
links (check tha... |
xmlSaveFlush(xmlSaveCtxtPtr ctxt)
{
if (ctxt == NULL) return(-1);
if (ctxt->buf == NULL) return(-1);
return(xmlOutputBufferFlush(ctxt->buf));
} | 0 | [
"CWE-502"
] | libxml2 | c97750d11bb8b6f3303e7131fe526a61ac65bcfd | 116,964,367,272,106,310,000,000,000,000,000,000,000 | 6 | Avoid an out of bound access when serializing malformed strings
For https://bugzilla.gnome.org/show_bug.cgi?id=766414
* xmlsave.c: xmlBufAttrSerializeTxtContent() if an attribute value
is not UTF-8 be more careful when serializing it as we may do an
out of bound access as a result. |
piv_process_history(sc_card_t *card)
{
piv_private_data_t * priv = PIV_DATA(card);
int r;
int i, tmplen, tmplen2, tmplen3;
int enumtag;
u8 * rbuf = NULL;
size_t rbuflen = 0;
const u8 * body;
size_t bodylen;
const u8 * num;
size_t numlen;
const u8 * url = NULL;
size_t urllen;
u8 * ocfhfbuf = NULL;
unsigned... | 0 | [] | OpenSC | 456ac566938a1da774db06126a2fa6c0cba514b3 | 109,868,222,400,034,210,000,000,000,000,000,000,000 | 228 | PIV Improved parsing of data from the card
Based on Fuzz testing, many of the calls to sc_asn1_find_tag were replaced
with sc_asn1_read_tag. The input is also tested that the
expected tag is the first byte. Additional tests are also add.
sc_asn1_find_tag will skip 0X00 or 0Xff if found. NIST sp800-73-x specs
do not ... |
static void mac80211_hwsim_add_vendor_rtap(struct sk_buff *skb)
{
/*
* To enable this code, #define the HWSIM_RADIOTAP_OUI,
* e.g. like this:
* #define HWSIM_RADIOTAP_OUI "\x02\x00\x00"
* (but you should use a valid OUI, not that)
*
* If anyone wants to 'donate' a radiotap OUI/subns code
* please send a ... | 0 | [
"CWE-703",
"CWE-772"
] | linux | 0ddcff49b672239dda94d70d0fcf50317a9f4b51 | 284,519,276,079,233,440,000,000,000,000,000,000,000 | 46 | mac80211_hwsim: fix possible memory leak in hwsim_new_radio_nl()
'hwname' is malloced in hwsim_new_radio_nl() and should be freed
before leaving from the error handling cases, otherwise it will cause
memory leak.
Fixes: ff4dd73dd2b4 ("mac80211_hwsim: check HWSIM_ATTR_RADIO_NAME length")
Signed-off-by: Wei Yongjun <we... |
remove_master(ClientPtr client, xXIRemoveMasterInfo * r, int flags[MAXDEVICES])
{
DeviceIntPtr ptr, keybd, XTestptr, XTestkeybd;
int rc = Success;
if (r->return_mode != XIAttachToMaster && r->return_mode != XIFloating)
return BadValue;
rc = dixLookupDevice(&ptr, r->deviceid, client, DixDestroy... | 0 | [
"CWE-191"
] | xserver | c940cc8b6c0a2983c1ec974f1b3f019795dd4cff | 25,344,955,155,027,810,000,000,000,000,000,000,000 | 112 | Fix XIChangeHierarchy() integer underflow
CVE-2020-14346 / ZDI-CAN-11429
This vulnerability was discovered by:
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative
Signed-off-by: Matthieu Herrb <matthieu@herrb.eu> |
ecb_ews_do_method_request_publish_reply (ECalBackendEws *cbews,
icalcomponent *vcalendar,
ECalComponent *comp,
icalcomponent *subcomp,
const gchar *response_type,
const gchar *user_email,
gboolean rsvp_requested,
GCancellable *cancellable,
GError **error)
{
GError *local... | 0 | [
"CWE-295"
] | evolution-ews | 915226eca9454b8b3e5adb6f2fff9698451778de | 251,379,900,901,899,580,000,000,000,000,000,000,000 | 168 | I#27 - SSL Certificates are not validated
This depends on https://gitlab.gnome.org/GNOME/evolution-data-server/commit/6672b8236139bd6ef41ecb915f4c72e2a052dba5 too.
Closes https://gitlab.gnome.org/GNOME/evolution-ews/issues/27 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.