func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
static int ql_mii_read_reg(struct ql3_adapter *qdev, u16 regAddr, u16 *value)
{
u32 temp;
struct ql3xxx_port_registers __iomem *port_regs =
qdev->mem_map_registers;
ql_mii_disable_scan_mode(qdev);
if (ql_wait_for_mii_ready(qdev)) {
netif_warn(qdev, link, qdev->ndev, TIMED_OUT_MSG);
return -1;
}
ql_write... | 0 | [
"CWE-401"
] | linux | 1acb8f2a7a9f10543868ddd737e37424d5c36cf4 | 76,238,435,362,316,470,000,000,000,000,000,000,000 | 35 | net: qlogic: Fix memory leak in ql_alloc_large_buffers
In ql_alloc_large_buffers, a new skb is allocated via netdev_alloc_skb.
This skb should be released if pci_dma_mapping_error fails.
Fixes: 0f8ab89e825f ("qla3xxx: Check return code from pci_map_single() in ql_release_to_lrg_buf_free_list(), ql_populate_free_queue... |
static unsigned offset_il_node(struct mempolicy *pol,
struct vm_area_struct *vma, unsigned long n)
{
unsigned nnodes = nodes_weight(pol->v.nodes);
unsigned target;
int i;
int nid;
if (!nnodes)
return numa_node_id();
target = (unsigned int)n % nnodes;
nid = first_node(pol->v.nodes);
for (i = 0; i < ... | 0 | [
"CWE-388"
] | linux | cf01fb9985e8deb25ccf0ea54d916b8871ae0e62 | 249,982,736,119,653,100,000,000,000,000,000,000,000 | 16 | mm/mempolicy.c: fix error handling in set_mempolicy and mbind.
In the case that compat_get_bitmap fails we do not want to copy the
bitmap to the user as it will contain uninitialized stack data and leak
sensitive data.
Signed-off-by: Chris Salls <salls@cs.ucsb.edu>
Signed-off-by: Linus Torvalds <torvalds@linux-founda... |
Expr *sqlite3ExprAlloc(
sqlite3 *db, /* Handle for sqlite3DbMallocRawNN() */
int op, /* Expression opcode */
const Token *pToken, /* Token argument. Might be NULL */
int dequote /* True to dequote */
){
Expr *pNew;
int nExtra = 0;
int iValue = 0;
assert( db!=0... | 0 | [
"CWE-476"
] | sqlite | 57f7ece78410a8aae86aa4625fb7556897db384c | 194,548,674,407,844,830,000,000,000,000,000,000,000 | 43 | Fix a problem that comes up when using generated columns that evaluate to a
constant in an index and then making use of that index in a join.
FossilOrigin-Name: 8b12e95fec7ce6e0de82a04ca3dfcf1a8e62e233b7382aa28a8a9be6e862b1af |
static void icmp_reply(struct icmp_bxm *icmp_param, struct sk_buff *skb)
{
struct ipcm_cookie ipc;
struct rtable *rt = skb_rtable(skb);
struct net *net = dev_net(rt->dst.dev);
struct sock *sk;
struct inet_sock *inet;
__be32 daddr;
if (ip_options_echo(&icmp_param->replyopts, skb))
return;
sk = icmp_xmit_lock... | 1 | [
"CWE-362"
] | linux-2.6 | f6d8bd051c391c1c0458a30b2a7abcd939329259 | 143,845,826,322,283,980,000,000,000,000,000,000,000 | 47 | inet: add RCU protection to inet->opt
We lack proper synchronization to manipulate inet->opt ip_options
Problem is ip_make_skb() calls ip_setup_cork() and
ip_setup_cork() possibly makes a copy of ipc->opt (struct ip_options),
without any protection against another thread manipulating inet->opt.
Another thread can ch... |
static void virtual_engine_initial_hint(struct virtual_engine *ve)
{
int swp;
/*
* Pick a random sibling on starting to help spread the load around.
*
* New contexts are typically created with exactly the same order
* of siblings, and often started in batches. Due to the way we iterate
* the array of sibli... | 0 | [] | linux | bc8a76a152c5f9ef3b48104154a65a68a8b76946 | 314,895,575,201,264,000,000,000,000,000,000,000,000 | 26 | drm/i915/gen9: Clear residual context state on context switch
Intel ID: PSIRT-TA-201910-001
CVEID: CVE-2019-14615
Intel GPU Hardware prior to Gen11 does not clear EU state
during a context switch. This can result in information
leakage between contexts.
For Gen8 and Gen9, hardware provides a mechanism for
fast clear... |
}
struct scsi_transport_template *
iscsi_register_transport(struct iscsi_transport *tt)
{
struct iscsi_internal *priv;
unsigned long flags;
int err;
BUG_ON(!tt);
priv = iscsi_if_transport_lookup(tt);
if (priv)
return NULL;
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
if (!priv)
return NULL;
INIT_LIST_HEA... | 0 | [
"CWE-787"
] | linux | ec98ea7070e94cc25a422ec97d1421e28d97b7ee | 124,140,167,806,389,800,000,000,000,000,000,000,000 | 63 | scsi: iscsi: Ensure sysfs attributes are limited to PAGE_SIZE
As the iSCSI parameters are exported back through sysfs, it should be
enforcing that they never are more than PAGE_SIZE (which should be more
than enough) before accepting updates through netlink.
Change all iSCSI sysfs attributes to use sysfs_emit().
Cc:... |
int __p4d_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address)
{
p4d_t *new = p4d_alloc_one(mm, address);
if (!new)
return -ENOMEM;
smp_wmb(); /* See comment in __pte_alloc */
spin_lock(&mm->page_table_lock);
if (pgd_present(*pgd)) /* Another has populated it */
p4d_free(mm, new);
else
pgd_popu... | 0 | [
"CWE-119"
] | linux | 1be7107fbe18eed3e319a6c3e83c78254b693acb | 203,168,003,818,828,900,000,000,000,000,000,000,000 | 16 | mm: larger stack guard gap, between vmas
Stack guard page is a useful feature to reduce a risk of stack smashing
into a different mapping. We have been using a single page gap which
is sufficient to prevent having stack adjacent to a different mapping.
But this seems to be insufficient in the light of the stack usage ... |
static int __platform_get_irq_byname(struct platform_device *dev,
const char *name)
{
struct resource *r;
int ret;
if (IS_ENABLED(CONFIG_OF_IRQ) && dev->dev.of_node) {
ret = of_irq_get_byname(dev->dev.of_node, name);
if (ret > 0 || ret == -EPROBE_DEFER)
return ret;
}
r = platform_get_resource_byn... | 0 | [
"CWE-787"
] | linux | aa838896d87af561a33ecefea1caa4c15a68bc47 | 116,311,322,063,785,640,000,000,000,000,000,000,000 | 20 | drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions
Convert the various sprintf fmaily calls in sysfs device show functions
to sysfs_emit and sysfs_emit_at for PAGE_SIZE buffer safety.
Done with:
$ spatch -sp-file sysfs_emit_dev.cocci --in-place --max-width=80 .
And cocci script:
$ cat s... |
is_needy (NautilusFile *file,
FileCheck check_missing,
RequestType request_type_wanted)
{
NautilusDirectory *directory;
GList *node;
ReadyCallback *callback;
Monitor *monitor;
if (!(*check_missing)(file))
{
return FALSE;
}
directory = file->details->di... | 0 | [
"CWE-20"
] | nautilus | 1630f53481f445ada0a455e9979236d31a8d3bb0 | 119,790,291,837,802,610,000,000,000,000,000,000,000 | 54 | mime-actions: use file metadata for trusting desktop files
Currently we only trust desktop files that have the executable bit
set, and don't replace the displayed icon or the displayed name until
it's trusted, which prevents for running random programs by a malicious
desktop file.
However, the executable permission i... |
void gnutls_system_global_deinit()
{
#ifdef _WIN32
#if defined(__MINGW32__) && !defined(__MINGW64__) && __MINGW32_MAJOR_VERSION <= 3 && __MINGW32_MINOR_VERSION <= 20
FreeLibrary(Crypt32_dll);
#endif
#endif
} | 0 | [
"CWE-20"
] | gnutls | b0a3048e56611a2deee4976aeba3b8c0740655a6 | 75,097,074,426,920,160,000,000,000,000,000,000,000 | 8 | env: use secure_getenv when reading environment variables |
char *data() const override {
return _data;
} | 0 | [
"CWE-703"
] | ZLMediaKit | 7d8b212a3c3368bc2f6507cb74664fc419eb9327 | 327,920,743,006,234,100,000,000,000,000,000,000,000 | 3 | 修复rtmp汇报窗口太小导致循环递归的bug:#1839 |
void Compute(OpKernelContext* context) override {
ResourceHandle handle;
OP_REQUIRES_OK(context,
HandleFromInput(context, kResourceHandleName, &handle));
core::RefCountPtr<QuantileStreamResource> stream_resource;
// Create a reference to the underlying resource using the handle.
... | 0 | [
"CWE-703",
"CWE-681"
] | tensorflow | 8a84f7a2b5a2b27ecf88d25bad9ac777cd2f7992 | 144,497,111,834,912,740,000,000,000,000,000,000,000 | 37 | Ensure num_streams >= 0 in tf.raw_ops.BoostedTreesCreateQuantileStreamResource
PiperOrigin-RevId: 387452765
Change-Id: I9990c760e177fabca6a3b9b4612ceeaeeba51495 |
static int shutdown_vlan(struct lxc_handler *handler, struct lxc_netdev *netdev)
{
return 0;
} | 0 | [
"CWE-59",
"CWE-61"
] | lxc | 592fd47a6245508b79fe6ac819fe6d3b2c1289be | 89,584,990,700,666,430,000,000,000,000,000,000,000 | 4 | CVE-2015-1335: Protect container mounts against symlinks
When a container starts up, lxc sets up the container's inital fstree
by doing a bunch of mounting, guided by the container configuration
file. The container config is owned by the admin or user on the host,
so we do not try to guard against bad entries. Howev... |
atmarp_spaddr_print(netdissect_options *ndo,
const struct atmarp_pkthdr *ap, u_short pro)
{
if (pro != ETHERTYPE_IP && pro != ETHERTYPE_TRAIL)
ND_PRINT((ndo, "<wrong proto type>"));
else if (ATMSPROTO_LEN(ap) != 4)
ND_PRINT((ndo, "<wrong splen>"));
else
ND_PRINT((ndo, "%s", ipaddr_string(ndo, ATMSPA(ap))... | 0 | [
"CWE-125",
"CWE-787"
] | tcpdump | 13ab8d18617d616c7d343530f8a842e7143fb5cc | 283,315,113,667,107,930,000,000,000,000,000,000,000 | 10 | CVE-2017-13013/ARP: Fix printing of ARP protocol addresses.
If the protocol type isn't ETHERTYPE_IP or ETHERTYPE_TRAIL, or if the
protocol address length isn't 4, don't print the address as an IPv4 address.
This fixes a buffer over-read discovered by Bhargava Shastry,
SecT/TU Berlin.
Add a test using the capture fil... |
TEST(ParseOperand, ShouldRecognizeFieldPath) {
auto resultExpression = parseOperand(BSON(""
<< "$field"));
auto fieldPathExpression = dynamic_cast<ExpressionFieldPath*>(resultExpression.get());
ASSERT_TRUE(fieldPathExpression);
ASSERT_VALUE_EQ(fieldPathExpre... | 0 | [
"CWE-835"
] | mongo | 0a076417d1d7fba3632b73349a1fd29a83e68816 | 139,419,947,561,468,750,000,000,000,000,000,000,000 | 7 | SERVER-38070 fix infinite loop in agg expression |
ofputil_encode_packet_in_private(const struct ofputil_packet_in_private *pin,
enum ofputil_protocol protocol,
enum nx_packet_in_format packet_in_format)
{
enum ofp_version version = ofputil_protocol_to_ofp_version(protocol);
struct ofpbuf *msg;
... | 0 | [
"CWE-617",
"CWE-703"
] | ovs | 4af6da3b275b764b1afe194df6499b33d2bf4cde | 221,617,964,677,512,800,000,000,000,000,000,000,000 | 50 | ofp-group: Don't assert-fail decoding bad OF1.5 group mod type or command.
When decoding a group mod, the current code validates the group type and
command after the whole group mod has been decoded. The OF1.5 decoder,
however, tries to use the type and command earlier, when it might still be
invalid. This caused an... |
diff_check_sanity(tabpage_T *tp, diff_T *dp)
{
int i;
for (i = 0; i < DB_COUNT; ++i)
if (tp->tp_diffbuf[i] != NULL)
if (dp->df_lnum[i] + dp->df_count[i] - 1
> tp->tp_diffbuf[i]->b_ml.ml_line_count)
return FAIL;
return OK;
} | 0 | [
"CWE-787"
] | vim | c101abff4c6756db4f5e740fde289decb9452efa | 270,338,878,600,594,950,000,000,000,000,000,000,000 | 11 | patch 8.2.5164: invalid memory access after diff buffer manipulations
Problem: Invalid memory access after diff buffer manipulations.
Solution: Use zero offset when change removes all lines in a diff block. |
void i40e_vlan_stripping_enable(struct i40e_vsi *vsi)
{
struct i40e_vsi_context ctxt;
i40e_status ret;
/* Don't modify stripping options if a port VLAN is active */
if (vsi->info.pvid)
return;
if ((vsi->info.valid_sections &
cpu_to_le16(I40E_AQ_VSI_PROP_VLAN_VALID)) &&
((vsi->info.port_vlan_flags & ... | 0 | [
"CWE-400",
"CWE-401"
] | linux | 27d461333459d282ffa4a2bdb6b215a59d493a8f | 338,538,051,225,197,900,000,000,000,000,000,000,000 | 29 | i40e: prevent memory leak in i40e_setup_macvlans
In i40e_setup_macvlans if i40e_setup_channel fails the allocated memory
for ch should be released.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> |
GF_Err vmhd_Size(GF_Box *s)
{
GF_VideoMediaHeaderBox *ptr = (GF_VideoMediaHeaderBox *)s;
ptr->size += 8;
return GF_OK; | 0 | [
"CWE-400",
"CWE-401"
] | gpac | d2371b4b204f0a3c0af51ad4e9b491144dd1225c | 14,167,467,816,377,542,000,000,000,000,000,000,000 | 6 | prevent dref memleak on invalid input (#1183) |
GF_Err gf_filter_assign_id(GF_Filter *filter, const char *id)
{
if (!filter || filter->id) return GF_BAD_PARAM;
if (!id) {
char szID[1024];
sprintf(szID, "_%p_", filter);
filter->id = gf_strdup(szID);
} else {
filter->id = gf_strdup(id);
}
return GF_OK;
} | 0 | [
"CWE-787"
] | gpac | da37ec8582266983d0ec4b7550ec907401ec441e | 156,837,441,367,285,520,000,000,000,000,000,000,000 | 13 | fixed crashes for very long path - cf #1908 |
exit_sg(void)
{
#ifdef CONFIG_SCSI_PROC_FS
remove_proc_subtree("scsi/sg", NULL);
#endif /* CONFIG_SCSI_PROC_FS */
scsi_unregister_interface(&sg_interface);
class_destroy(sg_sysfs_class);
sg_sysfs_valid = 0;
unregister_chrdev_region(MKDEV(SCSI_GENERIC_MAJOR, 0),
SG_MAX_DEVS);
idr_destroy(&sg_index_idr);
} | 0 | [
"CWE-732"
] | linux | 26b5b874aff5659a7e26e5b1997e3df2c41fa7fd | 274,689,143,338,304,030,000,000,000,000,000,000,000 | 12 | scsi: sg: mitigate read/write abuse
As Al Viro noted in commit 128394eff343 ("sg_write()/bsg_write() is not fit
to be called under KERNEL_DS"), sg improperly accesses userspace memory
outside the provided buffer, permitting kernel memory corruption via
splice(). But it doesn't just do it on ->write(), also on ->read(... |
static Variant HHVM_FUNCTION(zip_entry_compressionmethod, const Resource& zip_entry) {
auto zipEntry = cast<ZipEntry>(zip_entry);
FAIL_IF_INVALID_ZIPENTRY(zip_entry_compressionmethod, zipEntry);
return zipEntry->getCompressionMethod();
} | 0 | [
"CWE-22"
] | hhvm | 65c95a01541dd2fbc9c978ac53bed235b5376686 | 314,272,515,527,156,000,000,000,000,000,000,000,000 | 7 | ZipArchive::extractTo bug 70350
Summary:Don't allow upward directory traversal when extracting zip archive files.
Files in zip files with `..` or starting at main root `/` should be normalized
to something where the file being extracted winds up within the directory or
a subdirectory where the actual extraction is ta... |
static void lo_create(fuse_req_t req, fuse_ino_t parent, const char *name,
mode_t mode, struct fuse_file_info *fi)
{
int fd = -1;
struct lo_data *lo = lo_data(req);
struct lo_inode *parent_inode;
struct lo_inode *inode = NULL;
struct fuse_entry_param e;
int err;
struct ... | 0 | [
"CWE-281"
] | qemu | e586edcb410543768ef009eaa22a2d9dd4a53846 | 294,745,290,733,019,480,000,000,000,000,000,000,000 | 69 | virtiofs: drop remapped security.capability xattr as needed
On Linux, the 'security.capability' xattr holds a set of
capabilities that can change when an executable is run, giving
a limited form of privilege escalation to those programs that
the writer of the file deemed worthy.
Any write causes the 'security.capabil... |
int ServerKeyExchange::getKeyLength() const
{
return server_key_->get_length();
} | 0 | [] | mysql-server | b9768521bdeb1a8069c7b871f4536792b65fd79b | 21,186,098,185,761,128,000,000,000,000,000,000,000 | 4 | Updated yassl to yassl-2.3.8
(cherry picked from commit 7f9941eab55ed672bfcccd382dafbdbcfdc75aaa) |
bool CZNC::AddUser(CUser* pUser, CString& sErrorRet, bool bStartup) {
if (FindUser(pUser->GetUserName()) != nullptr) {
sErrorRet = t_s("User already exists");
DEBUG("User [" << pUser->GetUserName() << "] - already exists");
return false;
}
if (!pUser->IsValid(sErrorRet)) {
DE... | 0 | [
"CWE-20"
] | znc | 64613bc8b6b4adf1e32231f9844d99cd512b8973 | 292,845,020,386,959,200,000,000,000,000,000,000,000 | 26 | Don't crash if user specified invalid encoding.
This is CVE-2019-9917 |
AttVal* TY_(NewAttributeEx)( TidyDocImpl* doc, ctmbstr name, ctmbstr value,
int delim )
{
AttVal *av = TY_(NewAttribute)(doc);
av->attribute = TY_(tmbstrdup)(doc->allocator, name);
av->value = TY_(tmbstrdup)(doc->allocator, value);
av->delim = delim;
av->dict = TY_(FindA... | 0 | [
"CWE-119"
] | tidy-html5 | c18f27a58792f7fbd0b30a0ff50d6b40a82f940d | 289,411,268,322,681,920,000,000,000,000,000,000,000 | 10 | Issue #217 - avoid len going negative, ever... |
static ssize_t do_tcp_sendpages(struct sock *sk, struct page *page, int offset,
size_t size, int flags)
{
struct tcp_sock *tp = tcp_sk(sk);
int mss_now, size_goal;
int err;
ssize_t copied;
long timeo = sock_sndtimeo(sk, flags & MSG_DONTWAIT);
/* Wait for a connection to finish. One exception is TCP Fast Open... | 0 | [
"CWE-399",
"CWE-835"
] | linux | ccf7abb93af09ad0868ae9033d1ca8108bdaec82 | 45,915,997,660,774,770,000,000,000,000,000,000,000 | 130 | tcp: avoid infinite loop in tcp_splice_read()
Splicing from TCP socket is vulnerable when a packet with URG flag is
received and stored into receive queue.
__tcp_splice_read() returns 0, and sk_wait_data() immediately
returns since there is the problematic skb in queue.
This is a nice way to burn cpu (aka infinite l... |
sldns_bget_token_par(sldns_buffer *b, char *token, const char *delim,
size_t limit, int* par, const char* skipw)
{
int c, lc;
int p; /* 0 -> no parentheses seen, >0 nr of ( seen */
int com, quoted;
char *t;
size_t i;
const char *d;
const char *del;
/* standard delimiters */
if (!delim) {
/* from isspace(3)... | 0 | [] | unbound | 05a5dc2d0d7d1c9054af48913079abebff06a5a1 | 224,366,105,166,509,070,000,000,000,000,000,000,000 | 149 | - Fix out-of-bounds null-byte write in sldns_bget_token_par while
parsing type WKS, reported by Luis Merino from X41 D-Sec. |
map_clear_int(
buf_T *buf UNUSED, /* buffer for local mappings */
int mode, /* mode in which to delete */
int local UNUSED, /* TRUE for buffer-local mappings */
int abbr) /* TRUE for abbreviations */
{
mapblock_T *mp, **mpp;
int hash;
int new_hash;
validate_maphash();
for (h... | 0 | [
"CWE-78"
] | vim | 53575521406739cf20bbe4e384d88e7dca11f040 | 69,530,378,663,883,850,000,000,000,000,000,000,000 | 71 | patch 8.1.1365: source command doesn't check for the sandbox
Problem: Source command doesn't check for the sandbox. (Armin Razmjou)
Solution: Check for the sandbox when sourcing a file. |
const SyscallFilterSet *syscall_filter_set_find(const char *name) {
unsigned i;
if (isempty(name) || name[0] != '@')
return NULL;
for (i = 0; i < _SYSCALL_FILTER_SET_MAX; i++)
if (streq(syscall_filter_sets[i].name, name))
return syscall_f... | 0 | [] | systemd | b835eeb4ec1dd122b6feff2b70881265c529fcdd | 165,522,169,166,058,330,000,000,000,000,000,000,000 | 12 | shared/seccomp: disallow pkey_mprotect the same as mprotect for W^X mappings (#7295)
MemoryDenyWriteExecution policy could be be bypassed by using pkey_mprotect
instead of mprotect to create an executable writable mapping.
The impact is mitigated by the fact that the man page says "Note that this
feature is fully... |
static int memory_failure_hugetlb(unsigned long pfn, int flags)
{
struct page *p = pfn_to_page(pfn);
struct page *head = compound_head(p);
int res;
unsigned long page_flags;
if (TestSetPageHWPoison(head)) {
pr_err("Memory failure: %#lx: already hardware poisoned\n",
pfn);
return 0;
}
num_poisoned_... | 0 | [] | linux | 46612b751c4941c5c0472ddf04027e877ae5990f | 151,319,951,354,799,710,000,000,000,000,000,000,000 | 71 | mm: hwpoison: fix thp split handing in soft_offline_in_use_page()
When soft_offline_in_use_page() runs on a thp tail page after pmd is
split, we trigger the following VM_BUG_ON_PAGE():
Memory failure: 0x3755ff: non anonymous thp
__get_any_page: 0x3755ff: unknown zero refcount page type 2fffff80000000
Soft offli... |
static apr_status_t send_all_header_fields(header_struct *h,
const request_rec *r)
{
const apr_array_header_t *elts;
const apr_table_entry_t *t_elt;
const apr_table_entry_t *t_end;
struct iovec *vec;
struct iovec *vec_next;
elts = apr_table_elts(r->hea... | 0 | [
"CWE-20"
] | httpd | a6027e56924bb6227c1fdbf6f91e7e2438338be6 | 136,062,828,177,788,150,000,000,000,000,000,000,000 | 59 | Limit accepted chunk-size to 2^63-1 and be strict about chunk-ext
authorized characters.
Submitted by: Yann Ylavic
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1684513 13f79535-47bb-0310-9956-ffa450edef68 |
static double mp_diag(_cimg_math_parser& mp) {
const unsigned int i_end = (unsigned int)mp.opcode[2], siz = mp.opcode[2] - 3;
double *ptrd = &_mp_arg(1) + 1;
std::memset(ptrd,0,siz*siz*sizeof(double));
for (unsigned int i = 3; i<i_end; ++i) { *(ptrd++) = _mp_arg(i); ptrd+=siz; }
... | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 3,941,773,991,821,186,500,000,000,000,000,000,000 | 7 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
Address has_pending_message_address() {
return reinterpret_cast<Address>(&thread_local_top_.has_pending_message_);
} | 0 | [
"CWE-20",
"CWE-119"
] | node | 530af9cb8e700e7596b3ec812bad123c9fa06356 | 56,994,348,572,501,080,000,000,000,000,000,000,000 | 3 | v8: Interrupts must not mask stack overflow.
Backport of https://codereview.chromium.org/339883002 |
static struct sock *raw_get_next(struct seq_file *seq, struct sock *sk)
{
struct raw_iter_state *state = raw_seq_private(seq);
do {
sk = sk_next(sk);
try_again:
;
} while (sk && sock_net(sk) != seq_file_net(seq));
if (!sk && ++state->bucket < RAW_HTABLE_SIZE) {
sk = sk_head(&state->h->ht[state->bucket]);
... | 0 | [
"CWE-362"
] | linux-2.6 | f6d8bd051c391c1c0458a30b2a7abcd939329259 | 218,088,738,269,356,440,000,000,000,000,000,000,000 | 16 | inet: add RCU protection to inet->opt
We lack proper synchronization to manipulate inet->opt ip_options
Problem is ip_make_skb() calls ip_setup_cork() and
ip_setup_cork() possibly makes a copy of ipc->opt (struct ip_options),
without any protection against another thread manipulating inet->opt.
Another thread can ch... |
clear_sub(regsub_T *sub)
{
if (REG_MULTI)
// Use 0xff to set lnum to -1
vim_memset(sub->list.multi, 0xff,
sizeof(struct multipos) * rex.nfa_nsubexpr);
else
vim_memset(sub->list.line, 0,
sizeof(struct linepos) * rex.nfa_nsubexpr);
sub->in_use = 0;
} | 0 | [
"CWE-122"
] | vim | 65b605665997fad54ef39a93199e305af2fe4d7f | 310,674,629,630,629,630,000,000,000,000,000,000,000 | 11 | patch 8.2.3409: reading beyond end of line with invalid utf-8 character
Problem: Reading beyond end of line with invalid utf-8 character.
Solution: Check for NUL when advancing. |
static void close_accept_socket(void)
{
BIO_printf(bio_err, "shutdown accept socket\n");
if (accept_socket >= 0) {
SHUTDOWN2(accept_socket);
}
} | 0 | [
"CWE-399"
] | openssl | 380f18ed5f140e0ae1b68f3ab8f4f7c395658d9e | 163,134,949,188,652,920,000,000,000,000,000,000,000 | 7 | CVE-2016-0798: avoid memory leak in SRP
The SRP user database lookup method SRP_VBASE_get_by_user had confusing
memory management semantics; the returned pointer was sometimes newly
allocated, and sometimes owned by the callee. The calling code has no
way of distinguishing these two cases.
Specifically, SRP servers t... |
xmlParserAddNodeInfo(xmlParserCtxtPtr ctxt,
const xmlParserNodeInfoPtr info)
{
unsigned long pos;
if ((ctxt == NULL) || (info == NULL)) return;
/* Find pos and check to see if node is already in the sequence */
pos = xmlParserFindNodeInfoIndex(&ctxt->node_seq, (xmlNodePtr)
... | 0 | [
"CWE-119"
] | libxml2 | 23f05e0c33987d6605387b300c4be5da2120a7ab | 226,030,394,468,878,130,000,000,000,000,000,000,000 | 56 | Detect excessive entities expansion upon replacement
If entities expansion in the XML parser is asked for,
it is possble to craft relatively small input document leading
to excessive on-the-fly content generation.
This patch accounts for those replacement and stop parsing
after a given threshold. it can be bypassed as... |
void t_cpp_generator::init_generator() {
// Make output directory
MKDIR(get_out_dir().c_str());
// Make output file
string f_types_name = get_out_dir() + program_name_ + "_types.h";
f_types_.open(f_types_name.c_str());
string f_types_impl_name = get_out_dir() + program_name_ + "_types.cpp";
f_types_impl... | 0 | [
"CWE-20"
] | thrift | cfaadcc4adcfde2a8232c62ec89870b73ef40df1 | 52,507,939,688,872,640,000,000,000,000,000,000,000 | 89 | THRIFT-3231 CPP: Limit recursion depth to 64
Client: cpp
Patch: Ben Craig <bencraig@apache.org> |
bool ms_handle_reset(Connection *con) override {
Mutex::Locker l(lock);
lderr(g_ceph_context) << __func__ << " " << con << dendl;
Session *s = static_cast<Session*>(con->get_priv());
if (s) {
s->con.reset(NULL); // break con <-> session ref cycle
con->set_priv(NULL); // break ref <-> se... | 0 | [
"CWE-287",
"CWE-284"
] | ceph | 5ead97120e07054d80623dada90a5cc764c28468 | 330,548,843,462,507,270,000,000,000,000,000,000,000 | 11 | auth/cephx: add authorizer challenge
Allow the accepting side of a connection to reject an initial authorizer
with a random challenge. The connecting side then has to respond with an
updated authorizer proving they are able to decrypt the service's challenge
and that the new authorizer was produced for this specific ... |
static void test_copyrect_bounds_server(GInputStream *is, GOutputStream *os)
{
test_common_bounds_server(is, os);
/* Message type & pad */
test_send_u8(os, 0);
test_send_u8(os, 0);
/* num rect */
test_send_u16(os, 1);
/* x, y, w, h */
test_send_u16(os, 90);
test_send_u16(os, 90);
... | 0 | [] | gtk-vnc | ea0386933214c9178aaea9f2f85049ea3fa3e14a | 313,582,668,094,222,370,000,000,000,000,000,000,000 | 23 | Fix bounds checking for RRE, hextile & copyrect encodings
While the client would bounds check the overall update
region, it failed to bounds check the payload data
parameters.
Add a test case to validate bounds checking.
https://bugzilla.gnome.org/show_bug.cgi?id=778048
CVE-2017-5884
Signed-off-by: Daniel P. Berra... |
void CoreUserInputHandler::handleSetkey(const BufferInfo &bufferInfo, const QString &msg)
{
QString bufname = bufferInfo.bufferName().isNull() ? "" : bufferInfo.bufferName();
#ifdef HAVE_QCA2
if (!bufferInfo.isValid())
return;
if (!Cipher::neededFeaturesAvailable()) {
emit displayMsg(Messag... | 0 | [
"CWE-399"
] | quassel | b5e38970ffd55e2dd9f706ce75af9a8d7730b1b8 | 38,501,990,981,603,380,000,000,000,000,000,000,000 | 36 | Improve the message-splitting algorithm for PRIVMSG and CTCP
This introduces a new message splitting algorithm based on
QTextBoundaryFinder. It works by first starting with the entire
message to be sent, encoding it, and checking to see if it is over
the maximum message length. If it is, it uses QTBF to find the
wor... |
gss_wrap_size_limit(OM_uint32 *minor_status,
gss_ctx_id_t context_handle,
int conf_req_flag,
gss_qop_t qop_req, OM_uint32 req_output_size, OM_uint32 *max_input_size)
{
gss_union_ctx_id_t ctx;
gss_mechanism mech;
OM_uint32 major_st... | 0 | [
"CWE-415"
] | krb5 | 56f7b1bc95a2a3eeb420e069e7655fb181ade5cf | 320,151,753,576,172,730,000,000,000,000,000,000,000 | 48 | Preserve GSS context on init/accept failure
After gss_init_sec_context() or gss_accept_sec_context() has created a
context, don't delete the mechglue context on failures from subsequent
calls, even if the mechanism deletes the mech-specific context (which
is allowed by RFC 2744 but not preferred). Check for union con... |
nma_gconf_settings_class_init (NMAGConfSettingsClass *gconf_settings_class)
{
GObjectClass *object_class = G_OBJECT_CLASS (gconf_settings_class);
NMSettingsClass *settings_class = NM_SETTINGS_CLASS (gconf_settings_class);
g_type_class_add_private (gconf_settings_class, sizeof (NMAGConfSettingsPrivate));
/* Virtua... | 0 | [
"CWE-200"
] | network-manager-applet | 8627880e07c8345f69ed639325280c7f62a8f894 | 336,502,533,490,126,970,000,000,000,000,000,000,000 | 24 | 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 unsigned int tun_chr_poll(struct file *file, poll_table * wait)
{
struct tun_file *tfile = file->private_data;
struct tun_struct *tun = __tun_get(tfile);
struct sock *sk = tun->sk;
unsigned int mask = 0;
if (!tun)
return POLLERR;
DBG(KERN_INFO "%s: tun_chr_poll\n", tun->dev->name);
poll_wait(file, &t... | 1 | [
"CWE-119"
] | linux-2.6 | 3c8a9c63d5fd738c261bd0ceece04d9c8357ca13 | 215,145,108,635,494,700,000,000,000,000,000,000,000 | 28 | tun/tap: Fix crashes if open() /dev/net/tun and then poll() it.
Fix NULL pointer dereference in tun_chr_pool() introduced by commit
33dccbb050bbe35b88ca8cf1228dcf3e4d4b3554 ("tun: Limit amount of queued
packets per device") and triggered by this code:
int fd;
struct pollfd pfd;
fd = open("/dev/net/tun", O_RDWR);
... |
is_wordchar(int c)
{
return IS_ALNUM(c);
} | 0 | [
"CWE-59",
"CWE-241"
] | w3m | 18dcbadf2771cdb0c18509b14e4e73505b242753 | 156,104,681,085,294,390,000,000,000,000,000,000,000 | 4 | Make temporary directory safely when ~/.w3m is unwritable |
bool Item_in_optimizer::invisible_mode()
{
/* MAX/MIN transformed or EXISTS->IN prepared => do nothing */
return (args[1]->type() != Item::SUBSELECT_ITEM ||
((Item_subselect *)args[1])->substype() ==
Item_subselect::EXISTS_SUBS);
} | 0 | [
"CWE-617"
] | server | 807945f2eb5fa22e6f233cc17b85a2e141efe2c8 | 139,154,216,292,862,020,000,000,000,000,000,000,000 | 7 | MDEV-26402: A SEGV in Item_field::used_tables/update_depend_map_for_order...
When doing condition pushdown from HAVING into WHERE,
Item_equal::create_pushable_equalities() calls
item->set_extraction_flag(IMMUTABLE_FL) for constant items.
Then, Item::cleanup_excluding_immutables_processor() checks for this flag
to see ... |
static void report_wakeup_requests(struct usb_hub *hub)
{
struct usb_device *hdev = hub->hdev;
struct usb_device *udev;
struct usb_hcd *hcd;
unsigned long resuming_ports;
int i;
if (hdev->parent)
return; /* Not a root hub */
hcd = bus_to_hcd(hdev->bus);
if (hcd->driver->get_resuming_ports) {
/*
*... | 0 | [
"CWE-400",
"CWE-703"
] | linux | 704620afc70cf47abb9d6a1a57f3825d2bca49cf | 289,170,065,457,967,260,000,000,000,000,000,000,000 | 32 | USB: check usb_get_extra_descriptor for proper size
When reading an extra descriptor, we need to properly check the minimum
and maximum size allowed, to prevent from invalid data being sent by a
device.
Reported-by: Hui Peng <benquike@gmail.com>
Reported-by: Mathias Payer <mathias.payer@nebelwelt.net>
Co-developed-by... |
static int bind_interdomain_evtchn_to_irqhandler_chip(
unsigned int remote_domain, evtchn_port_t remote_port,
irq_handler_t handler, unsigned long irqflags,
const char *devname, void *dev_id, struct irq_chip *chip)
{
int irq, retval;
irq = bind_interdomain_evtchn_to_irq_chip(remote_domain, remote_port,
... | 0 | [
"CWE-400",
"CWE-703"
] | linux | e99502f76271d6bc4e374fe368c50c67a1fd3070 | 75,048,563,699,702,960,000,000,000,000,000,000,000 | 20 | xen/events: defer eoi in case of excessive number of events
In case rogue guests are sending events at high frequency it might
happen that xen_evtchn_do_upcall() won't stop processing events in
dom0. As this is done in irq handling a crash might be the result.
In order to avoid that, delay further inter-domain events... |
static int vhost_vdpa_process_iotlb_msg(struct vhost_dev *dev,
struct vhost_iotlb_msg *msg)
{
struct vhost_vdpa *v = container_of(dev, struct vhost_vdpa, vdev);
struct vdpa_device *vdpa = v->vdpa;
const struct vdpa_config_ops *ops = vdpa->config;
int r = 0;
r = vhost_dev_check_owner(dev);
if (r)
return r;... | 0 | [
"CWE-416"
] | linux | f6bbf0010ba004f5e90c7aefdebc0ee4bd3283b9 | 68,411,474,748,167,560,000,000,000,000,000,000,000 | 34 | vhost-vdpa: fix use-after-free of v->config_ctx
When the 'v->config_ctx' eventfd_ctx reference is released we didn't
set it to NULL. So if the same character device (e.g. /dev/vhost-vdpa-0)
is re-opened, the 'v->config_ctx' is invalid and calling again
vhost_vdpa_config_put() causes use-after-free issues like the
foll... |
void gf_filter_reset_pending_packets(GF_Filter *filter)
{
//may happen when a filter is removed from the chain
if (filter->postponed_packets) {
while (gf_list_count(filter->postponed_packets)) {
GF_FilterPacket *pck = gf_list_pop_front(filter->postponed_packets);
gf_filter_packet_destroy(pck);
}
gf_list_d... | 0 | [
"CWE-787"
] | gpac | da37ec8582266983d0ec4b7550ec907401ec441e | 319,082,656,785,437,430,000,000,000,000,000,000,000 | 12 | fixed crashes for very long path - cf #1908 |
static CURLcode tftp_connect(struct connectdata *conn, bool *done)
{
tftp_state_data_t *state;
int blksize;
blksize = TFTP_BLKSIZE_DEFAULT;
state = conn->proto.tftpc = calloc(1, sizeof(tftp_state_data_t));
if(!state)
return CURLE_OUT_OF_MEMORY;
/* alloc pkt buffers based on specified blksize */
if(... | 1 | [
"CWE-787"
] | curl | facb0e4662415b5f28163e853dc6742ac5fafb3d | 335,193,428,854,919,140,000,000,000,000,000,000,000 | 79 | tftp: Alloc maximum blksize, and use default unless OACK is received
Fixes potential buffer overflow from 'recvfrom()', should the server
return an OACK without blksize.
Bug: https://curl.haxx.se/docs/CVE-2019-5482.html
CVE-2019-5482 |
vim_isprintc(int c)
{
if (enc_utf8 && c >= 0x100)
return utf_printable(c);
return (c >= 0x100 || (c > 0 && (g_chartab[c] & CT_PRINT_CHAR)));
} | 0 | [
"CWE-125",
"CWE-787"
] | vim | 94f3192b03ed27474db80b4d3a409e107140738b | 184,004,601,381,858,250,000,000,000,000,000,000,000 | 6 | 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 int search_chunk(struct mschmd_header *chm,
const unsigned char *chunk,
const char *filename,
const unsigned char **result,
const unsigned char **result_end)
{
const unsigned char *start, *end, *p;
unsigned int qr_size, num_entries, qr_entries, qr_density, name_len;
unsigned int L, R, M, ... | 0 | [
"CWE-20",
"CWE-193",
"CWE-682"
] | libmspack | 72e70a921f0f07fee748aec2274b30784e1d312a | 208,124,814,059,353,600,000,000,000,000,000,000,000 | 139 | Fix off-by-one bounds check on CHM PMGI/PMGL chunk numbers and
reject empty filenames. Thanks to Hanno Böck for reporting |
nfsd4_decode_lookup(struct nfsd4_compoundargs *argp, struct nfsd4_lookup *lookup)
{
DECODE_HEAD;
READ_BUF(4);
lookup->lo_len = be32_to_cpup(p++);
READ_BUF(lookup->lo_len);
SAVEMEM(lookup->lo_name, lookup->lo_len);
if ((status = check_filename(lookup->lo_name, lookup->lo_len)))
return status;
DECODE_TAIL;
} | 0 | [
"CWE-20",
"CWE-129"
] | linux | f961e3f2acae94b727380c0b74e2d3954d0edf79 | 206,544,862,006,597,670,000,000,000,000,000,000,000 | 13 | 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 int __init i740fb_setup(char *options)
{
char *opt;
if (!options || !*options)
return 0;
while ((opt = strsep(&options, ",")) != NULL) {
if (!*opt)
continue;
else if (!strncmp(opt, "mtrr:", 5))
mtrr = simple_strtoul(opt + 5, NULL, 0);
else
mode_option = opt;
}
return 0;
} | 0 | [
"CWE-369"
] | linux-fbdev | 15cf0b82271b1823fb02ab8c377badba614d95d5 | 5,048,179,951,502,684,000,000,000,000,000,000,000 | 18 | video: fbdev: i740fb: Error out if 'pixclock' equals zero
The userspace program could pass any values to the driver through
ioctl() interface. If the driver doesn't check the value of 'pixclock',
it may cause divide error.
Fix this by checking whether 'pixclock' is zero in the function
i740fb_check_var().
The follow... |
static int dxtory_decode_v2_420(AVCodecContext *avctx, AVFrame *pic,
const uint8_t *src, int src_size)
{
GetByteContext gb;
GetBitContext gb2;
int nslices, slice, slice_height, ref_slice_height;
int cur_y, next_y;
uint32_t off, slice_size;
uint8_t *Y, *U, *V;
... | 0 | [
"CWE-190"
] | FFmpeg | a392bf657015c9a79a5a13adfbfb15086c1943b9 | 314,940,442,736,023,650,000,000,000,000,000,000,000 | 75 | avcodec/dxtory: fix src size checks
Fixes integer overflow
Fixes out of array read
Fixes: d104661bb59b202df7671fb19a00ca6c-asan_heap-oob_d6429d_5066_cov_1729501105_dxtory_mic.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> |
static int checkStringLength(client *c, long long size) {
if (!(c->flags & CLIENT_MASTER) && size > server.proto_max_bulk_len) {
addReplyError(c,"string exceeds maximum allowed size (proto-max-bulk-len)");
return C_ERR;
}
return C_OK;
} | 0 | [
"CWE-190"
] | redis | 92e3b1802f72ca0c5b0bde97f01d9b57a758d85c | 224,135,225,226,933,860,000,000,000,000,000,000,000 | 7 | Fix integer overflow in STRALGO LCS (CVE-2021-29477)
An integer overflow bug in Redis version 6.0 or newer could be exploited using
the STRALGO LCS command to corrupt the heap and potentially result with remote
code execution.
(cherry picked from commit f0c5f920d0f88bd8aa376a2c05af4902789d1ef9) |
DEFUN (no_bgp_redistribute_ipv4_metric,
no_bgp_redistribute_ipv4_metric_cmd,
"no redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295>",
NO_STR
"Redistribute information from another routing protocol\n"
"Connected\n"
"Kernel routes\n"
"Open Shurtest Path ... | 0 | [
"CWE-125"
] | frr | 6d58272b4cf96f0daa846210dd2104877900f921 | 25,107,597,144,783,915,000,000,000,000,000,000,000 | 25 | [bgpd] cleanup, compact and consolidate capability parsing code
2007-07-26 Paul Jakma <paul.jakma@sun.com>
* (general) Clean up and compact capability parsing slightly.
Consolidate validation of length and logging of generic TLV, and
memcpy of capability data, thus removing such from cap specifc
code (not a... |
static int slc_close(struct net_device *dev)
{
struct slcan *sl = netdev_priv(dev);
spin_lock_bh(&sl->lock);
if (sl->tty) {
/* TTY discipline is running. */
clear_bit(TTY_DO_WRITE_WAKEUP, &sl->tty->flags);
}
netif_stop_queue(dev);
sl->rcount = 0;
sl->xleft = 0;
spin_unlock_bh(&sl->lock);
return 0;
} | 0 | [
"CWE-200",
"CWE-909",
"CWE-908"
] | linux | b9258a2cece4ec1f020715fe3554bc2e360f6264 | 178,750,288,755,065,000,000,000,000,000,000,000,000 | 16 | slcan: Don't transmit uninitialized stack data in padding
struct can_frame contains some padding which is not explicitly zeroed in
slc_bump. This uninitialized data will then be transmitted if the stack
initialization hardening feature is not enabled (CONFIG_INIT_STACK_ALL).
This commit just zeroes the whole struct i... |
xmlBufferAdd(xmlBufferPtr buf, const xmlChar *str, int len) {
unsigned int needSize;
if ((str == NULL) || (buf == NULL)) {
return -1;
}
if (buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) return -1;
if (len < -1) {
#ifdef DEBUG_BUFFER
xmlGenericError(xmlGenericErrorContext,
"xmlBufferAdd: len ... | 0 | [
"CWE-190"
] | libxml2 | 6c283d83eccd940bcde15634ac8c7f100e3caefd | 96,974,980,580,463,980,000,000,000,000,000,000,000 | 37 | [CVE-2022-29824] Fix integer overflows in xmlBuf and xmlBuffer
In several places, the code handling string buffers didn't check for
integer overflow or used wrong types for buffer sizes. This could
result in out-of-bounds writes or other memory errors when working on
large, multi-gigabyte buffers.
Thanks to Felix Wil... |
add_printer(cupsd_client_t *con, /* I - Client connection */
ipp_attribute_t *uri) /* I - URI of printer */
{
http_status_t status; /* Policy status */
int i; /* Looping var */
char scheme[HTTP_MAX_URI], /* Method portion of URI */
username[HTTP_MAX_URI], /* Username portion of URI */
host[... | 0 | [
"CWE-20"
] | cups | 49fa4983f25b64ec29d548ffa3b9782426007df3 | 11,681,784,203,870,552,000,000,000,000,000,000,000 | 633 | DBUS notifications could crash the scheduler (Issue #5143)
- scheduler/ipp.c: Make sure requesting-user-name string is valid UTF-8. |
int input2() { return input2_; } | 0 | [
"CWE-20",
"CWE-703"
] | tensorflow | a989426ee1346693cc015792f11d715f6944f2b8 | 259,224,085,306,121,530,000,000,000,000,000,000,000 | 1 | Improve to cover scale value greater than one
PiperOrigin-RevId: 433050921 |
get_lineno (var)
SHELL_VAR *var;
{
char *p;
int ln;
ln = executing_line_number ();
p = itos (ln);
FREE (value_cell (var));
var_setvalue (var, p);
return (var);
} | 0 | [] | bash | 863d31ae775d56b785dc5b0105b6d251515d81d5 | 103,072,498,867,621,480,000,000,000,000,000,000,000 | 12 | commit bash-20120224 snapshot |
static void unmap_mapping_range_vma(struct vm_area_struct *vma,
unsigned long start_addr, unsigned long end_addr,
struct zap_details *details)
{
zap_page_range(vma, start_addr, end_addr - start_addr, details);
} | 0 | [
"CWE-264"
] | linux-2.6 | 1a5a9906d4e8d1976b701f889d8f35d54b928f25 | 129,833,970,240,702,780,000,000,000,000,000,000,000 | 6 | mm: thp: fix pmd_bad() triggering in code paths holding mmap_sem read mode
In some cases it may happen that pmd_none_or_clear_bad() is called with
the mmap_sem hold in read mode. In those cases the huge page faults can
allocate hugepmds under pmd_none_or_clear_bad() and that can trigger a
false positive from pmd_bad(... |
gdk_pixbuf__bmp_image_load_increment(gpointer data,
const guchar * buf,
guint size,
GError **error)
{
struct bmp_progressive_state *context =
(struct bmp_progressive_state *) data;
gint BytesToCopy;
g... | 0 | [] | gdk-pixbuf | 779429ce34e439c01d257444fe9d6739e72a2024 | 320,804,730,650,968,320,000,000,000,000,000,000,000 | 90 | bmp: Detect integer overflow of the line width
Instead of risking crashes or OOM, return an error if
we detect integer overflow.
The commit also includes a test image that triggers
this overflow when used with pixbuf-read.
https://bugzilla.gnome.org/show_bug.cgi?id=768738 |
struct sk_buff *__napi_alloc_skb(struct napi_struct *napi, unsigned int len,
gfp_t gfp_mask)
{
struct napi_alloc_cache *nc = this_cpu_ptr(&napi_alloc_cache);
struct sk_buff *skb;
void *data;
len += NET_SKB_PAD + NET_IP_ALIGN;
if ((len > SKB_WITH_OVERHEAD(PAGE_SIZE)) ||
(gfp_mask & (__GFP_DIRECT_RECLAIM... | 0 | [
"CWE-703",
"CWE-125"
] | linux | 8605330aac5a5785630aec8f64378a54891937cc | 39,619,058,178,049,580,000,000,000,000,000,000,000 | 45 | tcp: fix SCM_TIMESTAMPING_OPT_STATS for normal skbs
__sock_recv_timestamp can be called for both normal skbs (for
receive timestamps) and for skbs on the error queue (for transmit
timestamps).
Commit 1c885808e456
(tcp: SOF_TIMESTAMPING_OPT_STATS option for SO_TIMESTAMPING)
assumes any skb passed to __sock_recv_timest... |
strtok_r(char *s, const char *delim, char **state) {
char *cp, *start;
start = cp = s ? s : *state;
if (!cp)
return NULL;
while (*cp && !strchr(delim, *cp))
++cp;
if (!*cp) {
if (cp == start)
return NULL;
*state = NULL;
return start;
} else {
*cp++ = '\0';
*state = cp;
return start;
}
} | 0 | [
"CWE-125"
] | libevent | 96f64a022014a208105ead6c8a7066018449d86d | 331,683,181,213,990,000,000,000,000,000,000,000,000 | 18 | evdns: name_parse(): fix remote stack overread
@asn-the-goblin-slayer:
"the name_parse() function in libevent's DNS code is vulnerable to a buffer overread.
971 if (cp != name_out) {
972 if (cp + 1 >= end) return -1;
973 *cp++ = '.';
974 }
975 if (cp + ... |
int mp_init (mp_int * a)
{
if (a)
fp_init(a);
return MP_OKAY;
} | 0 | [
"CWE-326",
"CWE-203"
] | wolfssl | 1de07da61f0c8e9926dcbd68119f73230dae283f | 170,123,961,077,859,830,000,000,000,000,000,000,000 | 6 | Constant time EC map to affine for private operations
For fast math, use a constant time modular inverse when mapping to
affine when operation involves a private key - key gen, calc shared
secret, sign. |
call_user_func_check(
ufunc_T *fp,
int argcount,
typval_T *argvars,
typval_T *rettv,
funcexe_T *funcexe,
dict_T *selfdict)
{
int error;
#ifdef FEAT_LUA
if (fp->uf_flags & FC_CFUNC)
{
cfunc_T cb = fp->uf_cb;
return (*cb)(argcount, argvars, rettv, fp->uf_cb_state);
}
#endif
... | 0 | [
"CWE-416"
] | vim | 91c7cbfe31bbef57d5fcf7d76989fc159f73ef15 | 269,028,489,582,340,480,000,000,000,000,000,000,000 | 55 | patch 9.0.0225: using freed memory with multiple line breaks in expression
Problem: Using freed memory with multiple line breaks in expression.
Solution: Free eval_tofree later. |
static int adjust_ptr_min_max_vals(struct bpf_verifier_env *env,
struct bpf_insn *insn,
const struct bpf_reg_state *ptr_reg,
const struct bpf_reg_state *off_reg)
{
struct bpf_verifier_state *vstate = env->cur_state;
struct bpf_func_state *state = vstate->frame[vstate->curframe];
struct bpf_reg_s... | 0 | [
"CWE-843"
] | bpf | 5b029a32cfe4600f5e10e36b41778506b90fd4de | 145,402,959,988,798,940,000,000,000,000,000,000,000 | 230 | bpf: Fix ringbuf helper function compatibility
Commit 457f44363a88 ("bpf: Implement BPF ring buffer and verifier support
for it") extended check_map_func_compatibility() by enforcing map -> helper
function match, but not helper -> map type match.
Due to this all of the bpf_ringbuf_*() helper functions could be used w... |
static uint16_t nvme_changed_nslist(NvmeCtrl *n, uint8_t rae, uint32_t buf_len,
uint64_t off, NvmeRequest *req)
{
uint32_t nslist[1024];
uint32_t trans_len;
int i = 0;
uint32_t nsid;
if (off >= sizeof(nslist)) {
trace_pci_nvme_err_invalid_log_page_offset(... | 0 | [] | qemu | 736b01642d85be832385063f278fe7cd4ffb5221 | 321,500,403,696,772,130,000,000,000,000,000,000,000 | 46 | hw/nvme: fix CVE-2021-3929
This fixes CVE-2021-3929 "locally" by denying DMA to the iomem of the
device itself. This still allows DMA to MMIO regions of other devices
(e.g. doing P2P DMA to the controller memory buffer of another NVMe
device).
Fixes: CVE-2021-3929
Reported-by: Qiuhao Li <Qiuhao.Li@outlook.com>
Review... |
mono_lookup_internal_call (MonoMethod *method)
{
char *sigstart;
char *tmpsig;
char mname [2048];
int typelen = 0, mlen, siglen;
gpointer res;
const IcallTypeDesc *imap;
g_assert (method != NULL);
if (method->is_inflated)
method = ((MonoMethodInflated *) method)->declaring;
if (method->klass->nested_in) {... | 0 | [
"CWE-264"
] | mono | 035c8587c0d8d307e45f1b7171a0d337bb451f1e | 44,948,917,806,946,140,000,000,000,000,000,000,000 | 98 | Allow only primitive types/enums in RuntimeHelpers.InitializeArray (). |
void operator()(OpKernelContext* ctx, const TensorShape& segment_ids_shape,
typename TTypes<Index>::ConstFlat segment_ids,
typename TTypes<T, 2>::ConstTensor data,
typename TTypes<T, 2>::Tensor output) {
if (output.size() == 0) {
return;
}
// Set... | 0 | [
"CWE-703",
"CWE-681",
"CWE-787"
] | tensorflow | db4f9717c41bccc3ce10099ab61996b246099892 | 264,036,810,842,882,870,000,000,000,000,000,000,000 | 33 | Fix heap buffer overflow in UnsortedSegmentSum.
When Index=int32, data_size and num_segments were truncated from int64 to int32. This truncation can produce negative numbers, which causes UnsortedSegmentFunctor to access out of bounds memory.
Also:
- Switches some indexing calculations to int64 to avoid signed intege... |
bool Box_hvcC::get_headers(std::vector<uint8_t>* dest) const
{
for (const auto& array : m_nal_array) {
for (const auto& unit : array.m_nal_units) {
dest->push_back( (unit.size()>>24) & 0xFF );
dest->push_back( (unit.size()>>16) & 0xFF );
dest->push_back( (unit.size()>> 8) & 0xFF );
dest->... | 0 | [
"CWE-703"
] | libheif | 2710c930918609caaf0a664e9c7bc3dce05d5b58 | 127,544,295,071,630,420,000,000,000,000,000,000,000 | 22 | force fraction to a limited resolution to finally solve those pesky numerical edge cases |
mptctl_eventreport (unsigned long arg)
{
struct mpt_ioctl_eventreport __user *uarg = (void __user *) arg;
struct mpt_ioctl_eventreport karg;
MPT_ADAPTER *ioc;
int iocnum;
int numBytes, maxEvents, max;
if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventreport))) {
printk(KERN_ERR MYNAM "%s@%d... | 1 | [
"CWE-362",
"CWE-369"
] | linux | 28d76df18f0ad5bcf5fa48510b225f0ed262a99b | 13,463,597,767,272,930,000,000,000,000,000,000,000 | 51 | scsi: mptfusion: Fix double fetch bug in ioctl
Tom Hatskevich reported that we look up "iocp" then, in the called
functions we do a second copy_from_user() and look it up again.
The problem that could cause is:
drivers/message/fusion/mptctl.c
674 /* All of these commands require an interrupt or
675 ... |
iter_store_parentside_rrset(struct module_env* env,
struct ub_packed_rrset_key* rrset)
{
struct rrset_ref ref;
rrset = packed_rrset_copy_alloc(rrset, env->alloc, *env->now);
if(!rrset) {
log_err("malloc failure in store_parentside_rrset");
return;
}
rrset->rk.flags |= PACKED_RRSET_PARENT_SIDE;
rrset->entry.... | 0 | [
"CWE-400"
] | unbound | ba0f382eee814e56900a535778d13206b86b6d49 | 334,724,028,544,255,070,000,000,000,000,000,000,000 | 16 | - CVE-2020-12662 Unbound can be tricked into amplifying an incoming
query into a large number of queries directed to a target.
- CVE-2020-12663 Malformed answers from upstream name servers can be
used to make Unbound unresponsive. |
f_funcref(typval_T *argvars, typval_T *rettv)
{
common_function(argvars, rettv, TRUE);
} | 0 | [
"CWE-78"
] | vim | 8c62a08faf89663e5633dc5036cd8695c80f1075 | 171,996,834,388,423,470,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. |
mrb_class_defined(mrb_state *mrb, const char *name)
{
mrb_sym sym = mrb_intern_check_cstr(mrb, name);
if (!sym) return FALSE;
return mrb_const_defined(mrb, mrb_obj_value(mrb->object_class), sym);
} | 0 | [
"CWE-787"
] | mruby | b1d0296a937fe278239bdfac840a3fd0e93b3ee9 | 40,697,312,918,202,687,000,000,000,000,000,000,000 | 6 | class.c: clear method cache after `remove_method`. |
static inline unsigned int fuse_wr_pages(loff_t pos, size_t len,
unsigned int max_pages)
{
return min_t(unsigned int,
((pos + len - 1) >> PAGE_SHIFT) -
(pos >> PAGE_SHIFT) + 1,
max_pages);
} | 0 | [
"CWE-459"
] | linux | 5d069dbe8aaf2a197142558b6fb2978189ba3454 | 283,194,044,527,427,050,000,000,000,000,000,000,000 | 8 | fuse: fix bad inode
Jan Kara's analysis of the syzbot report (edited):
The reproducer opens a directory on FUSE filesystem, it then attaches
dnotify mark to the open directory. After that a fuse_do_getattr() call
finds that attributes returned by the server are inconsistent, and calls
make_bad_inode() which,... |
void begin_dataset()
{
// Only called for sp_cursor::Select_fetch_into_spvars
DBUG_ASSERT(false); /* purecov: inspected */
} | 0 | [
"CWE-416"
] | server | 4681b6f2d8c82b4ec5cf115e83698251963d80d5 | 26,639,110,028,799,644,000,000,000,000,000,000,000 | 5 | MDEV-26281 ASAN use-after-poison when complex conversion is involved in blob
the bug was that in_vector array in Item_func_in was allocated in the
statement arena, not in the table->expr_arena.
revert part of the 5acd391e8b2d. Instead, change the arena correctly
in fix_all_session_vcol_exprs().
Remove TABLE_ARENA, t... |
R_API void r_egg_label(REgg *egg, const char *name) {
r_egg_printf (egg, "%s:\n", name);
} | 0 | [
"CWE-125"
] | radare2 | e710401ebb4a892a87b0c709d709af8b5dcbbb01 | 5,722,338,275,381,258,000,000,000,000,000,000,000 | 3 | patch #14211 heap buffer overflow in large ragg2
inputs. this should be refactored to use an RBuffer to enable dynamic
resizing, but for now just patching it to bail out if we are about to
overwrite the allocated statically sized buffer |
static void find_good_pkt_pointers(struct bpf_verifier_state *state,
struct bpf_reg_state *dst_reg)
{
struct bpf_reg_state *regs = state->regs, *reg;
int i;
/* LLVM can generate two kind of checks:
*
* Type 1:
*
* r2 = r3;
* r2 += 8;
* if (r2 > pkt_end) goto <handle exception>
* <access... | 0 | [
"CWE-200"
] | linux | 0d0e57697f162da4aa218b5feafe614fb666db07 | 138,073,729,169,309,490,000,000,000,000,000,000,000 | 49 | bpf: don't let ldimm64 leak map addresses on unprivileged
The patch fixes two things at once:
1) It checks the env->allow_ptr_leaks and only prints the map address to
the log if we have the privileges to do so, otherwise it just dumps 0
as we would when kptr_restrict is enabled on %pK. Given the latter is
of... |
static int smaps_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
struct mm_walk *walk)
{
struct vm_area_struct *vma = walk->vma;
pte_t *pte;
spinlock_t *ptl;
ptl = pmd_trans_huge_lock(pmd, vma);
if (ptl) {
if (pmd_present(*pmd))
smaps_pmd_entry(pmd, addr, walk);
spin_unlock(ptl);
goto ... | 0 | [
"CWE-362",
"CWE-703",
"CWE-667"
] | linux | 04f5866e41fb70690e28397487d8bd8eea7d712a | 108,714,996,328,730,500,000,000,000,000,000,000,000 | 30 | coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping
The core dumping code has always run without holding the mmap_sem for
writing, despite that is the only way to ensure that the entire vma
layout will not change from under it. Only using some signal
serialization on the processes bel... |
static int ntop_interface_load_host_alert_prefs(lua_State* vm) {
NetworkInterface *ntop_interface = getCurrentInterface(vm);
char *host_ip;
u_int16_t vlan_id = 0;
char buf[64];
ntop->getTrace()->traceEvent(TRACE_DEBUG, "%s() called", __FUNCTION__);
if(ntop_lua_check(vm, __FUNCTION__, 1, LUA_TSTRING)) retu... | 0 | [
"CWE-476"
] | ntopng | 01f47e04fd7c8d54399c9e465f823f0017069f8f | 88,110,757,971,860,150,000,000,000,000,000,000,000 | 19 | Security fix: prevents empty host from being used |
**/
CImg<T>& load_inr(const char *const filename, float *const voxel_size=0) {
return _load_inr(0,filename,voxel_size); | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 272,239,852,658,831,250,000,000,000,000,000,000,000 | 3 | Fix other issues in 'CImg<T>::load_bmp()'. |
static void rtcp_init_seq(pjmedia_rtcp_session *sess)
{
sess->received = 0;
sess->exp_prior = 0;
sess->rx_prior = 0;
sess->transit = 0;
sess->jitter = 0;
} | 0 | [
"CWE-125"
] | pjproject | 8b621f192cae14456ee0b0ade52ce6c6f258af1e | 88,388,953,321,942,240,000,000,000,000,000,000,000 | 8 | Merge pull request from GHSA-3qx3-cg72-wrh9 |
void update_process_times(int user_tick)
{
struct task_struct *p = current;
/* Note: this timer irq context must be accounted for as well. */
account_process_tick(p, user_tick);
run_local_timers();
rcu_check_callbacks(user_tick);
#ifdef CONFIG_IRQ_WORK
if (in_irq())
irq_work_tick();
#endif
scheduler_tick();
... | 0 | [
"CWE-200"
] | tip | dfb4357da6ddbdf57d583ba64361c9d792b0e0b1 | 94,531,178,783,457,770,000,000,000,000,000,000,000 | 16 | time: Remove CONFIG_TIMER_STATS
Currently CONFIG_TIMER_STATS exposes process information across namespaces:
kernel/time/timer_list.c print_timer():
SEQ_printf(m, ", %s/%d", tmp, timer->start_pid);
/proc/timer_list:
#11: <0000000000000000>, hrtimer_wakeup, S:01, do_nanosleep, cron/2570
Given that the trac... |
TfLiteStatus PrepareMeanOrSum(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE_OK(context, PrepareSimple(context, node));
OpData* data = reinterpret_cast<OpData*>(node->user_data);
// reduce_mean requires a buffer to store intermediate sum result.
OpContext op_context(context, node);
if (op_context... | 0 | [
"CWE-125",
"CWE-787"
] | tensorflow | 1970c2158b1ffa416d159d03c3370b9a462aee35 | 252,608,715,738,495,830,000,000,000,000,000,000,000 | 26 | [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... |
}
static inline bool f2fs_may_encrypt(struct inode *inode)
{
#ifdef CONFIG_FS_ENCRYPTION
umode_t mode = inode->i_mode;
return (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode));
#else
return false; | 0 | [
"CWE-476"
] | linux | 4969c06a0d83c9c3dc50b8efcdc8eeedfce896f6 | 271,234,061,091,403,380,000,000,000,000,000,000,000 | 10 | f2fs: support swap file w/ DIO
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> |
static bool elevator_match(const struct elevator_type *e, const char *name)
{
if (!strcmp(e->elevator_name, name))
return true;
if (e->elevator_alias && !strcmp(e->elevator_alias, name))
return true;
return false;
} | 0 | [
"CWE-416"
] | linux | c3e2219216c92919a6bd1711f340f5faa98695e6 | 74,679,036,985,890,720,000,000,000,000,000,000,000 | 9 | block: free sched's request pool in blk_cleanup_queue
In theory, IO scheduler belongs to request queue, and the request pool
of sched tags belongs to the request queue too.
However, the current tags allocation interfaces are re-used for both
driver tags and sched tags, and driver tags is definitely host wide,
and doe... |
com_connect(String *buffer, char *line)
{
char *tmp, buff[256];
bool save_rehash= opt_rehash;
int error;
memset(buff, 0, sizeof(buff));
if (buffer)
{
/*
Two null bytes are needed in the end of buff to allow
get_arg to find end of string the second time it's called.
*/
tmp= strmake(b... | 0 | [
"CWE-284",
"CWE-295"
] | mysql-server | 3bd5589e1a5a93f9c224badf983cd65c45215390 | 290,925,161,489,786,730,000,000,000,000,000,000,000 | 53 | 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... |
void addCName(const std::string& hostname, const std::string& cname) {
cnames_[hostname] = cname;
} | 0 | [
"CWE-400"
] | envoy | 542f84c66e9f6479bc31c6f53157c60472b25240 | 290,903,691,063,693,360,000,000,000,000,000,000,000 | 3 | overload: Runtime configurable global connection limits (#147)
Signed-off-by: Tony Allen <tony@allen.gg> |
xmlPedanticParserDefault(int val) {
int old = xmlPedanticParserDefaultValue;
xmlPedanticParserDefaultValue = val;
return(old);
} | 0 | [
"CWE-119"
] | libxml2 | 23f05e0c33987d6605387b300c4be5da2120a7ab | 62,754,500,128,110,330,000,000,000,000,000,000,000 | 6 | Detect excessive entities expansion upon replacement
If entities expansion in the XML parser is asked for,
it is possble to craft relatively small input document leading
to excessive on-the-fly content generation.
This patch accounts for those replacement and stop parsing
after a given threshold. it can be bypassed as... |
static bool ok_jpg_skip_segment(ok_jpg_decoder *decoder) {
uint8_t buffer[2];
if (!ok_read(decoder, buffer, sizeof(buffer))) {
return false;
}
int length = readBE16(buffer) - 2;
return ok_seek(decoder, length);
} | 0 | [
"CWE-787"
] | ok-file-formats | a9cc1711dd4ed6a215038f1c5c03af0ef52c3211 | 251,796,148,593,655,940,000,000,000,000,000,000,000 | 8 | ok_jpg: Fix invalid DHT (#11) |
uint64 EbmlElementSize(uint64 type, uint64 value, uint64 fixed_size) {
// Size of EBML ID
uint64 ebml_size = GetUIntSize(type);
// Datasize
ebml_size += (fixed_size > 0) ? fixed_size : GetUIntSize(value);
// Size of Datasize
ebml_size++;
return ebml_size;
} | 0 | [
"CWE-20"
] | libvpx | 34d54b04e98dd0bac32e9aab0fbda0bf501bc742 | 2,809,853,187,670,298,400,000,000,000,000,000,000 | 12 | update libwebm to libwebm-1.0.0.27-358-gdbf1d10
changelog:
https://chromium.googlesource.com/webm/libwebm/+log/libwebm-1.0.0.27-351-g9f23fbc..libwebm-1.0.0.27-358-gdbf1d10
Change-Id: I28a6b3ae02a53fb1f2029eee11e9449afb94c8e3 |
debug_log(int level, const char *str)
{
fputs(str, stderr);
} | 0 | [
"CWE-399"
] | pacemaker | 564f7cc2a51dcd2f28ab12a13394f31be5aa3c93 | 8,536,747,292,451,539,000,000,000,000,000,000,000 | 4 | High: core: Internal tls api improvements for reuse with future LRMD tls backend. |
void FillFirstShaper(cmsS1Fixed14Number* Table, cmsToneCurve* Curve)
{
int i;
cmsFloat32Number R, y;
for (i=0; i < 256; i++) {
R = (cmsFloat32Number) (i / 255.0);
y = cmsEvalToneCurveFloat(Curve, R);
Table[i] = DOUBLE_TO_1FIXED14(y);
}
} | 0 | [] | Little-CMS | 41d222df1bc6188131a8f46c32eab0a4d4cdf1b6 | 129,873,867,713,642,140,000,000,000,000,000,000,000 | 13 | Memory squeezing fix: lcms2 cmsPipeline construction
When creating a new pipeline, lcms would often try to allocate a stage
and pass it to cmsPipelineInsertStage without checking whether the
allocation succeeded. cmsPipelineInsertStage would then assert (or crash)
if it had not.
The fix here is to change cmsPipelineI... |
static void win_stdio_close(CharDriverState *chr)
{
WinStdioCharState *stdio = chr->opaque;
if (stdio->hInputReadyEvent != INVALID_HANDLE_VALUE) {
CloseHandle(stdio->hInputReadyEvent);
}
if (stdio->hInputDoneEvent != INVALID_HANDLE_VALUE) {
CloseHandle(stdio->hInputDoneEvent);
}
... | 0 | [
"CWE-416"
] | qemu | a4afa548fc6dd9842ed86639b4d37d4d1c4ad480 | 200,694,482,757,098,040,000,000,000,000,000,000,000 | 16 | char: move front end handlers in CharBackend
Since the hanlders are associated with a CharBackend, rather than the
CharDriverState, it is more appropriate to store in CharBackend. This
avoids the handler copy dance in qemu_chr_fe_set_handlers() then
mux_chr_update_read_handler(), by storing the CharBackend pointer
dir... |
init_dfa (re_dfa_t *dfa, size_t pat_len)
{
__re_size_t table_size;
#ifndef _LIBC
const char *codeset_name;
#endif
#ifdef RE_ENABLE_I18N
size_t max_i18n_object_size = MAX (sizeof (wchar_t), sizeof (wctype_t));
#else
size_t max_i18n_object_size = 0;
#endif
size_t max_object_size =
MAX (sizeof (struct re_sta... | 0 | [
"CWE-19"
] | gnulib | 5513b40999149090987a0341c018d05d3eea1272 | 260,389,993,814,803,660,000,000,000,000,000,000,000 | 94 | Diagnose ERE '()|\1'
Problem reported by Hanno Böck in: http://bugs.gnu.org/21513
* lib/regcomp.c (parse_reg_exp): While parsing alternatives, keep
track of the set of previously-completed subexpressions available
before the first alternative, and restore this set just before
parsing each subsequent alternative. This... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.