func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
const uchar *frm_image,
size_t frm_length)
{
TABLE_SHARE *share= this;
uint new_frm_ver, field_pack_length, new_field_pack_flag;
uint interval_count, interval_p... | 0 | [
"CWE-416"
] | server | c02ebf3510850ba78a106be9974c94c3b97d8585 | 234,667,044,865,215,950,000,000,000,000,000,000,000 | 1,560 | 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. |
GC_API void GC_CALL GC_set_log_fd(int fd)
{
GC_log = fd;
} | 0 | [
"CWE-119"
] | bdwgc | 7292c02fac2066d39dd1bcc37d1a7054fd1e32ee | 334,083,765,742,402,330,000,000,000,000,000,000,000 | 4 | Fix malloc routines to prevent size value wrap-around
See issue #135 on Github.
* allchblk.c (GC_allochblk, GC_allochblk_nth): Use
OBJ_SZ_TO_BLOCKS_CHECKED instead of OBJ_SZ_TO_BLOCKS.
* malloc.c (GC_alloc_large): Likewise.
* alloc.c (GC_expand_hp_inner): Type of "bytes" local variable changed
from word to size_t; ca... |
GF_Box *svhd_box_new()
{
ISOM_DECL_BOX_ALLOC(GF_SphericalVideoInfoBox, GF_ISOM_BOX_TYPE_SVHD);
return (GF_Box *)tmp; | 0 | [
"CWE-476",
"CWE-787"
] | gpac | b8f8b202d4fc23eb0ab4ce71ae96536ca6f5d3f8 | 136,912,899,086,808,050,000,000,000,000,000,000,000 | 5 | fixed #1757 |
port::StatusOr<dnn::AlgorithmDesc> GetCudnnConvolutionForwardAlgorithm(
Stream* stream, const CudnnHandle& cudnn,
const dnn::AlgorithmConfig& algorithm_config,
const CudnnTensorDescriptor& input_nd, const CudnnFilterDescriptor& filter,
dnn::DataType element_type,
const dnn::ConvolutionDescriptor& co... | 0 | [
"CWE-20"
] | tensorflow | 14755416e364f17fb1870882fa778c7fec7f16e3 | 205,835,848,205,024,580,000,000,000,000,000,000,000 | 62 | Prevent CHECK-fail in LSTM/GRU with zero-length input.
PiperOrigin-RevId: 346239181
Change-Id: I5f233dbc076aab7bb4e31ba24f5abd4eaf99ea4f |
mono_method_signature (MonoMethod *m)
{
MonoError error;
MonoMethodSignature *sig;
sig = mono_method_signature_checked (m, &error);
if (!sig) {
char *type_name = mono_type_get_full_name (m->klass);
g_warning ("Could not load signature of %s:%s due to: %s", type_name, m->name, mono_error_get_message (&error));
... | 0 | [] | mono | 8e890a3bf80a4620e417814dc14886b1bbd17625 | 96,069,035,951,368,900,000,000,000,000,000,000,000 | 15 | Search for dllimported shared libs in the base directory, not cwd.
* loader.c: we don't search the current directory anymore for shared
libraries referenced in DllImport attributes, as it has a slight
security risk. We search in the same directory where the referencing
image was loaded from, instead. Fixes bug# 641915... |
tcp_info_append_uint(packet_info *pinfo, const char *abbrev, guint32 val)
{
/* fstr(" %s=%u", abbrev, val) */
col_append_str_uint(pinfo->cinfo, COL_INFO, abbrev, val, " ");
} | 0 | [
"CWE-354"
] | wireshark | 7f3fe6164a68b76d9988c4253b24d43f498f1753 | 245,428,223,658,835,580,000,000,000,000,000,000,000 | 5 | TCP: do not use an unknown status when the checksum is 0xffff
Otherwise it triggers an assert when adding the column as the field is
defined as BASE_NONE and not BASE_DEC or BASE_HEX. Thus an unknown value
(not in proto_checksum_vals[)array) cannot be represented.
Mark the checksum as bad even if we process the packet... |
SCTP_STATIC void sctp_shutdown(struct sock *sk, int how)
{
struct sctp_endpoint *ep;
struct sctp_association *asoc;
if (!sctp_style(sk, TCP))
return;
if (how & SEND_SHUTDOWN) {
ep = sctp_sk(sk)->ep;
if (!list_empty(&ep->asocs)) {
asoc = list_entry(ep->asocs.next,
struct sctp_association, asocs);
... | 0 | [] | linux-2.6 | 5e739d1752aca4e8f3e794d431503bfca3162df4 | 159,940,138,847,016,950,000,000,000,000,000,000,000 | 17 | sctp: fix potential panics in the SCTP-AUTH API.
All of the SCTP-AUTH socket options could cause a panic
if the extension is disabled and the API is envoked.
Additionally, there were some additional assumptions that
certain pointers would always be valid which may not
always be the case.
This patch hardens the API a... |
void t_cpp_generator::generate_service_client(t_service* tservice, string style) {
string ifstyle;
if (style == "Cob") {
ifstyle = "CobCl";
}
std::ofstream& out = (gen_templates_ ? f_service_tcc_ : f_service_);
string template_header, template_suffix, short_suffix, protocol_type, _this;
string const pr... | 0 | [
"CWE-20"
] | thrift | cfaadcc4adcfde2a8232c62ec89870b73ef40df1 | 54,133,728,874,699,160,000,000,000,000,000,000,000 | 415 | THRIFT-3231 CPP: Limit recursion depth to 64
Client: cpp
Patch: Ben Craig <bencraig@apache.org> |
static int read_filesystem_tables()
{
long long table_start;
/* Read uid and gid lookup tables */
/* Sanity check super block contents */
if(sBlk.no_guids) {
if(sBlk.guid_start >= sBlk.s.bytes_used) {
ERROR("read_filesystem_tables: gid start too large in super block\n");
goto corrupted;
}
if(read_ids... | 0 | [
"CWE-200",
"CWE-59",
"CWE-22"
] | squashfs-tools | e0485802ec72996c20026da320650d8362f555bd | 230,758,629,772,689,570,000,000,000,000,000,000,000 | 107 | Unsquashfs: additional write outside destination directory exploit fix
An issue on github (https://github.com/plougher/squashfs-tools/issues/72)
showed how some specially crafted Squashfs filesystems containing
invalid file names (with '/' and '..') can cause Unsquashfs to write
files outside of the destination direct... |
tdbio_get_dbname()
{
return db_name;
} | 0 | [
"CWE-20"
] | gnupg | 2183683bd633818dd031b090b5530951de76f392 | 179,454,959,650,455,360,000,000,000,000,000,000,000 | 4 | Use inline functions to convert buffer data to scalars.
* common/host2net.h (buf16_to_ulong, buf16_to_uint): New.
(buf16_to_ushort, buf16_to_u16): New.
(buf32_to_size_t, buf32_to_ulong, buf32_to_uint, buf32_to_u32): New.
--
Commit 91b826a38880fd8a989318585eb502582636ddd8 was not enough to
avoid all sign extension on ... |
static void init_loopback(struct net_device *dev)
{
struct inet6_dev *idev;
struct net_device *sp_dev;
struct inet6_ifaddr *sp_ifa;
struct rt6_info *sp_rt;
/* ::1 */
ASSERT_RTNL();
if ((idev = ipv6_find_idev(dev)) == NULL) {
pr_debug("%s: add_dev failed\n", __func__);
return;
}
add_addr(idev, &in6addr... | 0 | [] | net | 4b08a8f1bd8cb4541c93ec170027b4d0782dab52 | 108,441,114,466,372,800,000,000,000,000,000,000,000 | 47 | ipv6: remove max_addresses check from ipv6_create_tempaddr
Because of the max_addresses check attackers were able to disable privacy
extensions on an interface by creating enough autoconfigured addresses:
<http://seclists.org/oss-sec/2012/q4/292>
But the check is not actually needed: max_addresses protects the
kerne... |
WasmResult Context::recordMetric(uint32_t metric_id, uint64_t value) {
auto type = static_cast<MetricType>(metric_id & Wasm::kMetricTypeMask);
if (type == MetricType::Counter) {
auto it = wasm_->counters_.find(metric_id);
if (it != wasm_->counters_.end()) {
it->second->add(value);
return WasmRes... | 0 | [
"CWE-476"
] | envoy | 8788a3cf255b647fd14e6b5e2585abaaedb28153 | 113,690,970,489,955,230,000,000,000,000,000,000,000 | 23 | 1.4 - Do not call into the VM unless the VM Context has been created. (#24)
* Ensure that the in VM Context is created before onDone is called.
Signed-off-by: John Plevyak <jplevyak@gmail.com>
* Update as per offline discussion.
Signed-off-by: John Plevyak <jplevyak@gmail.com>
* Set in_vm_context_created_ in onNet... |
void OSD::handle_osd_map(MOSDMap *m)
{
assert(osd_lock.is_locked());
// Keep a ref in the list until we get the newly received map written
// onto disk. This is important because as long as the refs are alive,
// the OSDMaps will be pinned in the cache and we won't try to read it
// off of disk. Otherwise the... | 0 | [
"CWE-287",
"CWE-284"
] | ceph | 5ead97120e07054d80623dada90a5cc764c28468 | 112,796,390,201,206,400,000,000,000,000,000,000,000 | 208 | auth/cephx: add authorizer challenge
Allow the accepting side of a connection to reject an initial authorizer
with a random challenge. The connecting side then has to respond with an
updated authorizer proving they are able to decrypt the service's challenge
and that the new authorizer was produced for this specific ... |
do_learn_status (app_t app, ctrl_t ctrl, unsigned int flags)
{
gpg_error_t err;
err = switch_application (app, 0);
if (err)
return err;
do_learn_status_core (app, ctrl, flags, 0);
err = switch_application (app, 1);
if (err)
return 0; /* Silently ignore if we can't switch to SigG. */
do_learn... | 0 | [
"CWE-20"
] | gnupg | 2183683bd633818dd031b090b5530951de76f392 | 21,912,091,074,839,723,000,000,000,000,000,000,000 | 18 | Use inline functions to convert buffer data to scalars.
* common/host2net.h (buf16_to_ulong, buf16_to_uint): New.
(buf16_to_ushort, buf16_to_u16): New.
(buf32_to_size_t, buf32_to_ulong, buf32_to_uint, buf32_to_u32): New.
--
Commit 91b826a38880fd8a989318585eb502582636ddd8 was not enough to
avoid all sign extension on ... |
finalizeTable(TranslationTableHeader *table) {
if (table->finalized) return 1;
// normalize basechar and mode of all characters
for (int i = 0; i < HASHNUM; i++) {
TranslationTableOffset characterOffset = table->characters[i];
while (characterOffset) {
TranslationTableCharacter *character =
(TranslationT... | 0 | [
"CWE-787"
] | liblouis | 2e4772befb2b1c37cb4b9d6572945115ee28630a | 15,621,250,263,425,553,000,000,000,000,000,000,000 | 104 | Prevent an invalid memory writes in compileRule
Thanks to Han Zheng for reporting it
Fixes #1214 |
static int load_state_from_tss32(struct x86_emulate_ctxt *ctxt,
struct tss_segment_32 *tss)
{
int ret;
u8 cpl;
if (ctxt->ops->set_cr(ctxt, 3, tss->cr3))
return emulate_gp(ctxt, 0);
ctxt->_eip = tss->eip;
ctxt->eflags = tss->eflags | 2;
/* General purpose registers */
*reg_write(ctxt, VCPU_REGS_RAX) = ts... | 1 | [] | kvm | d1442d85cc30ea75f7d399474ca738e0bc96f715 | 209,745,938,894,562,920,000,000,000,000,000,000,000 | 75 | KVM: x86: Handle errors when RIP is set during far jumps
Far jmp/call/ret may fault while loading a new RIP. Currently KVM does not
handle this case, and may result in failed vm-entry once the assignment is
done. The tricky part of doing so is that loading the new CS affects the
VMCS/VMCB state, so if we fail during... |
int ext4_get_blocks_wrap(handle_t *handle, struct inode *inode, sector_t block,
unsigned int max_blocks, struct buffer_head *bh,
int create, int extend_disksize, int flag)
{
int retval;
clear_buffer_mapped(bh);
/*
* Try to see if we can get the block without requesting
* for new file system block.
*/
... | 0 | [
"CWE-399"
] | linux-2.6 | 06a279d636734da32bb62dd2f7b0ade666f65d7c | 106,528,403,621,899,840,000,000,000,000,000,000,000 | 88 | ext4: only use i_size_high for regular files
Directories are not allowed to be bigger than 2GB, so don't use
i_size_high for anything other than regular files. E2fsck should
complain about these inodes, but the simplest thing to do for the
kernel is to only use i_size_high for regular files.
This prevents an intenti... |
BPF_CALL_2(bpf_csum_update, struct sk_buff *, skb, __wsum, csum)
{
/* The interface is to be used in combination with bpf_csum_diff()
* for direct packet writes. csum rotation for alignment as well
* as emulating csum_sub() can be done from the eBPF program.
*/
if (skb->ip_summed == CHECKSUM_COMPLETE)
return ... | 0 | [
"CWE-120"
] | linux | 050fad7c4534c13c8eb1d9c2ba66012e014773cb | 219,087,714,250,041,020,000,000,000,000,000,000,000 | 11 | bpf: fix truncated jump targets on heavy expansions
Recently during testing, I ran into the following panic:
[ 207.892422] Internal error: Accessing user space memory outside uaccess.h routines: 96000004 [#1] SMP
[ 207.901637] Modules linked in: binfmt_misc [...]
[ 207.966530] CPU: 45 PID: 2256 Comm: test_ve... |
liblouis_allocMem (AllocBuf buffer, int srcmax, int destmax)
{
if (srcmax < 1024)
srcmax = 1024;
if (destmax < 1024)
destmax = 1024;
switch (buffer)
{
case alloc_typebuf:
if (destmax > sizeTypebuf)
{
if (typebuf != NULL)
free (typebuf);
typebuf = malloc ((destmax + 4) * sizeof (u... | 0 | [] | liblouis | dc97ef791a4fae9da11592c79f9f79e010596e0c | 201,059,637,990,149,820,000,000,000,000,000,000,000 | 92 | Merge branch 'table_resolver' |
static ssize_t mem_write(struct file * file, const char __user *buf,
size_t count, loff_t *ppos)
{
int copied;
char *page;
struct task_struct *task = get_proc_task(file->f_path.dentry->d_inode);
unsigned long dst = *ppos;
struct mm_struct *mm;
copied = -ESRCH;
if (!task)
goto out_no_task;
copied = -ENOM... | 0 | [] | linux | 0499680a42141d86417a8fbaa8c8db806bea1201 | 173,339,883,876,865,800,000,000,000,000,000,000,000 | 58 | procfs: add hidepid= and gid= mount options
Add support for mount options to restrict access to /proc/PID/
directories. The default backward-compatible "relaxed" behaviour is left
untouched.
The first mount option is called "hidepid" and its value defines how much
info about processes we want to be available for non... |
static int i8042_start(struct serio *serio)
{
struct i8042_port *port = serio->port_data;
port->exists = true;
mb();
return 0;
} | 1 | [
"CWE-476"
] | linux | 340d394a789518018f834ff70f7534fc463d3226 | 144,388,515,704,931,430,000,000,000,000,000,000,000 | 8 | Input: i8042 - fix crash at boot time
The driver checks port->exists twice in i8042_interrupt(), first when
trying to assign temporary "serio" variable, and second time when deciding
whether it should call serio_interrupt(). The value of port->exists may
change between the 2 checks, and we may end up calling serio_int... |
*/
static int native_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
{
int pkt_len;
uchar *pkt;
DBUG_ENTER("native_password_auth_client");
if (((MCPVIO_EXT *)vio)->mysql_change_user)
{
/*
in mysql_change_user() the client sends the first packet.
we use the old scramble.
*/
... | 0 | [
"CWE-284",
"CWE-295"
] | mysql-server | 3bd5589e1a5a93f9c224badf983cd65c45215390 | 18,369,111,353,078,591,000,000,000,000,000,000,000 | 48 | WL#6791 : Redefine client --ssl option to imply enforced encryption
# Changed the meaning of the --ssl=1 option of all client binaries
to mean force ssl, not try ssl and fail over to eunecrypted
# Added a new MYSQL_OPT_SSL_ENFORCE mysql_options()
option to specify that an ssl connection is required.
# Added a new macr... |
int ssl3_get_new_session_ticket(SSL *s)
{
int ok, al, ret = 0, ticklen;
long n;
const unsigned char *p;
unsigned char *d;
n = s->method->ssl_get_message(s,
SSL3_ST_CR_SESSION_TICKET_A,
SSL3_ST_CR_SESSION_TICKET_B,
... | 0 | [
"CWE-310"
] | openssl | e1b568dd2462f7cacf98f3d117936c34e2849a6b | 296,889,797,437,765,820,000,000,000,000,000,000,000 | 63 | Prevent handshake with unseeded PRNG
Fix security issue where under certain conditions a client can complete a
handshake with an unseeded PRNG. The conditions are:
- Client is on a platform where the PRNG has not been seeded, and the
user has not seeded manually
- A protocol specific client method version has been use... |
is_trusted_desktop_file (GFile *file,
GCancellable *cancellable)
{
char *basename;
gboolean res;
GFileInfo *info;
/* Don't trust non-local files */
if (!g_file_is_native (file)) {
return FALSE;
}
basename = g_file_get_basename (file);
if (!g_str_has_suffix (basename, ".desktop")) {
g_free (basename);... | 0 | [] | nautilus | a0f7bb5f2e9af8ecb463b13da834fa8559b0a481 | 286,646,382,577,512,050,000,000,000,000,000,000,000 | 44 | Use $XDG_DATA_HOME/.converted-launchers as marker for one-time desktop
2009-02-25 Alexander Larsson <alexl@redhat.com>
* src/nautilus-application.c:
Use $XDG_DATA_HOME/.converted-launchers as marker for
one-time desktop file trust operation.
* libnautilus-private/nautilus-file-utilities.[ch]:
Ad... |
R_API RAsmOp *r_core_disassemble (RCore *core, ut64 addr) {
int delta;
ut8 buf[128];
static RBuffer *b = NULL; // XXX: never freed and non-thread safe. move to RCore
RAsmOp *op;
if (!b) {
b = r_buf_new ();
if (!b || !r_core_read_at (core, addr, buf, sizeof (buf))) {
return NULL;
}
b->base = addr;
r_bu... | 0 | [
"CWE-119",
"CWE-787"
] | radare2 | 00e8f205475332d7842d0f0d1481eeab4e83017c | 220,345,587,012,083,460,000,000,000,000,000,000,000 | 30 | Fix #7727 - undefined pointers and out of band string access fixes |
static inline unsigned int Hq2XPatternToNumber(const int *pattern)
{
ssize_t
i;
unsigned int
result,
order;
result=0;
order=1;
for (i=7; i >= 0; i--)
{
result+=order*pattern[i];
order*=2;
}
return(result);
} | 0 | [
"CWE-369"
] | ImageMagick | 43539e67a47d2f8de832d33a5b26dc2a7a12294f | 12,447,896,940,299,240,000,000,000,000,000,000,000 | 18 | https://github.com/ImageMagick/ImageMagick/issues/1718 |
int expand_stack(struct vm_area_struct *vma, unsigned long address)
{
return expand_downwards(vma, address);
} | 0 | [
"CWE-119"
] | linux | 1be7107fbe18eed3e319a6c3e83c78254b693acb | 310,829,398,705,482,120,000,000,000,000,000,000,000 | 4 | mm: larger stack guard gap, between vmas
Stack guard page is a useful feature to reduce a risk of stack smashing
into a different mapping. We have been using a single page gap which
is sufficient to prevent having stack adjacent to a different mapping.
But this seems to be insufficient in the light of the stack usage ... |
int ssl_parse_serverhello_tlsext(SSL *s, unsigned char **p, unsigned char *d, int n, int *al)
{
unsigned short length;
unsigned short type;
unsigned short size;
unsigned char *data = *p;
int tlsext_servername = 0;
int renegotiate_seen = 0;
#ifndef OPENSSL_NO_NEXTPROTONEG
s->s3->next_proto_neg_seen = 0;
#endif
... | 1 | [] | openssl | 4817504d069b4c5082161b02a22116ad75f822b1 | 310,266,880,397,725,660,000,000,000,000,000,000,000 | 239 | PR: 2658
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Reviewed by: steve
Support for TLS/DTLS heartbeats. |
sctp_disposition_t sctp_sf_beat_8_3(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
{
struct sctp_chunk *chunk = arg;
struct sctp_chunk *reply;
size_t paylen = 0;
if (!sctp_vtag_verify(chunk, asoc))... | 0 | [
"CWE-20"
] | linux-2.6 | ba0166708ef4da7eeb61dd92bbba4d5a749d6561 | 179,226,736,282,922,000,000,000,000,000,000,000,000 | 38 | sctp: Fix kernel panic while process protocol violation parameter
Since call to function sctp_sf_abort_violation() need paramter 'arg' with
'struct sctp_chunk' type, it will read the chunk type and chunk length from
the chunk_hdr member of chunk. But call to sctp_sf_violation_paramlen()
always with 'struct sctp_paramh... |
void CL_CDDialog( void ) {
cls.cddialog = qtrue; // start it next frame
} | 0 | [
"CWE-269"
] | ioq3 | 376267d534476a875d8b9228149c4ee18b74a4fd | 284,409,401,539,135,740,000,000,000,000,000,000,000 | 3 | Don't load .pk3s as .dlls, and don't load user config files from .pk3s. |
dirvote_act(or_options_t *options, time_t now)
{
if (!authdir_mode_v3(options))
return;
if (!voting_schedule.voting_starts) {
char *keys = list_v3_auth_ids();
authority_cert_t *c = get_my_v3_authority_cert();
log_notice(LD_DIR, "Scheduling voting. Known authority IDs are %s. "
"Mine ... | 0 | [] | tor | 973c18bf0e84d14d8006a9ae97fde7f7fb97e404 | 217,042,975,579,976,570,000,000,000,000,000,000,000 | 49 | Fix assertion failure in tor_timegm.
Fixes bug 6811. |
int64_t reference_block_timestamp() const {
return reference_block_timestamp_;
} | 0 | [
"CWE-20"
] | libvpx | f00890eecdf8365ea125ac16769a83aa6b68792d | 103,380,063,995,472,460,000,000,000,000,000,000,000 | 3 | update libwebm to libwebm-1.0.0.27-352-g6ab9fcf
https://chromium.googlesource.com/webm/libwebm/+log/af81f26..6ab9fcf
Change-Id: I9d56e1fbaba9b96404b4fbabefddc1a85b79c25d |
GF_Err pcrb_box_size(GF_Box *s)
{
GF_PcrInfoBox *ptr = (GF_PcrInfoBox*) s;
ptr->size += 4;
ptr->size += ptr->subsegment_count * 6;
return GF_OK;
} | 0 | [
"CWE-787"
] | gpac | 77510778516803b7f7402d7423c6d6bef50254c3 | 336,931,153,913,513,820,000,000,000,000,000,000,000 | 9 | fixed #2255 |
static int peer_abort(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
{
struct cpl_abort_req_rss *req = cplhdr(skb);
struct iwch_ep *ep = ctx;
struct cpl_abort_rpl *rpl;
struct sk_buff *rpl_skb;
struct iwch_qp_attributes attrs;
int ret;
int release = 0;
unsigned long flags;
if (is_neg_adv_abort(req->stat... | 0 | [
"CWE-703"
] | linux | 67f1aee6f45059fd6b0f5b0ecb2c97ad0451f6b3 | 318,428,543,957,129,400,000,000,000,000,000,000,000 | 110 | iw_cxgb3: Fix incorrectly returning error on success
The cxgb3_*_send() functions return NET_XMIT_ values, which are
positive integers values. So don't treat positive return values
as an error.
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off... |
static void io_sqd_update_thread_idle(struct io_sq_data *sqd)
{
struct io_ring_ctx *ctx;
unsigned sq_thread_idle = 0;
list_for_each_entry(ctx, &sqd->ctx_list, sqd_list)
sq_thread_idle = max(sq_thread_idle, ctx->sq_thread_idle);
sqd->sq_thread_idle = sq_thread_idle; | 0 | [
"CWE-787"
] | linux | d1f82808877bb10d3deee7cf3374a4eb3fb582db | 181,991,843,127,295,500,000,000,000,000,000,000,000 | 9 | io_uring: truncate lengths larger than MAX_RW_COUNT on provide buffers
Read and write operations are capped to MAX_RW_COUNT. Some read ops rely on
that limit, and that is not guaranteed by the IORING_OP_PROVIDE_BUFFERS.
Truncate those lengths when doing io_add_buffers, so buffer addresses still
use the uncapped lengt... |
void MS_CALLBACK msg_cb(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg)
{
BIO *bio = arg;
const char *str_write_p, *str_version, *str_content_type = "", *str_details1 = "", *str_details2= "";
str_write_p = write_p ? ">>>" : "<<<";
switch (version)
{
case SSL2_VER... | 0 | [] | openssl | a70da5b3ecc3160368529677006801c58cb369db | 294,666,622,103,187,100,000,000,000,000,000,000,000 | 315 | New functions to check a hostname email or IP address against a
certificate. Add options to s_client, s_server and x509 utilities
to print results of checks. |
void set(const st_sp_chistics &other) { *this= other; } | 0 | [
"CWE-703"
] | server | 39feab3cd31b5414aa9b428eaba915c251ac34a2 | 172,630,812,621,563,000,000,000,000,000,000,000,000 | 1 | MDEV-26412 Server crash in Item_field::fix_outer_field for INSERT SELECT
IF an INSERT/REPLACE SELECT statement contained an ON expression in the top
level select and this expression used a subquery with a column reference
that could not be resolved then an attempt to resolve this reference as
an outer reference caused... |
static int __init ip6_tunnel_init(void)
{
int err;
if (xfrm6_tunnel_register(&ip4ip6_handler, AF_INET)) {
printk(KERN_ERR "ip6_tunnel init: can't register ip4ip6\n");
err = -EAGAIN;
goto out;
}
if (xfrm6_tunnel_register(&ip6ip6_handler, AF_INET6)) {
printk(KERN_ERR "ip6_tunnel init: can't register ip6ip6... | 1 | [] | linux-2.6 | d5aa407f59f5b83d2c50ec88f5bf56d40f1f8978 | 263,368,106,117,104,700,000,000,000,000,000,000,000 | 27 | tunnels: fix netns vs proto registration ordering
Same stuff as in ip_gre patch: receive hook can be called before netns
setup is done, oopsing in net_generic().
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net> |
int sched_trace_cfs_rq_cpu(struct cfs_rq *cfs_rq)
{
return cfs_rq ? cpu_of(rq_of(cfs_rq)) : -1;
} | 0 | [
"CWE-400",
"CWE-703"
] | linux | de53fd7aedb100f03e5d2231cfce0e4993282425 | 295,643,272,490,567,060,000,000,000,000,000,000,000 | 4 | sched/fair: Fix low cpu usage with high throttling by removing expiration of cpu-local slices
It has been observed, that highly-threaded, non-cpu-bound applications
running under cpu.cfs_quota_us constraints can hit a high percentage of
periods throttled while simultaneously not consuming the allocated
amount of quota... |
static void swiotlb_bounce(struct device *dev, phys_addr_t tlb_addr, size_t size,
enum dma_data_direction dir)
{
struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
int index = (tlb_addr - mem->start) >> IO_TLB_SHIFT;
phys_addr_t orig_addr = mem->slots[index].orig_addr;
size_t alloc_size = mem->slots[index].alloc_s... | 0 | [
"CWE-200",
"CWE-401"
] | linux | aa6f8dcbab473f3a3c7454b74caa46d36cdc5d13 | 194,440,088,487,665,970,000,000,000,000,000,000,000 | 71 | swiotlb: rework "fix info leak with DMA_FROM_DEVICE"
Unfortunately, we ended up merging an old version of the patch "fix info
leak with DMA_FROM_DEVICE" instead of merging the latest one. Christoph
(the swiotlb maintainer), he asked me to create an incremental fix
(after I have pointed this out the mix up, and asked h... |
__must_hold(wqe->lock)
{
if (!list_empty(&wqe->work_list) && !(wqe->flags & IO_WQE_FLAG_STALLED))
return true;
return false;
} | 0 | [] | linux | 181e448d8709e517c9c7b523fcd209f24eb38ca7 | 272,412,962,031,806,580,000,000,000,000,000,000,000 | 6 | io_uring: async workers should inherit the user creds
If we don't inherit the original task creds, then we can confuse users
like fuse that pass creds in the request header. See link below on
identical aio issue.
Link: https://lore.kernel.org/linux-fsdevel/26f0d78e-99ca-2f1b-78b9-433088053a61@scylladb.com/T/#u
Signed... |
int oz_usb_get_desc_req(void *hpd, u8 req_id, u8 req_type, u8 desc_type,
u8 index, __le16 windex, int offset, int len)
{
struct oz_usb_ctx *usb_ctx = hpd;
struct oz_pd *pd = usb_ctx->pd;
struct oz_elt *elt;
struct oz_get_desc_req *body;
struct oz_elt_buf *eb = &pd->elt_buff;
struct oz_elt_info *ei = oz_elt_info_... | 0 | [
"CWE-200",
"CWE-189"
] | linux | 04bf464a5dfd9ade0dda918e44366c2c61fce80b | 29,543,958,420,232,900,000,000,000,000,000,000,000 | 33 | ozwpan: divide-by-zero leading to panic
A network supplied parameter was not checked before division, leading to
a divide-by-zero. Since this happens in the softirq path, it leads to a
crash. A PoC follows below, which requires the ozprotocol.h file from
this module.
=-=-=-=-=-=
#include <arpa/inet.h>
#include <li... |
static struct sock *__llc_lookup_established(struct llc_sap *sap,
struct llc_addr *daddr,
struct llc_addr *laddr)
{
struct sock *rc;
struct hlist_nulls_node *node;
int slot = llc_sk_laddr_hashfn(sap, laddr);
struct hlist_nulls_head *laddr_hb = &sap->sk_laddr_hash[slot];
rcu_read_lock();
again:... | 0 | [
"CWE-20",
"CWE-401"
] | linux | 8b74d439e1697110c5e5c600643e823eb1dd0762 | 125,283,565,403,014,880,000,000,000,000,000,000,000 | 36 | net/llc: avoid BUG_ON() in skb_orphan()
It seems nobody used LLC since linux-3.12.
Fortunately fuzzers like syzkaller still know how to run this code,
otherwise it would be no fun.
Setting skb->sk without skb->destructor leads to all kinds of
bugs, we now prefer to be very strict about it.
Ideally here we would use... |
static void jas_icccurv_dump(jas_iccattrval_t *attrval, FILE *out)
{
int i;
jas_icccurv_t *curv = &attrval->data.curv;
fprintf(out, "number of entries = %"PRIuFAST32"\n", curv->numents);
if (curv->numents == 1) {
fprintf(out, "gamma = %f\n", curv->ents[0] / 256.0);
} else {
for (i = 0; i < JAS_CAST(int, curv->... | 0 | [
"CWE-20",
"CWE-190"
] | jasper | d42b2388f7f8e0332c846675133acea151fc557a | 126,216,247,557,530,470,000,000,000,000,000,000,000 | 15 | The generation of the configuration file jas_config.h has been completely
reworked in order to avoid pollution of the global namespace.
Some problematic types like uchar, ulong, and friends have been replaced
with names with a jas_ prefix.
An option max_samples has been added to the BMP and JPEG decoders to
restrict ... |
template<typename tp, typename tf, typename tc, typename to>
CImg<T>& draw_object3d(const float x0, const float y0, const float z0,
const CImg<tp>& vertices, const CImgList<tf>& primitives,
const CImgList<tc>& colors, const CImgList<to>& opacities,
... | 0 | [
"CWE-119",
"CWE-787"
] | CImg | ac8003393569aba51048c9d67e1491559877b1d1 | 217,234,297,487,258,420,000,000,000,000,000,000,000 | 12 | . |
*/
YY_BUFFER_STATE re_yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
char *buf;
yy_size_t n;
yy_size_t i;
/* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2;
buf = (char *) re_yyalloc(n ,yyscanner );
if ( !... | 0 | [
"CWE-476",
"CWE-703",
"CWE-125"
] | yara | 3119b232c9c453c98d8fa8b6ae4e37ba18117cd4 | 217,520,872,645,415,940,000,000,000,000,000,000,000 | 29 | re_lexer: Make reading escape sequences more robust (#586)
* Add test for issue #503
* re_lexer: Make reading escape sequences more robust
This commit fixes parsing incomplete escape sequences at the end of a
regular expression and parsing things like \xxy (invalid hex digits)
which before were silently turned... |
static int hns_xgmac_get_sset_count(int stringset)
{
if (stringset == ETH_SS_STATS)
return ARRAY_SIZE(g_xgmac_stats_string);
return 0;
} | 1 | [
"CWE-119",
"CWE-703"
] | linux | 412b65d15a7f8a93794653968308fc100f2aa87c | 73,638,552,327,055,930,000,000,000,000,000,000,000 | 7 | net: hns: fix ethtool_get_strings overflow in hns driver
hns_get_sset_count() returns HNS_NET_STATS_CNT and the data space allocated
is not enough for ethtool_get_strings(), which will cause random memory
corruption.
When SLAB and DEBUG_SLAB are both enabled, memory corruptions like the
the following can be observed ... |
BOOL security_establish_keys(const BYTE* client_random, rdpRdp* rdp)
{
BYTE pre_master_secret[48];
BYTE master_secret[48];
BYTE session_key_blob[48];
BYTE* server_random;
BYTE salt40[] = { 0xD1, 0x26, 0x9E };
rdpSettings* settings;
settings = rdp->settings;
server_random = settings->ServerRandom;
if (setting... | 0 | [
"CWE-476"
] | FreeRDP | 7d58aac24fe20ffaad7bd9b40c9ddf457c1b06e7 | 176,253,082,306,089,570,000,000,000,000,000,000,000 | 89 | security: add a NULL pointer check to fix a server crash. |
static int vb2_queue_or_prepare_buf(struct vb2_queue *q, struct v4l2_buffer *b,
const char *opname)
{
if (b->type != q->type) {
dprintk(1, "%s: invalid buffer type\n", opname);
return -EINVAL;
}
if (b->index >= q->num_buffers) {
dprintk(1, "%s: buffer index out of range\n", opname);
return -EINVAL;
... | 0 | [
"CWE-119",
"CWE-787"
] | linux | 2c1f6951a8a82e6de0d82b1158b5e493fc6c54ab | 27,054,482,176,992,300,000,000,000,000,000,000,000 | 26 | [media] videobuf2-v4l2: Verify planes array in buffer dequeueing
When a buffer is being dequeued using VIDIOC_DQBUF IOCTL, the exact buffer
which will be dequeued is not known until the buffer has been removed from
the queue. The number of planes is specific to a buffer, not to the queue.
This does lead to the situat... |
TEST_F(HttpConnectionManagerImplTest, PreserveUpstreamDateDisabledDateFromCache) {
TestScopedRuntime scoped_runtime;
Runtime::LoaderSingleton::getExisting()->mergeValues(
{{"envoy.reloadable_features.preserve_upstream_date", "false"}});
setup(false, "");
setUpEncoderAndDecoder(false, false);
sendRequest... | 0 | [
"CWE-400"
] | envoy | 0e49a495826ea9e29134c1bd54fdeb31a034f40c | 263,677,781,517,299,030,000,000,000,000,000,000,000 | 17 | http/2: add stats and stream flush timeout (#139)
This commit adds a new stream flush timeout to guard against a
remote server that does not open window once an entire stream has
been buffered for flushing. Additional stats have also been added
to better understand the codecs view of active streams as well as
amount o... |
bool blockUpdate(uint64_t new_hash) { return new_hash == hash_ || !added_via_api_; } | 0 | [
"CWE-400"
] | envoy | dfddb529e914d794ac552e906b13d71233609bf7 | 180,716,082,138,349,970,000,000,000,000,000,000,000 | 1 | listener: Add configurable accepted connection limits (#153)
Add support for per-listener limits on accepted connections.
Signed-off-by: Tony Allen <tony@allen.gg> |
GC_API void GC_CALL GC_set_non_gc_bytes(GC_word value)
{
GC_non_gc_bytes = value;
} | 0 | [
"CWE-119"
] | bdwgc | 7292c02fac2066d39dd1bcc37d1a7054fd1e32ee | 92,495,828,618,853,640,000,000,000,000,000,000,000 | 4 | Fix malloc routines to prevent size value wrap-around
See issue #135 on Github.
* allchblk.c (GC_allochblk, GC_allochblk_nth): Use
OBJ_SZ_TO_BLOCKS_CHECKED instead of OBJ_SZ_TO_BLOCKS.
* malloc.c (GC_alloc_large): Likewise.
* alloc.c (GC_expand_hp_inner): Type of "bytes" local variable changed
from word to size_t; ca... |
flatpak_run_setup_base_argv (FlatpakBwrap *bwrap,
GFile *runtime_files,
GFile *app_id_dir,
const char *arch,
FlatpakRunFlags flags,
GError **err... | 0 | [
"CWE-20"
] | flatpak | a9107feeb4b8275b78965b36bf21b92d5724699e | 262,096,608,970,939,220,000,000,000,000,000,000,000 | 179 | run: Only compare the lowest 32 ioctl arg bits for TIOCSTI
Closes #2782.
Closes: #2783
Approved by: alexlarsson |
ignorecase(char_u *pat)
{
return ignorecase_opt(pat, p_ic, p_scs);
} | 0 | [
"CWE-416"
] | vim | 409510c588b1eec1ae33511ae97a21eb8e110895 | 127,843,526,383,762,960,000,000,000,000,000,000,000 | 4 | patch 8.2.5050: using freed memory when searching for pattern in path
Problem: Using freed memory when searching for pattern in path.
Solution: Make a copy of the line. |
xmlParseAttValueInternal(xmlParserCtxtPtr ctxt, int *len, int *alloc,
int normalize)
{
xmlChar limit = 0;
const xmlChar *in = NULL, *start, *end, *last;
xmlChar *ret = NULL;
GROW;
in = (xmlChar *) CUR_PTR;
if (*in != '"' && *in != '\'') {
xmlFatalErr(ctxt, XML_E... | 0 | [
"CWE-119"
] | libxml2 | 23f05e0c33987d6605387b300c4be5da2120a7ab | 243,063,900,347,320,660,000,000,000,000,000,000,000 | 166 | Detect excessive entities expansion upon replacement
If entities expansion in the XML parser is asked for,
it is possble to craft relatively small input document leading
to excessive on-the-fly content generation.
This patch accounts for those replacement and stop parsing
after a given threshold. it can be bypassed as... |
bool create_table_precheck(THD *thd, TABLE_LIST *tables,
TABLE_LIST *create_table)
{
LEX *lex= thd->lex;
SELECT_LEX *select_lex= lex->first_select_lex();
ulong want_priv;
bool error= TRUE; // Error message is given
DBUG_ENTER("create_table_precheck");... | 0 | [
"CWE-703"
] | server | 39feab3cd31b5414aa9b428eaba915c251ac34a2 | 114,090,008,306,630,640,000,000,000,000,000,000,000 | 96 | MDEV-26412 Server crash in Item_field::fix_outer_field for INSERT SELECT
IF an INSERT/REPLACE SELECT statement contained an ON expression in the top
level select and this expression used a subquery with a column reference
that could not be resolved then an attempt to resolve this reference as
an outer reference caused... |
static int ext4_ext_split(handle_t *handle, struct inode *inode,
struct ext4_ext_path *path,
struct ext4_extent *newext, int at)
{
struct buffer_head *bh = NULL;
int depth = ext_depth(inode);
struct ext4_extent_header *neh;
struct ext4_extent_idx *fidx;
struct ext4_extent *ex;
int i = at, k, m, a;
ext4_f... | 0 | [
"CWE-703"
] | linux | 744692dc059845b2a3022119871846e74d4f6e11 | 308,699,816,166,535,300,000,000,000,000,000,000,000 | 231 | ext4: use ext4_get_block_write in buffer write
Allocate uninitialized extent before ext4 buffer write and
convert the extent to initialized after io completes.
The purpose is to make sure an extent can only be marked
initialized after it has been written with new data so
we can safely drop the i_mutex lock in ext4 DIO... |
bool CModules::OnPrivBufferEnding(CQuery& Query, CClient& Client) {
MODHALTCHK(OnPrivBufferEnding(Query, Client));
} | 0 | [
"CWE-20",
"CWE-264"
] | znc | 8de9e376ce531fe7f3c8b0aa4876d15b479b7311 | 639,445,333,429,112,400,000,000,000,000,000,000 | 3 | 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 |
const CString& CUser::GetClientEncoding() const { return m_sClientEncoding; } | 0 | [
"CWE-20"
] | znc | 64613bc8b6b4adf1e32231f9844d99cd512b8973 | 126,558,536,779,213,670,000,000,000,000,000,000,000 | 1 | Don't crash if user specified invalid encoding.
This is CVE-2019-9917 |
void gfs2_rsqa_delete(struct gfs2_inode *ip, atomic_t *wcount)
{
down_write(&ip->i_rw_mutex);
if ((wcount == NULL) || (atomic_read(wcount) <= 1)) {
gfs2_rs_deltree(&ip->i_res);
BUG_ON(ip->i_res.rs_free);
}
up_write(&ip->i_rw_mutex);
gfs2_qa_delete(ip, wcount);
} | 0 | [
"CWE-416"
] | linux | 36e4ad0316c017d5b271378ed9a1c9a4b77fab5f | 78,708,342,266,868,480,000,000,000,000,000,000,000 | 10 | GFS2: don't set rgrp gl_object until it's inserted into rgrp tree
Before this patch, function read_rindex_entry would set a rgrp
glock's gl_object pointer to itself before inserting the rgrp into
the rgrp rbtree. The problem is: if another process was also reading
the rgrp in, and had already inserted its newly create... |
find_all_exitpolicy(smartlist_t *s)
{
smartlist_t *out = smartlist_new();
SMARTLIST_FOREACH(s, directory_token_t *, t,
if (t->tp == K_ACCEPT || t->tp == K_ACCEPT6 ||
t->tp == K_REJECT || t->tp == K_REJECT6)
smartlist_add(out,t));
return out;
} | 0 | [
"CWE-119"
] | tor | d978216dea6b21ac38230a59d172139185a68dbd | 24,111,335,253,346,300,000,000,000,000,000,000,000 | 9 | Fix parsing bug with unecognized token at EOS
In get_token(), we could read one byte past the end of the
region. This is only a big problem in the case where the region
itself is (a) potentially hostile, and (b) not explicitly
nul-terminated.
This patch fixes the underlying bug, and also makes sure that the
one remai... |
int write_file(const unsigned char *buffer, const size_t len, const char *path) {
errno = 0;
FILE *file = fopen(path, "wb");
if (file == NULL) {
int errsv = errno;
printf("Could not open file for writing: %s (%s)\n", path, strerror(errsv));
return ERROR;
}
size_t n = fwrite(b... | 0 | [
"CWE-476"
] | libmobi | c0699c8693c47f14a2e57dec7292e862ac7adf9c | 293,635,329,639,745,030,000,000,000,000,000,000,000 | 18 | Fix undefined behavior when passing null to strdup |
static void await_references(H264Context *h)
{
const int mb_xy = h->mb_xy;
const int mb_type = h->cur_pic.mb_type[mb_xy];
int refs[2][48];
int nrefs[2] = { 0 };
int ref, list;
memset(refs, -1, sizeof(refs));
if (IS_16X16(mb_type)) {
get_lowest_part_y(h, refs, 0, 16, 0,
... | 0 | [
"CWE-787"
] | FFmpeg | 1f097d168d9cad473dd44010a337c1413a9cd198 | 96,361,727,733,446,200,000,000,000,000,000,000,000 | 107 | h264: reset data partitioning at the beginning of each decode call
Prevents using GetBitContexts with data from previous calls.
Fixes access to freed memory.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org |
free_blob_cache_entry (gpointer key, gpointer val, gpointer user_data)
{
g_free (key);
} | 0 | [
"CWE-20"
] | mono | 4905ef1130feb26c3150b28b97e4a96752e0d399 | 314,470,223,290,190,070,000,000,000,000,000,000,000 | 4 | Handle invalid instantiation of generic methods.
* verify.c: Add new function to internal verifier API to check
method instantiations.
* reflection.c (mono_reflection_bind_generic_method_parameters):
Check the instantiation before returning it.
Fixes #655847 |
static void bond_fill_ifbond(struct bonding *bond, struct ifbond *info)
{
info->bond_mode = BOND_MODE(bond);
info->miimon = bond->params.miimon;
info->num_slaves = bond->slave_cnt;
} | 0 | [
"CWE-476",
"CWE-703"
] | linux | 105cd17a866017b45f3c45901b394c711c97bf40 | 26,175,769,011,410,480,000,000,000,000,000,000,000 | 6 | bonding: fix null dereference in bond_ipsec_add_sa()
If bond doesn't have real device, bond->curr_active_slave is null.
But bond_ipsec_add_sa() dereferences bond->curr_active_slave without
null checking.
So, null-ptr-deref would occur.
Test commands:
ip link add bond0 type bond
ip link set bond0 up
ip x s... |
void Field::set_warning_truncated_wrong_value(const char *type_arg,
const char *value)
{
THD *thd= get_thd();
const char *db_name;
const char *table_name;
/*
table has in the past been 0 in case of wrong calls when processing
statistics tables. Let's protect... | 0 | [
"CWE-120"
] | server | eca207c46293bc72dd8d0d5622153fab4d3fccf1 | 96,933,973,808,317,230,000,000,000,000,000,000,000 | 24 | MDEV-25317 Assertion `scale <= precision' failed in decimal_bin_size And Assertion `scale >= 0 && precision > 0 && scale <= precision' failed in decimal_bin_size_inline/decimal_bin_size.
Precision should be kept below DECIMAL_MAX_SCALE for computations.
It can be bigger in Item_decimal. I'd fix this too but it changes... |
Return new DateTimeZone object relative to give DateTime
*/
PHP_FUNCTION(date_timezone_get)
{
zval *object;
php_date_obj *dateobj;
php_timezone_obj *tzobj;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, date_ce_interface) == FAILURE) {
RETURN_FALSE;
}
da... | 0 | [] | php-src | bb057498f7457e8b2eba98332a3bad434de4cf12 | 319,900,352,772,762,400,000,000,000,000,000,000,000 | 19 | Fix #70277: new DateTimeZone($foo) is ignoring text after null byte
The DateTimeZone constructors are not binary safe. They're parsing the timezone
as string, but discard the length when calling timezone_initialize(). This
patch adds a tz_len parameter and a respective check to timezone_initialize(). |
static int io_msg_ring(struct io_kiocb *req, unsigned int issue_flags)
{
struct io_ring_ctx *target_ctx;
struct io_msg *msg = &req->msg;
bool filled;
int ret;
ret = -EBADFD;
if (req->file->f_op != &io_uring_fops)
goto done;
ret = -EOVERFLOW;
target_ctx = req->file->private_data;
spin_lock(&target_ctx->com... | 0 | [
"CWE-416"
] | linux | 9cae36a094e7e9d6e5fe8b6dcd4642138b3eb0c7 | 249,700,625,331,703,460,000,000,000,000,000,000,000 | 33 | io_uring: reinstate the inflight tracking
After some debugging, it was realized that we really do still need the
old inflight tracking for any file type that has io_uring_fops assigned.
If we don't, then trivial circular references will mean that we never get
the ctx cleaned up and hence it'll leak.
Just bring back t... |
ArgJoin(It first, It last, const BasicCStringRef<Char>& sep) :
first(first),
last(last),
sep(sep) {} | 0 | [
"CWE-134",
"CWE-119",
"CWE-787"
] | fmt | 8cf30aa2be256eba07bb1cefb998c52326e846e7 | 147,693,076,008,783,660,000,000,000,000,000,000,000 | 4 | Fix segfault on complex pointer formatting (#642) |
static void aesni_xts_enc(void *ctx, u128 *dst, const u128 *src, le128 *iv)
{
glue_xts_crypt_128bit_one(ctx, dst, src, iv, GLUE_FUNC_CAST(aesni_enc));
} | 0 | [
"CWE-119",
"CWE-787"
] | linux | ccfe8c3f7e52ae83155cb038753f4c75b774ca8a | 292,634,732,950,122,540,000,000,000,000,000,000,000 | 4 | crypto: aesni - fix memory usage in GCM decryption
The kernel crypto API logic requires the caller to provide the
length of (ciphertext || authentication tag) as cryptlen for the
AEAD decryption operation. Thus, the cipher implementation must
calculate the size of the plaintext output itself and cannot simply use
cryp... |
static int nsv_read_chunk(AVFormatContext *s, int fill_header)
{
NSVContext *nsv = s->priv_data;
AVIOContext *pb = s->pb;
AVStream *st[2] = {NULL, NULL};
NSVStream *nst;
AVPacket *pkt;
int i, err = 0;
uint8_t auxcount; /* number of aux metadata, also 4 bits of vsize */
uint32_t vsize;
... | 0 | [
"CWE-476",
"CWE-787"
] | libav | fe6eea99efac66839052af547426518efd970b24 | 113,981,555,857,160,810,000,000,000,000,000,000,000 | 127 | nsvdec: don't ignore the return value of av_get_packet()
Fixes invalid reads with corrupted files.
CC: libav-stable@libav.org
Bug-Id: 1039 |
Column_definition()
:Type_handler_hybrid_field_type(&type_handler_null),
compression_method_ptr(0),
comment(null_clex_str),
on_update(NULL), length(0), invisible(VISIBLE), char_length(0),
decimals(0),
flags(0), pack_length(0), key_length(0), unireg_check(Field::NONE),
interval(0), charset(&... | 0 | [
"CWE-416",
"CWE-703"
] | server | 08c7ab404f69d9c4ca6ca7a9cf7eec74c804f917 | 179,722,140,887,297,200,000,000,000,000,000,000,000 | 15 | 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... |
dissect_kafka_string(proto_tree *tree, int hf_item, tvbuff_t *tvb, packet_info *pinfo, int offset, int flexible,
int *p_offset, int *p_length)
{
if (flexible) {
return dissect_kafka_compact_string(tree, hf_item, tvb, pinfo, offset, p_offset, p_length);
} else {
retur... | 0 | [
"CWE-401"
] | wireshark | f4374967bbf9c12746b8ec3cd54dddada9dd353e | 12,761,129,040,424,342,000,000,000,000,000,000,000 | 9 | Kafka: Limit our decompression size.
Don't assume that the Internet has our best interests at heart when it
gives us the size of our decompression buffer. Assign an arbitrary limit
of 50 MB.
This fixes #16739 in that it takes care of
** (process:17681): WARNING **: 20:03:07.440: Dissector bug, protocol Kafka, in pac... |
static int xfrm_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *xt,
struct xfrm_policy *xp)
{
struct net *net = xs_net(x);
struct sk_buff *skb;
int err;
skb = nlmsg_new(xfrm_acquire_msgsize(x, xp), GFP_ATOMIC);
if (skb == NULL)
return -ENOMEM;
err = build_acquire(skb, x, xt, xp);
BUG_ON(err < 0)... | 0 | [
"CWE-125"
] | linux | b805d78d300bcf2c83d6df7da0c818b0fee41427 | 161,497,809,350,998,950,000,000,000,000,000,000,000 | 16 | xfrm: policy: Fix out-of-bound array accesses in __xfrm_policy_unlink
UBSAN report this:
UBSAN: Undefined behaviour in net/xfrm/xfrm_policy.c:1289:24
index 6 is out of range for type 'unsigned int [6]'
CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.4.162-514.55.6.9.x86_64+ #13
Hardware name: QEMU Standard PC (i440FX + P... |
uint32_t writeString(const folly::fbstring& str) {
T_VIRTUAL_CALL();
return writeString_virt(str.toStdString());
} | 0 | [
"CWE-20",
"CWE-755"
] | fbthrift | 01686e15ec77ccb4d49a77d5bce3a01601e54d64 | 262,396,311,004,180,300,000,000,000,000,000,000,000 | 4 | Throw on skipping an invalid type.
Summary:
Certain values (e.g.) T_STOP should not appear as a skip type. Allowing them to
can cause thrift to loop unboundedly.
Reviewed By: spalamarchuk
Differential Revision: D15102451
fbshipit-source-id: c08d52f44f37e9c212d3480233ac217105586c9f |
ico_load_thumbnail_image (const gchar *filename,
gint *width,
gint *height,
GError **error)
{
FILE *fp;
IcoLoadInfo *info;
gint32 image;
gint w = 0;
gint h = 0;
gint ... | 0 | [] | gimp | 323ecb73f7bf36788fb7066eb2d6678830cd5de7 | 289,707,953,160,802,770,000,000,000,000,000,000,000 | 86 | Bug 773233 - CVE-2007-3126 - Gimp 2.3.14 allows context-dependent attackers...
...to cause a denial of service (crash) via an ICO file with an
InfoHeader containing a Height of zero
Add some error handling to ico-load.c and bail out on zero width or height
icons. Also some formatting cleanup.
(cherry picked from com... |
static bool usbredir_stream_needed(void *priv)
{
struct endp_data *endp = priv;
return endp->max_streams;
} | 0 | [
"CWE-770"
] | qemu | 7ec54f9eb62b5d177e30eb8b1cad795a5f8d8986 | 137,403,349,456,598,620,000,000,000,000,000,000,000 | 6 | usb/redir: avoid dynamic stack allocation (CVE-2021-3527)
Use autofree heap allocation instead.
Fixes: 4f4321c11ff ("usb: use iovecs in USBPacket")
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id:... |
static void new_settings_callback(uint16_t index, uint16_t length,
const void *param, void *user_data)
{
struct btd_adapter *adapter = user_data;
uint32_t settings;
if (length < sizeof(settings)) {
btd_error(adapter->dev_id,
"Wrong size of new settings parameters");
return;
}
settings = get_le32(par... | 0 | [
"CWE-862",
"CWE-863"
] | bluez | b497b5942a8beb8f89ca1c359c54ad67ec843055 | 300,814,943,451,564,800,000,000,000,000,000,000,000 | 21 | adapter: Fix storing discoverable setting
discoverable setting shall only be store when changed via Discoverable
property and not when discovery client set it as that be considered
temporary just for the lifetime of the discovery. |
static int run_selfcheck(struct cli_all_bc *bcs)
{
struct cli_bc_ctx *ctx;
struct cli_bc *bc = &bcs->all_bcs[bcs->count-1];
int rc;
if (bc->state != bc_jit && bc->state != bc_interp) {
cli_errmsg("Failed to prepare selfcheck bytecode\n");
return CL_EBYTECODE;
}
ctx = cli_bytecode_context_alloc... | 0 | [
"CWE-189"
] | clamav-devel | 3d664817f6ef833a17414a4ecea42004c35cc42f | 1,184,167,683,082,139,000,000,000,000,000,000,000 | 28 | fix recursion level crash (bb #3706).
Thanks to Stephane Chazelas for the analysis. |
static void FVMenuVKernByClasses(GWindow gw, struct gmenuitem *UNUSED(mi), GEvent *UNUSED(e)) {
FontView *fv = (FontView *) GDrawGetUserData(gw);
ShowKernClasses(fv->b.sf,NULL,fv->b.active_layer,true);
} | 0 | [
"CWE-119",
"CWE-787"
] | fontforge | 626f751752875a0ddd74b9e217b6f4828713573c | 163,698,073,563,091,210,000,000,000,000,000,000,000 | 5 | Warn users before discarding their unsaved scripts (#3852)
* Warn users before discarding their unsaved scripts
This closes #3846. |
void RtmpProtocol::sendUserControl(uint16_t event_type, uint32_t event_data) {
std::string control;
event_type = htons(event_type);
control.append((char *) &event_type, 2);
event_data = htonl(event_data);
control.append((char *) &event_data, 4);
sendRequest(MSG_USER_CONTROL, control);
} | 0 | [
"CWE-703"
] | ZLMediaKit | 7d8b212a3c3368bc2f6507cb74664fc419eb9327 | 257,801,422,638,921,950,000,000,000,000,000,000,000 | 9 | 修复rtmp汇报窗口太小导致循环递归的bug:#1839 |
gimp_channel_set_color (GimpChannel *channel,
const GimpRGB *color,
gboolean push_undo)
{
g_return_if_fail (GIMP_IS_CHANNEL (channel));
g_return_if_fail (color != NULL);
if (gimp_rgba_distance (&channel->color, color) > RGBA_EPSILON)
{
if (push_un... | 0 | [
"CWE-703"
] | gimp | 6ab90ecbbd7cc95901933f62227fd140c0576d55 | 71,103,194,486,635,240,000,000,000,000,000,000,000 | 30 | app: fix #8230 crash in gimp_layer_invalidate_boundary when channel is NULL
gimp_channel_is_empty returns FALSE if channel is NULL. This causes
gimp_layer_invalidate_boundary to crash if the mask channel is NULL.
With a NULL channel gimp_channel_is_empty should return TRUE, just like
the similar gimp_image_is_empty d... |
void button_free(Button *b) {
assert(b);
hashmap_remove(b->manager->buttons, b->name);
sd_event_source_unref(b->io_event_source);
sd_event_source_unref(b->check_event_source);
if (b->fd >= 0)
/* If the device has been unplugged close() returns
... | 0 | [
"CWE-772",
"CWE-401"
] | systemd | b2774a3ae692113e1f47a336a6c09bac9cfb49ad | 117,670,067,258,807,030,000,000,000,000,000,000,000 | 18 | bus_open leak sd_event_source when udevadm trigger。
On my host, when executing the udevadm trigger, I only receive the change event, which causes memleak |
static void SFS_AddInt(ScriptParser *parser, s32 val)
{
char msg[500];
sprintf(msg, "%d", val);
SFS_AddString(parser, msg);
} | 0 | [
"CWE-476"
] | gpac | 4e7736d7ec7bf64026daa611da951993bb42fdaf | 76,858,187,917,130,410,000,000,000,000,000,000,000 | 6 | fixed #2238 |
void php_gd_error_ex(int type, const char *format, ...)
{
va_list args;
TSRMLS_FETCH();
va_start(args, format);
php_verror(NULL, "", type, format, args TSRMLS_CC);
va_end(args);
} | 0 | [
"CWE-119"
] | php-src | e7f2356665c2569191a946b6fc35b437f0ae1384 | 150,599,968,052,180,520,000,000,000,000,000,000,000 | 10 | Fix #66387: Stack overflow with imagefilltoborder
The stack overflow is caused by the recursive algorithm in combination with a
very large negative coordinate passed to gdImageFillToBorder(). As there is
already a clipping for large positive coordinates to the width and height of
the image, it seems to be consequent t... |
proto_reg_handoff_usb_hid(void)
{
dissector_handle_t usb_hid_control_handle, usb_hid_interrupt_handle, usb_hid_descr_handle;
usb_hid_control_handle = create_dissector_handle(dissect_usb_hid_control, proto_usb_hid);
dissector_add_uint("usb.control", IF_CLASS_HID, usb_hid_control_handle);
dissector_add_f... | 0 | [] | wireshark | 0ceb46e1c28d1094a56aefa0ebf7d7c0e00f8849 | 56,144,258,670,111,970,000,000,000,000,000,000,000 | 14 | proto: add support for FT_BYTES in proto_tree_add_bits
Change-Id: I5030d550bd760953ac84c2700bb0e03cc7a831a1
Signed-off-by: Filipe Laíns <lains@archlinux.org> |
bool SELECT_LEX::vers_push_field(THD *thd, TABLE_LIST *table,
const LEX_CSTRING field_name)
{
DBUG_ASSERT(field_name.str);
Item_field *fld= new (thd->mem_root) Item_field(thd, &context,
table->db.str,
... | 0 | [
"CWE-703"
] | server | 39feab3cd31b5414aa9b428eaba915c251ac34a2 | 205,442,609,022,782,960,000,000,000,000,000,000,000 | 22 | MDEV-26412 Server crash in Item_field::fix_outer_field for INSERT SELECT
IF an INSERT/REPLACE SELECT statement contained an ON expression in the top
level select and this expression used a subquery with a column reference
that could not be resolved then an attempt to resolve this reference as
an outer reference caused... |
void hsr_prune_nodes(struct timer_list *t)
{
struct hsr_priv *hsr = from_timer(hsr, t, prune_timer);
struct hsr_node *node;
struct hsr_port *port;
unsigned long timestamp;
unsigned long time_a, time_b;
rcu_read_lock();
list_for_each_entry_rcu(node, &hsr->node_db, mac_list) {
/* Shorthand */
time_a = node->t... | 0 | [
"CWE-772",
"CWE-269",
"CWE-401"
] | linux | 6caabe7f197d3466d238f70915d65301f1716626 | 136,305,284,466,462,560,000,000,000,000,000,000,000 | 51 | net: hsr: fix memory leak in hsr_dev_finalize()
If hsr_add_port(hsr, hsr_dev, HSR_PT_MASTER) failed to
add port, it directly returns res and forgets to free the node
that allocated in hsr_create_self_node(), and forgets to delete
the node->mac_list linked in hsr->self_node_db.
BUG: memory leak
unreferenced object 0xf... |
PointGFp EC_Group::OS2ECP(const uint8_t bits[], size_t len) const
{
return Botan::OS2ECP(bits, len, data().curve());
} | 0 | [
"CWE-200"
] | botan | 48fc8df51d99f9d8ba251219367b3d629cc848e3 | 253,709,406,944,502,260,000,000,000,000,000,000,000 | 4 | Address DSA/ECDSA side channel |
int test_rshift(BIO *bp, BN_CTX *ctx)
{
BIGNUM *a, *b, *c, *d, *e;
int i;
a = BN_new();
b = BN_new();
c = BN_new();
d = BN_new();
e = BN_new();
BN_one(c);
BN_bntest_rand(a, 200, 0, 0);
a->neg = rand_neg();
for (i = 0; i < num0; i++) {
BN_rshift(b, a, i + 1);
... | 0 | [
"CWE-200"
] | openssl | d73cc256c8e256c32ed959456101b73ba9842f72 | 28,367,872,916,313,968,000,000,000,000,000,000,000 | 41 | bn/asm/x86_64-mont5.pl: fix carry propagating bug (CVE-2015-3193).
Reviewed-by: Richard Levitte <levitte@openssl.org>
(cherry picked from commit e7c078db57908cbf16074c68034977565ffaf107) |
static void convert_pseudo_ld_imm64(struct bpf_verifier_env *env)
{
struct bpf_insn *insn = env->prog->insnsi;
int insn_cnt = env->prog->len;
int i;
for (i = 0; i < insn_cnt; i++, insn++) {
if (insn->code != (BPF_LD | BPF_IMM | BPF_DW))
continue;
if (insn->src_reg == BPF_PSEUDO_FUNC)
continue;
insn->sr... | 0 | [
"CWE-125"
] | bpf | 049c4e13714ecbca567b4d5f6d563f05d431c80e | 4,894,000,502,013,385,000,000,000,000,000,000,000 | 14 | bpf: Fix alu32 const subreg bound tracking on bitwise operations
Fix a bug in the verifier's scalar32_min_max_*() functions which leads to
incorrect tracking of 32 bit bounds for the simulation of and/or/xor bitops.
When both the src & dst subreg is a known constant, then the assumption is
that scalar_min_max_*() will... |
void stsg_box_del(GF_Box *s)
{
GF_SubTrackSampleGroupBox *ptr = (GF_SubTrackSampleGroupBox *)s;
if (ptr == NULL) return;
if (ptr->group_description_index) gf_free(ptr->group_description_index);
gf_free(ptr);
} | 0 | [
"CWE-787"
] | gpac | 77510778516803b7f7402d7423c6d6bef50254c3 | 204,823,999,280,965,380,000,000,000,000,000,000,000 | 7 | fixed #2255 |
int usb_unlocked_disable_lpm(struct usb_device *udev)
{
struct usb_hcd *hcd = bus_to_hcd(udev->bus);
int ret;
if (!hcd)
return -EINVAL;
mutex_lock(hcd->bandwidth_mutex);
ret = usb_disable_lpm(udev);
mutex_unlock(hcd->bandwidth_mutex);
return ret;
} | 0 | [
"CWE-703"
] | linux | e50293ef9775c5f1cf3fcc093037dd6a8c5684ea | 297,905,541,136,482,770,000,000,000,000,000,000,000 | 14 | USB: fix invalid memory access in hub_activate()
Commit 8520f38099cc ("USB: change hub initialization sleeps to
delayed_work") changed the hub_activate() routine to make part of it
run in a workqueue. However, the commit failed to take a reference to
the usb_hub structure or to lock the hub interface while doing so. ... |
static void free_trace_buffers(struct trace_array *tr)
{
if (!tr)
return;
free_trace_buffer(&tr->trace_buffer);
#ifdef CONFIG_TRACER_MAX_TRACE
free_trace_buffer(&tr->max_buffer);
#endif
} | 0 | [
"CWE-415"
] | linux | 4397f04575c44e1440ec2e49b6302785c95fd2f8 | 271,510,224,927,644,100,000,000,000,000,000,000,000 | 11 | 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... |
gst_rmdemux_reset (GstRMDemux * rmdemux)
{
GSList *cur;
GST_OBJECT_LOCK (rmdemux);
rmdemux->running = FALSE;
GST_OBJECT_UNLOCK (rmdemux);
for (cur = rmdemux->streams; cur; cur = cur->next) {
GstRMDemuxStream *stream = cur->data;
gst_flow_combiner_remove_pad (rmdemux->flowcombiner, stream->pad);
... | 0 | [] | gst-plugins-ugly | 9726aaf78e6643a5955864f444852423de58de29 | 315,001,329,330,010,050,000,000,000,000,000,000,000 | 37 | rmdemux: Make sure we have enough data available when parsing audio/video packets
Otherwise there will be out-of-bounds reads and potential crashes.
Thanks to Natalie Silvanovich for reporting.
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-ugly/-/issues/37
Part-of: <https://gitlab.freedesktop.org/gstre... |
MagickExport MagickBooleanType GetImageAlphaChannel(const Image *image)
{
assert(image != (const Image *) NULL);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
assert(image->signature == MagickCoreSignature);
return(image->alpha_trait != UndefinedPixelTrait ? Mag... | 0 | [
"CWE-416"
] | ImageMagick | a47e7a994766b92b10d4a87df8c1c890c8b170f3 | 65,964,591,979,164,930,000,000,000,000,000,000,000 | 8 | https://github.com/ImageMagick/ImageMagick/issues/1724 |
void perform_http_redirect(struct session *s, struct stream_interface *si)
{
struct http_txn *txn;
struct chunk rdr;
char *path;
int len;
/* 1: create the response header */
rdr.len = strlen(HTTP_302);
rdr.str = trash;
rdr.size = trashlen;
memcpy(rdr.str, HTTP_302, rdr.len);
/* 2: add the server's prefix */... | 0 | [] | haproxy-1.4 | dc80672211e085c211f1fc47e15cfe57ab587d38 | 121,326,177,908,303,560,000,000,000,000,000,000,000 | 57 | BUG/CRITICAL: using HTTP information in tcp-request content may crash the process
During normal HTTP request processing, request buffers are realigned if
there are less than global.maxrewrite bytes available after them, in
order to leave enough room for rewriting headers after the request. This
is done in http_wait_fo... |
ExecutionStatus Interpreter::casePutOwnGetterSetterByVal(
Runtime *runtime,
PinnedHermesValue *frameRegs,
const inst::Inst *ip) {
DefinePropertyFlags dpFlags{};
dpFlags.setConfigurable = 1;
dpFlags.configurable = 1;
dpFlags.setEnumerable = 1;
dpFlags.enumerable = ip->iPutOwnGetterSetterByVal.op5;
... | 0 | [
"CWE-670",
"CWE-703"
] | hermes | b2021df620824627f5a8c96615edbd1eb7fdddfc | 142,222,387,373,310,630,000,000,000,000,000,000,000 | 38 | Fix CVE-2020-1914 by using NEXTINST for SaveGeneratorLong
Summary:
If `SaveGeneratorLong` was emitted, it would accidentally jump to the
wrong next instruction, based on how long SaveGenerator was.
Make a callout function to handle the common case, and handle the dispatch
within each case of the interpreter loop.
Fi... |
yank_copy_line(struct block_def *bd, long y_idx, int exclude_trailing_space)
{
char_u *pnew;
if (exclude_trailing_space)
bd->endspaces = 0;
if ((pnew = alloc(bd->startspaces + bd->endspaces + bd->textlen + 1))
== NULL)
return FAIL;
y_current->y_array[y_idx] = pnew;
vim_memset(pnew, ... | 1 | [
"CWE-122",
"CWE-787"
] | vim | 44db8213d38c39877d2148eff6a72f4beccfb94e | 246,228,854,524,410,000,000,000,000,000,000,000,000 | 29 | patch 8.2.4219: reading before the start of the line
Problem: Reading before the start of the line.
Solution: Check boundary before trying to read the character. |
int get_state() {
return state;
} | 0 | [
"CWE-287",
"CWE-284"
] | ceph | 5ead97120e07054d80623dada90a5cc764c28468 | 227,092,019,728,170,680,000,000,000,000,000,000,000 | 3 | auth/cephx: add authorizer challenge
Allow the accepting side of a connection to reject an initial authorizer
with a random challenge. The connecting side then has to respond with an
updated authorizer proving they are able to decrypt the service's challenge
and that the new authorizer was produced for this specific ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.