func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
int fileblobAddData(fileblob *fb, const unsigned char *data, size_t len)
{
if (len == 0)
return 0;
assert(data != NULL);
if (fb->fp) {
#if defined(MAX_SCAN_SIZE) && (MAX_SCAN_SIZE > 0)
const cli_ctx *ctx = fb->ctx;
if (fb->isInfected) /* pretend all was written */
retu... | 0 | [
"CWE-476"
] | clamav-devel | 8bb3716be9c7ab7c6a3a1889267b1072f48af87b | 143,998,451,542,159,940,000,000,000,000,000,000,000 | 44 | fuzz-22348 null deref in egg utf8 conversion
Corrected memory leaks and a null dereference in the egg utf8 conversion. |
dp_packet_set_flow_mark(struct dp_packet *p, uint32_t mark)
{
p->mbuf.hash.fdir.hi = mark;
p->mbuf.ol_flags |= PKT_RX_FDIR_ID;
} | 0 | [
"CWE-400"
] | ovs | 3512fb512c76a1f08eba4005aa2eb69160d0840e | 123,473,322,819,645,310,000,000,000,000,000,000,000 | 5 | flow: Support extra padding length.
Although not required, padding can be optionally added until
the packet length is MTU bytes. A packet with extra padding
currently fails sanity checks.
Vulnerability: CVE-2020-35498
Fixes: fa8d9001a624 ("miniflow_extract: Properly handle small IP packets.")
Reported-by: Joakim Hind... |
get_thread_static_data (MonoInternalThread *thread, guint32 offset)
{
int idx;
g_assert ((offset & 0x80000000) == 0);
offset &= 0x7fffffff;
idx = (offset >> 24) - 1;
return ((char*) thread->static_data [idx]) + (offset & 0xffffff);
} | 0 | [
"CWE-399",
"CWE-264"
] | mono | 722f9890f09aadfc37ae479e7d946d5fc5ef7b91 | 242,796,499,760,182,800,000,000,000,000,000,000,000 | 8 | Fix access to freed members of a dead thread
* threads.c: Fix access to freed members of a dead thread. Found
and fixed by Rodrigo Kumpera <rkumpera@novell.com>
Ref: CVE-2011-0992 |
static int unqueue_me(struct futex_q *q)
{
spinlock_t *lock_ptr;
int ret = 0;
/* In the common case we don't take the spinlock, which is nice. */
retry:
/*
* q->lock_ptr can change between this read and the following spin_lock.
* Use READ_ONCE to forbid the compiler from reloading q->lock_ptr and
* optimizin... | 0 | [
"CWE-190"
] | linux | fbe0e839d1e22d88810f3ee3e2f1479be4c0aa4a | 319,770,705,413,058,850,000,000,000,000,000,000,000 | 43 | futex: Prevent overflow by strengthen input validation
UBSAN reports signed integer overflow in kernel/futex.c:
UBSAN: Undefined behaviour in kernel/futex.c:2041:18
signed integer overflow:
0 - -2147483648 cannot be represented in type 'int'
Add a sanity check to catch negative values of nr_wake and nr_requeue.
... |
setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info,
sigset_t *set, struct pt_regs *regs)
{
struct rt_sigframe __user *frame = get_sigframe(ka, regs, sizeof(*frame));
stack_t stack;
int err = 0;
if (!frame)
return 1;
err |= copy_siginfo_to_user(&frame->info, info);
__put_user_error(0, &f... | 0 | [] | linux-2.6 | ee18d64c1f632043a02e6f5ba5e045bb26a5465f | 223,929,349,214,602,360,000,000,000,000,000,000,000 | 37 | KEYS: Add a keyctl to install a process's session keyring on its parent [try #6]
Add a keyctl to install a process's session keyring onto its parent. This
replaces the parent's session keyring. Because the COW credential code does
not permit one process to change another process's credentials directly, the
change is... |
static int nf_tables_updchain(struct nft_ctx *ctx, u8 genmask, u8 policy,
u32 flags, const struct nlattr *attr,
struct netlink_ext_ack *extack)
{
const struct nlattr * const *nla = ctx->nla;
struct nft_table *table = ctx->table;
struct nft_chain *chain = ctx->chain;
struct nft_base_chain *basechai... | 0 | [] | net | 520778042ccca019f3ffa136dd0ca565c486cedd | 243,297,828,181,021,000,000,000,000,000,000,000,000 | 122 | netfilter: nf_tables: disallow non-stateful expression in sets earlier
Since 3e135cd499bf ("netfilter: nft_dynset: dynamic stateful expression
instantiation"), it is possible to attach stateful expressions to set
elements.
cd5125d8f518 ("netfilter: nf_tables: split set destruction in deactivate
and destroy phase") in... |
int mbedtls_ssl_read_record( mbedtls_ssl_context *ssl,
unsigned update_hs_digest )
{
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
MBEDTLS_SSL_DEBUG_MSG( 2, ( "=> read record" ) );
if( ssl->keep_current_message == 0 )
{
do {
ret = ssl_consume_curren... | 0 | [
"CWE-787"
] | mbedtls | f333dfab4a6c2d8a604a61558a8f783145161de4 | 137,409,074,213,334,230,000,000,000,000,000,000,000 | 83 | More SSL debug messages for ClientHello parsing
In particular, be verbose when checking the ClientHello cookie in a possible
DTLS reconnection.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com> |
yang_read_require_instance(struct ly_ctx *ctx, struct yang_type *stype, int req)
{
if (stype->base && (stype->base != LY_TYPE_LEAFREF)) {
LOGVAL(ctx, LYE_INSTMT, LY_VLOG_NONE, NULL, "require-instance");
return EXIT_FAILURE;
}
if (stype->type->info.lref.req) {
LOGVAL(ctx, LYE_TOOMANY,... | 0 | [
"CWE-415"
] | libyang | d9feacc4a590d35dbc1af21caf9080008b4450ed | 223,384,544,291,447,000,000,000,000,000,000,000,000 | 14 | yang parser BUGFIX double free
Fixes #742 |
DECODE_JSON(SByte) {
CHECK_TOKEN_BOUNDS;
CHECK_PRIMITIVE;
size_t tokenSize;
char* tokenData;
GET_TOKEN(tokenData, tokenSize);
UA_Int64 out = 0;
UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
*dst = (UA_SByte)out;
if(moveToken)
parseCtx->index++;
retur... | 0 | [
"CWE-703",
"CWE-787"
] | open62541 | c800e2987b10bb3af6ef644b515b5d6392f8861d | 315,256,849,184,080,860,000,000,000,000,000,000,000 | 15 | fix(json): Check max recursion depth in more places |
static char *basename(char *path)
{
char *fname;
fname = path + strlen(path) - 1;
while (fname >= path) {
if (*fname == '/') {
fname++;
break;
}
fname--;
}
return fname;
} | 0 | [
"CWE-120",
"CWE-703"
] | u-boot | 5d14ee4e53a81055d34ba280cb8fd90330f22a96 | 112,617,746,794,031,240,000,000,000,000,000,000,000 | 14 | CVE-2019-14196: nfs: fix unbounded memcpy with a failed length check at nfs_lookup_reply
This patch adds a check to rpc_pkt.u.reply.data at nfs_lookup_reply.
Signed-off-by: Cheng Liu <liucheng32@huawei.com>
Reported-by: Fermín Serna <fermin@semmle.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com> |
static void __net_init ping_v6_proc_exit_net(struct net *net)
{
return ping_proc_unregister(net, &ping_v6_seq_afinfo);
} | 0 | [
"CWE-20"
] | net | 85fbaa75037d0b6b786ff18658ddf0b4014ce2a4 | 202,610,538,502,784,060,000,000,000,000,000,000,000 | 4 | inet: fix addr_len/msg->msg_namelen assignment in recv_error and rxpmtu functions
Commit bceaa90240b6019ed73b49965eac7d167610be69 ("inet: prevent leakage
of uninitialized memory to user in recv syscalls") conditionally updated
addr_len if the msg_name is written to. The recv_error and rxpmtu
functions relied on the re... |
parse_tag_line(
char_u *lbuf, // line to be parsed
#ifdef FEAT_EMACS_TAGS
int is_etag,
#endif
tagptrs_T *tagp)
{
char_u *p;
#ifdef FEAT_EMACS_TAGS
if (is_etag)
// emacs-style tag file
return emacs_tags_parse_line(lbuf, tagp);
#endif
// Isolate the tagname, from lbuf up to the first white
... | 0 | [
"CWE-416"
] | vim | adce965162dd89bf29ee0e5baf53652e7515762c | 195,639,299,741,598,360,000,000,000,000,000,000,000 | 40 | patch 9.0.0246: using freed memory when 'tagfunc' deletes the buffer
Problem: Using freed memory when 'tagfunc' deletes the buffer.
Solution: Make a copy of the tag name. |
static int vm_stat_clear(void *_offset, u64 val)
{
unsigned offset = (long)_offset;
struct kvm *kvm;
if (val)
return -EINVAL;
mutex_lock(&kvm_lock);
list_for_each_entry(kvm, &vm_list, vm_list) {
kvm_clear_stat_per_vm(kvm, offset);
}
mutex_unlock(&kvm_lock);
return 0;
} | 0 | [
"CWE-416"
] | linux | 0774a964ef561b7170d8d1b1bfe6f88002b6d219 | 222,542,183,254,366,100,000,000,000,000,000,000,000 | 16 | KVM: Fix out of range accesses to memslots
Reset the LRU slot if it becomes invalid when deleting a memslot to fix
an out-of-bounds/use-after-free access when searching through memslots.
Explicitly check for there being no used slots in search_memslots(), and
in the caller of s390's approximation variant.
Fixes: 369... |
ex_resize(exarg_T *eap)
{
int n;
win_T *wp = curwin;
if (eap->addr_count > 0)
{
n = eap->line2;
for (wp = firstwin; wp->w_next != NULL && --n > 0; wp = wp->w_next)
;
}
# ifdef FEAT_GUI
need_mouse_correct = TRUE;
# endif
n = atol((char *)eap->arg);
if (cmdmod.split & WSP_VERT)
... | 0 | [
"CWE-78"
] | vim | 8c62a08faf89663e5633dc5036cd8695c80f1075 | 175,041,798,568,935,400,000,000,000,000,000,000,000 | 33 | 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. |
nedpool *nedcreatepool(size_t capacity, int threads) THROWSPEC
{
nedpool *ret;
if(!(ret=(nedpool *) nedpcalloc(0, 1, sizeof(nedpool)))) return 0;
if(!InitPool(ret, capacity, threads))
{
nedpfree(0, ret);
return 0;
}
return ret;
} | 0 | [
"CWE-119",
"CWE-787"
] | git | 34fa79a6cde56d6d428ab0d3160cb094ebad3305 | 37,991,782,231,439,560,000,000,000,000,000,000,000 | 11 | prefer memcpy to strcpy
When we already know the length of a string (e.g., because
we just malloc'd to fit it), it's nicer to use memcpy than
strcpy, as it makes it more obvious that we are not going to
overflow the buffer (because the size we pass matches the
size in the allocation).
This also eliminates calls to st... |
static void check_no_capabilities(const char *line, int len)
{
if (strlen(line) != len)
warning(_("ignoring capabilities after first line '%s'"),
line + strlen(line));
} | 0 | [] | git | a02ea577174ab8ed18f847cf1693f213e0b9c473 | 32,574,065,773,049,750,000,000,000,000,000,000,000 | 6 | git_connect_git(): forbid newlines in host and path
When we connect to a git:// server, we send an initial request that
looks something like:
002dgit-upload-pack repo.git\0host=example.com
If the repo path contains a newline, then it's included literally, and
we get:
002egit-upload-pack repo
.git\0host=exampl... |
static void ffs_data_clear(struct ffs_data *ffs)
{
ENTER();
ffs_closed(ffs);
BUG_ON(ffs->gadget);
if (ffs->epfiles)
ffs_epfiles_destroy(ffs->epfiles, ffs->eps_count);
if (ffs->ffs_eventfd)
eventfd_ctx_put(ffs->ffs_eventfd);
kfree(ffs->raw_descs_data);
kfree(ffs->raw_strings);
kfree(ffs->stringtabs);
} | 0 | [
"CWE-416",
"CWE-362"
] | linux | 38740a5b87d53ceb89eb2c970150f6e94e00373a | 33,517,435,986,751,307,000,000,000,000,000,000,000 | 18 | usb: gadget: f_fs: Fix use-after-free
When using asynchronous read or write operations on the USB endpoints the
issuer of the IO request is notified by calling the ki_complete() callback
of the submitted kiocb when the URB has been completed.
Calling this ki_complete() callback will free kiocb. Make sure that the
str... |
void rtnl_unregister_all(int protocol)
{
BUG_ON(protocol < 0 || protocol > RTNL_FAMILY_MAX);
kfree(rtnl_msg_handlers[protocol]);
rtnl_msg_handlers[protocol] = NULL;
} | 0 | [
"CWE-399"
] | linux-2.6 | 84d73cd3fb142bf1298a8c13fd4ca50fd2432372 | 115,454,561,935,789,420,000,000,000,000,000,000,000 | 7 | rtnl: fix info leak on RTM_GETLINK request for VF devices
Initialize the mac address buffer with 0 as the driver specific function
will probably not fill the whole buffer. In fact, all in-kernel drivers
fill only ETH_ALEN of the MAX_ADDR_LEN bytes, i.e. 6 of the 32 possible
bytes. Therefore we currently leak 26 bytes ... |
_PUBLIC_ bool process_exists_by_pid(pid_t pid)
{
/* Doing kill with a non-positive pid causes messages to be
* sent to places we don't want. */
if (pid <= 0) {
return false;
}
return(kill(pid,0) == 0 || errno != ESRCH);
} | 0 | [] | samba | 8eae8d28bce2c3f6a323d3dc48ed10c2e6bb1ba5 | 231,457,938,701,604,160,000,000,000,000,000,000,000 | 9 | CVE-2013-4476: lib-util: add file_check_permissions()
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10234
Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org> |
bool isPrefixOf(StringData first, StringData second) {
if (first.size() >= second.size()) {
return false;
}
return second.startsWith(first) && second[first.size()] == '.';
} | 0 | [
"CWE-732"
] | mongo | cd583b6c4d8aa2364f255992708b9bb54e110cf4 | 100,208,243,312,219,210,000,000,000,000,000,000,000 | 7 | SERVER-53929 Add stricter parser checks around positional projection |
static int vmx_sync_pir_to_irr(struct kvm_vcpu *vcpu)
{
struct vcpu_vmx *vmx = to_vmx(vcpu);
int max_irr;
bool max_irr_updated;
WARN_ON(!vcpu->arch.apicv_active);
if (pi_test_on(&vmx->pi_desc)) {
pi_clear_on(&vmx->pi_desc);
/*
* IOMMU can write to PIR.ON, so the barrier matters even on UP.
* But on x86 ... | 0 | [
"CWE-284"
] | linux | 727ba748e110b4de50d142edca9d6a9b7e6111d8 | 157,381,563,466,610,100,000,000,000,000,000,000,000 | 37 | kvm: nVMX: Enforce cpl=0 for VMX instructions
VMX instructions executed inside a L1 VM will always trigger a VM exit
even when executed with cpl 3. This means we must perform the
privilege check in software.
Fixes: 70f3aac964ae("kvm: nVMX: Remove superfluous VMX instruction fault checks")
Cc: stable@vger.kernel.org
S... |
static int ext3_check_descriptors(struct super_block *sb)
{
struct ext3_sb_info *sbi = EXT3_SB(sb);
int i;
ext3_debug ("Checking group descriptors");
for (i = 0; i < sbi->s_groups_count; i++) {
struct ext3_group_desc *gdp = ext3_get_group_desc(sb, i, NULL);
ext3_fsblk_t first_block = ext3_group_first_block_no... | 0 | [
"CWE-20"
] | linux | 8d0c2d10dd72c5292eda7a06231056a4c972e4cc | 273,081,817,640,403,220,000,000,000,000,000,000,000 | 55 | ext3: Fix format string issues
ext3_msg() takes the printk prefix as the second parameter and the
format string as the third parameter. Two callers of ext3_msg omit the
prefix and pass the format string as the second parameter and the first
parameter to the format string as the third parameter. In both cases
this stri... |
static bool svm_pku_supported(void)
{
return false;
} | 0 | [
"CWE-401"
] | linux | d80b64ff297e40c2b6f7d7abc1b3eba70d22a068 | 296,308,897,821,654,300,000,000,000,000,000,000,000 | 4 | KVM: SVM: Fix potential memory leak in svm_cpu_init()
When kmalloc memory for sd->sev_vmcbs failed, we forget to free the page
held by sd->save_area. Also get rid of the var r as '-ENOMEM' is actually
the only possible outcome here.
Reviewed-by: Liran Alon <liran.alon@oracle.com>
Reviewed-by: Vitaly Kuznetsov <vkuzne... |
static diy_fp_t double2diy_fp(double d)
{
uint64_t d64 = double_to_uint64(d);
int biased_e = (d64 & DP_EXPONENT_MASK) >> DP_SIGNIFICAND_SIZE;
uint64_t significand = (d64 & DP_SIGNIFICAND_MASK);
diy_fp_t res;
if (biased_e != 0) {
res.f = significand + DP_HIDDEN_BIT;
res.e = biased_e - DP_EXPONENT_BIAS;
} else ... | 0 | [
"CWE-190"
] | mujs | 25821e6d74fab5fcc200fe5e818362e03e114428 | 186,218,498,492,024,600,000,000,000,000,000,000,000 | 15 | Fix 698920: Guard jsdtoa from integer overflow wreaking havoc. |
wkbConvPointToShape(wkbObj *w, shapeObj *shape)
{
int type;
lineObj line;
/*endian = */wkbReadChar(w);
type = wkbTypeMap(w,wkbReadInt(w));
if( type != WKB_POINT ) return MS_FAILURE;
if( ! (shape->type == MS_SHAPE_POINT) ) return MS_FAILURE;
line.numpoints = 1;
line.point = msSmallMalloc(sizeof(pointO... | 0 | [
"CWE-89"
] | mapserver | 3a10f6b829297dae63492a8c63385044bc6953ed | 7,774,104,320,201,004,000,000,000,000,000,000,000 | 17 | Fix potential SQL Injection with postgis TIME filters (#4834) |
static void _ion_buffer_destroy(struct kref *kref)
{
struct ion_buffer *buffer = container_of(kref, struct ion_buffer, ref);
struct ion_heap *heap = buffer->heap;
struct ion_device *dev = buffer->dev;
mutex_lock(&dev->buffer_lock);
rb_erase(&buffer->node, &dev->buffers);
mutex_unlock(&dev->buffer_lock);
if (he... | 0 | [
"CWE-416",
"CWE-284"
] | linux | 9590232bb4f4cc824f3425a6e1349afbe6d6d2b7 | 207,497,474,684,472,700,000,000,000,000,000,000,000 | 15 | staging/android/ion : fix a race condition in the ion driver
There is a use-after-free problem in the ion driver.
This is caused by a race condition in the ion_ioctl()
function.
A handle has ref count of 1 and two tasks on different
cpus calls ION_IOC_FREE simultaneously.
cpu 0 cpu ... |
T toNumber(const std::vector<char> &data, bool mostSignificantByteFirst)
{
T sum = 0;
if(data.size() <= 0) {
debug("ByteVectorMirror::toNumber<T>() -- data is empty, returning 0");
return sum;
}
uint size = sizeof(T);
uint last = data.size() > size ? size - 1 : data.size() - 1;
... | 0 | [
"CWE-189"
] | taglib | dcdf4fd954e3213c355746fa15b7480461972308 | 268,102,497,216,937,100,000,000,000,000,000,000,000 | 17 | Avoid uint overflow in case the length + index is over UINT_MAX |
static RzList *recurse_bb(RzCore *core, ut64 addr, RzAnalysisBlock *dest) {
RzAnalysisBlock *bb = rz_analysis_find_most_relevant_block_in(core->analysis, addr);
if (bb == dest) {
eprintf("path found!");
return NULL;
}
return recurse(core, bb, dest);
} | 0 | [
"CWE-703"
] | rizin | 6ce71d8aa3dafe3cdb52d5d72ae8f4b95916f939 | 315,582,691,721,004,440,000,000,000,000,000,000,000 | 8 | Initialize retctx,ctx before freeing the inner elements
In rz_core_analysis_type_match retctx structure was initialized on the
stack only after a "goto out_function", where a field of that structure
was freed. When the goto path is taken, the field is not properly
initialized and it cause cause a crash of Rizin or hav... |
void CWebServer::Cmd_GetSerialDevices(WebEmSession & session, const request& req, Json::Value &root)
{
root["status"] = "OK";
root["title"] = "GetSerialDevices";
bool bUseDirectPath = false;
std::vector<std::string> serialports = GetSerialPorts(bUseDirectPath);
int ii = 0;
for (const auto & itt :... | 0 | [
"CWE-89"
] | domoticz | ee70db46f81afa582c96b887b73bcd2a86feda00 | 263,846,653,662,275,650,000,000,000,000,000,000,000 | 15 | Fixed possible SQL Injection Vulnerability (Thanks to Fabio Carretto!) |
static void FVMenuShowDependentRefs(GWindow gw, struct gmenuitem *UNUSED(mi), GEvent *UNUSED(e)) {
FontView *fv = (FontView *) GDrawGetUserData(gw);
int pos = FVAnyCharSelected(fv);
SplineChar *sc;
if ( pos<0 || fv->b.map->map[pos]==-1 )
return;
sc = fv->b.sf->glyphs[fv->b.map->map[pos]];
if ( ... | 0 | [
"CWE-119",
"CWE-787"
] | fontforge | 626f751752875a0ddd74b9e217b6f4828713573c | 11,520,036,835,393,484,000,000,000,000,000,000,000 | 12 | Warn users before discarding their unsaved scripts (#3852)
* Warn users before discarding their unsaved scripts
This closes #3846. |
zwcheck(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
int code = access_check(i_ctx_p, a_write, false);
if (code >= 0)
make_bool(op, code), code = 0;
return code;
} | 0 | [] | ghostpdl | 0edd3d6c634a577db261615a9dc2719bca7f6e01 | 11,986,994,120,118,004,000,000,000,000,000,000,000 | 9 | Bug 699659: Don't just assume an object is a t_(a)struct |
static void get_type_str(xmlNodePtr node, const char* ns, const char* type, smart_str* ret)
{
TSRMLS_FETCH();
if (ns) {
xmlNsPtr xmlns;
if (SOAP_GLOBAL(soap_version) == SOAP_1_2 &&
strcmp(ns,SOAP_1_1_ENC_NAMESPACE) == 0) {
ns = SOAP_1_2_ENC_NAMESPACE;
} else if (SOAP_GLOBAL(soap_version) == SOAP_1_1 &... | 0 | [
"CWE-19"
] | php-src | c8eaca013a3922e8383def6158ece2b63f6ec483 | 214,502,043,462,525,900,000,000,000,000,000,000,000 | 20 | Added type checks |
TEST_F(QueryPlannerTest, LockstepOrEnumerationSanityCheckTwoChildrenOneIndexEach) {
params.options =
QueryPlannerParams::NO_TABLE_SCAN | QueryPlannerParams::ENUMERATE_OR_CHILDREN_LOCKSTEP;
addIndex(BSON("a" << 1 << "b" << 1));
addIndex(BSON("a" << 1 << "c" << 1));
runQueryAsCommand(fromjson("{f... | 0 | [] | mongo | 64095239f41e9f3841d8be9088347db56d35c891 | 136,357,904,830,911,580,000,000,000,000,000,000,000 | 20 | SERVER-51083 Reject invalid UTF-8 from $regex match expressions |
join_read_const(JOIN_TAB *tab)
{
int error;
TABLE *table= tab->table;
if (table->status & STATUS_GARBAGE) // If first read
{
table->status= 0;
if (cp_buffer_from_ref(tab->join->thd, table, &tab->ref))
error=HA_ERR_KEY_NOT_FOUND;
else
{
error= table->file->ha_index_read_idx_map(table... | 0 | [
"CWE-89"
] | server | 5ba77222e9fe7af8ff403816b5338b18b342053c | 41,229,219,278,345,970,000,000,000,000,000,000,000 | 35 | MDEV-21028 Server crashes in Query_arena::set_query_arena upon SELECT from view
if the view has algorithm=temptable it is not updatable,
so DEFAULT() for its fields is meaningless,
and thus it's NULL or 0/'' for NOT NULL columns. |
static int geneve_xmit_skb(struct sk_buff *skb, struct net_device *dev,
struct geneve_dev *geneve,
const struct ip_tunnel_info *info)
{
bool xnet = !net_eq(geneve->net, dev_net(geneve->dev));
struct geneve_sock *gs4 = rcu_dereference(geneve->sock4);
const struct ip_tunnel_key *key = &info->key;
struct r... | 1 | [
"CWE-319"
] | net | 34beb21594519ce64a55a498c2fe7d567bc1ca20 | 178,050,373,547,606,380,000,000,000,000,000,000,000 | 84 | geneve: add transport ports in route lookup for geneve
This patch adds transport ports information for route lookup so that
IPsec can select Geneve tunnel traffic to do encryption. This is
needed for OVS/OVN IPsec with encrypted Geneve tunnels.
This can be tested by configuring a host-host VPN using an IKE
daemon and... |
static inline int sctp_peer_needs_update(struct sctp_association *asoc)
{
switch (asoc->state) {
case SCTP_STATE_ESTABLISHED:
case SCTP_STATE_SHUTDOWN_PENDING:
case SCTP_STATE_SHUTDOWN_RECEIVED:
case SCTP_STATE_SHUTDOWN_SENT:
if ((asoc->rwnd > asoc->a_rwnd) &&
((asoc->rwnd - asoc->a_rwnd) >=
min_t(_... | 0 | [
"CWE-287"
] | linux-2.6 | add52379dde2e5300e2d574b172e62c6cf43b3d3 | 76,248,221,053,476,510,000,000,000,000,000,000,000 | 17 | sctp: Fix oops when INIT-ACK indicates that peer doesn't support AUTH
If INIT-ACK is received with SupportedExtensions parameter which
indicates that the peer does not support AUTH, the packet will be
silently ignore, and sctp_process_init() do cleanup all of the
transports in the association.
When T1-Init timer is ex... |
size_t Item_sum::ram_limitation(THD *thd)
{
return (size_t)MY_MIN(thd->variables.tmp_memory_table_size,
thd->variables.max_heap_table_size);
} | 0 | [
"CWE-120"
] | server | eca207c46293bc72dd8d0d5622153fab4d3fccf1 | 332,303,623,663,751,730,000,000,000,000,000,000,000 | 5 | MDEV-25317 Assertion `scale <= precision' failed in decimal_bin_size And Assertion `scale >= 0 && precision > 0 && scale <= precision' failed in decimal_bin_size_inline/decimal_bin_size.
Precision should be kept below DECIMAL_MAX_SCALE for computations.
It can be bigger in Item_decimal. I'd fix this too but it changes... |
xsltParseRemoveWhitespace(xmlNodePtr node)
{
if ((node == NULL) || (node->children == NULL))
return(0);
else {
xmlNodePtr delNode = NULL, child = node->children;
do {
if (delNode) {
xmlUnlinkNode(delNode);
xmlFreeNode(delNode);
delNode = NULL;
}
if (((child->type == XML_TEXT_NODE) ||
... | 0 | [] | libxslt | 7089a62b8f133b42a2981cf1f920a8b3fe9a8caa | 61,349,841,717,053,680,000,000,000,000,000,000,000 | 27 | Crash compiling stylesheet with DTD
* libxslt/xslt.c: when a stylesheet embbeds a DTD the compilation
process could get seriously wrong |
xmlBufAttrSerializeTxtContent(xmlBufPtr buf, xmlDocPtr doc,
xmlAttrPtr attr, const xmlChar * string)
{
xmlChar *base, *cur;
if (string == NULL)
return;
base = cur = (xmlChar *) string;
while (*cur != 0) {
if (*cur == '\n') {
if (base != cur)
... | 0 | [
"CWE-502"
] | libxml2 | c97750d11bb8b6f3303e7131fe526a61ac65bcfd | 230,895,568,099,009,900,000,000,000,000,000,000,000 | 118 | Avoid an out of bound access when serializing malformed strings
For https://bugzilla.gnome.org/show_bug.cgi?id=766414
* xmlsave.c: xmlBufAttrSerializeTxtContent() if an attribute value
is not UTF-8 be more careful when serializing it as we may do an
out of bound access as a result. |
bool Inflator::DecodeBody()
{
bool blockEnd = false;
switch (m_blockType)
{
case 0: // stored
CRYPTOPP_ASSERT(m_reader.BitsBuffered() == 0);
while (!m_inQueue.IsEmpty() && !blockEnd)
{
size_t size;
const byte *block = m_inQueue.Spy(size);
size = UnsignedMin(m_storedLen, size);
CRYPTOPP... | 0 | [
"CWE-190",
"CWE-125"
] | cryptopp | 07dbcc3d9644b18e05c1776db2a57fe04d780965 | 198,899,092,927,718,220,000,000,000,000,000,000,000 | 122 | Add Inflator::BadDistanceErr exception (Issue 414)
The improved validation and excpetion clears the Address Sanitizer and Undefined Behavior Sanitizer findings |
void rdma_leave_multicast(struct rdma_cm_id *id, struct sockaddr *addr)
{
struct rdma_id_private *id_priv;
struct cma_multicast *mc;
id_priv = container_of(id, struct rdma_id_private, id);
spin_lock_irq(&id_priv->lock);
list_for_each_entry(mc, &id_priv->mc_list, list) {
if (!memcmp(&mc->addr, addr, rdma_addr_si... | 0 | [
"CWE-20"
] | linux | b2853fd6c2d0f383dbdf7427e263eb576a633867 | 15,464,750,188,356,183,000,000,000,000,000,000,000 | 34 | IB/core: Don't resolve passive side RoCE L2 address in CMA REQ handler
The code that resolves the passive side source MAC within the rdma_cm
connection request handler was both redundant and buggy, so remove it.
It was redundant since later, when an RC QP is modified to RTR state,
the resolution will take place in th... |
static int do_setvfinfo(struct net_device *dev, struct nlattr *attr)
{
int rem, err = -EINVAL;
struct nlattr *vf;
const struct net_device_ops *ops = dev->netdev_ops;
nla_for_each_nested(vf, attr, rem) {
switch (nla_type(vf)) {
case IFLA_VF_MAC: {
struct ifla_vf_mac *ivm;
ivm = nla_data(vf);
err = -EOP... | 0 | [
"CWE-399"
] | linux-2.6 | 84d73cd3fb142bf1298a8c13fd4ca50fd2432372 | 126,629,266,471,190,440,000,000,000,000,000,000,000 | 54 | rtnl: fix info leak on RTM_GETLINK request for VF devices
Initialize the mac address buffer with 0 as the driver specific function
will probably not fill the whole buffer. In fact, all in-kernel drivers
fill only ETH_ALEN of the MAX_ADDR_LEN bytes, i.e. 6 of the 32 possible
bytes. Therefore we currently leak 26 bytes ... |
MODRET set_useralias(cmd_rec *cmd) {
config_rec *c = NULL;
CHECK_ARGS(cmd, 2);
CHECK_CONF(cmd, CONF_ROOT|CONF_VIRTUAL|CONF_GLOBAL|CONF_ANON);
/* Make sure that the given names differ. */
if (strcmp(cmd->argv[1], cmd->argv[2]) == 0)
CONF_ERROR(cmd, "alias and real user names must differ");
c = add_con... | 0 | [
"CWE-59",
"CWE-61"
] | proftpd | ecff21e0d0e84f35c299ef91d7fda088e516d4ed | 300,689,511,580,243,800,000,000,000,000,000,000,000 | 21 | Backporting recursive handling of DefaultRoot path, when AllowChrootSymlinks
is off, to 1.3.5 branch. |
SYSCALL_DEFINE2(inotify_rm_watch, int, fd, __s32, wd)
{
struct file *filp;
struct inotify_device *dev;
int ret, fput_needed;
filp = fget_light(fd, &fput_needed);
if (unlikely(!filp))
return -EBADF;
/* verify that this is indeed an inotify instance */
if (unlikely(filp->f_op != &inotify_fops)) {
ret = -EINV... | 0 | [
"CWE-399"
] | linux-2.6 | 3632dee2f8b8a9720329f29eeaa4ec4669a3aff8 | 195,646,196,696,232,250,000,000,000,000,000,000,000 | 25 | inotify: clean up inotify_read and fix locking problems
If userspace supplies an invalid pointer to a read() of an inotify
instance, the inotify device's event list mutex is unlocked twice.
This causes an unbalance which effectively leaves the data structure
unprotected, and we can trigger oopses by accessing the inot... |
TEST_F(ConnectionManagerUtilityTest, MtlsSanitizeSetClientCert) {
auto ssl = std::make_shared<NiceMock<Ssl::MockConnectionInfo>>();
ON_CALL(*ssl, peerCertificatePresented()).WillByDefault(Return(true));
const std::vector<std::string> local_uri_sans{"test://foo.com/be"};
EXPECT_CALL(*ssl, uriSanLocalCertificate(... | 0 | [
"CWE-22"
] | envoy | 5333b928d8bcffa26ab19bf018369a835f697585 | 21,248,693,440,533,375,000,000,000,000,000,000,000 | 36 | Implement handling of escaped slash characters in URL path
Fixes: CVE-2021-29492
Signed-off-by: Yan Avlasov <yavlasov@google.com> |
static void agent_connect(UdscsConnection *conn)
{
struct agent_data *agent_data;
agent_data = g_new0(struct agent_data, 1);
GError *err = NULL;
gint pid;
if (session_info) {
pid = vdagent_connection_get_peer_pid(VDAGENT_CONNECTION(conn), &err);
if (err || pid <= 0) {
st... | 1 | [
"CWE-362"
] | spice-vd_agent | 51c415df82a52e9ec033225783c77df95f387891 | 331,940,420,441,421,550,000,000,000,000,000,000,000 | 36 | Avoids user session hijacking
Avoids user hijacking sessions by reusing PID.
In theory an attacker could:
- open a connection to the daemon;
- fork and exit the process but keep the file descriptor open
(inheriting or duplicating it in forked process);
- force OS to recycle the initial PID, by creating many short li... |
static OPJ_BOOL opj_j2k_write_SQcd_SQcc(opj_j2k_t *p_j2k,
OPJ_UINT32 p_tile_no,
OPJ_UINT32 p_comp_no,
OPJ_BYTE * p_data,
OPJ_UINT32 * p_header_size,
... | 0 | [
"CWE-416",
"CWE-787"
] | openjpeg | 4241ae6fbbf1de9658764a80944dc8108f2b4154 | 308,650,657,929,155,940,000,000,000,000,000,000,000 | 74 | Fix assertion in debug mode / heap-based buffer overflow in opj_write_bytes_LE for Cinema profiles with numresolutions = 1 (#985) |
virDomainShmemDefEquals(virDomainShmemDefPtr src,
virDomainShmemDefPtr dst)
{
if (STRNEQ_NULLABLE(src->name, dst->name))
return false;
if (src->size != dst->size)
return false;
if (src->model != dst->model)
return false;
if (src->server.enabled != dst->... | 0 | [
"CWE-212"
] | libvirt | a5b064bf4b17a9884d7d361733737fb614ad8979 | 95,026,214,460,681,130,000,000,000,000,000,000,000 | 37 | 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... |
virtual Status checkAuthForCommand(Client* client,
const std::string& dbname,
const BSONObj& cmdObj) {
return auth::checkAuthForInvalidateUserCacheCommand(client);
} | 0 | [
"CWE-613"
] | mongo | db19e7ce84cfd702a4ba9983ee2ea5019f470f82 | 238,589,438,247,938,600,000,000,000,000,000,000,000 | 5 | SERVER-38984 Validate unique User ID on UserCache hit
(cherry picked from commit e55d6e2292e5dbe2f97153251d8193d1cc89f5d7) |
template<typename t>
CImg<T>& max(const CImg<t>& img) {
const ulongT siz = size(), isiz = img.size();
if (siz && isiz) {
if (is_overlapped(img)) return max(+img);
T *ptrd = _data, *const ptre = _data + siz;
if (siz>isiz) for (ulongT n = siz/isiz; n; --n)
for (const ... | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 294,565,965,572,993,560,000,000,000,000,000,000,000 | 12 | Fix other issues in 'CImg<T>::load_bmp()'. |
srs_free(srs_t *srs)
{
int i;
for (i = 0; i < srs->numsecrets; i++) {
memset(srs->secrets[i], 0, strlen(srs->secrets[i]));
srs_f_free(srs->secrets[i]);
srs->secrets[i] = 0;
}
srs_f_free(srs);
} | 0 | [
"CWE-400",
"CWE-703",
"CWE-834"
] | postsrsd | 4733fb11f6bec6524bb8518c5e1a699288c26bac | 287,896,488,462,734,600,000,000,000,000,000,000,000 | 10 | SECURITY: Fix potential denial of service attack against PostSRSd
I discovered that PostSRSd could be tricked into consuming a lot of CPU
time with an SRS address that has an excessively long time stamp tag,
e.g.
SRS0=HHHH=TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT=0@example.com |
static inline void nvme_blk_write(BlockBackend *blk, int64_t offset,
BlockCompletionFunc *cb, NvmeRequest *req)
{
assert(req->sg.flags & NVME_SG_ALLOC);
if (req->sg.flags & NVME_SG_DMA) {
req->aiocb = dma_blk_write(blk, &req->sg.qsg, offset, BDRV_SECTOR_SIZE,
... | 0 | [] | qemu | 736b01642d85be832385063f278fe7cd4ffb5221 | 167,427,870,937,837,050,000,000,000,000,000,000,000 | 12 | hw/nvme: fix CVE-2021-3929
This fixes CVE-2021-3929 "locally" by denying DMA to the iomem of the
device itself. This still allows DMA to MMIO regions of other devices
(e.g. doing P2P DMA to the controller memory buffer of another NVMe
device).
Fixes: CVE-2021-3929
Reported-by: Qiuhao Li <Qiuhao.Li@outlook.com>
Review... |
TEST(IndexBoundsBuilderTest, SimpleNE) {
auto testIndex = buildSimpleIndexEntry();
BSONObj obj = BSON("a" << BSON("$ne" << 3));
auto expr = parseMatchExpression(obj);
BSONElement elt = obj.firstElement();
OrderedIntervalList oil;
IndexBoundsBuilder::BoundsTightness tightness;
IndexBoundsBuil... | 0 | [
"CWE-754"
] | mongo | f8f55e1825ee5c7bdb3208fc7c5b54321d172732 | 176,380,343,223,915,880,000,000,000,000,000,000,000 | 16 | SERVER-44377 generate correct plan for indexed inequalities to null |
void push_back(const T &value) {
if (size_ == capacity_)
grow(size_ + 1);
ptr_[size_++] = value;
} | 0 | [
"CWE-134",
"CWE-119",
"CWE-787"
] | fmt | 8cf30aa2be256eba07bb1cefb998c52326e846e7 | 123,774,316,433,341,330,000,000,000,000,000,000,000 | 5 | Fix segfault on complex pointer formatting (#642) |
void __init early_fixmap_init(void)
{
pgd_t *pgdp, pgd;
pud_t *pudp;
pmd_t *pmdp;
unsigned long addr = FIXADDR_START;
pgdp = pgd_offset_k(addr);
pgd = READ_ONCE(*pgdp);
if (CONFIG_PGTABLE_LEVELS > 3 &&
!(pgd_none(pgd) || pgd_page_paddr(pgd) == __pa_symbol(bm_pud))) {
/*
* We only end up here if the ke... | 0 | [] | linux | 15122ee2c515a253b0c66a3e618bc7ebe35105eb | 270,517,324,528,791,050,000,000,000,000,000,000,000 | 50 | arm64: Enforce BBM for huge IO/VMAP mappings
ioremap_page_range doesn't honour break-before-make and attempts to put
down huge mappings (using p*d_set_huge) over the top of pre-existing
table entries. This leads to us leaking page table memory and also gives
rise to TLB conflicts and spurious aborts, which have been s... |
cmsBool CMSEXPORT cmsIsToneCurveDescending(const cmsToneCurve* t)
{
_cmsAssert(t != NULL);
return t ->Table16[0] > t ->Table16[t ->nEntries-1];
} | 0 | [] | Little-CMS | 9cf2d61867375f867e6e80906a571d222bc2cbf3 | 215,233,478,891,144,500,000,000,000,000,000,000,000 | 6 | Memory squeezing fix: LCMS2: AllocateToneCurveStruct
Simply add an extra check on the last allocation to avoid returning a
partially built struct. |
vhost_check_queue_inflights_packed(struct virtio_net *dev,
struct vhost_virtqueue *vq)
{
uint16_t i;
uint16_t resubmit_num = 0, old_used_idx, num;
struct rte_vhost_resubmit_info *resubmit;
struct rte_vhost_inflight_info_packed *inflight_packed;
if (!(dev->protocol_features &
(1ULL << VHOST_USER_PROTOC... | 0 | [
"CWE-125",
"CWE-787"
] | dpdk | 6442c329b9d2ded0f44b27d2016aaba8ba5844c5 | 325,268,070,984,611,200,000,000,000,000,000,000,000 | 96 | vhost: fix queue number check when setting inflight FD
In function vhost_user_set_inflight_fd, queue number in inflight
message is used to access virtqueue. However, queue number could
be larger than VHOST_MAX_VRING and cause write OOB as this number
will be used to write inflight info in virtqueue structure. This
pat... |
START_TEST(virgl_test_transfer_write_no_iov)
{
struct virgl_box box;
struct virgl_renderer_resource_create_args res;
int ret;
testvirgl_init_simple_1d_resource(&res, 1);
ret = virgl_renderer_resource_create(&res, NULL, 0);
ck_assert_int_eq(ret, 0);
virgl_renderer_ctx_attach_resource(1, res.handle);
... | 0 | [
"CWE-909"
] | virglrenderer | b05bb61f454eeb8a85164c8a31510aeb9d79129c | 266,285,920,052,759,040,000,000,000,000,000,000,000 | 19 | vrend: clear memory when allocating a host-backed memory resource
Closes: #249
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com> |
CtPtr ProtocolV2::server_ready() {
ldout(cct, 20) << __func__ << dendl;
if (connection->delay_state) {
ceph_assert(connection->delay_state->ready());
}
return ready();
} | 0 | [
"CWE-323"
] | ceph | 20b7bb685c5ea74c651ca1ea547ac66b0fee7035 | 275,851,946,646,575,850,000,000,000,000,000,000,000 | 9 | 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... |
static const char *qxl_mode_to_string(int mode)
{
switch (mode) {
case QXL_MODE_COMPAT:
return "compat";
case QXL_MODE_NATIVE:
return "native";
case QXL_MODE_UNDEFINED:
return "undefined";
case QXL_MODE_VGA:
return "vga";
}
return "INVALID";
} | 0 | [] | qemu-kvm | 5ff4e36c804157bd84af43c139f8cd3a59722db9 | 75,983,370,895,913,610,000,000,000,000,000,000,000 | 14 | qxl: async io support using new spice api
Some of the QXL port i/o commands are waiting for the spice server to
complete certain actions. Add async versions for these commands, so we
don't block the vcpu while the spice server processses the command.
Instead the qxl device will raise an IRQ when done.
The async comm... |
profCallgraphAdd(xsltTemplatePtr templ, xsltTemplatePtr parent)
{
int i;
if (templ->templMax == 0) {
templ->templMax = 4;
templ->templCalledTab =
(xsltTemplatePtr *) xmlMalloc(templ->templMax *
sizeof(templ->templCalledTab[0]));
temp... | 0 | [] | libxslt | e03553605b45c88f0b4b2980adfbbb8f6fca2fd6 | 38,823,463,014,827,680,000,000,000,000,000,000,000 | 46 | Fix security framework bypass
xsltCheckRead and xsltCheckWrite return -1 in case of error but callers
don't check for this condition and allow access. With a specially
crafted URL, xsltCheckRead could be tricked into returning an error
because of a supposedly invalid URL that would still be loaded
succesfully later on... |
void LEX::save_values_list_state()
{
current_select->save_many_values= many_values;
current_select->save_insert_list= insert_list;
} | 0 | [
"CWE-703"
] | server | 39feab3cd31b5414aa9b428eaba915c251ac34a2 | 38,743,961,767,209,796,000,000,000,000,000,000,000 | 5 | MDEV-26412 Server crash in Item_field::fix_outer_field for INSERT SELECT
IF an INSERT/REPLACE SELECT statement contained an ON expression in the top
level select and this expression used a subquery with a column reference
that could not be resolved then an attempt to resolve this reference as
an outer reference caused... |
static bool ipv4_datagram_support_cmsg(const struct sock *sk,
struct sk_buff *skb,
int ee_origin)
{
struct in_pktinfo *info;
if (ee_origin == SO_EE_ORIGIN_ICMP)
return true;
if (ee_origin == SO_EE_ORIGIN_LOCAL)
return false;
/* Support IP_PKTINFO on tstamp packets if requested, to corre... | 0 | [
"CWE-476",
"CWE-284"
] | linux | 34b2cef20f19c87999fff3da4071e66937db9644 | 208,996,310,477,556,950,000,000,000,000,000,000,000 | 25 | ipv4: keep skb->dst around in presence of IP options
Andrey Konovalov got crashes in __ip_options_echo() when a NULL skb->dst
is accessed.
ipv4_pktinfo_prepare() should not drop the dst if (evil) IP options
are present.
We could refine the test to the presence of ts_needtime or srr,
but IP options are not often used... |
Curl_mbedtls_connect(struct connectdata *conn,
int sockindex)
{
CURLcode retcode;
bool done = FALSE;
retcode = mbed_connect_common(conn, sockindex, FALSE, &done);
if(retcode)
return retcode;
DEBUGASSERT(done);
return CURLE_OK;
} | 0 | [
"CWE-20"
] | curl | 6efd2fa529a189bf41736a610f6184cd8ad94b4d | 83,263,072,772,225,150,000,000,000,000,000,000,000 | 14 | mbedtls/polarssl: set "hostname" unconditionally
...as otherwise the TLS libs will skip the CN/SAN check and just allow
connection to any server. curl previously skipped this function when SNI
wasn't used or when connecting to an IP address specified host.
CVE-2016-3739
Bug: https://curl.haxx.se/docs/adv_20160518A.h... |
void CLASS canon_600_fixed_wb (int temp)
{
static const short mul[4][5] = {
{ 667, 358,397,565,452 },
{ 731, 390,367,499,517 },
{ 1119, 396,348,448,537 },
{ 1399, 485,431,508,688 } };
int lo, hi, i;
float frac=0;
for (lo=4; --lo; )
if (*mul[lo] <= temp) break;
for (hi=0; hi < 3; hi++)
... | 0 | [
"CWE-703"
] | LibRaw | 11909cc59e712e09b508dda729b99aeaac2b29ad | 94,833,775,697,307,090,000,000,000,000,000,000,000 | 19 | cumulated data checks patch |
blobValidate(
Syntax *syntax,
struct berval *in )
{
/* any value allowed */
return LDAP_SUCCESS;
} | 0 | [
"CWE-617"
] | openldap | 67670f4544e28fb09eb7319c39f404e1d3229e65 | 141,945,644,583,851,300,000,000,000,000,000,000,000 | 7 | ITS#9383 remove assert in certificateListValidate |
conn_to_ct_dpif_entry(const struct conn *conn, struct ct_dpif_entry *entry,
long long now, int bkt)
{
struct ct_l4_proto *class;
long long expiration;
memset(entry, 0, sizeof *entry);
conn_key_to_tuple(&conn->key, &entry->tuple_orig);
conn_key_to_tuple(&conn->rev_key, &entry->t... | 0 | [
"CWE-400"
] | ovs | 35c280072c1c3ed58202745b7d27fbbd0736999b | 288,766,973,438,109,600,000,000,000,000,000,000,000 | 32 | flow: Support extra padding length.
Although not required, padding can be optionally added until
the packet length is MTU bytes. A packet with extra padding
currently fails sanity checks.
Vulnerability: CVE-2020-35498
Fixes: fa8d9001a624 ("miniflow_extract: Properly handle small IP packets.")
Reported-by: Joakim Hind... |
get_decompress_stream(packet_info* pinfo)
{
const blip_conversation_entry_t* blip_convo = get_blip_conversation(pinfo);
// Store compression state per srcport/destport.
guint32 hash_key = (pinfo->srcport << 16) | pinfo->destport;
z_stream* decompress_stream = (z_stream *)wmem_map_lookup(blip_convo->decompress_stre... | 0 | [
"CWE-476"
] | wireshark | 4a948427100b6c109f4ec7b4361f0d2aec5e5c3f | 168,987,657,490,541,340,000,000,000,000,000,000,000 | 17 | BLIP: Fix decompression buffer bug
Until now, mistakenly, the buffer for decompressing compressed BLIP messages
has been statically allocated as 16 Kb, but that is not valid behavior.
16 Kb is the maximum size of a _compressed_ frame. In theory, due to the
ability to zipbomb, there is virtually no upper bound on what... |
TEST(CudnnRNNOpsTest, ForwardLstm_ShapeFn) {
int seq_length = 2;
int batch_size = 3;
int num_units = 4;
int num_layers = 5;
int dir_count = 1;
std::vector<int> input_shape = {seq_length, batch_size, num_units};
std::vector<int> input_h_shape = {num_layers * dir_count, batch_size,
... | 1 | [
"CWE-416",
"CWE-787"
] | tensorflow | af5fcebb37c8b5d71c237f4e59c6477015c78ce6 | 197,436,449,671,576,500,000,000,000,000,000,000,000 | 31 | Fix access to undefined memory during shape inference of Cudnn*.
PiperOrigin-RevId: 400324259
Change-Id: Ie3b7859d19ae24ee9ac2adf413bdc1e851bbc604 |
imap_client_notify_starttls(struct client *client,
bool success, const char *text)
{
if (success)
client_send_reply(client, IMAP_CMD_REPLY_OK, text);
else
client_send_reply(client, IMAP_CMD_REPLY_BAD, text);
} | 0 | [] | core | 62061e8cf68f506c0ccaaba21fd4174764ca875f | 46,804,368,708,724,290,000,000,000,000,000,000,000 | 8 | imap-login: Split off client_invalid_command() |
void ConnectDialog::on_qtwServers_itemExpanded(QTreeWidgetItem *item) {
if (qtwServers->siPublic != NULL && item == qtwServers->siPublic) {
initList();
fillList();
}
ServerItem *p = static_cast<ServerItem *>(item);
foreach(ServerItem *si, p->qlChildren)
startDns(si);
} | 0 | [
"CWE-59",
"CWE-61"
] | mumble | e59ee87abe249f345908c7d568f6879d16bfd648 | 134,601,808,298,924,680,000,000,000,000,000,000,000 | 11 | FIX(client): Only allow "http"/"https" for URLs in ConnectDialog
Our public server list registration script doesn't have an URL scheme
whitelist for the website field.
Turns out a malicious server can register itself with a dangerous URL in
an attempt to attack a user's machine.
User interaction is required, as the ... |
bit_write_BLL (Bit_Chain *dat, BITCODE_BLL value)
{
// 64bit into how many bytes?
int i;
int len = 0;
BITCODE_BLL umax = 0xf000000000000000ULL;
for (i = 16; i; i--, umax >>= 8)
{
if (value & umax)
{
len = i;
break;
}
}
bit_write_BB (dat, len << 2);
bit_wri... | 0 | [
"CWE-703",
"CWE-125"
] | libredwg | 95cc9300430d35feb05b06a9badf678419463dbe | 236,660,070,900,200,960,000,000,000,000,000,000,000 | 23 | encode: protect from stack under-flow
From GH #178 fuzzing |
bool samba_private_attr_name(const char *unix_ea_name)
{
static const char * const prohibited_ea_names[] = {
SAMBA_POSIX_INHERITANCE_EA_NAME,
SAMBA_XATTR_DOS_ATTRIB,
SAMBA_XATTR_MARKER,
XATTR_NTACL_NAME,
NULL
};
int i;
for (i = 0; prohibited_ea_names[i]; i++) {
if (strequal( prohibited_ea_names[i], un... | 1 | [
"CWE-787"
] | samba | 22b4091924977f6437b59627f33a8e6f02b41011 | 89,952,104,762,470,840,000,000,000,000,000,000,000 | 22 | CVE-2021-44142: smbd: add Netatalk xattr used by vfs_fruit to the list of private Samba xattrs
This is an internal xattr that should not be user visible.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14914
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org> |
static int mb_find_extent(struct ext4_buddy *e4b, int block,
int needed, struct ext4_free_extent *ex)
{
int next = block;
int max, order;
void *buddy;
assert_spin_locked(ext4_group_lock_ptr(e4b->bd_sb, e4b->bd_group));
BUG_ON(ex == NULL);
buddy = mb_find_buddy(e4b, 0, &max);
BUG_ON(buddy == NULL);
BUG_ON(... | 0 | [
"CWE-416"
] | linux | 8844618d8aa7a9973e7b527d038a2a589665002c | 141,207,721,851,837,730,000,000,000,000,000,000,000 | 62 | ext4: only look at the bg_flags field if it is valid
The bg_flags field in the block group descripts is only valid if the
uninit_bg or metadata_csum feature is enabled. We were not
consistently looking at this field; fix this.
Also block group #0 must never have uninitialized allocation bitmaps,
or need to be zeroed... |
static int nfs4_xdr_dec_getdeviceinfo(struct rpc_rqst *rqstp,
struct xdr_stream *xdr,
void *data)
{
struct nfs4_getdeviceinfo_res *res = data;
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
if (status != 0)
goto out;
status = decode_sequence(xdr, &res->seq_res... | 0 | [
"CWE-787"
] | linux | b4487b93545214a9db8cbf32e86411677b0cca21 | 223,394,051,193,888,360,000,000,000,000,000,000,000 | 18 | nfs: Fix getxattr kernel panic and memory overflow
Move the buffer size check to decode_attr_security_label() before memcpy()
Only call memcpy() if the buffer is large enough
Fixes: aa9c2669626c ("NFS: Client implementation of Labeled-NFS")
Signed-off-by: Jeffrey Mitchell <jeffrey.mitchell@starlab.io>
[Trond: clean u... |
static int mov_write_ctts_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track)
{
MOVMuxContext *mov = s->priv_data;
MOVStts *ctts_entries;
uint32_t entries = 0;
uint32_t atom_size;
int i;
ctts_entries = av_malloc_array((track->entry + 1), sizeof(*ctts_entries)); /* worst case */
if (!c... | 0 | [
"CWE-125"
] | FFmpeg | 95556e27e2c1d56d9e18f5db34d6f756f3011148 | 231,435,983,499,305,400,000,000,000,000,000,000,000 | 39 | avformat/movenc: Do not pass AVCodecParameters in avpriv_request_sample
Fixes: out of array read
Fixes: ffmpeg_crash_8.avi
Found-by: Thuan Pham, Marcel Böhme, Andrew Santosa and Alexandru Razvan Caciulescu with AFLSmart
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> |
irc_server_copy (struct t_irc_server *server, const char *new_name)
{
struct t_irc_server *new_server;
struct t_infolist *infolist;
char *mask, *pos;
const char *option_name;
int length, index_option;
/* check if another server exists with this name */
if (irc_server_casesearch (new_name))
... | 0 | [
"CWE-120",
"CWE-787"
] | weechat | 40ccacb4330a64802b1f1e28ed9a6b6d3ca9197f | 225,468,641,513,736,730,000,000,000,000,000,000,000 | 51 | irc: fix crash when a new message 005 is received with longer nick prefixes
Thanks to Stuart Nevans Locke for reporting the issue. |
static int v4l_g_priority(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{
struct video_device *vfd;
u32 *p = arg;
vfd = video_devdata(file);
*p = v4l2_prio_max(vfd->prio);
return 0;
} | 0 | [
"CWE-401"
] | linux | fb18802a338b36f675a388fc03d2aa504a0d0899 | 335,379,231,828,906,600,000,000,000,000,000,000,000 | 10 | media: v4l: ioctl: Fix memory leak in video_usercopy
When an IOCTL with argument size larger than 128 that also used array
arguments were handled, two memory allocations were made but alas, only
the latter one of them was released. This happened because there was only
a single local variable to hold such a temporary a... |
static int pfkey_broadcast_one(struct sk_buff *skb, struct sk_buff **skb2,
gfp_t allocation, struct sock *sk)
{
int err = -ENOBUFS;
sock_hold(sk);
if (*skb2 == NULL) {
if (atomic_read(&skb->users) != 1) {
*skb2 = skb_clone(skb, allocation);
} else {
*skb2 = skb;
atomic_inc(&skb->users);
}
... | 0 | [
"CWE-20",
"CWE-269"
] | linux | f3d3342602f8bcbf37d7c46641cb9bca7618eb1c | 13,629,978,195,721,818,000,000,000,000,000,000,000 | 26 | net: rework recvmsg handler msg_name and msg_namelen logic
This patch now always passes msg->msg_namelen as 0. recvmsg handlers must
set msg_namelen to the proper size <= sizeof(struct sockaddr_storage)
to return msg_name to the user.
This prevents numerous uninitialized memory leaks we had in the
recvmsg handlers an... |
static void cleanup_a(struct list_head *actions)
{
struct tc_action *a, *tmp;
list_for_each_entry_safe(a, tmp, actions, list) {
list_del(&a->list);
kfree(a);
}
} | 0 | [
"CWE-264"
] | net | 90f62cf30a78721641e08737bda787552428061e | 304,523,361,258,951,400,000,000,000,000,000,000,000 | 9 | net: Use netlink_ns_capable to verify the permisions of netlink messages
It is possible by passing a netlink socket to a more privileged
executable and then to fool that executable into writing to the socket
data that happens to be valid netlink message to do something that
privileged executable did not intend to do.
... |
ldns_str2rdf_period(ldns_rdf **rd,const char *period)
{
uint32_t p;
const char *end;
/* Allocate required space... */
p = ldns_str2period(period, &end);
if (*end != 0) {
return LDNS_STATUS_ERR;
} else {
p = (uint32_t) htonl(p);
*rd = ldns_rdf_new_frm... | 0 | [] | ldns | 3bdeed02505c9bbacb3b64a97ddcb1de967153b7 | 242,786,676,456,856,660,000,000,000,000,000,000,000 | 17 | bugfix #1257: Free after reallocing to 0 size
Thanks Stephan Zeisberg |
static inline void clr_dr_intercepts(struct vcpu_svm *svm)
{
struct vmcb *vmcb = get_host_vmcb(svm);
vmcb->control.intercept_dr = 0;
recalc_intercepts(svm);
} | 0 | [] | kvm | 854e8bb1aa06c578c2c9145fa6bfe3680ef63b23 | 68,632,674,660,841,480,000,000,000,000,000,000,000 | 8 | KVM: x86: Check non-canonical addresses upon WRMSR
Upon WRMSR, the CPU should inject #GP if a non-canonical value (address) is
written to certain MSRs. The behavior is "almost" identical for AMD and Intel
(ignoring MSRs that are not implemented in either architecture since they would
anyhow #GP). However, IA32_SYSENTE... |
ModuleExport size_t RegisterSVGImage(void)
{
char
version[MaxTextExtent];
MagickInfo
*entry;
*version='\0';
#if defined(LIBXML_DOTTED_VERSION)
(void) CopyMagickString(version,"XML " LIBXML_DOTTED_VERSION,MaxTextExtent);
#endif
#if defined(MAGICKCORE_RSVG_DELEGATE)
#if !GLIB_CHECK_VERSION(2,35,0)
g_t... | 0 | [
"CWE-674"
] | ImageMagick6 | 6ba5e4b1673d75988d8dde38118b495a342823c8 | 249,906,090,230,400,300,000,000,000,000,000,000,000 | 70 | [FG-VD-19-136] ImageMagick Convert SVG MacOS Denial Of Service |
int ssh_scp_leave_directory(ssh_scp scp)
{
char buffer[] = "E\n";
int rc;
uint8_t code;
if (scp == NULL) {
return SSH_ERROR;
}
if (scp->state != SSH_SCP_WRITE_INITED) {
ssh_set_error(scp->session, SSH_FATAL,
"ssh_scp_leave_directory called under invalid st... | 1 | [] | libssh | 82c375b7c99141a5495e62060e0b7f9c97981e7e | 135,977,056,502,294,370,000,000,000,000,000,000,000 | 39 | CVE-2019-14889: scp: Log SCP warnings received from the server
Fixes T181
Previously, warnings received from the server were ignored. With this
change the warning message sent by the server will be logged.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.... |
static bool is_pointer_value(struct verifier_env *env, int regno)
{
if (env->allow_ptr_leaks)
return false;
switch (env->cur_state.regs[regno].type) {
case UNKNOWN_VALUE:
case CONST_IMM:
return false;
default:
return true;
}
} | 0 | [
"CWE-200"
] | linux | a1b14d27ed0965838350f1377ff97c93ee383492 | 77,984,607,317,126,090,000,000,000,000,000,000,000 | 13 | bpf: fix branch offset adjustment on backjumps after patching ctx expansion
When ctx access is used, the kernel often needs to expand/rewrite
instructions, so after that patching, branch offsets have to be
adjusted for both forward and backward jumps in the new eBPF program,
but for backward jumps it fails to account ... |
TEST_F(OptimizePipeline, ComputedProjectThenSortPushedDown) {
auto pipeline = Pipeline::parse(
makeVector(fromjson("{$_internalUnpackBucket: { exclude: [], timeField: 'time', metaField: "
"'myMeta', bucketMaxSpanSeconds: 3600}}"),
fromjson("{$project: {myMeta: ... | 0 | [] | mongo | b3107d73a2c58d7e016b834dae0acfd01c0db8d7 | 264,609,468,078,664,800,000,000,000,000,000,000,000 | 23 | SERVER-59299: Flatten top-level nested $match stages in doOptimizeAt
(cherry picked from commit 4db5eceda2cff697f35c84cd08232bac8c33beec) |
struct resource *platform_get_resource_byname(struct platform_device *dev,
unsigned int type,
const char *name)
{
u32 i;
for (i = 0; i < dev->num_resources; i++) {
struct resource *r = &dev->resource[i];
if (unlikely(!r->name))
continue;
if (type == resource_type(r) && !strcmp(r->nam... | 0 | [
"CWE-787"
] | linux | aa838896d87af561a33ecefea1caa4c15a68bc47 | 185,285,337,908,855,730,000,000,000,000,000,000,000 | 17 | drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions
Convert the various sprintf fmaily calls in sysfs device show functions
to sysfs_emit and sysfs_emit_at for PAGE_SIZE buffer safety.
Done with:
$ spatch -sp-file sysfs_emit_dev.cocci --in-place --max-width=80 .
And cocci script:
$ cat s... |
_g_mime_type_get_from_content (char *buffer,
gsize buffer_size)
{
#if ENABLE_MAGIC
static magic_t magic = NULL;
if (magic == NULL) {
magic = magic_open (MAGIC_MIME_TYPE);
if (magic != NULL)
magic_load (magic, NULL);
else
g_warning ("unable to open magic database");
}
if (magic != NULL) {
... | 0 | [
"CWE-22"
] | file-roller | b147281293a8307808475e102a14857055f81631 | 55,563,981,224,574,240,000,000,000,000,000,000,000 | 66 | libarchive: sanitize filenames before extracting |
TEST_F(ConnectionHandlerTest, ContinueOnListenerFilterTimeout) {
InSequence s;
TestListener* test_listener =
addListener(1, true, false, "test_listener", Network::Address::SocketType::Stream,
std::chrono::milliseconds(15000), true);
Network::MockListener* listener = new Network::MockListe... | 1 | [
"CWE-835"
] | envoy | c8de199e2971f79cbcbc6b5eadc8c566b28705d1 | 292,475,617,864,940,530,000,000,000,000,000,000,000 | 49 | listener: clean up accept filter before creating connection (#8922)
Signed-off-by: Yuchen Dai <silentdai@gmail.com> |
static inline void ConvertLuvToXYZ(const double L,const double u,const double v,
double *X,double *Y,double *Z)
{
double
gamma;
assert(X != (double *) NULL);
assert(Y != (double *) NULL);
assert(Z != (double *) NULL);
if (L > (CIEK*CIEEpsilon))
*Y=(double) pow((L+16.0)/116.0,3.0);
else
*Y=L/C... | 1 | [] | ImageMagick | a855d3ad660f307fdb071794351822f9ce878c4e | 38,417,910,825,899,277,000,000,000,000,000,000,000 | 20 | https://github.com/ImageMagick/ImageMagick/issues/3317 |
static void network_send_buffer_signed(sockent_t *se, /* {{{ */
const char *in_buffer,
size_t in_buffer_size) {
char buffer[BUFF_SIG_SIZE + in_buffer_size];
size_t buffer_offset;
size_t username_len;
gcry_md_hd_t hd;
gcry_error_t e... | 0 | [
"CWE-835"
] | collectd | f6be4f9b49b949b379326c3d7002476e6ce4f211 | 102,521,483,034,557,880,000,000,000,000,000,000,000 | 69 | network plugin: Fix endless loop DOS in parse_packet()
When correct 'Signature part' is received by Collectd, configured without
AuthFile option, condition for endless loop occurs due to missing increase
of pointer to next unprocessed part.
This is a forward-port of #2233.
Fixes: CVE-2017-7401
Closes: #2174
Signed-o... |
virtual int getChar()
{ return (bufIdx >= bufSize && !fillBuf()) ? EOF : buf[bufIdx++]; } | 0 | [] | poppler | abf167af8b15e5f3b510275ce619e6fdb42edd40 | 315,030,500,302,298,370,000,000,000,000,000,000,000 | 2 | Implement tiling/patterns in SplashOutputDev
Fixes bug 13518 |
do_auxv_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type,
int swap, uint32_t namesz __attribute__((__unused__)),
uint32_t descsz __attribute__((__unused__)),
size_t noff __attribute__((__unused__)), size_t doff,
int *flags, size_t size __attribute__((__unused__)), int clazz,
int fd, off... | 0 | [
"CWE-787"
] | file | d65781527c8134a1202b2649695d48d5701ac60b | 285,961,543,139,075,930,000,000,000,000,000,000,000 | 105 | PR/62: spinpx: limit size of file_printable. |
PHP_MINIT_FUNCTION(curl)
{
le_curl = zend_register_list_destructors_ex(_php_curl_close, NULL, "curl", module_number);
le_curl_multi_handle = zend_register_list_destructors_ex(_php_curl_multi_close, NULL, "curl_multi", module_number);
le_curl_share_handle = zend_register_list_destructors_ex(_php_curl_share_close, NUL... | 0 | [
"CWE-119",
"CWE-787"
] | php-src | 72dbb7f416160f490c4e9987040989a10ad431c7 | 93,128,066,816,918,160,000,000,000,000,000,000,000 | 744 | Fix bug #72674 - check both curl_escape and curl_unescape |
static ut64 initializeEsil(RCore *core) {
const char *name = r_reg_get_name (core->anal->reg, R_REG_NAME_PC);
RAnalEsil *esil = core->anal->esil;
int romem = r_config_get_i (core->config, "esil.romem");
int stats = r_config_get_i (core->config, "esil.stats");
int iotrap = r_config_get_i (core->config, "esil.iotrap... | 0 | [
"CWE-416",
"CWE-908"
] | radare2 | 9d348bcc2c4bbd3805e7eec97b594be9febbdf9a | 309,690,041,950,588,070,000,000,000,000,000,000,000 | 32 | Fix #9943 - Invalid free on RAnal.avr |
__zzip_parse_root_directory(int fd,
struct _disk_trailer *trailer,
struct zzip_dir_hdr **hdr_return,
zzip_plugin_io_t io)
{
auto struct zzip_disk_entry dirent;
struct zzip_dir_hdr *hdr;
struct zzip_dir_hdr *hdr0;
uint16_... | 1 | [
"CWE-119"
] | zziplib | feae4da1a5c92100c44ebfcbaaa895959cc0829b | 31,532,253,133,466,990,000,000,000,000,000,000,000 | 178 | fix for zz_rootsize #41 |
const struct GUID *samdb_domain_guid(struct ldb_context *ldb)
{
TALLOC_CTX *tmp_ctx = NULL;
struct GUID *domain_guid = NULL;
const char *attrs[] = {
"objectGUID",
NULL
};
struct ldb_result *res = NULL;
int ret;
/* see if we have a cached copy */
domain_guid = (struct GUID *)ldb_get_opaque(ldb, "cache.domai... | 0 | [
"CWE-200"
] | samba | 0a3aa5f908e351201dc9c4d4807b09ed9eedff77 | 98,193,120,215,313,640,000,000,000,000,000,000,000 | 51 | CVE-2022-32746 ldb: Make use of functions for appending to an ldb_message
This aims to minimise usage of the error-prone pattern of searching for
a just-added message element in order to make modifications to it (and
potentially finding the wrong element).
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15009
Signed... |
void vsock_remove_sock(struct vsock_sock *vsk)
{
vsock_remove_bound(vsk);
vsock_remove_connected(vsk);
} | 0 | [
"CWE-667"
] | linux | c518adafa39f37858697ac9309c6cf1805581446 | 243,599,215,230,230,930,000,000,000,000,000,000,000 | 5 | vsock: fix the race conditions in multi-transport support
There are multiple similar bugs implicitly introduced by the
commit c0cfa2d8a788fcf4 ("vsock: add multi-transports support") and
commit 6a2c0962105ae8ce ("vsock: prevent transport modules unloading").
The bug pattern:
[1] vsock_sock.transport pointer is copie... |
static int jas_strtoopenmode(const char *s)
{
int openmode = 0;
while (*s != '\0') {
switch (*s) {
case 'r':
openmode |= JAS_STREAM_READ;
break;
case 'w':
openmode |= JAS_STREAM_WRITE | JAS_STREAM_CREATE;
break;
case 'b':
openmode |= JAS_STREAM_BINARY;
break;
case 'a':
openmode |= JAS_S... | 0 | [
"CWE-189"
] | jasper | 3c55b399c36ef46befcb21e4ebc4799367f89684 | 68,390,022,846,829,020,000,000,000,000,000,000,000 | 27 | At many places in the code, jas_malloc or jas_recalloc was being
invoked with the size argument being computed in a manner that would not
allow integer overflow to be detected. Now, these places in the code
have been modified to use special-purpose memory allocation functions
(e.g., jas_alloc2, jas_alloc3, jas_realloc... |
qmerge_start (struct qmerge **qm, const char servers[64],
int flagrecursive, const char *q,
const char qtype[2], const char localip[4], const char *control)
{
int i = 0, r = 0;
struct qmerge_key k;
qmerge_free (qm);
byte_zero (&k, sizeof (k));
if (!qmerge_key_init (&k, ... | 0 | [
"CWE-362"
] | ndjbdns | 847523271f3966cf4618c5689b905703c41dec1c | 37,356,202,804,316,594,000,000,000,000,000,000,000 | 51 | 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.