func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
header_append_domain_buffer(char *buffer, char *domain, size_t len)
{
size_t i;
int escape, quote, comment, bracket;
int has_domain, has_bracket, has_group;
int pos_bracket, pos_component, pos_insert;
char copy[APPEND_DOMAIN_BUFFER_SIZE];
escape = quote = comment = bracket = 0;
has_domain = has_bracket = has_gr... | 0 | [
"CWE-78",
"CWE-252"
] | src | 9dcfda045474d8903224d175907bfc29761dcb45 | 292,622,149,632,729,300,000,000,000,000,000,000,000 | 79 | Fix a security vulnerability discovered by Qualys which can lead to a
privileges escalation on mbox deliveries and unprivileged code execution
on lmtp deliveries, due to a logic issue causing a sanity check to be
missed.
ok eric@, millert@ |
define_function(length)
{
char* s = string_argument(1);
return_integer(strlen(s));
} | 0 | [
"CWE-416"
] | yara | 053e67e3ec81cc9268ce30eaf0d6663d8639ed1e | 150,236,218,503,182,490,000,000,000,000,000,000,000 | 6 | Fix issue #658 |
void clearAndZero() { memset(start, 0, ptr-start); clear(); } | 0 | [
"CWE-20",
"CWE-787"
] | tigervnc | 0943c006c7d900dfc0281639e992791d6c567438 | 154,701,571,253,157,600,000,000,000,000,000,000,000 | 1 | Use size_t for lengths in stream objects
Provides safety against them accidentally becoming negative because
of bugs in the calculations.
Also does the same to CharArray and friends as they were strongly
connection to the stream objects. |
static RxFilterInfo *virtio_net_query_rxfilter(NetClientState *nc)
{
VirtIONet *n = qemu_get_nic_opaque(nc);
VirtIODevice *vdev = VIRTIO_DEVICE(n);
RxFilterInfo *info;
strList *str_list, *entry;
int i;
info = g_malloc0(sizeof(*info));
info->name = g_strdup(nc->name);
info->promiscuous =... | 0 | [
"CWE-119"
] | qemu | 98f93ddd84800f207889491e0b5d851386b459cf | 264,370,205,545,446,670,000,000,000,000,000,000,000 | 66 | virtio-net: out-of-bounds buffer write on load
CVE-2013-4149 QEMU 1.3.0 out-of-bounds buffer write in
virtio_net_load()@hw/net/virtio-net.c
> } else if (n->mac_table.in_use) {
> uint8_t *buf = g_malloc0(n->mac_table.in_use);
We are allocating buffer of size n->mac_table.in_use
> qemu... |
static unsigned long mb2_cache_count(struct shrinker *shrink,
struct shrink_control *sc)
{
struct mb2_cache *cache = container_of(shrink, struct mb2_cache,
c_shrink);
return cache->c_entry_count;
} | 0 | [
"CWE-241",
"CWE-19"
] | linux | f9a61eb4e2471c56a63cd804c7474128138c38ac | 247,048,659,171,105,440,000,000,000,000,000,000,000 | 8 | mbcache2: reimplement mbcache
Original mbcache was designed to have more features than what ext?
filesystems ended up using. It supported entry being in more hashes, it
had a home-grown rwlocking of each entry, and one cache could cache
entries from multiple filesystems. This genericity also resulted in more
complex l... |
set_term_defaults(void)
{
struct vimoption *p;
for (p = &options[0]; p->fullname != NULL; p++)
{
if (istermoption(p) && p->def_val[VI_DEFAULT] != *(char_u **)(p->var))
{
if (p->flags & P_DEF_ALLOCED)
{
free_string_option(p->def_val[VI_DEFAULT]);
p->flags &= ~P_DEF_ALLOCED;
}
p->... | 0 | [
"CWE-20"
] | vim | d0b5138ba4bccff8a744c99836041ef6322ed39a | 245,626,083,305,012,280,000,000,000,000,000,000,000 | 22 | patch 8.0.0056
Problem: When setting 'filetype' there is no check for a valid name.
Solution: Only allow valid characters in 'filetype', 'syntax' and 'keymap'. |
PHP_FUNCTION(openssl_get_curve_names)
{
EC_builtin_curve *curves = NULL;
const char *sname;
size_t i;
size_t len = EC_get_builtin_curves(NULL, 0);
curves = emalloc(sizeof(EC_builtin_curve) * len);
if (!EC_get_builtin_curves(curves, len)) {
RETURN_FALSE;
}
array_init(return_value);
for (i = 0; i < len; i++)... | 0 | [
"CWE-326"
] | php-src | 0216630ea2815a5789a24279a1211ac398d4de79 | 274,191,993,593,957,560,000,000,000,000,000,000,000 | 21 | Fix bug #79601 (Wrong ciphertext/tag in AES-CCM encryption for a 12 bytes IV) |
static void FVMenuKernByClasses(GWindow gw, struct gmenuitem *UNUSED(mi), GEvent *UNUSED(e)) {
FontView *fv = (FontView *) GDrawGetUserData(gw);
ShowKernClasses(fv->b.sf,NULL,fv->b.active_layer,false);
} | 0 | [
"CWE-119",
"CWE-787"
] | fontforge | 626f751752875a0ddd74b9e217b6f4828713573c | 62,935,072,642,618,640,000,000,000,000,000,000,000 | 5 | Warn users before discarding their unsaved scripts (#3852)
* Warn users before discarding their unsaved scripts
This closes #3846. |
void controller::reload_indexes(const std::vector<int>& indexes, bool unattended) {
scope_measure m1("controller::reload_indexes");
unsigned int unread_feeds, unread_articles;
compute_unread_numbers(unread_feeds, unread_articles);
unsigned long size;
{
std::lock_guard<std::mutex> feedslock(feeds_mutex);
size ... | 0 | [
"CWE-943",
"CWE-787"
] | newsbeuter | 96e9506ae9e252c548665152d1b8968297128307 | 67,574,796,961,406,520,000,000,000,000,000,000,000 | 29 | Sanitize inputs to bookmark-cmd (#591)
Newsbeuter didn't properly shell-escape the arguments passed to
bookmarking command, which allows a remote attacker to perform remote
code execution by crafting an RSS item whose title and/or URL contain
something interpretable by the shell (most notably subshell
invocations.)
T... |
struct dst_entry *fib6_rule_lookup(struct net *net, struct flowi6 *fl6,
const struct sk_buff *skb,
int flags, pol_lookup_t lookup)
{
struct rt6_info *rt;
rt = lookup(net, net->ipv6.fib6_main_tbl, fl6, skb, flags);
if (rt->dst.error == -EAGAIN) {
ip6_rt_put_flags(rt, flags);
rt = net->ipv6.ip6_null... | 0 | [
"CWE-755"
] | linux | 7b09c2d052db4b4ad0b27b97918b46a7746966fa | 137,054,922,321,227,940,000,000,000,000,000,000,000 | 16 | ipv6: fix a typo in fib6_rule_lookup()
Yi Ren reported an issue discovered by syzkaller, and bisected
to the cited commit.
Many thanks to Yi, this trivial patch does not reflect the patient
work that has been done.
Fixes: d64a1f574a29 ("ipv6: honor RT6_LOOKUP_F_DST_NOREF in rule lookup logic")
Signed-off-by: Eric Du... |
static INLINE BOOL updateContextFormat(CLEAR_CONTEXT* clear, UINT32 DstFormat)
{
if (!clear || !clear->nsc)
return FALSE;
clear->format = DstFormat;
return nsc_context_set_pixel_format(clear->nsc, DstFormat);
} | 0 | [
"CWE-125"
] | FreeRDP | 363d7046dfec4003b91aecf7867e3b05905f3843 | 227,090,566,798,061,980,000,000,000,000,000,000,000 | 8 | Fixed oob read in clear_decompress_subcode_rlex
Fixed length checks before stream read.
Thanks to hac425 CVE-2020-11040 |
static int wolfSSH_SFTPNAME_readdir(WOLFSSH* ssh, WDIR* dir, WS_SFTPNAME* out,
char* dirName)
{
struct dirent* dp;
int sz;
if (dir == NULL || ssh == NULL || out == NULL) {
return WS_BAD_ARGUMENT;
}
dp = WREADDIR(dir);
if (dp == NULL) {
return WS_FATAL_ERROR;
}
... | 0 | [
"CWE-190"
] | wolfssh | edb272e35ee57e7b89f3e127222c6981b6a1e730 | 132,247,461,337,964,700,000,000,000,000,000,000,000 | 70 | ASAN SFTP Fixes
When decoding SFTP messages, fix the size checks so they don't wrap. (ZD12766) |
static int mcryptd_hash_init_enqueue(struct ahash_request *req)
{
return mcryptd_hash_enqueue(req, mcryptd_hash_init);
} | 0 | [
"CWE-476",
"CWE-284"
] | linux | 48a992727d82cb7db076fa15d372178743b1f4cd | 264,754,027,516,967,500,000,000,000,000,000,000,000 | 4 | crypto: mcryptd - Check mcryptd algorithm compatibility
Algorithms not compatible with mcryptd could be spawned by mcryptd
with a direct crypto_alloc_tfm invocation using a "mcryptd(alg)" name
construct. This causes mcryptd to crash the kernel if an arbitrary
"alg" is incompatible and not intended to be used with mcr... |
exsltSaxonShutdown (xsltTransformContextPtr ctxt ATTRIBUTE_UNUSED,
const xmlChar *URI ATTRIBUTE_UNUSED,
xmlHashTablePtr data) {
xmlHashFree(data, (xmlHashDeallocator) xmlXPathFreeCompExpr);
} | 0 | [
"CWE-119"
] | libxslt | 8b90c9a699e0eaa98bbeec63a473ddc73aaa238c | 226,071,500,749,641,740,000,000,000,000,000,000,000 | 5 | Fix saxon:line-number with namespace nodes
exsltSaxonLineNumberFunction must make sure not to pass namespace
"nodes" to xmlGetLineNo. Otherwise, an OOB heap read results which
typically leads to a segfault.
Found with afl-fuzz and ASan. |
static int rt_fill_info(struct net *net, __be32 dst, __be32 src,
struct flowi4 *fl4, struct sk_buff *skb, u32 portid,
u32 seq, int event, int nowait, unsigned int flags)
{
struct rtable *rt = skb_rtable(skb);
struct rtmsg *r;
struct nlmsghdr *nlh;
unsigned long expires = 0;
u32 error;
u32 metrics[RTAX_MAX]... | 1 | [
"CWE-17"
] | linux | df4d92549f23e1c037e83323aff58a21b3de7fe0 | 147,977,988,723,783,770,000,000,000,000,000,000,000 | 109 | ipv4: try to cache dst_entries which would cause a redirect
Not caching dst_entries which cause redirects could be exploited by hosts
on the same subnet, causing a severe DoS attack. This effect aggravated
since commit f88649721268999 ("ipv4: fix dst race in sk_dst_get()").
Lookups causing redirects will be allocated... |
QPDF_Array::~QPDF_Array()
{
} | 0 | [
"CWE-787"
] | qpdf | d71f05ca07eb5c7cfa4d6d23e5c1f2a800f52e8e | 233,621,203,597,480,220,000,000,000,000,000,000,000 | 3 | Fix sign and conversion warnings (major)
This makes all integer type conversions that have potential data loss
explicit with calls that do range checks and raise an exception. After
this commit, qpdf builds with no warnings when -Wsign-conversion
-Wconversion is used with gcc or clang or when -W3 -Wd4800 is used
with ... |
void vrend_context_set_debug_flags(struct vrend_context *ctx, const char *flagstring)
{
if (vrend_debug_can_override()) {
ctx->debug_flags |= vrend_get_debug_flags(flagstring);
if (ctx->debug_flags & dbg_features)
vrend_debug_add_flag(dbg_feature_use);
}
} | 0 | [
"CWE-787"
] | virglrenderer | cbc8d8b75be360236cada63784046688aeb6d921 | 154,097,878,544,373,660,000,000,000,000,000,000,000 | 8 | vrend: check transfer bounds for negative values too and report error
Closes #138
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com> |
void KrecipesView::activateContextHelp()
{
switch ( m_activePanel ) {
case RecipeView:
KToolInvocation::invokeHelp();
break;
case SelectP:
KToolInvocation::invokeHelp("find-edit");
break;
case ShoppingP:
KToolInvocation::invokeHelp("shopping-list");
break;
case DietP:
KToolInvocation::invokeHelp("... | 0 | [] | krecipes | cd1490fb5fe82cbe9172a43be13298001b446ecd | 339,649,980,566,311,250,000,000,000,000,000,000,000 | 52 | Use WebKit instead of KHTML for printing recipes, fixes sourceforge #2990118 and
#2960140.
svn path=/trunk/extragear/utils/krecipes/; revision=1137824 |
static void tg3_read_fw_ver(struct tg3 *tp)
{
u32 val;
bool vpd_vers = false;
if (tp->fw_ver[0] != 0)
vpd_vers = true;
if (tg3_flag(tp, NO_NVRAM)) {
strcat(tp->fw_ver, "sb");
tg3_read_otp_ver(tp);
return;
}
if (tg3_nvram_read(tp, 0, &val))
return;
if (val == TG3_EEPROM_MAGIC)
tg3_read_bc_ver(tp);... | 0 | [
"CWE-476",
"CWE-119"
] | linux | 715230a44310a8cf66fbfb5a46f9a62a9b2de424 | 327,979,762,191,955,300,000,000,000,000,000,000,000 | 36 | tg3: fix length overflow in VPD firmware parsing
Commit 184b89044fb6e2a74611dafa69b1dce0d98612c6 ("tg3: Use VPD fw version
when present") introduced VPD parsing that contained a potential length
overflow.
Limit the hardware's reported firmware string length (max 255 bytes) to
stay inside the driver's firmware string ... |
QByteArray CtcpParser::pack(const QByteArray &ctcpTag, const QByteArray &message) {
if(message.isEmpty())
return XDELIM + ctcpTag + XDELIM;
return XDELIM + ctcpTag + ' ' + xdelimQuote(message) + XDELIM;
} | 0 | [
"CWE-399"
] | quassel | da215fcb9cd3096a3e223c87577d5d4ab8f8518b | 155,090,421,664,856,940,000,000,000,000,000,000,000 | 6 | Fix core crash
Some CTCP requests triggered a bug in the parser; this fixes the issue. |
BSONObj spec() {
return BSON("$toUpper" << BSON_ARRAY(str()));
} | 0 | [
"CWE-835"
] | mongo | 0a076417d1d7fba3632b73349a1fd29a83e68816 | 119,689,687,236,895,200,000,000,000,000,000,000,000 | 3 | SERVER-38070 fix infinite loop in agg expression |
juniper_monitor_print(netdissect_options *ndo,
const struct pcap_pkthdr *h, register const u_char *p)
{
struct juniper_l2info_t l2info;
struct juniper_monitor_header {
uint8_t pkt_type;
uint8_t padding;
uint8_t iif[2];
uint8_t service... | 0 | [
"CWE-125"
] | tcpdump | 42073d54c53a496be40ae84152bbfe2c923ac7bc | 208,834,267,371,514,000,000,000,000,000,000,000,000 | 35 | CVE-2017-13004/Juniper: Add a bounds check.
This fixes a buffer over-read discovered by Forcepoint's security
researchers Otto Airamo & Antti Levomäki.
Add tests using the capture files supplied by the reporter(s). |
p11_rpc_buffer_get_uint16 (p11_buffer *buf,
size_t *offset,
uint16_t *value)
{
unsigned char *ptr;
if (buf->len < 2 || *offset > buf->len - 2) {
p11_buffer_fail (buf);
return false;
}
ptr = (unsigned char*)buf->data + *offset;
if (value != NULL)
*value = ... | 0 | [
"CWE-787"
] | p11-kit | 2617f3ef888e103324a28811886b99ed0a56346d | 191,818,999,646,013,200,000,000,000,000,000,000,000 | 15 | Check attribute length against buffer size
If an attribute's length does not match the length of the byte array
inside it, one length was used for allocation, and the other was used
for memcpy. This additional check will instead return an error on
malformed messages. |
static int l2cap_sock_getname(struct socket *sock, struct sockaddr *addr, int *len, int peer)
{
struct sockaddr_l2 *la = (struct sockaddr_l2 *) addr;
struct sock *sk = sock->sk;
struct l2cap_chan *chan = l2cap_pi(sk)->chan;
BT_DBG("sock %p, sk %p", sock, sk);
addr->sa_family = AF_BLUETOOTH;
*len = sizeof(struct... | 1 | [
"CWE-200"
] | linux | 792039c73cf176c8e39a6e8beef2c94ff46522ed | 161,320,331,820,899,740,000,000,000,000,000,000,000 | 23 | Bluetooth: L2CAP - Fix info leak via getsockname()
The L2CAP code fails to initialize the l2_bdaddr_type member of struct
sockaddr_l2 and the padding byte added for alignment. It that for leaks
two bytes kernel stack via the getsockname() syscall. Add an explicit
memset(0) before filling the structure to avoid the inf... |
std::ostream &operator<<(std::ostream &s, const ByteVector &v)
{
for(TagLib::uint i = 0; i < v.size(); i++)
s << v[i];
return s;
} | 0 | [
"CWE-189"
] | taglib | dcdf4fd954e3213c355746fa15b7480461972308 | 37,040,470,802,396,526,000,000,000,000,000,000,000 | 6 | Avoid uint overflow in case the length + index is over UINT_MAX |
dns_free_all(void)
{
cached_resolve_t **ptr, **next, *item;
assert_cache_ok();
if (cached_resolve_pqueue) {
SMARTLIST_FOREACH(cached_resolve_pqueue, cached_resolve_t *, res,
{
if (res->state == CACHE_STATE_DONE)
_free_cached_resolve(res);
});
}
for (ptr = HT_START(cache_map, ... | 0 | [
"CWE-399"
] | tor | 62637fa22405278758febb1743da9af562524d4c | 130,633,704,139,043,720,000,000,000,000,000,000,000 | 21 | Avoid hard (impossible?)-to-trigger double-free in dns_resolve()
Fixes 6480; fix on 0.2.0.1-alpha; based on pseudonymous patch. |
void AccessControlTest::check_local_datawriter(
const RTPSParticipantAttributes& participant_attr,
bool success)
{
PermissionsHandle* access_handle;
get_access_handle(participant_attr, &access_handle);
SecurityException exception;
bool result = access_plugin.check_create_datawriter(
... | 0 | [
"CWE-284"
] | Fast-DDS | d2aeab37eb4fad4376b68ea4dfbbf285a2926384 | 314,564,997,759,129,550,000,000,000,000,000,000,000 | 26 | 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... |
static void perf_event_enable_on_exec(struct perf_event_context *ctx)
{
struct perf_event *event;
unsigned long flags;
int enabled = 0;
int ret;
local_irq_save(flags);
if (!ctx || !ctx->nr_events)
goto out;
/*
* We must ctxsw out cgroup events to avoid conflict
* when invoking perf_task_event_sched_in() ... | 0 | [
"CWE-703",
"CWE-189"
] | linux | 8176cced706b5e5d15887584150764894e94e02f | 323,304,486,979,278,640,000,000,000,000,000,000,000 | 44 | perf: Treat attr.config as u64 in perf_swevent_init()
Trinity discovered that we fail to check all 64 bits of
attr.config passed by user space, resulting to out-of-bounds
access of the perf_swevent_enabled array in
sw_perf_event_destroy().
Introduced in commit b0a873ebb ("perf: Register PMU
implementations").
Signed... |
static __always_inline void __vma_unlink_common(struct mm_struct *mm,
struct vm_area_struct *vma,
struct vm_area_struct *ignore)
{
vma_rb_erase_ignore(vma, &mm->mm_rb, ignore);
__vma_unlink_list(mm, vma);
/* Kill the cache */
vmacache_invalidate(mm);
} | 0 | [
"CWE-787"
] | linux | dcde237319e626d1ec3c9d8b7613032f0fd4663a | 52,412,660,218,215,830,000,000,000,000,000,000,000 | 9 | mm: Avoid creating virtual address aliases in brk()/mmap()/mremap()
Currently the arm64 kernel ignores the top address byte passed to brk(),
mmap() and mremap(). When the user is not aware of the 56-bit address
limit or relies on the kernel to return an error, untagging such
pointers has the potential to create addres... |
grub_ext2_dir_iter (const char *filename, enum grub_fshelp_filetype filetype,
grub_fshelp_node_t node, void *data)
{
struct grub_ext2_dir_ctx *ctx = data;
struct grub_dirhook_info info;
grub_memset (&info, 0, sizeof (info));
if (! node->inode_read)
{
grub_ext2_read_inode (ctx->data, node->ino, ... | 0 | [
"CWE-119"
] | grub | ac8cac1dac50daaf1c390d701cca3b55e16ee768 | 137,022,199,990,458,500,000,000,000,000,000,000,000 | 24 | * grub-core/fs/ext2.c: Remove variable length arrays. |
static int mov_read_ares(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
if (c->fc->nb_streams >= 1) {
AVCodecParameters *par = c->fc->streams[c->fc->nb_streams-1]->codecpar;
if (par->codec_tag == MKTAG('A', 'V', 'i', 'n') &&
par->codec_id == AV_CODEC_ID_H264 &&
atom.size > 1... | 0 | [
"CWE-399",
"CWE-834"
] | FFmpeg | 9cb4eb772839c5e1de2855d126bf74ff16d13382 | 143,581,145,046,236,620,000,000,000,000,000,000,000 | 39 | avformat/mov: Fix DoS in read_tfra()
Fixes: Missing EOF check in loop
No testcase
Found-by: Xiaohei and Wangchu from Alibaba Security Team
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> |
__releases(ax25_route_lock)
{
read_unlock(&ax25_route_lock);
} | 0 | [
"CWE-416"
] | linux | d01ffb9eee4af165d83b08dd73ebdf9fe94a519b | 115,283,391,576,896,300,000,000,000,000,000,000,000 | 4 | ax25: add refcount in ax25_dev to avoid UAF bugs
If we dereference ax25_dev after we call kfree(ax25_dev) in
ax25_dev_device_down(), it will lead to concurrency UAF bugs.
There are eight syscall functions suffer from UAF bugs, include
ax25_bind(), ax25_release(), ax25_connect(), ax25_ioctl(),
ax25_getname(), ax25_send... |
ReadCallbackTerminator(EventBase* base, WriteCallbackBase* wcb)
: ReadCallback(wcb), base_(base) {} | 0 | [
"CWE-125"
] | folly | c321eb588909646c15aefde035fd3133ba32cdee | 259,979,494,442,164,250,000,000,000,000,000,000,000 | 2 | Handle close_notify as standard writeErr in AsyncSSLSocket.
Summary: Fixes CVE-2019-11934
Reviewed By: mingtaoy
Differential Revision: D18020613
fbshipit-source-id: db82bb250e53f0d225f1280bd67bc74abd417836 |
static void lsr_read_preserve_aspect_ratio(GF_LASeRCodec *lsr, GF_Node *n)
{
GF_FieldInfo info;
u32 flag;
SVG_PreserveAspectRatio *par;
GF_LSR_READ_INT(lsr, flag, 1, "hasPreserveAspectRatio");
if (!flag) return;
lsr->last_error = gf_node_get_attribute_by_tag(n, TAG_SVG_ATT_preserveAspectRatio, 1, 0, &info);
pa... | 0 | [
"CWE-190"
] | gpac | faa75edde3dfeba1e2cf6ffa48e45a50f1042096 | 138,804,753,883,242,840,000,000,000,000,000,000,000 | 48 | fixed #2213 |
next_emf(FILE *f, uschar *which)
{
uschar *yield;
gstring * para;
uschar buffer[256];
if (!f) return NULL;
if (!Ufgets(buffer, sizeof(buffer), f) || Ustrcmp(buffer, "****\n") == 0)
return NULL;
para = string_get(256);
for (;;)
{
para = string_cat(para, buffer);
if (!Ufgets(buffer, sizeof(buffer), f) || Ustrc... | 0 | [
"CWE-78"
] | exim | d740d2111f189760593a303124ff6b9b1f83453d | 118,340,587,902,112,250,000,000,000,000,000,000,000 | 26 | Fix CVE-2019-10149 |
static int nl80211_dump_wiphy_parse(struct sk_buff *skb,
struct netlink_callback *cb,
struct nl80211_dump_wiphy_state *state)
{
struct nlattr **tb = kcalloc(NUM_NL80211_ATTR, sizeof(*tb), GFP_KERNEL);
int ret;
if (!tb)
return -ENOMEM;
ret = nlmsg_parse_deprecated(cb->nlh,
GENL_HDRLEN + ... | 0 | [
"CWE-120"
] | linux | f88eb7c0d002a67ef31aeb7850b42ff69abc46dc | 121,549,113,888,964,440,000,000,000,000,000,000,000 | 47 | 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... |
void CLASS jpeg_thumb()
{
char *thumb;
thumb = (char *) malloc (thumb_length);
merror (thumb, "jpeg_thumb()");
fread (thumb, 1, thumb_length, ifp);
jpeg_thumb_writer(ofp,thumb,thumb_length);
free (thumb);
} | 0 | [
"CWE-703"
] | LibRaw | 11909cc59e712e09b508dda729b99aeaac2b29ad | 223,934,070,344,904,970,000,000,000,000,000,000,000 | 10 | cumulated data checks patch |
static int ftrace_function_set_filter(struct perf_event *event,
struct event_filter *filter)
{
return -ENODEV;
} | 0 | [
"CWE-787"
] | linux | 70303420b5721c38998cf987e6b7d30cc62d4ff1 | 261,670,715,033,281,530,000,000,000,000,000,000,000 | 5 | tracing: Check for no filter when processing event filters
The syzkaller detected a out-of-bounds issue with the events filter code,
specifically here:
prog[N].pred = NULL; /* #13 */
prog[N].target = 1; /* TRUE */
prog[N+1].pred = NULL;
prog[N+1].target = 0; /* FALSE */
-> prog[N-1].target = N;
prog[N-1].w... |
mrb_env_unshare(mrb_state *mrb, struct REnv *e)
{
if (e == NULL) return;
else {
size_t len = (size_t)MRB_ENV_LEN(e);
mrb_value *p;
if (!MRB_ENV_ONSTACK_P(e)) return;
if (e->cxt != mrb->c) return;
if (e == mrb_vm_ci_env(mrb->c->cibase)) return; /* for mirb */
p = (mrb_value *)mrb_malloc(mrb,... | 0 | [
"CWE-122",
"CWE-787"
] | mruby | 47068ae07a5fa3aa9a1879cdfe98a9ce0f339299 | 13,960,639,507,239,157,000,000,000,000,000,000,000 | 19 | vm.c: packed arguments length may be zero for `send` method. |
static void flush_all(struct kmem_cache *s)
{
on_each_cpu_cond(has_cpu_slab, flush_cpu_slab, s, 1);
} | 0 | [] | linux | fd4d9c7d0c71866ec0c2825189ebd2ce35bd95b8 | 104,174,263,572,132,410,000,000,000,000,000,000,000 | 4 | 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... |
lyd_merge_node_schema_equal(struct lyd_node *node1, struct lyd_node *node2)
{
struct lys_node *sch1;
if (node1->schema->module->ctx == node2->schema->module->ctx) {
if (node1->schema != node2->schema) {
return 0;
}
} else {
/* the nodes are in different contexts, get the... | 0 | [
"CWE-119"
] | libyang | 32fb4993bc8bb49e93e84016af3c10ea53964be5 | 233,887,388,401,003,800,000,000,000,000,000,000,000 | 24 | schema tree BUGFIX do not check features while still resolving schema
Fixes #723 |
QPDFWriter::writeStandard()
{
if (this->m->deterministic_id)
{
pushMD5Pipeline();
}
// Start writing
writeHeader();
writeString(this->m->extra_header_text);
if (this->m->pclm)
{
enqueueObjectsPCLm();
}
else
{
enqueueObjectsStandard();
}
// ... | 0 | [
"CWE-125"
] | qpdf | 1868a10f8b06631362618bfc85ca8646da4b4b71 | 237,783,743,733,067,500,000,000,000,000,000,000,000 | 64 | Replace all atoi calls with QUtil::string_to_int
The latter catches underflow/overflow. |
static inline void ok_jpg_load_bits(ok_jpg_decoder *decoder, int num_bits) {
while (decoder->input_buffer_bit_count < num_bits) {
if (decoder->next_marker != 0) {
decoder->input_buffer_bits <<= 8;
decoder->input_buffer_bit_count += 8;
} else {
uint8_t b = ok_read_... | 0 | [
"CWE-787"
] | ok-file-formats | a9cc1711dd4ed6a215038f1c5c03af0ef52c3211 | 156,089,321,887,804,960,000,000,000,000,000,000,000 | 19 | ok_jpg: Fix invalid DHT (#11) |
TfLiteStatus CalculateActivationRangeQuantized(TfLiteContext* context,
TfLiteFusedActivation activation,
TfLiteTensor* output,
int32_t* act_min,
... | 0 | [
"CWE-476",
"CWE-369"
] | tensorflow | 5b048e87e4e55990dae6b547add4dae59f4e1c76 | 161,557,162,576,334,540,000,000,000,000,000,000,000 | 23 | Fix a null pointer exception in SVDF
This is due to not checking that `GetVariableInput` returns non-null tensor.
Also fix a potential null pointer exception in `GetVariableInput`.
PiperOrigin-RevId: 385160147
Change-Id: Iadf3f0705b036a9014d27caa5a8bbd91f4c4c401 |
void CLASS parse_foveon()
{
int entries, img=0, off, len, tag, save, i, wide, high, pent, poff[256][2];
char name[64], value[64];
order = 0x4949; /* Little-endian */
fseek (ifp, 36, SEEK_SET);
flip = get4();
fseek (ifp, -4, SEEK_END);
fseek (ifp, get4(), SEEK_SET);
if (get4() != 0x64434553) return; /... | 0 | [] | LibRaw | 9ae25d8c3a6bfb40c582538193264f74c9b93bc0 | 300,814,576,895,751,340,000,000,000,000,000,000,000 | 90 | backported 0.15.4 datachecks |
static void cil_reset_classpermission(struct cil_classpermission *cp)
{
if (cp == NULL) {
return;
}
cil_list_destroy(&cp->classperms, CIL_FALSE);
} | 0 | [
"CWE-416"
] | selinux | f34d3d30c8325e4847a6b696fe7a3936a8a361f3 | 78,857,804,173,448,450,000,000,000,000,000,000,000 | 8 | libsepol/cil: Destroy classperms list when resetting classpermission
Nicolas Iooss reports:
A few months ago, OSS-Fuzz found a crash in the CIL compiler, which
got reported as
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=28648 (the title
is misleading, or is caused by another issue that conflicts with... |
gs_window_new (GdkScreen *screen,
int monitor,
gboolean lock_enabled)
{
GObject *result;
result = g_object_new (GS_TYPE_WINDOW,
"type", GTK_WINDOW_POPUP,
"screen", screen,
... | 0 | [
"CWE-284"
] | cinnamon-screensaver | da7af55f1fa966c52e15cc288d4f8928eca8cc9f | 5,935,471,524,899,734,000,000,000,000,000,000,000 | 16 | Workaround gtk3 bug, don't allow GtkWindow to handle popup_menu. |
static void print_details(SSL *c_ssl, const char *prefix)
{
const SSL_CIPHER *ciph;
X509 *cert;
ciph=SSL_get_current_cipher(c_ssl);
BIO_printf(bio_stdout,"%s%s, cipher %s %s",
prefix,
SSL_get_version(c_ssl),
SSL_CIPHER_get_version(ciph),
SSL_CIPHER_get_name(ciph));
cert=SSL_get_peer_certificate(c_ssl);... | 0 | [] | openssl | edc032b5e3f3ebb1006a9c89e0ae00504f47966f | 152,282,857,544,306,410,000,000,000,000,000,000,000 | 43 | Add SRP support. |
OverflowDetectingUInt64& operator-=(uint64_t size) {
RELEASE_ASSERT(value_ >= size, "unsigned integer underflowed");
value_ -= size;
return *this;
} | 0 | [
"CWE-401"
] | envoy | 5eba69a1f375413fb93fab4173f9c393ac8c2818 | 46,674,685,339,936,010,000,000,000,000,000,000,000 | 5 | [buffer] Add on-drain hook to buffer API and use it to avoid fragmentation due to tracking of H2 data and control frames in the output buffer (#144)
Signed-off-by: antonio <avd@google.com> |
static void vmx_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
{
struct vcpu_vmx *vmx = to_vmx(vcpu);
u64 phys_addr = __pa(per_cpu(vmxarea, cpu));
if (!vmm_exclusive)
kvm_cpu_vmxon(phys_addr);
else if (vmx->loaded_vmcs->cpu != cpu)
loaded_vmcs_clear(vmx->loaded_vmcs);
if (per_cpu(current_vmcs, cpu) != vmx->loaded... | 0 | [
"CWE-284",
"CWE-264"
] | linux | 3ce424e45411cf5a13105e0386b6ecf6eeb4f66f | 281,958,627,436,381,600,000,000,000,000,000,000,000 | 58 | kvm:vmx: more complete state update on APICv on/off
The function to update APICv on/off state (in particular, to deactivate
it when enabling Hyper-V SynIC) is incomplete: it doesn't adjust
APICv-related fields among secondary processor-based VM-execution
controls. As a result, Windows 2012 guests get stuck when SynIC... |
static OPJ_BOOL bmp_read_info_header(FILE* IN, OPJ_BITMAPINFOHEADER* header)
{
memset(header, 0, sizeof(*header));
/* INFO HEADER */
/* ------------- */
header->biSize = (OPJ_UINT32)getc(IN);
header->biSize |= (OPJ_UINT32)getc(IN) << 8;
header->biSize |= (OPJ_UINT32)getc(IN) << 16;
header->... | 0 | [
"CWE-400",
"CWE-703",
"CWE-834"
] | openjpeg | 8ee335227bbcaf1614124046aa25e53d67b11ec3 | 93,954,683,737,126,480,000,000,000,000,000,000,000 | 163 | convertbmp: detect invalid file dimensions early
width/length dimensions read from bmp headers are not necessarily
valid. For instance they may have been maliciously set to very large
values with the intention to cause DoS (large memory allocation, stack
overflow). In these cases we want to detect the invalid size as ... |
void sas_porte_bytes_dmaed(struct work_struct *work)
{
struct asd_sas_event *ev = to_asd_sas_event(work);
struct asd_sas_phy *phy = ev->phy;
sas_form_port(phy);
} | 0 | [
"CWE-284"
] | linux | 0558f33c06bb910e2879e355192227a8e8f0219d | 230,306,684,159,373,400,000,000,000,000,000,000,000 | 7 | scsi: libsas: direct call probe and destruct
In commit 87c8331fcf72 ("[SCSI] libsas: prevent domain rediscovery
competing with ata error handling") introduced disco mutex to prevent
rediscovery competing with ata error handling and put the whole
revalidation in the mutex. But the rphy add/remove needs to wait for the
... |
static void perpendicular_mode(void)
{
unsigned char perp_mode;
if (raw_cmd->rate & 0x40) {
switch (raw_cmd->rate & 3) {
case 0:
perp_mode = 2;
break;
case 3:
perp_mode = 3;
break;
default:
DPRINT("Invalid data rate for perpendicular mode!\n");
cont->done(0);
FDCS->reset = 1;
/*
... | 0 | [
"CWE-264",
"CWE-754"
] | linux | ef87dbe7614341c2e7bfe8d32fcb7028cc97442c | 313,959,033,870,798,960,000,000,000,000,000,000,000 | 36 | floppy: ignore kernel-only members in FDRAWCMD ioctl input
Always clear out these floppy_raw_cmd struct members after copying the
entire structure from userspace so that the in-kernel version is always
valid and never left in an interdeterminate state.
Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
Signed-off-by: L... |
static CURLcode smtp_auth_login_user(struct connectdata *conn,
char **outptr, size_t *outlen)
{
size_t ulen = strlen(conn->user);
if(!ulen) {
*outptr = strdup("=");
if(*outptr) {
*outlen = (size_t) 1;
return CURLE_OK;
}
*outlen = 0;
return CURLE_... | 0 | [
"CWE-89"
] | curl | 75ca568fa1c19de4c5358fed246686de8467c238 | 174,883,034,977,788,400,000,000,000,000,000,000,000 | 17 | URL sanitize: reject URLs containing bad data
Protocols (IMAP, POP3 and SMTP) that use the path part of a URL in a
decoded manner now use the new Curl_urldecode() function to reject URLs
with embedded control codes (anything that is or decodes to a byte value
less than 32).
URLs containing such codes could easily oth... |
static int sapi_extract_response_code(const char *header_line)
{
int code = 200;
const char *ptr;
for (ptr = header_line; *ptr; ptr++) {
if (*ptr == ' ' && *(ptr + 1) != ' ') {
code = atoi(ptr + 1);
break;
}
}
return code;
} | 0 | [
"CWE-601"
] | php-src | 98b9dfaec95e6f910f125ed172cdbd25abd006ec | 128,155,893,422,474,900,000,000,000,000,000,000,000 | 14 | Fix for HTTP_PROXY issue.
The following changes are made:
- _SERVER/_ENV only has HTTP_PROXY if the local environment has it,
and only one from the environment.
- getenv('HTTP_PROXY') only returns one from the local environment
- getenv has optional second parameter, telling it to only consider
local environment |
match(struct magic_set *ms, struct magic *magic, uint32_t nmagic,
const unsigned char *s, size_t nbytes, size_t offset, int mode, int text,
int flip, size_t recursion_level, int *printed_something,
int *need_separator, int *returnval)
{
uint32_t magindex = 0;
unsigned int cont_level = 0;
int returnvalv =... | 0 | [
"CWE-399"
] | file | 90018fe22ff8b74a22fcd142225b0a00f3f12677 | 89,914,961,636,024,470,000,000,000,000,000,000,000 | 226 | bump recursion to 15, and allow it to be set from the command line. |
xsltApplyImportsComp(xsltStylesheetPtr style, xmlNodePtr inst) {
#ifdef XSLT_REFACTORED
xsltStyleItemApplyImportsPtr comp;
#else
xsltStylePreCompPtr comp;
#endif
if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
return;
#ifdef XSLT_REFACTORED
comp = (xsltStyleItemApplyImports... | 0 | [] | libxslt | 7ca19df892ca22d9314e95d59ce2abdeff46b617 | 227,034,884,826,122,900,000,000,000,000,000,000,000 | 21 | Fix for type confusion in preprocessing attributes
CVE-2015-7995 http://www.openwall.com/lists/oss-security/2015/10/27/10
We need to check that the parent node is an element before dereferencing
its namespace |
static void proxy_removed_cb(GDBusProxy *proxy, void *user_data)
{
struct gatt_app *app = user_data;
struct external_service *service;
const char *path;
path = g_dbus_proxy_get_path(proxy);
service = queue_remove_if(app->services, match_service_by_path,
(void *) path);
if (!service)
return;
DBG("Prox... | 0 | [
"CWE-416"
] | bluez | 838c0dc7641e1c991c0f3027bf94bee4606012f8 | 297,353,338,323,477,180,000,000,000,000,000,000,000 | 17 | gatt: Fix not cleaning up when disconnected
There is a current use after free possible on a gatt server if a client
disconnects while a WriteValue call is being processed with dbus.
This patch includes the addition of a pending disconnect callback to handle
cleanup better if a disconnect occurs during a write, an acq... |
static int write_header(struct pstore *ps)
{
struct disk_header *dh;
memset(ps->header_area, 0, ps->store->chunk_size << SECTOR_SHIFT);
dh = ps->header_area;
dh->magic = cpu_to_le32(SNAP_MAGIC);
dh->valid = cpu_to_le32(ps->valid);
dh->version = cpu_to_le32(ps->version);
dh->chunk_size = cpu_to_le32(ps->store->... | 0 | [
"CWE-200",
"CWE-264"
] | linux | e9c6a182649f4259db704ae15a91ac820e63b0ca | 319,538,260,360,338,440,000,000,000,000,000,000,000 | 14 | dm snapshot: fix data corruption
This patch fixes a particular type of data corruption that has been
encountered when loading a snapshot's metadata from disk.
When we allocate a new chunk in persistent_prepare, we increment
ps->next_free and we make sure that it doesn't point to a metadata area
by further incrementin... |
void rand_cleanup_int(void)
{
const RAND_METHOD *meth = default_RAND_meth;
if (!rand_inited)
return;
if (meth != NULL && meth->cleanup != NULL)
meth->cleanup();
RAND_set_rand_method(NULL);
rand_pool_cleanup();
#ifndef OPENSSL_NO_ENGINE
CRYPTO_THREAD_lock_free(rand_engine_lock);... | 0 | [
"CWE-330"
] | openssl | 1b0fe00e2704b5e20334a16d3c9099d1ba2ef1be | 17,499,058,678,930,867,000,000,000,000,000,000,000 | 21 | drbg: ensure fork-safety without using a pthread_atfork handler
When the new OpenSSL CSPRNG was introduced in version 1.1.1,
it was announced in the release notes that it would be fork-safe,
which the old CSPRNG hadn't been.
The fork-safety was implemented using a fork count, which was
incremented by a pthread_atfork... |
static void emmh32_update(emmh32_context *context, u8 *pOctets, int len)
{
int coeff_position, byte_position;
if (len == 0) return;
coeff_position = context->position >> 2;
/* deal with partial 32-bit word left over from last update */
byte_position = context->position & 3;
if (byte_position) {
/* have... | 0 | [
"CWE-703",
"CWE-264"
] | linux | 550fd08c2cebad61c548def135f67aba284c6162 | 53,357,303,483,979,850,000,000,000,000,000,000,000 | 37 | net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared
After the last patch, We are left in a state in which only drivers calling
ether_setup have IFF_TX_SKB_SHARING set (we assume that drivers touching real
hardware call ether_setup for their net_devices and don't hold any state in
their skbs. There... |
static bool vfswrap_lock(vfs_handle_struct *handle, files_struct *fsp, int op, off_t offset, off_t count, int type)
{
bool result;
START_PROFILE(syscall_fcntl_lock);
result = fcntl_lock(fsp->fh->fd, op, offset, count, type);
END_PROFILE(syscall_fcntl_lock);
return result;
} | 0 | [
"CWE-665"
] | samba | 30e724cbff1ecd90e5a676831902d1e41ec1b347 | 308,912,395,791,001,450,000,000,000,000,000,000,000 | 9 | FSCTL_GET_SHADOW_COPY_DATA: Initialize output array to zero
Otherwise num_volumes and the end marker can return uninitialized data
to the client.
Signed-off-by: Christof Schmitt <christof.schmitt@us.ibm.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org> |
void inet_frags_init(struct inet_frags *f)
{
int i;
for (i = 0; i < INETFRAGS_HASHSZ; i++)
INIT_HLIST_HEAD(&f->hash[i]);
rwlock_init(&f->lock);
f->rnd = (u32) ((num_physpages ^ (num_physpages>>7)) ^
(jiffies ^ (jiffies >> 6)));
setup_timer(&f->secret_timer, inet_frag_secret_rebuild,
(unsigned long)... | 0 | [] | linux | 3ef0eb0db4bf92c6d2510fe5c4dc51852746f206 | 179,733,861,080,230,570,000,000,000,000,000,000,000 | 17 | net: frag, move LRU list maintenance outside of rwlock
Updating the fragmentation queues LRU (Least-Recently-Used) list,
required taking the hash writer lock. However, the LRU list isn't
tied to the hash at all, so we can use a separate lock for it.
Original-idea-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Je... |
static void intel_pebs_aliases_core2(struct perf_event *event)
{
if ((event->hw.config & X86_RAW_EVENT_MASK) == 0x003c) {
/*
* Use an alternative encoding for CPU_CLK_UNHALTED.THREAD_P
* (0x003c) so that we can use it with PEBS.
*
* The regular CPU_CLK_UNHALTED.THREAD_P event (0x003c) isn't
* PEBS cap... | 0 | [
"CWE-20",
"CWE-401"
] | linux | f1923820c447e986a9da0fc6bf60c1dccdf0408e | 320,537,282,779,802,900,000,000,000,000,000,000,000 | 27 | perf/x86: Fix offcore_rsp valid mask for SNB/IVB
The valid mask for both offcore_response_0 and
offcore_response_1 was wrong for SNB/SNB-EP,
IVB/IVB-EP. It was possible to write to
reserved bit and cause a GP fault crashing
the kernel.
This patch fixes the problem by correctly marking the
reserved bits in the valid m... |
void kvm_destroy_vcpus(struct kvm *kvm)
{
unsigned long i;
struct kvm_vcpu *vcpu;
kvm_for_each_vcpu(i, vcpu, kvm) {
kvm_vcpu_destroy(vcpu);
xa_erase(&kvm->vcpu_array, i);
}
atomic_set(&kvm->online_vcpus, 0);
} | 0 | [
"CWE-459"
] | linux | 683412ccf61294d727ead4a73d97397396e69a6b | 151,719,536,363,437,530,000,000,000,000,000,000,000 | 12 | 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... |
horAcc8(TIFF* tif, uint8* cp0, tmsize_t cc)
{
tmsize_t stride = PredictorState(tif)->stride;
unsigned char* cp = (unsigned char*) cp0;
if((cc%stride)!=0)
{
TIFFErrorExt(tif->tif_clientdata, "horAcc8",
"%s", "(cc%stride)!=0");
return 0;
}
if (cc > stride) {
/*
*... | 0 | [
"CWE-119",
"CWE-787"
] | libtiff | 3ca657a8793dd011bf869695d72ad31c779c3cc1 | 96,843,170,806,250,020,000,000,000,000,000,000,000 | 55 | * libtiff/tif_predict.h, libtiff/tif_predict.c:
Replace assertions by runtime checks to avoid assertions in debug mode,
or buffer overflows in release mode. Can happen when dealing with
unusual tile size like YCbCr with subsampling. Reported as MSVR 35105
by Axel Souchet & Vishal Chauhan from the MSRC Vulnerabilities &... |
static bool atl2_spi_read(struct atl2_hw *hw, u32 addr, u32 *buf)
{
int i;
u32 value;
ATL2_WRITE_REG(hw, REG_SPI_DATA, 0);
ATL2_WRITE_REG(hw, REG_SPI_ADDR, addr);
value = SPI_FLASH_CTRL_WAIT_READY |
(CUSTOM_SPI_CS_SETUP & SPI_FLASH_CTRL_CS_SETUP_MASK) <<
SPI_FLASH_CTRL_CS_SETUP_SHIFT |
(CUSTOM_SPI_CLK_HI ... | 0 | [
"CWE-200"
] | linux | f43bfaeddc79effbf3d0fcb53ca477cca66f3db8 | 256,070,720,684,834,900,000,000,000,000,000,000,000 | 41 | atl2: Disable unimplemented scatter/gather feature
atl2 includes NETIF_F_SG in hw_features even though it has no support
for non-linear skbs. This bug was originally harmless since the
driver does not claim to implement checksum offload and that used to
be a requirement for SG.
Now that SG and checksum offload are i... |
OFBool DcmSCP::getVerbosePCMode() const
{
return m_cfg->getVerbosePCMode();
} | 0 | [
"CWE-264"
] | dcmtk | beaf5a5c24101daeeafa48c375120b16197c9e95 | 85,941,243,396,202,720,000,000,000,000,000,000,000 | 4 | Make sure to handle setuid() return code properly.
In some tools the return value of setuid() is not checked. In the worst
case this could lead to privilege escalation since the process does not
give up its root privileges and continue as root. |
exif_mnote_data_canon_new (ExifMem *mem, ExifDataOption o)
{
ExifMnoteData *d;
ExifMnoteDataCanon *dc;
if (!mem) return NULL;
d = exif_mem_alloc (mem, sizeof (ExifMnoteDataCanon));
if (!d)
return NULL;
exif_mnote_data_construct (d, mem);
/* Set up function pointers */
d->methods.free = exif_mno... | 0 | [
"CWE-125"
] | libexif | 435e21f05001fb03f9f186fa7cbc69454afd00d1 | 4,977,549,501,698,239,000,000,000,000,000,000,000 | 30 | Fix MakerNote tag size overflow issues at read time.
Check for a size overflow while reading tags, which ensures that the
size is always consistent for the given components and type of the
entry, making checking further down superfluous.
This provides an alternate fix for
https://sourceforge.net/p/libexif/bugs/125/ C... |
BSONElement(const char* d, int fieldNameSize, FieldNameSizeTag)
: data(d),
fieldNameSize_(fieldNameSize) // internal size includes null terminator
,
totalSize(-1) {} | 0 | [
"CWE-613"
] | mongo | 64d8e9e1b12d16b54d6a592bae8110226c491b4e | 333,327,450,927,045,630,000,000,000,000,000,000,000 | 5 | SERVER-38984 Validate unique User ID on UserCache hit
(cherry picked from commit e55d6e2292e5dbe2f97153251d8193d1cc89f5d7) |
parse_ihu_subtlv(const unsigned char *a, int alen,
unsigned int *hello_send_us,
unsigned int *hello_rtt_receive_time)
{
int type, len, i = 0, ret = 0;
while(i < alen) {
type = a[0];
if(type == SUBTLV_PAD1) {
i++;
continue;
}
... | 1 | [
"CWE-787"
] | frr | c3793352a8d76d2eee1edc38a9a16c1c8a6573f4 | 242,148,558,221,461,560,000,000,000,000,000,000,000 | 46 | babeld: fix #10502 #10503 by repairing the checks on length
This patch repairs the checking conditions on length in four functions:
babel_packet_examin, parse_hello_subtlv, parse_ihu_subtlv, and parse_update_subtlv
Signed-off-by: qingkaishi <qingkaishi@gmail.com> |
status_macros(stream * s, pcl_state_t * pcs, pcl_data_storage_t storage)
{
gs_const_string key;
void *value;
pl_dict_enum_t denum;
if (storage == 0)
return 0; /* no "currently selected" macro */
pl_dict_enum_begin(&pcs->macros, &denum);
while (pl_dict_enum_next(&denum, &ke... | 0 | [
"CWE-787"
] | ghostpdl | e1134d375e2ca176068e19a2aa9b040baffe1c22 | 23,469,523,058,393,307,000,000,000,000,000,000,000 | 19 | Bug 705156(1): Avoid double free of PCL error buffer |
lbr_chartabsize_adv(
char_u *line, // start of the line
char_u **s,
colnr_T col)
{
int retval;
retval = lbr_chartabsize(line, *s, col);
MB_PTR_ADV(*s);
return retval;
} | 0 | [
"CWE-125",
"CWE-787"
] | vim | 94f3192b03ed27474db80b4d3a409e107140738b | 67,960,449,380,441,760,000,000,000,000,000,000,000 | 11 | patch 8.2.3950: going beyond the end of the line with /\%V
Problem: Going beyond the end of the line with /\%V.
Solution: Check for valid column in getvcol(). |
static long btrfs_ioctl_quota_rescan(struct file *file, void __user *arg)
{
struct inode *inode = file_inode(file);
struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
struct btrfs_ioctl_quota_rescan_args *qsa;
int ret;
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
ret = mnt_want_write_file(file);
if (ret)
... | 0 | [
"CWE-476",
"CWE-284"
] | linux | 09ba3bc9dd150457c506e4661380a6183af651c1 | 17,022,073,402,231,700,000,000,000,000,000,000,000 | 33 | btrfs: merge btrfs_find_device and find_device
Both btrfs_find_device() and find_device() does the same thing except
that the latter does not take the seed device onto account in the device
scanning context. We can merge them.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.c... |
static inline void SetPixelCr(const Image *magick_restrict image,
const Quantum cr,Quantum *magick_restrict pixel)
{
pixel[image->channel_map[CrPixelChannel].offset]=cr;
} | 0 | [
"CWE-20",
"CWE-125"
] | ImageMagick | 8187d2d8fd010d2d6b1a3a8edd935beec404dddc | 141,159,581,082,434,400,000,000,000,000,000,000,000 | 5 | https://github.com/ImageMagick/ImageMagick/issues/1610 |
static inline void setmosi(const struct spi_device *spi, int is_on)
{
struct spi_gpio *spi_gpio = spi_to_spi_gpio(spi);
gpiod_set_value_cansleep(spi_gpio->mosi, is_on);
} | 0 | [
"CWE-400",
"CWE-401"
] | linux | d3b0ffa1d75d5305ebe34735598993afbb8a869d | 148,786,790,577,786,940,000,000,000,000,000,000,000 | 6 | spi: gpio: prevent memory leak in spi_gpio_probe
In spi_gpio_probe an SPI master is allocated via spi_alloc_master, but
this controller should be released if devm_add_action_or_reset fails,
otherwise memory leaks. In order to avoid leak spi_contriller_put must
be called in case of failure for devm_add_action_or_reset.... |
PHP_FUNCTION(iptcparse)
{
unsigned int inx = 0, len, tagsfound = 0;
unsigned char *buffer, recnum, dataset, key[ 16 ];
char *str;
int str_len;
zval *values, **element;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) != SUCCESS) {
return;
}
buffer = (unsigned char *)str;
while (in... | 0 | [] | php-src | ce96fd6b0761d98353761bf78d5bfb55291179fd | 78,582,707,134,941,450,000,000,000,000,000,000,000 | 68 | - fix #39863, do not accept paths with NULL in them. See http://news.php.net/php.internals/50191, trunk will have the patch later (adding a macro and/or changing (some) APIs. Patch by Rasmus |
static void unzzip_mem_disk_cat_file(ZZIP_MEM_DISK* disk, char* name, FILE* out)
{
ZZIP_DISK_FILE* file = zzip_mem_disk_fopen (disk, name);
if (file)
{
char buffer[1025]; int len;
while ((len = zzip_mem_disk_fread (buffer, 1, 1024, file)))
{
fwrite (buffer, 1, len, out);
}
zzip_mem_disk_fclose... | 0 | [] | zziplib | 931f962ddfec0e00d6f486df2c56d9857b55944e | 101,129,933,921,150,840,000,000,000,000,000,000,000 | 14 | fopen may fail for a bad name -> EXIT_ERRORS in that case #17 |
struct sctp_chunk *sctp_make_ecne(const struct sctp_association *asoc,
const __u32 lowest_tsn)
{
struct sctp_chunk *retval;
sctp_ecnehdr_t ecne;
ecne.lowest_tsn = htonl(lowest_tsn);
retval = sctp_make_chunk(asoc, SCTP_CID_ECN_ECNE, 0,
sizeof(sctp_ecnehdr_t));
if (!retval)
goto nodata;
retval->subh... | 0 | [
"CWE-20"
] | linux-2.6 | ba0166708ef4da7eeb61dd92bbba4d5a749d6561 | 200,157,685,691,770,340,000,000,000,000,000,000,000 | 17 | sctp: Fix kernel panic while process protocol violation parameter
Since call to function sctp_sf_abort_violation() need paramter 'arg' with
'struct sctp_chunk' type, it will read the chunk type and chunk length from
the chunk_hdr member of chunk. But call to sctp_sf_violation_paramlen()
always with 'struct sctp_paramh... |
static const char *set_errorlog_format(cmd_parms *cmd, void *dummy,
const char *arg1, const char *arg2)
{
const char *err_string = NULL;
core_server_config *conf =
ap_get_core_module_config(cmd->server->module_config);
if (!arg2) {
conf->error_log_form... | 0 | [
"CWE-416",
"CWE-284"
] | httpd | 4cc27823899e070268b906ca677ee838d07cf67a | 289,350,932,900,119,800,000,000,000,000,000,000,000 | 41 | core: Disallow Methods' registration at run time (.htaccess), they may be
used only if registered at init time (httpd.conf).
Calling ap_method_register() in children processes is not the right scope
since it won't be shared for all requests.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1807655 13f7... |
static void test_prepare_resultset()
{
MYSQL_STMT *stmt;
int rc;
MYSQL_RES *result;
myheader("test_prepare_resultset");
rc= mysql_autocommit(mysql, TRUE);
myquery(rc);
rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_prepare_resultset");
myquery(rc);
rc= mysql_query(mysql, "CREATE TABLE t... | 0 | [
"CWE-284",
"CWE-295"
] | mysql-server | 3bd5589e1a5a93f9c224badf983cd65c45215390 | 267,261,353,668,591,750,000,000,000,000,000,000,000 | 29 | WL#6791 : Redefine client --ssl option to imply enforced encryption
# Changed the meaning of the --ssl=1 option of all client binaries
to mean force ssl, not try ssl and fail over to eunecrypted
# Added a new MYSQL_OPT_SSL_ENFORCE mysql_options()
option to specify that an ssl connection is required.
# Added a new macr... |
GF_Err mdat_box_size(GF_Box *s)
{
GF_MediaDataBox *ptr = (GF_MediaDataBox *)s;
ptr->size += ptr->dataSize;
return GF_OK;
} | 0 | [
"CWE-787"
] | gpac | 388ecce75d05e11fc8496aa4857b91245007d26e | 267,209,635,251,281,040,000,000,000,000,000,000,000 | 6 | fixed #1587 |
static void encode_link(struct xdr_stream *xdr, const struct qstr *name, struct compound_hdr *hdr)
{
__be32 *p;
p = reserve_space(xdr, 8 + name->len);
*p++ = cpu_to_be32(OP_LINK);
xdr_encode_opaque(p, name->name, name->len);
hdr->nops++;
hdr->replen += decode_link_maxsz;
} | 0 | [
"CWE-703",
"CWE-189"
] | linux | bf118a342f10dafe44b14451a1392c3254629a1f | 166,889,195,868,379,170,000,000,000,000,000,000,000 | 10 | NFSv4: include bitmap in nfsv4 get acl data
The NFSv4 bitmap size is unbounded: a server can return an arbitrary
sized bitmap in an FATTR4_WORD0_ACL request. Replace using the
nfs4_fattr_bitmap_maxsz as a guess to the maximum bitmask returned by a server
with the inclusion of the bitmap (xdr length plus bitmasks) and... |
static int megasas_dcmd_set_fw_time(MegasasState *s, MegasasCmd *cmd)
{
uint64_t fw_time;
/* This is a dummy; setting of firmware time is not allowed */
memcpy(&fw_time, cmd->frame->dcmd.mbox, sizeof(fw_time));
trace_megasas_dcmd_set_fw_time(cmd->index, fw_time);
fw_time = cpu_to_le64(megasas_fw_t... | 0 | [
"CWE-401"
] | qemu | 765a707000e838c30b18d712fe6cb3dd8e0435f3 | 98,169,440,172,058,500,000,000,000,000,000,000,000 | 11 | megasas: fix guest-triggered memory leak
If the guest sets the sglist size to a value >=2GB, megasas_handle_dcmd
will return MFI_STAT_MEMORY_NOT_AVAILABLE without freeing the memory.
Avoid this by returning only the status from map_dcmd, and loading
cmd->iov_size in the caller.
Reported-by: Li Qiang <liqiang6-s@360.c... |
applet_get_settings (NMApplet *applet)
{
return (NMSettings *) applet->gconf_settings;
} | 0 | [
"CWE-200"
] | network-manager-applet | 8627880e07c8345f69ed639325280c7f62a8f894 | 10,704,457,524,163,866,000,000,000,000,000,000,000 | 4 | editor: prevent any registration of objects on the system bus
D-Bus access-control is name-based; so requests for a specific name
are allowed/denied based on the rules in /etc/dbus-1/system.d. But
apparently apps still get a non-named service on the bus, and if we
register *any* object even though we don't have a nam... |
static void __nft_release_tables(struct net *net)
{
struct nftables_pernet *nft_net = nft_pernet(net);
struct nft_table *table, *nt;
list_for_each_entry_safe(table, nt, &nft_net->tables, list) {
if (nft_table_has_owner(table))
continue;
__nft_release_table(net, table);
}
} | 0 | [
"CWE-665"
] | linux | ad9f151e560b016b6ad3280b48e42fa11e1a5440 | 124,399,445,326,704,570,000,000,000,000,000,000,000 | 12 | netfilter: nf_tables: initialize set before expression setup
nft_set_elem_expr_alloc() needs an initialized set if expression sets on
the NFT_EXPR_GC flag. Move set fields initialization before expression
setup.
[4512935.019450] ==================================================================
[4512935.019456] BUG: ... |
static ssize_t host_version_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct vbg_dev *gdev = dev_get_drvdata(dev);
return sprintf(buf, "%s\n", gdev->host_version);
} | 0 | [
"CWE-362"
] | linux | bd23a7269834dc7c1f93e83535d16ebc44b75eba | 135,342,832,319,951,600,000,000,000,000,000,000,000 | 7 | virt: vbox: Only copy_from_user the request-header once
In vbg_misc_device_ioctl(), the header of the ioctl argument is copied from
the userspace pointer 'arg' and saved to the kernel object 'hdr'. Then the
'version', 'size_in', and 'size_out' fields of 'hdr' are verified.
Before this commit, after the checks a buffe... |
DeepTiledInputFile::tileYSize () const
{
return _data->tileDesc.ySize;
} | 0 | [
"CWE-125"
] | openexr | e79d2296496a50826a15c667bf92bdc5a05518b4 | 52,587,694,970,412,940,000,000,000,000,000,000,000 | 4 | fix memory leaks and invalid memory accesses
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz> |
regmatch(
char_u *scan, // Current node.
proftime_T *tm UNUSED, // timeout limit or NULL
int *timed_out UNUSED) // flag set on timeout or NULL
{
char_u *next; // Next node.
int op;
int c;
regitem_T *rp;
int no;
int status; // one of the RA_ values:
#ifdef FEAT_RELTIME
int tm_... | 1 | [
"CWE-823",
"CWE-703"
] | vim | 6456fae9ba8e72c74b2c0c499eaf09974604ff30 | 14,507,096,832,468,277,000,000,000,000,000,000,000 | 1,481 | patch 8.2.4440: crash with specific regexp pattern and string
Problem: Crash with specific regexp pattern and string.
Solution: Stop at the start of the string. |
static ulong find_set(TYPELIB *lib, const char *x, size_t length,
char **err_pos, uint *err_len)
{
const char *end= x + length;
ulong found= 0;
uint find;
char buff[255];
*err_pos= 0; /* No error yet */
while (end > x && my_isspace(charset_info, end[-1]))
end--;
... | 0 | [
"CWE-319"
] | mysql-server | 060b1eadf4913f7066484ea34ec62feead1bca44 | 293,141,349,258,124,940,000,000,000,000,000,000,000 | 39 | 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 3b2d28578c526f347f5cfe763681eff365731f99) |
ChangeIntegerFeedback(ClientPtr client, DeviceIntPtr dev,
long unsigned int mask, IntegerFeedbackPtr i,
xIntegerFeedbackCtl * f)
{
if (client->swapped) {
swaps(&f->length);
swapl(&f->int_to_display);
}
i->ctrl.integer_displayed = f->int_to_display... | 0 | [
"CWE-191"
] | xserver | 7aaf54a1884f71dc363f0b884e57bcb67407a6cd | 299,829,998,423,563,500,000,000,000,000,000,000,000 | 13 | Fix XChangeFeedbackControl() request underflow
CVE-2021-3472 / ZDI-CAN-1259
This vulnerability was discovered by:
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative
Signed-off-by: Matthieu Herrb <matthieu@herrb.eu> |
static int mif_getc(jas_stream_t *in)
{
int c;
bool done;
done = false;
do {
switch (c = jas_stream_getc(in)) {
case EOF:
done = true;
break;
case '#':
for (;;) {
if ((c = jas_stream_getc(in)) == EOF) {
done = true;
break;
}
if (c == '\n') {
done = true;
break;
}... | 0 | [
"CWE-20",
"CWE-190"
] | jasper | d42b2388f7f8e0332c846675133acea151fc557a | 152,396,235,171,989,120,000,000,000,000,000,000,000 | 36 | The generation of the configuration file jas_config.h has been completely
reworked in order to avoid pollution of the global namespace.
Some problematic types like uchar, ulong, and friends have been replaced
with names with a jas_ prefix.
An option max_samples has been added to the BMP and JPEG decoders to
restrict ... |
alias_expand_line (count, ignore)
int count, ignore;
{
char *new_line;
new_line = alias_expand (rl_line_buffer);
if (new_line)
{
set_up_new_line (new_line);
return (0);
}
else
{
cleanup_expansion_error ();
return (1);
}
} | 0 | [
"CWE-20"
] | bash | 4f747edc625815f449048579f6e65869914dd715 | 121,548,503,385,114,290,000,000,000,000,000,000,000 | 18 | Bash-4.4 patch 7 |
f_argc(typval_T *argvars, typval_T *rettv)
{
win_T *wp;
if (argvars[0].v_type == VAR_UNKNOWN)
// use the current window
rettv->vval.v_number = ARGCOUNT;
else if (argvars[0].v_type == VAR_NUMBER
&& tv_get_number(&argvars[0]) == -1)
// use the global argument list
rettv->vval.v_number = GARGCOUNT... | 0 | [
"CWE-78"
] | vim | 8c62a08faf89663e5633dc5036cd8695c80f1075 | 230,623,076,383,454,600,000,000,000,000,000,000,000 | 21 | 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. |
GetPdFromLongAd (
IN UDF_VOLUME_INFO *Volume,
IN UDF_LONG_ALLOCATION_DESCRIPTOR *LongAd
)
{
UDF_LOGICAL_VOLUME_DESCRIPTOR *LogicalVolDesc;
UINT16 PartitionNum;
LogicalVolDesc = &Volume->LogicalVolDesc;
switch (LogicalVolDesc->DomainIdentifier.Suffix.Do... | 0 | [] | edk2 | b9ae1705adfdd43668027a25a2b03c2e81960219 | 267,162,825,869,940,570,000,000,000,000,000,000,000 | 57 | MdeModulePkg/UdfDxe: Refine boundary checks for file/path name string
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=828
The commit refines the boundary checks for file/path name string to
prevent possible buffer overrun.
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: ... |
static int kvm_create_vm_debugfs(struct kvm *kvm, int fd)
{
static DEFINE_MUTEX(kvm_debugfs_lock);
struct dentry *dent;
char dir_name[ITOA_MAX_LEN * 2];
struct kvm_stat_data *stat_data;
const struct _kvm_stats_desc *pdesc;
int i, ret;
int kvm_debugfs_num_entries = kvm_vm_stats_header.num_desc +
kvm_vc... | 0 | [
"CWE-459"
] | linux | 683412ccf61294d727ead4a73d97397396e69a6b | 50,376,883,159,121,320,000,000,000,000,000,000,000 | 73 | 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... |
mrb_vm_exec(mrb_state *mrb, const struct RProc *proc, const mrb_code *pc)
{
/* mrb_assert(MRB_PROC_CFUNC_P(proc)) */
const mrb_irep *irep = proc->body.irep;
const mrb_pool_value *pool = irep->pool;
const mrb_sym *syms = irep->syms;
mrb_code insn;
int ai = mrb_gc_arena_save(mrb);
struct mrb_jmpbuf *prev_jm... | 1 | [
"CWE-416",
"CWE-288"
] | mruby | 3cf291f72224715942beaf8553e42ba8891ab3c6 | 242,922,149,333,711,000,000,000,000,000,000,000,000 | 1,828 | vm.c: create break object before clearing GC arena.
Otherwise it possibly cause use-after-free. |
Fraction Fraction::operator/(int v) const
{
return Fraction { numerator, denominator*v };
} | 0 | [
"CWE-703"
] | libheif | 2710c930918609caaf0a664e9c7bc3dce05d5b58 | 148,976,862,372,458,940,000,000,000,000,000,000,000 | 4 | force fraction to a limited resolution to finally solve those pesky numerical edge cases |
ip_invoke(argc, argv, obj)
int argc;
VALUE *argv;
VALUE obj;
{
return ip_invoke_with_position(argc, argv, obj, TCL_QUEUE_TAIL);
} | 0 | [] | tk | ebd0fc80d62eeb7b8556522256f8d035e013eb65 | 109,575,427,463,612,680,000,000,000,000,000,000,000 | 7 | 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 |
void MainWindow::on_actionCut_triggered()
{
m_timelineDock->show();
m_timelineDock->raise();
m_timelineDock->removeSelection(true);
} | 0 | [
"CWE-89",
"CWE-327",
"CWE-295"
] | shotcut | f008adc039642307f6ee3378d378cdb842e52c1d | 306,737,446,727,194,700,000,000,000,000,000,000,000 | 6 | fix upgrade check is not using TLS correctly |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.