func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
bool tr_variantGetBool(tr_variant const* v, bool* setme)
{
char const* str;
bool success = false;
if (tr_variantIsBool(v))
{
*setme = v->val.b;
success = true;
}
if (!success && tr_variantIsInt(v))
{
if (v->val.i == 0 || v->val.i == 1)
{
*setme =... | 0 | [
"CWE-416",
"CWE-284"
] | transmission | 2123adf8e5e1c2b48791f9d22fc8c747e974180e | 144,483,348,596,679,960,000,000,000,000,000,000,000 | 31 | CVE-2018-10756: Fix heap-use-after-free in tr_variantWalk
In libtransmission/variant.c, function tr_variantWalk, when the variant
stack is reallocated, a pointer to the previously allocated memory
region is kept. This address is later accessed (heap use-after-free)
while walking back down the stack, causing the applic... |
static void free_verifier_state(struct bpf_verifier_state *state,
bool free_self)
{
kfree(state->stack);
if (free_self)
kfree(state);
} | 0 | [
"CWE-20"
] | linux | c131187db2d3fa2f8bf32fdf4e9a4ef805168467 | 5,709,520,770,474,973,000,000,000,000,000,000,000 | 7 | bpf: fix branch pruning logic
when the verifier detects that register contains a runtime constant
and it's compared with another constant it will prune exploration
of the branch that is guaranteed not to be taken at runtime.
This is all correct, but malicious program may be constructed
in such a way that it always has... |
TEST_P(MessengerTest, MarkdownTest) {
Messenger *server_msgr2 = Messenger::create(g_ceph_context, string(GetParam()), entity_name_t::OSD(0), "server", getpid(), 0);
MarkdownDispatcher cli_dispatcher(false), srv_dispatcher(true);
entity_addr_t bind_addr;
bind_addr.parse("127.0.0.1:16800");
server_msgr->bind(bi... | 0 | [
"CWE-287",
"CWE-284"
] | ceph | 5ead97120e07054d80623dada90a5cc764c28468 | 283,421,476,751,815,730,000,000,000,000,000,000,000 | 49 | 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 ... |
static void ssdp_recv(int sd)
{
ssize_t len;
struct sockaddr sa;
socklen_t salen;
char buf[MAX_PKT_SIZE];
memset(buf, 0, sizeof(buf));
len = recvfrom(sd, buf, sizeof(buf), MSG_DONTWAIT, &sa, &salen);
if (len > 0) {
buf[len] = 0;
if (sa.sa_family != AF_INET)
return;
if (strstr(buf, "M-SEARCH *")) {
... | 1 | [
"CWE-119",
"CWE-787"
] | ssdp-responder | ce04b1f29a137198182f60bbb628d5ceb8171765 | 14,450,774,816,984,690,000,000,000,000,000,000,000 | 62 | Fix #1: Ensure recv buf is always NUL terminated
Signed-off-by: Joachim Nilsson <troglobit@gmail.com> |
void settings_timeout_cb(struct ev_loop *loop, ev_timer *w, int revents) {
int rv;
auto hd = static_cast<Http2Handler *>(w->data);
hd->terminate_session(NGHTTP2_SETTINGS_TIMEOUT);
rv = hd->on_write();
if (rv == -1) {
delete_handler(hd);
}
} | 0 | [] | nghttp2 | 95efb3e19d174354ca50c65d5d7227d92bcd60e1 | 283,561,098,939,952,400,000,000,000,000,000,000,000 | 9 | Don't read too greedily |
static int __init dccp_v6_init(void)
{
int err = proto_register(&dccp_v6_prot, 1);
if (err != 0)
goto out;
err = inet6_add_protocol(&dccp_v6_protocol, IPPROTO_DCCP);
if (err != 0)
goto out_unregister_proto;
inet6_register_protosw(&dccp_v6_protosw);
err = register_pernet_subsys(&dccp_v6_ops);
if (err != 0... | 0 | [
"CWE-362"
] | linux-2.6 | f6d8bd051c391c1c0458a30b2a7abcd939329259 | 195,544,776,969,125,270,000,000,000,000,000,000,000 | 26 | inet: add RCU protection to inet->opt
We lack proper synchronization to manipulate inet->opt ip_options
Problem is ip_make_skb() calls ip_setup_cork() and
ip_setup_cork() possibly makes a copy of ipc->opt (struct ip_options),
without any protection against another thread manipulating inet->opt.
Another thread can ch... |
static void __io_queue_proc(struct io_poll_iocb *poll, struct io_poll_table *pt,
struct wait_queue_head *head,
struct io_poll_iocb **poll_ptr)
{
struct io_kiocb *req = pt->req;
unsigned long wqe_private = (unsigned long) req;
/*
* The file being polled uses multiple waitqueues for poll handling
*... | 0 | [
"CWE-416"
] | linux | e677edbcabee849bfdd43f1602bccbecf736a646 | 333,816,140,379,420,960,000,000,000,000,000,000,000 | 50 | io_uring: fix race between timeout flush and removal
io_flush_timeouts() assumes the timeout isn't in progress of triggering
or being removed/canceled, so it unconditionally removes it from the
timeout list and attempts to cancel it.
Leave it on the list and let the normal timeout cancelation take care
of it.
Cc: st... |
static int cap_socket_getsockopt(struct socket *sock, int level, int optname)
{
return 0;
} | 0 | [] | linux-2.6 | ee18d64c1f632043a02e6f5ba5e045bb26a5465f | 256,291,037,299,185,460,000,000,000,000,000,000,000 | 4 | KEYS: Add a keyctl to install a process's session keyring on its parent [try #6]
Add a keyctl to install a process's session keyring onto its parent. This
replaces the parent's session keyring. Because the COW credential code does
not permit one process to change another process's credentials directly, the
change is... |
int mongo_env_read_socket( mongo *conn, void *buf, int len ) {
char *cbuf = buf;
while ( len ) {
int sent = recv( conn->sock, cbuf, len, 0 );
if ( sent == 0 || sent == -1 ) {
conn->err = MONGO_IO_ERROR;
return MONGO_ERROR;
}
cbuf += sent;
len -= se... | 1 | [
"CWE-190"
] | mongo-c-driver-legacy | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | 161,960,864,338,824,810,000,000,000,000,000,000,000 | 14 | don't mix up int and size_t (first pass to fix that) |
save_entry(ScanEnv* env, enum SaveType type, int* id)
{
int nid = env->save_num;
#if 0
if (IS_NULL(env->saves)) {
int n = 10;
env->saves = (SaveItem* )xmalloc(sizeof(SaveItem) * n);
CHECK_NULL_RETURN_MEMERR(env->saves);
env->save_alloc_num = n;
}
else if (env->save_alloc_num <= nid) {
int n... | 0 | [
"CWE-400",
"CWE-399",
"CWE-674"
] | oniguruma | 4097828d7cc87589864fecf452f2cd46c5f37180 | 73,655,995,157,747,150,000,000,000,000,000,000,000 | 26 | fix #147: Stack Exhaustion Problem caused by some parsing functions in regcomp.c making recursive calls to themselves. |
static void init_exp (expdesc *e, expkind k, int i) {
e->f = e->t = NO_JUMP;
e->k = k;
e->u.info = i;
} | 0 | [
"CWE-125"
] | lua | 1f3c6f4534c6411313361697d98d1145a1f030fa | 33,533,521,721,625,690,000,000,000,000,000,000,000 | 5 | Bug: Lua can generate wrong code when _ENV is <const> |
void *Type_NamedColor_Read(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, cmsUInt32Number* nItems, cmsUInt32Number SizeOfTag)
{
cmsUInt32Number vendorFlag; // Bottom 16 bits for ICC use
cmsUInt32Number count; // Count of named colors
cmsUInt32Number nDeviceCoords; // N... | 0 | [
"CWE-125"
] | Little-CMS | d41071eb8cfea7aa10a9262c12bd95d5d9d81c8f | 312,972,013,149,936,170,000,000,000,000,000,000,000 | 57 | Contributed fixes from Oracle
Two minor glitches |
target_count_create(struct iter_qstate* iq)
{
if(!iq->target_count) {
iq->target_count = (int*)calloc(3, sizeof(int));
/* if calloc fails we simply do not track this number */
if(iq->target_count)
iq->target_count[0] = 1;
}
} | 0 | [
"CWE-400"
] | unbound | ba0f382eee814e56900a535778d13206b86b6d49 | 122,706,504,176,267,000,000,000,000,000,000,000,000 | 9 | - CVE-2020-12662 Unbound can be tricked into amplifying an incoming
query into a large number of queries directed to a target.
- CVE-2020-12663 Malformed answers from upstream name servers can be
used to make Unbound unresponsive. |
//! Remove image pointed by iterator.
/**
\param iter Iterator pointing to the image to remove. | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 247,366,587,567,886,250,000,000,000,000,000,000,000 | 3 | Fix other issues in 'CImg<T>::load_bmp()'. |
static int proc_wepkey_open( struct inode *inode, struct file *file )
{
struct proc_data *data;
struct proc_dir_entry *dp = PDE(inode);
struct net_device *dev = dp->data;
struct airo_info *ai = dev->ml_priv;
char *ptr;
WepKeyRid wkr;
__le16 lastindex;
int j=0;
int rc;
if ((file->private_data = kzalloc(sizeof... | 0 | [
"CWE-703",
"CWE-264"
] | linux | 550fd08c2cebad61c548def135f67aba284c6162 | 254,786,341,416,221,900,000,000,000,000,000,000,000 | 48 | net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared
After the last patch, We are left in a state in which only drivers calling
ether_setup have IFF_TX_SKB_SHARING set (we assume that drivers touching real
hardware call ether_setup for their net_devices and don't hold any state in
their skbs. There... |
static int nested_vmx_check_nmi_controls(struct vmcs12 *vmcs12)
{
if (!nested_cpu_has_nmi_exiting(vmcs12) &&
nested_cpu_has_virtual_nmis(vmcs12))
return -EINVAL;
if (!nested_cpu_has_virtual_nmis(vmcs12) &&
nested_cpu_has(vmcs12, CPU_BASED_VIRTUAL_NMI_PENDING))
return -EINVAL;
return 0;
} | 0 | [
"CWE-284"
] | linux | 727ba748e110b4de50d142edca9d6a9b7e6111d8 | 145,848,769,365,446,730,000,000,000,000,000,000,000 | 12 | kvm: nVMX: Enforce cpl=0 for VMX instructions
VMX instructions executed inside a L1 VM will always trigger a VM exit
even when executed with cpl 3. This means we must perform the
privilege check in software.
Fixes: 70f3aac964ae("kvm: nVMX: Remove superfluous VMX instruction fault checks")
Cc: stable@vger.kernel.org
S... |
ec_deinit (void *opaque)
{
mpi_ec_t ctx = opaque;
int i;
_gcry_mpi_barrett_free (ctx->t.p_barrett);
/* Domain parameter. */
mpi_free (ctx->p);
mpi_free (ctx->a);
mpi_free (ctx->b);
_gcry_mpi_point_release (ctx->G);
mpi_free (ctx->n);
mpi_free (ctx->h);
/* The key. */
_gcry_mpi_point_release... | 0 | [
"CWE-200"
] | libgcrypt | 88e1358962e902ff1cbec8d53ba3eee46407851a | 333,190,863,979,644,800,000,000,000,000,000,000,000 | 38 | ecc: Constant-time multiplication for Weierstrass curve.
* mpi/ec.c (_gcry_mpi_ec_mul_point): Use simple left-to-right binary
method for Weierstrass curve when SCALAR is secure. |
TEST_F(QueryPlannerTest, MustFetchWhenExpressionUsesROOT) {
params.options &= ~QueryPlannerParams::INCLUDE_COLLSCAN;
addIndex(fromjson("{a: 1, b: 1}"), {{}, {0}});
runQueryAsCommand(
fromjson("{find: 'testns', filter: {a: {$gt: 0}}, projection: {_id: 0, x: '$$ROOT'}}"));
assertNumSolutions(1U);... | 0 | [
"CWE-754"
] | mongo | f8f55e1825ee5c7bdb3208fc7c5b54321d172732 | 11,054,106,036,080,423,000,000,000,000,000,000,000 | 11 | SERVER-44377 generate correct plan for indexed inequalities to null |
static int sv_body(char *hostname, int s, unsigned char *context)
{
char *buf=NULL;
fd_set readfds;
int ret=1,width;
int k,i;
unsigned long l;
SSL *con=NULL;
BIO *sbio;
struct timeval timeout;
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_... | 0 | [] | openssl | ee2ffc279417f15fef3b1073c7dc81a908991516 | 67,824,741,500,224,250,000,000,000,000,000,000,000 | 386 | Add Next Protocol Negotiation. |
bool DecimalQuantity::isNegative() const {
return (flags & NEGATIVE_FLAG) != 0;
} | 0 | [
"CWE-190"
] | icu | 53d8c8f3d181d87a6aa925b449b51c4a2c922a51 | 143,610,943,898,952,130,000,000,000,000,000,000,000 | 3 | ICU-20246 Fixing another integer overflow in number parsing. |
void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start,
unsigned long end, unsigned long vmflag)
{
unsigned long addr;
/* do a global flush by default */
unsigned long base_pages_to_flush = TLB_FLUSH_ALL;
preempt_disable();
if (current->active_mm != mm) {
/* Synchronize with switch_mm. */
smp_m... | 0 | [
"CWE-362"
] | linux | 71b3c126e61177eb693423f2e18a1914205b165e | 2,834,259,509,244,205,000,000,000,000,000,000,000 | 52 | x86/mm: Add barriers and document switch_mm()-vs-flush synchronization
When switch_mm() activates a new PGD, it also sets a bit that
tells other CPUs that the PGD is in use so that TLB flush IPIs
will be sent. In order for that to work correctly, the bit
needs to be visible prior to loading the PGD and therefore
star... |
tables_init_destination(j_compress_ptr cinfo)
{
JPEGState* sp = (JPEGState*) cinfo;
/* while building, jpegtables_length is allocated buffer size */
sp->dest.next_output_byte = (JOCTET*) sp->jpegtables;
sp->dest.free_in_buffer = (size_t) sp->jpegtables_length;
} | 0 | [
"CWE-369"
] | libtiff | 47f2fb61a3a64667bce1a8398a8fcb1b348ff122 | 165,193,540,102,896,080,000,000,000,000,000,000,000 | 8 | * libtiff/tif_jpeg.c: avoid integer division by zero in
JPEGSetupEncode() when horizontal or vertical sampling is set to 0.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2653 |
#ifdef XP_OPTIMIZED_FILTER_FIRST
static int
xmlXPathCompOpEvalFilterFirst(xmlXPathParserContextPtr ctxt,
xmlXPathStepOpPtr op, xmlNodePtr * first)
{
int total = 0;
xmlXPathCompExprPtr comp;
xmlXPathObjectPtr res;
xmlXPathObjectPtr obj;
xmlNodeSetPtr oldset;
xmlNodePtr oldnode;
xmlDo... | 0 | [
"CWE-119"
] | libxml2 | 91d19754d46acd4a639a8b9e31f50f31c78f8c9c | 120,743,135,857,347,150,000,000,000,000,000,000,000 | 290 | Fix the semantic of XPath axis for namespace/attribute context nodes
The processing of namespace and attributes nodes was not compliant
to the XPath-1.0 specification |
FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_stream(
FLAC__StreamDecoder *decoder,
FLAC__StreamDecoderReadCallback read_callback,
FLAC__StreamDecoderSeekCallback seek_callback,
FLAC__StreamDecoderTellCallback tell_callback,
FLAC__StreamDecoderLengthCallback length_callback,
FLAC__StreamDecoder... | 0 | [
"CWE-119"
] | flac | 5b3033a2b355068c11fe637e14ac742d273f076e | 136,246,213,811,098,420,000,000,000,000,000,000,000 | 27 | src/libFLAC/stream_decoder.c : Fix buffer read overflow.
This is CVE-2014-8962.
Reported-by: Michele Spagnuolo,
Google Security Team <mikispag@google.com> |
static const struct hci_uart_proto *hci_uart_get_proto(unsigned int id)
{
if (id >= HCI_UART_MAX_PROTO)
return NULL;
return hup[id];
} | 0 | [
"CWE-416"
] | linux | 56897b217a1d0a91c9920cb418d6b3fe922f590a | 235,584,400,590,885,660,000,000,000,000,000,000,000 | 7 | Bluetooth: hci_ldisc: Postpone HCI_UART_PROTO_READY bit set in hci_uart_set_proto()
task A: task B:
hci_uart_set_proto flush_to_ldisc
- p->open(hu) -> h5_open //alloc h5 - receive_buf
- set_bit HCI_UART_PROTO_READY - tty_port_default_receive_buf
- hci_uar... |
int APE::Properties::version() const
{
return d->version;
} | 0 | [] | taglib | 77d61c6eca4d08b9b025738acf6b926cc750db23 | 273,426,370,099,366,550,000,000,000,000,000,000,000 | 4 | Make sure to not try dividing by zero |
check_definition(const char *buf)
{
const char *p;
def_t* def;
size_t def_name_len;
char *str;
if (buf[0] != '$')
return false;
if (!isalpha(buf[1]) && buf[1] != '_')
return NULL;
for (p = buf + 2; *p; p++) {
if (*p == '=')
break;
if (!isalnum(*p) &&
!isdigit(*p) &&
*p != '_')
return... | 0 | [
"CWE-59",
"CWE-61"
] | keepalived | 04f2d32871bb3b11d7dc024039952f2fe2750306 | 78,490,875,574,931,810,000,000,000,000,000,000,000 | 75 | When opening files for write, ensure they aren't symbolic links
Issue #1048 identified that if, for example, a non privileged user
created a symbolic link from /etc/keepalvied.data to /etc/passwd,
writing to /etc/keepalived.data (which could be invoked via DBus)
would cause /etc/passwd to be overwritten.
This commit ... |
int db_col_db_new(struct db_filter_col *col, const struct arch_def *arch)
{
int rc;
struct db_filter *db;
db = _db_init(arch);
if (db == NULL)
return -ENOMEM;
rc = db_col_db_add(col, db);
if (rc < 0)
_db_release(db);
return rc;
} | 0 | [] | libseccomp | c5bf78de480b32b324e0f511c88ce533ed280b37 | 165,701,590,795,366,780,000,000,000,000,000,000,000 | 14 | db: fix 64-bit argument comparisons
Our approach to doing 64-bit comparisons using 32-bit operators was
just plain wrong, leading to a number of potential problems with
filters that used the LT, GT, LE, or GE operators. This patch fixes
this problem and a few other related issues that came to light in
the course of f... |
Statement_Ptr Expand::operator()(At_Root_Block_Ptr a)
{
Block_Obj ab = a->block();
Expression_Obj ae = a->expression();
if (ae) ae = ae->perform(&eval);
else ae = SASS_MEMORY_NEW(At_Root_Query, a->pstate());
LOCAL_FLAG(at_root_without_rule, true);
LOCAL_FLAG(in_keyframes, false);
... | 0 | [
"CWE-476"
] | libsass | 0bc35e3d26922229d5a3e3308860cf0fcee5d1cf | 336,162,237,376,366,940,000,000,000,000,000,000,000 | 20 | Fix segfault on empty custom properties
Originally reported in sass/sassc#225
Fixes sass/sassc#225
Spec sass/sass-spec#1249 |
qtdemux_tag_add_gnre (GstQTDemux * qtdemux, GstTagList * taglist,
const char *tag, const char *dummy, GNode * node)
{
GNode *data;
data = qtdemux_tree_get_child_by_type (node, FOURCC_data);
/* re-route to normal string tag if major brand says so
* or no data atom and compatible brand suggests so */
if ... | 0 | [
"CWE-125"
] | gst-plugins-good | d0949baf3dadea6021d54abef6802fed5a06af75 | 328,975,988,310,705,930,000,000,000,000,000,000,000 | 34 | qtdemux: Fix out of bounds read in tag parsing code
We can't simply assume that the length of the tag value as given
inside the stream is correct but should also check against the amount of
data we have actually available.
https://bugzilla.gnome.org/show_bug.cgi?id=775451 |
static int getoffset(RBinFile *arch, int type, int idx) {
struct r_bin_dex_obj_t *dex = arch->o->bin_obj;
switch (type) {
case 'm': // methods
// TODO: ADD CHECK
return offset_of_method_idx (arch, dex, idx);
case 'o': // objects
break;
case 's': // strings
if (dex->header.strings_size > idx) {
if (dex->... | 0 | [
"CWE-125"
] | radare2 | ead645853a63bf83d8386702cad0cf23b31d7eeb | 79,622,114,814,846,720,000,000,000,000,000,000,000 | 21 | fix #6857 |
void CServer::SendServerInfo(int ClientID)
{
CMsgPacker Msg(NETMSG_SERVERINFO, true);
GenerateServerInfo(&Msg, -1);
if(ClientID == -1)
{
for(int i = 0; i < MAX_CLIENTS; i++)
{
if(m_aClients[i].m_State != CClient::STATE_EMPTY)
SendMsg(&Msg, MSGFLAG_VITAL|MSGFLAG_FLUSH, i);
}
}
else if(ClientID >= 0 &&... | 0 | [
"CWE-20",
"CWE-703",
"CWE-400"
] | teeworlds | c68402fa7e279d42886d5951d1ea8ac2facc1ea5 | 321,256,057,271,329,730,000,000,000,000,000,000,000 | 15 | changed a check |
static void tx3g_dump_box_nobox(FILE * trace, GF_BoxRecord *rec)
{
gf_fprintf(trace, "<TextBox top=\"%d\" left=\"%d\" bottom=\"%d\" right=\"%d\"/>\n", rec->top, rec->left, rec->bottom, rec->right);
} | 0 | [
"CWE-787"
] | gpac | ea1eca00fd92fa17f0e25ac25652622924a9a6a0 | 314,559,866,308,171,150,000,000,000,000,000,000,000 | 4 | fixed #2138 |
static GF_PropertyValue gf_filter_parse_prop_solve_env_var(GF_Filter *filter, u32 type, const char *name, const char *value, const char *enum_values)
{
char szPath[GF_MAX_PATH];
GF_PropertyValue argv;
if (!value) return gf_props_parse_value(type, name, NULL, enum_values, filter->session->sep_list);
if (!strnicmp... | 0 | [
"CWE-787"
] | gpac | da37ec8582266983d0ec4b7550ec907401ec441e | 199,092,455,299,918,470,000,000,000,000,000,000,000 | 42 | fixed crashes for very long path - cf #1908 |
static void update_hb_size(hb_font_t *hb_font, FT_Face face)
{
hb_font_set_scale (hb_font,
((uint64_t) face->size->metrics.x_scale * (uint64_t) face->units_per_EM) >> 16,
((uint64_t) face->size->metrics.y_scale * (uint64_t) face->units_per_EM) >> 16);
hb_font_set_ppem (hb_font, face->siz... | 0 | [
"CWE-399"
] | libass | aa54e0b59200a994d50a346b5d7ac818ebcf2d4b | 297,595,251,395,465,150,000,000,000,000,000,000,000 | 8 | shaper: fix reallocation
Update the variable that tracks the allocated size. This potentially
improves performance and avoid some side effects, which lead to
undefined behavior in some cases.
Fixes fuzzer test case id:000051,sig:11,sync:fuzzer3,src:004221. |
jpeg_pipeline_dest(j_compress_ptr cinfo,
unsigned char* outbuffer, size_t size,
Pipeline* next)
{
cinfo->dest = static_cast<struct jpeg_destination_mgr *>(
(*cinfo->mem->alloc_small)(reinterpret_cast<j_common_ptr>(cinfo),
JPOOL_PERMANE... | 0 | [
"CWE-787"
] | qpdf | d71f05ca07eb5c7cfa4d6d23e5c1f2a800f52e8e | 184,535,732,698,047,900,000,000,000,000,000,000,000 | 17 | 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 ... |
static int ssl3_get_record(SSL *s)
{
int ssl_major, ssl_minor, al;
int enc_err, n, i, ret = -1;
SSL3_RECORD *rr;
SSL_SESSION *sess;
unsigned char *p;
unsigned char md[EVP_MAX_MD_SIZE];
short version;
unsigned mac_size, orig_len;
size_t extra;
unsigned empty_record_count = 0;
... | 0 | [
"CWE-17"
] | openssl | 77c77f0a1b9f15b869ca3342186dfbedd1119d0e | 264,381,879,859,881,600,000,000,000,000,000,000,000 | 274 | Multiblock corrupted pointer fix
OpenSSL 1.0.2 introduced the "multiblock" performance improvement. This
feature only applies on 64 bit x86 architecture platforms that support AES
NI instructions. A defect in the implementation of "multiblock" can cause
OpenSSL's internal write buffer to become incorrectly set to NULL... |
QPDF_Stream::setDescription(QPDF* qpdf, std::string const& description)
{
this->QPDFObject::setDescription(qpdf, description);
setDictDescription();
} | 0 | [
"CWE-787"
] | qpdf | d71f05ca07eb5c7cfa4d6d23e5c1f2a800f52e8e | 173,962,895,880,589,600,000,000,000,000,000,000,000 | 5 | 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 ... |
static const sql_type_info_t *native2sql(int t)
{
switch (t) {
case FIELD_TYPE_VAR_STRING: return &SQL_GET_TYPE_INFO_values[0];
case FIELD_TYPE_DECIMAL: return &SQL_GET_TYPE_INFO_values[1];
#ifdef FIELD_TYPE_NEWDECIMAL
case FIELD_TYPE_NEWDECIMAL: return &SQL_GET_TYPE_INFO_values[1];
#endif
case ... | 0 | [
"CWE-416"
] | DBD-mysql | a56ae87a4c1c1fead7d09c3653905841ccccf1cc | 14,068,038,030,008,744,000,000,000,000,000,000,000 | 33 | fix use-after-free crash in RT #97625 |
static int fuse_lock_common(fuse_req_t req, fuse_ino_t ino,
struct fuse_file_info *fi, struct flock *lock,
int cmd)
{
struct fuse *f = req_fuse_prepare(req);
char *path;
int err;
err = -ENOENT;
pthread_rwlock_rdlock(&f->tree_lock);
path = ... | 0 | [] | ntfs-3g | fb28eef6f1c26170566187c1ab7dc913a13ea43c | 141,313,314,439,247,050,000,000,000,000,000,000,000 | 21 | Hardened the checking of directory offset requested by a readdir
When asked for the next directory entries, make sure the chunk offset
is within valid values, otherwise return no more entries in chunk. |
GF_Err unkn_box_dump(GF_Box *a, FILE * trace)
{
Bool str_dump = GF_FALSE;
const char *name = "UnknownBox";
GF_UnknownBox *u = (GF_UnknownBox *)a;
if (!a->type && (a->size==8)) {
name = "TerminatorBox";
} else if (u->original_4cc==GF_4CC('n','a','m','e') && (u->dataSize>4) && !u->data[0] && !u->data[1] && !u->dat... | 0 | [
"CWE-787"
] | gpac | ea1eca00fd92fa17f0e25ac25652622924a9a6a0 | 26,722,420,802,847,816,000,000,000,000,000,000,000 | 36 | fixed #2138 |
void spl_SplOjectStorage_free_storage(void *object TSRMLS_DC) /* {{{ */
{
spl_SplObjectStorage *intern = (spl_SplObjectStorage *)object;
zend_object_std_dtor(&intern->std TSRMLS_CC);
zend_hash_destroy(&intern->storage);
if (intern->debug_info != NULL) {
zend_hash_destroy(intern->debug_info);
efree(intern->... | 0 | [] | php-src | 950d3d6e9b94b75b266c67bf9e3a85ae9c31905d | 18,345,623,205,820,070,000,000,000,000,000,000,000 | 19 | Fix bug #69227 and #65967
This patch fixes a use (in zend_gc.c) after free (in spl_observer.c).
See https://bugs.php.net/bug.php?id=69227 |
virtual GBool gouraudTriangleShadedFill(GfxState *state, GfxGouraudTriangleShading *shading)
{ return gFalse; } | 0 | [] | poppler | abf167af8b15e5f3b510275ce619e6fdb42edd40 | 284,563,261,835,249,720,000,000,000,000,000,000,000 | 2 | Implement tiling/patterns in SplashOutputDev
Fixes bug 13518 |
inline protobuf::RepeatedPtrField<string>* MutableTensorProtoData<tstring>(
TensorProto* t) {
static_assert(SaveTypeTraits<tstring>::supported,
"Specified type tstring not supported for Save");
return t->mutable_string_val();
} | 0 | [
"CWE-345"
] | tensorflow | 368af875869a204b4ac552b9ddda59f6a46a56ec | 241,730,178,367,039,000,000,000,000,000,000,000,000 | 6 | Avoid buffer overflow when loading tensors with insufficient data from checkpoints.
`CopyDataFromTensorSliceToTensorSlice` does not (and cannot conveniently)
provide any bounds checking on its own, so the size is instead checked prior
to passing unvalidated data to that function.
PiperOrigin-RevId: 392971286
Change-I... |
static bool is_finite(const bool) { return true; } | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 263,012,291,053,657,700,000,000,000,000,000,000,000 | 1 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
cfile_free (cfile_t *cf)
{
if (cf == NULL)
return;
g_free (cf->name);
g_free (cf);
} | 0 | [
"CWE-787"
] | gcab | c512f6ff0c82a1139b36db2b28f93edc01c74b4b | 328,400,135,981,900,200,000,000,000,000,000,000,000 | 7 | trivial: Allocate cdata_t on the heap
Using a 91kB stack allocation for one object isn't awesome, and it also allows
us to use g_autoptr() to simplify gcab_folder_extract() |
void fm10k_clear_queueing_scheme(struct fm10k_intfc *interface)
{
fm10k_free_q_vectors(interface);
fm10k_reset_msix_capability(interface);
} | 0 | [
"CWE-476"
] | linux | 01ca667133d019edc9f0a1f70a272447c84ec41f | 275,098,478,992,405,600,000,000,000,000,000,000,000 | 5 | fm10k: Fix a potential NULL pointer dereference
Syzkaller report this:
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] SMP KASAN PTI
CPU: 0 PID: 4378 Comm: syz-executor.0 Tainted: G C 5.0.0+ #5
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),... |
static apr_status_t setup_reg(md_reg_t **preg, apr_pool_t *p, server_rec *s,
int can_http, int can_https)
{
md_srv_conf_t *sc;
md_mod_conf_t *mc;
md_store_t *store;
apr_status_t rv;
MD_CHK_VARS;
sc = md_config_get(s);
mc = sc->mc;
if ( MD_OK(set... | 0 | [
"CWE-476"
] | mod_md | e71001955809247b3aa4d269e1e0741b4fe0fc3d | 114,910,070,722,251,360,000,000,000,000,000,000,000 | 19 | v1.1.12, notifycmd improvements |
void SplashOutputDev::unsetSoftMaskFromImageMask(GfxState *state, double *baseMatrix) {
double bbox[4] = {0,0,1,1}; // dummy
/* transfer mask to alpha channel! */
// memcpy(maskBitmap->getAlphaPtr(), maskBitmap->getDataPtr(), bitmap->getRowSize() * bitmap->getHeight());
// memset(maskBitmap->getDataPtr(), 0, b... | 0 | [
"CWE-369"
] | poppler | b224e2f5739fe61de9fa69955d016725b2a4b78d | 268,407,096,683,471,320,000,000,000,000,000,000,000 | 20 | SplashOutputDev::tilingPatternFill: Fix crash on broken file
Issue #802 |
static Handle<type> registerInlineHeader(const LowerCaseString& header_name) {
static size_t inline_header_index = 0;
ASSERT(!mutableFinalized<type>());
auto& map = mutableRegistrationMap<type>();
auto entry = map.find(header_name);
if (entry == map.end()) {
map[header_name] = inline_header... | 0 | [] | envoy | 2c60632d41555ec8b3d9ef5246242be637a2db0f | 314,156,530,262,102,160,000,000,000,000,000,000,000 | 11 | http: header map security fixes for duplicate headers (#197)
Previously header matching did not match on all headers for
non-inline headers. This patch changes the default behavior to
always logically match on all headers. Multiple individual
headers will be logically concatenated with ',' similar to what
is done with... |
zsethalftone5(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
uint count;
gs_halftone_component *phtc = 0;
gs_halftone_component *pc;
int code = 0;
int j;
bool have_default;
gs_halftone *pht = 0;
gx_device_halftone *pdht = 0;
ref sprocs[GS_CLIENT_COLOR_MAX_COMPONENTS + 1];
ref tprocs[GS... | 1 | [] | ghostpdl | f5c7555c30393e64ec1f5ab0dfae5b55b3b3fc78 | 285,041,281,878,694,430,000,000,000,000,000,000,000 | 292 | Bug 697203: check for sufficient params in .sethalftone5
and param types |
RecordInstallHooks(RecordClientsAndProtocolPtr pRCAP, XID oneclient)
{
int i = 0;
XID client;
if (oneclient)
client = oneclient;
else
client = pRCAP->numClients ? pRCAP->pClientIDs[i++] : 0;
while (client) {
if (client != XRecordFutureClients) {
if (pRCAP->pRequ... | 0 | [
"CWE-191"
] | xserver | 2902b78535ecc6821cc027351818b28a5c7fdbdc | 63,820,878,622,032,770,000,000,000,000,000,000,000 | 65 | Fix XRecordRegisterClients() Integer underflow
CVE-2020-14362 ZDI-CAN-11574
This vulnerability was discovered by:
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative
Signed-off-by: Matthieu Herrb <matthieu@herrb.eu> |
int kvm_arch_create_memslot(struct kvm *kvm, struct kvm_memory_slot *slot,
unsigned long npages)
{
int i;
for (i = 0; i < KVM_NR_PAGE_SIZES; ++i) {
unsigned long ugfn;
int lpages;
int level = i + 1;
lpages = gfn_to_index(slot->base_gfn + npages - 1,
slot->base_gfn, level) + 1;
slot->arch... | 0 | [
"CWE-119",
"CWE-703",
"CWE-120"
] | linux | a08d3b3b99efd509133946056531cdf8f3a0c09b | 194,308,852,861,134,670,000,000,000,000,000,000,000 | 58 | kvm: x86: fix emulator buffer overflow (CVE-2014-0049)
The problem occurs when the guest performs a pusha with the stack
address pointing to an mmio address (or an invalid guest physical
address) to start with, but then extending into an ordinary guest
physical address. When doing repeated emulated pushes
emulator_re... |
static long fuse_dev_ioctl(struct file *file, unsigned int cmd,
unsigned long arg)
{
int err = -ENOTTY;
if (cmd == FUSE_DEV_IOC_CLONE) {
int oldfd;
err = -EFAULT;
if (!get_user(oldfd, (__u32 __user *) arg)) {
struct file *old = fget(oldfd);
err = -EINVAL;
if (old) {
struct fuse_dev *fud = ... | 0 | [
"CWE-416"
] | linux | 15fab63e1e57be9fdb5eec1bbc5916e9825e9acb | 210,562,843,812,742,130,000,000,000,000,000,000,000 | 35 | fs: prevent page refcount overflow in pipe_buf_get
Change pipe_buf_get() to return a bool indicating whether it succeeded
in raising the refcount of the page (if the thing in the pipe is a page).
This removes another mechanism for overflowing the page refcount. All
callers converted to handle a failure.
Reported-by:... |
int RemoteIo::getb()
{
assert(p_->isMalloced_);
if (p_->idx_ == p_->size_) {
p_->eof_ = true;
return EOF;
}
size_t expectedBlock = (p_->idx_ + 1)/p_->blockSize_;
// connect to the remote machine & populate the blocks just in time.
p_->popu... | 0 | [
"CWE-125"
] | exiv2 | bd0afe0390439b2c424d881c8c6eb0c5624e31d9 | 82,601,576,906,893,690,000,000,000,000,000,000,000 | 15 | Add bounds check to MemIo::seek(). (#944)
- Regression test for missing bounds check in MemIo::seek()
- Add bounds check to MemIo::seek(), this fixes CVE-2019-13504 |
SSL_SESSION *SSL_SESSION_new(void)
{
SSL_SESSION *ss;
ss = OPENSSL_malloc(sizeof(*ss));
if (ss == NULL) {
SSLerr(SSL_F_SSL_SESSION_NEW, ERR_R_MALLOC_FAILURE);
return (0);
}
memset(ss, 0, sizeof(*ss));
ss->verify_result = 1; /* avoid 0 (= X509_V_OK) just in case */
ss->... | 0 | [
"CWE-362"
] | openssl | 708cf593587e2fda67dae9782991ff9fccc781eb | 240,860,468,209,133,270,000,000,000,000,000,000,000 | 35 | More ssl_session_dup fixes
Fix error handling in ssl_session_dup, as well as incorrect setting up of
the session ticket. Follow on from CVE-2015-1791.
Thanks to LibreSSL project for reporting these issues.
Reviewed-by: Tim Hudson <tjh@openssl.org> |
static bool pcm_control_mmap_allowed(struct snd_pcm_file *pcm_file)
{
if (pcm_file->no_compat_mmap)
return false;
/* see above */
if (pcm_file->substream->runtime->hw.info & SNDRV_PCM_INFO_EXPLICIT_SYNC)
return false;
/* Disallow the control mmap when SYNC_APPLPTR flag is set;
* it enforces the user-space to ... | 0 | [
"CWE-125"
] | linux | 92ee3c60ec9fe64404dc035e7c41277d74aa26cb | 214,643,637,337,501,570,000,000,000,000,000,000,000 | 15 | ALSA: pcm: Fix races among concurrent hw_params and hw_free calls
Currently we have neither proper check nor protection against the
concurrent calls of PCM hw_params and hw_free ioctls, which may result
in a UAF. Since the existing PCM stream lock can't be used for
protecting the whole ioctl operations, we need a new... |
xmlRegisterOutputCallbacks(xmlOutputMatchCallback matchFunc,
xmlOutputOpenCallback openFunc, xmlOutputWriteCallback writeFunc,
xmlOutputCloseCallback closeFunc) {
if (xmlOutputCallbackNr >= MAX_OUTPUT_CALLBACK) {
return(-1);
}
xmlOutputCallbackTable[xmlOutputCallbackNr].matchcallback = matchFunc;
xml... | 0 | [
"CWE-134"
] | libxml2 | 4472c3a5a5b516aaf59b89be602fbce52756c3e9 | 155,793,924,627,382,580,000,000,000,000,000,000,000 | 13 | Fix some format string warnings with possible format string vulnerability
For https://bugzilla.gnome.org/show_bug.cgi?id=761029
Decorate every method in libxml2 with the appropriate
LIBXML_ATTR_FORMAT(fmt,args) macro and add some cleanups
following the reports. |
riff_type_find (GstTypeFind * tf, gpointer private)
{
GstTypeFindData *riff_data = (GstTypeFindData *) private;
const guint8 *data = gst_type_find_peek (tf, 0, 12);
if (data && (memcmp (data, "RIFF", 4) == 0 || memcmp (data, "AVF0", 4) == 0)) {
data += 8;
if (memcmp (data, riff_data->data, 4) == 0)
... | 0 | [
"CWE-125"
] | gst-plugins-base | 2fdccfd64fc609e44e9c4b8eed5bfdc0ab9c9095 | 258,117,104,116,492,000,000,000,000,000,000,000,000 | 11 | typefind: bounds check windows ico detection
Fixes out of bounds read
https://bugzilla.gnome.org/show_bug.cgi?id=774902 |
static int compat_getdrvprm(int drive,
struct compat_floppy_drive_params __user *arg)
{
struct compat_floppy_drive_params v;
memset(&v, 0, sizeof(struct compat_floppy_drive_params));
mutex_lock(&floppy_mutex);
v.cmos = drive_params[drive].cmos;
v.max_dtr = drive_params[drive].max_dtr;
v.hlt = drive_params... | 0 | [
"CWE-416"
] | linux | 233087ca063686964a53c829d547c7571e3f67bf | 232,005,648,972,149,700,000,000,000,000,000,000,000 | 33 | floppy: disable FDRAWCMD by default
Minh Yuan reported a concurrency use-after-free issue in the floppy code
between raw_cmd_ioctl and seek_interrupt.
[ It turns out this has been around, and that others have reported the
KASAN splats over the years, but Minh Yuan had a reproducer for it and
so gets primary credi... |
int zmq::curve_server_t::produce_error (msg_t *msg_) const
{
zmq_assert (status_code.length () == 3);
const int rc = msg_->init_size (6 + 1 + status_code.length ());
zmq_assert (rc == 0);
char *msg_data = static_cast <char *> (msg_->data ());
memcpy (msg_data, "\5ERROR", 6);
msg_data [6] = sizeo... | 0 | [] | libzmq | 0900a489213d74feb86fc0b343308fe7884a2a3c | 77,083,383,845,079,990,000,000,000,000,000,000,000 | 11 | Problem: curve messages can be replayed
Solution: ensure message short nonces are strictly increasing and validate them |
static void mld_gq_stop_work(struct inet6_dev *idev)
{
idev->mc_gq_running = 0;
if (cancel_delayed_work(&idev->mc_gq_work))
__in6_dev_put(idev);
} | 0 | [
"CWE-703"
] | linux | 2d3916f3189172d5c69d33065c3c21119fe539fc | 114,159,732,340,838,080,000,000,000,000,000,000,000 | 6 | ipv6: fix skb drops in igmp6_event_query() and igmp6_event_report()
While investigating on why a synchronize_net() has been added recently
in ipv6_mc_down(), I found that igmp6_event_query() and igmp6_event_report()
might drop skbs in some cases.
Discussion about removing synchronize_net() from ipv6_mc_down()
will ha... |
_Pickler_SetOutputStream(PicklerObject *self, PyObject *file)
{
_Py_IDENTIFIER(write);
assert(file != NULL);
if (_PyObject_LookupAttrId(file, &PyId_write, &self->write) < 0) {
return -1;
}
if (self->write == NULL) {
PyErr_SetString(PyExc_TypeError,
"file must ... | 0 | [
"CWE-190",
"CWE-369"
] | cpython | a4ae828ee416a66d8c7bf5ee71d653c2cc6a26dd | 76,525,775,507,066,120,000,000,000,000,000,000,000 | 15 | closes bpo-34656: Avoid relying on signed overflow in _pickle memos. (GH-9261) |
void NumberFormatTest::TestCurrencyFractionDigits() {
UErrorCode status = U_ZERO_ERROR;
UnicodeString text1, text2;
double value = 99.12345;
// Create currenct instance
NumberFormat* fmt = NumberFormat::createCurrencyInstance("ja_JP", status);
if (U_FAILURE(status) || fmt == NULL) {
dat... | 0 | [
"CWE-190"
] | icu | 53d8c8f3d181d87a6aa925b449b51c4a2c922a51 | 332,274,530,591,224,350,000,000,000,000,000,000,000 | 24 | ICU-20246 Fixing another integer overflow in number parsing. |
bool Item_field::eq(const Item *item, bool binary_cmp) const
{
Item *real_item2= ((Item *) item)->real_item();
if (real_item2->type() != FIELD_ITEM)
return 0;
Item_field *item_field= (Item_field*) real_item2;
if (item_field->field && field)
return item_field->field == field;
/*
We may come here... | 0 | [
"CWE-416"
] | server | c02ebf3510850ba78a106be9974c94c3b97d8585 | 191,101,931,564,212,940,000,000,000,000,000,000,000 | 28 | 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. |
int efi_mem_type(unsigned long phys_addr)
{
const efi_memory_desc_t *md;
if (!efi_enabled(EFI_MEMMAP))
return -ENOTSUPP;
for_each_efi_memory_desc(md) {
if ((md->phys_addr <= phys_addr) &&
(phys_addr < (md->phys_addr +
(md->num_pages << EFI_PAGE_SHIFT))))
return md->type;
}
return -EINVAL;
} | 0 | [] | linux | 1957a85b0032a81e6482ca4aab883643b8dae06e | 256,807,790,751,898,000,000,000,000,000,000,000,000 | 15 | efi: Restrict efivar_ssdt_load when the kernel is locked down
efivar_ssdt_load allows the kernel to import arbitrary ACPI code from an
EFI variable, which gives arbitrary code execution in ring 0. Prevent
that when the kernel is locked down.
Signed-off-by: Matthew Garrett <mjg59@google.com>
Acked-by: Ard Biesheuvel <... |
am_cache_entry_t *am_new_request_session(request_rec *r)
{
const char *session_id;
/* Generate session id. */
session_id = am_generate_id(r);
if(session_id == NULL) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
"Error creating session id.");
return NULL;
}
... | 1 | [
"CWE-79"
] | mod_auth_mellon | 7af21c53da7bb1de024274ee6da30bc22316a079 | 210,972,283,721,432,540,000,000,000,000,000,000,000 | 18 | Fix Cross-Site Session Transfer vulnerability
mod_auth_mellon did not verify that the site the session was created
for was the same site as the site the user accessed. This allows an
attacker with access to one web site on a server to use the same
session to get access to a different site running on the same server.
... |
TEST(ArrayOpsTest, MatrixSetDiag_ShapeFn) {
ShapeInferenceTestOp op("MatrixSetDiag");
// Inputs are input and diagonal.
// Rank checks.
INFER_ERROR("Shape must be at least rank 2 but is rank 1", op, "[1];?");
INFER_ERROR("Shape must be at least rank 1 but is rank 0", op, "?;[]");
INFER_ERROR("Shape must b... | 0 | [
"CWE-125"
] | tensorflow | 7cf73a2274732c9d82af51c2bc2cf90d13cd7e6d | 264,035,380,476,111,830,000,000,000,000,000,000,000 | 28 | Address QuantizeAndDequantizeV* heap oob. Added additional checks for the 'axis' attribute.
PiperOrigin-RevId: 402446942
Change-Id: Id2f6b82e4e740d0550329be02621c46466b5a5b9 |
static int snd_seq_ioctl_delete_queue(struct snd_seq_client *client, void *arg)
{
struct snd_seq_queue_info *info = arg;
return snd_seq_queue_delete(client->number, info->queue);
} | 0 | [
"CWE-416",
"CWE-362"
] | linux | 71105998845fb012937332fe2e806d443c09e026 | 24,268,408,805,477,074,000,000,000,000,000,000,000 | 6 | ALSA: seq: Fix use-after-free at creating a port
There is a potential race window opened at creating and deleting a
port via ioctl, as spotted by fuzzing. snd_seq_create_port() creates
a port object and returns its pointer, but it doesn't take the
refcount, thus it can be deleted immediately by another thread.
Meanwh... |
TEST(HeaderMapImplTest, AddCopy) {
TestRequestHeaderMapImpl headers;
// Start with a string value.
std::unique_ptr<LowerCaseString> lcKeyPtr(new LowerCaseString("hello"));
headers.addCopy(*lcKeyPtr, "world");
const HeaderString& value = headers.get(*lcKeyPtr)->value();
EXPECT_EQ("world", value.getStringV... | 0 | [] | envoy | 2c60632d41555ec8b3d9ef5246242be637a2db0f | 295,278,547,134,187,130,000,000,000,000,000,000,000 | 70 | http: header map security fixes for duplicate headers (#197)
Previously header matching did not match on all headers for
non-inline headers. This patch changes the default behavior to
always logically match on all headers. Multiple individual
headers will be logically concatenated with ',' similar to what
is done with... |
static int __check_block_validity(struct inode *inode, const char *func,
unsigned int line,
struct ext4_map_blocks *map)
{
if (!ext4_data_block_valid(EXT4_SB(inode->i_sb), map->m_pblk,
map->m_len)) {
ext4_error_inode(inode, func, line, map->m_pblk,
"lblock %lu mapped to illegal pblock %llu "
... | 0 | [
"CWE-787"
] | linux | c37e9e013469521d9adb932d17a1795c139b36db | 321,318,900,423,953,080,000,000,000,000,000,000,000 | 14 | ext4: add more inode number paranoia checks
If there is a directory entry pointing to a system inode (such as a
journal inode), complain and declare the file system to be corrupted.
Also, if the superblock's first inode number field is too small,
refuse to mount the file system.
This addresses CVE-2018-10882.
https... |
static int mac80211_hwsim_get_et_sset_count(struct ieee80211_hw *hw,
struct ieee80211_vif *vif, int sset)
{
if (sset == ETH_SS_STATS)
return MAC80211_HWSIM_SSTATS_LEN;
return 0;
} | 0 | [
"CWE-703",
"CWE-772"
] | linux | 0ddcff49b672239dda94d70d0fcf50317a9f4b51 | 150,298,309,446,228,000,000,000,000,000,000,000,000 | 7 | mac80211_hwsim: fix possible memory leak in hwsim_new_radio_nl()
'hwname' is malloced in hwsim_new_radio_nl() and should be freed
before leaving from the error handling cases, otherwise it will cause
memory leak.
Fixes: ff4dd73dd2b4 ("mac80211_hwsim: check HWSIM_ATTR_RADIO_NAME length")
Signed-off-by: Wei Yongjun <we... |
unsigned int dtls1_link_min_mtu(void)
{
return (g_probable_mtu[(sizeof(g_probable_mtu) /
sizeof(g_probable_mtu[0])) - 1]);
} | 0 | [
"CWE-399"
] | openssl | 00a4c1421407b6ac796688871b0a49a179c694d9 | 48,795,808,197,088,530,000,000,000,000,000,000,000 | 5 | Fix DTLS buffered message DoS attack
DTLS can handle out of order record delivery. Additionally since
handshake messages can be bigger than will fit into a single packet, the
messages can be fragmented across multiple records (as with normal TLS).
That means that the messages can arrive mixed up, and we have to
reasse... |
TEST_F(ConnectionManagerUtilityTest, DoNotAddConnectionLengthForWebSocket101Responses) {
TestRequestHeaderMapImpl request_headers{{"connection", "UpGrAdE"}, {"upgrade", "foo"}};
TestResponseHeaderMapImpl response_headers{
{":status", "101"}, {"connection", "upgrade"}, {"upgrade", "bar"}};
EXPECT_TRUE(Utilit... | 0 | [
"CWE-22"
] | envoy | 5333b928d8bcffa26ab19bf018369a835f697585 | 237,932,147,502,340,380,000,000,000,000,000,000,000 | 13 | Implement handling of escaped slash characters in URL path
Fixes: CVE-2021-29492
Signed-off-by: Yan Avlasov <yavlasov@google.com> |
v3d_submit_tfu_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
struct v3d_dev *v3d = to_v3d_dev(dev);
struct v3d_file_priv *v3d_priv = file_priv->driver_priv;
struct drm_v3d_submit_tfu *args = data;
struct v3d_tfu_job *job;
struct ww_acquire_ctx acquire_ctx;
int ret = 0;
trace_v3d... | 0 | [
"CWE-400",
"CWE-401"
] | linux | 29cd13cfd7624726d9e6becbae9aa419ef35af7f | 14,072,803,449,986,697,000,000,000,000,000,000,000 | 84 | drm/v3d: Fix memory leak in v3d_submit_cl_ioctl
In the impelementation of v3d_submit_cl_ioctl() there are two memory
leaks. One is when allocation for bin fails, and the other is when bin
initialization fails. If kcalloc fails to allocate memory for bin then
render->base should be put. Also, if v3d_job_init() fails to... |
fopen_noinh_readbin(char *filename)
{
# ifdef MSWIN
int fd_tmp = mch_open(filename, O_RDONLY | O_BINARY | O_NOINHERIT, 0);
# else
int fd_tmp = mch_open(filename, O_RDONLY, 0);
# endif
if (fd_tmp == -1)
return NULL;
# ifdef HAVE_FD_CLOEXEC
{
int fdflags = fcntl(fd_tmp, F_GETFD);
if (fdflags >= 0 && ... | 0 | [
"CWE-122"
] | vim | 2bdad6126778f907c0b98002bfebf0e611a3f5db | 153,042,923,645,112,340,000,000,000,000,000,000,000 | 21 | patch 8.2.4647: "source" can read past end of copied line
Problem: "source" can read past end of copied line.
Solution: Add a terminating NUL. |
void ip6_update_pmtu(struct sk_buff *skb, struct net *net, __be32 mtu,
int oif, u32 mark)
{
const struct ipv6hdr *iph = (struct ipv6hdr *) skb->data;
struct dst_entry *dst;
struct flowi6 fl6;
memset(&fl6, 0, sizeof(fl6));
fl6.flowi6_oif = oif;
fl6.flowi6_mark = mark;
fl6.daddr = iph->daddr;
fl6.saddr = ... | 0 | [
"CWE-119"
] | net | c88507fbad8055297c1d1e21e599f46960cbee39 | 64,323,533,303,134,650,000,000,000,000,000,000,000 | 19 | ipv6: don't set DST_NOCOUNT for remotely added routes
DST_NOCOUNT should only be used if an authorized user adds routes
locally. In case of routes which are added on behalf of router
advertisments this flag must not get used as it allows an unlimited
number of routes getting added remotely.
Signed-off-by: Sabrina Dub... |
dwg_find_table_control (Dwg_Data *restrict dwg, const char *restrict table)
{
BITCODE_BL i;
for (i = 0; i < dwg->num_objects; i++)
{
if (dwg->object[i].name && strEQ (dwg->object[i].name, table))
{
Dwg_Handle *hdl = &dwg->object[i].handle;
return dwg_add_handleref (dwg, 3, hdl-... | 0 | [
"CWE-787"
] | libredwg | ecf5183d8b3b286afe2a30021353b7116e0208dd | 92,062,043,214,427,400,000,000,000,000,000,000,000 | 16 | dwg_section_wtype: fix fuzzing overflow
with illegal and overlong section names. Fixes GH #349, #352
section names cannot be longer than 24 |
void ConnectionManagerImpl::ActiveStream::maybeContinueDecoding(
const std::list<ActiveStreamDecoderFilterPtr>::iterator& continue_data_entry) {
if (continue_data_entry != decoder_filters_.end()) {
// We use the continueDecoding() code since it will correctly handle not calling
// decodeHeaders() again. F... | 0 | [
"CWE-400"
] | envoy | 0e49a495826ea9e29134c1bd54fdeb31a034f40c | 90,872,664,843,679,660,000,000,000,000,000,000,000 | 12 | 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... |
is_mbc_ambiguous(OnigCaseFoldType flag,
const UChar** pp, const UChar* end)
{
int v;
const UChar* p = *pp;
if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
(*pp)++;
return TRUE;
}
(*pp)++;
v = (EncISO_8859_14_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));
if ((... | 0 | [
"CWE-125"
] | oniguruma | 65a9b1aa03c9bc2dc01b074295b9603232cb3b78 | 247,462,688,346,067,950,000,000,000,000,000,000,000 | 19 | onig-5.9.2 |
GF_Err flxs_box_dump(GF_Box *a, FILE * trace)
{
if (!a) return GF_BAD_PARAM;
gf_isom_box_dump_start(a, "AdobeFlashAccessParamsBox", trace);
gf_fprintf(trace, ">\n");
gf_isom_box_dump_done("AdobeFlashAccessParamsBox", a, trace);
return GF_OK;
} | 0 | [
"CWE-787"
] | gpac | ea1eca00fd92fa17f0e25ac25652622924a9a6a0 | 103,841,052,592,166,900,000,000,000,000,000,000,000 | 8 | fixed #2138 |
static BOOL optimize_class_chars(compiler_common *common, const sljit_u8 *bits, BOOL nclass, BOOL invert, jump_list **backtracks)
{
/* May destroy TMP1. */
DEFINE_COMPILER;
uint16_t char_list[MAX_CLASS_CHARS_SIZE];
uint8_t byte;
sljit_s32 type;
int i, j, k, len, c;
if (!sljit_has_cpu_feature(SLJIT_HAS_CMOV))
return ... | 0 | [
"CWE-125"
] | php-src | 8947fd9e9fdce87cd6c59817b1db58e789538fe9 | 42,284,035,281,800,780,000,000,000,000,000,000,000 | 100 | Fix #78338: Array cross-border reading in PCRE
We backport r1092 from pcre2. |
Perl_rsignal_restore(pTHX_ int signo, Sigsave_t *save)
{
#ifdef USE_ITHREADS
dVAR;
#endif
PERL_UNUSED_CONTEXT;
#ifdef USE_ITHREADS
/* only "parent" interpreter can diddle signals */
if (PL_curinterp != aTHX)
return -1;
#endif
return sigaction(signo, save, (struct sigaction *)NULL);
} | 0 | [
"CWE-119",
"CWE-703",
"CWE-787"
] | perl5 | 34716e2a6ee2af96078d62b065b7785c001194be | 290,454,200,863,984,920,000,000,000,000,000,000,000 | 14 | Perl_my_setenv(); handle integer wrap
RT #133204
Wean this function off int/I32 and onto UV/Size_t.
Also, replace all malloc-ish calls with a wrapper that does
overflow checks,
In particular, it was doing (nlen + vlen + 2) which could wrap when
the combined length of the environment variable name and value
exceeded ... |
GF_Box *trak_box_new()
{
ISOM_DECL_BOX_ALLOC(GF_TrackBox, GF_ISOM_BOX_TYPE_TRAK);
return (GF_Box *)tmp; | 0 | [
"CWE-787"
] | gpac | 388ecce75d05e11fc8496aa4857b91245007d26e | 74,526,956,408,443,240,000,000,000,000,000,000,000 | 5 | fixed #1587 |
SdMmcHcReset (
IN SD_MMC_HC_PRIVATE_DATA *Private,
IN UINT8 Slot
)
{
EFI_STATUS Status;
UINT8 SwReset;
EFI_PCI_IO_PROTOCOL *PciIo;
//
// Notify the SD/MMC override protocol that we are about to reset
// the SD/MMC host controller.
... | 0 | [] | edk2 | e36d5ac7d10a6ff5becb0f52fdfd69a1752b0d14 | 152,131,115,245,135,380,000,000,000,000,000,000,000 | 79 | MdeModulePkg/SdMmcPciHcDxe: Fix double PciIo Unmap in TRB creation (CVE-2019-14587)
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1989
The commit will avoid unmapping the same resource in error handling logic
for function BuildAdmaDescTable() and SdMmcCreateTrb().
For the error handling in BuildAdmaDescTable():... |
static u32 tun_xdp_query(struct net_device *dev)
{
struct tun_struct *tun = netdev_priv(dev);
const struct bpf_prog *xdp_prog;
xdp_prog = rtnl_dereference(tun->xdp_prog);
if (xdp_prog)
return xdp_prog->aux->id;
return 0;
} | 0 | [
"CWE-476"
] | linux | 0ad646c81b2182f7fa67ec0c8c825e0ee165696d | 5,641,500,879,092,972,000,000,000,000,000,000,000 | 11 | 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... |
apprentice_load(struct magic_set *ms, const char *fn, int action)
{
int errs = 0;
uint32_t i, j;
size_t files = 0, maxfiles = 0;
char **filearr = NULL;
struct stat st;
struct magic_map *map;
struct magic_entry_set mset[MAGIC_SETS];
php_stream *dir;
php_stream_dirent d;
TSRMLS_FETCH();
memset(mset, 0, size... | 0 | [
"CWE-17"
] | php-src | a72cd07f2983dc43a6bb35209dc4687852e53c09 | 152,754,614,840,571,500,000,000,000,000,000,000,000 | 117 | Fixed bug #68665 (Invalid free) |
PG* OSD::_make_pg(
OSDMapRef createmap,
spg_t pgid)
{
dout(10) << "_open_lock_pg " << pgid << dendl;
PGPool pool = _get_pool(pgid.pool(), createmap);
// create
PG *pg;
if (createmap->get_pg_type(pgid.pgid) == pg_pool_t::TYPE_REPLICATED ||
createmap->get_pg_type(pgid.pgid) == pg_pool_t::TYPE_ERASURE... | 0 | [
"CWE-287",
"CWE-284"
] | ceph | 5ead97120e07054d80623dada90a5cc764c28468 | 32,063,482,989,792,350,000,000,000,000,000,000,000 | 17 | 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 ... |
static void __reg_combine_32_into_64(struct bpf_reg_state *reg)
{
/* special case when 64-bit register has upper 32-bit register
* zeroed. Typically happens after zext or <<32, >>32 sequence
* allowing us to use 32-bit bounds directly,
*/
if (tnum_equals_const(tnum_clear_subreg(reg->var_off), 0)) {
__reg_assi... | 0 | [
"CWE-119",
"CWE-681",
"CWE-787"
] | linux | 5b9fbeb75b6a98955f628e205ac26689bcb1383e | 212,602,152,441,238,630,000,000,000,000,000,000,000 | 28 | bpf: Fix scalar32_min_max_or bounds tracking
Simon reported an issue with the current scalar32_min_max_or() implementation.
That is, compared to the other 32 bit subreg tracking functions, the code in
scalar32_min_max_or() stands out that it's using the 64 bit registers instead
of 32 bit ones. This leads to bounds tra... |
static int http_write_reply(URLContext* h, int status_code)
{
int ret, body = 0, reply_code, message_len;
const char *reply_text, *content_type;
HTTPContext *s = h->priv_data;
char message[BUFFER_SIZE];
content_type = "text/plain";
if (status_code < 0)
body = 1;
switch (status_code)... | 0 | [
"CWE-119",
"CWE-787"
] | FFmpeg | 2a05c8f813de6f2278827734bf8102291e7484aa | 52,889,340,085,283,140,000,000,000,000,000,000,000 | 73 | http: make length/offset-related variables unsigned.
Fixes #5992, reported and found by Paul Cher <paulcher@icloud.com>. |
void opj_j2k_setup_decoding_validation (opj_j2k_t *p_j2k)
{
/* preconditions*/
assert(p_j2k != 00);
opj_procedure_list_add_procedure(p_j2k->m_validation_list, (opj_procedure)opj_j2k_build_decoder);
opj_procedure_list_add_procedure(p_j2k->m_validation_list, (opj_procedure)opj_j2k_decodin... | 0 | [] | openjpeg | 0fa5a17c98c4b8f9ee2286f4f0a50cf52a5fccb0 | 233,902,592,812,014,120,000,000,000,000,000,000,000 | 10 | [trunk] Correct potential double free on malloc failure in opj_j2k_copy_default_tcp_and_create_tcp (fixes issue 492) |
pcsc_pinpad_verify (int slot, int class, int ins, int p0, int p1,
pininfo_t *pininfo)
{
int sw;
unsigned char *pin_verify;
int len = PIN_VERIFY_STRUCTURE_SIZE + pininfo->fixedlen;
unsigned char result[2];
pcsc_dword_t resultlen = 2;
int no_lc;
if (!reader_table[slot].atrlen
&& (... | 0 | [
"CWE-20"
] | gnupg | 2183683bd633818dd031b090b5530951de76f392 | 319,137,732,559,952,550,000,000,000,000,000,000,000 | 71 | 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 ... |
int RESTArgs::get_bool(struct req_state *s, const string& name, bool def_val, bool *val, bool *existed)
{
bool exists;
string sval = s->info.args.get(name, &exists);
if (existed)
*existed = exists;
if (!exists) {
*val = def_val;
return 0;
}
const char *str = sval.c_str();
if (sval.empty() ... | 0 | [
"CWE-770"
] | ceph | ab29bed2fc9f961fe895de1086a8208e21ddaddc | 67,961,477,963,508,850,000,000,000,000,000,000,000 | 31 | rgw: fix issues with 'enforce bounds' patch
The patch to enforce bounds on max-keys/max-uploads/max-parts had a few
issues that would prevent us from compiling it. Instead of changing the
code provided by the submitter, we're addressing them in a separate
commit to maintain the DCO.
Signed-off-by: Joao Eduardo Luis <... |
bool table_already_fk_prelocked(TABLE_LIST *tl, LEX_CSTRING *db,
LEX_CSTRING *table, thr_lock_type lock_type)
{
for (; tl; tl= tl->next_global )
{
if (tl->lock_type >= lock_type &&
tl->prelocking_placeholder == TABLE_LIST::PRELOCK_FK &&
strcmp(tl->db.str, db->str)... | 0 | [
"CWE-416"
] | server | c02ebf3510850ba78a106be9974c94c3b97d8585 | 190,879,884,930,387,170,000,000,000,000,000,000,000 | 13 | MDEV-24176 Preparations
1. moved fix_vcol_exprs() call to open_table()
mysql_alter_table() doesn't do lock_tables() so it cannot win from
fix_vcol_exprs() from there. Tests affected: main.default_session
2. Vanilla cleanups and comments. |
static void cassignop(JF, js_Ast *exp, int opcode)
{
js_Ast *lhs = exp->a;
js_Ast *rhs = exp->b;
cassignop1(J, F, lhs);
cexp(J, F, rhs);
emit(J, F, opcode);
cassignop2(J, F, lhs, 0);
} | 0 | [
"CWE-476"
] | mujs | 5008105780c0b0182ea6eda83ad5598f225be3ee | 225,028,919,057,140,640,000,000,000,000,000,000,000 | 9 | Fix 697172: degenerate labeled break/continue statement.
A labeled break statement will look for a matching label through
its chain of parent statements. We start looking at the break statement
though, so if the label is attached to the break, we'll return the break
statement itself as a break target.
Start looking f... |
trace_page_fault_entries(unsigned long address, struct pt_regs *regs,
unsigned long error_code)
{
if (user_mode(regs))
trace_page_fault_user(address, regs, error_code);
else
trace_page_fault_kernel(address, regs, error_code);
} | 0 | [
"CWE-264"
] | linux | 548acf19234dbda5a52d5a8e7e205af46e9da840 | 73,431,205,852,918,790,000,000,000,000,000,000,000 | 8 | x86/mm: Expand the exception table logic to allow new handling options
Huge amounts of help from Andy Lutomirski and Borislav Petkov to
produce this. Andy provided the inspiration to add classes to the
exception table with a clever bit-squeezing trick, Boris pointed
out how much cleaner it would all be if we just had... |
RList *r_bin_ne_get_imports(r_bin_ne_obj_t *bin) {
RList *imports = r_list_newf ((RListFree)r_bin_import_free);
if (!imports) {
return NULL;
}
ut16 off = bin->ne_header->ImportNameTable + bin->header_offset + 1;
int i;
for (i = 0; i < bin->ne_header->ModRefs; i++) {
RBinImport *imp = R_NEW0 (RBinImport);
if... | 0 | [
"CWE-476"
] | radare2 | 18d1d064bf599a255d55f09fca3104776fc34a67 | 259,744,328,844,284,900,000,000,000,000,000,000,000 | 32 | Fix null deref in the ne parser ##crash
* Reported by @hmsec via huntr.dev
* Reproducer: nepoc00
* BountyID: bfeb8fb8-644d-4587-80d4-cb704c404013 |
QMap<int, QString> Server::getRegistration(int id) {
QMap<int, QString> info;
int res = -2;
emit getRegistrationSig(res, id, info);
if (res >= 0)
return info;
TransactionHolder th;
QSqlQuery &query = *th.qsqQuery;
SQLPREP("SELECT `name`, `last_active` FROM `%1users` WHERE `server_id` = ? AND `user_id` = ?");... | 0 | [
"CWE-20"
] | mumble | 6b33dda344f89e5a039b7d79eb43925040654242 | 137,318,835,549,702,660,000,000,000,000,000,000,000 | 30 | Don't crash on long usernames |
int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
size_t len)
{
struct inet_sock *inet = inet_sk(sk);
struct udp_sock *up = udp_sk(sk);
int ulen = len;
struct ipcm_cookie ipc;
struct rtable *rt = NULL;
int free = 0;
int connected = 0;
__be32 daddr, faddr, saddr;
__be16 dport;
u8 tos;... | 0 | [] | linux-2.6 | 32c1da70810017a98aa6c431a5494a302b6b9a30 | 66,830,017,452,936,610,000,000,000,000,000,000,000 | 206 | [UDP]: Randomize port selection.
This patch causes UDP port allocation to be randomized like TCP.
The earlier code would always choose same port (ie first empty list).
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net> |
struct btrfs_device *btrfs_find_device(struct btrfs_fs_devices *fs_devices,
u64 devid, u8 *uuid, u8 *fsid,
bool seed)
{
struct btrfs_device *device;
while (fs_devices) {
if (!fsid ||
!memcmp(fs_devices->metadata_uuid, fsid, BTRFS_FSID_SIZE)) {
list_for_each_entry(device, &fs_devices-... | 0 | [
"CWE-476",
"CWE-284"
] | linux | 09ba3bc9dd150457c506e4661380a6183af651c1 | 314,008,159,871,713,860,000,000,000,000,000,000,000 | 24 | btrfs: merge btrfs_find_device and find_device
Both btrfs_find_device() and find_device() does the same thing except
that the latter does not take the seed device onto account in the device
scanning context. We can merge them.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.