func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
ex_later(exarg_T *eap)
{
long count = 0;
int sec = FALSE;
int file = FALSE;
char_u *p = eap->arg;
if (*p == NUL)
count = 1;
else if (isdigit(*p))
{
count = getdigits(&p);
switch (*p)
{
case 's': ++p; sec = TRUE; break;
case 'm': ++p; sec = TRUE; count *= 60; break;
case... | 0 | [
"CWE-125"
] | vim | d3a117814d6acbf0dca3eff1a7626843b9b3734a | 113,712,399,818,137,740,000,000,000,000,000,000,000 | 28 | patch 8.2.4009: reading one byte beyond the end of the line
Problem: Reading one byte beyond the end of the line.
Solution: Check for NUL byte first. |
dir_s_rmdir(VALUE obj, VALUE dir)
{
const char *p;
int r;
dir = check_dirname(dir);
p = RSTRING_PTR(dir);
r = (int)(VALUE)rb_thread_call_without_gvl(nogvl_rmdir, (void *)p, RUBY_UBF_IO, 0);
if (r < 0)
rb_sys_fail_path(dir);
return INT2FIX(0);
} | 0 | [
"CWE-22"
] | ruby | bd5661a3cbb38a8c3a3ea10cd76c88bbef7871b8 | 59,493,395,838,403,000,000,000,000,000,000,000,000 | 13 | dir.c: check NUL bytes
* dir.c (GlobPathValue): should be used in rb_push_glob only.
other methods should use FilePathValue.
https://hackerone.com/reports/302338
* dir.c (rb_push_glob): expand GlobPathValue
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
static void GTextFieldFit(GTextField *gt) {
GTextBounds bounds;
int as=0, ds, ld, width=0;
GRect inner, outer;
int bp = GBoxBorderWidth(gt->g.base,gt->g.box);
{
FontInstance *old = GDrawSetFont(gt->g.base,gt->font);
FontRequest rq;
int tries;
for ( tries = 0; tries<2; ++tries ) {
width = G... | 0 | [
"CWE-119",
"CWE-787"
] | fontforge | 626f751752875a0ddd74b9e217b6f4828713573c | 19,100,233,814,843,434,000,000,000,000,000,000,000 | 81 | Warn users before discarding their unsaved scripts (#3852)
* Warn users before discarding their unsaved scripts
This closes #3846. |
qemuPrepareNVRAM(virQEMUDriverConfigPtr cfg,
virDomainObjPtr vm)
{
int ret = -1;
int srcFD = -1;
int dstFD = -1;
virDomainLoaderDefPtr loader = vm->def->os.loader;
bool created = false;
const char *master_nvram_path;
ssize_t r;
if (!loader || !loader->nvram || virFileEx... | 0 | [
"CWE-416"
] | libvirt | 1ac703a7d0789e46833f4013a3876c2e3af18ec7 | 299,366,664,075,194,000,000,000,000,000,000,000,000 | 94 | 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... |
_archive_operation_completed (FrWindow *window,
FrAction action,
GError *error)
{
gboolean continue_batch = FALSE;
gboolean opens_dialog;
gboolean operation_canceled;
GFile *archive_dir;
gboolean is_temp_dir;
#ifdef DEBUG
debug (DEBUG_INFO, "%s [DONE] (FR::Window)\n", action_names[act... | 0 | [
"CWE-22"
] | file-roller | b147281293a8307808475e102a14857055f81631 | 160,258,787,851,709,900,000,000,000,000,000,000,000 | 148 | libarchive: sanitize filenames before extracting |
UTI_DoubleToNtp32(double x)
{
NTP_int32 r;
if (x >= MAX_NTP_INT32) {
r = 0xffffffff;
} else if (x <= 0.0) {
r = 0;
} else {
x *= 65536.0;
r = x;
/* Round up */
if (r < x)
r++;
}
return htonl(r);
} | 0 | [
"CWE-59"
] | chrony | 7a4c396bba8f92a3ee8018620983529152050c74 | 256,548,341,128,617,000,000,000,000,000,000,000,000 | 19 | util: add functions for common file operations
Add a function to open a file for reading, writing, or appending.
In uppercase modes errors are handled as fatal, i.e. the caller doesn't
need to check for NULL. To avoid string manipulations in the callers,
the function accepts an optional directory and suffix. New files... |
static bool isEmpty(const std::unique_ptr<folly::IOBuf>& str) {
return !str || str->empty();
} | 0 | [
"CWE-20",
"CWE-703",
"CWE-755"
] | fbthrift | c5d6e07588cd03061bc54d451a7fa6e84883d62b | 189,901,838,013,562,500,000,000,000,000,000,000,000 | 3 | Throw on bad types during skipping data
Summary:
The current code silently returns on bad types. In case when we have an invalid data, we may get a container of a large size with a bad type, this would lead to us running long loop doing nothing (though we already can say that the data is invalid).
The new code would ... |
static gnutls_datum_t load_file(const char *file)
{
FILE *f;
gnutls_datum_t loaded_file = { NULL, 0 };
long filelen;
void *ptr;
f = fopen(file, "rb");
if(!f)
return loaded_file;
if(fseek(f, 0, SEEK_END) != 0
|| (filelen = ftell(f)) < 0
|| fseek(f, 0, SEEK_SET) != 0
|| !(ptr = malloc((s... | 0 | [
"CWE-290"
] | curl | b09c8ee15771c614c4bf3ddac893cdb12187c844 | 328,827,383,575,000,240,000,000,000,000,000,000,000 | 26 | vtls: add 'isproxy' argument to Curl_ssl_get/addsessionid()
To make sure we set and extract the correct session.
Reported-by: Mingtao Yang
Bug: https://curl.se/docs/CVE-2021-22890.html
CVE-2021-22890 |
static RELOC_PTRS_WITH(epo_reloc_ptrs, gx_device *dev)
{
dev->parent = gx_device_reloc_ptr(dev->parent, gcst);
dev->child = gx_device_reloc_ptr(dev->child, gcst);
}RELOC_PTRS_END | 0 | [] | ghostpdl | c9b362ba908ca4b1d7c72663a33229588012d7d9 | 311,362,164,308,290,650,000,000,000,000,000,000,000 | 5 | Bug 699670: disallow copying of the epo device
The erasepage optimisation (epo) subclass device shouldn't be allowed to be
copied because the subclass private data, child and parent pointers end up
being shared between the original device and the copy.
Add an epo_finish_copydevice which NULLs the three offending poin... |
void Downstream::add_retry() { ++num_retry_; } | 0 | [] | nghttp2 | 319d5ab1c6d916b6b8a0d85b2ae3f01b3ad04f2c | 71,122,156,381,411,660,000,000,000,000,000,000,000 | 1 | nghttpx: Fix request stall
Fix request stall if backend connection is reused and buffer is full. |
static bool anal_bb_edge (RCore *core, const char *input) {
// "afbe" switch-bb-addr case-bb-addr
char *arg = strdup (r_str_trim_head_ro (input));
char *sp = strchr (arg, ' ');
bool ret = false;
if (sp) {
*sp++ = 0;
ut64 switch_addr = r_num_math (core->num, arg);
ut64 case_addr = r_num_math (core->num, sp);
... | 0 | [
"CWE-703",
"CWE-908"
] | radare2 | 4d3811681a80f92a53e795f6a64c4b0fc2c8dd22 | 36,083,430,758,314,353,000,000,000,000,000,000,000 | 19 | Fix segfault in adf (#16230) |
bool is_path_reachable(struct mount *mnt, struct dentry *dentry,
const struct path *root)
{
while (&mnt->mnt != root->mnt && mnt_has_parent(mnt)) {
dentry = mnt->mnt_mountpoint;
mnt = mnt->mnt_parent;
}
return &mnt->mnt == root->mnt && is_subdir(dentry, root->dentry);
} | 0 | [
"CWE-269"
] | user-namespace | a6138db815df5ee542d848318e5dae681590fccd | 152,703,267,211,086,640,000,000,000,000,000,000,000 | 9 | 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... |
bool CModule::RemCommand(const CString& sCmd) {
return m_mCommands.erase(sCmd) > 0;
} | 0 | [
"CWE-20",
"CWE-264"
] | znc | 8de9e376ce531fe7f3c8b0aa4876d15b479b7311 | 59,407,677,858,741,340,000,000,000,000,000,000,000 | 3 | Fix remote code execution and privilege escalation vulnerability.
To trigger this, need to have a user already.
Thanks for Jeriko One <jeriko.one@gmx.us> for finding and reporting this.
CVE-2019-12816 |
int X509V3_add_value(const char *name, const char *value,
STACK_OF(CONF_VALUE) **extlist)
{
CONF_VALUE *vtmp = NULL;
char *tname = NULL, *tvalue = NULL;
if(name && !(tname = BUF_strdup(name))) goto err;
if(value && !(tvalue = BUF_strdup(value))) goto err;;
if(!(vtmp = (CONF_VALUE *)OPENSSL_malloc(sizeof(CONF... | 0 | [] | openssl | c7235be6e36c4bef84594aa3b2f0561db84b63d8 | 117,497,743,306,174,080,000,000,000,000,000,000,000 | 21 | RFC 3161 compliant time stamp request creation, response generation
and response verification.
Submitted by: Zoltan Glozik <zglozik@opentsa.org>
Reviewed by: Ulf Moeller |
void SimpleMessenger::learned_addr(const entity_addr_t &peer_addr_for_me)
{
// be careful here: multiple threads may block here, and readers of
// my_inst.addr do NOT hold any lock.
// this always goes from true -> false under the protection of the
// mutex. if it is already false, we need not retake the mute... | 0 | [
"CWE-287",
"CWE-284"
] | ceph | 5ead97120e07054d80623dada90a5cc764c28468 | 17,565,630,273,477,065,000,000,000,000,000,000,000 | 25 | auth/cephx: add authorizer challenge
Allow the accepting side of a connection to reject an initial authorizer
with a random challenge. The connecting side then has to respond with an
updated authorizer proving they are able to decrypt the service's challenge
and that the new authorizer was produced for this specific ... |
static int btrfs_setsize(struct inode *inode, loff_t newsize)
{
struct btrfs_root *root = BTRFS_I(inode)->root;
struct btrfs_trans_handle *trans;
loff_t oldsize = i_size_read(inode);
int ret;
if (newsize == oldsize)
return 0;
if (newsize > oldsize) {
truncate_pagecache(inode, oldsize, newsize);
ret = btrf... | 0 | [
"CWE-310"
] | linux-2.6 | 9c52057c698fb96f8f07e7a4bcf4801a092bda89 | 241,377,776,735,023,420,000,000,000,000,000,000,000 | 42 | Btrfs: fix hash overflow handling
The handling for directory crc hash overflows was fairly obscure,
split_leaf returns EOVERFLOW when we try to extend the item and that is
supposed to bubble up to userland. For a while it did so, but along the
way we added better handling of errors and forced the FS readonly if we
hi... |
TIFFPredictorCleanup(TIFF* tif)
{
TIFFPredictorState* sp = PredictorState(tif);
assert(sp != 0);
tif->tif_tagmethods.vgetfield = sp->vgetparent;
tif->tif_tagmethods.vsetfield = sp->vsetparent;
tif->tif_tagmethods.printdir = sp->printdir;
tif->tif_setupdecode = sp->setupdecode;
tif->tif_setupencode = sp->setupe... | 0 | [
"CWE-119",
"CWE-787"
] | libtiff | 3ca657a8793dd011bf869695d72ad31c779c3cc1 | 113,342,988,190,446,280,000,000,000,000,000,000,000 | 14 | * libtiff/tif_predict.h, libtiff/tif_predict.c:
Replace assertions by runtime checks to avoid assertions in debug mode,
or buffer overflows in release mode. Can happen when dealing with
unusual tile size like YCbCr with subsampling. Reported as MSVR 35105
by Axel Souchet & Vishal Chauhan from the MSRC Vulnerabilities &... |
log_result(Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag, int nentries)
{
char *notes_str = NULL;
char notes_buf[256] = {0};
int internal_op;
CSN *operationcsn = NULL;
char csn_str[CSN_STRSIZE + 5];
char etime[ETIME_BUFSIZ] = {0};
char wtime[ETIME_BUFSIZ] = {0};
char optime[ETI... | 0 | [
"CWE-399",
"CWE-203"
] | 389-ds-base | cc0f69283abc082488824702dae485b8eae938bc | 105,729,343,572,997,750,000,000,000,000,000,000,000 | 214 | Issue 4480 - Unexpected info returned to ldap request (#4491)
Bug description:
If the bind entry does not exist, the bind result info
reports that 'No such entry'. It should not give any
information if the target entry exists or not
Fix description:
Does not return any additional information d... |
AuthDigestCred(struct http_auth *ha, Str uname, Str pw, ParsedURL *pu,
HRequest *hr, FormList *request)
{
Str tmp, a1buf, a2buf, rd, s;
unsigned char md5[MD5_DIGEST_LENGTH + 1];
Str uri = HTTPrequestURI(pu, hr);
char nc[] = "00000001";
FILE *fp;
Str algorithm = qstr_unquote(get_auth_par... | 0 | [
"CWE-476"
] | w3m | 59b91cd8e30c86f23476fa81ae005cabff49ebb6 | 205,462,555,070,043,860,000,000,000,000,000,000,000 | 180 | Prevent segfault with malformed input type
Bug-Debian: https://github.com/tats/w3m/issues/7 |
gst_qtdemux_push_pending_newsegment (GstQTDemux * qtdemux)
{
if (qtdemux->pending_newsegment) {
gst_qtdemux_push_event (qtdemux, qtdemux->pending_newsegment);
qtdemux->pending_newsegment = NULL;
}
} | 0 | [
"CWE-125"
] | gst-plugins-good | d0949baf3dadea6021d54abef6802fed5a06af75 | 180,975,814,766,760,040,000,000,000,000,000,000,000 | 7 | qtdemux: Fix out of bounds read in tag parsing code
We can't simply assume that the length of the tag value as given
inside the stream is correct but should also check against the amount of
data we have actually available.
https://bugzilla.gnome.org/show_bug.cgi?id=775451 |
GuestUserList *qmp_guest_get_users(Error **errp)
{
error_setg(errp, QERR_UNSUPPORTED);
return NULL;
} | 0 | [
"CWE-190"
] | qemu | 141b197408ab398c4f474ac1a728ab316e921f2b | 264,313,408,074,518,660,000,000,000,000,000,000,000 | 5 | 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... |
int qemu_console_get_height(QemuConsole *con, int fallback)
{
if (con == NULL) {
con = active_console;
}
return con ? surface_height(con->surface) : fallback;
} | 0 | [
"CWE-416"
] | qemu | a4afa548fc6dd9842ed86639b4d37d4d1c4ad480 | 74,662,436,053,201,010,000,000,000,000,000,000,000 | 7 | char: move front end handlers in CharBackend
Since the hanlders are associated with a CharBackend, rather than the
CharDriverState, it is more appropriate to store in CharBackend. This
avoids the handler copy dance in qemu_chr_fe_set_handlers() then
mux_chr_update_read_handler(), by storing the CharBackend pointer
dir... |
static void cirrus_mem_writeb_mode4and5_8bpp(CirrusVGAState * s,
unsigned mode,
unsigned offset,
uint32_t mem_value)
{
int x;
unsigned val = mem_value;
uint8_t *dst;
dst = s->vram_ptr + (offset &= s->cirrus_addr_mask);
for (x = 0; x < 8; x++) {
if (val & 0x80) {
... | 0 | [
"CWE-787"
] | qemu | b2eb849d4b1fdb6f35d5c46958c7f703cf64cfef | 57,435,100,515,244,520,000,000,000,000,000,000,000 | 22 | CVE-2007-1320 - Cirrus LGD-54XX "bitblt" heap overflow
I have just noticed that patch for CVE-2007-1320 has never been applied
to the QEMU CVS. Please find it below.
| Multiple heap-based buffer overflows in the cirrus_invalidate_region
| function in the Cirrus VGA extension in QEMU 0.8.2, as used in Xen and
| possib... |
MONGO_EXPORT void mongo_cursor_set_query( mongo_cursor *cursor, const bson *query ) {
cursor->query = query;
} | 0 | [
"CWE-190"
] | mongo-c-driver-legacy | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | 9,306,004,340,794,379,000,000,000,000,000,000,000 | 3 | don't mix up int and size_t (first pass to fix that) |
xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt,
xmlParserErrors error,
xmlNodePtr node,
xmlSchemaTypePtr type ATTRIBUTE_UNUSED,
const char *message,
int nbval,
int nbneg,
xmlChar **values)
{
xmlChar *str = NULL, *msg = NULL;
xmlChar *localName, *nsName;
const xmlCh... | 0 | [
"CWE-134"
] | libxml2 | 502f6a6d08b08c04b3ddfb1cd21b2f699c1b7f5b | 213,943,177,750,550,020,000,000,000,000,000,000,000 | 98 | 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 |
bool ProtocolV2::append_frame(F& frame) {
ceph::bufferlist bl;
try {
bl = frame.get_buffer(session_stream_handlers);
} catch (ceph::crypto::onwire::TxHandlerError &e) {
ldout(cct, 1) << __func__ << " " << e.what() << dendl;
return false;
}
connection->outgoing_bl.append(bl);
return true;
} | 0 | [
"CWE-323"
] | ceph | 20b7bb685c5ea74c651ca1ea547ac66b0fee7035 | 89,906,178,796,017,700,000,000,000,000,000,000,000 | 11 | msg/async/ProtocolV2: avoid AES-GCM nonce reuse vulnerabilities
The secure mode uses AES-128-GCM with 96-bit nonces consisting of a
32-bit counter followed by a 64-bit salt. The counter is incremented
after processing each frame, the salt is fixed for the duration of
the session. Both are initialized from the sessio... |
int main()
{
FILE *sec_file = fopen("amanda-security.conf", "w");
if (!sec_file) {
fprintf(stderr,"Can't create amanda-security.conf");
exit(1);
}
fprintf(sec_file,"############################################################\n");
fprintf(sec_file,"# /etc/amanda-security.conf ... | 0 | [
"CWE-264"
] | amanda | 4bf5b9b356848da98560ffbb3a07a9cb5c4ea6d7 | 63,845,783,941,005,250,000,000,000,000,000,000,000 | 60 | * Add a /etc/amanda-security.conf file
git-svn-id: https://svn.code.sf.net/p/amanda/code/amanda/branches/3_3@6486 a8d146d6-cc15-0410-8900-af154a0219e0 |
static int vsock_send_shutdown(struct sock *sk, int mode)
{
return transport->shutdown(vsock_sk(sk), mode);
} | 0 | [
"CWE-20",
"CWE-269"
] | linux | f3d3342602f8bcbf37d7c46641cb9bca7618eb1c | 1,520,438,837,921,698,200,000,000,000,000,000,000 | 4 | 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... |
unsigned dev_get_flags(const struct net_device *dev)
{
unsigned flags;
flags = (dev->flags & ~(IFF_PROMISC |
IFF_ALLMULTI |
IFF_RUNNING |
IFF_LOWER_UP |
IFF_DORMANT)) |
(dev->gflags & (IFF_PROMISC |
IFF_ALLMULTI));
if (netif_running(dev)) {
if (netif_oper_up(dev))
flags |= IFF_RUNNING;
... | 0 | [
"CWE-399"
] | linux | 6ec82562ffc6f297d0de36d65776cff8e5704867 | 138,571,072,907,709,520,000,000,000,000,000,000,000 | 23 | veth: Dont kfree_skb() after dev_forward_skb()
In case of congestion, netif_rx() frees the skb, so we must assume
dev_forward_skb() also consume skb.
Bug introduced by commit 445409602c092
(veth: move loopback logic to common location)
We must change dev_forward_skb() to always consume skb, and veth to not
double fr... |
void expectData(std::string expected) {
EXPECT_CALL(*read_filter_, onNewConnection());
EXPECT_CALL(*read_filter_, onData(_, _))
.WillOnce(Invoke([&](Buffer::Instance& buffer, bool) -> Network::FilterStatus {
EXPECT_EQ(buffer.toString(), expected);
buffer.drain(expected.length());
... | 0 | [
"CWE-400"
] | envoy | dfddb529e914d794ac552e906b13d71233609bf7 | 332,425,235,332,619,450,000,000,000,000,000,000,000 | 12 | listener: Add configurable accepted connection limits (#153)
Add support for per-listener limits on accepted connections.
Signed-off-by: Tony Allen <tony@allen.gg> |
SDL_GetRGBA(Uint32 pixel, const SDL_PixelFormat * format,
Uint8 * r, Uint8 * g, Uint8 * b, Uint8 * a)
{
if (format->palette == NULL) {
unsigned v;
v = (pixel & format->Rmask) >> format->Rshift;
*r = SDL_expand_byte[format->Rloss][v];
v = (pixel & format->Gmask) >> format-... | 0 | [
"CWE-703",
"CWE-787"
] | SDL | 8c91cf7dba5193f5ce12d06db1336515851c9ee9 | 84,908,953,587,478,075,000,000,000,000,000,000,000 | 24 | Always create a full 256-entry map in case color values are out of range
Fixes https://github.com/libsdl-org/SDL/issues/5042 |
int APE::Properties::sampleRate() const
{
return d->sampleRate;
} | 0 | [] | taglib | 77d61c6eca4d08b9b025738acf6b926cc750db23 | 233,707,144,994,642,750,000,000,000,000,000,000,000 | 4 | Make sure to not try dividing by zero |
static BOOL update_read_multi_dstblt_order(wStream* s, const ORDER_INFO* orderInfo,
MULTI_DSTBLT_ORDER* multi_dstblt)
{
ORDER_FIELD_COORD(1, multi_dstblt->nLeftRect);
ORDER_FIELD_COORD(2, multi_dstblt->nTopRect);
ORDER_FIELD_COORD(3, multi_dstblt->nWidth);
ORDER_FIELD_COOR... | 1 | [
"CWE-125"
] | FreeRDP | 907640a924fa7a9a99c80a48ac225e9d8e41548b | 141,361,143,726,521,310,000,000,000,000,000,000,000 | 21 | Fixed CVE-2020-11522: Limit number of DELTA_RECT to 45.
Thanks to Sunglin and HuanGMz from Knownsec 404 |
Status AuthorizationSession::addAndAuthorizeUser(OperationContext* txn, const UserName& userName) {
User* user;
Status status = getAuthorizationManager().acquireUser(txn, userName, &user);
if (!status.isOK()) {
return status;
}
// Calling add() on the UserSet may return a user that was repl... | 0 | [
"CWE-613"
] | mongo | 64d8e9e1b12d16b54d6a592bae8110226c491b4e | 1,512,429,256,129,989,700,000,000,000,000,000,000 | 20 | SERVER-38984 Validate unique User ID on UserCache hit
(cherry picked from commit e55d6e2292e5dbe2f97153251d8193d1cc89f5d7) |
formUpdateBuffer(Anchor *a, Buffer *buf, FormItemList *form)
{
Buffer save;
char *p;
int spos, epos, rows, c_rows, pos, col = 0;
Line *l;
copyBuffer(&save, buf);
gotoLine(buf, a->start.line);
switch (form->type) {
case FORM_TEXTAREA:
case FORM_INPUT_TEXT:
case FORM_INPUT_FILE:
... | 1 | [
"CWE-476"
] | w3m | 22d29c3d11bdfec80164789a99c36cc674340914 | 145,469,349,271,063,450,000,000,000,000,000,000,000 | 95 | Fix incorrect dereference in formUpdateBuffer when MENU_SELECT
cf. https://github.com/tats/w3m/commit/ec9eb22e008a69ea9dc21fdca4b9b836679965ee |
static void packet_id_queue_add(struct PacketIdQueue *q, uint64_t id)
{
USBRedirDevice *dev = q->dev;
struct PacketIdQueueEntry *e;
DPRINTF("adding packet id %"PRIu64" to %s queue\n", id, q->name);
e = g_new0(struct PacketIdQueueEntry, 1);
e->id = id;
QTAILQ_INSERT_TAIL(&q->head, e, next);
... | 0 | [
"CWE-770"
] | qemu | 7ec54f9eb62b5d177e30eb8b1cad795a5f8d8986 | 191,358,804,926,316,700,000,000,000,000,000,000,000 | 12 | usb/redir: avoid dynamic stack allocation (CVE-2021-3527)
Use autofree heap allocation instead.
Fixes: 4f4321c11ff ("usb: use iovecs in USBPacket")
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id:... |
static int evtchn_fifo_percpu_deinit(unsigned int cpu)
{
__evtchn_fifo_handle_events(cpu, true);
return 0;
} | 1 | [
"CWE-400",
"CWE-703"
] | linux | e99502f76271d6bc4e374fe368c50c67a1fd3070 | 231,270,439,729,336,150,000,000,000,000,000,000,000 | 5 | xen/events: defer eoi in case of excessive number of events
In case rogue guests are sending events at high frequency it might
happen that xen_evtchn_do_upcall() won't stop processing events in
dom0. As this is done in irq handling a crash might be the result.
In order to avoid that, delay further inter-domain events... |
similar_sgr(int num, char *a, char *b)
{
char *base_a = a;
char *base_b = b;
int delaying = 0;
while (*b != 0) {
while (*a != *b) {
if (*a == 0) {
if (num < 0) {
;
} else if (b[0] == '$'
&& b[1] == '<') {
_nc_warning("did not find delay %s", _nc_visbuf(b));
} else {
... | 0 | [] | ncurses | 790a85dbd4a81d5f5d8dd02a44d84f01512ef443 | 96,828,595,364,099,440,000,000,000,000,000,000,000 | 50 | 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... |
ZSTD_compressionParameters ZSTD_getCParamsFromCCtxParams(
const ZSTD_CCtx_params* CCtxParams, U64 srcSizeHint, size_t dictSize)
{
ZSTD_compressionParameters cParams = ZSTD_getCParams(CCtxParams->compressionLevel, srcSizeHint, dictSize);
if (CCtxParams->ldmParams.enableLdm) cParams.windowLog = ZSTD_LDM_D... | 0 | [
"CWE-362"
] | zstd | 3e5cdf1b6a85843e991d7d10f6a2567c15580da0 | 265,125,834,574,118,240,000,000,000,000,000,000,000 | 15 | fixed T36302429 |
int hashbin_delete( hashbin_t* hashbin, FREE_FUNC free_func)
{
irda_queue_t* queue;
unsigned long flags = 0;
int i;
IRDA_ASSERT(hashbin != NULL, return -1;);
IRDA_ASSERT(hashbin->magic == HB_MAGIC, return -1;);
/* Synchronize */
if (hashbin->hb_type & HB_LOCK)
spin_lock_irqsave(&hashbin->hb_spinlock, flags);... | 0 | [
"CWE-200"
] | linux | 4c03b862b12f980456f9de92db6d508a4999b788 | 238,620,854,487,017,180,000,000,000,000,000,000,000 | 49 | irda: Fix lockdep annotations in hashbin_delete().
A nested lock depth was added to the hasbin_delete() code but it
doesn't actually work some well and results in tons of lockdep splats.
Fix the code instead to properly drop the lock around the operation
and just keep peeking the head of the hashbin queue.
Reported-... |
static inline int io_iter_do_read(struct io_kiocb *req, struct iov_iter *iter)
{
if (req->file->f_op->read_iter)
return call_read_iter(req->file, &req->rw.kiocb, iter);
else if (req->file->f_op->read)
return loop_rw_iter(READ, req, iter);
else
return -EINVAL;
} | 0 | [
"CWE-125"
] | linux | 89c2b3b74918200e46699338d7bcc19b1ea12110 | 151,285,075,163,101,700,000,000,000,000,000,000,000 | 9 | io_uring: reexpand under-reexpanded iters
[ 74.211232] BUG: KASAN: stack-out-of-bounds in iov_iter_revert+0x809/0x900
[ 74.212778] Read of size 8 at addr ffff888025dc78b8 by task
syz-executor.0/828
[ 74.214756] CPU: 0 PID: 828 Comm: syz-executor.0 Not tainted
5.14.0-rc3-next-20210730 #1
[ 74.216525] Hardware n... |
onig_regset_number_of_regex(OnigRegSet* set)
{
return set->n;
} | 0 | [
"CWE-125"
] | oniguruma | 0463e21432515631a9bc925ce5eb95b097c73719 | 234,223,591,327,091,230,000,000,000,000,000,000,000 | 4 | fix #164: Integer overflow related to reg->dmax in search_in_range() |
GF_Err trak_box_read(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
u32 i;
GF_TrackBox *ptr = (GF_TrackBox *)s;
e = gf_isom_box_array_read(s, bs);
if (e) return e;
e = gf_isom_check_sample_desc(ptr);
if (e) return e;
if (!ptr->Header) {
GF_LOG(GF_LOG_ERROR, GF_LOG_CONTAINER, ("[iso file] Missing TrackHeaderBox\n")... | 0 | [
"CWE-787"
] | gpac | 77510778516803b7f7402d7423c6d6bef50254c3 | 28,819,179,069,398,637,000,000,000,000,000,000,000 | 42 | fixed #2255 |
mono_image_get_array_token (MonoDynamicImage *assembly, MonoReflectionArrayMethod *m)
{
guint32 nparams, i;
GList *tmp;
char *name;
MonoMethodSignature *sig;
ArrayMethod *am;
MonoType *mtype;
name = mono_string_to_utf8 (m->name);
nparams = mono_array_length (m->parameters);
sig = g_malloc0 (MONO_SIZEOF_METHOD... | 0 | [
"CWE-20"
] | mono | 4905ef1130feb26c3150b28b97e4a96752e0d399 | 123,683,310,360,497,150,000,000,000,000,000,000,000 | 42 | Handle invalid instantiation of generic methods.
* verify.c: Add new function to internal verifier API to check
method instantiations.
* reflection.c (mono_reflection_bind_generic_method_parameters):
Check the instantiation before returning it.
Fixes #655847 |
str_matches_option(const char *s1, const char *optionname)
{
/* Option names are given as "option:" We accept either 'option' in
* s1, or 'option:randomjunk'. The latter form is to implement the
* resolv.conf parser. */
size_t optlen = strlen(optionname);
size_t slen = strlen(s1);
if (slen == optlen || slen ==... | 0 | [
"CWE-125"
] | libevent | 96f64a022014a208105ead6c8a7066018449d86d | 139,517,038,208,047,150,000,000,000,000,000,000,000 | 14 | evdns: name_parse(): fix remote stack overread
@asn-the-goblin-slayer:
"the name_parse() function in libevent's DNS code is vulnerable to a buffer overread.
971 if (cp != name_out) {
972 if (cp + 1 >= end) return -1;
973 *cp++ = '.';
974 }
975 if (cp + ... |
Tensor get_allocated_tensor(int index) const {
return allocated_tensors_[index];
} | 0 | [
"CWE-476",
"CWE-703"
] | tensorflow | 6972f9dfe325636b3db4e0bc517ee22a159365c0 | 21,410,666,212,150,494,000,000,000,000,000,000,000 | 3 | Add missing valuidation to FusedBatchNorm.
PiperOrigin-RevId: 372460336
Change-Id: Ic8c4e4de67c58a741bd87f2e182bed07247d1126 |
static int read_download_mem(struct usb_device *dev, int start_address,
int length, __u8 address_type, __u8 *buffer)
{
int status = 0;
__u8 read_length;
u16 be_start_address;
dev_dbg(&dev->dev, "%s - @ %x for %d\n", __func__, start_address, length);
/*
* Read in blocks of 64 bytes
* (TI firmware can't ha... | 0 | [
"CWE-191"
] | linux | 654b404f2a222f918af9b0cd18ad469d0c941a8e | 135,454,135,543,063,220,000,000,000,000,000,000,000 | 48 | USB: serial: io_ti: fix information leak in completion handler
Add missing sanity check to the bulk-in completion handler to avoid an
integer underflow that can be triggered by a malicious device.
This avoids leaking 128 kB of memory content from after the URB transfer
buffer to user space.
Fixes: 8c209e6782ca ("USB... |
static int nested_check_host_control_regs(struct kvm_vcpu *vcpu,
struct vmcs12 *vmcs12)
{
bool ia32e;
if (!nested_host_cr0_valid(vcpu, vmcs12->host_cr0) ||
!nested_host_cr4_valid(vcpu, vmcs12->host_cr4) ||
!nested_cr3_valid(vcpu, vmcs12->host_cr3))
return -EINVAL... | 0 | [
"CWE-863"
] | kvm | acff78477b9b4f26ecdf65733a4ed77fe837e9dc | 223,612,197,043,426,200,000,000,000,000,000,000,000 | 31 | KVM: x86: nVMX: close leak of L0's x2APIC MSRs (CVE-2019-3887)
The nested_vmx_prepare_msr_bitmap() function doesn't directly guard the
x2APIC MSR intercepts with the "virtualize x2APIC mode" MSR. As a
result, we discovered the potential for a buggy or malicious L1 to get
access to L0's x2APIC MSRs, via an L2, as follo... |
static RBinSymbol *get_symbol(RBin *bin, RList *symbols, const char *name, ut64 addr) {
RBinSymbol *symbol;
RListIter *iter;
r_list_foreach (symbols, iter, symbol) {
if (name) {
if (!strcmp (symbol->name, name))
return symbol;
} else {
if (symbol->vaddr == addr) {
return symbol;
}
}
}
return... | 0 | [
"CWE-416"
] | radare2 | f85bc674b2a2256a364fe796351bc1971e106005 | 282,780,240,832,131,040,000,000,000,000,000,000,000 | 15 | Fix #7698 - UAF in r_config_set when loading a dex |
int mingw_raise(int sig)
{
switch (sig) {
case SIGALRM:
if (timer_fn == SIG_DFL) {
if (isatty(STDERR_FILENO))
fputs("Alarm clock\n", stderr);
exit(128 + SIGALRM);
} else if (timer_fn != SIG_IGN)
timer_fn(SIGALRM);
return 0;
case SIGINT:
if (sigint_fn == SIG_DFL)
exit(128 + SIGINT);
else if... | 0 | [
"CWE-20"
] | git | 6d8684161ee9c03bed5cb69ae76dfdddb85a0003 | 96,835,755,325,623,270,000,000,000,000,000,000,000 | 23 | mingw: fix quoting of arguments
We need to be careful to follow proper quoting rules. For example, if an
argument contains spaces, we have to quote them. Double-quotes need to
be escaped. Backslashes need to be escaped, but only if they are
followed by a double-quote character.
We need to be _extra_ careful to consid... |
push_wrote_body_data (SoupMessage *msg, SoupBuffer *chunk, gpointer user_data)
{
PushHandle *handle = user_data;
handle->n_written += chunk->length;
g_vfs_job_progress_callback (handle->n_written, handle->size, handle->job);
} | 0 | [] | gvfs | f81ff2108ab3b6e370f20dcadd8708d23f499184 | 121,011,858,792,813,810,000,000,000,000,000,000,000 | 7 | dav: don't unescape the uri twice
path_equal tries to unescape path before comparing. Unfortunately
this function is used also for already unescaped paths. Therefore
unescaping can fail. This commit reverts changes which was done in
commit 50af53d and unescape just uris, which aren't unescaped yet.
https://bugzilla.g... |
struct vfsmount *mnt_clone_internal(const struct path *path)
{
struct mount *p;
p = clone_mnt(real_mount(path->mnt), path->dentry, CL_PRIVATE);
if (IS_ERR(p))
return ERR_CAST(p);
p->mnt.mnt_flags |= MNT_INTERNAL;
return &p->mnt;
} | 0 | [
"CWE-200"
] | linux | 427215d85e8d1476da1a86b8d67aceb485eb3631 | 188,620,232,518,012,800,000,000,000,000,000,000,000 | 9 | ovl: prevent private clone if bind mount is not allowed
Add the following checks from __do_loopback() to clone_private_mount() as
well:
- verify that the mount is in the current namespace
- verify that there are no locked children
Reported-by: Alois Wohlschlager <alois1@gmx-topmail.de>
Fixes: c771d683a62e ("vfs: ... |
nfp_abm_u32_knode_replace(struct nfp_abm_link *alink,
struct tc_cls_u32_knode *knode,
__be16 proto, struct netlink_ext_ack *extack)
{
struct nfp_abm_u32_match *match = NULL, *iter;
unsigned int tos_off;
u8 mask, val;
int err;
if (!nfp_abm_u32_check_knode(alink->abm, knode, proto, extack))
goto err_del... | 1 | [
"CWE-400",
"CWE-401"
] | linux | 78beef629fd95be4ed853b2d37b832f766bd96ca | 323,320,439,813,425,730,000,000,000,000,000,000,000 | 56 | nfp: abm: fix memory leak in nfp_abm_u32_knode_replace
In nfp_abm_u32_knode_replace if the allocation for match fails it should
go to the error handling instead of returning. Updated other gotos to
have correct errno returned, too.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: David S. Mil... |
void Sys_ErrorDialog( const char *error )
{
char buffer[ 1024 ];
unsigned int size;
int f = -1;
const char *homepath = Cvar_VariableString( "fs_homepath" );
const char *gamedir = Cvar_VariableString( "fs_game" );
const char *fileName = "crashlog.txt";
char *ospath = FS_BuildOSPath( homepath, gamedir, fileName );... | 0 | [
"CWE-59"
] | ioq3 | b5acc31a4da72cc3a4a6d88facb15b6214d745c6 | 313,072,876,966,977,170,000,000,000,000,000,000,000 | 42 | CVE-2012-3345 |
GF_Err m4ds_box_size(GF_Box *s)
{
GF_Err e;
u32 descSize = 0;
GF_MPEG4ExtensionDescriptorsBox *ptr = (GF_MPEG4ExtensionDescriptorsBox *)s;
e = gf_odf_desc_list_size(ptr->descriptors, &descSize);
ptr->size += descSize;
return e;
} | 0 | [
"CWE-401"
] | gpac | 0a85029d694f992f3631e2f249e4999daee15cbf | 101,890,527,337,984,390,000,000,000,000,000,000,000 | 9 | fixed #1785 (fuzz) |
http_get_path(struct http_txn *txn)
{
char *ptr, *end;
ptr = txn->req.sol + txn->req.sl.rq.u;
end = ptr + txn->req.sl.rq.u_l;
if (ptr >= end)
return NULL;
/* RFC2616, par. 5.1.2 :
* Request-URI = "*" | absuri | abspath | authority
*/
if (*ptr == '*')
return NULL;
if (isalpha((unsigned char)*ptr)) {
... | 0 | [] | haproxy-1.4 | dc80672211e085c211f1fc47e15cfe57ab587d38 | 141,389,533,558,690,270,000,000,000,000,000,000,000 | 42 | BUG/CRITICAL: using HTTP information in tcp-request content may crash the process
During normal HTTP request processing, request buffers are realigned if
there are less than global.maxrewrite bytes available after them, in
order to leave enough room for rewriting headers after the request. This
is done in http_wait_fo... |
DEFUN (show_ipv6_bgp_summary,
show_ipv6_bgp_summary_cmd,
"show ipv6 bgp summary",
SHOW_STR
IPV6_STR
BGP_STR
"Summary of BGP neighbor status\n")
{
return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST);
} | 0 | [
"CWE-125"
] | frr | 6d58272b4cf96f0daa846210dd2104877900f921 | 99,882,602,557,833,520,000,000,000,000,000,000,000 | 10 | [bgpd] cleanup, compact and consolidate capability parsing code
2007-07-26 Paul Jakma <paul.jakma@sun.com>
* (general) Clean up and compact capability parsing slightly.
Consolidate validation of length and logging of generic TLV, and
memcpy of capability data, thus removing such from cap specifc
code (not a... |
StartLogicalReplication(StartReplicationCmd *cmd)
{
StringInfoData buf;
/* make sure that our requirements are still fulfilled */
CheckLogicalDecodingRequirements();
Assert(!MyReplicationSlot);
ReplicationSlotAcquire(cmd->slotname);
/*
* Force a disconnect, so that the decoding code doesn't need to care
*... | 0 | [
"CWE-89"
] | postgres | 2b3a8b20c2da9f39ffecae25ab7c66974fbc0d3b | 13,508,258,119,160,498,000,000,000,000,000,000,000 | 82 | Be more careful to not lose sync in the FE/BE protocol.
If any error occurred while we were in the middle of reading a protocol
message from the client, we could lose sync, and incorrectly try to
interpret a part of another message as a new protocol message. That will
usually lead to an "invalid frontend message" erro... |
static void __sctp_unhash_endpoint(struct sctp_endpoint *ep)
{
struct sctp_hashbucket *head;
struct sctp_ep_common *epb;
epb = &ep->base;
if (hlist_unhashed(&epb->node))
return;
epb->hashent = sctp_ep_hashfn(epb->bind_addr.port);
head = &sctp_ep_hashtable[epb->hashent];
sctp_write_lock(&head->lock);
__hl... | 0 | [
"CWE-362"
] | linux | ae53b5bd77719fed58086c5be60ce4f22bffe1c6 | 63,544,715,033,649,970,000,000,000,000,000,000,000 | 18 | sctp: Fix another socket race during accept/peeloff
There is a race between sctp_rcv() and sctp_accept() where we
have moved the association from the listening socket to the
accepted socket, but sctp_rcv() processing cached the old
socket and continues to use it.
The easy solution is to check for the socket mismatch ... |
static void l2cap_chan_le_connect_reject(struct l2cap_chan *chan)
{
struct l2cap_conn *conn = chan->conn;
struct l2cap_le_conn_rsp rsp;
u16 result;
if (test_bit(FLAG_DEFER_SETUP, &chan->flags))
result = L2CAP_CR_LE_AUTHORIZATION;
else
result = L2CAP_CR_LE_BAD_PSM;
l2cap_state_change(chan, BT_DISCONN);
rsp... | 0 | [
"CWE-125"
] | linux | 7c9cbd0b5e38a1672fcd137894ace3b042dfbf69 | 15,541,582,877,834,088,000,000,000,000,000,000,000 | 22 | Bluetooth: Verify that l2cap_get_conf_opt provides large enough buffer
The function l2cap_get_conf_opt will return L2CAP_CONF_OPT_SIZE + opt->len
as length value. The opt->len however is in control over the remote user
and can be used by an attacker to gain access beyond the bounds of the
actual packet.
To prevent an... |
ZSTD_buildCTable(void* dst, size_t dstCapacity,
FSE_CTable* nextCTable, U32 FSELog, symbolEncodingType_e type,
U32* count, U32 max,
const BYTE* codeTable, size_t nbSeq,
const S16* defaultNorm, U32 defaultNormLog, U32 defaultMax,
const FSE_C... | 1 | [
"CWE-362"
] | zstd | 3e5cdf1b6a85843e991d7d10f6a2567c15580da0 | 217,653,073,531,723,840,000,000,000,000,000,000,000 | 41 | fixed T36302429 |
fiber_switch_context(mrb_state *mrb, struct mrb_context *c)
{
if (mrb->c->fib) {
mrb_write_barrier(mrb, (struct RBasic*)mrb->c->fib);
}
c->status = MRB_FIBER_RUNNING;
mrb->c = c;
} | 0 | [
"CWE-476",
"CWE-703"
] | mruby | da48e7dbb20024c198493b8724adae1b842083aa | 142,716,961,386,070,750,000,000,000,000,000,000,000 | 8 | fiber.c: should pack 15+ arguments in an array. |
void LJ_FASTCALL lj_trace_free(global_State *g, GCtrace *T)
{
jit_State *J = G2J(g);
if (T->traceno) {
lj_gdbjit_deltrace(J, T);
if (T->traceno < J->freetrace)
J->freetrace = T->traceno;
setgcrefnull(J->trace[T->traceno]);
}
lj_mem_free(g, T,
((sizeof(GCtrace)+7)&~7) + (T->nins-T->nk)*size... | 0 | [
"CWE-125"
] | LuaJIT | 12ab596997b9cb27846a5b254d11230c3f9c50c8 | 125,852,098,356,919,140,000,000,000,000,000,000,000 | 13 | Fix handling of errors during snapshot restore. |
GF_Err stbl_AppendDegradation(GF_SampleTableBox *stbl, u16 DegradationPriority)
{
if (!stbl->DegradationPriority) {
stbl->DegradationPriority = (GF_DegradationPriorityBox *) gf_isom_box_new_parent(&stbl->child_boxes, GF_ISOM_BOX_TYPE_STDP);
if (!stbl->DegradationPriority) return GF_OUT_OF_MEM;
}
stbl->Degradati... | 0 | [
"CWE-120",
"CWE-787"
] | gpac | 77ed81c069e10b3861d88f72e1c6be1277ee7eae | 91,337,271,778,799,760,000,000,000,000,000,000,000 | 13 | fixed #1774 (fuzz) |
pgp_parse_and_set_pubkey_output(sc_card_t *card, u8* data, size_t data_len,
sc_cardctl_openpgp_keygen_info_t *key_info)
{
time_t ctime = 0;
u8 *in = data;
u8 *modulus = NULL;
u8 *exponent = NULL;
int r;
LOG_FUNC_CALLED(card->ctx);
/* store creation time */
r = pgp_store_creation... | 0 | [
"CWE-125"
] | OpenSC | 8fe377e93b4b56060e5bbfb6f3142ceaeca744fa | 174,105,203,724,535,450,000,000,000,000,000,000,000 | 69 | fixed out of bounds reads
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting and suggesting security fixes. |
static bool bond_should_notify_peers(struct bonding *bond)
{
struct slave *slave = bond->curr_active_slave;
pr_debug("bond_should_notify_peers: bond %s slave %s\n",
bond->dev->name, slave ? slave->dev->name : "NULL");
if (!slave || !bond->send_peer_notif ||
test_bit(__LINK_STATE_LINKWATCH_PENDING, &slave->... | 0 | [
"CWE-703",
"CWE-264"
] | linux | 550fd08c2cebad61c548def135f67aba284c6162 | 195,334,904,386,090,470,000,000,000,000,000,000,000 | 14 | net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared
After the last patch, We are left in a state in which only drivers calling
ether_setup have IFF_TX_SKB_SHARING set (we assume that drivers touching real
hardware call ether_setup for their net_devices and don't hold any state in
their skbs. There... |
initialize_readline ()
{
rl_command_func_t *func;
char kseq[2];
if (bash_readline_initialized)
return;
rl_terminal_name = get_string_value ("TERM");
rl_instream = stdin;
rl_outstream = stderr;
/* Allow conditional parsing of the ~/.inputrc file. */
rl_readline_name = "Bash";
/* Add bindable na... | 0 | [
"CWE-20"
] | bash | 4f747edc625815f449048579f6e65869914dd715 | 322,939,680,680,232,900,000,000,000,000,000,000,000 | 187 | Bash-4.4 patch 7 |
virDomainGetNumaParameters(virDomainPtr domain,
virTypedParameterPtr params,
int *nparams, unsigned int flags)
{
virConnectPtr conn;
VIR_DOMAIN_DEBUG(domain, "params=%p, nparams=%d, flags=%x",
params, (nparams) ? *nparams : -1, flags);
... | 0 | [
"CWE-254"
] | libvirt | 506e9d6c2d4baaf580d489fff0690c0ff2ff588f | 324,272,769,708,873,030,000,000,000,000,000,000,000 | 37 | virDomainGetTime: Deny on RO connections
We have a policy that if API may end up talking to a guest agent
it should require RW connection. We don't obey the rule in
virDomainGetTime().
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> |
static int sctp_getsockopt_rtoinfo(struct sock *sk, int len,
char __user *optval,
int __user *optlen) {
struct sctp_rtoinfo rtoinfo;
struct sctp_association *asoc;
if (len < sizeof (struct sctp_rtoinfo))
return -EINVAL;
len = sizeof(struct sctp_rtoinfo);
if (copy_from_user(&rtoinfo, optval, len))
re... | 0 | [] | linux-2.6 | 5e739d1752aca4e8f3e794d431503bfca3162df4 | 168,707,187,318,322,400,000,000,000,000,000,000,000 | 41 | sctp: fix potential panics in the SCTP-AUTH API.
All of the SCTP-AUTH socket options could cause a panic
if the extension is disabled and the API is envoked.
Additionally, there were some additional assumptions that
certain pointers would always be valid which may not
always be the case.
This patch hardens the API a... |
int ssl3_check_cert_and_algorithm(SSL *s)
{
int i, idx;
long alg_k, alg_a;
EVP_PKEY *pkey = NULL;
int pkey_bits;
SESS_CERT *sc;
#ifndef OPENSSL_NO_RSA
RSA *rsa;
#endif
#ifndef OPENSSL_NO_DH
DH *dh;
#endif
alg_k = s->s3->tmp.new_cipher->algorithm_mkey;
alg_a = s->s3->tmp.new_cipher->... | 0 | [
"CWE-362"
] | openssl | 98ece4eebfb6cd45cc8d550c6ac0022965071afc | 58,019,889,565,290,800,000,000,000,000,000,000,000 | 137 | Fix race condition in NewSessionTicket
If a NewSessionTicket is received by a multi-threaded client when
attempting to reuse a previous ticket then a race condition can occur
potentially leading to a double free of the ticket data.
CVE-2015-1791
This also fixes RT#3808 where a session ID is changed for a session alr... |
format_absolute_time(uint64_t t, char *buf, size_t len)
{
time_t tt = t > SSH_TIME_T_MAX ? SSH_TIME_T_MAX : t;
struct tm tm;
localtime_r(&tt, &tm);
strftime(buf, len, "%Y-%m-%dT%H:%M:%S", &tm);
} | 0 | [] | openssh-portable | f3cbe43e28fe71427d41cfe3a17125b972710455 | 215,319,607,407,346,880,000,000,000,000,000,000,000 | 8 | upstream: need initgroups() before setresgid(); reported by anton@,
ok deraadt@
OpenBSD-Commit-ID: 6aa003ee658b316960d94078f2a16edbc25087ce |
T& atXYZ(const int x, const int y, const int z, const int c=0) {
if (is_empty())
throw CImgInstanceException(_cimg_instance
"atXYZ(): Empty instance.",
cimg_instance);
return _atXYZ(x,y,z,c);
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 51,183,202,634,922,870,000,000,000,000,000,000,000 | 7 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
bool IsSupported(const NodeDef* node) const override {
return IsAggregate(*node) && NumNonControlInputs(*node) > 1 &&
!IsRewritten(node);
} | 0 | [
"CWE-476"
] | tensorflow | e6340f0665d53716ef3197ada88936c2a5f7a2d3 | 211,010,971,874,818,580,000,000,000,000,000,000,000 | 4 | 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 int init_victim_secmap(struct f2fs_sb_info *sbi)
{
struct dirty_seglist_info *dirty_i = DIRTY_I(sbi);
unsigned int bitmap_size = f2fs_bitmap_size(MAIN_SECS(sbi));
dirty_i->victim_secmap = f2fs_kvzalloc(bitmap_size, GFP_KERNEL);
if (!dirty_i->victim_secmap)
return -ENOMEM;
return 0;
} | 0 | [
"CWE-200",
"CWE-476"
] | linux | d4fdf8ba0e5808ba9ad6b44337783bd9935e0982 | 228,864,418,088,195,300,000,000,000,000,000,000,000 | 10 | f2fs: fix a panic caused by NULL flush_cmd_control
Mount fs with option noflush_merge, boot failed for illegal address
fcc in function f2fs_issue_flush:
if (!test_opt(sbi, FLUSH_MERGE)) {
ret = submit_flush_wait(sbi);
atomic_inc(&fcc->issued_flush); -> Here, fcc illegal
... |
static int uac_clock_selector_set_val(struct snd_usb_audio *chip, int selector_id,
unsigned char pin)
{
int ret;
ret = snd_usb_ctl_msg(chip->dev, usb_sndctrlpipe(chip->dev, 0),
UAC2_CS_CUR,
USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_OUT,
UAC2_CX_CLOCK_SELECTOR << 8,
snd_u... | 0 | [] | sound | 447d6275f0c21f6cc97a88b3a0c601436a4cdf2a | 148,714,639,804,660,720,000,000,000,000,000,000,000 | 34 | ALSA: usb-audio: Add sanity checks for endpoint accesses
Add some sanity check codes before actually accessing the endpoint via
get_endpoint() in order to avoid the invalid access through a
malformed USB descriptor. Mostly just checking bNumEndpoints, but in
one place (snd_microii_spdif_default_get()), the validity o... |
asn1_get_bit_der (const unsigned char *der, int der_len,
int *ret_len, unsigned char *str, int str_size,
int *bit_len)
{
int len_len = 0, len_byte;
if (der_len <= 0)
return ASN1_GENERIC_ERROR;
len_byte = asn1_get_length_der (der, der_len, &len_len) - 1;
if (len_byte < 0)
return ASN1_DER_ERROR;... | 0 | [
"CWE-476"
] | libtasn1 | 53958290ab731c8486531a3bdef54a933533579d | 337,095,427,300,063,700,000,000,000,000,000,000,000 | 31 | Allow a NULL value in asn1_read_value() for all types. |
int copy_xattrs(const char *source, const char *dest)
{
ssize_t list_len, name_len;
size_t datum_len;
char *name, *ptr;
#ifdef HAVE_LINUX_XATTRS
int user_only = am_sender ? 0 : am_root <= 0;
#endif
/* This puts the name list into the "namebuf" buffer. */
if ((list_len = get_xattr_names(source)) < 0)
return -1;... | 0 | [
"CWE-125"
] | rsync | 47a63d90e71d3e19e0e96052bb8c6b9cb140ecc1 | 75,281,318,389,022,830,000,000,000,000,000,000,000 | 43 | Enforce trailing \0 when receiving xattr name values.
Fixes bug 13112. |
sds setTypeNextObject(setTypeIterator *si) {
int64_t intele;
sds sdsele;
int encoding;
encoding = setTypeNext(si,&sdsele,&intele);
switch(encoding) {
case -1: return NULL;
case OBJ_ENCODING_INTSET:
return sdsfromlonglong(intele);
case OBJ_ENCODING_HT:
... | 0 | [
"CWE-190"
] | redis | a30d367a71b7017581cf1ca104242a3c644dec0f | 165,014,765,141,603,990,000,000,000,000,000,000,000 | 17 | Fix Integer overflow issue with intsets (CVE-2021-32687)
The vulnerability involves changing the default set-max-intset-entries
configuration parameter to a very large value and constructing specially
crafted commands to manipulate sets |
xfs_inode_item_push(
struct xfs_log_item *lip,
struct list_head *buffer_list)
{
struct xfs_inode_log_item *iip = INODE_ITEM(lip);
struct xfs_inode *ip = iip->ili_inode;
struct xfs_buf *bp = NULL;
uint rval = XFS_ITEM_SUCCESS;
int error;
if (xfs_ipincount(ip) > 0)
return XFS_ITEM_PINNED;
if (!xfs_ilock... | 0 | [
"CWE-19"
] | linux | fc0561cefc04e7803c0f6501ca4f310a502f65b8 | 72,986,305,549,145,340,000,000,000,000,000,000,000 | 60 | xfs: optimise away log forces on timestamp updates for fdatasync
xfs: timestamp updates cause excessive fdatasync log traffic
Sage Weil reported that a ceph test workload was writing to the
log on every fdatasync during an overwrite workload. Event tracing
showed that the only metadata modification being made was the... |
g_file_real_delete_async (GFile *file,
int io_priority,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
GTask *task;
task = g_tas... | 0 | [
"CWE-362"
] | glib | d8f8f4d637ce43f8699ba94c9b7648beda0ca174 | 270,409,977,754,852,500,000,000,000,000,000,000,000 | 14 | gfile: Limit access to files when copying
file_copy_fallback creates new files with default permissions and
set the correct permissions after the operation is finished. This
might cause that the files can be accessible by more users during
the operation than expected. Use G_FILE_CREATE_PRIVATE for the new
files to lim... |
int rtas_get_power_level(int powerdomain, int *level)
{
int token = rtas_token("get-power-level");
int rc;
if (token == RTAS_UNKNOWN_SERVICE)
return -ENOENT;
while ((rc = rtas_call(token, 1, 2, level, powerdomain)) == RTAS_BUSY)
udelay(1);
if (rc < 0)
return rtas_error_rc(rc);
return rc;
} | 0 | [
"CWE-862"
] | linux | bd59380c5ba4147dcbaad3e582b55ccfd120b764 | 56,105,471,640,820,520,000,000,000,000,000,000,000 | 15 | powerpc/rtas: Restrict RTAS requests from userspace
A number of userspace utilities depend on making calls to RTAS to retrieve
information and update various things.
The existing API through which we expose RTAS to userspace exposes more
RTAS functionality than we actually need, through the sys_rtas syscall,
which al... |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE_EQ(context, NumInputs(node), 2);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
const TfLiteTensor* params;
TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, kParams, ¶ms));
const TfLiteTensor* indices;
TF_LITE_ENSUR... | 0 | [
"CWE-125"
] | tensorflow | 595a65a3e224a0362d7e68c2213acfc2b499a196 | 268,951,577,303,846,900,000,000,000,000,000,000,000 | 71 | Return a TFLite error if gather_nd will result in reading invalid memory
PiperOrigin-RevId: 463054033 |
bool ServerSecurityFeature::isFoxxApiDisabled() const {
return !_enableFoxxApi;
} | 0 | [
"CWE-918"
] | arangodb | d9b7f019d2435f107b19a59190bf9cc27d5f34dd | 24,320,191,373,052,300,000,000,000,000,000,000,000 | 3 | [APM-78] Disable installation from remote URL (#15292) |
int bson_ensure_space( bson *b, const int bytesNeeded ) {
int pos = b->cur - b->data;
char *orig = b->data;
int new_size;
if ( pos + bytesNeeded <= b->dataSize )
return BSON_OK;
new_size = 1.5 * ( b->dataSize + bytesNeeded );
if( new_size < b->dataSize ) {
if( ( b->dataSize + ... | 1 | [
"CWE-190"
] | mongo-c-driver-legacy | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | 37,260,485,168,738,767,000,000,000,000,000,000,000 | 28 | don't mix up int and size_t (first pass to fix that) |
static inline int throttled_lb_pair(struct task_group *tg,
int src_cpu, int dest_cpu)
{
return 0;
} | 0 | [
"CWE-400",
"CWE-703",
"CWE-835"
] | linux | c40f7d74c741a907cfaeb73a7697081881c497d0 | 75,637,882,585,640,245,000,000,000,000,000,000,000 | 5 | sched/fair: Fix infinite loop in update_blocked_averages() by reverting a9e7f6544b9c
Zhipeng Xie, Xie XiuQi and Sargun Dhillon reported lockups in the
scheduler under high loads, starting at around the v4.18 time frame,
and Zhipeng Xie tracked it down to bugs in the rq->leaf_cfs_rq_list
manipulation.
Do a (manual) re... |
ImageChecker::ImageChecker(size_t n) :
Pipeline("image checker", 0),
n(n),
offset(0),
okay(true)
{
} | 0 | [
"CWE-787"
] | qpdf | d71f05ca07eb5c7cfa4d6d23e5c1f2a800f52e8e | 50,216,105,379,800,180,000,000,000,000,000,000,000 | 7 | Fix sign and conversion warnings (major)
This makes all integer type conversions that have potential data loss
explicit with calls that do range checks and raise an exception. After
this commit, qpdf builds with no warnings when -Wsign-conversion
-Wconversion is used with gcc or clang or when -W3 -Wd4800 is used
with ... |
parse_be(const int is_emergency)
{
char lin[MAXBUF];
BACKEND *res;
int has_addr, has_port;
struct hostent *host;
struct sockaddr_in in;
struct sockaddr_in6 in6;
if((res = (BACKEND *)malloc(sizeof(BACKEND))) == NULL)
conf_err("BackEnd config: out of memory - ... | 1 | [] | pound | a0c52c542ca9620a96750f9877b26bf4c84aef1b | 25,576,748,244,410,240,000,000,000,000,000,000,000 | 164 | SSL Compression Disable patch for 2.6f
This patch disables SSL/TLS compression entirely. There is no config option.
This prevents CRIME attacks against SSL. Note that HTTP compression is still
an option.
Test your server at https://www.ssllabs.com/ssldb/
Original patch by Hereward Cooper <coops@fawk.eu>
Openssl 0... |
void AES::SetKey(const byte* userKey, word32 keylen, CipherDir /*dummy*/)
{
if (keylen <= 16)
keylen = 16;
else if (keylen >= 32)
keylen = 32;
else if (keylen != 24)
keylen = 24;
rounds_ = keylen/4 + 6;
word32 temp, *rk = key_;
unsigned int i=0;
GetUserKey(BigE... | 0 | [] | mysql-server | 5c6169fb309981b564a17bee31b367a18866d674 | 92,947,564,006,870,770,000,000,000,000,000,000,000 | 127 | Bug #24740291: YASSL UPDATE TO 2.4.2 |
int ath6kl_wmi_set_regdomain_cmd(struct wmi *wmi, const char *alpha2)
{
struct sk_buff *skb;
struct wmi_set_regdomain_cmd *cmd;
skb = ath6kl_wmi_get_new_buf(sizeof(*cmd));
if (!skb)
return -ENOMEM;
cmd = (struct wmi_set_regdomain_cmd *) skb->data;
memcpy(cmd->iso_name, alpha2, 2);
return ath6kl_wmi_cmd_send... | 0 | [
"CWE-125"
] | linux | 5d6751eaff672ea77642e74e92e6c0ac7f9709ab | 153,026,509,447,640,740,000,000,000,000,000,000,000 | 16 | ath6kl: add some bounds checking
The "ev->traffic_class" and "reply->ac" variables come from the network
and they're used as an offset into the wmi->stream_exist_for_ac[] array.
Those variables are u8 so they can be 0-255 but the stream_exist_for_ac[]
array only has WMM_NUM_AC (4) elements. We need to add a couple bo... |
alloc_path_with_tree_prefix(__le16 **out_path, int *out_size, int *out_len,
const char *treename, const __le16 *path)
{
int treename_len, path_len;
struct nls_table *cp;
const __le16 sep[] = {cpu_to_le16('\\'), cpu_to_le16(0x0000)};
/*
* skip leading "\\"
*/
treename_len = strlen(treename);
if (treena... | 0 | [
"CWE-416",
"CWE-200"
] | linux | 6a3eb3360667170988f8a6477f6686242061488a | 95,381,072,263,772,840,000,000,000,000,000,000,000 | 43 | cifs: Fix use-after-free in SMB2_write
There is a KASAN use-after-free:
BUG: KASAN: use-after-free in SMB2_write+0x1342/0x1580
Read of size 8 at addr ffff8880b6a8e450 by task ln/4196
Should not release the 'req' because it will use in the trace.
Fixes: eccb4422cf97 ("smb3: Add ftrace tracepoints for improved SMB3 de... |
static inline pmd_t pmd_wrprotect(pmd_t pmd)
{
return pmd_clear_flags(pmd, _PAGE_RW);
} | 0 | [
"CWE-119",
"CWE-787"
] | linux | 027ef6c87853b0a9df53175063028edb4950d476 | 316,458,187,725,527,250,000,000,000,000,000,000,000 | 4 | mm: thp: fix pmd_present for split_huge_page and PROT_NONE with THP
In many places !pmd_present has been converted to pmd_none. For pmds
that's equivalent and pmd_none is quicker so using pmd_none is better.
However (unless we delete pmd_present) we should provide an accurate
pmd_present too. This will avoid the ri... |
static const char *wsgi_set_chunked_request(cmd_parms *cmd, void *mconfig,
const char *f)
{
if (cmd->path) {
WSGIDirectoryConfig *dconfig = NULL;
dconfig = (WSGIDirectoryConfig *)mconfig;
if (strcasecmp(f, "Off") == 0)
dconfig->chunked... | 0 | [
"CWE-264"
] | mod_wsgi | d9d5fea585b23991f76532a9b07de7fcd3b649f4 | 154,137,196,301,715,120,000,000,000,000,000,000,000 | 29 | Local privilege escalation when using daemon mode. (CVE-2014-0240) |
static struct net_device_stats *ipip6_tunnel_get_stats(struct net_device *dev)
{
return &(((struct ip_tunnel*)netdev_priv(dev))->stat);
} | 0 | [
"CWE-399"
] | linux-2.6 | 36ca34cc3b8335eb1fe8bd9a1d0a2592980c3f02 | 69,930,965,450,014,180,000,000,000,000,000,000,000 | 4 | sit: Add missing kfree_skb() on pskb_may_pull() failure.
Noticed by Paul Marks <paul@pmarks.net>.
Signed-off-by: David S. Miller <davem@davemloft.net> |
void FileIo::transfer(BasicIo& src)
{
const bool wasOpen = (p_->fp_ != 0);
const std::string lastMode(p_->openMode_);
FileIo *fileIo = dynamic_cast<FileIo*>(&src);
if (fileIo) {
// Optimization if src is another instance of FileIo
fileIo->close();
... | 0 | [
"CWE-125"
] | exiv2 | edb4bf78ca5820f2c7a852c8f2df11e6aba45704 | 157,160,718,941,752,130,000,000,000,000,000,000,000 | 273 | Add bounds check to MemIo::seek(). (#944)
- Regression test for missing bounds check in MemIo::seek()
- Add bounds check to MemIo::seek(), this fixes CVE-2019-13504
(cherry picked from commit bd0afe0390439b2c424d881c8c6eb0c5624e31d9)
Additional fixes for 0.27:
- Add fix for the linux variant of MemIo::seek
- Change ... |
int kvm_inject_realmode_interrupt(struct kvm_vcpu *vcpu, int irq, int inc_eip)
{
struct x86_emulate_ctxt *ctxt = &vcpu->arch.emulate_ctxt;
int ret;
init_emulate_ctxt(vcpu);
ctxt->op_bytes = 2;
ctxt->ad_bytes = 2;
ctxt->_eip = ctxt->eip + inc_eip;
ret = emulate_int_real(ctxt, irq);
if (ret != X86EMUL_CONTINUE... | 0 | [] | linux | 6d1068b3a98519247d8ba4ec85cd40ac136dbdf9 | 158,365,398,642,994,010,000,000,000,000,000,000,000 | 26 | KVM: x86: invalid opcode oops on SET_SREGS with OSXSAVE bit set (CVE-2012-4461)
On hosts without the XSAVE support unprivileged local user can trigger
oops similar to the one below by setting X86_CR4_OSXSAVE bit in guest
cr4 register using KVM_SET_SREGS ioctl and later issuing KVM_RUN
ioctl.
invalid opcode: 0000 [#2]... |
selaDisplayInPix(SELA *sela,
l_int32 size,
l_int32 gthick,
l_int32 spacing,
l_int32 ncols)
{
l_int32 nsels, i, w, width;
PIX *pixt, *pixd;
PIXA *pixa;
SEL *sel;
PROCNAME("selaDisplayInPix");
if (!sela)
return (PIX *... | 0 | [
"CWE-119",
"CWE-787"
] | leptonica | ee301cb2029db8a6289c5295daa42bba7715e99a | 22,624,215,747,970,810,000,000,000,000,000,000,000 | 56 | Security fixes: expect final changes for release 1.75.3.
* Fixed a debian security issue with fscanf() reading a string with
possible buffer overflow.
* There were also a few similar situations with sscanf(). |
string_to_key (int id, char *salt, size_t saltlen, int iter, const char *pw,
int req_keylen, unsigned char *keybuf)
{
int rc, i, j;
gcry_md_hd_t md;
gcry_mpi_t num_b1 = NULL;
int pwlen;
unsigned char hash[20], buf_b[64], buf_i[128], *p;
size_t cur_keylen;
size_t n;
cur_keylen = 0;
pwle... | 0 | [] | gnupg | ed8383c618e124cfa708c9ee87563fcdf2f4649c | 89,253,691,461,000,780,000,000,000,000,000,000,000 | 95 | sm: Avoid double-free on iconv failure
* sm/minip12.c: (p12_build) if jnlib_iconv_open fails, avoid
double-free of pwbuf.
--
Observed by Joshua Rogers <honey@internot.info>, who proposed a
slightly different fix.
Debian-Bug-Id: 773472
Added fix at a second place - wk. |
Item_ref::Item_ref(THD *thd, Name_resolution_context *context_arg,
Item **item, const char *table_name_arg,
const LEX_CSTRING *field_name_arg,
bool alias_name_used_arg):
Item_ident(thd, context_arg, NullS, table_name_arg, field_name_arg),
ref(item), reference... | 0 | [
"CWE-416"
] | server | c02ebf3510850ba78a106be9974c94c3b97d8585 | 95,430,879,927,742,930,000,000,000,000,000,000,000 | 14 | 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. |
pop_value(i_ctx_t *i_ctx_p, ref * pvalue)
{
if (!ref_stack_count(&o_stack))
return_error(gs_error_stackunderflow);
*pvalue = *ref_stack_index(&o_stack, 0L);
return 0;
} | 0 | [] | ghostpdl | 6d444c273da5499a4cd72f21cb6d4c9a5256807d | 30,669,020,397,298,080,000,000,000,000,000,000,000 | 7 | Bug 697178: Add a file permissions callback
For the rare occasions when the graphics library directly opens a file
(currently for reading), this allows us to apply any restrictions on
file access normally applied in the interpteter. |
bit_isnan (BITCODE_BD number)
{
int32_t *res = (int32_t *)&number;
return (res[0] == -1 && res[1] == -1);
} | 0 | [
"CWE-703",
"CWE-125"
] | libredwg | 95cc9300430d35feb05b06a9badf678419463dbe | 314,068,316,885,003,830,000,000,000,000,000,000,000 | 5 | encode: protect from stack under-flow
From GH #178 fuzzing |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.