func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
static void rds_ib_remove_one(struct ib_device *device)
{
struct rds_ib_device *rds_ibdev;
rds_ibdev = ib_get_client_data(device, &rds_ib_client);
if (!rds_ibdev)
return;
rds_ib_dev_shutdown(rds_ibdev);
/* stop connection attempts from getting a reference to this device. */
ib_set_client_data(device, &rds_ib... | 0 | [
"CWE-399",
"CWE-476"
] | linux | c2349758acf1874e4c2b93fe41d072336f1a31d0 | 112,303,983,753,952,660,000,000,000,000,000,000,000 | 26 | rds: prevent dereference of a NULL device
Binding might result in a NULL device, which is dereferenced
causing this BUG:
[ 1317.260548] BUG: unable to handle kernel NULL pointer dereference at 000000000000097
4
[ 1317.261847] IP: [<ffffffff84225f52>] rds_ib_laddr_check+0x82/0x110
[ 1317.263315] PGD 418bcb067 PUD 3ceb... |
void CLASS bad_pixels(const char *cfname)
{
FILE *fp = NULL;
#ifndef LIBRAW_LIBRARY_BUILD
char *fname, *cp, line[128];
int len, time, row, col, r, c, rad, tot, n, fixed = 0;
#else
char *cp, line[128];
int time, row, col, r, c, rad, tot, n;
#ifdef DCRAW_VERBOSE
int fixed = 0;
#endif
#endif
if (!filters)
... | 0 | [
"CWE-476",
"CWE-119"
] | LibRaw | d7c3d2cb460be10a3ea7b32e9443a83c243b2251 | 276,178,389,922,889,500,000,000,000,000,000,000,000 | 103 | Secunia SA75000 advisory: several buffer overruns |
const std::vector<std::shared_ptr<Ope>> &top_args() const {
return args_stack[args_stack.size() - 1];
} | 0 | [
"CWE-125"
] | cpp-peglib | b3b29ce8f3acf3a32733d930105a17d7b0ba347e | 309,421,747,071,963,700,000,000,000,000,000,000,000 | 3 | Fix #122 |
static void php_imagepolygon(INTERNAL_FUNCTION_PARAMETERS, int filled)
{
zval *IM, *POINTS;
long NPOINTS, COL;
zval **var = NULL;
gdImagePtr im;
gdPointPtr points;
int npoints, col, nelem, i;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rall", &IM, &POINTS, &NPOINTS, &COL) == FAILURE) {
return;
}
... | 1 | [
"CWE-703",
"CWE-189"
] | php-src | 2938329ce19cb8c4197dec146c3ec887c6f61d01 | 299,379,498,278,272,830,000,000,000,000,000,000,000 | 56 | Fixed bug #66356 (Heap Overflow Vulnerability in imagecrop())
And also fixed the bug: arguments are altered after some calls |
static void input_dev_release_keys(struct input_dev *dev)
{
bool need_sync = false;
int code;
if (is_event_supported(EV_KEY, dev->evbit, EV_MAX)) {
for_each_set_bit(code, dev->key, KEY_CNT) {
input_pass_event(dev, EV_KEY, code, 0);
need_sync = true;
}
if (need_sync)
input_pass_event(dev, EV_SYN, SYN... | 0 | [
"CWE-703",
"CWE-787"
] | linux | cb222aed03d798fc074be55e59d9a112338ee784 | 233,882,427,825,667,930,000,000,000,000,000,000,000 | 17 | Input: add safety guards to input_set_keycode()
If we happen to have a garbage in input device's keycode table with values
too big we'll end up doing clear_bit() with offset way outside of our
bitmaps, damaging other objects within an input device or even outside of
it. Let's add sanity checks to the returned old keyc... |
lexer_construct_literal_object (parser_context_t *context_p, /**< context */
const lexer_lit_location_t *lit_location_p, /**< literal location */
uint8_t literal_type) /**< final literal type */
{
uint8_t local_byte_array[LEXER_MAX_LITERAL_LOCAL_BUFFER_S... | 0 | [
"CWE-288"
] | jerryscript | f3a420b672927037beb4508d7bdd68fb25d2caf6 | 43,023,362,196,828,210,000,000,000,000,000,000,000 | 114 | Fix class static block opening brace parsing (#4942)
The next character should not be consumed after finding the static block opening brace.
This patch fixes #4916.
JerryScript-DCO-1.0-Signed-off-by: Martin Negyokru negyokru@inf.u-szeged.hu |
cert_object_t **get_certificate_list(pkcs11_handle_t *h, int *count)
{
CERTCertList * certList;
CERTCertListNode *node;
cert_object_t **certs;
int certCount = 0;
int certIndex = 0;
SECStatus rv;
if (!h->slot) {
return NULL;
}
if (h->certs) {
*count = h->cert_count;
return h->certs;
}
... | 0 | [] | pam_pkcs11 | cc51b3e2720ea862d500cab2ea517518ff39a497 | 270,855,809,559,429,380,000,000,000,000,000,000,000 | 77 | verify using a nonce from the system, not the card
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting the problem. |
static inline bool is_vmalloc_addr(const void *x)
{
#ifdef CONFIG_MMU
unsigned long addr = (unsigned long)x;
return addr >= VMALLOC_START && addr < VMALLOC_END;
#else
return false;
#endif
} | 0 | [
"CWE-119"
] | linux | 1be7107fbe18eed3e319a6c3e83c78254b693acb | 253,718,035,724,623,800,000,000,000,000,000,000,000 | 10 | 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 ... |
int vfs_readlink(struct dentry *dentry, char __user *buffer, int buflen)
{
struct inode *inode = d_inode(dentry);
DEFINE_DELAYED_CALL(done);
const char *link;
int res;
if (unlikely(!(inode->i_opflags & IOP_DEFAULT_READLINK))) {
if (unlikely(inode->i_op->readlink))
return inode->i_op->readlink(dentry, buffer,... | 0 | [
"CWE-416",
"CWE-284"
] | linux | d0cb50185ae942b03c4327be322055d622dc79f6 | 99,821,607,102,772,750,000,000,000,000,000,000,000 | 29 | do_last(): fetch directory ->i_mode and ->i_uid before it's too late
may_create_in_sticky() call is done when we already have dropped the
reference to dir.
Fixes: 30aba6656f61e (namei: allow restricted O_CREAT of FIFOs and regular files)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> |
static int u32_set_parms(struct net *net, struct tcf_proto *tp,
unsigned long base,
struct tc_u_knode *n, struct nlattr **tb,
struct nlattr *est, u32 flags, u32 fl_flags,
struct netlink_ext_ack *extack)
{
int err;
err = tcf_exts_validate_ex(net, tp, tb, est, &n->exts, flags,
fl_flags, extack);... | 0 | [
"CWE-416"
] | linux | 3db09e762dc79584a69c10d74a6b98f89a9979f8 | 193,616,534,262,910,300,000,000,000,000,000,000,000 | 56 | net/sched: cls_u32: fix netns refcount changes in u32_change()
We are now able to detect extra put_net() at the moment
they happen, instead of much later in correct code paths.
u32_init_knode() / tcf_exts_init() populates the ->exts.net
pointer, but as mentioned in tcf_exts_init(),
the refcount on netns has not been ... |
static enum hrtimer_restart pit_timer_fn(struct hrtimer *data)
{
struct kvm_kpit_state *ps = container_of(data, struct kvm_kpit_state, timer);
struct kvm_pit *pt = ps->kvm->arch.vpit;
if (ps->reinject || !atomic_read(&ps->pending)) {
atomic_inc(&ps->pending);
queue_kthread_work(&pt->worker, &pt->expired);
}
... | 0 | [
"CWE-362"
] | kvm | 2febc839133280d5a5e8e1179c94ea674489dae2 | 8,100,304,270,261,891,000,000,000,000,000,000,000 | 16 | KVM: x86: Improve thread safety in pit
There's a race condition in the PIT emulation code in KVM. In
__kvm_migrate_pit_timer the pit_timer object is accessed without
synchronization. If the race condition occurs at the wrong time this
can crash the host kernel.
This fixes CVE-2014-3611.
Cc: stable@vger.kernel.org
... |
register_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops,
void *data)
{
struct ftrace_func_probe *entry;
struct ftrace_page *pg;
struct dyn_ftrace *rec;
int type, len, not;
unsigned long key;
int count = 0;
char *search;
type = filter_parse_regex(glob, strlen(glob), &search, ¬);
len... | 0 | [
"CWE-703"
] | linux | 6a76f8c0ab19f215af2a3442870eeb5f0e81998d | 24,909,227,637,571,107,000,000,000,000,000,000,000 | 67 | tracing: Fix possible NULL pointer dereferences
Currently set_ftrace_pid and set_graph_function files use seq_lseek
for their fops. However seq_open() is called only for FMODE_READ in
the fops->open() so that if an user tries to seek one of those file
when she open it for writing, it sees NULL seq_file and then panic... |
SPL_METHOD(SplPriorityQueue, extract)
{
zval *value, *value_out, **value_out_pp;
spl_heap_object *intern;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
return;
}
intern = (spl_heap_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
if (intern->heap->flags & SPL_HEAP_CORRUPTED... | 0 | [] | php-src | 1cbd25ca15383394ffa9ee8601c5de4c0f2f90e1 | 63,142,758,180,222,410,000,000,000,000,000,000,000 | 39 | Fix bug #69737 - Segfault when SplMinHeap::compare produces fatal error |
static void usage(char *me, bool fail)
{
fprintf(stderr, "Usage: %s lxcpath name pid type bridge nicname\n", me);
fprintf(stderr, " nicname is the name to use inside the container\n");
exit(fail ? 1 : 0);
} | 0 | [
"CWE-284",
"CWE-862"
] | lxc | 16af238036a5464ae8f2420ed3af214f0de875f9 | 300,462,334,129,205,660,000,000,000,000,000,000,000 | 6 | CVE-2017-5985: Ensure target netns is caller-owned
Before this commit, lxc-user-nic could potentially have been tricked into
operating on a network namespace over which the caller did not hold privilege.
This commit ensures that the caller is privileged over the network namespace by
temporarily dropping privilege.
L... |
static int unix_dgram_recvmsg(struct kiocb *iocb, struct socket *sock,
struct msghdr *msg, size_t size,
int flags)
{
struct sock_iocb *siocb = kiocb_to_siocb(iocb);
struct scm_cookie tmp_scm;
struct sock *sk = sock->sk;
struct unix_sock *u = unix_sk(sk);
int noblock = flags & MSG_DONTWAIT;
struc... | 0 | [
"CWE-20",
"CWE-269"
] | linux | f3d3342602f8bcbf37d7c46641cb9bca7618eb1c | 21,598,982,742,088,085,000,000,000,000,000,000,000 | 96 | net: rework recvmsg handler msg_name and msg_namelen logic
This patch now always passes msg->msg_namelen as 0. recvmsg handlers must
set msg_namelen to the proper size <= sizeof(struct sockaddr_storage)
to return msg_name to the user.
This prevents numerous uninitialized memory leaks we had in the
recvmsg handlers an... |
static GF_Err do_scene_encode()
{
GF_Err e;
FILE *logs = NULL;
if (do_scene_log) {
char alogfile[GF_MAX_PATH];
strcpy(alogfile, inName);
if (strchr(alogfile, '.')) {
while (alogfile[strlen(alogfile)-1] != '.') alogfile[strlen(alogfile)-1] = 0;
alogfile[strlen(alogfile)-1] = 0;
}
strcat(alogfile, "_en... | 0 | [
"CWE-476"
] | gpac | 87afe070cd6866df7fe80f11b26ef75161de85e0 | 29,894,586,031,862,188,000,000,000,000,000,000,000 | 32 | fixed #1734 |
status_end(void)
{
fprintf(stdout, "\n");
fflush(stdout);
if (logfile)
fprintf(logfile, "\n");
} | 0 | [
"CWE-119"
] | postgres | 01824385aead50e557ca1af28640460fa9877d51 | 66,582,864,684,554,920,000,000,000,000,000,000,000 | 7 | Prevent potential overruns of fixed-size buffers.
Coverity identified a number of places in which it couldn't prove that a
string being copied into a fixed-size buffer would fit. We believe that
most, perhaps all of these are in fact safe, or are copying data that is
coming from a trusted source so that any overrun i... |
static void lsr_read_href(GF_LASeRCodec *lsr, GF_Node *n)
{
Bool has_href;
GF_LSR_READ_INT(lsr, has_href, 1, "has_href");
if (has_href) {
GF_FieldInfo info;
lsr->last_error = gf_node_get_attribute_by_tag(n, TAG_XLINK_ATT_href, GF_TRUE, GF_FALSE, &info);
lsr_read_any_uri(lsr, info.far_ptr, "href");
}
} | 0 | [
"CWE-190"
] | gpac | faa75edde3dfeba1e2cf6ffa48e45a50f1042096 | 335,854,060,648,784,000,000,000,000,000,000,000,000 | 10 | fixed #2213 |
static void rbd_set_owner_cid(struct rbd_device *rbd_dev,
const struct rbd_client_id *cid)
{
dout("%s rbd_dev %p %llu-%llu -> %llu-%llu\n", __func__, rbd_dev,
rbd_dev->owner_cid.gid, rbd_dev->owner_cid.handle,
cid->gid, cid->handle);
rbd_dev->owner_cid = *cid; /* struct */
} | 0 | [
"CWE-863"
] | linux | f44d04e696feaf13d192d942c4f14ad2e117065a | 136,036,313,454,931,770,000,000,000,000,000,000,000 | 8 | rbd: require global CAP_SYS_ADMIN for mapping and unmapping
It turns out that currently we rely only on sysfs attribute
permissions:
$ ll /sys/bus/rbd/{add*,remove*}
--w------- 1 root root 4096 Sep 3 20:37 /sys/bus/rbd/add
--w------- 1 root root 4096 Sep 3 20:37 /sys/bus/rbd/add_single_major
--w------- 1 ro... |
TEST(IndexBoundsBuilderTest, TranslateLtNumberMin) {
auto testIndex = buildSimpleIndexEntry();
BSONObj obj = BSON("a" << BSON("$lt" << numberMin));
auto expr = parseMatchExpression(obj);
BSONElement elt = obj.firstElement();
OrderedIntervalList oil;
IndexBoundsBuilder::BoundsTightness tightness;... | 0 | [
"CWE-754"
] | mongo | f8f55e1825ee5c7bdb3208fc7c5b54321d172732 | 290,013,015,367,381,000,000,000,000,000,000,000,000 | 15 | SERVER-44377 generate correct plan for indexed inequalities to null |
void Item_func_sha2::fix_length_and_dec()
{
maybe_null = 1;
max_length = 0;
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
int sha_variant= args[1]->const_item() ? args[1]->val_int() : 512;
switch (sha_variant) {
#ifndef OPENSSL_NO_SHA512
case 512:
fix_length_and_charset(SHA512_DIGEST_LENGTH * ... | 0 | [] | mysql-server | 475dcde2c7856dd0050b967099a86c087d94f32f | 155,818,792,630,669,970,000,000,000,000,000,000,000 | 44 | Bug#27099029: UNLIMITED LENGTH OF THE PASSWORD
Description: my_crypt_genhash depends on the length of
plaintext password. Longer the password,
more is the time required to produce the
transformation. An unusually large password
may consume considerable amount of time... |
flatpak_dir_get_user (void)
{
g_autoptr(GFile) path = flatpak_get_user_base_dir_location ();
return flatpak_dir_new (path, TRUE);
} | 0 | [
"CWE-668"
] | flatpak | cd2142888fc4c199723a0dfca1f15ea8788a5483 | 110,883,890,347,644,630,000,000,000,000,000,000,000 | 5 | Don't expose /proc when running apply_extra
As shown by CVE-2019-5736, it is sometimes possible for the sandbox
app to access outside files using /proc/self/exe. This is not
typically an issue for flatpak as the sandbox runs as the user which
has no permissions to e.g. modify the host files.
However, when installing ... |
static void floppy_send(uint8_t byte)
{
uint8_t msr;
msr = inb(FLOPPY_BASE + reg_msr);
assert_bit_set(msr, RQM);
assert_bit_clear(msr, DIO);
outb(FLOPPY_BASE + reg_fifo, byte);
} | 0 | [
"CWE-787"
] | qemu | 46609b90d9e3a6304def11038a76b58ff43f77bc | 317,586,544,094,019,240,000,000,000,000,000,000,000 | 10 | tests/qtest/fdc-test: Add a regression test for CVE-2021-3507
Add the reproducer from https://gitlab.com/qemu-project/qemu/-/issues/339
Without the previous commit, when running 'make check-qtest-i386'
with QEMU configured with '--enable-sanitizers' we get:
==4028352==ERROR: AddressSanitizer: heap-buffer-overflow ... |
gerbv_gdk_draw_amacro(GdkPixmap *pixmap, GdkGC *gc,
gerbv_simplified_amacro_t *s, double scale,
gint x, gint y)
{
dprintf("%s(): drawing simplified aperture macros:\n", __func__);
while (s != NULL) {
if (s->type >= GERBV_APTYPE_MACRO_CIRCLE
&& s->type <= GERBV_APTYPE_MACRO_LINE22) {
dgk_dra... | 0 | [
"CWE-703"
] | gerbv | b2c2f8da851f2ac8079a91ce9d498d87ff96abcf | 112,810,628,848,759,010,000,000,000,000,000,000,000 | 21 | Avoid direct access on array of unknown size
Be requiring a `gerbv_simplified_amacro_t` the `dgk_draw_amacro_funcs` can be sure of the length of the parameter array. |
int ClientHandler::read_tls() {
auto should_break = false;
ERR_clear_error();
rb_.ensure_chunk();
for (;;) {
// we should process buffered data first before we read EOF.
if (rb_.rleft() && on_read() != 0) {
return -1;
}
if (rb_.rleft() == 0) {
rb_.reset();
} else if (rb_.wleft... | 0 | [] | nghttp2 | 95efb3e19d174354ca50c65d5d7227d92bcd60e1 | 32,195,700,055,537,800,000,000,000,000,000,000,000 | 40 | Don't read too greedily |
static bool is_marantz_denon_dac(unsigned int id)
{
switch (id) {
case USB_ID(0x154e, 0x1003): /* Denon DA-300USB */
case USB_ID(0x154e, 0x3005): /* Marantz HD-DAC1 */
case USB_ID(0x154e, 0x3006): /* Marantz SA-14S1 */
return true;
}
return false;
} | 0 | [] | sound | 0f886ca12765d20124bd06291c82951fd49a33be | 143,799,535,524,742,210,000,000,000,000,000,000,000 | 10 | ALSA: usb-audio: Fix NULL dereference in create_fixed_stream_quirk()
create_fixed_stream_quirk() may cause a NULL-pointer dereference by
accessing the non-existing endpoint when a USB device with a malformed
USB descriptor is used.
This patch avoids it simply by adding a sanity check of bNumEndpoints
before the acces... |
void InstanceKlass::deallocate_record_components(ClassLoaderData* loader_data,
Array<RecordComponent*>* record_components) {
if (record_components != NULL && !record_components->is_shared()) {
for (int i = 0; i < record_components->length(); i++) {
RecordComp... | 0 | [] | jdk17u | f8eb9abe034f7c6bea4da05a9ea42017b3f80730 | 6,317,183,011,195,568,000,000,000,000,000,000,000 | 10 | 8270386: Better verification of scan methods
Reviewed-by: coleenp
Backport-of: ac329cef45979bd0159ecd1347e36f7129bb2ce4 |
static int ieee80211_frag_cache_invalidate(struct ieee80211_device *ieee,
struct ieee80211_hdr_4addr *hdr)
{
u16 sc;
unsigned int seq;
struct ieee80211_frag_entry *entry;
sc = le16_to_cpu(hdr->seq_ctl);
seq = WLAN_GET_SEQ_SEQ(sc);
entry = ieee80211_frag_cache_find(ieee, seq, -1, hdr->addr2,
hdr->... | 0 | [
"CWE-189"
] | linux-2.6 | 04045f98e0457aba7d4e6736f37eed189c48a5f7 | 207,385,287,163,947,700,000,000,000,000,000,000,000 | 22 | [IEEE80211]: avoid integer underflow for runt rx frames
Reported by Chris Evans <scarybeasts@gmail.com>:
> The summary is that an evil 80211 frame can crash out a victim's
> machine. It only applies to drivers using the 80211 wireless code, and
> only then to certain drivers (and even then depends on a card's
> firmw... |
void Gfx::doForm1(Object *str, Dict *resDict, double *matrix, double *bbox,
GBool transpGroup, GBool softMask,
GfxColorSpace *blendingColorSpace,
GBool isolated, GBool knockout,
GBool alpha, Function *transferFunc,
GfxColor *backdropColor) {
Parser *oldParser;
double oldBaseMatrix[6];
int i;
... | 0 | [] | poppler | abf167af8b15e5f3b510275ce619e6fdb42edd40 | 283,084,565,196,499,670,000,000,000,000,000,000,000 | 104 | Implement tiling/patterns in SplashOutputDev
Fixes bug 13518 |
static unsigned int x25_new_lci(struct x25_neigh *nb)
{
unsigned int lci = 1;
struct sock *sk;
read_lock_bh(&x25_list_lock);
while ((sk = __x25_find_socket(lci, nb)) != NULL) {
sock_put(sk);
if (++lci == 4096) {
lci = 0;
break;
}
}
read_unlock_bh(&x25_list_lock);
return lci;
} | 0 | [
"CWE-20",
"CWE-269"
] | linux | f3d3342602f8bcbf37d7c46641cb9bca7618eb1c | 236,793,958,532,706,130,000,000,000,000,000,000,000 | 18 | net: rework recvmsg handler msg_name and msg_namelen logic
This patch now always passes msg->msg_namelen as 0. recvmsg handlers must
set msg_namelen to the proper size <= sizeof(struct sockaddr_storage)
to return msg_name to the user.
This prevents numerous uninitialized memory leaks we had in the
recvmsg handlers an... |
BOOL update_bounds_equals(rdpBounds* bounds1, rdpBounds* bounds2)
{
if ((bounds1->left == bounds2->left) && (bounds1->top == bounds2->top) &&
(bounds1->right == bounds2->right) && (bounds1->bottom == bounds2->bottom))
return TRUE;
return FALSE;
} | 0 | [
"CWE-119",
"CWE-787"
] | FreeRDP | 445a5a42c500ceb80f8fa7f2c11f3682538033f3 | 180,266,974,399,326,450,000,000,000,000,000,000,000 | 8 | Fixed CVE-2018-8786
Thanks to Eyal Itkin from Check Point Software Technologies. |
static void last_msg_destroy(GSList **list, LAST_MSG_REC *rec)
{
*list = g_slist_remove(*list, rec);
g_free(rec->nick);
g_free(rec);
} | 0 | [
"CWE-416"
] | irssi | 36564717c9f701e3a339da362ab46d220d27e0c1 | 322,802,129,564,132,740,000,000,000,000,000,000,000 | 7 | Merge branch 'security' into 'master'
Security
See merge request irssi/irssi!34
(cherry picked from commit b0d9cb33cd9ef9da7c331409e8b7c57a6f3aef3f) |
int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address)
{
pud_t *new = pud_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 */
pud_free(mm, new);
else
pgd_popu... | 0 | [
"CWE-20"
] | linux-2.6 | 89f5b7da2a6bad2e84670422ab8192382a5aeb9f | 129,132,179,697,246,720,000,000,000,000,000,000,000 | 16 | Reinstate ZERO_PAGE optimization in 'get_user_pages()' and fix XIP
KAMEZAWA Hiroyuki and Oleg Nesterov point out that since the commit
557ed1fa2620dc119adb86b34c614e152a629a80 ("remove ZERO_PAGE") removed
the ZERO_PAGE from the VM mappings, any users of get_user_pages() will
generally now populate the VM with real emp... |
ipvs_update_stats(virtual_server_t *vs)
{
element e, ge;
virtual_server_group_entry_t *vsg_entry;
uint32_t addr_ip;
uint16_t port;
union nf_inet_addr nfaddr;
unsigned i;
real_server_t *rs;
time_t time_now = time(NULL);
if (time_now - vs->lastupdated < STATS_REFRESH)
return;
vs->lastupdated = time_now;
/*... | 0 | [
"CWE-200"
] | keepalived | 26c8d6374db33bcfcdcd758b1282f12ceef4b94f | 53,418,451,246,413,580,000,000,000,000,000,000,000 | 63 | Disable fopen_safe() append mode by default
If a non privileged user creates /tmp/keepalived.log and has it open
for read (e.g. tail -f), then even though keepalived will change the
owner to root and remove all read/write permissions from non owners,
the application which already has the file open will be able to read... |
int snd_ctl_replace(struct snd_card *card, struct snd_kcontrol *kcontrol,
bool add_on_replace)
{
struct snd_ctl_elem_id id;
unsigned int count;
unsigned int idx;
struct snd_kcontrol *old;
int ret;
if (!kcontrol)
return -EINVAL;
if (snd_BUG_ON(!card || !kcontrol->info)) {
ret = -EINVAL;
goto error;
... | 0 | [
"CWE-190",
"CWE-189"
] | linux | ac902c112d90a89e59916f751c2745f4dbdbb4bd | 258,819,270,943,890,270,000,000,000,000,000,000,000 | 50 | ALSA: control: Handle numid overflow
Each control gets automatically assigned its numids when the control is created.
The allocation is done by incrementing the numid by the amount of allocated
numids per allocation. This means that excessive creation and destruction of
controls (e.g. via SNDRV_CTL_IOCTL_ELEM_ADD/REMO... |
tabstop_eq(int *ts1, int *ts2)
{
int t;
if ((ts1 == 0 && ts2) || (ts1 && ts2 == 0))
return FALSE;
if (ts1 == ts2)
return TRUE;
if (ts1[0] != ts2[0])
return FALSE;
for (t = 1; t <= ts1[0]; ++t)
if (ts1[t] != ts2[t])
return FALSE;
return TRUE;
} | 0 | [
"CWE-122"
] | vim | b7081e135a16091c93f6f5f7525a5c58fb7ca9f9 | 318,438,252,847,992,720,000,000,000,000,000,000,000 | 17 | patch 8.2.3402: invalid memory access when using :retab with large value
Problem: Invalid memory access when using :retab with large value.
Solution: Check the number is positive. |
static int amd_gpio_probe(struct platform_device *pdev)
{
int ret = 0;
int irq_base;
struct resource *res;
struct amd_gpio *gpio_dev;
gpio_dev = devm_kzalloc(&pdev->dev,
sizeof(struct amd_gpio), GFP_KERNEL);
if (!gpio_dev)
return -ENOMEM;
spin_lock_init(&gpio_dev->lock);
res = platform_get_resource(pde... | 1 | [
"CWE-415"
] | linux | 251e22abde21833b3d29577e4d8c7aaccd650eee | 131,029,323,376,865,200,000,000,000,000,000,000,000 | 98 | pinctrl: amd: Use devm_pinctrl_register() for pinctrl registration
Use devm_pinctrl_register() for pin control registration and clean
error path.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org> |
const char* PE_(bin_pe_get_authentihash)(RBinPEObj* pe) {
return pe->authentihash;
} | 0 | [
"CWE-400",
"CWE-703"
] | radare2 | 634b886e84a5c568d243e744becc6b3223e089cf | 249,991,768,014,581,600,000,000,000,000,000,000,000 | 3 | Fix DoS in PE/QNX/DYLDCACHE/PSX parsers ##crash
* Reported by lazymio
* Reproducer: AAA4AAAAAB4= |
normalized_cost(NCURSES_SP_DCLx const char *const cap, int affcnt)
/* compute the effective character-count for an operation (round up) */
{
int cost = NCURSES_SP_NAME(_nc_msec_cost) (NCURSES_SP_ARGx cap, affcnt);
if (cost != INFINITY)
cost = (cost + SP_PARM->_char_padding - 1) / SP_PARM->_char_padding;
re... | 0 | [] | ncurses | 790a85dbd4a81d5f5d8dd02a44d84f01512ef443 | 127,731,825,098,313,090,000,000,000,000,000,000,000 | 8 | ncurses 6.2 - patch 20200531
+ correct configure version-check/warnng for g++ to allow for 10.x
+ re-enable "bel" in konsole-base (report by Nia Huang)
+ add linux-s entry (patch by Alexandre Montaron).
+ drop long-obsolete convert_configure.pl
+ add test/test_parm.c, for checking tparm changes.
+ improve parameter-ch... |
template<typename t>
CImg<_cimg_Tt> get_cross(const CImg<t>& img) const {
return CImg<_cimg_Tt>(*this).cross(img); | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 255,334,783,289,442,540,000,000,000,000,000,000,000 | 3 | Fix other issues in 'CImg<T>::load_bmp()'. |
ctnetlink_exp_ct_dump_table(struct sk_buff *skb, struct netlink_callback *cb)
{
struct nf_conntrack_expect *exp, *last;
struct nfgenmsg *nfmsg = nlmsg_data(cb->nlh);
struct nf_conn *ct = cb->data;
struct nf_conn_help *help = nfct_help(ct);
u_int8_t l3proto = nfmsg->nfgen_family;
if (cb->args[0])
return 0;
rc... | 0 | [
"CWE-120"
] | linux | 1cc5ef91d2ff94d2bf2de3b3585423e8a1051cb6 | 91,793,342,576,259,670,000,000,000,000,000,000,000 | 44 | netfilter: ctnetlink: add a range check for l3/l4 protonum
The indexes to the nf_nat_l[34]protos arrays come from userspace. So
check the tuple's family, e.g. l3num, when creating the conntrack in
order to prevent an OOB memory access during setup. Here is an example
kernel panic on 4.14.180 when userspace passes in ... |
static int asn1_d2i_ex_primitive(ASN1_VALUE **pval,
const unsigned char **in, long inlen,
const ASN1_ITEM *it,
int tag, int aclass, char opt, ASN1_TLC *ctx)
{
int ret = 0, utype;
long plen;
char cst, inf, free... | 0 | [
"CWE-476"
] | openssl | 43a7033a010feaf72c79d39df65ca733fb9dcd4c | 262,481,201,208,946,400,000,000,000,000,000,000,000 | 130 | Check that multi-strings/CHOICE types don't use implicit tagging
It never makes sense for multi-string or CHOICE types to use implicit
tagging since the content would be ambiguous. It is an error in the
template if this ever happens. If we detect it we should stop parsing.
Thanks to David Benjamin from Google for rep... |
void Field::error_generated_column_function_is_not_allowed(THD *thd,
bool error) const
{
StringBuffer<64> tmp;
vcol_info->expr->print(&tmp, (enum_query_type)
(QT_TO_SYSTEM_CHARSET |
QT_ITEM_IDEN... | 0 | [
"CWE-120"
] | server | eca207c46293bc72dd8d0d5622153fab4d3fccf1 | 306,724,233,404,095,970,000,000,000,000,000,000,000 | 13 | MDEV-25317 Assertion `scale <= precision' failed in decimal_bin_size And Assertion `scale >= 0 && precision > 0 && scale <= precision' failed in decimal_bin_size_inline/decimal_bin_size.
Precision should be kept below DECIMAL_MAX_SCALE for computations.
It can be bigger in Item_decimal. I'd fix this too but it changes... |
max3421_remove(struct spi_device *spi)
{
struct max3421_hcd *max3421_hcd = NULL, **prev;
struct usb_hcd *hcd = NULL;
unsigned long flags;
for (prev = &max3421_hcd_list; *prev; prev = &(*prev)->next) {
max3421_hcd = *prev;
hcd = max3421_to_hcd(max3421_hcd);
if (hcd->self.controller == &spi->dev)
break;
}
... | 0 | [
"CWE-416"
] | linux | b5fdf5c6e6bee35837e160c00ac89327bdad031b | 32,969,171,668,803,690,000,000,000,000,000,000,000 | 32 | usb: max-3421: Prevent corruption of freed memory
The MAX-3421 USB driver remembers the state of the USB toggles for a
device/endpoint. To save SPI writes, this was only done when a new
device/endpoint was being used. Unfortunately, if the old device was
removed, this would cause writes to freed memory.
To fix this, ... |
rfbBool rfbSendRectEncodingZRLE(rfbClientPtr cl, int x, int y, int w, int h)
{
zrleOutStream* zos;
rfbFramebufferUpdateRectHeader rect;
rfbZRLEHeader hdr;
int i;
char *zrleBeforeBuf;
if (cl->zrleBeforeBuf == NULL) {
cl->zrleBeforeBuf = (char *) malloc(rfbZRLETileWidth * rfbZRLETileHeight * 4 + 4);
}
z... | 0 | [] | libvncserver | 804335f9d296440bb708ca844f5d89b58b50b0c6 | 18,899,816,140,621,763,000,000,000,000,000,000,000 | 134 | Thread safety for zrle, zlib, tight.
Proposed tight security type fix for debian bug 517422. |
static bool pickoneauth(struct auth *pick, unsigned long mask)
{
bool picked;
/* only deal with authentication we want */
unsigned long avail = pick->avail & pick->want & mask;
picked = TRUE;
/* The order of these checks is highly relevant, as this will be the order
of preference in case of the existenc... | 0 | [] | curl | 48d7064a49148f03942380967da739dcde1cdc24 | 258,674,322,415,078,640,000,000,000,000,000,000,000 | 31 | cookie: apply limits
- Send no more than 150 cookies per request
- Cap the max length used for a cookie: header to 8K
- Cap the max number of received Set-Cookie: headers to 50
Bug: https://curl.se/docs/CVE-2022-32205.html
CVE-2022-32205
Reported-by: Harry Sintonen
Closes #9048 |
check_type_tree(Node* node, int type_mask, int enclose_mask, int anchor_mask)
{
int type, r = 0;
type = NTYPE(node);
if ((NTYPE2BIT(type) & type_mask) == 0)
return 1;
switch (type) {
case NT_LIST:
case NT_ALT:
do {
r = check_type_tree(NCAR(node), type_mask, enclose_mask,
anchor_mask);
... | 0 | [
"CWE-125"
] | php-src | c6e34d91b88638966662caac62c4d0e90538e317 | 169,035,472,527,649,000,000,000,000,000,000,000,000 | 47 | Fix bug #77371 (heap buffer overflow in mb regex functions - compile_string_node) |
void CascadeClassifierImpl::detectMultiScale( InputArray _image, std::vector<Rect>& objects,
std::vector<int>& numDetections, double scaleFactor,
int minNeighbors, int flags, Size minObjectSize,
... | 0 | [
"CWE-125"
] | opencv | 321c74ccd6077bdea1d47450ca4fe955cb5b6330 | 279,845,410,008,067,670,000,000,000,000,000,000,000 | 30 | objdetect: validate feature rectangle on reading |
_asn1_extract_tag_der (asn1_node node, const unsigned char *der, int der_len,
int *tag_len, int *inner_tag_len, unsigned flags)
{
asn1_node p;
int counter, len2, len3, is_tag_implicit;
int result;
unsigned long tag, tag_implicit = 0;
unsigned char class, class2, class_implicit = 0;
if (der_len <= ... | 0 | [
"CWE-399"
] | libtasn1 | f435825c0f527a8e52e6ffbc3ad0bc60531d537e | 233,258,950,324,480,120,000,000,000,000,000,000,000 | 182 | _asn1_extract_der_octet: catch invalid input cases early
That is, check the calculated lengths for validity prior
to entering a loop. This avoids an infinite recursion.
Reported by Pascal Cuoq. |
static void theme_read_formats(THEME_REC *theme, const char *module,
CONFIG_REC *config, MODULE_THEME_REC *rec)
{
CONFIG_NODE *node;
GSList *tmp;
node = config_node_traverse(config, "formats", FALSE);
if (node == NULL) return;
node = config_node_section(node, module, -1);
if (node == NULL) return;
fo... | 0 | [
"CWE-125"
] | irssi | e0c66e31224894674356ddaf6d46016c1abc994f | 60,815,689,868,150,120,000,000,000,000,000,000,000 | 20 | Previous theme patch fixes by c0ffee
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3058 dbcabf3a-b0e7-0310-adc4-f8d773084564 |
compare_routerinfo_by_ip_and_bw_(const void **a, const void **b)
{
routerinfo_t *first = *(routerinfo_t **)a, *second = *(routerinfo_t **)b;
int first_is_auth, second_is_auth;
uint32_t bw_kb_first, bw_kb_second;
const node_t *node_first, *node_second;
int first_is_running, second_is_running;
/* we return -... | 0 | [] | tor | 02e05bd74dbec614397b696cfcda6525562a4675 | 157,239,000,265,761,200,000,000,000,000,000,000,000 | 53 | When examining descriptors as a dirserver, reject ones with bad versions
This is an extra fix for bug 21278: it ensures that these
descriptors and platforms will never be listed in a legit consensus. |
static struct disk_exception *get_exception(struct pstore *ps, uint32_t index)
{
BUG_ON(index >= ps->exceptions_per_area);
return ((struct disk_exception *) ps->area) + index;
} | 0 | [
"CWE-200",
"CWE-264"
] | linux | e9c6a182649f4259db704ae15a91ac820e63b0ca | 37,301,327,363,942,725,000,000,000,000,000,000,000 | 6 | 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... |
/** Get or create the named queue. */
queue_t* queues_get(queues_t *qs, const char* name) {
queue_t *q;
pthread_mutex_lock(&qs->lock);
for (q = qs->queues; q && strcmp(q->name, name) != 0; q = q->next)
;
if (!q) {
q = (queue_t*)malloc(sizeof(queue_t));
queue_init(q, name, qs->queues);
qs->queues... | 0 | [] | qpid-proton | 159fac1f90d9b1ace1138d510176e7a5da54e9e9 | 287,941,983,291,120,580,000,000,000,000,000,000,000 | 13 | PROTON-2014: [c] Fix example broker to warn when it fails to set up ssl
- Also make send-ssl tell you the remote peer |
static void request_status_string(VTermState *state, const char *command, size_t cmdlen)
{
if(cmdlen == 1)
switch(command[0]) {
case 'm': // Query SGR
{
long args[20];
int argc = vterm_state_getpen(state, args, sizeof(args)/sizeof(args[0]));
int argi;
vterm_push_outp... | 0 | [
"CWE-476"
] | vim | cd929f7ba8cc5b6d6dcf35c8b34124e969fed6b8 | 232,274,495,701,256,940,000,000,000,000,000,000,000 | 49 | patch 8.1.0633: crash when out of memory while opening a terminal window
Problem: Crash when out of memory while opening a terminal window.
Solution: Handle out-of-memory more gracefully. |
pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
{
return _do_fork(flags|CLONE_VM|CLONE_UNTRACED, (unsigned long)fn,
(unsigned long)arg, NULL, NULL, 0);
} | 0 | [
"CWE-416",
"CWE-703"
] | linux | 2b7e8665b4ff51c034c55df3cff76518d1a9ee3a | 117,107,414,915,799,400,000,000,000,000,000,000,000 | 5 | fork: fix incorrect fput of ->exe_file causing use-after-free
Commit 7c051267931a ("mm, fork: make dup_mmap wait for mmap_sem for
write killable") made it possible to kill a forking task while it is
waiting to acquire its ->mmap_sem for write, in dup_mmap().
However, it was overlooked that this introduced an new erro... |
filesystem_info_start (NautilusDirectory *directory,
NautilusFile *file,
gboolean *doing_io)
{
GFile *location;
FilesystemInfoState *state;
if (directory->details->filesystem_info_state != NULL)
{
*doing_io = TRUE;
return;
... | 0 | [
"CWE-20"
] | nautilus | 1630f53481f445ada0a455e9979236d31a8d3bb0 | 163,364,020,921,344,140,000,000,000,000,000,000,000 | 45 | 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... |
static void namespace_unlock(void)
{
struct mount *mnt;
struct hlist_head head = unmounted;
if (likely(hlist_empty(&head))) {
up_write(&namespace_sem);
return;
}
head.first->pprev = &head.first;
INIT_HLIST_HEAD(&unmounted);
up_write(&namespace_sem);
synchronize_rcu();
while (!hlist_empty(&head)) {
m... | 0 | [
"CWE-269"
] | user-namespace | a6138db815df5ee542d848318e5dae681590fccd | 41,119,491,469,773,690,000,000,000,000,000,000,000 | 25 | mnt: Only change user settable mount flags in remount
Kenton Varda <kenton@sandstorm.io> discovered that by remounting a
read-only bind mount read-only in a user namespace the
MNT_LOCK_READONLY bit would be cleared, allowing an unprivileged user
to the remount a read-only mount read-write.
Correct this by replacing t... |
static int get_next_char(void)
{
int c;
FILE *f;
c = '\n';
if ((f = config_file) != NULL) {
c = fgetc(f);
if (c == '\r') {
/* DOS like systems */
c = fgetc(f);
if (c != '\n') {
ungetc(c, f);
c = '\r';
}
}
if (c == '\n')
config_linenr++;
if (c == EOF) {
config_file_eof = 1;
c ... | 0 | [
"CWE-94"
] | linux | aba8d056078e47350d85b06a9cabd5afcc4b72ea | 303,176,750,384,998,550,000,000,000,000,000,000,000 | 25 | perf tools: do not look at ./config for configuration
In addition to /etc/perfconfig and $HOME/.perfconfig, perf looks for
configuration in the file ./config, imitating git which looks at
$GIT_DIR/config. If ./config is not a perf configuration file, it
fails, or worse, treats it as a configuration file and changes b... |
char *Curl_formpostheader(void *formp, size_t *len)
{
char *header;
struct Form *form=(struct Form *)formp;
if(!form->data)
return 0; /* nothing, ERROR! */
header = form->data->line;
*len = form->data->length;
form->data = form->data->next; /* advance */
return header;
} | 0 | [
"CWE-200"
] | curl | b3875606925536f82fc61f3114ac42f29eaf6945 | 20,735,702,547,518,055,000,000,000,000,000,000,000 | 15 | curl_easy_duphandle: CURLOPT_COPYPOSTFIELDS read out of bounds
When duplicating a handle, the data to post was duplicated using
strdup() when it could be binary and contain zeroes and it was not even
zero terminated! This caused read out of bounds crashes/segfaults.
Since the lib/strdup.c file no longer is easily sha... |
http_GetHdrField(const struct http *hp, const char *hdr,
const char *field, char **ptr)
{
char *h;
int i;
if (ptr != NULL)
*ptr = NULL;
h = NULL;
i = http_GetHdrData(hp, hdr, field, &h);
if (!i)
return (i);
if (ptr != NULL && h != NULL) {
/* Skip whitespace, looking for '=' */
while (*h && vct_iss... | 0 | [] | Varnish-Cache | 29870c8fe95e4e8a672f6f28c5fbe692bea09e9c | 155,452,538,266,485,180,000,000,000,000,000,000,000 | 27 | Check for duplicate Content-Length headers in requests
If a duplicate CL header is in the request, we fail the request with a
400 (Bad Request)
Fix a test case that was sending duplicate CL by misstake and would
not fail because of that. |
void RGWAsioFrontend::unpause_with_new_config(
rgw::sal::RGWRadosStore* const store,
rgw_auth_registry_ptr_t auth_registry
) {
impl->unpause(store, std::move(auth_registry));
} | 0 | [
"CWE-400"
] | ceph | ff72c50a2c43c57aead933eb4903ad1ca6d1748a | 50,176,206,853,334,650,000,000,000,000,000,000,000 | 6 | rgw: improve beast
Avoid leaking connections that had partially-consumed
client data on unexpected disconnect.
Resolves CVE-2020-1700 (moderate impact flaw).
Fixes: https://tracker.ceph.com/issues/42531
Signed-off-by: Or Friedmann <ofriedma@redhat.com>
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com> |
_run_spank_job_script (const char *mode, char **env, uint32_t job_id, uid_t uid)
{
pid_t cpid;
int status = 0, timeout;
int pfds[2];
if (pipe (pfds) < 0) {
error ("_run_spank_job_script: pipe: %m");
return (-1);
}
fd_set_close_on_exec (pfds[1]);
debug ("Calling %s spank %s", conf->stepd_loc, mode);
if ((... | 0 | [
"CWE-20"
] | slurm | df545955e4f119974c278bff0c47155257d5afc7 | 154,643,669,807,450,600,000,000,000,000,000,000,000 | 69 | Validate gid and user_name values provided to slurmd up front.
Do not defer until later, and do not potentially miss out on proper
validation of the user_name field which can lead to improper authentication
handling.
CVE-2018-10995. |
void add_interrupt_randomness(int irq, int irq_flags)
{
struct entropy_store *r;
struct fast_pool *fast_pool = this_cpu_ptr(&irq_randomness);
struct pt_regs *regs = get_irq_regs();
unsigned long now = jiffies;
cycles_t cycles = random_get_entropy();
__u32 c_high, j_high;
__u64 ip;
unsigned long seed;
i... | 1 | [
"CWE-200",
"CWE-330"
] | linux | f227e3ec3b5cad859ad15666874405e8c1bbc1d4 | 93,078,228,868,817,230,000,000,000,000,000,000,000 | 64 | random32: update the net random state on interrupt and activity
This modifies the first 32 bits out of the 128 bits of a random CPU's
net_rand_state on interrupt or CPU activity to complicate remote
observations that could lead to guessing the network RNG's internal
state.
Note that depending on some network devices'... |
static GuestDiskAddressList *build_guest_disk_info(char *guid, Error **errp)
{
GuestDiskAddressList *list = NULL;
GuestDiskAddress *disk;
SCSI_ADDRESS addr, *scsi_ad;
DWORD len;
int bus;
HANDLE vol_h;
scsi_ad = &addr;
char *name = g_strndup(guid, strlen(guid)-1);
vol_h = CreateFile... | 0 | [
"CWE-190"
] | qemu | 141b197408ab398c4f474ac1a728ab316e921f2b | 129,514,589,664,285,100,000,000,000,000,000,000,000 | 57 | qga: check bytes count read by guest-file-read
While reading file content via 'guest-file-read' command,
'qmp_guest_file_read' routine allocates buffer of count+1
bytes. It could overflow for large values of 'count'.
Add check to avoid it.
Reported-by: Fakhri Zulkifli <mohdfakhrizulkifli@gmail.com>
Signed-off-by: Pra... |
void nntp_buffy(char *buf, size_t len)
{
for (unsigned int i = 0; i < CurrentNewsSrv->groups_num; i++)
{
struct NntpData *nntp_data = CurrentNewsSrv->groups_list[i];
if (!nntp_data || !nntp_data->subscribed || !nntp_data->unread)
continue;
if (Context && Context->magic == MUTT_NNTP &&
(m... | 0 | [
"CWE-119",
"CWE-787"
] | neomutt | 6296f7153f0c9d5e5cd3aaf08f9731e56621bdd3 | 288,665,612,170,306,100,000,000,000,000,000,000,000 | 24 | Set length modifiers for group and desc
nntp_add_group parses a line controlled by the connected nntp server.
Restrict the maximum lengths read into the stack buffers group, and
desc. |
print_options(printer, arg)
printer_func printer;
void *arg;
{
struct option_list *list;
int i;
printer(arg, "pppd options in effect:\n");
print_option_list(general_options, printer, arg);
print_option_list(auth_options, printer, arg);
for (list = extra_options; list != NULL; list = list->next)
print_o... | 0 | [
"CWE-415",
"CWE-119"
] | ppp | 7658e8257183f062dc01f87969c140707c7e52cb | 217,444,080,931,377,600,000,000,000,000,000,000,000 | 16 | pppd: Eliminate potential integer overflow in option parsing
When we are reading in a word from an options file, we maintain a count
of the length we have seen so far in 'len', which is an int. When len
exceeds MAXWORDLEN - 1 (i.e. 1023) we cease storing characters in the
buffer but we continue to increment len. Sin... |
int remove_memory(u64 start, u64 size)
{
return -EINVAL;
} | 0 | [] | linux-2.6 | 08dff7b7d629807dbb1f398c68dd9cd58dd657a1 | 240,857,181,948,578,370,000,000,000,000,000,000,000 | 4 | mm/hotplug: correctly add new zone to all other nodes' zone lists
When online_pages() is called to add new memory to an empty zone, it
rebuilds all zone lists by calling build_all_zonelists(). But there's a
bug which prevents the new zone to be added to other nodes' zone lists.
online_pages() {
build_all_zonelists(... |
print_r2p_datarate (const unsigned char *msg, size_t msglen)
{
print_r2p_header ("RDR_to_PC_DataRate", msg, msglen);
if (msglen < 10)
return;
if (msglen >= 18)
{
printf (" dwClockFrequency ..: %u\n", convert_le_u32 (msg+10));
printf (" dwDataRate ..... ..: %u\n", convert_le_u32 (msg+14));
... | 0 | [
"CWE-20"
] | gnupg | 2183683bd633818dd031b090b5530951de76f392 | 16,804,330,068,165,362,000,000,000,000,000,000,000 | 14 | Use inline functions to convert buffer data to scalars.
* common/host2net.h (buf16_to_ulong, buf16_to_uint): New.
(buf16_to_ushort, buf16_to_u16): New.
(buf32_to_size_t, buf32_to_ulong, buf32_to_uint, buf32_to_u32): New.
--
Commit 91b826a38880fd8a989318585eb502582636ddd8 was not enough to
avoid all sign extension on ... |
uint64_t yang_dnode_get_uint64(const struct lyd_node *dnode,
const char *xpath_fmt, ...)
{
const struct lyd_value *dvalue;
dvalue = YANG_DNODE_XPATH_GET_VALUE(dnode, xpath_fmt);
assert(dvalue->realtype->basetype == LY_TYPE_UINT64);
return dvalue->uint64;
} | 0 | [
"CWE-119",
"CWE-787"
] | frr | ac3133450de12ba86c051265fc0f1b12bc57b40c | 184,601,315,541,852,200,000,000,000,000,000,000,000 | 8 | isisd: fix #10505 using base64 encoding
Using base64 instead of the raw string to encode
the binary data.
Signed-off-by: whichbug <whichbug@github.com> |
static pfunc stream_token(struct jv_parser* p, char ch) {
jv_kind k;
jv last;
switch (ch) {
case '[':
if (jv_is_valid(p->next))
return "Expected a separator between values";
p->path = jv_array_append(p->path, jv_number(0)); // push
p->last_seen = JV_LAST_OPEN_ARRAY;
p->stacklen++;
bre... | 0 | [
"CWE-119",
"CWE-787"
] | jq | 8eb1367ca44e772963e704a700ef72ae2e12babd | 267,925,752,669,523,050,000,000,000,000,000,000,000 | 153 | Heap buffer overflow in tokenadd() (fix #105)
This was an off-by one: the NUL terminator byte was not allocated on
resize. This was triggered by JSON-encoded numbers longer than 256
bytes. |
int md_check_no_bitmap(struct mddev *mddev)
{
if (!mddev->bitmap_info.file && !mddev->bitmap_info.offset)
return 0;
printk(KERN_ERR "%s: bitmaps are not supported for %s\n",
mdname(mddev), mddev->pers->name);
return 1;
} | 0 | [
"CWE-200"
] | linux | b6878d9e03043695dbf3fa1caa6dfc09db225b16 | 99,968,432,218,192,250,000,000,000,000,000,000,000 | 8 | md: use kzalloc() when bitmap is disabled
In drivers/md/md.c get_bitmap_file() uses kmalloc() for creating a
mdu_bitmap_file_t called "file".
5769 file = kmalloc(sizeof(*file), GFP_NOIO);
5770 if (!file)
5771 return -ENOMEM;
This structure is copied to user space at the end of the fun... |
ofpact_is_apply_actions(const struct ofpact *a, enum ofp_version version)
{
return (ovs_instruction_type_from_ofpact_type(a->type, version)
== OVSINST_OFPIT11_APPLY_ACTIONS);
} | 0 | [
"CWE-416"
] | ovs | 77cccc74deede443e8b9102299efc869a52b65b2 | 205,692,067,667,086,660,000,000,000,000,000,000,000 | 5 | ofp-actions: Fix use-after-free while decoding RAW_ENCAP.
While decoding RAW_ENCAP action, decode_ed_prop() might re-allocate
ofpbuf if there is no enough space left. However, function
'decode_NXAST_RAW_ENCAP' continues to use old pointer to 'encap'
structure leading to write-after-free and incorrect decoding.
==3... |
void Field::register_field_in_read_map()
{
if (vcol_info)
{
Item *vcol_item= vcol_info->expr;
vcol_item->walk(&Item::register_field_in_read_map, 1, 0);
}
bitmap_set_bit(table->read_set, field_index);
} | 0 | [
"CWE-416",
"CWE-703"
] | server | 08c7ab404f69d9c4ca6ca7a9cf7eec74c804f917 | 266,753,866,979,086,830,000,000,000,000,000,000,000 | 9 | MDEV-24176 Server crashes after insert in the table with virtual
column generated using date_format() and if()
vcol_info->expr is allocated on expr_arena at parsing stage. Since
expr item is allocated on expr_arena all its containee items must be
allocated on expr_arena too. Otherwise fix_session_expr() will
encounter... |
Item_cache_int(): Item_cache(),
value(0) {} | 0 | [] | mysql-server | f7316aa0c9a3909fc7498e7b95d5d3af044a7e21 | 18,801,621,394,093,636,000,000,000,000,000,000,000 | 2 | Bug#26361149 MYSQL SERVER CRASHES AT: COL IN(IFNULL(CONST,
COL), NAME_CONST('NAME', NULL))
Backport of Bug#19143243 fix.
NAME_CONST item can return NULL_ITEM type in case of incorrect arguments.
NULL_ITEM has special processing in Item_func_in function.
In Item_func_in::fix_length_and_dec an a... |
MOBI_RET mobi_xml_write_dcmeta_creator(xmlTextWriterPtr writer, const OPFcreator **creator, const char *name) {
if (creator) {
size_t i = 0;
while (i < OPF_META_MAX_TAGS) {
if (creator[i] == NULL || creator[i]->value == NULL) {
break;
}
int xml_ret... | 0 | [
"CWE-476"
] | libmobi | c0699c8693c47f14a2e57dec7292e862ac7adf9c | 329,122,155,893,264,100,000,000,000,000,000,000,000 | 42 | Fix undefined behavior when passing null to strdup |
int gfn_to_page_many_atomic(struct kvm_memory_slot *slot, gfn_t gfn,
struct page **pages, int nr_pages)
{
unsigned long addr;
gfn_t entry = 0;
addr = gfn_to_hva_many(slot, gfn, &entry);
if (kvm_is_error_hva(addr))
return -1;
if (entry < nr_pages)
return 0;
return get_user_pages_fast_only(addr, nr_pa... | 0 | [
"CWE-401"
] | linux | f65886606c2d3b562716de030706dfe1bea4ed5e | 139,724,882,862,081,400,000,000,000,000,000,000,000 | 15 | KVM: fix memory leak in kvm_io_bus_unregister_dev()
when kmalloc() fails in kvm_io_bus_unregister_dev(), before removing
the bus, we should iterate over all other devices linked to it and call
kvm_iodevice_destructor() for them
Fixes: 90db10434b16 ("KVM: kvm_io_bus_unregister_dev() should never fail")
Cc: stable@vger... |
void MonCapGrant::expand_profile_mon(const EntityName& name) const
{
if (profile == "mon") {
profile_grants.push_back(MonCapGrant("mon", MON_CAP_ALL));
profile_grants.push_back(MonCapGrant("log", MON_CAP_ALL));
}
if (profile == "osd") {
profile_grants.push_back(MonCapGrant("osd", MON_CAP_ALL));
pr... | 0 | [
"CWE-285"
] | ceph | a2acedd2a7e12d58af6db35edbd8a9d29c557578 | 21,815,122,520,579,630,000,000,000,000,000,000,000 | 128 | mon/config-key: limit caps allowed to access the store
Henceforth, we'll require explicit `allow` caps for commands, or for the
config-key service. Blanket caps are no longer allowed for the
config-key service, except for 'allow *'.
(for luminous and mimic, we're also ensuring MonCap's parser is able to
understand fo... |
static void __exit ib_uverbs_cleanup(void)
{
ib_unregister_client(&uverbs_client);
class_destroy(uverbs_class);
unregister_chrdev_region(IB_UVERBS_BASE_DEV, IB_UVERBS_MAX_DEVICES);
if (overflow_maj)
unregister_chrdev_region(overflow_maj, IB_UVERBS_MAX_DEVICES);
idr_destroy(&ib_uverbs_pd_idr);
idr_destroy(&ib_uv... | 0 | [
"CWE-284",
"CWE-264"
] | linux | e6bd18f57aad1a2d1ef40e646d03ed0f2515c9e3 | 171,791,075,105,981,740,000,000,000,000,000,000,000 | 15 | IB/security: Restrict use of the write() interface
The drivers/infiniband stack uses write() as a replacement for
bi-directional ioctl(). This is not safe. There are ways to
trigger write calls that result in the return structure that
is normally written to user space being shunted off to user
specified kernel memory... |
static struct sk_buff * pfkey_xfrm_policy2msg_prep(const struct xfrm_policy *xp)
{
struct sk_buff *skb;
int size;
size = pfkey_xfrm_policy2msg_size(xp);
skb = alloc_skb(size + 16, GFP_ATOMIC);
if (skb == NULL)
return ERR_PTR(-ENOBUFS);
return skb;
} | 0 | [] | linux | 096f41d3a8fcbb8dde7f71379b1ca85fe213eded | 198,749,077,392,719,500,000,000,000,000,000,000,000 | 13 | af_key: Fix sadb_x_ipsecrequest parsing
The parsing of sadb_x_ipsecrequest is broken in a number of ways.
First of all we're not verifying sadb_x_ipsecrequest_len. This
is needed when the structure carries addresses at the end. Worse
we don't even look at the length when we parse those optional
addresses.
The migra... |
void Context::onLog() {
if (wasm_->onLog_) {
wasm_->onLog_(this, id_);
}
} | 1 | [
"CWE-476"
] | envoy | 8788a3cf255b647fd14e6b5e2585abaaedb28153 | 172,960,336,902,433,900,000,000,000,000,000,000,000 | 5 | 1.4 - Do not call into the VM unless the VM Context has been created. (#24)
* Ensure that the in VM Context is created before onDone is called.
Signed-off-by: John Plevyak <jplevyak@gmail.com>
* Update as per offline discussion.
Signed-off-by: John Plevyak <jplevyak@gmail.com>
* Set in_vm_context_created_ in onNet... |
TEST_F(Http1ServerConnectionImplTest, Http10MultipleResponses) {
initialize();
MockRequestDecoder decoder;
// Send a full HTTP/1.0 request and proxy a response.
{
Buffer::OwnedImpl buffer(
"GET /foobar HTTP/1.0\r\nHost: www.somewhere.com\r\nconnection: keep-alive\r\n\r\n");
Http::ResponseEncode... | 0 | [
"CWE-770"
] | envoy | 7ca28ff7d46454ae930e193d97b7d08156b1ba59 | 321,819,993,379,413,260,000,000,000,000,000,000,000 | 45 | [http1] Include request URL in request header size computation, and reject partial headers that exceed configured limits (#145)
Signed-off-by: antonio <avd@google.com> |
bool sort_and_filter_keyuse(THD *thd, DYNAMIC_ARRAY *keyuse,
bool skip_unprefixed_keyparts)
{
KEYUSE key_end, *prev, *save_pos, *use;
uint found_eq_constant, i;
DBUG_ASSERT(keyuse->elements);
my_qsort(keyuse->buffer, keyuse->elements, sizeof(KEYUSE),
(qsort_cmp) sort_key... | 0 | [] | server | ff77a09bda884fe6bf3917eb29b9d3a2f53f919b | 270,395,890,466,385,300,000,000,000,000,000,000,000 | 63 | MDEV-22464 Server crash on UPDATE with nested subquery
Uninitialized ref_pointer_array[] because setup_fields() got empty
fields list. mysql_multi_update() for some reason does that by
substituting the fields list with empty total_list for the
mysql_select() call (looks like wrong merge since total_list is not
used a... |
static void detach_db(annotate_db_t *prev, annotate_db_t *d)
{
if (prev)
prev->next = d->next;
else
all_dbs_head = d->next;
if (all_dbs_tail == d)
all_dbs_tail = prev;
} | 0 | [
"CWE-732"
] | cyrus-imapd | 621f9e41465b521399f691c241181300fab55995 | 309,174,698,299,505,070,000,000,000,000,000,000,000 | 9 | annotate: don't allow everyone to write shared server entries |
pk_transaction_authorize_actions (PkTransaction *transaction,
PkRoleEnum role,
GPtrArray *actions)
{
const gchar *action_id = NULL;
_cleanup_object_unref_ PolkitDetails *details = NULL;
_cleanup_free_ gchar *package_ids = NULL;
GString *string = NULL;
PkTransactionPrivate *priv = transaction->priv;
co... | 0 | [
"CWE-287"
] | PackageKit | f176976e24e8c17b80eff222572275517c16bdad | 319,926,576,721,918,120,000,000,000,000,000,000,000 | 109 | Reinstallation and downgrade require authorization
Added new policy actions:
* org.freedesktop.packagekit.package-reinstall
* org.freedesktop.packagekit.package-downgrade
The first does not depend or require any other actions to be authorized
except for org.freedesktop.packagekit.package-install-untrusted in case
o... |
dump_packet_and_trunc(u_char *user, const struct pcap_pkthdr *h, const u_char *sp)
{
struct dump_info *dump_info;
++packets_captured;
++infodelay;
dump_info = (struct dump_info *)user;
/*
* XXX - this won't force the file to rotate on the specified time
* boundary, but it will rotate on the first packet re... | 0 | [
"CWE-120",
"CWE-787"
] | tcpdump | 9ba91381954ad325ea4fd26b9c65a8bd9a2a85b6 | 25,407,067,830,352,807,000,000,000,000,000,000,000 | 200 | (for 4.9.3) CVE-2018-14879/fix -V to fail invalid input safely
get_next_file() did not check the return value of strlen() and
underflowed an array index if the line read by fgets() from the file
started with \0. This caused an out-of-bounds read and could cause a
write. Add the missing check.
This vulnerability was d... |
scan_env_add_mem_entry(ScanEnv* env)
{
int i, need, alloc;
Node** p;
need = env->num_mem + 1;
if (need > MaxCaptureNum && MaxCaptureNum != 0)
return ONIGERR_TOO_MANY_CAPTURES;
if (need >= SCANENV_MEMNODES_SIZE) {
if (env->mem_alloc <= need) {
if (IS_NULL(env->mem_nodes_dynamic)) {
allo... | 0 | [
"CWE-787"
] | oniguruma | f015fbdd95f76438cd86366467bb2b39870dd7c6 | 11,619,687,719,534,397,000,000,000,000,000,000,000 | 34 | fix #55 : Byte value expressed in octal must be smaller than 256 |
static WireType defaultValue() {
return nimble::NimbleType::STOP;
} | 0 | [
"CWE-703",
"CWE-770"
] | fbthrift | 3f156207e8a6583d88999487e954320dc18955e6 | 211,244,266,099,379,500,000,000,000,000,000,000,000 | 3 | Better handling of truncated data when reading containers
Summary:
Currently we read the container size and blindly pre-allocate the container of that size. This allows malicious attacker to send few bytes message and cause server to allocate GBs of memory.
This diff changes the logic to check if we have at least 1b/... |
static const char *set_timeout(cmd_parms *cmd, void *dummy, const char *arg)
{
const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE);
if (err != NULL) {
return err;
}
cmd->server->timeout = apr_time_from_sec(atoi(arg));
return NULL;
} | 0 | [
"CWE-416",
"CWE-284"
] | httpd | 4cc27823899e070268b906ca677ee838d07cf67a | 226,522,672,148,146,970,000,000,000,000,000,000,000 | 11 | 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 inline void slab_kernel_map(struct kmem_cache *cachep, void *objp,
int map, unsigned long caller) {} | 0 | [
"CWE-703"
] | linux | c4e490cf148e85ead0d1b1c2caaba833f1d5b29f | 178,497,011,301,131,230,000,000,000,000,000,000,000 | 2 | mm/slab.c: fix SLAB freelist randomization duplicate entries
This patch fixes a bug in the freelist randomization code. When a high
random number is used, the freelist will contain duplicate entries. It
will result in different allocations sharing the same chunk.
It will result in odd behaviours and crashes. It sh... |
void __init proc_caches_init(void)
{
unsigned int mm_size;
sighand_cachep = kmem_cache_create("sighand_cache",
sizeof(struct sighand_struct), 0,
SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_TYPESAFE_BY_RCU|
SLAB_ACCOUNT, sighand_ctor);
signal_cachep = kmem_cache_create("signal_cache",
sizeof(struct signal_struct)... | 0 | [
"CWE-362"
] | linux | 7b55851367136b1efd84d98fea81ba57a98304cf | 338,727,204,261,229,600,000,000,000,000,000,000,000 | 38 | fork: record start_time late
This changes the fork(2) syscall to record the process start_time after
initializing the basic task structure but still before making the new
process visible to user-space.
Technically, we could record the start_time anytime during fork(2). But
this might lead to scenarios where a start_... |
static CURLcode http_perhapsrewind(struct connectdata *conn)
{
struct SessionHandle *data = conn->data;
struct HTTP *http = data->req.protop;
curl_off_t bytessent;
curl_off_t expectsend = -1; /* default is unknown */
if(!http)
/* If this is still NULL, we have not reach very far and we can safely
... | 0 | [
"CWE-284"
] | curl | f78ae415d24b9bd89d6c121c556e411fdb21c6aa | 226,942,925,645,553,300,000,000,000,000,000,000,000 | 93 | Don't clear GSSAPI state between each exchange in the negotiation
GSSAPI doesn't work very well if we forget everything ever time.
XX: Is Curl_http_done() the right place to do the final cleanup? |
struct inode *ilookup5_nowait(struct super_block *sb, unsigned long hashval,
int (*test)(struct inode *, void *), void *data)
{
struct hlist_head *head = inode_hashtable + hash(sb, hashval);
struct inode *inode;
spin_lock(&inode_hash_lock);
inode = find_inode(sb, head, test, data);
spin_unlock(&inode_hash_lock)... | 0 | [
"CWE-269"
] | linux | 0fa3ecd87848c9c93c2c828ef4c3a8ca36ce46c7 | 249,914,955,980,124,360,000,000,000,000,000,000,000 | 12 | Fix up non-directory creation in SGID directories
sgid directories have special semantics, making newly created files in
the directory belong to the group of the directory, and newly created
subdirectories will also become sgid. This is historically used for
group-shared directories.
But group directories writable b... |
static char *get_first_line(char *txt)
{
char *t = xstrdup(txt);
char *p = strchr(t, '\n');
if (p)
*p = '\0';
return t;
} | 0 | [] | cgit | 1c581a072651524f3b0d91f33e22a42c4166dd96 | 297,526,489,994,003,900,000,000,000,000,000,000,000 | 8 | ui-blob: Do not accept mimetype from user |
static int do_stmt_execute(struct st_connection *cn)
{
/* The cn->stmt is already set. */
if (!cn->has_thread)
return mysql_stmt_execute(cn->stmt);
signal_connection_thd(cn, EMB_EXECUTE_STMT);
wait_query_thread_done(cn);
return cn->result;
} | 0 | [] | server | 01b39b7b0730102b88d8ea43ec719a75e9316a1e | 234,699,956,947,600,120,000,000,000,000,000,000,000 | 9 | mysqltest: don't eat new lines in --exec
pass them through as is |
Primitive() {
material = -1;
indices = -1;
mode = -1;
} | 0 | [
"CWE-20"
] | tinygltf | 52ff00a38447f06a17eab1caa2cf0730a119c751 | 84,866,894,282,553,610,000,000,000,000,000,000,000 | 5 | Do not expand file path since its not necessary for glTF asset path(URI) and for security reason(`wordexp`). |
ZEND_API void _zend_ts_hash_init(TsHashTable *ht, uint nSize, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC)
{
#ifdef ZTS
ht->mx_reader = tsrm_mutex_alloc();
ht->mx_writer = tsrm_mutex_alloc();
ht->reader = 0;
#endif
_zend_hash_init(TS_HASH(ht), nSize, pDestructor, persistent ZEND_FILE_LINE_RELAY_... | 0 | [] | php-src | 2bcf69d073190e4f032d883f3416dea1b027a39e | 189,385,079,433,615,240,000,000,000,000,000,000,000 | 9 | Fixed bug #68676 (Explicit Double Free) |
QPDFObjectHandle::assertInteger()
{
assertType("integer", isInteger());
} | 0 | [
"CWE-399",
"CWE-674"
] | qpdf | b4d6cf6836ce025ba1811b7bbec52680c7204223 | 6,480,457,300,596,484,000,000,000,000,000,000,000 | 4 | Limit depth of nesting in direct objects (fixes #202)
This fixes CVE-2018-9918. |
static void raw_close(struct sock *sk, long timeout)
{
/*
* Raw sockets may have direct kernel references. Kill them.
*/
rtnl_lock();
ip_ra_control(sk, 0, NULL);
rtnl_unlock();
sk_common_release(sk);
} | 0 | [
"CWE-362"
] | linux | 8f659a03a0ba9289b9aeb9b4470e6fb263d6f483 | 252,718,302,212,663,830,000,000,000,000,000,000,000 | 11 | net: ipv4: fix for a race condition in raw_sendmsg
inet->hdrincl is racy, and could lead to uninitialized stack pointer
usage, so its value should be read only once.
Fixes: c008ba5bdc9f ("ipv4: Avoid reading user iov twice after raw_probe_proto_opt")
Signed-off-by: Mohamed Ghannam <simo.ghannam@gmail.com>
Reviewed-by... |
static int mpls_nh_build(struct net *net, struct mpls_route *rt,
struct mpls_nh *nh, int oif, struct nlattr *via,
struct nlattr *newdst, u8 max_labels,
struct netlink_ext_ack *extack)
{
int err = -ENOMEM;
if (!nh)
goto errout;
if (newdst) {
err = nla_get_labels(newdst, max_labels, &nh->nh_labels,
... | 0 | [] | net | 6c8991f41546c3c472503dff1ea9daaddf9331c2 | 317,305,059,804,060,400,000,000,000,000,000,000,000 | 35 | net: ipv6_stub: use ip6_dst_lookup_flow instead of ip6_dst_lookup
ipv6_stub uses the ip6_dst_lookup function to allow other modules to
perform IPv6 lookups. However, this function skips the XFRM layer
entirely.
All users of ipv6_stub->ip6_dst_lookup use ip_route_output_flow (via the
ip_route_output_key and ip_route_o... |
bool dwgReader18::readDwgClasses(){
DRW_DBG("\ndwgReader18::readDwgClasses\n");
dwgSectionInfo si = sections[secEnum::CLASSES];
if (si.Id < 0) //not found, ends
return false;
if (!parseDataPage(si/*, objData*/)) {
return false;
}
//global store for uncompressed data of all pages... | 0 | [
"CWE-191"
] | libdxfrw | ba3fa95648bef948e008dfbdd31a4d21badd71f0 | 99,841,575,841,822,110,000,000,000,000,000,000,000 | 100 | fixed out-of-bounds write vulnerability CVE-2021-21898
as reported in TALOS-2021-1349 / CVE-2021-21898,
dwgCompressor::decompress18() could be abused with a malformed DWG file
to force out-of-bounds write and possibly lead to malicious code
execution. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.