func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
XML_StopParser(XML_Parser parser, XML_Bool resumable)
{
switch (ps_parsing) {
case XML_SUSPENDED:
if (resumable) {
errorCode = XML_ERROR_SUSPENDED;
return XML_STATUS_ERROR;
}
ps_parsing = XML_FINISHED;
break;
case XML_FINISHED:
errorCode = XML_ERROR_FINISHED;
return XML_STATUS_... | 0 | [
"CWE-119"
] | libexpat | ba0f9c3b40c264b8dd392e02a7a060a8fa54f032 | 253,107,002,436,508,330,000,000,000,000,000,000,000 | 28 | CVE-2015-1283 Sanity check size calculations. r=peterv, a=abillings
https://sourceforge.net/p/expat/bugs/528/ |
cardos_decipher(struct sc_card *card,
const u8 * crgram, size_t crgram_len,
u8 * out, size_t outlen)
{
cardos_data_t* priv = (cardos_data_t*)card->drv_data;
int r;
size_t card_max_send_size = card->max_send_size;
size_t reader_max_send_size = card->reader->max_send_size;
SC_FUNC_CALLED(card->ctx, SC_LOG_DEBUG... | 0 | [] | OpenSC | 1252aca9f10771ef5ba8405e73cf2da50827958f | 245,595,411,001,678,970,000,000,000,000,000,000,000 | 55 | cardos: Correctly calculate the left bytes to avoid buffer overrun
Thanks oss-fuzz
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=29912 |
static inline void ok_jpg_idct_1d_row_16(int h, const int *in, uint8_t *out) {
static const int out_shift = 19;
int t0, t1, t2;
int p0, p1, p2, p3, p4, p5, p6, p7;
int q0, q1, q2, q3, q4, q5, q6, q7;
for (int y = 0; y < h; y++) {
// Quick check to avoid mults
if (in[1] == 0 && in[2... | 0 | [
"CWE-787"
] | ok-file-formats | a9cc1711dd4ed6a215038f1c5c03af0ef52c3211 | 77,003,202,072,525,940,000,000,000,000,000,000,000 | 37 | ok_jpg: Fix invalid DHT (#11) |
static int show_modified(struct oneway_unpack_data *cbdata,
struct cache_entry *old,
struct cache_entry *new,
int report_missing,
int cached, int match_missing)
{
unsigned int mode, oldmode;
const unsigned char *sha1;
struct rev_info *revs = cbdata->revs;
if (get_stat_data(new, &sha1, &mode, cached... | 0 | [
"CWE-119"
] | git | fd55a19eb1d49ae54008d932a65f79cd6fda45c9 | 53,246,825,925,114,850,000,000,000,000,000,000,000 | 51 | Fix buffer overflow in git diff
If PATH_MAX on your system is smaller than a path stored, it may cause
buffer overflow and stack corruption in diff_addremove() and diff_change()
functions when running git-diff
Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com> |
void HttpIntegrationTest::useAccessLog() {
access_log_name_ = TestEnvironment::temporaryPath(TestUtility::uniqueFilename());
ASSERT_TRUE(config_helper_.setAccessLog(access_log_name_));
} | 0 | [
"CWE-400",
"CWE-703"
] | envoy | afc39bea36fd436e54262f150c009e8d72db5014 | 316,380,868,873,312,680,000,000,000,000,000,000,000 | 4 | Track byteSize of HeaderMap internally.
Introduces a cached byte size updated internally in HeaderMap. The value
is stored as an optional, and is cleared whenever a non-const pointer or
reference to a HeaderEntry is accessed. The cached value can be set with
refreshByteSize() which performs an iteration over the Heade... |
PackOpenBSDElf32x86::PackOpenBSDElf32x86(InputFile *f) : super(f)
{
ei_osabi = Elf32_Ehdr::ELFOSABI_OPENBSD;
osabi_note = "OpenBSD";
} | 0 | [
"CWE-476"
] | upx | ef336dbcc6dc8344482f8cf6c909ae96c3286317 | 234,501,379,753,659,380,000,000,000,000,000,000,000 | 5 | Protect against bad crafted input.
https://github.com/upx/upx/issues/128
modified: p_lx_elf.cpp |
WM_SYMBOL midi *WildMidi_Open(const char *midifile) {
uint8_t *mididata = NULL;
uint32_t midisize = 0;
uint8_t mus_hdr[] = { 'M', 'U', 'S', 0x1A };
uint8_t xmi_hdr[] = { 'F', 'O', 'R', 'M' };
midi * ret = NULL;
if (!WM_Initialized) {
_WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_I... | 1 | [
"CWE-200",
"CWE-119"
] | wildmidi | 814f31d8eceda8401eb812fc2e94ed143fdad0ab | 129,481,338,030,073,930,000,000,000,000,000,000,000 | 41 | wildmidi_lib.c (WildMidi_Open, WildMidi_OpenBuffer): refuse to proceed if less then 18 bytes of input
Fixes bug #178. |
static const char *set_errorlog(cmd_parms *cmd, void *dummy, const char *arg1,
const char *arg2)
{
ap_errorlog_provider *provider;
const char *err;
cmd->server->errorlog_provider = NULL;
if (!arg2) {
/* Stay backward compatible and check for "syslog" */
i... | 0 | [
"CWE-416",
"CWE-284"
] | httpd | 4cc27823899e070268b906ca677ee838d07cf67a | 85,118,921,841,954,110,000,000,000,000,000,000,000 | 48 | 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... |
struct gendisk *dm_disk(struct mapped_device *md)
{
return md->disk;
} | 0 | [
"CWE-362"
] | linux | b9a41d21dceadf8104812626ef85dc56ee8a60ed | 98,228,241,650,644,760,000,000,000,000,000,000,000 | 4 | dm: fix race between dm_get_from_kobject() and __dm_destroy()
The following BUG_ON was hit when testing repeat creation and removal of
DM devices:
kernel BUG at drivers/md/dm.c:2919!
CPU: 7 PID: 750 Comm: systemd-udevd Not tainted 4.1.44
Call Trace:
[<ffffffff81649e8b>] dm_get_from_kobject+0x34/0x3a
... |
static void atalk_route_packet(struct sk_buff *skb, struct net_device *dev,
struct ddpehdr *ddp, __u16 len_hops,
int origlen)
{
struct atalk_route *rt;
struct atalk_addr ta;
/*
* Don't route multicast, etc., packets, or packets sent to "this
* network"
*/
if (skb->pkt_type != PACKET_HOST ... | 0 | [
"CWE-200"
] | linux-2.6 | 3d392475c873c10c10d6d96b94d092a34ebd4791 | 243,157,730,961,912,250,000,000,000,000,000,000,000 | 86 | appletalk: fix atalk_getname() leak
atalk_getname() can leak 8 bytes of kernel memory to user
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net> |
static void cexit(JF, enum js_AstType T, js_Ast *node, js_Ast *target)
{
js_Ast *prev;
do {
prev = node, node = node->parent;
switch (node->type) {
default:
/* impossible */
break;
case STM_WITH:
emitline(J, F, node);
emit(J, F, OP_ENDWITH);
break;
case STM_FOR_IN:
case STM_FOR_IN_VAR:
e... | 0 | [
"CWE-703",
"CWE-787"
] | mujs | df8559e7bdbc6065276e786217eeee70f28fce66 | 327,061,396,182,488,470,000,000,000,000,000,000,000 | 57 | Bug 704749: Clear jump list after patching jump addresses.
Since we can emit a statement multiple times when compiling try/finally
we have to use a new patch list for each instance. |
static int ath6kl_usb_setup_pipe_resources(struct ath6kl_usb *ar_usb)
{
struct usb_interface *interface = ar_usb->interface;
struct usb_host_interface *iface_desc = interface->cur_altsetting;
struct usb_endpoint_descriptor *endpoint;
struct ath6kl_usb_pipe *pipe;
int i, urbcount, status = 0;
u8 pipe_num;
ath6kl... | 0 | [
"CWE-476"
] | linux | 39d170b3cb62ba98567f5c4f40c27b5864b304e5 | 265,043,916,417,887,400,000,000,000,000,000,000,000 | 105 | ath6kl: fix a NULL-ptr-deref bug in ath6kl_usb_alloc_urb_from_pipe()
The `ar_usb` field of `ath6kl_usb_pipe_usb_pipe` objects
are initialized to point to the containing `ath6kl_usb` object
according to endpoint descriptors read from the device side, as shown
below in `ath6kl_usb_setup_pipe_resources`:
for (i = 0; i <... |
_bson_iter_next_internal (bson_iter_t *iter, /* INOUT */
const char **key, /* OUT */
uint32_t *bson_type, /* OUT */
bool *unsupported) /* OUT */
{
const uint8_t *data;
uint32_t o;
unsigned int len;
BSON_ASSERT (iter);
... | 1 | [
"CWE-125"
] | libbson | 42900956dc461dfe7fb91d93361d10737c1602b3 | 7,329,382,916,006,192,000,000,000,000,000,000,000 | 316 | CDRIVER-2269 Check for zero string length in codewscope |
tally_event_reply ()
{
static int replies_received = 0;
replies_received++;
if (replies_received == 3)
{
if (!clients)
spi_atk_deregister_event_listeners ();
spi_global_app_data->events_initialized = TRUE;
}
} | 0 | [] | at-spi2-atk | e4f3eee2e137cd34cd427875365f458c65458164 | 227,146,972,901,535,550,000,000,000,000,000,000,000 | 12 | Use XDG_RUNTIME_DIR to hold sockets, and do not make a world-writable dir
If we use XDG_RUNTIME_DIR, then the directory should be owned by the
appropriate user, so it should not need to be world-writable. Hopefully this
won't break accessibility for administrative apps on some distro.
https://bugzilla.gnome.org/show_... |
static void RunDeviceBenckmark(MagickCLEnv clEnv,MagickCLEnv testEnv,
MagickCLDevice device)
{
testEnv->devices[0]=device;
default_CLEnv=testEnv;
device->score=RunOpenCLBenchmark(MagickFalse);
default_CLEnv=clEnv;
testEnv->devices[0]=(MagickCLDevice) NULL;
} | 0 | [
"CWE-476"
] | ImageMagick | cca91aa1861818342e3d072bb0fad7dc4ffac24a | 196,856,152,422,190,760,000,000,000,000,000,000,000 | 9 | https://github.com/ImageMagick/ImageMagick/issues/790 |
bool readNumber( N* out ) {
if ( ( _position + sizeof(N) ) > _maxLength )
return false;
if ( out ) {
const N* temp = reinterpret_cast<const N*>(_buffer + _position);
*out = *temp;
}
_p... | 0 | [
"CWE-20"
] | mongo | 6889d1658136c753998b4a408dc8d1a3ec28e3b9 | 59,984,480,214,479,960,000,000,000,000,000,000,000 | 10 | SERVER-7769 - fast bson validate |
virDomainDeviceDefCheckUnsupportedMemoryDevice(virDomainDeviceDefPtr dev)
{
/* This driver doesn't yet know how to handle memory devices */
if (dev->type == VIR_DOMAIN_DEVICE_MEMORY) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("memory devices are not supported by this dri... | 0 | [
"CWE-212"
] | libvirt | a5b064bf4b17a9884d7d361733737fb614ad8979 | 129,027,115,514,253,780,000,000,000,000,000,000,000 | 11 | conf: Don't format http cookies unless VIR_DOMAIN_DEF_FORMAT_SECURE is used
Starting with 3b076391befc3fe72deb0c244ac6c2b4c100b410
(v6.1.0-122-g3b076391be) we support http cookies. Since they may contain
somewhat sensitive information we should not format them into the XML
unless VIR_DOMAIN_DEF_FORMAT_SECURE is assert... |
void tcp_send_ack(struct sock *sk)
{
__tcp_send_ack(sk, tcp_sk(sk)->rcv_nxt);
} | 0 | [
"CWE-190"
] | net | 3b4929f65b0d8249f19a50245cd88ed1a2f78cff | 208,208,153,523,743,680,000,000,000,000,000,000,000 | 4 | tcp: limit payload size of sacked skbs
Jonathan Looney reported that TCP can trigger the following crash
in tcp_shifted_skb() :
BUG_ON(tcp_skb_pcount(skb) < pcount);
This can happen if the remote peer has advertized the smallest
MSS that linux TCP accepts : 48
An skb can hold 17 fragments, and each fragment can ho... |
static int mov_write_stbl_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track)
{
int64_t pos = avio_tell(pb);
int ret;
avio_wb32(pb, 0); /* size */
ffio_wfourcc(pb, "stbl");
mov_write_stsd_tag(s, pb, mov, track);
mov_write_stts_tag(pb, track);
if ((track->par->codec... | 0 | [
"CWE-369"
] | FFmpeg | 2c0e98a0b478284bdff6d7a4062522605a8beae5 | 83,654,327,752,992,790,000,000,000,000,000,000,000 | 29 | avformat/movenc: Write version 2 of audio atom if channels is not known
The version 1 needs the channel count and would divide by 0
Fixes: division by 0
Fixes: fpe_movenc.c_1108_1.ogg
Fixes: fpe_movenc.c_1108_2.ogg
Fixes: fpe_movenc.c_1108_3.wav
Found-by: #CHEN HONGXU# <HCHEN017@e.ntu.edu.sg>
Signed-off-by: Michael N... |
check_signature_token(const char *digest,
ssize_t digest_len,
directory_token_t *tok,
crypto_pk_env_t *pkey,
int flags,
const char *doctype)
{
char *signed_digest;
size_t keysize;
const int check_authorit... | 0 | [
"CWE-399"
] | tor | 57e35ad3d91724882c345ac709666a551a977f0f | 325,829,837,197,434,500,000,000,000,000,000,000,000 | 49 | Avoid possible segfault when handling networkstatus vote with bad flavor
Fix for 6530; fix on 0.2.2.6-alpha. |
static int get_importer(struct transport *transport, struct child_process *fastimport)
{
struct child_process *helper = get_helper(transport);
struct helper_data *data = transport->data;
int cat_blob_fd, code;
child_process_init(fastimport);
fastimport->in = helper->out;
argv_array_push(&fastimport->args, "fast-i... | 1 | [] | git | 68061e3470210703cb15594194718d35094afdc0 | 296,299,330,173,190,800,000,000,000,000,000,000,000 | 19 | fast-import: disallow "feature export-marks" by default
The fast-import stream command "feature export-marks=<path>" lets the
stream write marks to an arbitrary path. This may be surprising if you
are running fast-import against an untrusted input (which otherwise
cannot do anything except update Git objects and refs)... |
void DecimalQuantity::readDecNumberToBcd(const DecNum& decnum) {
const decNumber* dn = decnum.getRawDecNumber();
if (dn->digits > 16) {
ensureCapacity(dn->digits);
for (int32_t i = 0; i < dn->digits; i++) {
fBCD.bcdBytes.ptr[i] = dn->lsu[i];
}
} else {
uint64_t re... | 0 | [
"CWE-190"
] | icu | 53d8c8f3d181d87a6aa925b449b51c4a2c922a51 | 252,231,618,452,528,440,000,000,000,000,000,000,000 | 17 | ICU-20246 Fixing another integer overflow in number parsing. |
f_pyxeval(typval_T *argvars, typval_T *rettv)
{
# if defined(FEAT_PYTHON) && defined(FEAT_PYTHON3)
init_pyxversion();
if (p_pyx == 2)
f_pyeval(argvars, rettv);
else
f_py3eval(argvars, rettv);
# elif defined(FEAT_PYTHON)
f_pyeval(argvars, rettv);
# elif defined(FEAT_PYTHON3)
f_py3eval(argvars, rett... | 1 | [
"CWE-78"
] | vim | 8c62a08faf89663e5633dc5036cd8695c80f1075 | 212,270,470,355,967,500,000,000,000,000,000,000,000 | 14 | 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. |
f_setwinvar(typval_T *argvars, typval_T *rettv)
{
setwinvar(argvars, rettv, 0);
} | 0 | [
"CWE-78"
] | vim | 8c62a08faf89663e5633dc5036cd8695c80f1075 | 100,498,209,814,398,550,000,000,000,000,000,000,000 | 4 | patch 8.1.0881: can execute shell commands in rvim through interfaces
Problem: Can execute shell commands in rvim through interfaces.
Solution: Disable using interfaces in restricted mode. Allow for writing
file with writefile(), histadd() and a few others. |
void kvm_mmu_free_memory_cache(struct kvm_mmu_memory_cache *mc)
{
while (mc->nobjs) {
if (mc->kmem_cache)
kmem_cache_free(mc->kmem_cache, mc->objects[--mc->nobjs]);
else
free_page((unsigned long)mc->objects[--mc->nobjs]);
}
} | 0 | [
"CWE-401"
] | linux | f65886606c2d3b562716de030706dfe1bea4ed5e | 261,813,733,837,398,250,000,000,000,000,000,000,000 | 9 | 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... |
onig_name_to_backref_number(regex_t* reg, const UChar* name,
const UChar* name_end, OnigRegion* region)
{
return ONIG_NO_SUPPORT_CONFIG;
} | 0 | [
"CWE-787"
] | oniguruma | ddbf55698b5f7ffdfa737b0b8e0079af1fdd7cb1 | 236,810,379,838,892,950,000,000,000,000,000,000,000 | 5 | re-fix #60 by check val_type |
TEST_P(MessengerTest, TimeoutTest) {
g_ceph_context->_conf->set_val("ms_tcp_read_timeout", "1");
FakeDispatcher cli_dispatcher(false), srv_dispatcher(true);
entity_addr_t bind_addr;
bind_addr.parse("127.0.0.1");
server_msgr->bind(bind_addr);
server_msgr->add_dispatcher_head(&srv_dispatcher);
server_msgr->... | 0 | [
"CWE-287",
"CWE-284"
] | ceph | 5ead97120e07054d80623dada90a5cc764c28468 | 240,396,264,082,190,770,000,000,000,000,000,000,000 | 37 | 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 ... |
int ToTraditional(byte* input, word32 sz)
{
word32 oid;
return ToTraditional_ex(input, sz, &oid);
} | 0 | [
"CWE-125",
"CWE-345"
] | wolfssl | f93083be72a3b3d956b52a7ec13f307a27b6e093 | 117,000,469,595,835,360,000,000,000,000,000,000,000 | 6 | OCSP: improve handling of OCSP no check extension |
struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx)
{
if (ctx != NULL)
atomic_inc(&ctx->count);
return ctx;
} | 0 | [
"CWE-703"
] | linux | dc0b027dfadfcb8a5504f7d8052754bf8d501ab9 | 194,995,978,068,242,100,000,000,000,000,000,000,000 | 6 | NFSv4: Convert the open and close ops to use fmode
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> |
static int kvm_fast_pio_out(struct kvm_vcpu *vcpu, int size,
unsigned short port)
{
unsigned long val = kvm_rax_read(vcpu);
int ret = emulator_pio_out(vcpu, size, port, &val, 1);
if (ret)
return ret;
/*
* Workaround userspace that relies on old KVM behavior of %rip being
* incremented prior to exitin... | 0 | [
"CWE-476"
] | linux | 55749769fe608fa3f4a075e42e89d237c8e37637 | 86,356,669,897,864,700,000,000,000,000,000,000,000 | 24 | KVM: x86: Fix wall clock writes in Xen shared_info not to mark page dirty
When dirty ring logging is enabled, any dirty logging without an active
vCPU context will cause a kernel oops. But we've already declared that
the shared_info page doesn't get dirty tracking anyway, since it would
be kind of insane to mark it di... |
void Clear() { length_ = 0; } | 0 | [] | node | fd80a31e0697d6317ce8c2d289575399f4e06d21 | 254,579,904,867,747,940,000,000,000,000,000,000,000 | 1 | deps: backport 5f836c from v8 upstream
Original commit message:
Fix Hydrogen bounds check elimination
When combining bounds checks, they must all be moved before the first load/store
that they are guarding.
BUG=chromium:344186
LOG=y
R=svenpanne@chromium.org
Review URL: https://coderevie... |
void opj_pi_update_decode_poc (opj_pi_iterator_t * p_pi,
opj_tcp_t * p_tcp,
OPJ_UINT32 p_max_precision,
OPJ_UINT32 p_max_res)
{
/* loop*/
OPJ_UINT32 pino;
/* encoding prameters to set*/
OPJ_UINT32 l_bound;
opj_pi_iterato... | 0 | [
"CWE-190"
] | openjpeg | 5d00b719f4b93b1445e6fb4c766b9a9883c57949 | 311,225,553,098,761,950,000,000,000,000,000,000,000 | 41 | [trunk] fixed a buffer overflow in opj_tcd_init_decode_tile
Update issue 431 |
Item *Item_func_le::negated_item(THD *thd) /* a <= b -> a > b */
{
return new (thd->mem_root) Item_func_gt(thd, args[0], args[1]);
} | 0 | [
"CWE-617"
] | server | 807945f2eb5fa22e6f233cc17b85a2e141efe2c8 | 301,750,117,554,785,670,000,000,000,000,000,000,000 | 4 | 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 ... |
explicit ReadCallbackBase(WriteCallbackBase* wcb)
: wcb_(wcb), state(STATE_WAITING) {} | 0 | [
"CWE-125"
] | folly | c321eb588909646c15aefde035fd3133ba32cdee | 50,307,023,226,631,430,000,000,000,000,000,000,000 | 2 | Handle close_notify as standard writeErr in AsyncSSLSocket.
Summary: Fixes CVE-2019-11934
Reviewed By: mingtaoy
Differential Revision: D18020613
fbshipit-source-id: db82bb250e53f0d225f1280bd67bc74abd417836 |
static bool fetch_seccomp(const char *name, const char *lxcpath,
struct lxc_proc_context_info *i, lxc_attach_options_t *options)
{
struct lxc_container *c;
if (!(options->namespaces & CLONE_NEWNS) || !(options->attach_flags & LXC_ATTACH_LSM))
return true;
c = lxc_container_new(name, lxcpath);
if (!c)
return... | 0 | [
"CWE-17"
] | lxc | 5c3fcae78b63ac9dd56e36075903921bd9461f9e | 13,989,126,989,280,920,000,000,000,000,000,000,000 | 21 | CVE-2015-1334: Don't use the container's /proc during attach
A user could otherwise over-mount /proc and prevent the apparmor profile
or selinux label from being written which combined with a modified
/bin/sh or other commonly used binary would lead to unconfined code
execution.
Reported-by: Roman Fiedler
Signed-off-... |
static blk_status_t floppy_queue_rq(struct blk_mq_hw_ctx *hctx,
const struct blk_mq_queue_data *bd)
{
blk_mq_start_request(bd->rq);
if (WARN(max_buffer_sectors == 0,
"VFS: %s called on non-open device\n", __func__))
return BLK_STS_IOERR;
if (WARN(atomic_read(&usage_count) == 0,
"warning: usage coun... | 0 | [
"CWE-190",
"CWE-125"
] | linux | da99466ac243f15fbba65bd261bfc75ffa1532b6 | 307,567,044,944,554,300,000,000,000,000,000,000,000 | 33 | floppy: fix out-of-bounds read in copy_buffer
This fixes a global out-of-bounds read access in the copy_buffer
function of the floppy driver.
The FDDEFPRM ioctl allows one to set the geometry of a disk. The sect
and head fields (unsigned int) of the floppy_drive structure are used to
compute the max_sector (int) in ... |
static void vhost_vdpa_set_iova_range(struct vhost_vdpa *v)
{
struct vdpa_iova_range *range = &v->range;
struct iommu_domain_geometry geo;
struct vdpa_device *vdpa = v->vdpa;
const struct vdpa_config_ops *ops = vdpa->config;
if (ops->get_iova_range) {
*range = ops->get_iova_range(vdpa);
} else if (v->domain &&... | 0 | [
"CWE-416"
] | linux | f6bbf0010ba004f5e90c7aefdebc0ee4bd3283b9 | 54,083,296,841,526,300,000,000,000,000,000,000,000 | 20 | 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... |
Item *get_copy(THD *thd, MEM_ROOT *mem_root)
{ return get_item_copy<Item_cache_int>(thd, mem_root, this); } | 0 | [
"CWE-617"
] | server | 2e7891080667c59ac80f788eef4d59d447595772 | 91,224,410,620,696,100,000,000,000,000,000,000,000 | 2 | MDEV-25635 Assertion failure when pushing from HAVING into WHERE of view
This bug could manifest itself after pushing a where condition over a
mergeable derived table / view / CTE DT into a grouping view / derived
table / CTE V whose item list contained set functions with constant
arguments such as MIN(2), SUM(1) etc.... |
static int bpf_map_release(struct inode *inode, struct file *filp)
{
bpf_map_put_with_uref(filp->private_data);
return 0;
} | 0 | [
"CWE-703"
] | linux | 92117d8443bc5afacc8d5ba82e541946310f106e | 78,104,118,267,888,860,000,000,000,000,000,000,000 | 5 | bpf: fix refcnt overflow
On a system with >32Gbyte of phyiscal memory and infinite RLIMIT_MEMLOCK,
the malicious application may overflow 32-bit bpf program refcnt.
It's also possible to overflow map refcnt on 1Tb system.
Impose 32k hard limit which means that the same bpf program or
map cannot be shared by more than ... |
archive_read_support_format_rar(struct archive *_a)
{
struct archive_read *a = (struct archive_read *)_a;
struct rar *rar;
int r;
archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
"archive_read_support_format_rar");
rar = (struct rar *)calloc(sizeof(*rar), 1);
if (rar ==... | 0 | [
"CWE-125",
"CWE-193"
] | libarchive | 5562545b5562f6d12a4ef991fae158bf4ccf92b6 | 281,824,272,323,388,650,000,000,000,000,000,000,000 | 39 | Avoid a read off-by-one error for UTF16 names in RAR archives.
Reported-By: OSS-Fuzz issue 573 |
bool Cipher::encrypt(QByteArray &cipherText)
{
if (cipherText.left(3) == "+p ") //don't encode if...?
cipherText = cipherText.mid(3);
else
{
if (m_cbc) //encode in ecb or cbc decide how to determine later
{
QByteArray temp = blowfishCBC(cipherText, true);
if ... | 0 | [
"CWE-125"
] | quassel | 8b5ecd226f9208af3074b33d3b7cf5e14f55b138 | 36,306,942,870,851,866,000,000,000,000,000,000,000 | 33 | Check for invalid input in encrypted buffers
The ECB Blowfish decryption function assumed that encrypted input would
always come in blocks of 12 characters, as specified. However, buggy
clients or annoying people may not adhere to that assumption, causing
the core to crash while trying to process the invalid base64 in... |
static int coolkey_select_file(sc_card_t *card, const sc_path_t *in_path, sc_file_t **file_out)
{
int r;
struct sc_file *file = NULL;
coolkey_private_data_t * priv = COOLKEY_DATA(card);
unsigned long object_id;
assert(card != NULL && in_path != NULL);
SC_FUNC_CALLED(card->ctx, SC_LOG_DEBUG_VERBOSE);
if (in_pa... | 0 | [
"CWE-125"
] | OpenSC | 8fe377e93b4b56060e5bbfb6f3142ceaeca744fa | 111,134,118,106,715,540,000,000,000,000,000,000,000 | 43 | fixed out of bounds reads
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting and suggesting security fixes. |
static int ioat_xor_val_self_test(struct ioatdma_device *device)
{
int i, src_idx;
struct page *dest;
struct page *xor_srcs[IOAT_NUM_SRC_TEST];
struct page *xor_val_srcs[IOAT_NUM_SRC_TEST + 1];
dma_addr_t dma_srcs[IOAT_NUM_SRC_TEST + 1];
dma_addr_t dest_dma;
struct dma_async_tx_descriptor *tx;
struct dma_chan *... | 0 | [] | linux | 7bced397510ab569d31de4c70b39e13355046387 | 229,817,692,476,502,320,000,000,000,000,000,000,000 | 238 | net_dma: simple removal
Per commit "77873803363c net_dma: mark broken" net_dma is no longer used
and there is no plan to fix it.
This is the mechanical removal of bits in CONFIG_NET_DMA ifdef guards.
Reverting the remainder of the net_dma induced changes is deferred to
subsequent patches.
Marked for stable due to Ro... |
static int tc_ctl_chain(struct sk_buff *skb, struct nlmsghdr *n,
struct netlink_ext_ack *extack)
{
struct net *net = sock_net(skb->sk);
struct nlattr *tca[TCA_MAX + 1];
struct tcmsg *t;
u32 parent;
u32 chain_index;
struct Qdisc *q = NULL;
struct tcf_chain *chain = NULL;
struct tcf_block *block;
unsigned lon... | 1 | [
"CWE-416"
] | linux | 04c2a47ffb13c29778e2a14e414ad4cb5a5db4b5 | 204,059,627,905,279,000,000,000,000,000,000,000,000 | 133 | net: sched: fix use-after-free in tc_new_tfilter()
Whenever tc_new_tfilter() jumps back to replay: label,
we need to make sure @q and @chain local variables are cleared again,
or risk use-after-free as in [1]
For consistency, apply the same fix in tc_ctl_chain()
BUG: KASAN: use-after-free in mini_qdisc_pair_swap+0x1... |
static int io_sendmsg_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
{
struct io_sr_msg *sr = &req->sr_msg;
struct io_async_ctx *io = req->io;
int ret;
if (unlikely(req->ctx->flags & IORING_SETUP_IOPOLL))
return -EINVAL;
sr->msg_flags = READ_ONCE(sqe->msg_flags);
sr->umsg = u64_to_user_ptr(READ_ON... | 0 | [] | linux | 0f2122045b946241a9e549c2a76cea54fa58a7ff | 116,408,470,576,853,260,000,000,000,000,000,000,000 | 29 | io_uring: don't rely on weak ->files references
Grab actual references to the files_struct. To avoid circular references
issues due to this, we add a per-task note that keeps track of what
io_uring contexts a task has used. When the tasks execs or exits its
assigned files, we cancel requests based on this tracking.
W... |
static int __udp4_lib_mcast_deliver(struct net *net, struct sk_buff *skb,
struct udphdr *uh,
__be32 saddr, __be32 daddr,
struct udp_table *udptable)
{
struct sock *sk, *stack[256 / sizeof(struct sock *)];
struct udp_hslot *hslot = udp_hashslot(udptable, net, ntohs(uh->dest));
int dif;
unsig... | 0 | [
"CWE-400"
] | linux-2.6 | c377411f2494a931ff7facdbb3a6839b1266bcf6 | 155,936,411,355,455,290,000,000,000,000,000,000,000 | 46 | net: sk_add_backlog() take rmem_alloc into account
Current socket backlog limit is not enough to really stop DDOS attacks,
because user thread spend many time to process a full backlog each
round, and user might crazy spin on socket lock.
We should add backlog size and receive_queue size (aka rmem_alloc) to
pace writ... |
static noinline int btrfs_ioctl_resize(struct file *file,
void __user *arg)
{
struct inode *inode = file_inode(file);
struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
u64 new_size;
u64 old_size;
u64 devid = 1;
struct btrfs_root *root = BTRFS_I(inode)->root;
struct btrfs_ioctl_vol_args *vol_args;
stru... | 1 | [
"CWE-476",
"CWE-284"
] | linux | 09ba3bc9dd150457c506e4661380a6183af651c1 | 214,819,274,342,162,530,000,000,000,000,000,000,000 | 141 | btrfs: merge btrfs_find_device and find_device
Both btrfs_find_device() and find_device() does the same thing except
that the latter does not take the seed device onto account in the device
scanning context. We can merge them.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.c... |
int __kvm_set_memory_region(struct kvm *kvm,
struct kvm_userspace_memory_region *mem,
int user_alloc)
{
int r;
gfn_t base_gfn;
unsigned long npages;
unsigned long i;
struct kvm_memory_slot *memslot;
struct kvm_memory_slot old, new;
struct kvm_memslots *slots, *old_memslots;
r = -EINVAL;
/* Gener... | 1 | [
"CWE-264"
] | kvm | 32f6daad4651a748a58a3ab6da0611862175722f | 195,116,695,660,102,520,000,000,000,000,000,000,000 | 167 | KVM: unmap pages from the iommu when slots are removed
We've been adding new mappings, but not destroying old mappings.
This can lead to a page leak as pages are pinned using
get_user_pages, but only unpinned with put_page if they still
exist in the memslots list on vm shutdown. A memslot that is
destroyed while an i... |
TEST_F(QueryPlannerTest, PlannerUsesCoveredIxscanForCountWhenIndexSatisfiesQuery) {
params.options = QueryPlannerParams::IS_COUNT;
addIndex(BSON("x" << 1));
runQuery(BSON("x" << 5));
ASSERT_EQUALS(getNumSolutions(), 1U);
assertSolutionExists("{ixscan: {pattern: {x: 1}, bounds: {x: [[5,5,true,true]]}... | 0 | [] | mongo | ee97c0699fd55b498310996ee002328e533681a3 | 175,842,747,209,697,900,000,000,000,000,000,000,000 | 7 | SERVER-36993 Fix crash due to incorrect $or pushdown for indexed $expr. |
struct hlist_node *seq_hlist_next_rcu(void *v,
struct hlist_head *head,
loff_t *ppos)
{
struct hlist_node *node = v;
++*ppos;
if (v == SEQ_START_TOKEN)
return rcu_dereference(head->first);
else
return rcu_dereference(node->next);
} | 0 | [
"CWE-120",
"CWE-787"
] | linux | 8cae8cd89f05f6de223d63e6d15e31c8ba9cf53b | 117,435,573,103,991,590,000,000,000,000,000,000,000 | 12 | seq_file: disallow extremely large seq buffer allocations
There is no reasonable need for a buffer larger than this, and it avoids
int overflow pitfalls.
Fixes: 058504edd026 ("fs/seq_file: fallback to vmalloc allocation")
Suggested-by: Al Viro <viro@zeniv.linux.org.uk>
Reported-by: Qualys Security Advisory <qsa@qualy... |
xmlRelaxNGParsePattern(xmlRelaxNGParserCtxtPtr ctxt, xmlNodePtr node)
{
xmlRelaxNGDefinePtr def = NULL;
if (node == NULL) {
return (NULL);
}
if (IS_RELAXNG(node, "element")) {
def = xmlRelaxNGParseElement(ctxt, node);
} else if (IS_RELAXNG(node, "attribute")) {
def = xmlRela... | 0 | [
"CWE-134"
] | libxml2 | 502f6a6d08b08c04b3ddfb1cd21b2f699c1b7f5b | 282,247,524,998,017,750,000,000,000,000,000,000,000 | 288 | More format string warnings with possible format string vulnerability
For https://bugzilla.gnome.org/show_bug.cgi?id=761029
adds a new xmlEscapeFormatString() function to escape composed format
strings |
SPL_METHOD(SplFileObject, current)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis());
if (zend_parse_parameters_none() == FAILURE) {
return;
}
if(!intern->u.file.stream) {
zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
return;
}
if (!intern->u.file.current_lin... | 0 | [
"CWE-74"
] | php-src | a5a15965da23c8e97657278fc8dfbf1dfb20c016 | 291,393,049,601,246,140,000,000,000,000,000,000,000 | 27 | Fix #78863: DirectoryIterator class silently truncates after a null byte
Since the constructor of DirectoryIterator and friends is supposed to
accepts paths (i.e. strings without NUL bytes), we must not accept
arbitrary strings. |
void Filter::onGenericPoolFailure(ConnectionPool::PoolFailureReason reason,
Upstream::HostDescriptionConstSharedPtr host) {
generic_conn_pool_.reset();
read_callbacks_->upstreamHost(host);
getStreamInfo().upstreamInfo()->setUpstreamHost(host);
switch (reason) {
case Connecti... | 0 | [
"CWE-416"
] | envoy | ce0ae309057a216aba031aff81c445c90c6ef145 | 115,001,875,535,903,840,000,000,000,000,000,000,000 | 19 | CVE-2021-43826
Signed-off-by: Yan Avlasov <yavlasov@google.com> |
static int get_refcount(BlockDriverState *bs, int64_t cluster_index)
{
BDRVQcowState *s = bs->opaque;
uint64_t refcount_table_index, block_index;
int64_t refcount_block_offset;
int ret;
uint16_t *refcount_block;
uint16_t refcount;
refcount_table_index = cluster_index >> (s->cluster_bits - R... | 0 | [
"CWE-190"
] | qemu | db8a31d11d6a60f48d6817530640d75aa72a9a2f | 139,618,620,991,451,140,000,000,000,000,000,000,000 | 35 | qcow2: Avoid integer overflow in get_refcount (CVE-2014-0143)
This ensures that the checks catch all invalid cluster indexes
instead of returning the refcount of a wrong cluster.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com... |
template<typename T>
inline T median(T val0, T val1, T val2) {
return std::max(std::min(val0,val1),std::min(val2,std::max(val0,val1))); | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 239,099,537,703,520,260,000,000,000,000,000,000,000 | 3 | Fix other issues in 'CImg<T>::load_bmp()'. |
FLAC__bool read_metadata_seektable_(FLAC__StreamDecoder *decoder, FLAC__bool is_last, unsigned length)
{
FLAC__uint32 i, x;
FLAC__uint64 xx;
FLAC__ASSERT(FLAC__bitreader_is_consumed_byte_aligned(decoder->private_->input));
decoder->private_->seek_table.type = FLAC__METADATA_TYPE_SEEKTABLE;
decoder->private_->see... | 0 | [
"CWE-119"
] | flac | 5b3033a2b355068c11fe637e14ac742d273f076e | 242,614,377,328,464,200,000,000,000,000,000,000,000 | 41 | src/libFLAC/stream_decoder.c : Fix buffer read overflow.
This is CVE-2014-8962.
Reported-by: Michele Spagnuolo,
Google Security Team <mikispag@google.com> |
bool IsBinaryAssociative(const NodeDef& node) const {
return IsMul(node) || IsAdd(node);
} | 0 | [
"CWE-476"
] | tensorflow | e6340f0665d53716ef3197ada88936c2a5f7a2d3 | 106,211,958,737,751,200,000,000,000,000,000,000,000 | 3 | Handle a special grappler case resulting in crash.
It might happen that a malformed input could be used to trick Grappler into trying to optimize a node with no inputs. This, in turn, would produce a null pointer dereference and a segfault.
PiperOrigin-RevId: 369242852
Change-Id: I2e5cbe7aec243d34a6d60220ac8ac9b16f13... |
static void stellaris_enet_unrealize(DeviceState *dev, Error **errp)
{
stellaris_enet_state *s = STELLARIS_ENET(dev);
memory_region_destroy(&s->mmio);
} | 0 | [
"CWE-119",
"CWE-787"
] | qemu | 2e1198672759eda6e122ff38fcf6df06f27e0fe2 | 86,641,509,890,606,670,000,000,000,000,000,000,000 | 6 | hw/net/stellaris_enet: Convert to vmstate
Convert this device to use vmstate for its save/load, including
providing a post_load function that sanitizes inbound data to
avoid possible buffer overflows if it is malicious.
The sanitizing fixes CVE-2013-4532 (though nobody should be
relying on the security properties of ... |
static int find_length(struct pdf_struct *pdf,
struct pdf_obj *obj,
const char *start, off_t len)
{
int length;
const char *q;
q = cli_memstr(start, len, "/Length", 7);
if (!q)
return 0;
q++;
len -= q - start;
start = pdf_nextobject(q, len);
if (!start)
return 0;
... | 0 | [
"CWE-119",
"CWE-189",
"CWE-79"
] | clamav-devel | 24ff855c82d3f5c62bc5788a5776cefbffce2971 | 64,236,795,697,535,450,000,000,000,000,000,000,000 | 44 | pdf: bb #7053 |
samesets(g, c1, c2)
register struct re_guts *g;
int c1;
int c2;
{
register uch *col;
register int i;
register int ncols = (g->ncsets+(CHAR_BIT-1)) / CHAR_BIT;
register unsigned uc1 = (unsigned char)c1;
register unsigned uc2 = (unsigned char)c2;
for (i = 0, col = g->setbits; i < ncols; i++, col += g->csetsize)
... | 0 | [] | php-src | 124fb22a13fafa3648e4e15b4f207c7096d8155e | 253,393,973,655,090,480,000,000,000,000,000,000,000 | 16 | Fixed bug #68739 #68740 #68741 |
flatpak_dir_system_helper_call_deploy_appstream (FlatpakDir *self,
const gchar *arg_repo_path,
guint arg_flags,
const gchar *arg_origin,
... | 0 | [
"CWE-74"
] | flatpak | fb473cad801c6b61706353256cab32330557374a | 339,982,506,583,007,570,000,000,000,000,000,000,000 | 24 | dir: Pass environment via bwrap --setenv when running apply_extra
This means we can systematically pass the environment variables
through bwrap(1), even if it is setuid and thus is filtering out
security-sensitive environment variables. bwrap ends up being
run with an empty environment instead.
As with the previous c... |
void jpeg_gdIOCtx_src(j_decompress_ptr cinfo, gdIOCtx *infile)
{
my_src_ptr src;
/* The source object and input buffer are made permanent so that a series
* of JPEG images can be read from the same file by calling jpeg_gdIOCtx_src
* only before the first one. (If we discarded the buffer at the end of
* one im... | 0 | [
"CWE-415"
] | libgd | 553702980ae89c83f2d6e254d62cf82e204956d0 | 17,485,330,775,142,007,000,000,000,000,000,000,000 | 32 | Fix #492: Potential double-free in gdImage*Ptr()
Whenever `gdImage*Ptr()` calls `gdImage*Ctx()` and the latter fails, we
must not call `gdDPExtractData()`; otherwise a double-free would
happen. Since `gdImage*Ctx()` are void functions, and we can't change
that for BC reasons, we're introducing static helpers which ar... |
static void dump_object_metadata(struct req_state * const s,
const map<string, bufferlist>& attrs)
{
map<string, string> response_attrs;
for (auto kv : attrs) {
const char * name = kv.first.c_str();
const auto aiter = rgw_to_http_attrs.find(name);
if (aiter != std::end(rgw_to_http_attrs)) {
... | 0 | [
"CWE-617"
] | ceph | f44a8ae8aa27ecef69528db9aec220f12492810e | 87,872,759,312,635,020,000,000,000,000,000,000,000 | 55 | rgw: RGWSwiftWebsiteHandler::is_web_dir checks empty subdir_name
checking for empty name avoids later assertion in RGWObjectCtx::set_atomic
Fixes: CVE-2021-3531
Reviewed-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 7196a469b4470f3c8628489df9a41ec8b... |
static inline unsigned long *frame_vector_pfns(struct frame_vector *vec)
{
if (!vec->is_pfns)
frame_vector_to_pfns(vec);
return (unsigned long *)(vec->ptrs);
} | 0 | [
"CWE-119"
] | linux | 1be7107fbe18eed3e319a6c3e83c78254b693acb | 123,328,467,173,672,700,000,000,000,000,000,000,000 | 6 | 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 ... |
qemuProcessBuildDestroyMemoryPaths(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainMemoryDefPtr mem,
bool build)
{
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
size_t i;
bo... | 0 | [
"CWE-416"
] | libvirt | 1ac703a7d0789e46833f4013a3876c2e3af18ec7 | 69,631,723,090,895,010,000,000,000,000,000,000,000 | 42 | qemu: Add missing lock in qemuProcessHandleMonitorEOF
qemuMonitorUnregister will be called in multiple threads (e.g. threads
in rpc worker pool and the vm event thread). In some cases, it isn't
protected by the monitor lock, which may lead to call g_source_unref
more than one time and a use-after-free problem eventua... |
yang_fill_extcomplex_module(struct ly_ctx *ctx, struct lys_ext_instance_complex *ext,
char *parent_name, char **values, int implemented)
{
int c, i;
struct lys_module **modules, ***p, *reallocated, **pp;
struct lyext_substmt *info;
if (!values) {
return EXIT_SUCCESS;... | 0 | [
"CWE-415"
] | libyang | d9feacc4a590d35dbc1af21caf9080008b4450ed | 6,112,605,986,924,067,000,000,000,000,000,000,000 | 53 | yang parser BUGFIX double free
Fixes #742 |
int kvm_tdp_page_fault(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault)
{
while (fault->max_level > PG_LEVEL_4K) {
int page_num = KVM_PAGES_PER_HPAGE(fault->max_level);
gfn_t base = (fault->addr >> PAGE_SHIFT) & ~(page_num - 1);
if (kvm_mtrr_check_gfn_range_consistency(vcpu, base, page_num))
break;
--... | 0 | [
"CWE-476"
] | linux | 9f46c187e2e680ecd9de7983e4d081c3391acc76 | 309,398,455,408,797,140,000,000,000,000,000,000,000 | 14 | KVM: x86/mmu: fix NULL pointer dereference on guest INVPCID
With shadow paging enabled, the INVPCID instruction results in a call
to kvm_mmu_invpcid_gva. If INVPCID is executed with CR0.PG=0, the
invlpg callback is not set and the result is a NULL pointer dereference.
Fix it trivially by checking for mmu->invlpg befo... |
static void trace_consume(struct trace_iterator *iter)
{
ring_buffer_consume(iter->trace_buffer->buffer, iter->cpu, &iter->ts,
&iter->lost_events);
} | 0 | [
"CWE-415"
] | linux | 4397f04575c44e1440ec2e49b6302785c95fd2f8 | 146,701,334,723,995,650,000,000,000,000,000,000,000 | 5 | tracing: Fix possible double free on failure of allocating trace buffer
Jing Xia and Chunyan Zhang reported that on failing to allocate part of the
tracing buffer, memory is freed, but the pointers that point to them are not
initialized back to NULL, and later paths may try to free the freed memory
again. Jing and Chu... |
int udp_lib_setsockopt(struct sock *sk, int level, int optname,
char __user *optval, unsigned int optlen,
int (*push_pending_frames)(struct sock *))
{
struct udp_sock *up = udp_sk(sk);
int val;
int err = 0;
int is_udplite = IS_UDPLITE(sk);
if (optlen < sizeof(int))
return -EINVAL;
if (get_us... | 0 | [
"CWE-362"
] | linux-2.6 | f6d8bd051c391c1c0458a30b2a7abcd939329259 | 292,950,641,438,085,050,000,000,000,000,000,000,000 | 80 | 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... |
virtual void updateLineJoin(GfxState * /*state*/) {} | 0 | [] | poppler | abf167af8b15e5f3b510275ce619e6fdb42edd40 | 231,627,318,053,933,600,000,000,000,000,000,000,000 | 1 | Implement tiling/patterns in SplashOutputDev
Fixes bug 13518 |
static SchroFrame *CreateSchroFrameFromPic( decoder_t *p_dec )
{
decoder_sys_t *p_sys = p_dec->p_sys;
SchroFrame *p_schroframe = schro_frame_new();
picture_t *p_pic = NULL;
struct picture_free_t *p_free;
if( !p_schroframe )
return NULL;
p_pic = decoder_NewPicture( p_dec );
if( !p_... | 0 | [
"CWE-120",
"CWE-787"
] | vlc | 9bb0353a5c63a7f8c6fc853faa3df4b4df1f5eb5 | 38,106,839,110,198,730,000,000,000,000,000,000,000 | 57 | codec: schroedinger: fix potential buffer overflow.
The variable len is a raw 32 bit value read using GetDWBE. If this
value is larger than UINT32_MAX - sizeof(eos), this will cause an
integer overflow in the subsequent call to malloc, and finally a
buffer overflow when calling memcpy. We fix this by checking len
acco... |
gst_asf_demux_pull_data (GstASFDemux * demux, guint64 offset, guint size,
GstBuffer ** p_buf, GstFlowReturn * p_flow)
{
gsize buffer_size;
GstFlowReturn flow;
GST_LOG_OBJECT (demux, "pulling buffer at %" G_GUINT64_FORMAT "+%u",
offset, size);
flow = gst_pad_pull_range (demux->sinkpad, offset, size, ... | 0 | [
"CWE-125",
"CWE-787"
] | gst-plugins-ugly | d21017b52a585f145e8d62781bcc1c5fefc7ee37 | 164,031,488,065,784,510,000,000,000,000,000,000,000 | 36 | asfdemux: Check that we have enough data available before parsing bool/uint extended content descriptors
https://bugzilla.gnome.org/show_bug.cgi?id=777955 |
virtual SplashPattern *copy() { return new SplashRadialPattern(colorMode, state, (GfxRadialShading *) shading); } | 0 | [] | poppler | abf167af8b15e5f3b510275ce619e6fdb42edd40 | 282,790,113,288,483,120,000,000,000,000,000,000,000 | 1 | Implement tiling/patterns in SplashOutputDev
Fixes bug 13518 |
static void sig_handler(const int sig) {
printf("Signal handled: %s.\n", strsignal(sig));
exit(EXIT_SUCCESS);
} | 0 | [
"CWE-190"
] | memcached | bd578fc34b96abe0f8d99c1409814a09f51ee71c | 215,381,396,446,419,200,000,000,000,000,000,000,000 | 4 | CVE reported by cisco talos |
intuit_diff_type (bool need_header, mode_t *p_file_type)
{
file_offset this_line = 0;
file_offset first_command_line = -1;
char first_ed_command_letter = 0;
lin fcl_line = 0; /* Pacify 'gcc -W'. */
bool this_is_a_command = false;
bool stars_this_line = false;
bool extended_headers = false;
... | 0 | [
"CWE-59"
] | patch | 44a987e02f04b9d81a0db4a611145cad1093a2d3 | 144,975,919,338,285,180,000,000,000,000,000,000,000 | 566 | Add line number overflow checking
* bootstrap.conf: use intprops module.
* src/common.h: Define LINENUM_MIN and LINENUM_MAX macros.
* src/pch.c (another_hunk): Add line number overflow checking. Based on Robert
C. Seacord's INT32-C document for integer overflow checking and Tobias
Stoeckmann's "integer overflows and ... |
static inline struct cfs_rq *cfs_rq_of(struct sched_entity *se)
{
struct task_struct *p = task_of(se);
struct rq *rq = task_rq(p);
return &rq->cfs;
} | 0 | [] | linux-2.6 | 6a6029b8cefe0ca7e82f27f3904dbedba3de4e06 | 46,799,909,197,675,500,000,000,000,000,000,000,000 | 7 | sched: simplify sched_slice()
Use the existing calc_delta_mine() calculation for sched_slice(). This
saves a divide and simplifies the code because we share it with the
other /cfs_rq->load users.
It also improves code size:
text data bss dec hex filename
42659 2740 144 45543 b1e... |
int hfs_cat_find_brec(struct super_block *sb, u32 cnid,
struct hfs_find_data *fd)
{
hfs_cat_rec rec;
int res, len, type;
hfs_cat_build_key(sb, fd->search_key, cnid, NULL);
res = hfs_brec_read(fd, &rec, sizeof(rec));
if (res)
return res;
type = rec.type;
if (type != HFS_CDR_THD && type != HFS_CDR_FTH)... | 1 | [] | linux-2.6 | d38b7aa7fc3371b52d036748028db50b585ade2e | 71,919,391,830,078,220,000,000,000,000,000,000,000 | 22 | hfs: fix namelength memory corruption
Fix a stack corruption caused by a corrupted hfs filesystem. If the
catalog name length is corrupted the memcpy overwrites the catalog btree
structure. Since the field is limited to HFS_NAMELEN bytes in the
structure and the file format, we throw an error if it is too long.
Cc:... |
static void __init xen_pv_guest_late_init(void)
{
#ifndef CONFIG_SMP
/* Setup shared vcpu info for non-smp configurations */
xen_setup_vcpu_info_placement();
#endif
} | 0 | [
"CWE-703"
] | linux | 96e8fc5818686d4a1591bb6907e7fdb64ef29884 | 22,517,637,292,866,344,000,000,000,000,000,000,000 | 7 | x86/xen: Use clear_bss() for Xen PV guests
Instead of clearing the bss area in assembly code, use the clear_bss()
function.
This requires to pass the start_info address as parameter to
xen_start_kernel() in order to avoid the xen_start_info being zeroed
again.
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-of... |
bool Item::save_in_param(THD *thd, Item_param *param)
{
return param->set_from_item(thd, this);
} | 0 | [
"CWE-416"
] | server | c02ebf3510850ba78a106be9974c94c3b97d8585 | 226,628,144,061,090,480,000,000,000,000,000,000,000 | 4 | MDEV-24176 Preparations
1. moved fix_vcol_exprs() call to open_table()
mysql_alter_table() doesn't do lock_tables() so it cannot win from
fix_vcol_exprs() from there. Tests affected: main.default_session
2. Vanilla cleanups and comments. |
static void analyze(JF, js_Ast *node)
{
if (isfun(node->type)) {
F->lightweight = 0;
return; /* don't scan inner functions */
}
if (node->type == STM_WITH) {
F->lightweight = 0;
}
if (node->type == STM_TRY && node->c) {
F->lightweight = 0;
}
if (node->type == EXP_IDENTIFIER) {
if (!strcmp(node->stri... | 0 | [
"CWE-476"
] | mujs | 5008105780c0b0182ea6eda83ad5598f225be3ee | 6,460,904,612,113,289,000,000,000,000,000,000,000 | 32 | Fix 697172: degenerate labeled break/continue statement.
A labeled break statement will look for a matching label through
its chain of parent statements. We start looking at the break statement
though, so if the label is attached to the break, we'll return the break
statement itself as a break target.
Start looking f... |
entry_callback (GtkWidget *widget,
gpointer data)
{
strncpy (info.description, gtk_entry_get_text (GTK_ENTRY (widget)),
sizeof (info.description));
info.description[sizeof (info.description) - 1] = '\0';
} | 0 | [
"CWE-125"
] | gimp | c57f9dcf1934a9ab0cd67650f2dea18cb0902270 | 21,891,591,104,902,230,000,000,000,000,000,000,000 | 7 | Bug 790784 - (CVE-2017-17784) heap overread in gbr parser / load_image.
We were assuming the input name was well formed, hence was
nul-terminated. As any data coming from external input, this has to be
thorougly checked.
Similar to commit 06d24a79af94837d615d0024916bb95a01bf3c59 but adapted
to older gimp-2-8 code. |
static void bpf_prog_uncharge_memlock(struct bpf_prog *prog)
{
struct user_struct *user = prog->aux->user;
atomic_long_sub(prog->pages, &user->locked_vm);
free_uid(user);
} | 0 | [
"CWE-703"
] | linux | 92117d8443bc5afacc8d5ba82e541946310f106e | 32,269,133,176,952,170,000,000,000,000,000,000,000 | 7 | bpf: fix refcnt overflow
On a system with >32Gbyte of phyiscal memory and infinite RLIMIT_MEMLOCK,
the malicious application may overflow 32-bit bpf program refcnt.
It's also possible to overflow map refcnt on 1Tb system.
Impose 32k hard limit which means that the same bpf program or
map cannot be shared by more than ... |
static int nb_add_signature (lcc_network_buffer_t *nb) /* {{{ */
{
char *buffer;
size_t buffer_size;
gcry_md_hd_t hd;
gcry_error_t err;
unsigned char *hash;
const size_t hash_length = 32;
/* The type, length and username have already been filled in by
* "lcc_network_buffer_initialize". All we do here... | 0 | [
"CWE-119"
] | collectd | 8b4fed9940e02138b7e273e56863df03d1a39ef7 | 10,186,193,569,677,168,000,000,000,000,000,000,000 | 45 | network plugin, libcollectdclient: Check return value of gcry_control().
Fixes: #1665 |
pwg_unppdize_name(const char *ppd, /* I - PPD keyword */
char *name, /* I - Name buffer */
size_t namesize, /* I - Size of name buffer */
const char *dashchars)/* I - Characters to be replaced by dashes */
{
char *ptr, /* Pointer into name buffer */
*end; /* En... | 0 | [
"CWE-93"
] | cups | 07428f6a640ff93aa0b4cc69ca372e2cf8490e41 | 122,162,012,599,865,960,000,000,000,000,000,000,000 | 46 | Only list supported PDLs (Issue #4923) |
wc_ucs_totitle(wc_uint32 ucs)
{
wc_map *conv = NULL;
if (ucs <= WC_C_UCS2_END)
conv = wc_map_search((wc_uint16)ucs,
ucs_totitle_map, N_ucs_totitle_map);
return conv ? (wc_uint32)(conv->code2) : ucs;
} | 0 | [
"CWE-119"
] | w3m | 716bc126638393c733399d11d3228edb82877faa | 280,422,416,351,596,800,000,000,000,000,000,000,000 | 8 | Prevent global-buffer-overflow in wc_any_to_ucs()
Bug-Debian: https://github.com/tats/w3m/issues/43 |
static void flush_pq_iowait(struct hfi1_user_sdma_pkt_q *pq)
{
unsigned long flags;
seqlock_t *lock = pq->busy.lock;
if (!lock)
return;
write_seqlock_irqsave(lock, flags);
if (!list_empty(&pq->busy.list)) {
list_del_init(&pq->busy.list);
pq->busy.lock = NULL;
}
write_sequnlock_irqrestore(lock, flags);
} | 0 | [
"CWE-416"
] | linux | 3d2a9d642512c21a12d19b9250e7a835dcb41a79 | 132,845,071,695,486,750,000,000,000,000,000,000,000 | 14 | IB/hfi1: Ensure correct mm is used at all times
Two earlier bug fixes have created a security problem in the hfi1
driver. One fix aimed to solve an issue where current->mm was not valid
when closing the hfi1 cdev. It attempted to do this by saving a cached
value of the current->mm pointer at file open time. This is a ... |
qmerge_key_init (struct qmerge_key *qmk, const char *q,
const char qtype[2], const char *control)
{
if (!dns_domain_copy (&qmk->q, q))
return 0;
byte_copy (qmk->qtype, 2, qtype);
if (!dns_domain_copy (&qmk->control, control))
return 0;
return 1;
} | 0 | [
"CWE-362"
] | ndjbdns | 847523271f3966cf4618c5689b905703c41dec1c | 151,408,485,107,021,790,000,000,000,000,000,000,000 | 12 | Merge identical outgoing requests.
This patch fixes dnscache to combine *same* client queries into one
single outgoing request, thus securing the server from possible cache
poisoning attacks. This fixes one of the cache poisoning vulnerability
reported by Mr Mark Johnson
-> https://bugzilla.redhat.com/show_bug.cgi?id... |
static void _slurm_rpc_dump_nodes(slurm_msg_t * msg)
{
DEF_TIMERS;
char *dump;
int dump_size;
slurm_msg_t response_msg;
node_info_request_msg_t *node_req_msg =
(node_info_request_msg_t *) msg->data;
/* Locks: Read config, write node (reset allocated CPU count in some
* select plugins), read part (for part_is_... | 0 | [
"CWE-20"
] | slurm | 033dc0d1d28b8d2ba1a5187f564a01c15187eb4e | 326,832,299,128,033,400,000,000,000,000,000,000,000 | 58 | Fix insecure handling of job requested gid.
Only trust MUNGE signed values, unless the RPC was signed by
SlurmUser or root.
CVE-2018-10995. |
static void interface_release_resource(QXLInstance *sin,
QXLReleaseInfoExt ext)
{
PCIQXLDevice *qxl = container_of(sin, PCIQXLDevice, ssd.qxl);
QXLReleaseRing *ring;
uint64_t *item, id;
if (ext.group_id == MEMSLOT_GROUP_HOST) {
/* host group -> vga mode up... | 1 | [
"CWE-476"
] | qemu | d52680fc932efb8a2f334cc6993e705ed1e31e99 | 137,601,713,232,703,200,000,000,000,000,000,000,000 | 45 | qxl: check release info object
When releasing spice resources in release_resource() routine,
if release info object 'ext.info' is null, it leads to null
pointer dereference. Add check to avoid it.
Reported-by: Bugs SysSec <bugs-syssec@rub.de>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Message-id: 20190425... |
int tcp_emu(struct socket *so, struct mbuf *m)
{
Slirp *slirp = so->slirp;
unsigned n1, n2, n3, n4, n5, n6;
char buff[257];
uint32_t laddr;
unsigned lport;
char *bptr;
DEBUG_CALL("tcp_emu");
DEBUG_ARG("so = %p", so);
DEBUG_ARG("m = %p", m);
switch (so->so_emu) {
int x, ... | 1 | [
"CWE-787"
] | libslirp | ce131029d6d4a405cb7d3ac6716d03e58fb4a5d9 | 47,300,590,118,503,960,000,000,000,000,000,000,000 | 340 | slirp: use correct size while emulating IRC commands
While emulating IRC DCC commands, tcp_emu() uses 'mbuf' size
'm->m_size' to write DCC commands via snprintf(3). This may
lead to OOB write access, because 'bptr' points somewhere in
the middle of 'mbuf' buffer, not at the start. Use M_FREEROOM(m)
size to avoid OOB a... |
autoar_extractor_get_common_prefix (GList *files,
GFile *root)
{
GFile *prefix;
GFile *file;
GList *l;
prefix = g_object_ref (files->data);
/* This can happen if the archive contains malformed paths that point outside
* of it
*/
if (!g_file_has_prefix (prefix, root... | 0 | [
"CWE-22"
] | gnome-autoar | adb067e645732fdbe7103516e506d09eb6a54429 | 19,428,530,662,645,688,000,000,000,000,000,000,000 | 33 | AutoarExtractor: Do not extract files outside the destination dir
Currently, a malicious archive can cause that the files are extracted
outside of the destination dir. This can happen if the archive contains
a file whose parent is a symbolic link, which points outside of the
destination dir. This is potentially a secu... |
gdk_pixbuf__gif_fill_vtable (GdkPixbufModule *module)
{
module->load = gdk_pixbuf__gif_image_load;
module->begin_load = gdk_pixbuf__gif_image_begin_load;
module->stop_load = gdk_pixbuf__gif_image_stop_load;
module->load_increment = gdk_pixbuf__gif_image_load_increment;
module->load_animation = gdk_pixbuf__gif... | 0 | [
"CWE-20"
] | gdk-pixbuf | 3bac204e0d0241a0d68586ece7099e6acf0e9bea | 156,731,427,491,579,840,000,000,000,000,000,000,000 | 8 | Initial stab at getting the focus code to work.
Fri Jun 1 18:54:47 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c: (gtk_tree_view_focus): Initial stab at
getting the focus code to work.
(gtk_tree_view_class_init): Add a bunch of keybindings.
* gtk/gtktreeviewcolumn.c
(gtk_tree_view_column_set_c... |
static int do_siocgstampns(struct net *net, struct socket *sock,
unsigned int cmd, struct compat_timespec __user *up)
{
mm_segment_t old_fs = get_fs();
struct timespec kts;
int err;
set_fs(KERNEL_DS);
err = sock_do_ioctl(net, sock, cmd, (unsigned long)&kts);
set_fs(old_fs);
if (!err) {
err = put_user(kts.... | 1 | [] | linux-2.6 | 644595f89620ba8446cc555be336d24a34464950 | 264,779,786,964,067,920,000,000,000,000,000,000,000 | 16 | compat: Handle COMPAT_USE_64BIT_TIME in net/socket.c
Use helper functions aware of COMPAT_USE_64BIT_TIME to write struct
timeval and struct timespec to userspace in net/socket.c.
Signed-off-by: H. Peter Anvin <hpa@zytor.com> |
static void io_init_new_worker(struct io_wqe *wqe, struct io_worker *worker,
struct task_struct *tsk)
{
tsk->pf_io_worker = worker;
worker->task = tsk;
set_cpus_allowed_ptr(tsk, wqe->cpu_mask);
tsk->flags |= PF_NO_SETAFFINITY;
raw_spin_lock(&wqe->lock);
hlist_nulls_add_head_rcu(&worker->nulls_node, &wq... | 0 | [
"CWE-200"
] | linux | 713b9825a4c47897f66ad69409581e7734a8728e | 219,791,876,737,464,840,000,000,000,000,000,000,000 | 15 | io-wq: fix cancellation on create-worker failure
WARNING: CPU: 0 PID: 10392 at fs/io_uring.c:1151 req_ref_put_and_test
fs/io_uring.c:1151 [inline]
WARNING: CPU: 0 PID: 10392 at fs/io_uring.c:1151 req_ref_put_and_test
fs/io_uring.c:1146 [inline]
WARNING: CPU: 0 PID: 10392 at fs/io_uring.c:1151
io_req_complete_post+0xf5... |
static PHP_FUNCTION(xmlwriter_text)
{
php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterWriteString, NULL);
} | 0 | [
"CWE-20"
] | php-src | 52b93f0cfd3cba7ff98cc5198df6ca4f23865f80 | 275,786,103,446,037,330,000,000,000,000,000,000,000 | 4 | Fixed bug #69353 (Missing null byte checks for paths in various PHP extensions) |
extension_info_stop (NautilusDirectory *directory)
{
if (directory->details->extension_info_in_progress != NULL) {
NautilusFile *file;
file = directory->details->extension_info_file;
if (file != NULL) {
g_assert (NAUTILUS_IS_FILE (file));
g_assert (file->details->directory == directory);
if (is_needy (... | 0 | [] | nautilus | 7632a3e13874a2c5e8988428ca913620a25df983 | 163,587,613,130,050,880,000,000,000,000,000,000,000 | 18 | Check for trusted desktop file launchers.
2009-02-24 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-directory-async.c:
Check for trusted desktop file launchers.
* libnautilus-private/nautilus-file-private.h:
* libnautilus-private/nautilus-file.c:
* libnautilus-... |
void wake_up_nohz_cpu(int cpu)
{
if (!wake_up_full_nohz_cpu(cpu))
wake_up_idle_cpu(cpu);
} | 0 | [
"CWE-119"
] | linux | 29d6455178a09e1dc340380c582b13356227e8df | 84,806,891,936,380,960,000,000,000,000,000,000,000 | 5 | sched: panic on corrupted stack end
Until now, hitting this BUG_ON caused a recursive oops (because oops
handling involves do_exit(), which calls into the scheduler, which in
turn raises an oops), which caused stuff below the stack to be
overwritten until a panic happened (e.g. via an oops in interrupt
context, cause... |
static void i40e_free_misc_vector(struct i40e_pf *pf)
{
/* Disable ICR 0 */
wr32(&pf->hw, I40E_PFINT_ICR0_ENA, 0);
i40e_flush(&pf->hw);
if (pf->flags & I40E_FLAG_MSIX_ENABLED && pf->msix_entries) {
synchronize_irq(pf->msix_entries[0].vector);
free_irq(pf->msix_entries[0].vector, pf);
clear_bit(__I40E_MISC_IR... | 0 | [
"CWE-400",
"CWE-401"
] | linux | 27d461333459d282ffa4a2bdb6b215a59d493a8f | 256,488,593,477,395,750,000,000,000,000,000,000,000 | 12 | 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> |
static bool is_pkt_reg(struct bpf_verifier_env *env, int regno)
{
const struct bpf_reg_state *reg = reg_state(env, regno);
return type_is_pkt_pointer(reg->type);
} | 0 | [
"CWE-703",
"CWE-189"
] | linux | 979d63d50c0c0f7bc537bf821e056cc9fe5abd38 | 270,415,346,514,080,840,000,000,000,000,000,000,000 | 6 | bpf: prevent out of bounds speculation on pointer arithmetic
Jann reported that the original commit back in b2157399cc98
("bpf: prevent out-of-bounds speculation") was not sufficient
to stop CPU from speculating out of bounds memory access:
While b2157399cc98 only focussed on masking array map access
for unprivileged ... |
inline static void _slurm_rpc_top_job(slurm_msg_t * msg)
{
int error_code = SLURM_SUCCESS;
DEF_TIMERS;
top_job_msg_t *top_ptr = (top_job_msg_t *) msg->data;
/* Locks: write job */
slurmctld_lock_t job_write_lock = {
NO_LOCK, WRITE_LOCK, NO_LOCK, NO_LOCK, NO_LOCK };
uid_t uid = g_slurm_auth_get_uid(msg->auth_cre... | 0 | [
"CWE-20"
] | slurm | 033dc0d1d28b8d2ba1a5187f564a01c15187eb4e | 239,655,109,813,917,670,000,000,000,000,000,000,000 | 28 | Fix insecure handling of job requested gid.
Only trust MUNGE signed values, unless the RPC was signed by
SlurmUser or root.
CVE-2018-10995. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.