func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
static void igmp_group_added(struct ip_mc_list *im)
{
struct in_device *in_dev = im->interface;
#ifdef CONFIG_IP_MULTICAST
struct net *net = dev_net(in_dev->dev);
#endif
if (im->loaded == 0) {
im->loaded = 1;
ip_mc_filter_add(in_dev, im->multiaddr);
}
#ifdef CONFIG_IP_MULTICAST
if (im->multiaddr == IGMP_ALL_... | 0 | [
"CWE-362"
] | linux | 23d2b94043ca8835bd1e67749020e839f396a1c2 | 23,977,282,249,595,197,000,000,000,000,000,000,000 | 40 | igmp: Add ip_mc_list lock in ip_check_mc_rcu
I got below panic when doing fuzz test:
Kernel panic - not syncing: panic_on_warn set ...
CPU: 0 PID: 4056 Comm: syz-executor.3 Tainted: G B 5.14.0-rc1-00195-gcff5c4254439-dirty #2
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.0-59-gc9... |
static void pppol2tp_next_tunnel(struct net *net, struct pppol2tp_seq_data *pd)
{
for (;;) {
pd->tunnel = l2tp_tunnel_find_nth(net, pd->tunnel_idx);
pd->tunnel_idx++;
if (pd->tunnel == NULL)
break;
/* Ignore L2TPv3 tunnels */
if (pd->tunnel->version < 3)
break;
}
} | 0 | [
"CWE-416"
] | linux | f026bc29a8e093edfbb2a77700454b285c97e8ad | 194,611,998,138,051,350,000,000,000,000,000,000,000 | 14 | l2tp: pass tunnel pointer to ->session_create()
Using l2tp_tunnel_find() in pppol2tp_session_create() and
l2tp_eth_create() is racy, because no reference is held on the
returned session. These functions are only used to implement the
->session_create callback which is run by l2tp_nl_cmd_session_create().
Therefore sea... |
void btrfs_dec_block_group_swap_extents(struct btrfs_block_group *bg, int amount)
{
spin_lock(&bg->lock);
ASSERT(!bg->ro);
ASSERT(bg->swap_extents >= amount);
bg->swap_extents -= amount;
spin_unlock(&bg->lock);
} | 0 | [
"CWE-703",
"CWE-667"
] | linux | 1cb3db1cf383a3c7dbda1aa0ce748b0958759947 | 165,062,093,721,257,860,000,000,000,000,000,000,000 | 8 | btrfs: fix deadlock with concurrent chunk allocations involving system chunks
When a task attempting to allocate a new chunk verifies that there is not
currently enough free space in the system space_info and there is another
task that allocated a new system chunk but it did not finish yet the
creation of the respecti... |
static int __init arch_parse_efi_cmdline(char *str)
{
if (!str) {
pr_warn("need at least one option\n");
return -EINVAL;
}
if (parse_option_str(str, "old_map"))
set_bit(EFI_OLD_MEMMAP, &efi.flags);
return 0;
} | 0 | [
"CWE-388"
] | tip | 4e78921ba4dd0aca1cc89168f45039add4183f8e | 26,375,350,237,154,635,000,000,000,000,000,000,000 | 12 | efi/x86/Add missing error handling to old_memmap 1:1 mapping code
The old_memmap flow in efi_call_phys_prolog() performs numerous memory
allocations, and either does not check for failure at all, or it does
but fails to propagate it back to the caller, which may end up calling
into the firmware with an incomplete 1:1 ... |
int tls1_process_sigalgs(SSL *s, const unsigned char *data, int dsize)
{
int idx;
size_t i;
const EVP_MD *md;
CERT *c = s->cert;
TLS_SIGALGS *sigptr;
/* Extension ignored for inappropriate versions */
if (!SSL_USE_SIGALGS(s))
return 1;
/* Should never happen */
if (!c)
return 0;
c->peer_sigalgs = OPENSS... | 0 | [
"CWE-19"
] | openssl | 45473632c54947859a731dfe2db087c002ef7aa7 | 129,081,586,826,803,550,000,000,000,000,000,000,000 | 91 | Prevent use of RSA+MD5 in TLS 1.2 by default.
Removing RSA+MD5 from the default signature algorithm list
prevents its use by default.
If a broken implementation attempts to use RSA+MD5 anyway the sanity
checking of signature algorithms will cause a fatal alert. |
LIST *mutt_add_list_n (LIST *head, const void *data, size_t len)
{
LIST *tmp;
for (tmp = head; tmp && tmp->next; tmp = tmp->next)
;
if (tmp)
{
tmp->next = safe_malloc (sizeof (LIST));
tmp = tmp->next;
}
else
head = tmp = safe_malloc (sizeof (LIST));
tmp->data = safe_malloc (len);
i... | 0 | [
"CWE-668"
] | mutt | 6d0624411a979e2e1d76af4dd97d03f47679ea4a | 81,727,918,526,852,055,000,000,000,000,000,000,000 | 20 | use a 64-bit random value in temporary filenames.
closes #3158 |
S_ssc_cp_and(pTHX_ regnode_ssc *ssc, const UV cp)
{
/* AND just the single code point 'cp' into the SSC 'ssc' */
SV* cp_list = _new_invlist(2);
PERL_ARGS_ASSERT_SSC_CP_AND;
assert(is_ANYOF_SYNTHETIC(ssc));
cp_list = add_cp_to_invlist(cp_list, cp);
ssc_intersection(ssc, cp_list,
... | 0 | [
"CWE-125"
] | perl5 | 43b2f4ef399e2fd7240b4eeb0658686ad95f8e62 | 163,104,667,865,250,530,000,000,000,000,000,000,000 | 16 | regcomp.c: Convert some strchr to memchr
This allows things to work properly in the face of embedded NULs.
See the branch merge message for more information. |
_timer_for_tcl(clientData)
ClientData clientData;
{
int thr_crit_bup;
/* struct invoke_queue *q, *tmp; */
/* VALUE thread; */
DUMP1("call _timer_for_tcl");
thr_crit_bup = rb_thread_critical;
rb_thread_critical = Qtrue;
Tcl_DeleteTimerHandler(timer_token);
run_timer_flag = 1;
... | 0 | [] | tk | ebd0fc80d62eeb7b8556522256f8d035e013eb65 | 252,282,463,018,865,200,000,000,000,000,000,000,000 | 29 | tcltklib.c: check argument
* ext/tk/tcltklib.c (ip_cancel_eval_core): check argument type and
length.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
PREPEND_CHAIN(struct evbuffer *dst, struct evbuffer *src)
{
ASSERT_EVBUFFER_LOCKED(dst);
ASSERT_EVBUFFER_LOCKED(src);
src->last->next = dst->first;
dst->first = src->first;
dst->total_len += src->total_len;
if (*dst->last_with_datap == NULL) {
if (src->last_with_datap == &(src)->first)
dst->last_with_datap =... | 0 | [
"CWE-189"
] | libevent | 20d6d4458bee5d88bda1511c225c25b2d3198d6c | 153,733,870,064,464,070,000,000,000,000,000,000,000 | 16 | Fix CVE-2014-6272 in Libevent 2.0
For this fix, we need to make sure that passing too-large inputs to
the evbuffer functions can't make us do bad things with the heap.
Also, lower the maximum chunk size to the lower of off_t, size_t maximum.
This is necessary since otherwise we could get into an infinite loop
if we ... |
static void charstring_byte(int v)
{
byte b = (byte)(v & 0xff);
if (charstring_bp - charstring_buf == charstring_bufsiz) {
charstring_bufsiz *= 2;
if (!(charstring_buf = (byte *) realloc(charstring_buf, charstring_bufsiz)))
fatal_error("out of memory");
charstring_bp = charstring_buf + charstring_... | 0 | [
"CWE-119",
"CWE-787"
] | t1utils | 6b9d1aafcb61a3663c883663eb19ccdbfcde8d33 | 70,326,107,842,465,830,000,000,000,000,000,000,000 | 11 | Security fixes.
- Don't overflow the small cs_start buffer (reported by Niels
Thykier via the debian tracker (Jakub Wilk), found with a
fuzzer ("American fuzzy lop")).
- Cast arguments to <ctype.h> functions to unsigned char. |
static int nested_vmx_check_vmcs12(struct kvm_vcpu *vcpu)
{
struct vcpu_vmx *vmx = to_vmx(vcpu);
if (vmx->nested.current_vmptr == -1ull) {
nested_vmx_failInvalid(vcpu);
skip_emulated_instruction(vcpu);
return 0;
}
return 1;
} | 0 | [] | kvm | a642fc305053cc1c6e47e4f4df327895747ab485 | 34,978,685,756,620,086,000,000,000,000,000,000,000 | 10 | kvm: vmx: handle invvpid vm exit gracefully
On systems with invvpid instruction support (corresponding bit in
IA32_VMX_EPT_VPID_CAP MSR is set) guest invocation of invvpid
causes vm exit, which is currently not handled and results in
propagation of unknown exit to userspace.
Fix this by installing an invvpid vm exit ... |
R_API RBinJavaAttrInfo *r_bin_java_unknown_attr_new(ut8 *buffer, ut64 sz, ut64 buf_offset) {
return r_bin_java_default_attr_new (buffer, sz, buf_offset);
} | 0 | [
"CWE-125"
] | radare2 | e9ce0d64faf19fa4e9c260250fbdf25e3c11e152 | 142,813,962,440,999,680,000,000,000,000,000,000,000 | 3 | Fix #10498 - Fix crash in fuzzed java files (#10511) |
unsigned long arch_randomize_brk(struct mm_struct *mm)
{
unsigned long base = mm->brk;
unsigned long ret;
#ifdef CONFIG_PPC_STD_MMU_64
/*
* If we are using 1TB segments and we are allowed to randomise
* the heap, we can put it above 1TB so it is backed by a 1TB
* segment. Otherwise the heap will be in the bot... | 0 | [
"CWE-20"
] | linux | 621b5060e823301d0cba4cb52a7ee3491922d291 | 236,713,954,336,065,600,000,000,000,000,000,000,000 | 24 | powerpc/tm: Fix crash when forking inside a transaction
When we fork/clone we currently don't copy any of the TM state to the new
thread. This results in a TM bad thing (program check) when the new process is
switched in as the kernel does a tmrechkpt with TEXASR FS not set. Also, since
R1 is from userspace, we trig... |
static gboolean sasl_timeout (IRC_SERVER_REC *server)
{
/* The authentication timed out, we can't do much beside terminating it */
g_critical("The authentication timed out, try increasing the timeout and check your connection "
"to the network.");
irc_send_cmd_now(server, "AUTHENTICATE *");
cap_finish_n... | 0 | [
"CWE-416"
] | irssi | b8d3301d34f383f039071214872570385de1bb59 | 123,852,041,188,152,330,000,000,000,000,000,000,000 | 10 | SASL support
The only supported methods are PLAIN and EXTERNAL, the latter is untested as of
now.
The code gets the values from the keys named sasl_{mechanism,username,password}
specified for each chatnet. |
static int eaptls_detach(void *arg)
{
EAP_TLS_CONF *conf;
eap_tls_t *inst;
inst = (eap_tls_t *) arg;
conf = inst->conf;
if (conf) {
memset(conf, 0, sizeof(*conf));
free(inst->conf);
inst->conf = NULL;
}
if (inst->ctx) SSL_CTX_free(inst->ctx);
inst->ctx = NULL;
#ifdef HAVE_OPENSSL_OCSP_H
if (inst->... | 0 | [
"CWE-119"
] | freeradius-server | 78e5aed56c36a9231bc91ea5f55b3edf88a9d2a4 | 118,387,155,700,836,290,000,000,000,000,000,000,000 | 26 | Fix CVE-2012-3547. Found by Timo Warns |
void js_defaccessor(js_State *J, int idx, const char *name, int atts)
{
jsR_defproperty(J, js_toobject(J, idx), name, atts, NULL, jsR_tofunction(J, -2), jsR_tofunction(J, -1));
js_pop(J, 2);
} | 0 | [
"CWE-476"
] | mujs | 77ab465f1c394bb77f00966cd950650f3f53cb24 | 336,535,798,326,626,300,000,000,000,000,000,000,000 | 5 | Fix 697401: Error when dropping extra arguments to lightweight functions. |
struct sk_buff *cfg80211_testmode_alloc_event_skb(struct wiphy *wiphy,
int approxlen, gfp_t gfp)
{
struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
return __cfg80211_testmode_alloc_skb(rdev, approxlen, 0, 0, gfp); | 0 | [
"CWE-362",
"CWE-119"
] | linux | 208c72f4fe44fe09577e7975ba0e7fa0278f3d03 | 163,927,716,879,099,960,000,000,000,000,000,000,000 | 7 | nl80211: fix check for valid SSID size in scan operations
In both trigger_scan and sched_scan operations, we were checking for
the SSID length before assigning the value correctly. Since the
memory was just kzalloc'ed, the check was always failing and SSID with
over 32 characters were allowed to go through.
This was... |
static void Epbx2X(const Image *source,const Quantum *pixels,
Quantum *result,const size_t channels)
{
#define HelperCond(a,b,c,d,e,f,g) ( \
PixelsEqual(pixels,a,pixels,b,channels) && ( \
PixelsEqual(pixels,c,pixels,d,channels) || \
PixelsEqual(pixels,c,pixels,e,channels) || \
PixelsEqual(pixels,a,pixel... | 0 | [
"CWE-369"
] | ImageMagick | 43539e67a47d2f8de832d33a5b26dc2a7a12294f | 339,900,276,973,563,170,000,000,000,000,000,000,000 | 52 | https://github.com/ImageMagick/ImageMagick/issues/1718 |
CModule::EModRet CModule::OnUserNotice(CString& sTarget, CString& sMessage) {
return CONTINUE;
} | 0 | [
"CWE-20",
"CWE-264"
] | znc | 8de9e376ce531fe7f3c8b0aa4876d15b479b7311 | 258,583,673,243,503,130,000,000,000,000,000,000,000 | 3 | Fix remote code execution and privilege escalation vulnerability.
To trigger this, need to have a user already.
Thanks for Jeriko One <jeriko.one@gmx.us> for finding and reporting this.
CVE-2019-12816 |
static inline int sq(int x)
{
return x * x;
} | 0 | [
"CWE-369"
] | libcaca | 84bd155087b93ab2d8d7cb5b1ac94ecd4cf4f93c | 297,907,112,927,065,880,000,000,000,000,000,000,000 | 4 | dither: fix integer overflows that were causing a division by zero.
Fixes: #36 (CVE-2018-20544) |
showruler(int always)
{
if (!always && !redrawing())
return;
if (pum_visible())
{
// Don't redraw right now, do it later.
curwin->w_redr_status = TRUE;
return;
}
#if defined(FEAT_STL_OPT)
if ((*p_stl != NUL || *curwin->w_p_stl != NUL) && curwin->w_status_height)
redraw_custom_statusline(curwin)... | 0 | [
"CWE-200",
"CWE-122"
] | vim | de05bb25733c3319e18dca44e9b59c6ee389eb26 | 294,610,215,311,985,200,000,000,000,000,000,000,000 | 31 | patch 8.2.4074: going over the end of NameBuff
Problem: Going over the end of NameBuff.
Solution: Check length when appending a space. |
void gtkui_icmp_redir(void)
{
GtkWidget *dialog, *table, *hbox, *image, *label, *entry1, *entry2, *frame;
gint response = 0;
DEBUG_MSG("gtk_icmp_redir");
dialog = gtk_dialog_new_with_buttons("MITM Attack: ICMP Redirect", GTK_WINDOW (window),
GTK_DIALOG_MODAL, GTK_ST... | 1 | [
"CWE-120",
"CWE-787"
] | ettercap | 4ef3ede30181eca9add74305ad26dbcb0c3686a0 | 269,515,442,850,405,500,000,000,000,000,000,000,000 | 73 | More changes to mitigate:
CVE-2010-3843
CVE-2010-3844 |
void smb_vfs_call_rewind_dir(struct vfs_handle_struct *handle,
DIR *dirp)
{
VFS_FIND(rewind_dir);
handle->fns->rewind_dir_fn(handle, dirp);
} | 0 | [
"CWE-264"
] | samba | 4278ef25f64d5fdbf432ff1534e275416ec9561e | 107,140,496,655,927,570,000,000,000,000,000,000,000 | 6 | CVE-2015-5252: s3: smbd: Fix symlink verification (file access outside the share).
Ensure matching component ends in '/' or '\0'.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11395
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org> |
qtif_type_find (GstTypeFind * tf, gpointer unused)
{
const guint8 *data;
gboolean found_idsc = FALSE;
gboolean found_idat = FALSE;
guint64 offset = 0;
guint rounds = 0;
while ((data = gst_type_find_peek (tf, offset, 8)) != NULL) {
guint64 size;
size = GST_READ_UINT32_BE (data);
if (size == 1) ... | 0 | [
"CWE-125"
] | gst-plugins-base | 2fdccfd64fc609e44e9c4b8eed5bfdc0ab9c9095 | 143,389,010,075,099,260,000,000,000,000,000,000,000 | 44 | typefind: bounds check windows ico detection
Fixes out of bounds read
https://bugzilla.gnome.org/show_bug.cgi?id=774902 |
int gs_lib_ctx_register_callout(gs_memory_t *mem, gs_callout_fn fn, void *arg)
{
gs_lib_ctx_core_t *core;
gs_callout_list_t *entry;
if (mem == NULL || mem->gs_lib_ctx == NULL ||
mem->gs_lib_ctx->core == NULL || fn == NULL)
return 0;
core = mem->gs_lib_ctx->core;
entry = (gs_callout_l... | 0 | [
"CWE-20"
] | ghostpdl | a9bd3dec9fde03327a4a2c69dad1036bf9632e20 | 183,211,163,817,196,370,000,000,000,000,000,000,000 | 22 | Bug 704342: Include device specifier strings in access validation
for the "%pipe%", %handle%" and %printer% io devices.
We previously validated only the part after the "%pipe%" Postscript device
specifier, but this proved insufficient.
This rebuilds the original file name string, and validates it complete. The
sligh... |
SPL_METHOD(SplFileObject, eof)
{
spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
if (zend_parse_parameters_none() == FAILURE) {
return;
}
RETURN_BOOL(php_stream_eof(intern->u.file.stream));
} /* }}} */ | 0 | [
"CWE-190"
] | php-src | 7245bff300d3fa8bacbef7897ff080a6f1c23eba | 117,539,870,365,358,630,000,000,000,000,000,000,000 | 10 | Fix bug #72262 - do not overflow int |
static int sco_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
struct msghdr *msg, size_t len, int flags)
{
struct sock *sk = sock->sk;
struct sco_pinfo *pi = sco_pi(sk);
lock_sock(sk);
if (sk->sk_state == BT_CONNECT2 &&
test_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags)) {
sco_conn_defer_accept(p... | 0 | [
"CWE-20",
"CWE-269"
] | linux | f3d3342602f8bcbf37d7c46641cb9bca7618eb1c | 192,985,490,475,417,500,000,000,000,000,000,000,000 | 21 | 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... |
static int fixup_bpf_calls(struct bpf_verifier_env *env)
{
struct bpf_prog *prog = env->prog;
bool expect_blinding = bpf_jit_blinding_enabled(prog);
struct bpf_insn *insn = prog->insnsi;
const struct bpf_func_proto *fn;
const int insn_cnt = prog->len;
const struct bpf_map_ops *ops;
struct bpf_insn_aux_data *aux;... | 0 | [] | linux | 9b00f1b78809309163dda2d044d9e94a3c0248a3 | 309,007,112,653,661,000,000,000,000,000,000,000,000 | 352 | bpf: Fix truncation handling for mod32 dst reg wrt zero
Recently noticed that when mod32 with a known src reg of 0 is performed,
then the dst register is 32-bit truncated in verifier:
0: R1=ctx(id=0,off=0,imm=0) R10=fp0
0: (b7) r0 = 0
1: R0_w=inv0 R1=ctx(id=0,off=0,imm=0) R10=fp0
1: (b7) r1 = -1
2: R0_w=inv... |
void LoadModuleForNetwork(const CString& sLine) {
CString sUsername = sLine.Token(1);
CString sNetwork = sLine.Token(2);
CString sModName = sLine.Token(3);
CString sArgs = sLine.Token(4, true);
if (sModName.empty()) {
PutModule(
t_s("Usage: LoadNe... | 0 | [
"CWE-20"
] | znc | 64613bc8b6b4adf1e32231f9844d99cd512b8973 | 40,592,881,727,577,660,000,000,000,000,000,000,000 | 24 | Don't crash if user specified invalid encoding.
This is CVE-2019-9917 |
static void cmd_parse_enabled(struct ImapAccountData *adata, const char *s)
{
mutt_debug(LL_DEBUG2, "Handling ENABLED\n");
while ((s = imap_next_word((char *) s)) && (*s != '\0'))
{
if (mutt_str_startswith(s, "UTF8=ACCEPT", CASE_IGNORE) ||
mutt_str_startswith(s, "UTF8=ONLY", CASE_IGNORE))
{
... | 0 | [
"CWE-94",
"CWE-74"
] | neomutt | fb013ec666759cb8a9e294347c7b4c1f597639cc | 71,447,659,214,629,050,000,000,000,000,000,000,000 | 15 | tls: clear data after a starttls acknowledgement
After a starttls acknowledgement message, clear the buffers of any
incoming data / commands. This will ensure that all future data is
handled securely.
Co-authored-by: Pietro Cerutti <gahr@gahr.ch> |
void HeaderMapImpl::removePrefix(const LowerCaseString& prefix) {
headers_.remove_if([&](const HeaderEntryImpl& entry) {
bool to_remove = absl::StartsWith(entry.key().getStringView(), prefix.get());
if (to_remove) {
// If this header should be removed, make sure any references in the
// static loo... | 1 | [
"CWE-400",
"CWE-703"
] | envoy | afc39bea36fd436e54262f150c009e8d72db5014 | 19,436,556,993,400,243,000,000,000,000,000,000,000 | 17 | Track byteSize of HeaderMap internally.
Introduces a cached byte size updated internally in HeaderMap. The value
is stored as an optional, and is cleared whenever a non-const pointer or
reference to a HeaderEntry is accessed. The cached value can be set with
refreshByteSize() which performs an iteration over the Heade... |
private int
mcopy(struct magic_set *ms, union VALUETYPE *p, int type, int indir,
const unsigned char *s, uint32_t offset, size_t nbytes, struct magic *m)
{
/*
* Note: FILE_SEARCH and FILE_REGEX do not actually copy
* anything, but setup pointers into the source
*/
if (indir == 0) {
switch (type) {
case... | 0 | [
"CWE-787"
] | php-src | ca6d511fa54b34d5b75bf120a86482a1b9e1e686 | 303,188,494,905,572,420,000,000,000,000,000,000,000 | 131 | Fix #81723: Memory corruption in finfo_buffer()
We need to use the same memory allocator throughout. |
static AvahiSRBLookup *lookup_find(
AvahiSRecordBrowser *b,
AvahiIfIndex interface,
AvahiProtocol protocol,
AvahiLookupFlags flags,
AvahiKey *key) {
AvahiSRBLookup *l;
assert(b);
for (l = b->lookups; l; l = l->lookups_next) {
if ((l->interface == AVAHI_IF_UNSPEC || l->interfa... | 0 | [] | avahi | 9d31939e55280a733d930b15ac9e4dda4497680c | 171,039,852,372,955,150,000,000,000,000,000,000,000 | 23 | Fix NULL pointer crashes from #175
avahi-daemon is crashing when running "ping .local".
The crash is due to failing assertion from NULL pointer.
Add missing NULL pointer checks to fix it.
Introduced in #175 - merge commit 8f75a045709a780c8cf92a6a21e9d35b593bdecd |
static void l2cap_do_start(struct sock *sk)
{
struct l2cap_conn *conn = l2cap_pi(sk)->conn;
if (conn->info_state & L2CAP_INFO_FEAT_MASK_REQ_SENT) {
if (!(conn->info_state & L2CAP_INFO_FEAT_MASK_REQ_DONE))
return;
if (l2cap_check_security(sk)) {
struct l2cap_conn_req req;
req.scid = cpu_to_le16(l2cap_pi... | 0 | [
"CWE-200",
"CWE-119",
"CWE-787"
] | linux | f2fcfcd670257236ebf2088bbdf26f6a8ef459fe | 313,785,788,540,707,600,000,000,000,000,000,000,000 | 32 | Bluetooth: Add configuration support for ERTM and Streaming mode
Add support to config_req and config_rsp to configure ERTM and Streaming
mode. If the remote device specifies ERTM or Streaming mode, then the
same mode is proposed. Otherwise ERTM or Basic mode is used. And in case
of a state 2 device, the remote device... |
static int nsv_parse_NSVs_header(AVFormatContext *s)
{
NSVContext *nsv = s->priv_data;
AVIOContext *pb = s->pb;
uint32_t vtag, atag;
uint16_t vwidth, vheight;
AVRational framerate;
int i;
AVStream *st;
NSVStream *nst;
vtag = avio_rl32(pb);
atag = avio_rl32(pb);
vwidth = avio... | 0 | [
"CWE-476",
"CWE-787"
] | libav | fe6eea99efac66839052af547426518efd970b24 | 232,730,796,486,797,440,000,000,000,000,000,000,000 | 114 | nsvdec: don't ignore the return value of av_get_packet()
Fixes invalid reads with corrupted files.
CC: libav-stable@libav.org
Bug-Id: 1039 |
*/
int __kvm_set_memory_region(struct kvm *kvm,
const struct kvm_userspace_memory_region *mem)
{
struct kvm_memory_slot *old, *new;
struct kvm_memslots *slots;
enum kvm_mr_change change;
unsigned long npages;
gfn_t base_gfn;
int as_id, id;
int r;
r = check_memory_region_flags(mem);
if (r)
return r;
... | 0 | [
"CWE-459"
] | linux | 683412ccf61294d727ead4a73d97397396e69a6b | 221,471,643,221,817,460,000,000,000,000,000,000,000 | 102 | KVM: SEV: add cache flush to solve SEV cache incoherency issues
Flush the CPU caches when memory is reclaimed from an SEV guest (where
reclaim also includes it being unmapped from KVM's memslots). Due to lack
of coherency for SEV encrypted memory, failure to flush results in silent
data corruption if userspace is mal... |
static int context_idr_cleanup(int id, void *p, void *data)
{
context_close(p);
return 0;
} | 0 | [
"CWE-416"
] | linux | 7dc40713618c884bf07c030d1ab1f47a9dc1f310 | 330,819,096,720,931,600,000,000,000,000,000,000,000 | 5 | drm/i915: Introduce a mutex for file_priv->context_idr
Define a mutex for the exclusive use of interacting with the per-file
context-idr, that was previously guarded by struct_mutex. This allows us
to reduce the coverage of struct_mutex, with a view to removing the last
bits coordinating GEM context later. (In the sho... |
static int ion_get_client_serial(const struct rb_root *root,
const unsigned char *name)
{
int serial = -1;
struct rb_node *node;
for (node = rb_first(root); node; node = rb_next(node)) {
struct ion_client *client = rb_entry(node, struct ion_client,
node);
if (strcmp(client->name, name))
continue;... | 0 | [
"CWE-416",
"CWE-284"
] | linux | 9590232bb4f4cc824f3425a6e1349afbe6d6d2b7 | 34,148,614,204,353,940,000,000,000,000,000,000,000 | 16 | staging/android/ion : fix a race condition in the ion driver
There is a use-after-free problem in the ion driver.
This is caused by a race condition in the ion_ioctl()
function.
A handle has ref count of 1 and two tasks on different
cpus calls ION_IOC_FREE simultaneously.
cpu 0 cpu ... |
ex_tearoff(exarg_T *eap)
{
gui_make_tearoff(eap->arg);
} | 0 | [
"CWE-78"
] | vim | 8c62a08faf89663e5633dc5036cd8695c80f1075 | 146,236,519,565,255,440,000,000,000,000,000,000,000 | 4 | patch 8.1.0881: can execute shell commands in rvim through interfaces
Problem: Can execute shell commands in rvim through interfaces.
Solution: Disable using interfaces in restricted mode. Allow for writing
file with writefile(), histadd() and a few others. |
void ipv6_sock_mc_close(struct sock *sk)
{
struct ipv6_pinfo *np = inet6_sk(sk);
if (!rcu_access_pointer(np->ipv6_mc_list))
return;
rtnl_lock();
lock_sock(sk);
__ipv6_sock_mc_close(sk);
release_sock(sk);
rtnl_unlock();
} | 0 | [
"CWE-703"
] | linux | 2d3916f3189172d5c69d33065c3c21119fe539fc | 9,233,470,712,194,130,000,000,000,000,000,000,000 | 13 | 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... |
static void dvb_usb_data_complete(struct usb_data_stream *stream, u8 *buf,
size_t len)
{
struct dvb_usb_adapter *adap = stream->user_priv;
dvb_dmx_swfilter(&adap->demux, buf, len);
} | 0 | [
"CWE-119",
"CWE-787"
] | linux | 005145378c9ad7575a01b6ce1ba118fb427f583a | 240,416,204,879,433,900,000,000,000,000,000,000,000 | 6 | [media] dvb-usb-v2: avoid use-after-free
I ran into a stack frame size warning because of the on-stack copy of
the USB device structure:
drivers/media/usb/dvb-usb-v2/dvb_usb_core.c: In function 'dvb_usbv2_disconnect':
drivers/media/usb/dvb-usb-v2/dvb_usb_core.c:1029:1: error: the frame size of 1104 bytes is larger th... |
static BROTLI_INLINE void SortHuffmanTreeItems(HuffmanTree* items,
const size_t n, HuffmanTreeComparator comparator) {
if (n < 13) {
/* Insertion sort. */
size_t i;
for (i = 1; i < n; ++i) {
HuffmanTree tmp = items[i];
size_t k = i;
size_t j = i - 1;
while (comparator(&tmp, &it... | 0 | [
"CWE-120"
] | brotli | 223d80cfbec8fd346e32906c732c8ede21f0cea6 | 56,689,384,151,314,200,000,000,000,000,000,000,000 | 34 | Update (#826)
* IMPORTANT: decoder: fix potential overflow when input chunk is >2GiB
* simplify max Huffman table size calculation
* eliminate symbol duplicates (static arrays in .h files)
* minor combing in research/ code |
nfsd4_decode_layoutreturn(struct nfsd4_compoundargs *argp,
struct nfsd4_layoutreturn *lrp)
{
DECODE_HEAD;
READ_BUF(16);
lrp->lr_reclaim = be32_to_cpup(p++);
lrp->lr_layout_type = be32_to_cpup(p++);
lrp->lr_seg.iomode = be32_to_cpup(p++);
lrp->lr_return_type = be32_to_cpup(p++);
if (lrp->lr_return_type == RETU... | 0 | [
"CWE-20",
"CWE-129"
] | linux | f961e3f2acae94b727380c0b74e2d3954d0edf79 | 252,611,486,438,940,900,000,000,000,000,000,000,000 | 32 | nfsd: encoders mustn't use unitialized values in error cases
In error cases, lgp->lg_layout_type may be out of bounds; so we
shouldn't be using it until after the check of nfserr.
This was seen to crash nfsd threads when the server receives a LAYOUTGET
request with a large layout type.
GETDEVICEINFO has the same pro... |
static bool is_topic_in_criterias(
const char* topic_name,
const std::vector<Criteria>& criterias)
{
bool returned_value = false;
for (auto criteria_it = criterias.begin(); !returned_value &&
criteria_it != criterias.end(); ++criteria_it)
{
for (auto topic : (*criteria_i... | 0 | [
"CWE-284"
] | Fast-DDS | d2aeab37eb4fad4376b68ea4dfbbf285a2926384 | 66,467,436,058,160,190,000,000,000,000,000,000,000 | 21 | check remote permissions (#1387)
* Refs 5346. Blackbox test
Signed-off-by: Iker Luengo <ikerluengo@eprosima.com>
* Refs 5346. one-way string compare
Signed-off-by: Iker Luengo <ikerluengo@eprosima.com>
* Refs 5346. Do not add partition separator on last partition
Signed-off-by: Iker Luengo <ikerluengo@e... |
CModule::EModRet CModule::OnUserRawMessage(CMessage& Message) {
return CONTINUE;
} | 0 | [
"CWE-20",
"CWE-264"
] | znc | 8de9e376ce531fe7f3c8b0aa4876d15b479b7311 | 232,854,233,875,132,600,000,000,000,000,000,000,000 | 3 | Fix remote code execution and privilege escalation vulnerability.
To trigger this, need to have a user already.
Thanks for Jeriko One <jeriko.one@gmx.us> for finding and reporting this.
CVE-2019-12816 |
mwifiex_cmd_append_generic_ie(struct mwifiex_private *priv, u8 **buffer)
{
int ret_len = 0;
struct mwifiex_ie_types_header ie_header;
/* Null Checks */
if (!buffer)
return 0;
if (!(*buffer))
return 0;
/*
* If there is a generic ie buffer setup, append it to the return
* parameter buffer pointer.
*/
... | 0 | [
"CWE-120",
"CWE-787"
] | linux | 5c455c5ab332773464d02ba17015acdca198f03d | 155,631,793,421,562,670,000,000,000,000,000,000,000 | 46 | mwifiex: Fix possible buffer overflows in mwifiex_cmd_802_11_ad_hoc_start
mwifiex_cmd_802_11_ad_hoc_start() calls memcpy() without checking
the destination size may trigger a buffer overflower,
which a local user could use to cause denial of service
or the execution of arbitrary code.
Fix it by putting the length chec... |
struct sk_buff *netlink_alloc_skb(struct sock *ssk, unsigned int size,
u32 dst_portid, gfp_t gfp_mask)
{
#ifdef CONFIG_NETLINK_MMAP
struct sock *sk = NULL;
struct sk_buff *skb;
struct netlink_ring *ring;
struct nl_mmap_hdr *hdr;
unsigned int maxlen;
sk = netlink_getsockbyportid(ssk, dst_portid);
if (IS_ER... | 0 | [
"CWE-20",
"CWE-269"
] | linux | f3d3342602f8bcbf37d7c46641cb9bca7618eb1c | 137,623,905,966,504,400,000,000,000,000,000,000,000 | 61 | 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... |
OPJ_BOOL OPJ_CALLCONV opj_decode_tile_data(opj_codec_t *p_codec,
OPJ_UINT32 p_tile_index,
OPJ_BYTE * p_data,
OPJ_UINT32 p_data_size,
opj_stream_t *p_stream
)
{
if (p_codec && p_data && p_stream) {
opj_codec_private_t * l_codec = (opj_... | 0 | [
"CWE-20"
] | openjpeg | 4edb8c83374f52cd6a8f2c7c875e8ffacccb5fa5 | 175,580,372,216,151,400,000,000,000,000,000,000,000 | 25 | Add support for generation of PLT markers in encoder
* -PLT switch added to opj_compress
* Add a opj_encoder_set_extra_options() function that
accepts a PLT=YES option, and could be expanded later
for other uses.
-------
Testing with a Sentinel2 10m band, T36JTT_20160914T074612_B02.jp2,
coming from S2A_MSIL1C_20... |
static void __drop_largest_extent(struct inode *inode,
pgoff_t fofs, unsigned int len)
{
struct extent_info *largest = &F2FS_I(inode)->extent_tree->largest;
if (fofs < largest->fofs + largest->len && fofs + len > largest->fofs) {
largest->len = 0;
f2fs_mark_inode_dirty_sync(inode, true);
}
} | 0 | [
"CWE-119",
"CWE-787"
] | linux | dad48e73127ba10279ea33e6dbc8d3905c4d31c0 | 281,695,244,779,492,300,000,000,000,000,000,000,000 | 10 | f2fs: fix a bug caused by NULL extent tree
Thread A: Thread B:
-f2fs_remount
-sbi->mount_opt.opt = 0;
<--- -f2fs_iget
-do_read_inode
-f2fs_init_extent_tree
-F2FS_I(inode)->extent_tree is NULL
-default_options && parse_options
-remount return
... |
int main(int argc, char **argv)
{
int ret = -1, argc_utf8 = -1;
char **argv_utf8 = NULL;
init_commandline_arguments_utf8(&argc_utf8, &argv_utf8);
ret = wvunpack_main(argc_utf8, argv_utf8);
free_commandline_arguments_utf8(&argc_utf8, &argv_utf8);
if (pause_mode) do_pause_mode ();
return ret;... | 1 | [
"CWE-476",
"CWE-703"
] | WavPack | 25b4a2725d8568212e7cf89ca05ca29d128af7ac | 17,622,919,189,138,470,000,000,000,000,000,000,000 | 11 | issue #121: NULL pointer dereference in wvunpack.c
* check for NULL pointer before dereferencing in wvunpack.c
* sanitize custom extensions to be alphanumeric only |
_gnutls_encrypt (gnutls_session_t session, const opaque * headers,
size_t headers_size, const opaque * data,
size_t data_size, opaque * ciphertext,
size_t ciphertext_size, content_type_t type, int random_pad,
record_parameters_st * params)
{
gnutls_d... | 0 | [
"CWE-310"
] | gnutls | 422214868061370aeeb0ac9cd0f021a5c350a57d | 189,168,787,391,653,470,000,000,000,000,000,000,000 | 52 | better check decrypted data. |
void CreateExtremalDataAndRunAveragePool(bool padding_same) {
const int batch = UniformRandomInt(1, 2);
const int input_depth = UniformRandomInt(1, 700);
const int output_depth = input_depth;
const int input_width_offset = UniformRandomInt(1, 30);
const int input_height_offset = UniformRandomInt(1, 30);
con... | 0 | [
"CWE-703",
"CWE-835"
] | tensorflow | dfa22b348b70bb89d6d6ec0ff53973bacb4f4695 | 335,842,490,600,129,960,000,000,000,000,000,000,000 | 62 | Prevent a division by 0 in average ops.
PiperOrigin-RevId: 385184660
Change-Id: I7affd4554f9b336fca29ac68f633232c094d0bd3 |
PyRun_SimpleStringFlags(const char *command, PyCompilerFlags *flags)
{
PyObject *m, *d, *v;
m = PyImport_AddModule("__main__");
if (m == NULL)
return -1;
d = PyModule_GetDict(m);
v = PyRun_StringFlags(command, Py_file_input, d, d, flags);
if (v == NULL) {
PyErr_Print();
r... | 0 | [
"CWE-125"
] | cpython | dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c | 192,696,576,185,596,230,000,000,000,000,000,000,000 | 15 | bpo-35766: Merge typed_ast back into CPython (GH-11645) |
static void init_dynamic_section_sdb(ELFOBJ *bin, Elf_(Addr) strtabaddr, size_t strsize) {
int r = Elf_(r_bin_elf_has_relro) (bin);
switch (r) {
case R_ELF_FULL_RELRO:
sdb_set (bin->kv, "elf.relro", "full", 0);
break;
case R_ELF_PART_RELRO:
sdb_set (bin->kv, "elf.relro", "partial", 0);
break;
default:
sd... | 0 | [
"CWE-787"
] | radare2 | 3ecdbf8e21186a9c5a4d3cfa3b1e9fd27045340e | 250,672,387,760,679,100,000,000,000,000,000,000,000 | 16 | Fix 4 byte oobread in msp430 disassembler ##crash
* Only crashes with asan builds
* Add missing =SN register
* Reported by cnitlrt via huntrdev
* BountyID: 1c22055b-b015-47a8-a57b-4982978751d0 |
const char *SSL_state_string_long(const SSL *s)
{
const char *str;
switch (s->state)
{
case SSL_ST_BEFORE: str="before SSL initialization"; break;
case SSL_ST_ACCEPT: str="before accept initialization"; break;
case SSL_ST_CONNECT: str="before connect initialization"; break;
case SSL_ST_OK: str="SSL negotiation fi... | 0 | [] | openssl | edc032b5e3f3ebb1006a9c89e0ae00504f47966f | 274,417,485,351,001,370,000,000,000,000,000,000,000 | 152 | Add SRP support. |
crypto_send(
struct exten *ep, /* extension field pointer */
struct value *vp, /* value pointer */
int start /* buffer offset */
)
{
u_int len, vallen, siglen, opcode;
u_int i, j;
/*
* Calculate extension field length and check for buffer
* overflow. Leave room for the MAC.
*/
len = 16; /* XXX Docume... | 0 | [
"CWE-20"
] | ntp | c4cd4aaf418f57f7225708a93bf48afb2bc9c1da | 335,776,535,816,952,240,000,000,000,000,000,000,000 | 59 | CVE-2014-9297 |
add_index_file(ParsedURL *pu, URLFile *uf)
{
char *p, *q;
TextList *index_file_list = NULL;
TextListItem *ti;
if (non_null(index_file))
index_file_list = make_domain_list(index_file);
if (index_file_list == NULL) {
uf->stream = NULL;
return;
}
for (ti = index_file_list->first; ti; ti = t... | 0 | [
"CWE-119"
] | w3m | ba9d78faeba9024c3e8840579c3b0e959ae2cb0f | 277,836,695,751,735,230,000,000,000,000,000,000,000 | 24 | Prevent global-buffer-overflow in parseURL()
Bug-Debian: https://github.com/tats/w3m/issues/41 |
static int __init htab_dt_scan_pftsize(unsigned long node,
const char *uname, int depth,
void *data)
{
char *type = of_get_flat_dt_prop(node, "device_type", NULL);
u32 *prop;
/* We are scanning "cpu" nodes only */
if (type == NULL || strcmp(type, "cpu") != 0)
return 0;
prop = (u32 *)of_ge... | 0 | [
"CWE-200"
] | linux-2.6 | 721151d004dcf01a71b12bb6b893f9160284cf6e | 188,476,469,429,249,400,000,000,000,000,000,000,000 | 19 | [POWERPC] Allow drivers to map individual 4k pages to userspace
Some drivers have resources that they want to be able to map into
userspace that are 4k in size. On a kernel configured with 64k pages
we currently end up mapping the 4k we want plus another 60k of
physical address space, which could contain anything. T... |
Images of the list are appended in a single temporary image for visualization purposes.
The function returns immediately.
**/
const CImgList<T>& display(CImgDisplay &disp, const char axis='x', const float align=0) const { | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 130,215,569,091,389,640,000,000,000,000,000,000,000 | 4 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
void setUpBufferLimits() {
ON_CALL(response_encoder_, getStream()).WillByDefault(ReturnRef(stream_));
EXPECT_CALL(stream_, addCallbacks(_))
.WillOnce(Invoke(
[&](Http::StreamCallbacks& callbacks) -> void { stream_callbacks_ = &callbacks; }));
EXPECT_CALL(stream_, bufferLimit()).WillOnc... | 1 | [
"CWE-400"
] | envoy | 0e49a495826ea9e29134c1bd54fdeb31a034f40c | 24,222,056,748,460,660,000,000,000,000,000,000,000 | 7 | 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 bool remove_xps_queue_cpu(struct net_device *dev,
struct xps_dev_maps *dev_maps,
int cpu, u16 offset, u16 count)
{
int num_tc = dev->num_tc ? : 1;
bool active = false;
int tci;
for (tci = cpu * num_tc; num_tc--; tci++) {
int i, j;
for (i = count, j = offset; i--; j++) {
if (!remove_xps_qu... | 0 | [
"CWE-476"
] | linux | 0ad646c81b2182f7fa67ec0c8c825e0ee165696d | 250,969,331,298,638,230,000,000,000,000,000,000,000 | 21 | 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... |
cmsBool _cmsRegisterMultiProcessElementPlugin(cmsPluginBase* Data)
{
return RegisterTypesPlugin(Data, SupportedMPEtypes, DEFAULT_MPE_TYPE_COUNT);
} | 0 | [] | Little-CMS | 886e2f524268efe8a1c3aa838c28e446fda24486 | 241,200,781,413,313,240,000,000,000,000,000,000,000 | 4 | Fixes from coverity check |
ldap_search_dtor (LDAPOp *op)
{
EBookBackendLDAP *bl;
LDAPSearchOp *search_op = (LDAPSearchOp *) op;
d (printf ("ldap_search_dtor (%p)\n", search_op->view));
bl = E_BOOK_BACKEND_LDAP (e_data_book_view_get_backend (op->view));
/* unhook us from our EDataBookView */
g_mutex_lock (&bl->priv->view_mutex);
g_objec... | 0 | [] | evolution-data-server | 34bad61738e2127736947ac50e0c7969cc944972 | 308,945,324,792,522,640,000,000,000,000,000,000,000 | 19 | Bug 796174 - strcat() considered unsafe for buffer overflow |
static int nl80211_set_key(struct sk_buff *skb, struct genl_info *info)
{
struct cfg80211_registered_device *rdev = info->user_ptr[0];
struct key_parse key;
int err;
struct net_device *dev = info->user_ptr[1];
err = nl80211_parse_key(info, &key);
if (err)
return err;
if (key.idx < 0)
return -EINVAL;
/* O... | 0 | [
"CWE-120"
] | linux | f88eb7c0d002a67ef31aeb7850b42ff69abc46dc | 150,070,326,914,958,170,000,000,000,000,000,000,000 | 88 | nl80211: validate beacon head
We currently don't validate the beacon head, i.e. the header,
fixed part and elements that are to go in front of the TIM
element. This means that the variable elements there can be
malformed, e.g. have a length exceeding the buffer size, but
most downstream code from this assumes that thi... |
scan_file (GFile *file,
SourceInfo *source_info,
CommonJob *job)
{
GFileInfo *info;
GError *error;
GQueue *dirs;
GFile *dir;
char *primary;
char *secondary;
char *details;
int response;
dirs = g_queue_new ();
retry:
error = NULL;
info = g_file_query_info (file,
G_FILE_ATTRIBUTE_STANDARD_TY... | 0 | [] | nautilus | ca2fd475297946f163c32dcea897f25da892b89d | 309,616,134,612,665,400,000,000,000,000,000,000,000 | 85 | Add nautilus_file_mark_desktop_file_trusted(), this now adds a #! line if
2009-02-24 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-file-operations.c:
* libnautilus-private/nautilus-file-operations.h:
Add nautilus_file_mark_desktop_file_trusted(), this now
adds a #! line if th... |
static int tower_open (struct inode *inode, struct file *file)
{
struct lego_usb_tower *dev = NULL;
int subminor;
int retval = 0;
struct usb_interface *interface;
struct tower_reset_reply reset_reply;
int result;
nonseekable_open(inode, file);
subminor = iminor(inode);
interface = usb_find_interface (&tower_... | 0 | [
"CWE-476"
] | linux | 2fae9e5a7babada041e2e161699ade2447a01989 | 189,873,895,774,853,780,000,000,000,000,000,000,000 | 97 | usb: misc: legousbtower: Fix NULL pointer deference
This patch fixes a NULL pointer dereference caused by a race codition in
the probe function of the legousbtower driver. It re-structures the
probe function to only register the interface after successfully reading
the board's firmware ID.
The probe function does not... |
struct resource_pool *dce120_create_resource_pool(
uint8_t num_virtual_links,
struct dc *dc)
{
struct dce110_resource_pool *pool =
kzalloc(sizeof(struct dce110_resource_pool), GFP_KERNEL);
if (!pool)
return NULL;
if (construct(num_virtual_links, dc, pool))
return &pool->base;
kfree(pool);
BREAK_TO_DEBUG... | 0 | [
"CWE-400",
"CWE-401"
] | linux | 104c307147ad379617472dd91a5bcb368d72bd6d | 12,612,542,291,827,945,000,000,000,000,000,000,000 | 17 | drm/amd/display: prevent memory leak
In dcn*_create_resource_pool the allocated memory should be released if
construct pool fails.
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com> |
static void tcp_v6_reqsk_destructor(struct request_sock *req)
{
kfree_skb(inet_rsk(req)->pktopts);
} | 0 | [
"CWE-416",
"CWE-284",
"CWE-264"
] | linux | 45f6fad84cc305103b28d73482b344d7f5b76f39 | 143,240,170,839,050,600,000,000,000,000,000,000,000 | 4 | ipv6: add complete rcu protection around np->opt
This patch addresses multiple problems :
UDP/RAW sendmsg() need to get a stable struct ipv6_txoptions
while socket is not locked : Other threads can change np->opt
concurrently. Dmitry posted a syzkaller
(http://github.com/google/syzkaller) program desmonstrating
use-a... |
static void add_not_null_conds(JOIN *join)
{
JOIN_TAB *tab;
DBUG_ENTER("add_not_null_conds");
for (tab= first_linear_tab(join, WITH_BUSH_ROOTS, WITHOUT_CONST_TABLES);
tab;
tab= next_linear_tab(join, tab, WITH_BUSH_ROOTS))
{
if (tab->type == JT_REF || tab->type == JT_EQ_REF ||
tab-... | 0 | [] | server | ff77a09bda884fe6bf3917eb29b9d3a2f53f919b | 150,624,850,476,927,670,000,000,000,000,000,000,000 | 72 | MDEV-22464 Server crash on UPDATE with nested subquery
Uninitialized ref_pointer_array[] because setup_fields() got empty
fields list. mysql_multi_update() for some reason does that by
substituting the fields list with empty total_list for the
mysql_select() call (looks like wrong merge since total_list is not
used a... |
inline double rol(const double a, const unsigned int n=1) {
return (double)rol((cimg_long)a,n); | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 238,851,459,564,707,880,000,000,000,000,000,000,000 | 3 | Fix other issues in 'CImg<T>::load_bmp()'. |
std::string str() const { return std::string(&buffer_[0], size()); } | 0 | [
"CWE-134",
"CWE-119",
"CWE-787"
] | fmt | 8cf30aa2be256eba07bb1cefb998c52326e846e7 | 333,469,460,018,612,680,000,000,000,000,000,000,000 | 1 | Fix segfault on complex pointer formatting (#642) |
void MainWindow::on_actionTopics_triggered()
{
QDesktopServices::openUrl(QUrl("https://www.shotcut.org/howtos/"));
} | 0 | [
"CWE-89",
"CWE-327",
"CWE-295"
] | shotcut | f008adc039642307f6ee3378d378cdb842e52c1d | 299,694,581,960,560,200,000,000,000,000,000,000,000 | 4 | fix upgrade check is not using TLS correctly |
_gnutls_x509_verify_signature (const gnutls_datum_t * tbs,
const gnutls_datum_t * hash,
const gnutls_datum_t * signature,
gnutls_x509_crt_t issuer)
{
bigint_t issuer_params[MAX_PUBLIC_PARAMS_SIZE];
int ret, issuer_params_size, i;
/* Read the MPI parameters from the issuer's certific... | 0 | [
"CWE-17"
] | gnutls | 897cbce62c0263a498088ac3e465aa5f05f8719c | 78,739,286,813,598,450,000,000,000,000,000,000,000 | 37 | Extended time verification to trusted certificate list as well. Introduced
the flag GNUTLS_VERIFY_DISABLE_TRUSTED_TIME_CHECKS that will prevent the
trusted certificate list verification. |
void hci_conn_check_pending(struct hci_dev *hdev)
{
struct hci_conn *conn;
BT_DBG("hdev %s", hdev->name);
hci_dev_lock(hdev);
conn = hci_conn_hash_lookup_state(hdev, ACL_LINK, BT_CONNECT2);
if (conn)
hci_acl_create_connection(conn);
hci_dev_unlock(hdev);
} | 0 | [
"CWE-327"
] | linux | d5bb334a8e171b262e48f378bd2096c0ea458265 | 151,816,608,193,647,100,000,000,000,000,000,000,000 | 14 | Bluetooth: Align minimum encryption key size for LE and BR/EDR connections
The minimum encryption key size for LE connections is 56 bits and to
align LE with BR/EDR, enforce 56 bits of minimum encryption key size for
BR/EDR connections as well.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan... |
int traverse_trees(int n, struct tree_desc *t, struct traverse_info *info)
{
int error = 0;
struct name_entry *entry = xmalloc(n*sizeof(*entry));
int i;
struct tree_desc_x *tx = xcalloc(n, sizeof(*tx));
struct strbuf base = STRBUF_INIT;
int interesting = 1;
char *traverse_path;
for (i = 0; i < n; i++)
tx[i].... | 0 | [
"CWE-20"
] | git | e1d911dd4c7b76a5a8cec0f5c8de15981e34da83 | 314,270,800,687,976,300,000,000,000,000,000,000,000 | 109 | mingw: disallow backslash characters in tree objects' file names
The backslash character is not a valid part of a file name on Windows.
Hence it is dangerous to allow writing files that were unpacked from
tree objects, when the stored file name contains a backslash character:
it will be misinterpreted as directory sep... |
extern "C" void *malloc_wrapper(struct _reent *r, size_t size, void *caller)
{
void *ptr = NULL;
#if MBED_MEM_TRACING_ENABLED
mbed_mem_trace_lock();
#endif
#if MBED_HEAP_STATS_ENABLED
malloc_stats_mutex->lock();
alloc_info_t *alloc_info = NULL;
if (size <= SIZE_MAX - sizeof(alloc_info_t)) {
... | 0 | [
"CWE-190"
] | mbed-os | 4450464fc87fb104a45190a2334b82b3bb2b13fb | 257,798,437,669,142,760,000,000,000,000,000,000,000 | 36 | Add integer overflow check to the malloc wrappers
Add a check that the combined size of the buffer to allocate and
alloc_info_t does not exceed the maximum integer value representable
by size_t. |
void Field_bit::hash(ulong *nr, ulong *nr2)
{
if (is_null())
{
*nr^= (*nr << 1) | 1;
}
else
{
CHARSET_INFO *cs= &my_charset_bin;
longlong value= Field_bit::val_int();
uchar tmp[8];
mi_int8store(tmp,value);
cs->coll->hash_sort(cs, tmp, 8, nr, nr2);
}
} | 0 | [
"CWE-416",
"CWE-703"
] | server | 08c7ab404f69d9c4ca6ca7a9cf7eec74c804f917 | 133,878,687,050,178,340,000,000,000,000,000,000,000 | 15 | MDEV-24176 Server crashes after insert in the table with virtual
column generated using date_format() and if()
vcol_info->expr is allocated on expr_arena at parsing stage. Since
expr item is allocated on expr_arena all its containee items must be
allocated on expr_arena too. Otherwise fix_session_expr() will
encounter... |
void opj_j2k_setup_end_compress (opj_j2k_t *p_j2k)
{
/* preconditions */
assert(p_j2k != 00);
/* DEVELOPER CORNER, insert your custom procedures */
opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(opj_procedure)opj_j2k_write_eoc );
if (OPJ_IS_CINEMA(p_j2k->m_cp.rsiz)) ... | 0 | [] | openjpeg | 0fa5a17c98c4b8f9ee2286f4f0a50cf52a5fccb0 | 239,920,534,678,931,800,000,000,000,000,000,000,000 | 16 | [trunk] Correct potential double free on malloc failure in opj_j2k_copy_default_tcp_and_create_tcp (fixes issue 492) |
static int emit_call(u8 **pprog, void *func, void *ip)
{
return emit_patch(pprog, func, ip, 0xE8);
} | 0 | [
"CWE-77"
] | linux | e4d4d456436bfb2fe412ee2cd489f7658449b098 | 175,127,574,924,729,770,000,000,000,000,000,000,000 | 4 | bpf, x86: Validate computation of branch displacements for x86-64
The branch displacement logic in the BPF JIT compilers for x86 assumes
that, for any generated branch instruction, the distance cannot
increase between optimization passes.
But this assumption can be violated due to how the distances are
computed. Spec... |
static int proc_gid_map_open(struct inode *inode, struct file *file)
{
return proc_id_map_open(inode, file, &proc_gid_seq_operations);
} | 0 | [
"CWE-362"
] | linux | 8148a73c9901a8794a50f950083c00ccf97d43b3 | 119,059,854,465,684,120,000,000,000,000,000,000,000 | 4 | proc: prevent accessing /proc/<PID>/environ until it's ready
If /proc/<PID>/environ gets read before the envp[] array is fully set up
in create_{aout,elf,elf_fdpic,flat}_tables(), we might end up trying to
read more bytes than are actually written, as env_start will already be
set but env_end will still be zero, makin... |
autodiscover_cb (GObject *source_object, GAsyncResult *res, gpointer user_data)
{
GoaEwsClient *client = GOA_EWS_CLIENT (source_object);
AddAccountData *data = user_data;
goa_ews_client_autodiscover_finish (client, res, &data->error);
g_main_loop_quit (data->loop);
gtk_widget_set_sensitive (data->connect_but... | 0 | [
"CWE-310"
] | gnome-online-accounts | edde7c63326242a60a075341d3fea0be0bc4d80e | 125,750,369,643,503,450,000,000,000,000,000,000,000 | 10 | Guard against invalid SSL certificates
None of the branded providers (eg., Google, Facebook and Windows Live)
should ever have an invalid certificate. So set "ssl-strict" on the
SoupSession object being used by GoaWebView.
Providers like ownCloud and Exchange might have to deal with
certificates that are not up to th... |
bool bus_socket_auth_needs_write(sd_bus *b) {
unsigned i;
if (b->auth_index >= ELEMENTSOF(b->auth_iovec))
return false;
for (i = b->auth_index; i < ELEMENTSOF(b->auth_iovec); i++) {
struct iovec *j = b->auth_iovec + i;
if (j->iov_len > 0)
... | 0 | [
"CWE-787"
] | systemd | 6d586a13717ae057aa1b4127400c3de61cd5b9e7 | 177,118,020,829,958,140,000,000,000,000,000,000,000 | 16 | sd-bus: if we receive an invalid dbus message, ignore and proceeed
dbus-daemon might have a slightly different idea of what a valid msg is
than us (for example regarding valid msg and field sizes). Let's hence
try to proceed if we can and thus drop messages rather than fail the
connection if we fail to validate a mess... |
TfLiteStatus ResizeOutputShape(TfLiteContext* context,
const TfLiteTensor* output_shape,
TfLiteTensor* output) {
if (output_shape->type == kTfLiteInt32) {
return Resize<int32_t>(context, output_shape, output);
} else if (output_shape->type == kTfLite... | 0 | [
"CWE-125",
"CWE-787"
] | tensorflow | 1970c2158b1ffa416d159d03c3370b9a462aee35 | 57,111,939,695,203,080,000,000,000,000,000,000,000 | 13 | [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... |
decode_NXAST_RAW_CONTROLLER(const struct nx_action_controller *nac,
enum ofp_version ofp_version OVS_UNUSED,
struct ofpbuf *out)
{
struct ofpact_controller *oc;
oc = ofpact_put_CONTROLLER(out);
oc->ofpact.raw = NXAST_RAW_CONTROLLER;
oc->max_len = ... | 0 | [
"CWE-125"
] | ovs | 9237a63c47bd314b807cda0bd2216264e82edbe8 | 149,802,943,809,357,540,000,000,000,000,000,000,000 | 15 | ofp-actions: Avoid buffer overread in BUNDLE action decoding.
Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9052
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org> |
static inline int domain_type_is_si(struct dmar_domain *domain)
{
return domain->flags & DOMAIN_FLAG_STATIC_IDENTITY;
} | 0 | [] | linux | d8b8591054575f33237556c32762d54e30774d28 | 252,809,517,741,439,200,000,000,000,000,000,000,000 | 4 | iommu/vt-d: Disable ATS support on untrusted devices
Commit fb58fdcd295b9 ("iommu/vt-d: Do not enable ATS for untrusted
devices") disables ATS support on the devices which have been marked
as untrusted. Unfortunately this is not enough to fix the DMA attack
vulnerabiltiies because IOMMU driver allows translated reques... |
tight_filter_gradient24(VncState *vs, uint8_t *buf, int w, int h)
{
uint32_t *buf32;
uint32_t pix32;
int shift[3];
int *prev;
int here[3], upper[3], left[3], upperleft[3];
int prediction;
int x, y, c;
buf32 = (uint32_t *)buf;
memset(vs->tight.gradient.buffer, 0, w * 3 * sizeof(int))... | 1 | [
"CWE-125"
] | qemu | 9f64916da20eea67121d544698676295bbb105a7 | 209,961,068,420,556,300,000,000,000,000,000,000,000 | 50 | 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... |
static u32 tc_cls_act_convert_ctx_access(enum bpf_access_type type,
const struct bpf_insn *si,
struct bpf_insn *insn_buf,
struct bpf_prog *prog, u32 *target_size)
{
struct bpf_insn *insn = insn_buf;
switch (si->off) {
case offsetof(struct __sk_buff, ifindex):
*insn++ = BPF_LDX_MEM(BPF_FIELD_SIZE... | 0 | [
"CWE-120"
] | linux | 050fad7c4534c13c8eb1d9c2ba66012e014773cb | 199,410,762,270,240,880,000,000,000,000,000,000,000 | 23 | 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... |
assembleVaryKey(String &vary, SBuf &vstr, const HttpRequest &request)
{
static const SBuf asterisk("*");
const char *pos = nullptr;
const char *item = nullptr;
int ilen = 0;
while (strListGetItem(&vary, ',', &item, &ilen, &pos)) {
SBuf name(item, ilen);
if (name == asterisk) {
... | 0 | [
"CWE-444"
] | squid | fd68382860633aca92065e6c343cfd1b12b126e7 | 64,726,533,549,519,770,000,000,000,000,000,000,000 | 29 | Improve Transfer-Encoding handling (#702)
Reject messages containing Transfer-Encoding header with coding other
than chunked or identity. Squid does not support other codings.
For simplicity and security sake, also reject messages where
Transfer-Encoding contains unnecessary complex values that are
technically equiva... |
CImg<T> operator<<(const char *const expression) const {
return (+*this)<<=expression;
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 42,810,519,827,471,710,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. |
BGD_DECLARE(gdImagePtr) gdImageCreateFromGd2Ctx (gdIOCtxPtr in)
{
int sx, sy;
int i;
int ncx, ncy, nc, cs, cx, cy;
int x, y, ylo, yhi, xlo, xhi;
int vers, fmt;
t_chunk_info *chunkIdx = NULL; /* So we can gdFree it with impunity. */
unsigned char *chunkBuf = NULL; /* So we can gdFree it with impunity. */
int chu... | 0 | [
"CWE-20"
] | libgd | fe9ed49dafa993e3af96b6a5a589efeea9bfb36f | 334,996,856,273,504,700,000,000,000,000,000,000,000 | 160 | Fix DOS vulnerability in gdImageCreateFromGd2Ctx()
We must not pretend that there are image data if there are none. Instead
we fail reading the image file gracefully. |
static int bp_interception(struct vcpu_svm *svm)
{
struct kvm_run *kvm_run = svm->vcpu.run;
kvm_run->exit_reason = KVM_EXIT_DEBUG;
kvm_run->debug.arch.pc = svm->vmcb->save.cs.base + svm->vmcb->save.rip;
kvm_run->debug.arch.exception = BP_VECTOR;
return 0;
} | 0 | [
"CWE-400"
] | linux-2.6 | 9581d442b9058d3699b4be568b6e5eae38a41493 | 120,669,740,961,558,340,000,000,000,000,000,000,000 | 9 | KVM: Fix fs/gs reload oops with invalid ldt
kvm reloads the host's fs and gs blindly, however the underlying segment
descriptors may be invalid due to the user modifying the ldt after loading
them.
Fix by using the safe accessors (loadsegment() and load_gs_index()) instead
of home grown unsafe versions.
This is CVE-... |
static void pxa2xx_setup_cp14(PXA2xxState *s)
{
define_arm_cp_regs_with_opaque(s->cpu, pxa_cp_reginfo, s);
} | 0 | [
"CWE-119"
] | qemu | caa881abe0e01f9931125a0977ec33c5343e4aa7 | 136,641,023,723,622,840,000,000,000,000,000,000,000 | 4 | pxa2xx: avoid buffer overrun on incoming migration
CVE-2013-4533
s->rx_level is read from the wire and used to determine how many bytes
to subsequently read into s->rx_fifo[]. If s->rx_level exceeds the
length of s->rx_fifo[] the buffer can be overrun with arbitrary data
from the wire.
Fix this by validating rx_leve... |
int CLASS parse_tiff_ifd (int base)
{
unsigned entries, tag, type, len, plen=16, save;
int ifd, use_cm=0, cfa, i, j, c, ima_len=0;
int blrr=1, blrc=1, dblack[] = { 0,0,0,0 };
char software[64], *cbuf, *cp;
uchar cfa_pat[16], cfa_pc[] = { 0,1,2,3 }, tab[256];
double cc[4][4], cm[4][3], cam_xyz[4][3], num;
... | 0 | [
"CWE-703"
] | LibRaw | 11909cc59e712e09b508dda729b99aeaac2b29ad | 144,734,922,869,222,280,000,000,000,000,000,000,000 | 495 | cumulated data checks patch |
cifs_put_tcon(struct cifs_tcon *tcon)
{
unsigned int xid;
struct cifs_ses *ses = tcon->ses;
cifs_dbg(FYI, "%s: tc_count=%d\n", __func__, tcon->tc_count);
spin_lock(&cifs_tcp_ses_lock);
if (--tcon->tc_count > 0) {
spin_unlock(&cifs_tcp_ses_lock);
return;
}
list_del_init(&tcon->tcon_list);
spin_unlock(&cifs... | 0 | [
"CWE-703",
"CWE-189"
] | linux | 1fc29bacedeabb278080e31bb9c1ecb49f143c3b | 165,796,235,354,517,170,000,000,000,000,000,000,000 | 24 | cifs: fix off-by-one bug in build_unc_path_to_root
commit 839db3d10a (cifs: fix up handling of prefixpath= option) changed
the code such that the vol->prepath no longer contained a leading
delimiter and then fixed up the places that accessed that field to
account for that change.
One spot in build_unc_path_to_root wa... |
heif_encoder::~heif_encoder()
{
release();
} | 0 | [
"CWE-125"
] | libheif | f7399b62d7fbc596f1b2871578c1d2053bedf1dd | 77,777,073,634,691,800,000,000,000,000,000,000,000 | 4 | Handle case where referenced "iref" box doesn't exist (fixes #138). |
GF_Err hdlr_box_size(GF_Box *s)
{
GF_HandlerBox *ptr = (GF_HandlerBox *)s;
ptr->size += 20 + 1; //null term or counted string
if (ptr->nameUTF8) {
ptr->size += strlen(ptr->nameUTF8);
}
return GF_OK;
} | 0 | [
"CWE-787"
] | gpac | 388ecce75d05e11fc8496aa4857b91245007d26e | 77,466,435,864,335,110,000,000,000,000,000,000,000 | 9 | fixed #1587 |
mrb_ci_nregs(mrb_callinfo *ci)
{
const struct RProc *p;
if (!ci) return 4;
mrb_int nregs = mrb_ci_bidx(ci) + 1; /* self + args + kargs + blk */
p = ci->proc;
if (p && !MRB_PROC_CFUNC_P(p) && p->body.irep && p->body.irep->nregs > nregs) {
return p->body.irep->nregs;
}
return nregs;
} | 0 | [
"CWE-122",
"CWE-787"
] | mruby | 47068ae07a5fa3aa9a1879cdfe98a9ce0f339299 | 126,243,008,756,262,650,000,000,000,000,000,000,000 | 12 | vm.c: packed arguments length may be zero for `send` method. |
int vm_insert_page(struct vm_area_struct *vma, unsigned long addr,
struct page *page)
{
if (addr < vma->vm_start || addr >= vma->vm_end)
return -EFAULT;
if (!page_count(page))
return -EINVAL;
vma->vm_flags |= VM_INSERTPAGE;
return insert_page(vma, addr, page, vma->vm_page_prot);
} | 0 | [
"CWE-20"
] | linux-2.6 | 89f5b7da2a6bad2e84670422ab8192382a5aeb9f | 197,117,682,567,182,600,000,000,000,000,000,000,000 | 10 | 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... |
static NTSTATUS open_mode_check(connection_struct *conn,
struct share_mode_lock *lck,
uint32 access_mask,
uint32 share_access)
{
int i;
if(lck->data->num_share_modes == 0) {
return NT_STATUS_OK;
}
if (is_stat_open(access_mask)) {
/* Stat open that doesn't trigger oplock breaks or share mode
* c... | 0 | [] | samba | 60f922bf1bd8816eacbb32c24793ad1f97a1d9f2 | 142,805,109,637,782,930,000,000,000,000,000,000,000 | 50 | Fix bug #10229 - No access check verification on stream files.
https://bugzilla.samba.org/show_bug.cgi?id=10229
We need to check if the requested access mask
could be used to open the underlying file (if
it existed), as we're passing in zero for the
access mask to the base filename.
Signed-off-by: Jeremy Allison <jr... |
static char *my_case_str(const char *str,
size_t str_len,
const char *token,
uint token_len)
{
my_match_t match;
uint status= my_charset_latin1.coll->instr(&my_charset_latin1,
str, str_len,
... | 0 | [
"CWE-319"
] | mysql-server | 0002e1380d5f8c113b6bce91f2cf3f75136fd7c7 | 131,511,491,485,194,400,000,000,000,000,000,000,000 | 14 | BUG#25575605: SETTING --SSL-MODE=REQUIRED SENDS CREDENTIALS BEFORE VERIFYING SSL CONNECTION
MYSQL_OPT_SSL_MODE option introduced.
It is set in case of --ssl-mode=REQUIRED and permits only SSL connection.
(cherry picked from commit f91b941842d240b8a62645e507f5554e8be76aec) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.