func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
static void snd_msndmidi_free(struct snd_rawmidi *rmidi)
{
struct snd_msndmidi *mpu = rmidi->private_data;
kfree(mpu);
} | 0 | [
"CWE-125",
"CWE-401"
] | linux | 20e2b791796bd68816fa115f12be5320de2b8021 | 286,100,333,107,821,470,000,000,000,000,000,000,000 | 5 | ALSA: msnd: Optimize / harden DSP and MIDI loops
The ISA msnd drivers have loops fetching the ring-buffer head, tail
and size values inside the loops. Such codes are inefficient and
fragile.
This patch optimizes it, and also adds the sanity check to avoid the
endless loops.
Bugzilla: https://bugzilla.kernel.org/sho... |
void *Virtual_tmp_table::operator new(size_t size, THD *thd) throw()
{
return (Virtual_tmp_table *) alloc_root(thd->mem_root, size);
} | 0 | [] | server | ff77a09bda884fe6bf3917eb29b9d3a2f53f919b | 232,889,591,908,010,520,000,000,000,000,000,000,000 | 4 | MDEV-22464 Server crash on UPDATE with nested subquery
Uninitialized ref_pointer_array[] because setup_fields() got empty
fields list. mysql_multi_update() for some reason does that by
substituting the fields list with empty total_list for the
mysql_select() call (looks like wrong merge since total_list is not
used a... |
int tls1_ec_curve_id2nid(int curve_id)
{
/* ECC curves from draft-ietf-tls-ecc-12.txt (Oct. 17, 2005) */
if ((curve_id < 1) || ((unsigned int)curve_id >
sizeof(nid_list)/sizeof(nid_list[0])))
return 0;
return nid_list[curve_id-1].nid;
} | 0 | [] | openssl | 80bd7b41b30af6ee96f519e629463583318de3b0 | 7,826,350,341,254,500,000,000,000,000,000,000,000 | 8 | Fix SRP ciphersuite DoS vulnerability.
If a client attempted to use an SRP ciphersuite and it had not been
set up correctly it would crash with a null pointer read. A malicious
server could exploit this in a DoS attack.
Thanks to Joonas Kuorilehto and Riku Hietamäki from Codenomicon
for reporting this issue.
CVE-201... |
ews_delete_type_to_str (EwsDeleteType delete_type)
{
switch (delete_type) {
case EWS_HARD_DELETE:
return "HardDelete";
case EWS_SOFT_DELETE:
return "SoftDelete";
case EWS_MOVE_TO_DELETED_ITEMS:
return "MoveToDeletedItems";
}
return NULL;
} | 0 | [
"CWE-295"
] | evolution-ews | 915226eca9454b8b3e5adb6f2fff9698451778de | 167,904,846,957,650,380,000,000,000,000,000,000,000 | 12 | 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 |
static CURLcode ossl_connect_step2(struct Curl_easy *data,
struct connectdata *conn, int sockindex)
{
int err;
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
struct ssl_backend_data *backend = connssl->backend;
DEBUGASSERT(ssl_connect_2 == connssl->connecting_state
... | 0 | [
"CWE-290"
] | curl | b09c8ee15771c614c4bf3ddac893cdb12187c844 | 323,317,023,059,594,600,000,000,000,000,000,000,000 | 156 | vtls: add 'isproxy' argument to Curl_ssl_get/addsessionid()
To make sure we set and extract the correct session.
Reported-by: Mingtao Yang
Bug: https://curl.se/docs/CVE-2021-22890.html
CVE-2021-22890 |
static void dvb_frontend_get_frequency_limits(struct dvb_frontend *fe,
u32 *freq_min, u32 *freq_max)
{
*freq_min = max(fe->ops.info.frequency_min, fe->ops.tuner_ops.info.frequency_min);
if (fe->ops.info.frequency_max == 0)
*freq_max = fe->ops.tuner_ops.info.frequency_max;
else if (fe->ops.tuner_ops.info.freq... | 0 | [
"CWE-416"
] | linux | b1cb7372fa822af6c06c8045963571d13ad6348b | 297,477,499,185,027,850,000,000,000,000,000,000,000 | 16 | dvb_frontend: don't use-after-free the frontend struct
dvb_frontend_invoke_release() may free the frontend struct.
So, the free logic can't update it anymore after calling it.
That's OK, as __dvb_frontend_free() is called only when the
krefs are zeroed, so nobody is using it anymore.
That should fix the following KA... |
int copy_page_range(struct mm_struct *dst_mm, struct mm_struct *src_mm,
struct vm_area_struct *vma)
{
pgd_t *src_pgd, *dst_pgd;
unsigned long next;
unsigned long addr = vma->vm_start;
unsigned long end = vma->vm_end;
/*
* Don't copy ptes where a page fault will fill them correctly.
* Fork becomes much light... | 0 | [
"CWE-20"
] | linux-2.6 | 89f5b7da2a6bad2e84670422ab8192382a5aeb9f | 108,881,401,337,051,750,000,000,000,000,000,000,000 | 34 | Reinstate ZERO_PAGE optimization in 'get_user_pages()' and fix XIP
KAMEZAWA Hiroyuki and Oleg Nesterov point out that since the commit
557ed1fa2620dc119adb86b34c614e152a629a80 ("remove ZERO_PAGE") removed
the ZERO_PAGE from the VM mappings, any users of get_user_pages() will
generally now populate the VM with real emp... |
GF_Err fiel_box_write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
GF_FieldInfoBox *ptr = (GF_FieldInfoBox *)s;
e = gf_isom_box_write_header(s, bs);
if (e) return e;
gf_bs_write_u8(bs, ptr->field_count);
gf_bs_write_u8(bs, ptr->field_order);
return GF_OK;
} | 0 | [
"CWE-476"
] | gpac | 6170024568f4dda310e98ef7508477b425c58d09 | 278,509,594,242,048,800,000,000,000,000,000,000,000 | 10 | fixed potential crash - cf #1263 |
char *d_path(const struct path *path, char *buf, int buflen)
{
char *res = buf + buflen;
struct path root;
int error;
/*
* We have various synthetic filesystems that never get mounted. On
* these filesystems dentries are never used for lookup purposes, and
* thus don't need to be hashed. They also don't ne... | 0 | [
"CWE-362",
"CWE-399"
] | linux | 49d31c2f389acfe83417083e1208422b4091cd9e | 97,646,878,779,109,780,000,000,000,000,000,000,000 | 30 | dentry name snapshots
take_dentry_name_snapshot() takes a safe snapshot of dentry name;
if the name is a short one, it gets copied into caller-supplied
structure, otherwise an extra reference to external name is grabbed
(those are never modified). In either case the pointer to stable
string is stored into the same st... |
CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
const char *tree, struct cifsTconInfo *tcon,
const struct nls_table *nls_codepage)
{
struct smb_hdr *smb_buffer;
struct smb_hdr *smb_buffer_response;
TCONX_REQ *pSMB;
TCONX_RSP *pSMBr;
unsigned char *bcc_ptr;
int rc = 0;
int length;
__u16 bytes_left, count... | 0 | [
"CWE-20"
] | linux | 70945643722ffeac779d2529a348f99567fa5c33 | 216,336,343,629,074,700,000,000,000,000,000,000,000 | 154 | cifs: always do is_path_accessible check in cifs_mount
Currently, we skip doing the is_path_accessible check in cifs_mount if
there is no prefixpath. I have a report of at least one server however
that allows a TREE_CONNECT to a share that has a DFS referral at its
root. The reporter in this case was using a UNC that ... |
void MYSQL_BIN_LOG::set_max_size(ulong max_size_arg)
{
/*
We need to take locks, otherwise this may happen:
new_file() is called, calls open(old_max_size), then before open() starts,
set_max_size() sets max_size to max_size_arg, then open() starts and
uses the old_max_size argument, so max_size_arg ha... | 0 | [
"CWE-264"
] | mysql-server | 48bd8b16fe382be302c6f0b45931be5aa6f29a0e | 309,723,113,461,544,500,000,000,000,000,000,000,000 | 16 | Bug#24388753: PRIVILEGE ESCALATION USING MYSQLD_SAFE
[This is the 5.5/5.6 version of the bugfix].
The problem was that it was possible to write log files ending
in .ini/.cnf that later could be parsed as an options file.
This made it possible for users to specify startup options
without the permissions to do so.
Thi... |
GF_Err rvcc_box_write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
GF_RVCConfigurationBox *ptr = (GF_RVCConfigurationBox*) s;
e = gf_isom_box_write_header(s, bs);
if (e) return e;
gf_bs_write_u16(bs, ptr->predefined_rvc_config);
if (!ptr->predefined_rvc_config) {
gf_bs_write_u16(bs, ptr->rvc_meta_idx);
}
return... | 0 | [
"CWE-787"
] | gpac | 77510778516803b7f7402d7423c6d6bef50254c3 | 191,123,464,362,609,550,000,000,000,000,000,000,000 | 14 | fixed #2255 |
static int mptsas_post_load(void *opaque, int version_id)
{
MPTSASState *s = opaque;
if (s->doorbell_idx > s->doorbell_cnt ||
s->doorbell_cnt > ARRAY_SIZE(s->doorbell_msg) ||
s->doorbell_reply_idx > s->doorbell_reply_size ||
s->doorbell_reply_size > ARRAY_SIZE(s->doorbell_reply) ||
... | 0 | [
"CWE-416"
] | qemu | 3791642c8d60029adf9b00bcb4e34d7d8a1aea4d | 118,018,165,437,364,870,000,000,000,000,000,000,000 | 17 | mptsas: Remove unused MPTSASState 'pending' field (CVE-2021-3392)
While processing SCSI i/o requests in mptsas_process_scsi_io_request(),
the Megaraid emulator appends new MPTSASRequest object 'req' to
the 's->pending' queue. In case of an error, this same object gets
dequeued in mptsas_free_request() only if SCSIRequ... |
static int intAddEntry(Header h, rpmtd td)
{
indexEntry entry;
rpm_data_t data;
int length = 0;
/* Count must always be >= 1 for headerAddEntry. */
if (td->count <= 0)
return 0;
if (hdrchkType(td->type))
return 0;
if (hdrchkData(td->count))
return 0;
data = grabData(td->type, td->d... | 0 | [
"CWE-125"
] | rpm | 8f4b3c3cab8922a2022b9e47c71f1ecf906077ef | 266,924,498,674,138,480,000,000,000,000,000,000,000 | 40 | hdrblobInit() needs bounds checks too
Users can pass untrusted data to hdrblobInit() and it must be robust
against this. |
lvs_notify_fifo(vector_t *strvec)
{
notify_fifo(strvec, "lvs_", &global_data->lvs_notify_fifo);
} | 0 | [
"CWE-200"
] | keepalived | c6247a9ef2c7b33244ab1d3aa5d629ec49f0a067 | 162,062,989,982,617,800,000,000,000,000,000,000,000 | 4 | Add command line and configuration option to set umask
Issue #1048 identified that files created by keepalived are created
with mode 0666. This commit changes the default to 0644, and also
allows the umask to be specified in the configuration or as a command
line option.
Signed-off-by: Quentin Armitage <quentin@armit... |
GF_Err moov_Read(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
e = gf_isom_box_array_read(s, bs, moov_AddBox);
if (e) {
return e;
}
else {
if (!((GF_MovieBox *)s)->mvhd) {
GF_LOG(GF_LOG_ERROR, GF_LOG_CONTAINER, ("[iso file] Missing MovieHeaderBox\n"));
return GF_ISOM_INVALID_FILE;
}
}
return e;
} | 0 | [
"CWE-400",
"CWE-401"
] | gpac | d2371b4b204f0a3c0af51ad4e9b491144dd1225c | 273,419,362,590,518,230,000,000,000,000,000,000,000 | 15 | prevent dref memleak on invalid input (#1183) |
static Expr *sqlite3WindowOffsetExpr(Parse *pParse, Expr *pExpr){
if( 0==sqlite3ExprIsConstant(pExpr) ){
if( IN_RENAME_OBJECT ) sqlite3RenameExprUnmap(pParse, pExpr);
sqlite3ExprDelete(pParse->db, pExpr);
pExpr = sqlite3ExprAlloc(pParse->db, TK_NULL, 0, 0);
}
return pExpr;
} | 0 | [
"CWE-476"
] | sqlite | 75e95e1fcd52d3ec8282edb75ac8cd0814095d54 | 297,618,267,927,400,100,000,000,000,000,000,000,000 | 8 | When processing constant integer values in ORDER BY clauses of window
definitions (see check-in [7e4809eadfe99ebf]) be sure to fully disable
the constant value to avoid an invalid pointer dereference if the expression
is ever duplicated. This fixes a crash report from Yongheng and Rui.
FossilOrigin-Name: 1ca0bd982ab11... |
CImg<T>& pseudoinvert(const bool use_LU=false) {
return get_pseudoinvert(use_LU).move_to(*this);
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 255,688,013,751,447,660,000,000,000,000,000,000,000 | 3 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
static int r_cmd_java_print_import_definitions ( RBinJavaObj *obj ) {
RList * the_list = r_bin_java_get_import_definitions (obj);
char * str = NULL;
RListIter *iter;
r_list_foreach (the_list, iter, str) {
r_cons_printf("import %s;\n", str);
}
r_list_free (the_list);
return true;
} | 0 | [
"CWE-703",
"CWE-193"
] | radare2 | ced0223c7a1b3b5344af315715cd28fe7c0d9ebc | 76,072,876,502,320,370,000,000,000,000,000,000,000 | 10 | Fix unmatched array length in core_java.c (issue #16304) (#16313) |
static int set_next_request(void)
{
current_req = list_first_entry_or_null(&floppy_reqs, struct request,
queuelist);
if (current_req) {
floppy_errors = 0;
list_del_init(¤t_req->queuelist);
return 1;
}
return 0;
} | 0 | [
"CWE-416"
] | linux | f71f01394f742fc4558b3f9f4c7ef4c4cf3b07c8 | 211,983,467,718,790,700,000,000,000,000,000,000,000 | 11 | floppy: use a statically allocated error counter
Interrupt handler bad_flp_intr() may cause a UAF on the recently freed
request just to increment the error count. There's no point keeping
that one in the request anyway, and since the interrupt handler uses a
static pointer to the error which cannot be kept in sync wi... |
static void flush_all_backlogs(void)
{
unsigned int cpu;
get_online_cpus();
for_each_online_cpu(cpu)
queue_work_on(cpu, system_highpri_wq,
per_cpu_ptr(&flush_works, cpu));
for_each_online_cpu(cpu)
flush_work(per_cpu_ptr(&flush_works, cpu));
put_online_cpus(); | 0 | [
"CWE-476"
] | linux | 0ad646c81b2182f7fa67ec0c8c825e0ee165696d | 20,889,396,293,837,446,000,000,000,000,000,000,000 | 15 | tun: call dev_get_valid_name() before register_netdevice()
register_netdevice() could fail early when we have an invalid
dev name, in which case ->ndo_uninit() is not called. For tun
device, this is a problem because a timer etc. are already
initialized and it expects ->ndo_uninit() to clean them up.
We could move th... |
u32 gf_m4v_parser_get_obj_type(GF_M4VParser *m4v)
{
if (m4v) return m4v->current_object_type;
return 0;
} | 0 | [
"CWE-190",
"CWE-787"
] | gpac | 51cdb67ff7c5f1242ac58c5aa603ceaf1793b788 | 77,464,264,708,097,700,000,000,000,000,000,000,000 | 5 | add safety in avc/hevc/vvc sps/pps/vps ID check - cf #1720 #1721 #1722 |
static int dns_stream_update_io(DnsStream *s) {
int f = 0;
assert(s);
if (s->write_packet && s->n_written < sizeof(s->write_size) + s->write_packet->size)
f |= EPOLLOUT;
else if (!ordered_set_isempty(s->write_queue)) {
dns_packet_unref(s->write_packet);
... | 0 | [
"CWE-416",
"CWE-703"
] | systemd | d973d94dec349fb676fdd844f6fe2ada3538f27c | 66,641,291,604,355,480,000,000,000,000,000,000,000 | 25 | resolved: pin stream while calling callbacks for it
These callbacks might unref the stream, but we still have to access it,
let's hence ref it explicitly.
Maybe fixes: #10725 |
ns_client_aclmsg(const char *msg, const dns_name_t *name, dns_rdatatype_t type,
dns_rdataclass_t rdclass, char *buf, size_t len) {
char namebuf[DNS_NAME_FORMATSIZE];
char typebuf[DNS_RDATATYPE_FORMATSIZE];
char classbuf[DNS_RDATACLASS_FORMATSIZE];
dns_name_format(name, namebuf, sizeof(namebuf));
dns_rdatatype_... | 0 | [
"CWE-617"
] | bind9 | 15996f0cb15631b95a801e3e88928494a69ad6ee | 157,506,244,992,937,580,000,000,000,000,000,000,000 | 12 | ns_client_error() could assert if rcode was overridden to NOERROR
The client->rcode_override was originally created to force the server
to send SERVFAIL in some cases when it would normally have sent FORMERR.
More recently, it was used in a3ba95116ed04594ea59a8124bf781b30367a7a2
commit (part of GL #2790) to force the... |
static int _proc_do_string(void* data, int maxlen, int write,
void __user *buffer,
size_t *lenp, loff_t *ppos)
{
size_t len;
char __user *p;
char c;
if (!data || !maxlen || !*lenp) {
*lenp = 0;
return 0;
}
if (write) {
len = 0;
p = buffer;
while (len < *lenp) {
if (get_user(c, p++))
... | 0 | [
"CWE-284",
"CWE-264"
] | linux | bfdc0b497faa82a0ba2f9dddcf109231dd519fcc | 277,779,043,525,983,670,000,000,000,000,000,000,000 | 57 | sysctl: restrict write access to dmesg_restrict
When dmesg_restrict is set to 1 CAP_SYS_ADMIN is needed to read the kernel
ring buffer. But a root user without CAP_SYS_ADMIN is able to reset
dmesg_restrict to 0.
This is an issue when e.g. LXC (Linux Containers) are used and complete
user space is running without CA... |
void * gdImageGifPtr (gdImagePtr im, int *size)
{
void *rv;
gdIOCtx *out = gdNewDynamicCtx (2048, NULL);
if (!_gdImageGifCtx(im, out)) {
rv = gdDPExtractData(out, size);
} else {
rv = NULL;
}
out->gd_free (out);
return rv;
} | 0 | [
"CWE-415"
] | php-src | 089f7c0bc28d399b0420aa6ef058e4c1c120b2ae | 271,402,365,854,142,630,000,000,000,000,000,000,000 | 12 | Sync with upstream
Even though libgd/libgd#492 is not a relevant bug fix for PHP, since
the binding doesn't use the `gdImage*Ptr()` functions at all, we're
porting the fix to stay in sync here. |
bool ZstdDecompressorImpl::isError(size_t result) {
switch (ZSTD_getErrorCode(result)) {
case ZSTD_error_no_error:
return false;
case ZSTD_error_memory_allocation:
stats_.zstd_memory_error_.inc();
break;
case ZSTD_error_dictionary_corrupted:
case ZSTD_error_dictionary_wrong:
stats_.zstd_dictio... | 0 | [] | envoy | cb4ef0b09200c720dfdb07e097092dd105450343 | 112,410,785,308,378,700,000,000,000,000,000,000,000 | 20 | decompressors: stop decompressing upon excessive compression ratio (#733)
Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@intel.com>
Co-authored-by: Ryan Hamilton <rch@google.com>
Signed-off-by: Matt Klein <mklein@lyft.com>
Signed-off-by: Pradeep Rao <pcrao@google.com> |
static int hrtimer_reprogram(struct hrtimer *timer,
struct hrtimer_clock_base *base)
{
ktime_t *expires_next = &__get_cpu_var(hrtimer_bases).expires_next;
ktime_t expires = ktime_sub(timer->expires, base->offset);
int res;
/*
* When the callback is running, we do not reprogram the clock event
* device.... | 0 | [
"CWE-189"
] | linux-2.6 | 13788ccc41ceea5893f9c747c59bc0b28f2416c2 | 250,805,017,584,215,570,000,000,000,000,000,000,000 | 28 | [PATCH] hrtimer: prevent overrun DoS in hrtimer_forward()
hrtimer_forward() does not check for the possible overflow of
timer->expires. This can happen on 64 bit machines with large interval
values and results currently in an endless loop in the softirq because the
expiry value becomes negative and therefor the timer... |
static int ip6_pkt_prohibit_out(struct sock *sk, struct sk_buff *skb)
{
skb->dev = skb_dst(skb)->dev;
return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_OUTNOROUTES);
} | 0 | [
"CWE-17"
] | linux-stable | 9d289715eb5c252ae15bd547cb252ca547a3c4f2 | 15,045,242,029,885,373,000,000,000,000,000,000,000 | 5 | ipv6: stop sending PTB packets for MTU < 1280
Reduce the attack vector and stop generating IPv6 Fragment Header for
paths with an MTU smaller than the minimum required IPv6 MTU
size (1280 byte) - called atomic fragments.
See IETF I-D "Deprecating the Generation of IPv6 Atomic Fragments" [1]
for more information and h... |
static int traverseLclosure (global_State *g, LClosure *cl) {
int i;
markobjectN(g, cl->p); /* mark its prototype */
for (i = 0; i < cl->nupvalues; i++) { /* visit its upvalues */
UpVal *uv = cl->upvals[i];
markobjectN(g, uv); /* mark upvalue */
}
return 1 + cl->nupvalues;
} | 0 | [
"CWE-125"
] | lua | 127e7a6c8942b362aa3c6627f44d660a4fb75312 | 27,680,919,319,176,727,000,000,000,000,000,000,000 | 9 | Fixed bug of old finalized objects in the GC
When an object aged OLD1 is finalized, it is moved from the list
'finobj' to the *beginning* of the list 'allgc'. So, this part of the
list (and not only the survival list) must be visited by 'markold'. |
pixHtmlViewer(const char *dirin,
const char *dirout,
const char *rootname,
l_int32 thumbwidth,
l_int32 viewwidth)
{
char *fname, *fullname, *outname;
char *mainname, *linkname, *linknameshort;
char *viewfile, *thumbfile;
char *shtm... | 1 | [
"CWE-119",
"CWE-787"
] | leptonica | c1079bb8e77cdd426759e466729917ca37a3ed9f | 172,924,717,160,575,000,000,000,000,000,000,000,000 | 148 | prog/htmlviewer: Catch unbound memory access (CID 1386222)
rootname can have any size, so limit the amount of copied bytes.
Signed-off-by: Stefan Weil <sw@weilnetz.de> |
longlong Field::convert_decimal2longlong(const my_decimal *val,
bool unsigned_flag, int *err)
{
longlong i;
if (unsigned_flag)
{
if (val->sign())
{
set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1);
i= 0;
*err= 1;
}
else if (warn_if_overflow(my_de... | 0 | [
"CWE-416",
"CWE-703"
] | server | 08c7ab404f69d9c4ca6ca7a9cf7eec74c804f917 | 291,302,689,765,342,400,000,000,000,000,000,000,000 | 31 | 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... |
g_file_delete (GFile *file,
GCancellable *cancellable,
GError **error)
{
GFileIface *iface;
g_return_val_if_fail (G_IS_FILE (file), FALSE);
if (g_cancellable_set_error_if_cancelled (cancellable, error))
return FALSE;
iface = G_FILE_GET_IFACE (file);
if (ifa... | 0 | [
"CWE-362"
] | glib | d8f8f4d637ce43f8699ba94c9b7648beda0ca174 | 122,540,212,679,580,900,000,000,000,000,000,000,000 | 23 | gfile: Limit access to files when copying
file_copy_fallback creates new files with default permissions and
set the correct permissions after the operation is finished. This
might cause that the files can be accessible by more users during
the operation than expected. Use G_FILE_CREATE_PRIVATE for the new
files to lim... |
UTI_IsZeroTimespec(struct timespec *ts)
{
return !ts->tv_sec && !ts->tv_nsec;
} | 0 | [
"CWE-59"
] | chrony | 7a4c396bba8f92a3ee8018620983529152050c74 | 110,038,427,926,711,000,000,000,000,000,000,000,000 | 4 | util: add functions for common file operations
Add a function to open a file for reading, writing, or appending.
In uppercase modes errors are handled as fatal, i.e. the caller doesn't
need to check for NULL. To avoid string manipulations in the callers,
the function accepts an optional directory and suffix. New files... |
static void usbnet_terminate_urbs(struct usbnet *dev)
{
DECLARE_WAITQUEUE(wait, current);
int temp;
/* ensure there are no more active urbs */
add_wait_queue(&dev->wait, &wait);
set_current_state(TASK_UNINTERRUPTIBLE);
temp = unlink_urbs(dev, &dev->txq) +
unlink_urbs(dev, &dev->rxq);
/* maybe wait for deleti... | 0 | [
"CWE-703"
] | linux | 1666984c8625b3db19a9abc298931d35ab7bc64b | 168,326,809,565,292,420,000,000,000,000,000,000,000 | 20 | usbnet: cleanup after bind() in probe()
In case bind() works, but a later error forces bailing
in probe() in error cases work and a timer may be scheduled.
They must be killed. This fixes an error case related to
the double free reported in
http://www.spinics.net/lists/netdev/msg367669.html
and needs to go on top of L... |
sh_backslash_quote_for_double_quotes (string)
char *string;
{
unsigned char c;
char *result, *r, *s;
result = (char *)xmalloc (2 * strlen (string) + 1);
for (r = result, s = string; s && (c = *s); s++)
{
if (sh_syntaxtab[c] & CBSDQUOTE)
*r++ = '\\';
/* I should probably add flags for the... | 0 | [] | bash | 863d31ae775d56b785dc5b0105b6d251515d81d5 | 332,264,750,211,320,700,000,000,000,000,000,000,000 | 22 | commit bash-20120224 snapshot |
CImg<T>& _load_pfm(std::FILE *const file, const char *const filename) {
if (!file && !filename)
throw CImgArgumentException(_cimg_instance
"load_pfm(): Specified filename is (null).",
cimg_instance);
std::FILE *const nfile... | 0 | [
"CWE-119",
"CWE-787"
] | CImg | ac8003393569aba51048c9d67e1491559877b1d1 | 58,865,043,654,745,160,000,000,000,000,000,000,000 | 71 | . |
static int unuse_pte(struct vm_area_struct *vma, pmd_t *pmd,
unsigned long addr, swp_entry_t entry, struct page *page)
{
struct mem_cgroup *memcg;
spinlock_t *ptl;
pte_t *pte;
int ret = 1;
if (mem_cgroup_try_charge_swapin(vma->vm_mm, page,
GFP_KERNEL, &memcg)) {
ret = -ENOMEM;
goto out_nolock;
}
pt... | 0 | [
"CWE-264"
] | linux-2.6 | 1a5a9906d4e8d1976b701f889d8f35d54b928f25 | 232,527,427,433,414,600,000,000,000,000,000,000,000 | 40 | mm: thp: fix pmd_bad() triggering in code paths holding mmap_sem read mode
In some cases it may happen that pmd_none_or_clear_bad() is called with
the mmap_sem hold in read mode. In those cases the huge page faults can
allocate hugepmds under pmd_none_or_clear_bad() and that can trigger a
false positive from pmd_bad(... |
xmlDOMWrapReconcileNamespaces(xmlDOMWrapCtxtPtr ctxt ATTRIBUTE_UNUSED,
xmlNodePtr elem,
int options)
{
int depth = -1, adoptns = 0, parnsdone = 0;
xmlNsPtr ns, prevns;
xmlDocPtr doc;
xmlNodePtr cur, curElem = NULL;
xmlNsMapPtr nsMap = NULL;
xmlNsMapItemPtr /* topmi = NULL, */ m... | 0 | [
"CWE-190"
] | libxml2 | 6c283d83eccd940bcde15634ac8c7f100e3caefd | 302,318,181,430,127,870,000,000,000,000,000,000,000 | 239 | [CVE-2022-29824] Fix integer overflows in xmlBuf and xmlBuffer
In several places, the code handling string buffers didn't check for
integer overflow or used wrong types for buffer sizes. This could
result in out-of-bounds writes or other memory errors when working on
large, multi-gigabyte buffers.
Thanks to Felix Wil... |
static void vrend_draw_bind_vertex_binding(struct vrend_context *ctx,
struct vrend_vertex_element_array *va)
{
int i;
glBindVertexArray(va->id);
if (ctx->sub->vbo_dirty) {
struct vrend_vertex_buffer *vbo = &ctx->sub->vbo[0];
if (has_feature(feat_bind_ve... | 0 | [
"CWE-787"
] | virglrenderer | 95e581fd181b213c2ed7cdc63f2abc03eaaa77ec | 153,208,416,201,202,610,000,000,000,000,000,000,000 | 52 | vrend: Add test to resource OOB write and fix it
v2: Also check that no depth != 1 has been send when none is due
Closes: #250
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com> |
**/
Tfloat cubic_atXY(const float fx, const float fy, const int z=0, const int c=0) const {
if (is_empty())
throw CImgInstanceException(_cimg_instance
"cubic_atXY(): Empty instance.",
cimg_instance);
return _cubic_atXY(f... | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 324,497,672,730,864,240,000,000,000,000,000,000,000 | 7 | Fix other issues in 'CImg<T>::load_bmp()'. |
hash_aclitem(PG_FUNCTION_ARGS)
{
AclItem *a = PG_GETARG_ACLITEM_P(0);
/* not very bright, but avoids any issue of padding in struct */
PG_RETURN_UINT32((uint32) (a->ai_privs + a->ai_grantee + a->ai_grantor));
} | 0 | [
"CWE-264"
] | postgres | fea164a72a7bfd50d77ba5fb418d357f8f2bb7d0 | 241,758,650,361,570,000,000,000,000,000,000,000,000 | 7 | Shore up ADMIN OPTION restrictions.
Granting a role without ADMIN OPTION is supposed to prevent the grantee
from adding or removing members from the granted role. Issuing SET ROLE
before the GRANT bypassed that, because the role itself had an implicit
right to add or remove members. Plug that hole by recognizing tha... |
batchNumMsgs(batch_t *pBatch) {
return pBatch->nElem;
} | 0 | [
"CWE-772",
"CWE-401"
] | rsyslog | 1ef709cc97d54f74d3fdeb83788cc4b01f4c6a2a | 326,588,098,387,061,760,000,000,000,000,000,000,000 | 3 | bugfix: fixed a memory leak and potential abort condition
this could happen if multiple rulesets were used and some output batches
contained messages belonging to more than one ruleset.
fixes: http://bugzilla.adiscon.com/show_bug.cgi?id=226
fixes: http://bugzilla.adiscon.com/show_bug.cgi?id=218 |
static int apparmor_path_unlink(struct path *dir, struct dentry *dentry)
{
return common_perm_rm(OP_UNLINK, dir, dentry, AA_MAY_DELETE);
} | 0 | [
"CWE-20"
] | linux | a5b2c5b2ad5853591a6cac6134cd0f599a720865 | 200,626,256,524,813,460,000,000,000,000,000,000,000 | 4 | AppArmor: fix oops in apparmor_setprocattr
When invalid parameters are passed to apparmor_setprocattr a NULL deref
oops occurs when it tries to record an audit message. This is because
it is passing NULL for the profile parameter for aa_audit. But aa_audit
now requires that the profile passed is not NULL.
Fix this by... |
int ath6kl_wmi_listeninterval_cmd(struct wmi *wmi, u8 if_idx,
u16 listen_interval,
u16 listen_beacons)
{
struct sk_buff *skb;
struct wmi_listen_int_cmd *cmd;
int ret;
skb = ath6kl_wmi_get_new_buf(sizeof(*cmd));
if (!skb)
return -ENOMEM;
cmd = (struct wmi_listen_int_cmd *) skb->data;
cmd->listen_i... | 0 | [
"CWE-125"
] | linux | 5d6751eaff672ea77642e74e92e6c0ac7f9709ab | 38,307,614,647,541,520,000,000,000,000,000,000,000 | 20 | 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... |
Binary::it_segments Binary::segments() {
return segments_;
} | 0 | [
"CWE-703"
] | LIEF | 7acf0bc4224081d4f425fcc8b2e361b95291d878 | 67,955,647,626,549,650,000,000,000,000,000,000,000 | 3 | Resolve #764 |
ccbaGetCcb(CCBORDA *ccba,
l_int32 index)
{
CCBORD *ccb;
PROCNAME("ccbaGetCcb");
if (!ccba)
return (CCBORD *)ERROR_PTR("ccba not defined", procName, NULL);
if (index < 0 || index >= ccba->n)
return (CCBORD *)ERROR_PTR("index out of bounds", procName, NULL);
ccb = ccba->c... | 0 | [
"CWE-125"
] | leptonica | 8d6e1755518cfb98536d6c3daf0601f226d16842 | 272,155,099,043,994,300,000,000,000,000,000,000,000 | 16 | Issue 23433 in oss-fuzz: Heap-buffer-overflow in findNextBorderPixel()
* Check pix boundary when looking for the next pixel. |
xmlBufSetAllocationScheme(xmlBufPtr buf,
xmlBufferAllocationScheme scheme) {
if ((buf == NULL) || (buf->error != 0)) {
#ifdef DEBUG_BUFFER
xmlGenericError(xmlGenericErrorContext,
"xmlBufSetAllocationScheme: buf == NULL or in error\n");
#endif
return(-1);
}
if ((bu... | 1 | [
"CWE-399"
] | libxml2 | 213f1fe0d76d30eaed6e5853057defc43e6df2c9 | 155,484,866,204,748,730,000,000,000,000,000,000,000 | 31 | CVE-2015-1819 Enforce the reader to run in constant memory
One of the operation on the reader could resolve entities
leading to the classic expansion issue. Make sure the
buffer used for xmlreader operation is bounded.
Introduce a new allocation type for the buffers for this effect. |
bool pn_ssl_present(void)
{
return true;
} | 0 | [] | qpid-proton | 4aea0fd8502f5e9af7f22fd60645eeec07bce0b2 | 25,096,560,322,797,276,000,000,000,000,000,000,000 | 4 | PROTON-2014: [c] Ensure SSL mutual authentication
(cherry picked from commit 97c7733f07712665f3d08091c82c393e4c3adbf7) |
void LIRGenerator::do_If(If* x) {
assert(x->number_of_sux() == 2, "inconsistency");
ValueTag tag = x->x()->type()->tag();
bool is_safepoint = x->is_safepoint();
If::Condition cond = x->cond();
LIRItem xitem(x->x(), this);
LIRItem yitem(x->y(), this);
LIRItem* xin = &xitem;
LIRItem* yin = &yitem;
if... | 0 | [] | jdk17u | 268c0159253b3de5d72eb826ef2329b27bb33fea | 65,771,426,829,607,730,000,000,000,000,000,000,000 | 58 | 8272014: Better array indexing
Reviewed-by: thartmann
Backport-of: 937c31d896d05aa24543b74e98a2ea9f05b5d86f |
template<typename t>
CImg<T>& distance_eikonal(const T& value, const CImg<t>& metric) {
return get_distance_eikonal(value,metric).move_to(*this); | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 182,826,629,844,262,440,000,000,000,000,000,000,000 | 3 | Fix other issues in 'CImg<T>::load_bmp()'. |
static void fdctrl_handle_version(FDCtrl *fdctrl, int direction)
{
/* Controller's version */
fdctrl->fifo[0] = fdctrl->version;
fdctrl_set_fifo(fdctrl, 1);
} | 0 | [
"CWE-119"
] | qemu | e907746266721f305d67bc0718795fedee2e824c | 83,608,697,097,367,380,000,000,000,000,000,000,000 | 6 | fdc: force the fifo access to be in bounds of the allocated buffer
During processing of certain commands such as FD_CMD_READ_ID and
FD_CMD_DRIVE_SPECIFICATION_COMMAND the fifo memory access could
get out of bounds leading to memory corruption with values coming
from the guest.
Fix this by making sure that the index i... |
invoke_NPN_PostURL(PluginInstance *plugin, const char *url, const char *target, uint32_t len, const char *buf, NPBool file)
{
npw_return_val_if_fail(rpc_method_invoke_possible(g_rpc_connection),
NPERR_GENERIC_ERROR);
int error = rpc_method_invoke(g_rpc_connection,
RPC_METHOD_NPN_POST_URL,
RP... | 0 | [
"CWE-264"
] | nspluginwrapper | 7e4ab8e1189846041f955e6c83f72bc1624e7a98 | 74,025,850,482,154,060,000,000,000,000,000,000,000 | 29 | Support all the new variables added |
static void handle_page_specs(QPDF& pdf, Options& o)
{
// Parse all page specifications and translate them into lists of
// actual pages.
// Handle "." as a shortcut for the input file
for (std::vector<PageSpec>::iterator iter = o.page_specs.begin();
iter != o.page_specs.end(); ++iter)
{
... | 1 | [
"CWE-787"
] | qpdf | d71f05ca07eb5c7cfa4d6d23e5c1f2a800f52e8e | 309,945,331,195,298,500,000,000,000,000,000,000,000 | 277 | 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 ... |
RZ_API RZ_OWN char *rz_bin_dex_resolve_field_by_idx(RZ_NONNULL RzBinDex *dex, ut32 field_idx) {
rz_return_val_if_fail(dex, NULL);
if (field_idx >= rz_pvector_len(dex->field_ids)) {
return NULL;
}
DexFieldId *field_id = (DexFieldId *)rz_pvector_at(dex->field_ids, field_idx);
char *class_name = dex_resolve_type_... | 0 | [
"CWE-787"
] | rizin | 1524f85211445e41506f98180f8f69f7bf115406 | 250,954,714,905,686,840,000,000,000,000,000,000,000 | 33 | fix #2969 - oob write (1 byte) in dex.c |
void WebContents::Unselect() {
web_contents()->CollapseSelection();
} | 0 | [] | electron | e9fa834757f41c0b9fe44a4dffe3d7d437f52d34 | 143,567,570,793,988,180,000,000,000,000,000,000,000 | 3 | fix: ensure ElectronBrowser mojo service is only bound to appropriate render frames (#33344)
* fix: ensure ElectronBrowser mojo service is only bound to authorized render frames
Notes: no-notes
* refactor: extract electron API IPC to its own mojo interface
* fix: just check main frame not primary main frame
... |
void kvm_vcpu_kick(struct kvm_vcpu *vcpu)
{
int ipi_pcpu = vcpu->cpu;
int cpu = get_cpu();
if (waitqueue_active(&vcpu->wq)) {
wake_up_interruptible(&vcpu->wq);
++vcpu->stat.halt_wakeup;
}
/*
* We may be called synchronously with irqs disabled in guest mode,
* So need not to call smp_call_function_single()... | 0 | [
"CWE-476"
] | linux-2.6 | 59839dfff5eabca01cc4e20b45797a60a80af8cb | 129,155,663,276,575,470,000,000,000,000,000,000,000 | 17 | KVM: x86: check for cr3 validity in ioctl_set_sregs
Matt T. Yourst notes that kvm_arch_vcpu_ioctl_set_sregs lacks validity
checking for the new cr3 value:
"Userspace callers of KVM_SET_SREGS can pass a bogus value of cr3 to
the kernel. This will trigger a NULL pointer access in gfn_to_rmap()
when userspace next tries... |
bool mg_log_prefix(int level, const char *file, int line, const char *fname) {
// static unsigned long seq;
int max = LL_INFO;
struct mg_str k, v, s = mg_str(s_spec);
const char *p = strrchr(file, '/');
if (s_fn == NULL) return false;
if (p == NULL) p = strrchr(file, '\\');
p = p == NULL ? file : p + 1;... | 0 | [
"CWE-552"
] | mongoose | c65c8fdaaa257e0487ab0aaae9e8f6b439335945 | 225,108,906,122,510,140,000,000,000,000,000,000,000 | 33 | Protect against the directory traversal in mg_upload() |
static char *userauth_list(LIBSSH2_SESSION *session, const char *username,
unsigned int username_len)
{
static const unsigned char reply_codes[3] =
{ SSH_MSG_USERAUTH_SUCCESS, SSH_MSG_USERAUTH_FAILURE, 0 };
/* packet_type(1) + username_len(4) + service_len(4) +
service(... | 0 | [
"CWE-787"
] | libssh2 | dc109a7f518757741590bb993c0c8412928ccec2 | 164,775,050,950,921,160,000,000,000,000,000,000,000 | 111 | Security fixes (#315)
* Bounds checks
Fixes for CVEs
https://www.libssh2.org/CVE-2019-3863.html
https://www.libssh2.org/CVE-2019-3856.html
* Packet length bounds check
CVE
https://www.libssh2.org/CVE-2019-3855.html
* Response length check
CVE
https://www.libssh2.org/CVE-2019-3859.html
* Bounds ch... |
std::shared_ptr<Grammar> perform_core(const char *s, size_t n,
const Rules &rules, std::string &start,
Log log) {
Data data;
any dt = &data;
auto r = g["Grammar"].parse(s, n, dt);
if (!r.ret) {
if (log) {
if... | 1 | [
"CWE-476"
] | cpp-peglib | 0061f393de54cf0326621c079dc2988336d1ebb3 | 316,834,522,271,309,500,000,000,000,000,000,000,000 | 152 | Fix #121 |
int get_partition_id_key_nosub(partition_info *part_info,
uint32 *part_id,
longlong *func_value)
{
*part_id= get_part_id_key(part_info->part_field_array,
part_info->num_parts, func_value);
return 0;
} | 0 | [] | mysql-server | be901b60ae59c93848c829d1b0b2cb523ab8692e | 193,698,876,431,005,270,000,000,000,000,000,000,000 | 8 | Bug#26390632: CREATE TABLE CAN CAUSE MYSQL TO EXIT.
Analysis
========
CREATE TABLE of InnoDB table with a partition name
which exceeds the path limit can cause the server
to exit.
During the preparation of the partition name,
there was no check to identify whether the complete
path name for partition exceeds the max ... |
const Config *get_config() const { return config_; } | 0 | [] | nghttp2 | 95efb3e19d174354ca50c65d5d7227d92bcd60e1 | 269,347,338,868,138,640,000,000,000,000,000,000,000 | 1 | Don't read too greedily |
static int wc_ecc_alloc_async(ecc_key* key)
{
int err = wc_ecc_alloc_mpint(key, &key->r);
if (err == 0)
err = wc_ecc_alloc_mpint(key, &key->s);
return err;
} | 0 | [
"CWE-326",
"CWE-203"
] | wolfssl | 1de07da61f0c8e9926dcbd68119f73230dae283f | 251,014,938,931,414,800,000,000,000,000,000,000,000 | 7 | Constant time EC map to affine for private operations
For fast math, use a constant time modular inverse when mapping to
affine when operation involves a private key - key gen, calc shared
secret, sign. |
static u32 gen_new_htid(struct tc_u_common *tp_c, struct tc_u_hnode *ptr)
{
int id = idr_alloc_cyclic(&tp_c->handle_idr, ptr, 1, 0x7FF, GFP_KERNEL);
if (id < 0)
return 0;
return (id | 0x800U) << 20;
} | 0 | [
"CWE-416"
] | linux | 3db09e762dc79584a69c10d74a6b98f89a9979f8 | 316,708,866,236,625,720,000,000,000,000,000,000,000 | 7 | net/sched: cls_u32: fix netns refcount changes in u32_change()
We are now able to detect extra put_net() at the moment
they happen, instead of much later in correct code paths.
u32_init_knode() / tcf_exts_init() populates the ->exts.net
pointer, but as mentioned in tcf_exts_init(),
the refcount on netns has not been ... |
mlx5_fw_fatal_reporter_dump(struct devlink_health_reporter *reporter,
struct devlink_fmsg *fmsg, void *priv_ctx)
{
struct mlx5_core_dev *dev = devlink_health_reporter_priv(reporter);
u32 crdump_size = dev->priv.health.crdump_size;
u32 *cr_data;
u32 data_size;
u32 offset;
int err;
if (!mlx5_core_is_pf(dev... | 0 | [
"CWE-400",
"CWE-401"
] | linux | c7ed6d0183d5ea9bc31bcaeeba4070bd62546471 | 64,655,936,825,596,470,000,000,000,000,000,000,000 | 47 | net/mlx5: fix memory leak in mlx5_fw_fatal_reporter_dump
In mlx5_fw_fatal_reporter_dump if mlx5_crdump_collect fails the
allocated memory for cr_data must be released otherwise there will be
memory leak. To fix this, this commit changes the return instruction
into goto error handling.
Fixes: 9b1f29823605 ("net/mlx5: ... |
datetime_s_xmlschema(int argc, VALUE *argv, VALUE klass)
{
VALUE str, sg;
rb_scan_args(argc, argv, "02", &str, &sg);
switch (argc) {
case 0:
str = rb_str_new2("-4712-01-01T00:00:00+00:00");
case 1:
sg = INT2FIX(DEFAULT_SG);
}
{
VALUE hash = date_s__xmlschema(klass, str);
return dt... | 1 | [] | date | 3959accef8da5c128f8a8e2fd54e932a4fb253b0 | 61,041,937,090,538,860,000,000,000,000,000,000,000 | 18 | 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`... |
cmsBool GrowNamedColorList(cmsNAMEDCOLORLIST* v)
{
cmsUInt32Number size;
_cmsNAMEDCOLOR * NewPtr;
if (v == NULL) return FALSE;
if (v ->Allocated == 0)
size = 64; // Initial guess
else
size = v ->Allocated * 2;
// Keep a maximum color lists can grow, 100K entries seems reaso... | 0 | [] | Little-CMS | 886e2f524268efe8a1c3aa838c28e446fda24486 | 71,286,296,317,429,610,000,000,000,000,000,000,000 | 23 | Fixes from coverity check |
void virtio_gpu_get_display_info(VirtIOGPU *g,
struct virtio_gpu_ctrl_command *cmd)
{
struct virtio_gpu_resp_display_info display_info;
trace_virtio_gpu_cmd_get_display_info();
memset(&display_info, 0, sizeof(display_info));
display_info.hdr.type = VIRTIO_GPU_RESP_OK_DI... | 0 | [] | qemu | acfc4846508a02cc4c83aa27799fd74ac280bdb2 | 298,090,043,977,263,950,000,000,000,000,000,000,000 | 12 | virtio-gpu: use VIRTIO_GPU_MAX_SCANOUTS
The value is defined in virtio_gpu.h already (changing from 4 to 16).
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 1463653560-26958-6-git-send-email-marcandre.lureau@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> |
static uint64_t megasas_frame_get_context(MegasasState *s,
unsigned long frame)
{
PCIDevice *pci = &s->parent_obj;
return ldq_le_pci_dma(pci, frame + offsetof(struct mfi_frame_header, context));
} | 0 | [
"CWE-401"
] | qemu | 765a707000e838c30b18d712fe6cb3dd8e0435f3 | 142,673,983,360,967,150,000,000,000,000,000,000,000 | 6 | megasas: fix guest-triggered memory leak
If the guest sets the sglist size to a value >=2GB, megasas_handle_dcmd
will return MFI_STAT_MEMORY_NOT_AVAILABLE without freeing the memory.
Avoid this by returning only the status from map_dcmd, and loading
cmd->iov_size in the caller.
Reported-by: Li Qiang <liqiang6-s@360.c... |
void test_nghttp2_http_record_request_method(void) {
nghttp2_session *session;
nghttp2_session_callbacks callbacks;
const nghttp2_nv conn_reqnv[] = {MAKE_NV(":method", "CONNECT"),
MAKE_NV(":authority", "localhost")};
const nghttp2_nv conn_resnv[] = {MAKE_NV(":status", "200"),
... | 0 | [] | nghttp2 | 0a6ce87c22c69438ecbffe52a2859c3a32f1620f | 83,135,654,032,529,070,000,000,000,000,000,000,000 | 54 | Add nghttp2_option_set_max_outbound_ack |
static int macvtap_recvmsg(struct kiocb *iocb, struct socket *sock,
struct msghdr *m, size_t total_len,
int flags)
{
struct macvtap_queue *q = container_of(sock, struct macvtap_queue, sock);
int ret;
if (flags & ~(MSG_DONTWAIT|MSG_TRUNC))
return -EINVAL;
ret = macvtap_do_read(q, iocb, m->msg_iov, tota... | 0 | [
"CWE-119",
"CWE-787"
] | linux | b92946e2919134ebe2a4083e4302236295ea2a73 | 198,614,888,363,450,870,000,000,000,000,000,000,000 | 16 | macvtap: zerocopy: validate vectors before building skb
There're several reasons that the vectors need to be validated:
- Return error when caller provides vectors whose num is greater than UIO_MAXIOV.
- Linearize part of skb when userspace provides vectors grater than MAX_SKB_FRAGS.
- Return error when userspace pro... |
psutil_proc_io_counters(PyObject *self, PyObject *args) {
long pid;
int rc;
perfstat_process_t procinfo;
perfstat_id_t id;
if (! PyArg_ParseTuple(args, "l", &pid))
return NULL;
snprintf(id.name, sizeof(id.name), "%ld", pid);
rc = perfstat_process(&id, &procinfo, sizeof(perfstat_proc... | 0 | [
"CWE-415"
] | psutil | 7d512c8e4442a896d56505be3e78f1156f443465 | 47,162,452,915,568,770,000,000,000,000,000,000,000 | 21 | Use Py_CLEAR instead of Py_DECREF to also set the variable to NULL (#1616)
These files contain loops that convert system data into python objects
and during the process they create objects and dereference their
refcounts after they have been added to the resulting list.
However, in case of errors during the creat... |
static ssize_t uart_mode_store(struct device *dev,
struct device_attribute *attr, const char *valbuf, size_t count)
{
struct usb_serial_port *port = to_usb_serial_port(dev);
struct edgeport_port *edge_port = usb_get_serial_port_data(port);
unsigned int v = simple_strtoul(valbuf, NULL, 0);
dev_dbg(dev, "%s: settin... | 0 | [
"CWE-191"
] | linux | 654b404f2a222f918af9b0cd18ad469d0c941a8e | 59,406,251,017,607,620,000,000,000,000,000,000,000 | 16 | USB: serial: io_ti: fix information leak in completion handler
Add missing sanity check to the bulk-in completion handler to avoid an
integer underflow that can be triggered by a malicious device.
This avoids leaking 128 kB of memory content from after the URB transfer
buffer to user space.
Fixes: 8c209e6782ca ("USB... |
bool createUpgradeFilterChain(absl::string_view, const Http::FilterChainFactory::UpgradeMap*,
Http::FilterChainFactoryCallbacks&) override {
return false;
} | 0 | [
"CWE-400"
] | envoy | dfddb529e914d794ac552e906b13d71233609bf7 | 259,881,163,148,932,620,000,000,000,000,000,000,000 | 4 | 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_F(HttpConnectionManagerImplTest, TestSrdsRouteNotFound) {
setup(false, "", true, true);
setupFilterChain(1, 0); // Recreate the chain for second stream.
EXPECT_CALL(*static_cast<const Router::MockScopedConfig*>(
scopedRouteConfigProvider()->config<Router::ScopedConfig>().get()),
... | 0 | [
"CWE-400",
"CWE-703"
] | envoy | afc39bea36fd436e54262f150c009e8d72db5014 | 303,297,009,489,210,540,000,000,000,000,000,000,000 | 27 | Track byteSize of HeaderMap internally.
Introduces a cached byte size updated internally in HeaderMap. The value
is stored as an optional, and is cleared whenever a non-const pointer or
reference to a HeaderEntry is accessed. The cached value can be set with
refreshByteSize() which performs an iteration over the Heade... |
void Downstream::set_chunked_response(bool f) { chunked_response_ = f; } | 0 | [] | nghttp2 | 319d5ab1c6d916b6b8a0d85b2ae3f01b3ad04f2c | 29,425,947,078,046,157,000,000,000,000,000,000,000 | 1 | nghttpx: Fix request stall
Fix request stall if backend connection is reused and buffer is full. |
void ide_flush_cache(IDEState *s)
{
if (s->bs == NULL) {
ide_flush_cb(s, 0);
return;
}
s->status |= BUSY_STAT;
bdrv_acct_start(s->bs, &s->acct, 0, BDRV_ACCT_FLUSH);
bdrv_aio_flush(s->bs, ide_flush_cb, s);
} | 0 | [
"CWE-189"
] | qemu | 940973ae0b45c9b6817bab8e4cf4df99a9ef83d7 | 94,793,628,274,221,980,000,000,000,000,000,000,000 | 11 | ide: Correct improper smart self test counter reset in ide core.
The SMART self test counter was incorrectly being reset to zero,
not 1. This had the effect that on every 21st SMART EXECUTE OFFLINE:
* We would write off the beginning of a dynamically allocated buffer
* We forgot the SMART history
Fix this.
Signed-o... |
getftypest(stat_T *st)
{
char *t;
if (S_ISREG(st->st_mode))
t = "file";
else if (S_ISDIR(st->st_mode))
t = "dir";
else if (S_ISLNK(st->st_mode))
t = "link";
else if (S_ISBLK(st->st_mode))
t = "bdev";
else if (S_ISCHR(st->st_mode))
t = "cdev";
else if (S_ISFIFO(st->st_mode))
t = "fi... | 0 | [
"CWE-823",
"CWE-703"
] | vim | 5921aeb5741fc6e84c870d68c7c35b93ad0c9f87 | 168,330,982,698,545,540,000,000,000,000,000,000,000 | 22 | patch 8.2.4418: crash when using special multi-byte character
Problem: Crash when using special multi-byte character.
Solution: Don't use isalpha() for an arbitrary character. |
COMPAT_SYSCALL_DEFINE5(waitid,
int, which, compat_pid_t, pid,
struct compat_siginfo __user *, infop, int, options,
struct compat_rusage __user *, uru)
{
struct rusage ru;
struct waitid_info info = {.status = 0};
long err = kernel_waitid(which, pid, &info, options, uru ? &ru : NULL);
int signo = 0;
if (err > ... | 1 | [
"CWE-20"
] | linux | 96ca579a1ecc943b75beba58bebb0356f6cc4b51 | 214,296,876,056,560,050,000,000,000,000,000,000,000 | 39 | waitid(): Add missing access_ok() checks
Adds missing access_ok() checks.
CVE-2017-5123
Reported-by: Chris Salls <chrissalls5@gmail.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Fixes: 4c48abe91be0 ("waitid(): switch copyout of siginfo to unsafe_put_user()")
Cc: st... |
int can_nice(const struct task_struct *p, const int nice)
{
/* convert nice value [19,-20] to rlimit style value [1,40] */
int nice_rlim = 20 - nice;
return (nice_rlim <= task_rlimit(p, RLIMIT_NICE) ||
capable(CAP_SYS_NICE));
} | 0 | [
"CWE-200"
] | linux | 4efbc454ba68def5ef285b26ebfcfdb605b52755 | 338,456,630,711,551,860,000,000,000,000,000,000,000 | 8 | sched: Fix information leak in sys_sched_getattr()
We're copying the on-stack structure to userspace, but forgot to give
the right number of bytes to copy. This allows the calling process to
obtain up to PAGE_SIZE bytes from the stack (and possibly adjacent
kernel memory).
This fix copies only as much as we actually ... |
int dequeue_signal(struct task_struct *tsk, sigset_t *mask, kernel_siginfo_t *info)
{
bool resched_timer = false;
int signr;
/* We only dequeue private signals from ourselves, we don't let
* signalfd steal them
*/
signr = __dequeue_signal(&tsk->pending, mask, info, &resched_timer);
if (!signr) {
signr = __d... | 0 | [
"CWE-190"
] | linux | d1e7fd6462ca9fc76650fbe6ca800e35b24267da | 314,283,153,019,600,640,000,000,000,000,000,000,000 | 76 | signal: Extend exec_id to 64bits
Replace the 32bit exec_id with a 64bit exec_id to make it impossible
to wrap the exec_id counter. With care an attacker can cause exec_id
wrap and send arbitrary signals to a newly exec'd parent. This
bypasses the signal sending checks if the parent changes their
credentials during e... |
static ssize_t event_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct uio_device *idev = dev_get_drvdata(dev);
return sprintf(buf, "%u\n", (unsigned int)atomic_read(&idev->event));
} | 0 | [
"CWE-119",
"CWE-189",
"CWE-703"
] | linux | 7314e613d5ff9f0934f7a0f74ed7973b903315d1 | 155,827,085,922,745,510,000,000,000,000,000,000,000 | 6 | Fix a few incorrectly checked [io_]remap_pfn_range() calls
Nico Golde reports a few straggling uses of [io_]remap_pfn_range() that
really should use the vm_iomap_memory() helper. This trivially converts
two of them to the helper, and comments about why the third one really
needs to continue to use remap_pfn_range(), ... |
static void SFDDumpDHintList( FILE *sfd,const char *key, DStemInfo *d ) {
HintInstance *hi;
if ( d==NULL )
return;
fprintf(sfd, "%s", key );
for ( ; d!=NULL; d=d->next ) {
fprintf(sfd, "%g %g %g %g %g %g",
(double) d->left.x, (double) d->left.y,
(double) d->right.x, (double) d->right.y,
(double)... | 0 | [
"CWE-416"
] | fontforge | 048a91e2682c1a8936ae34dbc7bd70291ec05410 | 66,059,815,398,243,780,000,000,000,000,000,000,000 | 19 | Fix for #4084 Use-after-free (heap) in the SFD_GetFontMetaData() function
Fix for #4086 NULL pointer dereference in the SFDGetSpiros() function
Fix for #4088 NULL pointer dereference in the SFD_AssignLookups() function
Add empty sf->fontname string if it isn't set, fixing #4089 #4090 and many
other potential issues (... |
nm_utils_arp_type_get_hwaddr_relevant_part(int arp_type, const guint8 **hwaddr, gsize *hwaddr_len)
{
g_return_val_if_fail(hwaddr && hwaddr_len
&& nm_utils_arp_type_validate_hwaddr(arp_type, *hwaddr, *hwaddr_len),
FALSE);
/* for infiniband, we only consider ... | 0 | [
"CWE-20"
] | NetworkManager | 420784e342da4883f6debdfe10cde68507b10d27 | 183,931,546,966,462,920,000,000,000,000,000,000,000 | 14 | core: fix crash in nm_wildcard_match_check()
It's not entirely clear how to treat %NULL.
Clearly "match.interface-name=eth0" should not
match with an interface %NULL. But what about
"match.interface-name=!eth0"? It's now implemented
that negative matches still succeed against %NULL.
What about "match.interface-name=*"... |
static PyObject *do_curl_setstate(CurlObject *self, PyObject *args)
{
PyErr_SetString(PyExc_TypeError, "Curl objects do not support deserialization");
return NULL;
} | 0 | [] | pycurl | 2a743674dcf152beaaf6adaddb1ef51b18d1fffe | 95,893,826,424,207,770,000,000,000,000,000,000,000 | 5 | Fix use after free in Curl object's HTTPPOST setopt with unicode FORM_BUFFERPTR.
Fixes use after free in the Curl object's HTTPPOST setopt when a unicode value
is passed as a value with a FORM_BUFFERPTR. The str object created from
the passed in unicode object would have its buffer used but the unicode object
would be... |
static enum_func_status
php_mysqlnd_cached_sha2_result_read(MYSQLND_CONN_DATA * conn, void * _packet)
{
MYSQLND_PACKET_CACHED_SHA2_RESULT * packet= (MYSQLND_PACKET_CACHED_SHA2_RESULT *) _packet;
MYSQLND_ERROR_INFO * error_info = conn->error_info;
MYSQLND_PFC * pfc = conn->protocol_frame_codec;
MYSQLND_VIO * vio = c... | 0 | [
"CWE-120"
] | php-src | 58006537fc5f133ae8549efe5118cde418b3ace9 | 16,470,164,598,147,790,000,000,000,000,000,000,000 | 67 | Fix bug #81719: mysqlnd/pdo password buffer overflow |
Pl_AES_PDF::flush(bool strip_padding)
{
assert(this->offset == this->buf_size);
if (first)
{
first = false;
bool return_after_init = false;
if (this->cbc_mode)
{
if (encrypt)
{
// Set cbc_block to the initialization vector, and if
// not zero, write it to the output stream.
initi... | 1 | [
"CWE-787"
] | qpdf | dc92574c10f3e2516ec6445b88c5d584f40df4e5 | 210,723,206,961,795,060,000,000,000,000,000,000,000 | 76 | Fix some pipelines to be safe if downstream write fails (fuzz issue 28262) |
GF_Box *fiin_New()
{
ISOM_DECL_BOX_ALLOC(FDItemInformationBox, GF_ISOM_BOX_TYPE_FIIN);
return (GF_Box *)tmp;
} | 0 | [
"CWE-125"
] | gpac | bceb03fd2be95097a7b409ea59914f332fb6bc86 | 114,717,419,588,075,570,000,000,000,000,000,000,000 | 5 | fixed 2 possible heap overflows (inc. #1088) |
static int racls_add_cb(const mbentry_t *mbentry, void *rock)
{
struct txn **txn = (struct txn **)rock;
return mboxlist_update_racl(mbentry->name, NULL, mbentry, txn);
} | 0 | [
"CWE-20"
] | cyrus-imapd | 6bd33275368edfa71ae117de895488584678ac79 | 120,714,388,520,717,340,000,000,000,000,000,000,000 | 5 | mboxlist: fix uninitialised memory use where pattern is "Other Users" |
void mark_select_range_as_dependent(THD *thd,
SELECT_LEX *last_select,
SELECT_LEX *current_sel,
Field *found_field, Item *found_item,
Item_ident *resolved_item)
{
/*
Go f... | 0 | [] | server | b000e169562697aa072600695d4f0c0412f94f4f | 195,087,597,793,564,160,000,000,000,000,000,000,000 | 42 | 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'... |
decode_str(const char *input, int single, struct tok_state *tok)
{
PyObject* utf8 = NULL;
const char *str;
const char *s;
const char *newl[2] = {NULL, NULL};
int lineno = 0;
tok->input = str = translate_newlines(input, single, tok);
if (str == NULL)
return NULL;
tok->enc = NULL;
... | 0 | [
"CWE-125"
] | cpython | dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c | 118,645,302,573,418,970,000,000,000,000,000,000,000 | 54 | bpo-35766: Merge typed_ast back into CPython (GH-11645) |
gif_get_next_step (GifContext *context)
{
unsigned char c;
while (TRUE) {
if (!gif_read (context, &c, 1)) {
return -1;
}
if (c == ';') {
/* GIF terminator */
/* hmm. Not 100% sure what to do about this. Should
* i try to return a blank image instead? */
context->state = GIF_DONE;
return 0;
... | 0 | [] | gdk-pixbuf | f8569bb13e2aa1584dde61ca545144750f7a7c98 | 187,122,611,851,680,030,000,000,000,000,000,000,000 | 31 | GIF: Don't return a partially initialized pixbuf structure
It was found that gdk-pixbuf GIF image loader gdk_pixbuf__gif_image_load()
routine did not properly handle certain return values from their subroutines.
A remote attacker could provide a specially-crafted GIF image, which once
opened in an application, linked ... |
void Magick::Image::alphaChannel(AlphaChannelOption alphaOption_)
{
modifyImage();
GetPPException;
SetImageAlphaChannel(image(),alphaOption_,exceptionInfo);
ThrowImageException;
} | 0 | [
"CWE-416"
] | ImageMagick | 8c35502217c1879cb8257c617007282eee3fe1cc | 197,011,381,193,232,350,000,000,000,000,000,000,000 | 7 | Added missing return to avoid use after free. |
tracing_thresh_write(struct file *filp, const char __user *ubuf,
size_t cnt, loff_t *ppos)
{
struct trace_array *tr = filp->private_data;
int ret;
mutex_lock(&trace_types_lock);
ret = tracing_nsecs_write(&tracing_thresh, ubuf, cnt, ppos);
if (ret < 0)
goto out;
if (tr->current_trace->update_thresh) {
... | 0 | [
"CWE-415"
] | linux | 4397f04575c44e1440ec2e49b6302785c95fd2f8 | 277,913,101,575,410,140,000,000,000,000,000,000,000 | 23 | tracing: Fix possible double free on failure of allocating trace buffer
Jing Xia and Chunyan Zhang reported that on failing to allocate part of the
tracing buffer, memory is freed, but the pointers that point to them are not
initialized back to NULL, and later paths may try to free the freed memory
again. Jing and Chu... |
static int cx24116_cmd_execute(struct dvb_frontend *fe, struct cx24116_cmd *cmd)
{
struct cx24116_state *state = fe->demodulator_priv;
int i, ret;
dprintk("%s()\n", __func__);
/* Load the firmware if required */
ret = cx24116_firmware_ondemand(fe);
if (ret != 0) {
printk(KERN_ERR "%s(): Unable initialise the ... | 0 | [
"CWE-476",
"CWE-119",
"CWE-125"
] | linux | 1fa2337a315a2448c5434f41e00d56b01a22283c | 33,304,631,638,715,900,000,000,000,000,000,000,000 | 35 | [media] cx24116: fix a buffer overflow when checking userspace params
The maximum size for a DiSEqC command is 6, according to the
userspace API. However, the code allows to write up much more values:
drivers/media/dvb-frontends/cx24116.c:983 cx24116_send_diseqc_msg() error: buffer overflow 'd->msg' 6 <= 23
Cc: stab... |
e_mail_part_update_validity (EMailPart *part,
CamelCipherValidity *validity,
EMailPartValidityFlags validity_type)
{
EMailPartValidityPair *pair;
EMailPartValidityFlags mask;
g_return_if_fail (E_IS_MAIL_PART (part));
g_return_if_fail (validity != NULL);
m... | 1 | [
"CWE-347"
] | evolution | f66cd3e1db301d264563b4222a3574e2e58e2b85 | 36,298,089,107,314,850,000,000,000,000,000,000,000 | 24 | eds-I#3 - [GPG] Mails that are not encrypted look encrypted
Related to https://gitlab.gnome.org/GNOME/evolution-data-server/issues/3 |
static void sysbus_fdc_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
dc->props = sysbus_fdc_properties;
set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
} | 0 | [
"CWE-119"
] | qemu | e907746266721f305d67bc0718795fedee2e824c | 208,568,555,707,644,900,000,000,000,000,000,000,000 | 7 | fdc: force the fifo access to be in bounds of the allocated buffer
During processing of certain commands such as FD_CMD_READ_ID and
FD_CMD_DRIVE_SPECIFICATION_COMMAND the fifo memory access could
get out of bounds leading to memory corruption with values coming
from the guest.
Fix this by making sure that the index i... |
static int nf_tables_commit_chain_prepare(struct net *net, struct nft_chain *chain)
{
const struct nft_expr *expr, *last;
struct nft_regs_track track = {};
unsigned int size, data_size;
void *data, *data_boundary;
struct nft_rule_dp *prule;
struct nft_rule *rule;
/* already handled or inactive chain? */
if (ch... | 0 | [
"CWE-787"
] | linux | 6e1acfa387b9ff82cfc7db8cc3b6959221a95851 | 252,471,165,109,778,500,000,000,000,000,000,000,000 | 79 | netfilter: nf_tables: validate registers coming from userspace.
Bail out in case userspace uses unsupported registers.
Fixes: 49499c3e6e18 ("netfilter: nf_tables: switch registers to 32 bit addressing")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> |
Status MakeShapeFromFormat(TensorFormat format, DimensionOrConstant N,
const std::vector<DimensionOrConstant>& spatial,
DimensionOrConstant C, ShapeHandle* out,
shape_inference::InferenceContext* context) {
const int num_dims = GetTensor... | 0 | [
"CWE-369"
] | tensorflow | 8a793b5d7f59e37ac7f3cd0954a750a2fe76bad4 | 164,923,715,571,851,730,000,000,000,000,000,000,000 | 24 | Prevent division by 0 in common shape functions.
PiperOrigin-RevId: 387712197
Change-Id: Id25c7460e35b68aeeeac23b9a88e455b443ee149 |
static int ZEND_FASTCALL ZEND_CLONE_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
zval *obj = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC);
zend_class_entry *ce;
zend_function *clone;
zend_object_clone_obj_t clone_call;
if (IS_CV == IS_CONST ||
(IS_CV == IS_VAR &&... | 0 | [] | php-src | ce96fd6b0761d98353761bf78d5bfb55291179fd | 79,552,618,559,082,680,000,000,000,000,000,000,000 | 56 | - 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.