func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
static bool FromV8(v8::Isolate* isolate,
v8::Local<v8::Value> val,
printing::mojom::DuplexMode* out) {
std::string mode;
if (ConvertFromV8(isolate, val, &mode)) {
if (mode == "simplex") {
*out = printing::mojom::DuplexMode::kSimplex;
return true;... | 0 | [] | electron | e9fa834757f41c0b9fe44a4dffe3d7d437f52d34 | 271,917,344,004,482,500,000,000,000,000,000,000,000 | 20 | fix: ensure ElectronBrowser mojo service is only bound to appropriate render frames (#33344)
* fix: ensure ElectronBrowser mojo service is only bound to authorized render frames
Notes: no-notes
* refactor: extract electron API IPC to its own mojo interface
* fix: just check main frame not primary main frame
... |
static inline int arp_packet_match(const struct arphdr *arphdr,
struct net_device *dev,
const char *indev,
const char *outdev,
const struct arpt_arp *arpinfo)
{
const char *arpptr = (char *)(arphdr + 1);
const char *src_devaddr, *tgt_devaddr;
__be32 src_ipaddr, tgt_ipaddr;
long ret;
#de... | 0 | [
"CWE-200"
] | linux-2.6 | 42eab94fff18cb1091d3501cd284d6bd6cc9c143 | 331,169,170,413,192,250,000,000,000,000,000,000,000 | 103 | netfilter: arp_tables: fix infoleak to userspace
Structures ipt_replace, compat_ipt_replace, and xt_get_revision are
copied from userspace. Fields of these structs that are
zero-terminated strings are not checked. When they are used as argument
to a format string containing "%s" in request_module(), some sensitive
i... |
xmlSaveTree(xmlSaveCtxtPtr ctxt, xmlNodePtr node)
{
long ret = 0;
if ((ctxt == NULL) || (node == NULL)) return(-1);
xmlNodeDumpOutputInternal(ctxt, node);
return(ret);
} | 0 | [
"CWE-502"
] | libxml2 | c97750d11bb8b6f3303e7131fe526a61ac65bcfd | 3,255,725,072,846,040,700,000,000,000,000,000,000 | 8 | Avoid an out of bound access when serializing malformed strings
For https://bugzilla.gnome.org/show_bug.cgi?id=766414
* xmlsave.c: xmlBufAttrSerializeTxtContent() if an attribute value
is not UTF-8 be more careful when serializing it as we may do an
out of bound access as a result. |
long keyctl_read_key(key_serial_t keyid, char __user *buffer, size_t buflen)
{
struct key *key;
key_ref_t key_ref;
long ret;
/* find the key first */
key_ref = lookup_user_key(keyid, 0, 0);
if (IS_ERR(key_ref)) {
ret = -ENOKEY;
goto error;
}
key = key_ref_to_ptr(key_ref);
/* see if we can read it direct... | 0 | [
"CWE-476"
] | linux-2.6 | 9d1ac65a9698513d00e5608d93fca0c53f536c14 | 25,417,930,522,299,463,000,000,000,000,000,000,000 | 51 | KEYS: Fix RCU no-lock warning in keyctl_session_to_parent()
There's an protected access to the parent process's credentials in the middle
of keyctl_session_to_parent(). This results in the following RCU warning:
===================================================
[ INFO: suspicious rcu_dereference_check() usage.... |
void LeakyReluFree(TfLiteContext* context, void* buffer) {
delete reinterpret_cast<LeakyReluOpData*>(buffer);
} | 0 | [
"CWE-125",
"CWE-787"
] | tensorflow | 1970c2158b1ffa416d159d03c3370b9a462aee35 | 223,747,838,822,318,000,000,000,000,000,000,000,000 | 3 | [tflite]: Insert `nullptr` checks when obtaining tensors.
As part of ongoing refactoring, `tflite::GetInput`, `tflite::GetOutput`, `tflite::GetTemporary` and `tflite::GetIntermediates` will return `nullptr` in some cases. Hence, we insert the `nullptr` checks on all usages.
We also insert `nullptr` checks on usages o... |
bool SetTLSSession(
const SSLPointer& ssl,
const SSLSessionPointer& session) {
return session != nullptr && SSL_set_session(ssl.get(), session.get()) == 1;
} | 0 | [
"CWE-295"
] | node | 466e5415a2b7b3574ab5403acb87e89a94a980d1 | 86,576,692,962,037,780,000,000,000,000,000,000,000 | 5 | crypto,tls: implement safe x509 GeneralName format
This change introduces JSON-compatible escaping rules for strings that
include X.509 GeneralName components (see RFC 5280). This non-standard
format avoids ambiguities and prevents injection attacks that could
previously lead to X.509 certificates being accepted even ... |
leading_DYN(DYNBUF * buffer, const char *leading)
{
bool result = FALSE;
size_t need = strlen(leading);
if (buffer->used > need) {
need = buffer->used - need;
if (!strcmp(buffer->text + need, leading)) {
result = TRUE;
while (--need != 0) {
if (buffer->text[need] == '\n') {
break;
}
... | 0 | [
"CWE-125"
] | ncurses | b025434573f466efe27862656a6a9d41dd2bd609 | 102,304,986,497,768,450,000,000,000,000,000,000,000 | 21 | ncurses 6.1 - patch 20191012
+ amend recent changes to ncurses*-config and pc-files to filter out
Debian linker-flags (report by Sven Joachim, cf: 20150516).
+ clarify relationship between tic, infocmp and captoinfo in manpage.
+ check for invalid hashcode in _nc_find_type_entry and
_nc_find_name_entry.
> fix seve... |
void KaxBlockBlob::SetBlockGroup( KaxBlockGroup &BlockRef )
{
assert(!bUseSimpleBlock);
Block.group = &BlockRef;
} | 0 | [
"CWE-200",
"CWE-399",
"CWE-119"
] | libmatroska | 0a2d3e3644a7453b6513db2f9bc270f77943573f | 151,851,333,329,848,850,000,000,000,000,000,000,000 | 5 | KaxBlockInternal: check EBML lace sizes against available buffer space |
static void theme_read_formats(THEME_REC *theme, const char *module,
CONFIG_REC *config, MODULE_THEME_REC *rec)
{
CONFIG_NODE *node;
GSList *tmp;
node = config_node_traverse(config, "formats", FALSE);
if (node == NULL) return;
node = config_node_section(config, node, module, -1);
if (node == NULL) retu... | 0 | [
"CWE-416"
] | irssi | 43e44d553d44e313003cee87e6ea5e24d68b84a1 | 184,824,160,801,527,470,000,000,000,000,000,000,000 | 20 | Merge branch 'security' into 'master'
Security
Closes GL#12, GL#13, GL#14, GL#15, GL#16
See merge request irssi/irssi!23 |
static ssize_t n_hdlc_tty_read(struct tty_struct *tty, struct file *file,
__u8 __user *buf, size_t nr)
{
struct n_hdlc *n_hdlc = tty2n_hdlc(tty);
int ret = 0;
struct n_hdlc_buf *rbuf;
DECLARE_WAITQUEUE(wait, current);
if (debuglevel >= DEBUG_LEVEL_INFO)
printk("%s(%d)n_hdlc_tty_read() called\n",__FILE__,... | 0 | [
"CWE-362"
] | tty | 82f2341c94d270421f383641b7cd670e474db56b | 271,738,856,333,737,450,000,000,000,000,000,000,000 | 74 | tty: n_hdlc: get rid of racy n_hdlc.tbuf
Currently N_HDLC line discipline uses a self-made singly linked list for
data buffers and has n_hdlc.tbuf pointer for buffer retransmitting after
an error.
The commit be10eb7589337e5defbe214dae038a53dd21add8
("tty: n_hdlc add buffer flushing") introduced racy access to n_hdlc.... |
find_folder_response_cb (ESoapResponse *response,
GSimpleAsyncResult *simple)
{
EwsAsyncData *async_data;
ESoapParameter *param;
ESoapParameter *subparam;
GError *error = NULL;
async_data = g_simple_async_result_get_op_res_gpointer (simple);
param = e_soap_response_get_first_parameter_by_name (
response, ... | 0 | [
"CWE-295"
] | evolution-ews | 915226eca9454b8b3e5adb6f2fff9698451778de | 192,425,721,401,166,900,000,000,000,000,000,000,000 | 39 | I#27 - SSL Certificates are not validated
This depends on https://gitlab.gnome.org/GNOME/evolution-data-server/commit/6672b8236139bd6ef41ecb915f4c72e2a052dba5 too.
Closes https://gitlab.gnome.org/GNOME/evolution-ews/issues/27 |
init_tracer_tracefs(struct trace_array *tr, struct dentry *d_tracer)
{
int cpu;
trace_create_file("available_tracers", 0444, d_tracer,
tr, &show_traces_fops);
trace_create_file("current_tracer", 0644, d_tracer,
tr, &set_tracer_fops);
trace_create_file("tracing_cpumask", 0644, d_tracer,
tr, &tracing_cp... | 0 | [
"CWE-415"
] | linux | 4397f04575c44e1440ec2e49b6302785c95fd2f8 | 112,349,043,263,015,120,000,000,000,000,000,000,000 | 63 | tracing: Fix possible double free on failure of allocating trace buffer
Jing Xia and Chunyan Zhang reported that on failing to allocate part of the
tracing buffer, memory is freed, but the pointers that point to them are not
initialized back to NULL, and later paths may try to free the freed memory
again. Jing and Chu... |
static inline void pmdp_set_wrprotect(struct mm_struct *mm,
unsigned long address, pmd_t *pmdp)
{
pmd_t old_pmd = *pmdp;
set_pmd_at(mm, address, pmdp, pmd_wrprotect(old_pmd));
} | 0 | [
"CWE-264"
] | linux-2.6 | 1a5a9906d4e8d1976b701f889d8f35d54b928f25 | 119,505,281,897,334,580,000,000,000,000,000,000,000 | 6 | mm: thp: fix pmd_bad() triggering in code paths holding mmap_sem read mode
In some cases it may happen that pmd_none_or_clear_bad() is called with
the mmap_sem hold in read mode. In those cases the huge page faults can
allocate hugepmds under pmd_none_or_clear_bad() and that can trigger a
false positive from pmd_bad(... |
file_tryelf(struct magic_set *ms, int fd, const unsigned char *buf,
size_t nbytes)
{
union {
int32_t l;
char c[sizeof (int32_t)];
} u;
int clazz;
int swap;
struct stat st;
off_t fsize;
int flags = 0;
Elf32_Ehdr elf32hdr;
Elf64_Ehdr elf64hdr;
uint16_t type;
if (ms->flags & (MAGIC_MIME|MAGIC_APPLE))
... | 1 | [
"CWE-399",
"CWE-284"
] | file | b4c01141e5367f247b84dcaf6aefbb4e741842b8 | 84,970,782,852,994,770,000,000,000,000,000,000,000 | 64 | - limit the number of program and section header number of sections to be
processed to avoid excessive processing time.
- if a bad note is found, return 0 to stop processing immediately. |
CURLcode Curl_output_negotiate(struct connectdata *conn, bool proxy)
{
struct negotiatedata *neg_ctx = proxy?&conn->data->state.proxyneg:
&conn->data->state.negotiate;
char *encoded = NULL;
size_t len = 0;
char *userp;
CURLcode error;
error = Curl_base64_encode(conn->data,
... | 0 | [
"CWE-284"
] | curl | f78ae415d24b9bd89d6c121c556e411fdb21c6aa | 277,096,738,959,603,330,000,000,000,000,000,000,000 | 29 | Don't clear GSSAPI state between each exchange in the negotiation
GSSAPI doesn't work very well if we forget everything ever time.
XX: Is Curl_http_done() the right place to do the final cleanup? |
BPF_CALL_5(bpf_csum_diff, __be32 *, from, u32, from_size,
__be32 *, to, u32, to_size, __wsum, seed)
{
struct bpf_scratchpad *sp = this_cpu_ptr(&bpf_sp);
u32 diff_size = from_size + to_size;
int i, j = 0;
/* This is quite flexible, some examples:
*
* from_size == 0, to_size > 0, seed := csum --> pushing da... | 0 | [
"CWE-120"
] | linux | 050fad7c4534c13c8eb1d9c2ba66012e014773cb | 65,945,491,729,034,530,000,000,000,000,000,000,000 | 26 | 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... |
void iwl_fw_dbg_read_d3_debug_data(struct iwl_fw_runtime *fwrt)
{
const struct iwl_cfg *cfg = fwrt->trans->cfg;
if (!iwl_fw_dbg_is_d3_debug_enabled(fwrt))
return;
if (!fwrt->dump.d3_debug_data) {
fwrt->dump.d3_debug_data = kmalloc(cfg->d3_debug_data_length,
GFP_KERNEL);
if (!fwrt->dump.d3_debug_data... | 0 | [
"CWE-400",
"CWE-401"
] | linux | b4b814fec1a5a849383f7b3886b654a13abbda7d | 49,219,463,528,972,940,000,000,000,000,000,000,000 | 22 | iwlwifi: dbg_ini: fix memory leak in alloc_sgtable
In alloc_sgtable if alloc_page fails, the alocated table should be
released.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com> |
static int sctp_v6_addr_valid(union sctp_addr *addr,
struct sctp_sock *sp,
const struct sk_buff *skb)
{
int ret = ipv6_addr_type(&addr->v6.sin6_addr);
/* Support v4-mapped-v6 address. */
if (ret == IPV6_ADDR_MAPPED) {
/* Note: This routine is used in input, so v4-mapped-v6
* are disallowed he... | 0 | [
"CWE-310"
] | net | 95ee62083cb6453e056562d91f597552021e6ae7 | 243,212,512,088,933,340,000,000,000,000,000,000,000 | 25 | net: sctp: fix ipv6 ipsec encryption bug in sctp_v6_xmit
Alan Chester reported an issue with IPv6 on SCTP that IPsec traffic is not
being encrypted, whereas on IPv4 it is. Setting up an AH + ESP transport
does not seem to have the desired effect:
SCTP + IPv4:
22:14:20.809645 IP (tos 0x2,ECT(0), ttl 64, id 0, offse... |
xps_setfillcolor(gx_device_vector *vdev, const gs_gstate *pgs, const gx_drawing_color *pdc)
{
gx_device_xps *xps = (gx_device_xps *)vdev;
if_debug1m('_', xps->memory, "xps_setfillcolor:%06X\n", (uint32_t)gx_dc_pure_color(pdc));
return set_state_color(vdev, pdc, &xps->fillcolor);
} | 0 | [] | ghostpdl | 94d8955cb7725eb5f3557ddc02310c76124fdd1a | 327,584,195,180,238,640,000,000,000,000,000,000,000 | 8 | Bug 701818: better handling of error during PS/PDF image
In the xps device, if an error occurred after xps_begin_image() but before
xps_image_end_image(), *if* the Postscript had called 'restore' as part of the
error handling, the image enumerator would have been freed (by the restore)
despite the xps device still hol... |
static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb,
struct net_device *dev)
{
struct ip_tunnel *tunnel = netdev_priv(dev);
struct net_device_stats *stats = &dev->stats;
struct netdev_queue *txq = netdev_get_tx_queue(dev, 0);
struct iphdr *tiph = &tunnel->parms.iph;
struct ipv6hdr *iph6 = ipv6_hdr(s... | 0 | [] | linux-2.6 | d5aa407f59f5b83d2c50ec88f5bf56d40f1f8978 | 198,840,191,124,268,820,000,000,000,000,000,000,000 | 189 | 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> |
GF_Err paen_box_read(GF_Box *s, GF_BitStream *bs)
{
return gf_isom_box_array_read(s, bs, fiin_on_child_box); | 0 | [
"CWE-787"
] | gpac | 388ecce75d05e11fc8496aa4857b91245007d26e | 150,550,884,132,978,720,000,000,000,000,000,000,000 | 4 | fixed #1587 |
ProcessTCPHeader(tTcpIpPacketParsingResult _res, PVOID pIpHeader, ULONG len, USHORT ipHeaderSize)
{
ULONG tcpipDataAt;
tTcpIpPacketParsingResult res = _res;
tcpipDataAt = ipHeaderSize + sizeof(TCPHeader);
res.TcpUdp = ppresIsTCP;
if (len >= tcpipDataAt)
{
TCPHeader *pTcpHeader = (TCPHea... | 0 | [
"CWE-20"
] | kvm-guest-drivers-windows | 723416fa4210b7464b28eab89cc76252e6193ac1 | 208,642,182,465,095,520,000,000,000,000,000,000,000 | 23 | NetKVM: BZ#1169718: Checking the length only on read
Signed-off-by: Joseph Hindin <yhindin@rehat.com> |
quit_timeout(void *arg)
{
/* Return with non-zero status if the clock is not synchronised */
exit_status = REF_GetOurStratum() >= NTP_MAX_STRATUM;
SCH_QuitProgram();
} | 0 | [
"CWE-59"
] | chrony | e18903a6b56341481a2e08469c0602010bf7bfe3 | 124,359,942,244,490,770,000,000,000,000,000,000,000 | 6 | switch to new util file functions
Replace all fopen(), rename(), and unlink() calls with the new util
functions. |
void streamReplyWithCGLag(client *c, stream *s, streamCG *cg) {
int valid = 0;
long long lag = 0;
if (!s->entries_added) {
/* The lag of a newly-initialized stream is 0. */
lag = 0;
valid = 1;
} else if (cg->entries_read != SCG_INVALID_ENTRIES_READ && !streamRangeHasTombstones(s... | 0 | [
"CWE-703",
"CWE-401"
] | redis | 4a7a4e42db8ff757cdf3f4a824f66426036034ef | 285,483,011,389,131,440,000,000,000,000,000,000,000 | 29 | Fix memory leak in streamGetEdgeID (#10753)
si is initialized by streamIteratorStart(), we should call
streamIteratorStop() on it when done.
regression introduced in #9127 (redis 7.0) |
PHP_RINIT_FUNCTION(spl) /* {{{ */
{
SPL_G(autoload_extensions) = NULL;
SPL_G(autoload_extensions_len) = 0;
SPL_G(autoload_functions) = NULL;
SPL_G(hash_mask_init) = 0;
return SUCCESS; | 0 | [] | php-src | b584b513983319be170f02828bc7c12850b40320 | 115,462,009,423,960,700,000,000,000,000,000,000,000 | 8 | Fixed bug #70290 (Null pointer deref (segfault) in spl_autoload via ob_start) |
void test_nghttp2_session_recv(void) {
nghttp2_session *session;
nghttp2_session_callbacks callbacks;
scripted_data_feed df;
my_user_data user_data;
nghttp2_bufs bufs;
size_t framelen;
nghttp2_frame frame;
size_t i;
nghttp2_outbound_item *item;
nghttp2_nv *nva;
size_t nvlen;
nghttp2_hd_deflater ... | 0 | [] | nghttp2 | 0a6ce87c22c69438ecbffe52a2859c3a32f1620f | 186,756,546,689,706,570,000,000,000,000,000,000,000 | 120 | Add nghttp2_option_set_max_outbound_ack |
static void vmci_transport_handle_detach(struct sock *sk)
{
struct vsock_sock *vsk;
vsk = vsock_sk(sk);
if (!vmci_handle_is_invalid(vmci_trans(vsk)->qp_handle)) {
sock_set_flag(sk, SOCK_DONE);
/* On a detach the peer will not be sending or receiving
* anymore.
*/
vsk->peer_shutdown = SHUTDOWN_MASK;
... | 0 | [
"CWE-20",
"CWE-269"
] | linux | f3d3342602f8bcbf37d7c46641cb9bca7618eb1c | 223,478,155,415,546,840,000,000,000,000,000,000,000 | 37 | net: rework recvmsg handler msg_name and msg_namelen logic
This patch now always passes msg->msg_namelen as 0. recvmsg handlers must
set msg_namelen to the proper size <= sizeof(struct sockaddr_storage)
to return msg_name to the user.
This prevents numerous uninitialized memory leaks we had in the
recvmsg handlers an... |
http_dissect_hdrs(struct worker *w, struct http *hp, int fd, char *p,
const struct http_conn *htc)
{
char *q, *r;
txt t = htc->rxbuf;
if (*p == '\r')
p++;
hp->nhd = HTTP_HDR_FIRST;
hp->conds = 0;
r = NULL; /* For FlexeLint */
for (; p < t.e; p = r) {
/* Find end of next header */
q = r = p;
while... | 0 | [] | Varnish-Cache | 29870c8fe95e4e8a672f6f28c5fbe692bea09e9c | 330,284,753,108,613,970,000,000,000,000,000,000,000 | 70 | Check for duplicate Content-Length headers in requests
If a duplicate CL header is in the request, we fail the request with a
400 (Bad Request)
Fix a test case that was sending duplicate CL by misstake and would
not fail because of that. |
void MSG_BeginReading( msg_t *msg ) {
msg->readcount = 0;
msg->bit = 0;
msg->oob = qfalse;
} | 0 | [
"CWE-119"
] | ioq3 | d2b1d124d4055c2fcbe5126863487c52fd58cca1 | 273,253,666,848,699,820,000,000,000,000,000,000,000 | 5 | Fix/improve buffer overflow in MSG_ReadBits/MSG_WriteBits
Prevent reading past end of message in MSG_ReadBits. If read past
end of msg->data buffer (16348 bytes) the engine could SEGFAULT.
Make MSG_WriteBits use an exact buffer overflow check instead of
possibly failing with a few bytes left. |
static void _anal_calls(RCore *core, ut64 addr, ut64 addr_end) {
RAnalOp op;
int bufi;
int depth = r_config_get_i (core->config, "anal.depth");
const int addrbytes = core->io->addrbytes;
const int bsz = 4096;
ut8 *buf;
ut8 *block;
bufi = 0;
if (addr_end - addr > UT32_MAX) {
return;
}
buf = malloc (bsz);
b... | 0 | [
"CWE-416",
"CWE-908"
] | radare2 | 9d348bcc2c4bbd3805e7eec97b594be9febbdf9a | 74,002,328,302,404,590,000,000,000,000,000,000,000 | 84 | Fix #9943 - Invalid free on RAnal.avr |
void *__kmalloc_track_caller(size_t size, gfp_t flags, unsigned long caller)
{
return __do_kmalloc(size, flags, caller);
} | 0 | [
"CWE-703"
] | linux | c4e490cf148e85ead0d1b1c2caaba833f1d5b29f | 216,492,925,834,177,040,000,000,000,000,000,000,000 | 4 | mm/slab.c: fix SLAB freelist randomization duplicate entries
This patch fixes a bug in the freelist randomization code. When a high
random number is used, the freelist will contain duplicate entries. It
will result in different allocations sharing the same chunk.
It will result in odd behaviours and crashes. It sh... |
authentic_set_security_env(struct sc_card *card,
const struct sc_security_env *env, int se_num)
{
struct sc_context *ctx = card->ctx;
struct sc_apdu apdu;
unsigned char cse_crt_dst[] = {
0x80, 0x01, AUTHENTIC_ALGORITHM_RSA_PKCS1,
0x83, 0x01, env->key_ref[0] & ~AUTHENTIC_OBJECT_REF_FLAG_LOCAL,
};
unsigned cha... | 0 | [
"CWE-125"
] | OpenSC | 8fe377e93b4b56060e5bbfb6f3142ceaeca744fa | 72,378,609,068,103,130,000,000,000,000,000,000,000 | 42 | fixed out of bounds reads
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting and suggesting security fixes. |
static void ext4_falloc_update_inode(struct inode *inode,
int mode, loff_t new_size, int update_ctime)
{
struct timespec now;
if (update_ctime) {
now = current_fs_time(inode->i_sb);
if (!timespec_equal(&inode->i_ctime, &now))
inode->i_ctime = now;
}
/*
* Update only when preallocation was requested be... | 0 | [
"CWE-703"
] | linux | 744692dc059845b2a3022119871846e74d4f6e11 | 221,078,174,511,010,120,000,000,000,000,000,000,000 | 29 | 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... |
Field_longstr::report_if_important_data(const char *pstr, const char *end,
bool count_spaces)
{
THD *thd;
if ((pstr < end) &&
(thd= get_thd())->count_cuted_fields > CHECK_FIELD_EXPRESSION)
{
if (test_if_important_data(field_charset, pstr, end))
{
if (thd... | 0 | [
"CWE-416",
"CWE-703"
] | server | 08c7ab404f69d9c4ca6ca7a9cf7eec74c804f917 | 276,631,233,074,844,620,000,000,000,000,000,000,000 | 24 | MDEV-24176 Server crashes after insert in the table with virtual
column generated using date_format() and if()
vcol_info->expr is allocated on expr_arena at parsing stage. Since
expr item is allocated on expr_arena all its containee items must be
allocated on expr_arena too. Otherwise fix_session_expr() will
encounter... |
int put_cmsg_compat(struct msghdr *kmsg, int level, int type, int len, void *data)
{
struct compat_cmsghdr __user *cm = (struct compat_cmsghdr __user *) kmsg->msg_control;
struct compat_cmsghdr cmhdr;
struct compat_timeval ctv;
struct compat_timespec cts[3];
int cmlen;
if (cm == NULL || kmsg->msg_controllen < si... | 0 | [
"CWE-20",
"CWE-269"
] | linux | f3d3342602f8bcbf37d7c46641cb9bca7618eb1c | 275,986,426,935,998,240,000,000,000,000,000,000,000 | 55 | net: rework recvmsg handler msg_name and msg_namelen logic
This patch now always passes msg->msg_namelen as 0. recvmsg handlers must
set msg_namelen to the proper size <= sizeof(struct sockaddr_storage)
to return msg_name to the user.
This prevents numerous uninitialized memory leaks we had in the
recvmsg handlers an... |
flatpak_collection_ref_free (FlatpakCollectionRef *ref)
{
g_return_if_fail (ref != NULL);
g_free (ref->collection_id);
g_free (ref->ref_name);
g_free (ref);
} | 0 | [
"CWE-668"
] | flatpak | cd2142888fc4c199723a0dfca1f15ea8788a5483 | 287,017,393,454,944,000,000,000,000,000,000,000,000 | 8 | Don't expose /proc when running apply_extra
As shown by CVE-2019-5736, it is sometimes possible for the sandbox
app to access outside files using /proc/self/exe. This is not
typically an issue for flatpak as the sandbox runs as the user which
has no permissions to e.g. modify the host files.
However, when installing ... |
http_VSLH_del(const struct http *hp, unsigned hdr)
{
int i;
if (hp->vsl != NULL) {
/* We don't support unsetting stuff in the first line */
assert (hdr >= HTTP_HDR_FIRST);
AN(hp->vsl->wid & (VSL_CLIENTMARKER|VSL_BACKENDMARKER));
i = (HTTP_... | 0 | [
"CWE-476"
] | varnish-modules | 2c120e576ebb73bc247790184702ba58dc0afc39 | 155,853,434,644,613,680,000,000,000,000,000,000,000 | 13 | Check VRT_StrandsWS() return value
Fixes: VSV00006 |
ha_partition::~ha_partition()
{
DBUG_ENTER("ha_partition::~ha_partition()");
if (m_file != NULL)
{
uint i;
for (i= 0; i < m_tot_parts; i++)
delete m_file[i];
}
destroy_record_priority_queue();
my_free(m_part_ids_sorted_by_num_of_records);
clear_handler_file();
DBUG_VOID_RETURN;
} | 0 | [] | mysql-server | be901b60ae59c93848c829d1b0b2cb523ab8692e | 117,503,971,997,044,780,000,000,000,000,000,000,000 | 15 | Bug#26390632: CREATE TABLE CAN CAUSE MYSQL TO EXIT.
Analysis
========
CREATE TABLE of InnoDB table with a partition name
which exceeds the path limit can cause the server
to exit.
During the preparation of the partition name,
there was no check to identify whether the complete
path name for partition exceeds the max ... |
void hfi1_mmu_rb_evict(struct mmu_rb_handler *handler, void *evict_arg)
{
struct mmu_rb_node *rbnode, *ptr;
struct list_head del_list;
unsigned long flags;
bool stop = false;
if (current->mm != handler->mn.mm)
return;
INIT_LIST_HEAD(&del_list);
spin_lock_irqsave(&handler->lock, flags);
list_for_each_entry_... | 0 | [
"CWE-416"
] | linux | 3d2a9d642512c21a12d19b9250e7a835dcb41a79 | 328,264,439,723,920,550,000,000,000,000,000,000,000 | 32 | IB/hfi1: Ensure correct mm is used at all times
Two earlier bug fixes have created a security problem in the hfi1
driver. One fix aimed to solve an issue where current->mm was not valid
when closing the hfi1 cdev. It attempted to do this by saving a cached
value of the current->mm pointer at file open time. This is a ... |
bool samdb_is_gc(struct ldb_context *ldb)
{
uint32_t options = 0;
if (samdb_ntds_options(ldb, &options) != LDB_SUCCESS) {
return false;
}
return (options & DS_NTDSDSA_OPT_IS_GC) != 0;
} | 0 | [
"CWE-200"
] | samba | 0a3aa5f908e351201dc9c4d4807b09ed9eedff77 | 145,046,609,330,209,480,000,000,000,000,000,000,000 | 8 | CVE-2022-32746 ldb: Make use of functions for appending to an ldb_message
This aims to minimise usage of the error-prone pattern of searching for
a just-added message element in order to make modifications to it (and
potentially finding the wrong element).
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15009
Signed... |
void test_nghttp2_submit_shutdown_notice(void) {
nghttp2_session *session;
nghttp2_session_callbacks callbacks;
my_user_data ud;
memset(&callbacks, 0, sizeof(nghttp2_session_callbacks));
callbacks.send_callback = null_send_callback;
callbacks.on_frame_send_callback = on_frame_send_callback;
callbacks.on_... | 0 | [] | nghttp2 | 0a6ce87c22c69438ecbffe52a2859c3a32f1620f | 150,860,440,615,949,920,000,000,000,000,000,000,000 | 55 | Add nghttp2_option_set_max_outbound_ack |
void base64_encode_xmlrpc(struct buffer_st *b, const char *source, int length)
{
int i, hiteof = 0;
int offset = 0;
int olen;
olen = 0;
buffer_new(b);
/* Fill dtable with character encodings. */
for (i = 0; i < 26; i++) {
dtable[i] = 'A' + i;
dtable[26 + i] = 'a' + i;
}
for (i = 0; i < 10... | 0 | [
"CWE-125"
] | php-src | 1cc2182bcc81e185c14837e659d12b268cb99d63 | 321,515,047,206,961,930,000,000,000,000,000,000,000 | 64 | Fix bug #77380 (Global out of bounds read in xmlrpc base64 code) |
TEST_P(QuicHttpIntegrationTest, ConnectionMigration) {
concurrency_ = 2;
set_reuse_port_ = true;
initialize();
uint32_t old_port = lookupPort("http");
codec_client_ = makeHttpConnection(old_port);
auto encoder_decoder =
codec_client_->startRequest(Http::TestRequestHeaderMapImpl{{":method", "POST"},
... | 0 | [
"CWE-400"
] | envoy | 0e49a495826ea9e29134c1bd54fdeb31a034f40c | 45,495,480,839,393,250,000,000,000,000,000,000,000 | 37 | 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... |
static void handle_data_sections(RBinSection *sect) {
if (strstr (sect->name, "_cstring")) {
sect->is_data = true;
} else if (strstr (sect->name, "_os_log")) {
sect->is_data = true;
} else if (strstr (sect->name, "_objc_methname")) {
sect->is_data = true;
} else if (strstr (sect->name, "_objc_classname")) {
... | 0 | [
"CWE-476"
] | radare2 | feaa4e7f7399c51ee6f52deb84dc3f795b4035d6 | 103,016,782,376,252,400,000,000,000,000,000,000,000 | 13 | Fix null deref in xnu.kernelcache ##crash
* Reported by @xshad3 via huntr.dev |
rle_write (FILE *fp,
guchar *buf,
guint width,
guint bytes)
{
gint repeat = 0;
gint direct = 0;
guchar *from = buf;
guint x;
for (x = 1; x < width; ++x)
{
if (memcmp (buf, buf + bytes, bytes))
{
/* next pixel is different */
... | 0 | [
"CWE-125"
] | GIMP | 674b62ad45b6579ec6d7923dc3cb1ef4e8b5498b | 105,444,828,713,837,100,000,000,000,000,000,000,000 | 76 | Bug 739134 - (CVE-2017-17786) Out of bounds read / heap overflow in...
... TGA importer.
Be more thorough on valid TGA RGB and RGBA images.
In particular current TGA plug-in can import RGBA as 32 bits (8 bits per
channel) and 16 bits (5 bits per color channel and 1 bit for alpha), and
RGB as 15 and 24 bits.
Maybe the... |
void ipt_unregister_table(struct net *net, struct xt_table *table,
const struct nf_hook_ops *ops)
{
if (ops)
ipt_unregister_table_pre_exit(net, table, ops);
__ipt_unregister_table(net, table);
} | 0 | [
"CWE-787"
] | linux | b29c457a6511435960115c0f548c4360d5f4801d | 313,863,633,572,037,000,000,000,000,000,000,000,000 | 7 | netfilter: x_tables: fix compat match/target pad out-of-bound write
xt_compat_match/target_from_user doesn't check that zeroing the area
to start of next rule won't write past end of allocated ruleset blob.
Remove this code and zero the entire blob beforehand.
Reported-by: syzbot+cfc0247ac173f597aaaa@syzkaller.appsp... |
void bigint_sub2_rev(word x[], const word y[], size_t y_size)
{
word borrow = 0;
const size_t blocks = y_size - (y_size % 8);
for(size_t i = 0; i != blocks; i += 8)
borrow = word8_sub2_rev(x + i, y + i, borrow);
for(size_t i = blocks; i != y_size; ++i)
x[i] = word_sub(y[i], x[i], &borrow)... | 0 | [
"CWE-200"
] | botan | bcf13fa153a11b3e0ad54e2af6962441cea3adf1 | 311,183,597,165,504,470,000,000,000,000,000,000,000 | 15 | Fixes for CVE-2015-7827 and CVE-2016-2849 |
int vnc_display_pw_expire(DisplayState *ds, time_t expires)
{
VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display;
if (!vs) {
return -EINVAL;
}
vs->expires = expires;
return 0;
} | 0 | [
"CWE-125"
] | qemu | 9f64916da20eea67121d544698676295bbb105a7 | 304,119,207,845,026,650,000,000,000,000,000,000,000 | 11 | pixman/vnc: use pixman images in vnc.
The vnc code uses *three* DisplaySurfaces:
First is the surface of the actual QemuConsole, usually the guest
screen, but could also be a text console (monitor/serial reachable via
Ctrl-Alt-<nr> keys). This is left as-is.
Second is the current server's view of the screen content... |
const char *message() const { return m_message; } | 0 | [
"CWE-264"
] | mysql-server | 48bd8b16fe382be302c6f0b45931be5aa6f29a0e | 7,757,205,996,911,099,000,000,000,000,000,000,000 | 1 | Bug#24388753: PRIVILEGE ESCALATION USING MYSQLD_SAFE
[This is the 5.5/5.6 version of the bugfix].
The problem was that it was possible to write log files ending
in .ini/.cnf that later could be parsed as an options file.
This made it possible for users to specify startup options
without the permissions to do so.
Thi... |
SPL_METHOD(SplObjectStorage, count)
{
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(getThis());
zend_long mode = COUNT_NORMAL;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &mode) == FAILURE) {
return;
}
if (mode == COUNT_RECURSIVE) {
zend_long ret = zend_hash_num_elements(&intern->storage);
zval *el... | 0 | [
"CWE-119",
"CWE-787"
] | php-src | 61cdd1255d5b9c8453be71aacbbf682796ac77d4 | 114,099,909,505,537,970,000,000,000,000,000,000,000 | 23 | Fix bug #73257 and bug #73258 - SplObjectStorage unserialize allows use of non-object as key |
GF_Err audio_sample_entry_box_read(GF_Box *s, GF_BitStream *bs)
{
GF_MPEGAudioSampleEntryBox *ptr;
char *data;
u8 a, b, c, d;
u32 i, size, v, nb_alnum;
GF_Err e;
u64 pos, start;
ptr = (GF_MPEGAudioSampleEntryBox *)s;
start = gf_bs_get_position(bs);
gf_bs_seek(bs, start + 8);
v = gf_bs_read_u16(bs);
if (v)
... | 0 | [
"CWE-787"
] | gpac | 77510778516803b7f7402d7423c6d6bef50254c3 | 161,739,978,822,005,300,000,000,000,000,000,000,000 | 97 | fixed #2255 |
static void cms_env_set_version(CMS_EnvelopedData *env)
{
int i;
CMS_RecipientInfo *ri;
/*
* Can't set version higher than 4 so if 4 or more already nothing to do.
*/
if (env->version >= 4)
return;
cms_env_set_originfo_version(env);
if (env->version >= 3)
return;
... | 0 | [
"CWE-311",
"CWE-327"
] | openssl | 08229ad838c50f644d7e928e2eef147b4308ad64 | 63,696,662,364,955,750,000,000,000,000,000,000,000 | 32 | Fix a padding oracle in PKCS7_dataDecode and CMS_decrypt_set1_pkey
An attack is simple, if the first CMS_recipientInfo is valid but the
second CMS_recipientInfo is chosen ciphertext. If the second
recipientInfo decodes to PKCS #1 v1.5 form plaintext, the correct
encryption key will be replaced by garbage, and the mess... |
static struct tun_struct *__tun_get(struct tun_file *tfile)
{
struct tun_struct *tun;
rcu_read_lock();
tun = rcu_dereference(tfile->tun);
if (tun)
dev_hold(tun->dev);
rcu_read_unlock();
return tun;
} | 0 | [
"CWE-476"
] | linux | 0ad646c81b2182f7fa67ec0c8c825e0ee165696d | 174,287,685,836,335,300,000,000,000,000,000,000,000 | 12 | 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... |
R_API bool r_sys_arch_match(const char *archstr, const char *arch) {
char *ptr;
if (!archstr || !arch || !*archstr || !*arch) {
return true;
}
if (!strcmp (archstr, "*") || !strcmp (archstr, "any")) {
return true;
}
if (!strcmp (archstr, arch)) {
return true;
}
if ((ptr = strstr (archstr, arch))) {
char... | 0 | [
"CWE-78"
] | radare2 | 04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9 | 8,705,226,984,152,439,000,000,000,000,000,000,000 | 19 | Fix command injection on PDB download (#16966)
* Fix r_sys_mkdirp with absolute path on Windows
* Fix build with --with-openssl
* Use RBuffer in r_socket_http_answer()
* r_socket_http_answer: Fix read for big responses
* Implement r_str_escape_sh()
* Cleanup r_socket_connect() on Windows
* Fix socket being creat... |
static int moverect_internal(VTermRect dest, VTermRect src, void *user)
{
VTermScreen *screen = user;
if(screen->callbacks && screen->callbacks->sb_pushline &&
dest.start_row == 0 && dest.start_col == 0 && // starts top-left corner
dest.end_col == screen->cols && // full width
screen... | 0 | [
"CWE-476"
] | vim | cd929f7ba8cc5b6d6dcf35c8b34124e969fed6b8 | 12,191,140,909,223,408,000,000,000,000,000,000,000 | 42 | patch 8.1.0633: crash when out of memory while opening a terminal window
Problem: Crash when out of memory while opening a terminal window.
Solution: Handle out-of-memory more gracefully. |
uint32 Field_blob::char_length() const
{
return Field_blob::octet_length();
} | 0 | [
"CWE-416",
"CWE-703"
] | server | 08c7ab404f69d9c4ca6ca7a9cf7eec74c804f917 | 159,103,239,674,587,090,000,000,000,000,000,000,000 | 4 | 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... |
clear_status_flags_on_sybil(routerstatus_t *rs)
{
rs->is_authority = rs->is_exit = rs->is_stable = rs->is_fast =
rs->is_running = rs->is_named = rs->is_valid = rs->is_v2_dir =
rs->is_hs_dir = rs->is_possible_guard = rs->is_bad_exit =
rs->is_bad_directory = 0;
/* FFFF we might want some mechanism to chec... | 0 | [
"CWE-264"
] | tor | 00fffbc1a15e2696a89c721d0c94dc333ff419ef | 142,889,811,454,961,430,000,000,000,000,000,000,000 | 10 | Don't give the Guard flag to relays without the CVE-2011-2768 fix |
static int init_victim_secmap(struct f2fs_sb_info *sbi)
{
struct dirty_seglist_info *dirty_i = DIRTY_I(sbi);
unsigned int bitmap_size = f2fs_bitmap_size(MAIN_SECS(sbi));
dirty_i->victim_secmap = kvzalloc(bitmap_size, GFP_KERNEL);
if (!dirty_i->victim_secmap)
return -ENOMEM;
return 0;
} | 0 | [
"CWE-20"
] | linux | 638164a2718f337ea224b747cf5977ef143166a4 | 100,419,986,603,043,920,000,000,000,000,000,000,000 | 10 | f2fs: fix potential panic during fstrim
As Ju Hyung Park reported:
"When 'fstrim' is called for manual trim, a BUG() can be triggered
randomly with this patch.
I'm seeing this issue on both x86 Desktop and arm64 Android phone.
On x86 Desktop, this was caused during Ubuntu boot-up. I have a
cronjob installed which c... |
void ListModulesForNetwork(const CString& sLine) {
CString sUsername = sLine.Token(1);
CString sNetwork = sLine.Token(2);
if (sNetwork.empty()) {
PutModule("Usage: ListNetMods <username> <network>");
return;
}
CUser* pUser = FindUser(sUsername);
... | 0 | [
"CWE-20"
] | znc | 64613bc8b6b4adf1e32231f9844d99cd512b8973 | 51,013,174,293,138,140,000,000,000,000,000,000,000 | 25 | Don't crash if user specified invalid encoding.
This is CVE-2019-9917 |
static ssize_t _epoll_readv(
oe_fd_t* desc,
const struct oe_iovec* iov,
int iovcnt)
{
ssize_t ret = -1;
epoll_t* file = _cast_epoll(desc);
void* buf = NULL;
size_t buf_size = 0;
if (!file || (iovcnt && !iov) || iovcnt < 0 || iovcnt > OE_IOV_MAX)
OE_RAISE_ERRNO(OE_EINVAL);
/... | 1 | [
"CWE-200",
"CWE-552"
] | openenclave | bcac8e7acb514429fee9e0b5d0c7a0308fd4d76b | 1,268,362,690,002,022,400,000,000,000,000,000,000 | 35 | Merge pull request from GHSA-525h-wxcc-f66m
Signed-off-by: Ming-Wei Shih <mishih@microsoft.com> |
static int show_timer(struct seq_file *m, void *v)
{
struct k_itimer *timer;
struct timers_private *tp = m->private;
int notify;
static const char * const nstr[] = {
[SIGEV_SIGNAL] = "signal",
[SIGEV_NONE] = "none",
[SIGEV_THREAD] = "thread",
};
timer = list_entry((struct list_head *)v, struct k_itimer, li... | 0 | [
"CWE-119"
] | linux | 7f7ccc2ccc2e70c6054685f5e3522efa81556830 | 104,619,311,212,150,040,000,000,000,000,000,000,000 | 26 | proc: do not access cmdline nor environ from file-backed areas
proc_pid_cmdline_read() and environ_read() directly access the target
process' VM to retrieve the command line and environment. If this
process remaps these areas onto a file via mmap(), the requesting
process may experience various issues such as extra de... |
static void __init vmx_check_processor_compat(void *rtn)
{
struct vmcs_config vmcs_conf;
*(int *)rtn = 0;
if (setup_vmcs_config(&vmcs_conf) < 0)
*(int *)rtn = -EIO;
if (memcmp(&vmcs_config, &vmcs_conf, sizeof(struct vmcs_config)) != 0) {
printk(KERN_ERR "kvm: CPU %d feature inconsistency!\n",
smp_processor... | 0 | [
"CWE-20"
] | linux-2.6 | 16175a796d061833aacfbd9672235f2d2725df65 | 271,471,195,309,013,000,000,000,000,000,000,000,000 | 13 | KVM: VMX: Don't allow uninhibited access to EFER on i386
vmx_set_msr() does not allow i386 guests to touch EFER, but they can still
do so through the default: label in the switch. If they set EFER_LME, they
can oops the host.
Fix by having EFER access through the normal channel (which will check for
EFER_LME) even o... |
void SFS_ObjectMemberAccess(ScriptParser *parser)
{
if (parser->codec->LastError) return;
SFS_Expression(parser);
if (parser->codec->LastError) return;
SFS_AddString(parser, ".");
SFS_Identifier(parser);
} | 0 | [
"CWE-476"
] | gpac | 4e7736d7ec7bf64026daa611da951993bb42fdaf | 172,451,477,435,250,600,000,000,000,000,000,000,000 | 8 | fixed #2238 |
ext2_init_acl(struct inode *inode, struct inode *dir)
{
struct posix_acl *default_acl, *acl;
int error;
error = posix_acl_create(dir, &inode->i_mode, &default_acl, &acl);
if (error)
return error;
if (default_acl) {
error = ext2_set_acl(inode, default_acl, ACL_TYPE_DEFAULT);
posix_acl_release(default_acl);
... | 0 | [
"CWE-862",
"CWE-285"
] | linux | 073931017b49d9458aa351605b43a7e34598caef | 336,279,534,982,980,750,000,000,000,000,000,000,000 | 20 | posix_acl: Clear SGID bit when setting file permissions
When file permissions are modified via chmod(2) and the user is not in
the owning group or capable of CAP_FSETID, the setgid bit is cleared in
inode_change_ok(). Setting a POSIX ACL via setxattr(2) sets the file
permissions as well as the new ACL, but doesn't cl... |
int _gnutls_x509_decode_ext(const gnutls_datum_t *der, gnutls_x509_ext_st *out)
{
ASN1_TYPE c2 = ASN1_TYPE_EMPTY;
char str_critical[10];
char oid[MAX_OID_SIZE];
int result, len, ret;
memset(out, 0, sizeof(*out));
/* decode der */
result = asn1_create_element(_gnutls_get_pkix(), "PKIX1.Extension", &c2);
if (re... | 0 | [
"CWE-415"
] | gnutls | c5aaa488a3d6df712dc8dff23a049133cab5ec1b | 326,227,539,472,978,430,000,000,000,000,000,000,000 | 68 | gnutls_x509_ext_import_proxy: fix issue reading the policy language
If the language was set but the policy wasn't, that could lead to
a double free, as the value returned to the user was freed. |
TfLiteStatus EvalHybrid(TfLiteContext* context, TfLiteNode* node,
TfLiteFullyConnectedParams* params, OpData* data,
const TfLiteTensor* input, const TfLiteTensor* filter,
const TfLiteTensor* bias, TfLiteTensor* input_quantized,
... | 0 | [
"CWE-125",
"CWE-787"
] | tensorflow | 1970c2158b1ffa416d159d03c3370b9a462aee35 | 237,928,747,566,164,020,000,000,000,000,000,000,000 | 67 | [tflite]: Insert `nullptr` checks when obtaining tensors.
As part of ongoing refactoring, `tflite::GetInput`, `tflite::GetOutput`, `tflite::GetTemporary` and `tflite::GetIntermediates` will return `nullptr` in some cases. Hence, we insert the `nullptr` checks on all usages.
We also insert `nullptr` checks on usages o... |
const char * Config::base_name(const char * s, Action * action)
{
if (action) *action = Set;
const char * c = strchr(s, '-');
if (!c) return s;
unsigned len = c - s;
TEST("reset", 5, Reset);
TEST("enable", 6, Enable);
TEST("dont", 4, Disable);
TEST("disable", 7, Disable);
T... | 0 | [
"CWE-125"
] | aspell | 80fa26c74279fced8d778351cff19d1d8f44fe4e | 65,146,698,245,673,280,000,000,000,000,000,000,000 | 17 | Fix various bugs found by OSS-Fuze. |
QPDF::compute_encryption_key_from_password(
std::string const& password, EncryptionData const& data)
{
// Algorithm 3.2 from the PDF 1.7 Reference Manual
// This code does not properly handle Unicode passwords.
// Passwords are supposed to be converted from OS codepage
// characters to PDFDocEncodi... | 0 | [
"CWE-125"
] | qpdf | dea704f0ab7f625e1e7b3f9a1110b45b63157317 | 253,383,824,403,765,480,000,000,000,000,000,000,000 | 37 | Pad keys to avoid memory errors (fixes #147) |
evdns_server_request_add_reply(struct evdns_server_request *req_, int section, const char *name, int type, int class, int ttl, int datalen, int is_name, const char *data)
{
struct server_request *req = TO_SERVER_REQUEST(req_);
struct server_reply_item **itemp, *item;
int *countp;
int result = -1;
EVDNS_LOCK(req->... | 0 | [
"CWE-125"
] | libevent | 96f64a022014a208105ead6c8a7066018449d86d | 45,611,635,685,884,900,000,000,000,000,000,000,000 | 70 | evdns: name_parse(): fix remote stack overread
@asn-the-goblin-slayer:
"the name_parse() function in libevent's DNS code is vulnerable to a buffer overread.
971 if (cp != name_out) {
972 if (cp + 1 >= end) return -1;
973 *cp++ = '.';
974 }
975 if (cp + ... |
static MagickBooleanType DrawPolygonPrimitive(Image *image,
const DrawInfo *draw_info,const PrimitiveInfo *primitive_info,
ExceptionInfo *exception)
{
CacheView
*image_view;
MagickBooleanType
fill,
status;
double
mid;
PolygonInfo
**magick_restrict polygon_info;
register EdgeInfo
... | 0 | [
"CWE-416"
] | ImageMagick | ecf7c6b288e11e7e7f75387c5e9e93e423b98397 | 51,234,074,132,524,650,000,000,000,000,000,000,000 | 232 | ... |
static CImg<T> get_load_cimg(const char *const filename, const char axis='z', const float align=0) {
return CImg<T>().load_cimg(filename,axis,align);
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 91,523,376,620,601,340,000,000,000,000,000,000,000 | 3 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
void SFS_ArrayDeref(ScriptParser *parser)
{
if (parser->codec->LastError) return;
SFS_Expression(parser);
SFS_AddString(parser, "[");
SFS_CompoundExpression(parser);
SFS_AddString(parser, "]");
} | 1 | [
"CWE-476"
] | gpac | 4e7736d7ec7bf64026daa611da951993bb42fdaf | 75,917,018,501,934,000,000,000,000,000,000,000,000 | 8 | fixed #2238 |
static void dccp_terminate_connection(struct sock *sk)
{
u8 next_state = DCCP_CLOSED;
switch (sk->sk_state) {
case DCCP_PASSIVE_CLOSE:
case DCCP_PASSIVE_CLOSEREQ:
dccp_finish_passive_close(sk);
break;
case DCCP_PARTOPEN:
dccp_pr_debug("Stop PARTOPEN timer (%p)\n", sk);
inet_csk_clear_xmit_timer(sk, ICSK_T... | 0 | [
"CWE-189"
] | linux-2.6 | 3e8a0a559c66ee9e7468195691a56fefc3589740 | 314,103,786,641,232,850,000,000,000,000,000,000,000 | 26 | dccp: change L/R must have at least one byte in the dccpsf_val field
Thanks to Eugene Teo for reporting this problem.
Signed-off-by: Eugene Teo <eugenete@kernel.sg>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: David S. Miller <da... |
static int inetdev_event(struct notifier_block *this, unsigned long event,
void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
struct in_device *in_dev = __in_dev_get_rtnl(dev);
ASSERT_RTNL();
if (!in_dev) {
if (event == NETDEV_REGISTER) {
in_dev = inetdev_init(dev);
if (IS_ERR(in_... | 0 | [
"CWE-399"
] | net-next | fbd40ea0180a2d328c5adc61414dc8bab9335ce2 | 291,811,382,826,890,460,000,000,000,000,000,000,000 | 92 | ipv4: Don't do expensive useless work during inetdev destroy.
When an inetdev is destroyed, every address assigned to the interface
is removed. And in this scenerio we do two pointless things which can
be very expensive if the number of assigned interfaces is large:
1) Address promotion. We are deleting all address... |
static int init_kmem_cache_nodes(struct kmem_cache *s)
{
int node;
for_each_node_state(node, N_NORMAL_MEMORY) {
struct kmem_cache_node *n;
if (slab_state == DOWN) {
early_kmem_cache_node_alloc(node);
continue;
}
n = kmem_cache_alloc_node(kmem_cache_node,
GFP_KERNEL, node);
if (!n) {
free_k... | 0 | [] | linux | fd4d9c7d0c71866ec0c2825189ebd2ce35bd95b8 | 174,151,605,495,999,620,000,000,000,000,000,000,000 | 24 | mm: slub: add missing TID bump in kmem_cache_alloc_bulk()
When kmem_cache_alloc_bulk() attempts to allocate N objects from a percpu
freelist of length M, and N > M > 0, it will first remove the M elements
from the percpu freelist, then call ___slab_alloc() to allocate the next
element and repopulate the percpu freelis... |
phys_addr_t per_cpu_ptr_to_phys(void *addr)
{
void __percpu *base = __addr_to_pcpu_ptr(pcpu_base_addr);
bool in_first_chunk = false;
unsigned long first_low, first_high;
unsigned int cpu;
/*
* The following test on unit_low/high isn't strictly
* necessary but will speed up lookups of addresses which
* aren'... | 0 | [] | linux | 4f996e234dad488e5d9ba0858bc1bae12eff82c3 | 143,843,743,514,525,770,000,000,000,000,000,000,000 | 37 | percpu: fix synchronization between chunk->map_extend_work and chunk destruction
Atomic allocations can trigger async map extensions which is serviced
by chunk->map_extend_work. pcpu_balance_work which is responsible for
destroying idle chunks wasn't synchronizing properly against
chunk->map_extend_work and may end u... |
char* skipSpaces( char* ptr, int mode )
{
if (!ptr)
CV_PARSE_ERROR_CPP("Invalid input");
int level = 0;
for(;;)
{
char c;
ptr--;
if( mode == CV_XML_INSIDE_COMMENT )
{
do c = *++ptr;
whi... | 0 | [
"CWE-787"
] | opencv | f42d5399aac80d371b17d689851406669c9b9111 | 8,188,524,436,391,037,000,000,000,000,000,000,000 | 63 | core(persistence): add more checks for implementation limitations |
static void bt_att_attach_chan(struct bt_att *att, struct bt_att_chan *chan)
{
/* Push to head as EATT channels have higher priority */
queue_push_head(att->chans, chan);
chan->att = att;
if (chan->mtu > att->mtu)
att->mtu = chan->mtu;
io_set_close_on_destroy(chan->io, att->close_on_unref);
util_debug(att->d... | 0 | [
"CWE-415"
] | bluez | 1cd644db8c23a2f530ddb93cebed7dacc5f5721a | 92,472,873,317,071,840,000,000,000,000,000,000,000 | 16 | shared/att: Fix possible crash on disconnect
If there are pending request while disconnecting they would be notified
but clients may endup being freed in the proccess which will then be
calling bt_att_cancel to cancal its requests causing the following
trace:
Invalid read of size 4
at 0x1D894C: enable_ccc_callback... |
Bool gf_dom_event_fire(GF_Node *node, GF_DOM_Event *event)
{
return gf_dom_event_fire_ex(node, event, NULL);
} | 0 | [
"CWE-416"
] | gpac | 9723dd0955894f2cb7be13b94cf7a47f2754b893 | 37,906,650,367,647,020,000,000,000,000,000,000,000 | 4 | fixed #2109 |
static bool ldap_decode_control_value(void *mem_ctx, DATA_BLOB value,
const struct ldap_control_handler *handlers,
struct ldb_control *ctrl)
{
int i;
if (!handlers) {
return true;
}
for (i = 0; handlers[i].oid != NULL; i++) {
if (strcmp(handlers[i].oid, ctrl->oid) == 0) {
if (!handlers[... | 0 | [
"CWE-399"
] | samba | 530d50a1abdcdf4d1775652d4c456c1274d83d8d | 195,856,170,200,008,900,000,000,000,000,000,000,000 | 24 | CVE-2015-7540: s4: libcli: ldap message - Ensure all asn1_XX returns are checked.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=9187
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): F... |
*/
static void php_wddx_add_var(wddx_packet *packet, zval *name_var)
{
zval **val;
HashTable *target_hash;
TSRMLS_FETCH();
if (Z_TYPE_P(name_var) == IS_STRING) {
if (!EG(active_symbol_table)) {
zend_rebuild_symbol_table(TSRMLS_C);
}
if (zend_hash_find(EG(active_symbol_table), Z_STRVAL_P(name_var),
... | 0 | [] | php-src | 1785d2b805f64eaaacf98c14c9e13107bf085ab1 | 112,495,731,421,926,370,000,000,000,000,000,000,000 | 40 | Fixed bug #70741: Session WDDX Packet Deserialization Type Confusion Vulnerability |
static int i740fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
{
switch (var->bits_per_pixel) {
case 8:
var->red.offset = var->green.offset = var->blue.offset = 0;
var->red.length = var->green.length = var->blue.length = 8;
break;
case 16:
switch (var->green.length) {
default:
case 5:
... | 1 | [
"CWE-369"
] | linux-fbdev | 15cf0b82271b1823fb02ab8c377badba614d95d5 | 206,866,387,050,123,770,000,000,000,000,000,000,000 | 56 | video: fbdev: i740fb: Error out if 'pixclock' equals zero
The userspace program could pass any values to the driver through
ioctl() interface. If the driver doesn't check the value of 'pixclock',
it may cause divide error.
Fix this by checking whether 'pixclock' is zero in the function
i740fb_check_var().
The follow... |
bool Virtual_column_info::fix_session_expr_for_read(THD *thd, Field *field)
{
DBUG_ENTER("fix_session_vcol_expr_for_read");
TABLE_LIST *tl= field->table->pos_in_table_list;
if (!tl || tl->lock_type >= TL_WRITE_ALLOW_WRITE)
DBUG_RETURN(0);
Security_context *save_security_ctx= thd->security_ctx;
if (tl->sec... | 1 | [
"CWE-416",
"CWE-703"
] | server | 08c7ab404f69d9c4ca6ca7a9cf7eec74c804f917 | 166,078,451,050,786,450,000,000,000,000,000,000,000 | 13 | MDEV-24176 Server crashes after insert in the table with virtual
column generated using date_format() and if()
vcol_info->expr is allocated on expr_arena at parsing stage. Since
expr item is allocated on expr_arena all its containee items must be
allocated on expr_arena too. Otherwise fix_session_expr() will
encounter... |
static void usage(void)
{
DBUG_ENTER("usage");
if (!(default_charset_info= get_charset_by_csname(default_character_set_name,
MY_CS_PRIMARY,
MYF(MY_WME))))
exit(1);
if (!default_collation_name)
default_collation_name= (char*) default_charset_info->name;
print_version();
puts(OR... | 0 | [
"CWE-362"
] | server | 347eeefbfc658c8531878218487d729f4e020805 | 5,072,330,557,137,332,000,000,000,000,000,000,000 | 50 | don't use my_copystat in the server
it was supposed to be used in command-line tools only.
Different fix for 4e5473862e:
Bug#24388746: PRIVILEGE ESCALATION AND RACE CONDITION USING CREATE TABLE |
xfs_acl_to_disk(struct xfs_acl *aclp, const struct posix_acl *acl)
{
const struct posix_acl_entry *acl_e;
struct xfs_acl_entry *ace;
int i;
aclp->acl_cnt = cpu_to_be32(acl->a_count);
for (i = 0; i < acl->a_count; i++) {
ace = &aclp->acl_entry[i];
acl_e = &acl->a_entries[i];
ace->ae_tag = cpu_to_be32(acl_e-... | 0 | [
"CWE-862",
"CWE-285"
] | linux | 073931017b49d9458aa351605b43a7e34598caef | 152,419,880,931,389,750,000,000,000,000,000,000,000 | 27 | posix_acl: Clear SGID bit when setting file permissions
When file permissions are modified via chmod(2) and the user is not in
the owning group or capable of CAP_FSETID, the setgid bit is cleared in
inode_change_ok(). Setting a POSIX ACL via setxattr(2) sets the file
permissions as well as the new ACL, but doesn't cl... |
int sctp_chunk_iif(const struct sctp_chunk *chunk)
{
struct sk_buff *skb = chunk->skb;
return SCTP_INPUT_CB(skb)->af->skb_iif(skb);
} | 0 | [
"CWE-20"
] | linux | 07f2c7ab6f8d0a7e7c5764c4e6cc9c52951b9d9c | 65,154,275,119,440,375,000,000,000,000,000,000,000 | 6 | sctp: verify size of a new chunk in _sctp_make_chunk()
When SCTP makes INIT or INIT_ACK packet the total chunk length
can exceed SCTP_MAX_CHUNK_LEN which leads to kernel panic when
transmitting these packets, e.g. the crash on sending INIT_ACK:
[ 597.804948] skbuff: skb_over_panic: text:00000000ffae06e4 len:120168
... |
iasecc_init_oberthur(struct sc_card *card)
{
struct sc_context *ctx = card->ctx;
unsigned int flags;
int rv = 0;
LOG_FUNC_CALLED(ctx);
flags = IASECC_CARD_DEFAULT_FLAGS;
_sc_card_add_rsa_alg(card, 1024, flags, 0x10001);
_sc_card_add_rsa_alg(card, 2048, flags, 0x10001);
card->caps = SC_CARD_CAP_RNG;
card->c... | 0 | [
"CWE-125"
] | OpenSC | 8fe377e93b4b56060e5bbfb6f3142ceaeca744fa | 241,877,578,292,856,030,000,000,000,000,000,000,000 | 36 | fixed out of bounds reads
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting and suggesting security fixes. |
DEATH_TEST(LtOp, InvalidEooOperand, "Invariant failure _rhs") {
BSONObj operand;
LTMatchExpression lt;
lt.init("", operand.firstElement()).ignore();
} | 0 | [] | mongo | b0ef26c639112b50648a02d969298650fbd402a4 | 278,230,442,455,136,100,000,000,000,000,000,000,000 | 5 | SERVER-51083 Reject invalid UTF-8 from $regex match expressions |
sixel_dither_tests_main(void)
{
int nret = EXIT_FAILURE;
size_t i;
typedef int (* testcase)(void);
static testcase const testcases[] = {
test1,
test2,
};
for (i = 0; i < sizeof(testcases) / sizeof(testcase); ++i) {
nret = testcases[i]();
if (nret != EXIT_SUCCESS... | 0 | [
"CWE-200"
] | libsixel | cb373ab6614c910407c5e5a93ab935144e62b037 | 312,996,336,539,380,330,000,000,000,000,000,000,000 | 23 | Avoid illegal memory access problem with 1 color paletted png(#73),
Thanks to HongxuChen. |
void radeon_atom_set_clock_gating(struct radeon_device *rdev, int enable)
{
DYNAMIC_CLOCK_GATING_PS_ALLOCATION args;
int index = GetIndexIntoMasterTable(COMMAND, DynamicClockGating);
args.ucEnable = enable;
atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
} | 0 | [
"CWE-119",
"CWE-193"
] | linux | 0031c41be5c529f8329e327b63cde92ba1284842 | 326,030,577,178,917,700,000,000,000,000,000,000,000 | 9 | drivers/gpu/drm/radeon/radeon_atombios.c: range check issues
This change makes the array larger, "MAX_SUPPORTED_TV_TIMING_V1_2" is 3
and the original size "MAX_SUPPORTED_TV_TIMING" is 2.
Also there were checks that were off by one.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Alex Deucher <alexdeucher@... |
OPJ_BOOL opj_tcd_rateallocate(opj_tcd_t *tcd,
OPJ_BYTE *dest,
OPJ_UINT32 * p_data_written,
OPJ_UINT32 len,
opj_codestream_info_t *cstr_info,
opj_event_mgr_t *p_manager)
{... | 0 | [
"CWE-122"
] | openjpeg | 15cf3d95814dc931ca0ecb132f81cb152e051bae | 64,516,769,401,291,930,000,000,000,000,000,000,000 | 202 | Encoder: grow again buffer size in opj_tcd_code_block_enc_allocate_data() (fixes #1283) |
unsigned long unmap_vmas(struct mmu_gather **tlbp,
struct vm_area_struct *vma, unsigned long start_addr,
unsigned long end_addr, unsigned long *nr_accounted,
struct zap_details *details)
{
long zap_work = ZAP_BLOCK_SIZE;
unsigned long tlb_start = 0; /* For tlb_finish_mmu */
int tlb_start_valid = 0;
unsigned l... | 0 | [
"CWE-20"
] | linux-2.6 | 89f5b7da2a6bad2e84670422ab8192382a5aeb9f | 247,213,168,581,277,480,000,000,000,000,000,000,000 | 64 | Reinstate ZERO_PAGE optimization in 'get_user_pages()' and fix XIP
KAMEZAWA Hiroyuki and Oleg Nesterov point out that since the commit
557ed1fa2620dc119adb86b34c614e152a629a80 ("remove ZERO_PAGE") removed
the ZERO_PAGE from the VM mappings, any users of get_user_pages() will
generally now populate the VM with real emp... |
find_pa_data(const METHOD_DATA *md, unsigned type)
{
size_t i;
if (md == NULL)
return NULL;
for (i = 0; i < md->len; i++)
if (md->val[i].padata_type == type)
return &md->val[i];
return NULL;
} | 0 | [
"CWE-320"
] | heimdal | 2f7f3d9960aa6ea21358bdf3687cee5149aa35cf | 292,059,961,793,087,000,000,000,000,000,000,000,000 | 10 | CVE-2019-12098: krb5: always confirm PA-PKINIT-KX for anon PKINIT
RFC8062 Section 7 requires verification of the PA-PKINIT-KX key excahnge
when anonymous PKINIT is used. Failure to do so can permit an active
attacker to become a man-in-the-middle.
Introduced by a1ef548600c5bb51cf52a9a9ea12676506ede19f. First tagged... |
int TS_ACCURACY_set_millis(TS_ACCURACY *a, ASN1_INTEGER *millis)
{
ASN1_INTEGER *new_millis = NULL;
if (a->millis == millis)
return 1;
if (millis != NULL)
{
new_millis = ASN1_INTEGER_dup(millis);
if (new_millis == NULL)
{
TSerr(TS_F_TS_ACCURACY_SET_MILLIS,
ERR_R_MALLOC_FAILURE);
return 0... | 0 | [] | openssl | c7235be6e36c4bef84594aa3b2f0561db84b63d8 | 319,000,885,631,028,680,000,000,000,000,000,000,000 | 20 | RFC 3161 compliant time stamp request creation, response generation
and response verification.
Submitted by: Zoltan Glozik <zglozik@opentsa.org>
Reviewed by: Ulf Moeller |
GF_Err gf_media_avc_change_par(GF_AVCConfig *avcc, s32 ar_n, s32 ar_d)
{
GF_VUIInfo vuii;
memset(&vuii, 0, sizeof(GF_VUIInfo));
vuii.ar_num = ar_n;
vuii.ar_den = ar_d;
vuii.fullrange = -1;
vuii.video_format = -1;
vuii.color_prim = -1;
vuii.color_tfc = -1;
vuii.color_matrix = -1;
return gf_avc_change_vui(avcc,... | 0 | [
"CWE-190",
"CWE-787"
] | gpac | 51cdb67ff7c5f1242ac58c5aa603ceaf1793b788 | 198,537,941,058,468,160,000,000,000,000,000,000,000 | 13 | add safety in avc/hevc/vvc sps/pps/vps ID check - cf #1720 #1721 #1722 |
static void cmv_motcomp(unsigned char *dst, int dst_stride,
const unsigned char *src, int src_stride,
int x, int y,
int xoffset, int yoffset,
int width, int height){
int i,j;
for(j=y;j<y+4;j++)
for(i=x;i<x+4;i++... | 0 | [
"CWE-703"
] | FFmpeg | 5430839144c6da0160e8e0cfb0c8db01de432e94 | 219,328,719,475,254,540,000,000,000,000,000,000,000 | 18 | eacmv: clear references on frame dimensions change
Fixes invalid reads.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org |
static int hclge_pfc_pause_en_cfg(struct hclge_dev *hdev, u8 tx_rx_bitmap,
u8 pfc_bitmap)
{
struct hclge_desc desc;
struct hclge_pfc_en_cmd *pfc = (struct hclge_pfc_en_cmd *)desc.data;
hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_CFG_PFC_PAUSE_EN, false);
pfc->tx_rx_en_bitmap = tx_rx_bitmap;
pfc->pri_en_bit... | 0 | [
"CWE-125"
] | linux | 04f25edb48c441fc278ecc154c270f16966cbb90 | 272,415,103,820,080,230,000,000,000,000,000,000,000 | 13 | net: hns3: add some error checking in hclge_tm module
When hdev->tx_sch_mode is HCLGE_FLAG_VNET_BASE_SCH_MODE, the
hclge_tm_schd_mode_vnet_base_cfg calls hclge_tm_pri_schd_mode_cfg
with vport->vport_id as pri_id, which is used as index for
hdev->tm_info.tc_info, it will cause out of bound access issue
if vport_id is e... |
void show_help_default(const char *opt, const char *arg)
{
printf("usage: ffserver [options]\n"
"Hyper fast multi format Audio/Video streaming server\n");
printf("\n");
show_help_options(options, "Main options:", 0, 0, 0);
} | 0 | [
"CWE-119",
"CWE-787"
] | FFmpeg | a5d25faa3f4b18dac737fdb35d0dd68eb0dc2156 | 172,765,059,265,170,360,000,000,000,000,000,000,000 | 7 | ffserver: Check chunk size
Fixes out of array access
Fixes: poc_ffserver.py
Found-by: Paul Cher <paulcher@icloud.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> |
table_domain_match(const char *s1, const char *s2)
{
return hostname_match(s1, s2);
} | 0 | [
"CWE-772",
"CWE-401"
] | src | 79a034b4aed29e965f45a13409268290c9910043 | 254,669,318,642,573,400,000,000,000,000,000,000,000 | 4 | Use regfree after we're done with preg.
From gilles@ |
Value ExpressionFirst::evaluate(const Document& root, Variables* variables) const {
const Value array = _children[0]->evaluate(root, variables);
return arrayElemAt(this, array, Value(0));
} | 0 | [] | mongo | 1772b9a0393b55e6a280a35e8f0a1f75c014f301 | 309,116,086,266,622,120,000,000,000,000,000,000,000 | 4 | SERVER-49404 Enforce additional checks in $arrayToObject |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.