func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
static int complete_walk(struct nameidata *nd)
{
struct dentry *dentry = nd->path.dentry;
int status;
if (nd->flags & LOOKUP_RCU) {
if (!(nd->flags & LOOKUP_ROOT))
nd->root.mnt = NULL;
if (unlikely(unlazy_walk(nd, NULL, 0)))
return -ECHILD;
}
if (likely(!(nd->flags & LOOKUP_JUMPED)))
return 0;
if (... | 0 | [
"CWE-284"
] | linux | 9409e22acdfc9153f88d9b1ed2bd2a5b34d2d3ca | 170,586,256,225,889,300,000,000,000,000,000,000,000 | 27 | vfs: rename: check backing inode being equal
If a file is renamed to a hardlink of itself POSIX specifies that rename(2)
should do nothing and return success.
This condition is checked in vfs_rename(). However it won't detect hard
links on overlayfs where these are given separate inodes on the overlayfs
layer.
Over... |
on_launch_environment_session_opened (GdmLaunchEnvironment *launch_environment,
GdmDisplay *self)
{
char *session_id;
g_debug ("GdmDisplay: Greeter session opened");
session_id = gdm_launch_environment_get_session_id (launch_environment);
... | 0 | [
"CWE-754"
] | gdm | 4e6e5335d29c039bed820c43bfd1c19cb62539ff | 68,381,876,051,434,550,000,000,000,000,000,000,000 | 10 | display: Use autoptr to handle errors in look for existing users
It will make things just cleaner |
R_API RBinJavaAttrInfo *r_bin_java_default_attr_new(RBinJavaObj *bin, ut8 *buffer, ut64 sz, ut64 buf_offset) {
// NOTE: this function receives the buffer offset in the original buffer,
// but the buffer is already point to that particular offset.
// XXX - all the code that relies on this function should probably be ... | 0 | [
"CWE-119",
"CWE-788"
] | radare2 | 6c4428f018d385fc80a33ecddcb37becea685dd5 | 230,086,933,234,975,100,000,000,000,000,000,000,000 | 33 | Improve boundary checks to fix oobread segfaults ##crash
* Reported by Cen Zhang via huntr.dev
* Reproducer: bins/fuzzed/javaoob-havoc.class |
void luaV_finishset (lua_State *L, const TValue *t, TValue *key,
TValue *val, const TValue *slot) {
int loop; /* counter to avoid infinite loops */
for (loop = 0; loop < MAXTAGLOOP; loop++) {
const TValue *tm; /* '__newindex' metamethod */
if (slot != NULL) { /* is 't' a table? */
... | 0 | [
"CWE-787"
] | lua | 42d40581dd919fb134c07027ca1ce0844c670daf | 163,224,368,144,689,400,000,000,000,000,000,000,000 | 36 | Save stack space while handling errors
Because error handling (luaG_errormsg) uses slots from EXTRA_STACK,
and some errors can recur (e.g., string overflow while creating an
error message in 'luaG_runerror', or a C-stack overflow before calling
the message handler), the code should use stack slots with parsimony.
Thi... |
u32 gf_fs_get_filters_count(GF_FilterSession *session)
{
return session ? gf_list_count(session->filters) : 0;
} | 0 | [
"CWE-787"
] | gpac | da37ec8582266983d0ec4b7550ec907401ec441e | 30,676,679,683,122,213,000,000,000,000,000,000,000 | 4 | fixed crashes for very long path - cf #1908 |
send_query_to_peer(peer_t *p)
{
/* Why do we need to bind()?
* See what happens when we don't bind:
*
* socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 3
* setsockopt(3, SOL_IP, IP_TOS, [16], 4) = 0
* gettimeofday({1259071266, 327885}, NULL) = 0
* sendto(3, "xxx", 48, MSG_DONTWAIT, {sa_family=AF_INET, sin_port=h... | 0 | [
"CWE-399"
] | busybox | 150dc7a2b483b8338a3e185c478b4b23ee884e71 | 72,586,095,432,827,300,000,000,000,000,000,000,000 | 88 | ntpd: respond only to client and symmetric active packets
The busybox NTP implementation doesn't check the NTP mode of packets
received on the server port and responds to any packet with the right
size. This includes responses from another NTP server. An attacker can
send a packet with a spoofed source address in orde... |
static struct regulator *_regulator_get(struct device *dev, const char *id,
bool exclusive, bool allow_dummy)
{
struct regulator_dev *rdev;
struct regulator *regulator = ERR_PTR(-EPROBE_DEFER);
const char *devname = NULL;
int ret;
if (id == NULL) {
pr_err("get() with no identifier\n");
return ERR_PTR(-EI... | 0 | [
"CWE-416"
] | linux | 60a2362f769cf549dc466134efe71c8bf9fbaaba | 225,859,725,124,872,200,000,000,000,000,000,000,000 | 94 | regulator: core: Fix regualtor_ena_gpio_free not to access pin after freeing
After freeing pin from regulator_ena_gpio_free, loop can access
the pin. So this patch fixes not to access pin after freeing.
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org> |
MonoReflectionMethod*
mono_reflection_bind_generic_method_parameters (MonoReflectionMethod *rmethod, MonoArray *types)
{
MonoClass *klass;
MonoMethod *method, *inflated;
MonoMethodInflated *imethod;
MonoGenericContext tmp_context;
MonoGenericInst *ginst;
MonoType **type_argv;
int count, i;
MONO_ARCH_SAVE_REGS;... | 1 | [
"CWE-20"
] | mono | 65292a69c837b8a5f7a392d34db63de592153358 | 161,148,815,879,048,570,000,000,000,000,000,000,000 | 69 | 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 |
static int rfcomm_sock_getname(struct socket *sock, struct sockaddr *addr, int *len, int peer)
{
struct sockaddr_rc *sa = (struct sockaddr_rc *) addr;
struct sock *sk = sock->sk;
BT_DBG("sock %p, sk %p", sock, sk);
memset(sa, 0, sizeof(*sa));
sa->rc_family = AF_BLUETOOTH;
sa->rc_channel = rfcomm_pi(sk)->channe... | 0 | [
"CWE-200"
] | linux | e11e0455c0d7d3d62276a0c55d9dfbc16779d691 | 9,980,762,431,611,519,000,000,000,000,000,000,000 | 18 | Bluetooth: RFCOMM - Fix missing msg_namelen update in rfcomm_sock_recvmsg()
If RFCOMM_DEFER_SETUP is set in the flags, rfcomm_sock_recvmsg() returns
early with 0 without updating the possibly set msg_namelen member. This,
in turn, leads to a 128 byte kernel stack leak in net/socket.c.
Fix this by updating msg_namelen... |
static inline unsigned int ahash_align_buffer_size(unsigned len,
unsigned long mask)
{
return len + (mask & ~(crypto_tfm_ctx_alignment() - 1));
} | 0 | [
"CWE-835"
] | linux | ef0579b64e93188710d48667cb5e014926af9f1b | 118,993,996,379,972,420,000,000,000,000,000,000,000 | 5 | crypto: ahash - Fix EINPROGRESS notification callback
The ahash API modifies the request's callback function in order
to clean up after itself in some corner cases (unaligned final
and missing finup).
When the request is complete ahash will restore the original
callback and everything is fine. However, when the requ... |
virDomainNetIPParseXML(xmlNodePtr node)
{
/* Parse the prefix in every case */
unsigned int prefixValue = 0;
int family = AF_UNSPEC;
g_autofree virNetDevIPAddrPtr ip = NULL;
g_autofree char *prefixStr = NULL;
g_autofree char *familyStr = NULL;
g_autofree char *address = NULL;
g_autofree ... | 0 | [
"CWE-212"
] | libvirt | a5b064bf4b17a9884d7d361733737fb614ad8979 | 193,298,115,503,051,530,000,000,000,000,000,000,000 | 56 | 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... |
PointToCELL(TScreen *screen,
int y,
int x,
CELL *cell)
/* Convert pixel coordinates to character coordinates.
Rows are clipped between firstValidRow and lastValidRow.
Columns are clipped between to be 0 or greater, but are not clipped to some
maximum value. */
{
cell->row = (y - screen->... | 0 | [
"CWE-399"
] | xterm-snapshots | 82ba55b8f994ab30ff561a347b82ea340ba7075c | 127,360,879,216,465,320,000,000,000,000,000,000,000 | 32 | snapshot of project "xterm", label xterm-365d |
static int compat_getdrvstat(int drive, bool poll,
struct compat_floppy_drive_struct __user *arg)
{
struct compat_floppy_drive_struct v;
memset(&v, 0, sizeof(struct compat_floppy_drive_struct));
mutex_lock(&floppy_mutex);
if (poll) {
if (lock_fdc(drive))
goto Eintr;
if (poll_drive(true, FD_RAW_NEED_... | 0 | [
"CWE-190",
"CWE-125"
] | linux | da99466ac243f15fbba65bd261bfc75ffa1532b6 | 45,968,444,307,711,950,000,000,000,000,000,000,000 | 38 | floppy: fix out-of-bounds read in copy_buffer
This fixes a global out-of-bounds read access in the copy_buffer
function of the floppy driver.
The FDDEFPRM ioctl allows one to set the geometry of a disk. The sect
and head fields (unsigned int) of the floppy_drive structure are used to
compute the max_sector (int) in ... |
int file_permission(struct file *file, int mask)
{
return permission(file->f_path.dentry->d_inode, mask, NULL);
} | 0 | [
"CWE-120"
] | linux-2.6 | d70b67c8bc72ee23b55381bd6a884f4796692f77 | 34,118,175,351,931,230,000,000,000,000,000,000,000 | 4 | [patch] vfs: fix lookup on deleted directory
Lookup can install a child dentry for a deleted directory. This keeps
the directory dentry alive, and the inode pinned in the cache and on
disk, even after all external references have gone away.
This isn't a big problem normally, since memory pressure or umount
will clea... |
bool cancel_work(struct work_struct *work)
{
return __cancel_work(work, false);
} | 0 | [
"CWE-200"
] | tip | dfb4357da6ddbdf57d583ba64361c9d792b0e0b1 | 53,361,780,421,512,680,000,000,000,000,000,000,000 | 4 | time: Remove CONFIG_TIMER_STATS
Currently CONFIG_TIMER_STATS exposes process information across namespaces:
kernel/time/timer_list.c print_timer():
SEQ_printf(m, ", %s/%d", tmp, timer->start_pid);
/proc/timer_list:
#11: <0000000000000000>, hrtimer_wakeup, S:01, do_nanosleep, cron/2570
Given that the trac... |
enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_RESPONSE_EX_with_flags(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_SAM_LOGON_RESPONSE_EX *r)
{
{
uint32_t _flags_save_STRUCT = ndr->flags;
ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_push_align(ndr, ... | 0 | [
"CWE-400"
] | samba | cc3a67760cf9faaad3af73b1eed9e2ef85276633 | 68,373,099,481,992,970,000,000,000,000,000,000,000 | 42 | CVE-2020-10745: ndr/dns-utils: prepare for NBT compatibility
NBT has a funny thing where it sometimes needs to send a trailing dot as
part of the last component, because the string representation is a user
name. In DNS, "example.com", and "example.com." are the same, both
having three components ("example", "com", "")... |
static int encode_write(struct xdr_stream *xdr, const struct nfs_writeargs *args)
{
__be32 *p;
RESERVE_SPACE(4);
WRITE32(OP_WRITE);
encode_stateid(xdr, args->context);
RESERVE_SPACE(16);
WRITE64(args->offset);
WRITE32(args->stable);
WRITE32(args->count);
xdr_write_pages(xdr, args->pages, args->pgbase, args... | 0 | [
"CWE-703"
] | linux | dc0b027dfadfcb8a5504f7d8052754bf8d501ab9 | 222,906,457,112,983,150,000,000,000,000,000,000,000 | 18 | NFSv4: Convert the open and close ops to use fmode
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> |
static void cdelete(JF, js_Ast *exp)
{
js_Ast *arg = exp->a;
switch (arg->type) {
case EXP_IDENTIFIER:
if (F->strict)
jsC_error(J, exp, "delete on an unqualified name is not allowed in strict mode");
emitline(J, F, exp);
emitlocal(J, F, OP_DELLOCAL, OP_DELVAR, arg);
break;
case EXP_INDEX:
cexp(J, F, ar... | 0 | [
"CWE-703",
"CWE-787"
] | mujs | df8559e7bdbc6065276e786217eeee70f28fce66 | 200,130,658,348,007,630,000,000,000,000,000,000,000 | 25 | Bug 704749: Clear jump list after patching jump addresses.
Since we can emit a statement multiple times when compiling try/finally
we have to use a new patch list for each instance. |
size_t zmalloc_get_smap_bytes_by_field(char *field, long pid) {
#if defined(__APPLE__)
struct proc_regioninfo pri;
if (pid == -1) pid = getpid();
if (proc_pidinfo(pid, PROC_PIDREGIONINFO, 0, &pri,
PROC_PIDREGIONINFO_SIZE) == PROC_PIDREGIONINFO_SIZE)
{
int pagesize = getpages... | 0 | [
"CWE-190"
] | redis | d32f2e9999ce003bad0bd2c3bca29f64dcce4433 | 259,649,475,441,824,670,000,000,000,000,000,000,000 | 22 | Fix integer overflow (CVE-2021-21309). (#8522)
On 32-bit systems, setting the proto-max-bulk-len config parameter to a high value may result with integer overflow and a subsequent heap overflow when parsing an input bulk (CVE-2021-21309).
This fix has two parts:
Set a reasonable limit to the config parameter.
A... |
nfa_postfix_dump(char_u *expr, int retval)
{
int *p;
FILE *f;
f = fopen(NFA_REGEXP_DUMP_LOG, "a");
if (f != NULL)
{
fprintf(f, "\n-------------------------\n");
if (retval == FAIL)
fprintf(f, ">>> NFA engine failed... \n");
else if (retval == OK)
fprintf(f, ">>> NFA engine succeeded !\... | 0 | [
"CWE-122"
] | vim | 65b605665997fad54ef39a93199e305af2fe4d7f | 83,568,334,891,945,380,000,000,000,000,000,000,000 | 26 | patch 8.2.3409: reading beyond end of line with invalid utf-8 character
Problem: Reading beyond end of line with invalid utf-8 character.
Solution: Check for NUL when advancing. |
hash_data(const unsigned char *data, size_t datalen, unsigned char *hash, unsigned int mechanismType)
{
if ((NULL == data) || (NULL == hash))
return SC_ERROR_INVALID_ARGUMENTS;
if(mechanismType & SC_ALGORITHM_ECDSA_HASH_SHA1)
{
unsigned char data_hash[24] = { 0 };
size_t len = 0;
sha1_digest(data, datalen... | 0 | [
"CWE-415",
"CWE-119"
] | OpenSC | 360e95d45ac4123255a4c796db96337f332160ad | 93,415,934,285,231,930,000,000,000,000,000,000,000 | 33 | fixed out of bounds writes
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting the problems. |
void Gfx::opFillStroke(Object args[], int numArgs) {
if (!state->isCurPt()) {
//error(getPos(), "No path in fill/stroke");
return;
}
if (state->isPath() && !contentIsHidden()) {
if (state->getFillColorSpace()->getMode() == csPattern) {
doPatternFill(gFalse);
} else {
out->fill(state);
... | 0 | [] | poppler | abf167af8b15e5f3b510275ce619e6fdb42edd40 | 276,587,951,364,570,900,000,000,000,000,000,000,000 | 19 | Implement tiling/patterns in SplashOutputDev
Fixes bug 13518 |
mtab_is_a_symlink(void) {
get_mtab_info();
return var_mtab_is_a_symlink;
} | 0 | [
"CWE-399"
] | util-linux | 4b39b6aefd5dd8ac68a92adc650dc13d5d54d704 | 139,989,368,735,210,440,000,000,000,000,000,000,000 | 4 | mount: use fflush() and temporary file for mtab updates (CVE-2011-1089)
http://thread.gmane.org/gmane.comp.security.oss.general/4374
Changes:
- force mount(8) to use /etc/mtab.tmp file every time. The original
code used the tmp file for remount/move operations only.
- call and check fflush() return code for... |
R_API const char *r_bin_get_meth_flag_string(ut64 flag, bool compact) {
switch (flag) {
case R_BIN_METH_CLASS:
return compact ? "c" : "class";
case R_BIN_METH_STATIC:
return compact ? "s" : "static";
case R_BIN_METH_PUBLIC:
return compact ? "p" : "public";
case R_BIN_METH_PRIVATE:
return compact ? "P" : "p... | 0 | [
"CWE-125"
] | radare2 | d31c4d3cbdbe01ea3ded16a584de94149ecd31d9 | 204,096,938,263,555,430,000,000,000,000,000,000,000 | 50 | Fix #8748 - Fix oobread on string search |
DT_1_SendPData(PRIVATE_NETWORKKEY ** /*network*/,
PRIVATE_ASSOCIATIONKEY ** association, int nextState, void *params)
{
OFCondition cond = EC_Normal;
DUL_PDVLIST
* pdvList;
/* Remember that params used to be a variable of type DUL_PDVLIST * and restore this variable */
pdvList = (DUL_P... | 0 | [
"CWE-415",
"CWE-703",
"CWE-401"
] | dcmtk | a9697dfeb672b0b9412c00c7d36d801e27ec85cb | 158,544,083,430,068,670,000,000,000,000,000,000,000 | 19 | Fixed poss. NULL pointer dereference/double free.
Thanks to Jinsheng Ba <bajinsheng@u.nus.edu> for the report and some patches. |
u8 remove_sta(struct ar6_softc *ar, u8 *mac, u16 reason)
{
u8 i, removed=0;
if(IS_MAC_NULL(mac)) {
return removed;
}
if(IS_MAC_BCAST(mac)) {
A_PRINTF("DEL ALL STA\n");
for(i=0; i < AP_MAX_NUM_STA; i++) {
if(!IS_MAC_NULL(ar->sta_list[i].mac)) {
sta_cl... | 0 | [
"CWE-703",
"CWE-264"
] | linux | 550fd08c2cebad61c548def135f67aba284c6162 | 1,839,694,507,936,271,400,000,000,000,000,000,000 | 31 | 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... |
static mode_t unix_perms_to_acl_perms(mode_t mode, int r_mask, int w_mask, int x_mask)
{
mode_t ret = 0;
if (mode & r_mask)
ret |= S_IRUSR;
if (mode & w_mask)
ret |= S_IWUSR;
if (mode & x_mask)
ret |= S_IXUSR;
return ret;
} | 0 | [
"CWE-264"
] | samba | d6c28913f3109d1327a3d1369b6eafd3874b2dca | 128,188,768,378,974,460,000,000,000,000,000,000,000 | 13 | Bug 6488: acl_group_override() call in posix acls references an uninitialized variable.
(cherry picked from commit f92195e3a1baaddda47a5d496f9488c8445b41ad) |
u8 ath_txchainmask_reduction(struct ath_softc *sc, u8 chainmask, u32 rate)
{
struct ath_hw *ah = sc->sc_ah;
struct ath9k_channel *curchan = ah->curchan;
if ((ah->caps.hw_caps & ATH9K_HW_CAP_APM) && IS_CHAN_5GHZ(curchan) &&
(chainmask == 0x7) && (rate < 0x90))
return 0x3;
else if (AR_SREV_9462(ah) && ath9k_h... | 0 | [
"CWE-362",
"CWE-241"
] | linux | 21f8aaee0c62708654988ce092838aa7df4d25d8 | 51,462,709,797,186,150,000,000,000,000,000,000,000 | 14 | ath9k: protect tid->sched check
We check tid->sched without a lock taken on ath_tx_aggr_sleep(). That
is race condition which can result of doing list_del(&tid->list) twice
(second time with poisoned list node) and cause crash like shown below:
[424271.637220] BUG: unable to handle kernel paging request at 00100104
[... |
lys_submodule_free(struct lys_submodule *submodule, void (*private_destructor)(const struct lys_node *node, void *priv))
{
int i;
if (!submodule) {
return;
}
/* common part with struct ly_module */
module_free_common((struct lys_module *)submodule, private_destructor);
/* include */
... | 0 | [
"CWE-119"
] | libyang | 32fb4993bc8bb49e93e84016af3c10ea53964be5 | 156,346,225,832,595,880,000,000,000,000,000,000,000 | 23 | schema tree BUGFIX do not check features while still resolving schema
Fixes #723 |
_symlink_is_external_to_destination (GFile *file,
const char *symlink,
GFile *destination,
GHashTable *external_links)
{
gboolean external = FALSE;
GFile *parent;
char **components;
int i;
if ((file == NULL) || (symlink == NULL))
return FALSE;
if (symlink[0] =... | 1 | [
"CWE-59"
] | file-roller | e970f4966bf388f6e7c277357c8b186c645683ae | 214,323,525,536,430,000,000,000,000,000,000,000,000 | 53 | libarchive: Skip files with symlinks in parents
Currently, it is still possible that some files are extracted outside of
the destination dir in case of malicious archives. The checks from commit
21dfcdbf can be still bypassed in certain cases. See GNOME/file-roller#108
for more details. After some investigation, I am ... |
bool change_master(THD* thd, Master_info* mi)
{
int thread_mask;
const char* errmsg= 0;
bool need_relay_log_purge= 1;
char *var_master_log_name= NULL, *var_group_master_log_name= NULL;
bool ret= false;
char saved_host[HOSTNAME_LENGTH + 1], saved_bind_addr[HOSTNAME_LENGTH + 1];
uint saved_port= 0;
char s... | 0 | [
"CWE-284",
"CWE-295"
] | mysql-server | 3bd5589e1a5a93f9c224badf983cd65c45215390 | 166,734,786,410,026,670,000,000,000,000,000,000,000 | 451 | WL#6791 : Redefine client --ssl option to imply enforced encryption
# Changed the meaning of the --ssl=1 option of all client binaries
to mean force ssl, not try ssl and fail over to eunecrypted
# Added a new MYSQL_OPT_SSL_ENFORCE mysql_options()
option to specify that an ssl connection is required.
# Added a new macr... |
static js_Ast *callexp(js_State *J)
{
js_Ast *a = newexp(J);
SAVEREC();
loop:
INCREC();
if (jsP_accept(J, '.')) { a = EXP2(MEMBER, a, identifiername(J)); goto loop; }
if (jsP_accept(J, '[')) { a = EXP2(INDEX, a, expression(J, 0)); jsP_expect(J, ']'); goto loop; }
if (jsP_accept(J, '(')) { a = EXP2(CALL, a, argume... | 0 | [
"CWE-674"
] | mujs | 4d45a96e57fbabf00a7378b337d0ddcace6f38c1 | 335,289,173,459,857,770,000,000,000,000,000,000,000 | 12 | Guard binary expressions from too much recursion. |
Pl_LZWDecoder::handleCode(unsigned int code)
{
if (this->eod)
{
return;
}
if (code == 256)
{
if (! this->table.empty())
{
QTC::TC("libtests", "Pl_LZWDecoder intermediate reset");
}
this->table.clear();
this->code_size = 9;
}
else if (code == 257)
{
this->eod = true;
}
... | 0 | [
"CWE-787"
] | qpdf | d71f05ca07eb5c7cfa4d6d23e5c1f2a800f52e8e | 213,735,902,049,407,080,000,000,000,000,000,000,000 | 84 | 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 ... |
bool css_has_online_children(struct cgroup_subsys_state *css)
{
struct cgroup_subsys_state *child;
bool ret = false;
rcu_read_lock();
css_for_each_child(child, css) {
if (child->flags & CSS_ONLINE) {
ret = true;
break;
}
}
rcu_read_unlock();
return ret;
} | 0 | [
"CWE-416"
] | linux | a06247c6804f1a7c86a2e5398a4c1f1db1471848 | 12,056,895,242,303,303,000,000,000,000,000,000,000 | 15 | psi: Fix uaf issue when psi trigger is destroyed while being polled
With write operation on psi files replacing old trigger with a new one,
the lifetime of its waitqueue is totally arbitrary. Overwriting an
existing trigger causes its waitqueue to be freed and pending poll()
will stumble on trigger->event_wait which w... |
WORD_LIST *
expand_word_leave_quoted (word, quoted)
WORD_DESC *word;
int quoted;
{
WORD_LIST *result;
expand_no_split_dollar_star = 1;
#if defined (HANDLE_MULTIBYTE)
if (ifs_firstc[0] == 0)
#else
if (ifs_firstc == 0)
#endif
word->flags |= W_NOSPLIT;
word->flags |= W_NOSPLIT2;
result = call_ex... | 0 | [
"CWE-20"
] | bash | 4f747edc625815f449048579f6e65869914dd715 | 336,888,310,981,710,330,000,000,000,000,000,000,000 | 19 | Bash-4.4 patch 7 |
Cipher::~Cipher()
{} | 0 | [
"CWE-125"
] | quassel | 8b5ecd226f9208af3074b33d3b7cf5e14f55b138 | 325,852,565,615,607,330,000,000,000,000,000,000,000 | 2 | Check for invalid input in encrypted buffers
The ECB Blowfish decryption function assumed that encrypted input would
always come in blocks of 12 characters, as specified. However, buggy
clients or annoying people may not adhere to that assumption, causing
the core to crash while trying to process the invalid base64 in... |
virtual Item *derived_field_transformer_for_having(THD *thd, uchar *arg)
{ return this; } | 0 | [
"CWE-617"
] | server | 2e7891080667c59ac80f788eef4d59d447595772 | 50,195,866,127,585,960,000,000,000,000,000,000,000 | 2 | MDEV-25635 Assertion failure when pushing from HAVING into WHERE of view
This bug could manifest itself after pushing a where condition over a
mergeable derived table / view / CTE DT into a grouping view / derived
table / CTE V whose item list contained set functions with constant
arguments such as MIN(2), SUM(1) etc.... |
static void close_connections(void)
{
#ifdef EXTRA_DEBUG
int count=0;
#endif
DBUG_ENTER("close_connections");
/* Clear thread cache */
kill_cached_threads++;
flush_thread_cache();
/* kill connection thread */
#if !defined(__WIN__)
DBUG_PRINT("quit", ("waiting for select thread: 0x%lx",
... | 0 | [
"CWE-264"
] | mysql-server | 48bd8b16fe382be302c6f0b45931be5aa6f29a0e | 20,496,325,349,891,100,000,000,000,000,000,000,000 | 179 | Bug#24388753: PRIVILEGE ESCALATION USING MYSQLD_SAFE
[This is the 5.5/5.6 version of the bugfix].
The problem was that it was possible to write log files ending
in .ini/.cnf that later could be parsed as an options file.
This made it possible for users to specify startup options
without the permissions to do so.
Thi... |
/* when returns >0, the caller should retry */
static inline int io_cqring_wait_schedule(struct io_ring_ctx *ctx,
struct io_wait_queue *iowq,
signed long *timeout)
{
int ret;
/* make sure we run task_work before checking for signals */
ret = io_run_task_work_sig();
if (ret || io_should_wake(iowq))
... | 0 | [
"CWE-125"
] | linux | 89c2b3b74918200e46699338d7bcc19b1ea12110 | 227,442,592,211,316,100,000,000,000,000,000,000,000 | 17 | 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... |
static Bool fs_check_locales(void *__self, const char *locales_parent_path, const char *rel_path, char *relocated_path, char *localized_rel_path)
{
char path[GF_MAX_PATH];
const char *opt;
GF_FSLocales *loc = (GF_FSLocales*)__self;
/* Checks if the rel_path argument really contains a relative path (no ':', no '/'... | 0 | [
"CWE-787"
] | gpac | da37ec8582266983d0ec4b7550ec907401ec441e | 298,495,700,875,597,770,000,000,000,000,000,000,000 | 68 | fixed crashes for very long path - cf #1908 |
static int rndis_init_response(struct rndis_params *params,
rndis_init_msg_type *buf)
{
rndis_init_cmplt_type *resp;
rndis_resp_t *r;
if (!params->dev)
return -ENOTSUPP;
r = rndis_add_response(params, sizeof(rndis_init_cmplt_type));
if (!r)
return -ENOMEM;
resp = (rndis_init_cmplt_type *)r->buf;
... | 0 | [
"CWE-200",
"CWE-668"
] | linux | 38ea1eac7d88072bbffb630e2b3db83ca649b826 | 233,077,564,279,173,330,000,000,000,000,000,000,000 | 35 | usb: gadget: rndis: check size of RNDIS_MSG_SET command
Check the size of the RNDIS_MSG_SET command given to us before
attempting to respond to an invalid message size.
Reported-by: Szymon Heidrich <szymon.heidrich@gmail.com>
Cc: stable@kernel.org
Tested-by: Szymon Heidrich <szymon.heidrich@gmail.com>
Signed-off-by: ... |
wired_get_secrets (NMDevice *device,
NMConnection *connection,
NMActiveConnection *active_connection,
const char *setting_name,
const char **hints,
DBusGMethodInvocation *context,
NMApplet *applet,
GError **error)
{
NMSettingConnection *s_con;
const char *connection_ty... | 0 | [
"CWE-310"
] | network-manager-applet | 4020594dfbf566f1852f0acb36ad631a9e73a82b | 59,469,932,228,308,410,000,000,000,000,000,000,000 | 29 | core: fix CA cert mishandling after cert file deletion (deb #560067) (rh #546793)
If a connection was created with a CA certificate, but the user later
moved or deleted that CA certificate, the applet would simply provide the
connection to NetworkManager without any CA certificate. This could cause
NM to connect to t... |
xmlSnprintfElements(char *buf, int size, xmlNodePtr node, int glob) {
xmlNodePtr cur;
int len;
if (node == NULL) return;
if (glob) strcat(buf, "(");
cur = node;
while (cur != NULL) {
len = strlen(buf);
if (size - len < 50) {
if ((size - len > 4) && (buf[len - 1] != '.'))
strcat(buf, " ... | 0 | [
"CWE-416"
] | libxml2 | 652dd12a858989b14eed4e84e453059cd3ba340e | 240,048,741,907,391,400,000,000,000,000,000,000,000 | 73 | [CVE-2022-23308] Use-after-free of ID and IDREF attributes
If a document is parsed with XML_PARSE_DTDVALID and without
XML_PARSE_NOENT, the value of ID attributes has to be normalized after
potentially expanding entities in xmlRemoveID. Otherwise, later calls
to xmlGetID can return a pointer to previously freed memory... |
rsvg_filter_get_result (GString * name, RsvgFilterContext * ctx)
{
RsvgFilterPrimitiveOutput output;
RsvgFilterPrimitiveOutput *outputpointer;
output.bounds.x0 = output.bounds.x1 = output.bounds.y0 = output.bounds.y1 = 0;
if (!strcmp (name->str, "SourceGraphic")) {
output.surface = cairo_surfac... | 0 | [] | librsvg | a51919f7e1ca9c535390a746fbf6e28c8402dc61 | 51,666,202,185,391,690,000,000,000,000,000,000,000 | 46 | rsvg: Add rsvg_acquire_node()
This function does proper recursion checks when looking up resources
from URLs and thereby helps avoiding infinite loops when cyclic
references span multiple types of elements. |
static int virtio_net_load(QEMUFile *f, void *opaque, int version_id)
{
VirtIONet *n = opaque;
VirtIODevice *vdev = VIRTIO_DEVICE(n);
int ret, i, link_down;
if (version_id < 2 || version_id > VIRTIO_NET_VM_VERSION)
return -EINVAL;
ret = virtio_load(vdev, f);
if (ret) {
return r... | 0 | [
"CWE-119"
] | qemu | 98f93ddd84800f207889491e0b5d851386b459cf | 286,562,234,221,498,380,000,000,000,000,000,000,000 | 129 | virtio-net: out-of-bounds buffer write on load
CVE-2013-4149 QEMU 1.3.0 out-of-bounds buffer write in
virtio_net_load()@hw/net/virtio-net.c
> } else if (n->mac_table.in_use) {
> uint8_t *buf = g_malloc0(n->mac_table.in_use);
We are allocating buffer of size n->mac_table.in_use
> qemu... |
static void ConvertRGBToDisplayP3(const double red,const double green,
const double blue,double *r,double *g,double *b)
{
double
X,
Y,
Z;
ConvertRGBToXYZ(red,green,blue,&X,&Y,&Z);
ConvertXYZToDisplayP3(X,Y,Z,r,g,b);
} | 0 | [
"CWE-369"
] | ImageMagick | 75f6f5032690077cae3eaeda3c0165cc765eaeb5 | 25,730,476,724,215,880,000,000,000,000,000,000,000 | 11 | https://github.com/ImageMagick/ImageMagick/issues/3295 |
tv2bool(typval_T *tv)
{
switch (tv->v_type)
{
case VAR_NUMBER:
return tv->vval.v_number != 0;
case VAR_FLOAT:
#ifdef FEAT_FLOAT
return tv->vval.v_float != 0.0;
#else
break;
#endif
case VAR_PARTIAL:
return tv->vval.v_partial != NULL;
case VAR_FUNC:
case VAR_STRING:
return tv->vval.v... | 0 | [
"CWE-416"
] | vim | 9c23f9bb5fe435b28245ba8ac65aa0ca6b902c04 | 173,286,696,678,595,800,000,000,000,000,000,000,000 | 47 | patch 8.2.3902: Vim9: double free with nested :def function
Problem: Vim9: double free with nested :def function.
Solution: Pass "line_to_free" from compile_def_function() and make sure
cmdlinep is valid. |
dse_compare(Slapi_PBlock *pb)
{
/*
* Inspired largely by ldbm_compare.c. Allow schema aware comparison
* of entries in the DSE, including cn=config.
*/
backend *be = NULL;
char *type = NULL;
struct berval *bval = NULL;
Slapi_DN *sdn = NULL;
struct dse *pdse = NULL;
Slapi_Entry... | 0 | [
"CWE-200",
"CWE-203"
] | 389-ds-base | b6aae4d8e7c8a6ddd21646f94fef1bf7f22c3f32 | 257,507,304,210,835,600,000,000,000,000,000,000 | 82 | Issue 4609 - CVE - info disclosure when authenticating
Description: If you bind as a user that does not exist. Error 49 is returned
instead of error 32. As error 32 discloses that the entry does
not exist. When you bind as an entry that does not have userpassword
set then ... |
static struct psi_group *iterate_groups(struct task_struct *task, void **iter)
{
if (*iter == &psi_system)
return NULL;
#ifdef CONFIG_CGROUPS
if (static_branch_likely(&psi_cgroups_enabled)) {
struct cgroup *cgroup = NULL;
if (!*iter)
cgroup = task->cgroups->dfl_cgrp;
else
cgroup = cgroup_parent(*iter)... | 0 | [
"CWE-416"
] | linux | a06247c6804f1a7c86a2e5398a4c1f1db1471848 | 2,443,726,248,854,724,700,000,000,000,000,000,000 | 23 | psi: Fix uaf issue when psi trigger is destroyed while being polled
With write operation on psi files replacing old trigger with a new one,
the lifetime of its waitqueue is totally arbitrary. Overwriting an
existing trigger causes its waitqueue to be freed and pending poll()
will stumble on trigger->event_wait which w... |
static struct inode *proc_sys_make_inode(struct super_block *sb,
struct ctl_table_header *head, struct ctl_table *table)
{
struct ctl_table_root *root = head->root;
struct inode *inode;
struct proc_inode *ei;
inode = new_inode(sb);
if (!inode)
goto out;
inode->i_ino = get_next_ino();
sysctl_head_get(head)... | 0 | [
"CWE-20",
"CWE-399"
] | linux | 93362fa47fe98b62e4a34ab408c4a418432e7939 | 137,799,660,141,613,500,000,000,000,000,000,000,000 | 38 | sysctl: Drop reference added by grab_header in proc_sys_readdir
Fixes CVE-2016-9191, proc_sys_readdir doesn't drop reference
added by grab_header when return from !dir_emit_dots path.
It can cause any path called unregister_sysctl_table will
wait forever.
The calltrace of CVE-2016-9191:
[ 5535.960522] Call Trace:
[ ... |
static int ftrace_process_locs(struct module *mod,
unsigned long *start,
unsigned long *end)
{
struct ftrace_page *start_pg;
struct ftrace_page *pg;
struct dyn_ftrace *rec;
unsigned long count;
unsigned long *p;
unsigned long addr;
unsigned long flags = 0; /* Shut up gcc */
int ret = -ENOMEM... | 0 | [
"CWE-703"
] | linux | 6a76f8c0ab19f215af2a3442870eeb5f0e81998d | 139,307,109,565,328,070,000,000,000,000,000,000,000 | 101 | tracing: Fix possible NULL pointer dereferences
Currently set_ftrace_pid and set_graph_function files use seq_lseek
for their fops. However seq_open() is called only for FMODE_READ in
the fops->open() so that if an user tries to seek one of those file
when she open it for writing, it sees NULL seq_file and then panic... |
void set_process_cpu_timer(struct task_struct *tsk, unsigned int clock_idx,
cputime_t *newval, cputime_t *oldval)
{
union cpu_time_count now;
struct list_head *head;
BUG_ON(clock_idx == CPUCLOCK_SCHED);
cpu_clock_sample_group_locked(clock_idx, tsk, &now);
if (oldval) {
if (!cputime_eq(*oldval, cputime_ze... | 0 | [
"CWE-189"
] | linux | f8bd2258e2d520dff28c855658bd24bdafb5102d | 176,623,272,672,624,200,000,000,000,000,000,000,000 | 50 | remove div_long_long_rem
x86 is the only arch right now, which provides an optimized for
div_long_long_rem and it has the downside that one has to be very careful that
the divide doesn't overflow.
The API is a little akward, as the arguments for the unsigned divide are
signed. The signed version also doesn't handle ... |
fascist_firewall_allows_rs_impl(const routerstatus_t *rs,
firewall_connection_t fw_connection,
int pref_only, int pref_ipv6)
{
if (!rs) {
return 0;
}
/* Assume IPv4 and IPv6 DirPorts are the same */
return fascist_firewall_allows_base(rs->addr... | 0 | [] | tor | 1afc2ed956a35b40dfd1d207652af5b50c295da7 | 36,232,158,955,263,115,000,000,000,000,000,000,000 | 14 | Fix policies.c instance of the "if (r=(a-b)) return r" pattern
I think this one probably can't underflow, since the input ranges
are small. But let's not tempt fate.
This patch also replaces the "cmp" functions here with just "eq"
functions, since nothing actually checked for anything besides 0 and
nonzero.
Related... |
GF_Err gf_isom_new_dims_description(GF_ISOFile *movie, u32 trackNumber, GF_DIMSDescription *desc, const char *URLname, const char *URNname, u32 *outDescriptionIndex)
{
GF_TrackBox *trak;
GF_Err e;
u32 dataRefIndex;
GF_DIMSSampleEntryBox *dims;
e = CanAccessMovie(movie, GF_ISOM_OPEN_WRITE);
if (e) return e;
tra... | 0 | [
"CWE-476",
"CWE-401"
] | gpac | 328c6d682698fdb9878dbb4f282963d42c538c01 | 306,375,504,344,575,270,000,000,000,000,000,000,000 | 51 | fixed #1756 |
TEST(BasicFlatBufferModel, TestSetNumThreads) {
TestErrorReporter reporter;
auto model = FlatBufferModel::BuildFromFile(
"tensorflow/lite/testdata/test_model.bin", &reporter);
ASSERT_TRUE(model);
std::unique_ptr<Interpreter> interpreter;
TrivialResolver resolver(&dummy_reg);
InterpreterBuilder builder... | 0 | [
"CWE-703",
"CWE-835"
] | tensorflow | c6173f5fe66cdbab74f4f869311fe6aae2ba35f4 | 220,197,759,530,682,500,000,000,000,000,000,000,000 | 34 | TFLite: Error out when the graph has a recurion.
Recursion is currently unsupported.
PiperOrigin-RevId: 371708957
Change-Id: I8dfad0d85cbfe08e39ae8ea7bad21254ddee5003 |
de265_error decoder_context::decode_slice_unit_sequential(image_unit* imgunit,
slice_unit* sliceunit)
{
de265_error err = DE265_OK;
/*
printf("decode slice POC=%d addr=%d, img=%p\n",
sliceunit->shdr->slice_pic_order_cnt_lsb,
sliceunit->s... | 0 | [
"CWE-416"
] | libde265 | f538254e4658ef5ea4e233c2185dcbfd165e8911 | 92,582,954,935,396,130,000,000,000,000,000,000,000 | 54 | fix streams where SPS image size changes without refreshing PPS (#299) |
void virtqueue_push(VirtQueue *vq, const VirtQueueElement *elem,
unsigned int len)
{
virtqueue_fill(vq, elem, len, 0);
virtqueue_flush(vq, 1);
} | 0 | [
"CWE-94"
] | qemu | cc45995294b92d95319b4782750a3580cabdbc0c | 306,864,250,952,927,500,000,000,000,000,000,000,000 | 6 | virtio: out-of-bounds buffer write on invalid state load
CVE-2013-4151 QEMU 1.0 out-of-bounds buffer write in
virtio_load@hw/virtio/virtio.c
So we have this code since way back when:
num = qemu_get_be32(f);
for (i = 0; i < num; i++) {
vdev->vq[i].vring.num = qemu_get_be32(f);
array of vqs has size ... |
void ip_rt_multicast_event(struct in_device *in_dev)
{
rt_cache_flush(dev_net(in_dev->dev));
} | 0 | [
"CWE-17"
] | linux | df4d92549f23e1c037e83323aff58a21b3de7fe0 | 151,511,089,864,861,340,000,000,000,000,000,000,000 | 4 | ipv4: try to cache dst_entries which would cause a redirect
Not caching dst_entries which cause redirects could be exploited by hosts
on the same subnet, causing a severe DoS attack. This effect aggravated
since commit f88649721268999 ("ipv4: fix dst race in sk_dst_get()").
Lookups causing redirects will be allocated... |
GC_INNER void GC_init_linux_data_start(void)
{
ptr_t data_end = DATAEND;
# if (defined(LINUX) || defined(HURD)) && !defined(IGNORE_PROG_DATA_START)
/* Try the easy approaches first: */
# ifdef PLATFORM_ANDROID
/* Workaround for "gold" (default) linker (as of Android NDK r10e). */
if... | 0 | [
"CWE-119"
] | bdwgc | 7292c02fac2066d39dd1bcc37d1a7054fd1e32ee | 304,091,261,092,691,230,000,000,000,000,000,000,000 | 42 | Fix malloc routines to prevent size value wrap-around
See issue #135 on Github.
* allchblk.c (GC_allochblk, GC_allochblk_nth): Use
OBJ_SZ_TO_BLOCKS_CHECKED instead of OBJ_SZ_TO_BLOCKS.
* malloc.c (GC_alloc_large): Likewise.
* alloc.c (GC_expand_hp_inner): Type of "bytes" local variable changed
from word to size_t; ca... |
static inline struct desc_struct *get_cpu_gdt_table(unsigned int cpu)
{
return per_cpu(gdt_page, cpu).gdt;
} | 0 | [
"CWE-119"
] | linux-2.6 | 5ac37f87ff18843aabab84cf75b2f8504c2d81fe | 303,115,340,275,940,260,000,000,000,000,000,000,000 | 4 | x86: fix ldt limit for 64 bit
Fix size of LDT entries. On x86-64, ldt_desc is a double-sized descriptor.
Signed-off-by: Michael Karcher <kernel@mkarcher.dialup.fu-berlin.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu> |
static Exit_status dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info,
const char* logname)
{
uchar *command_buffer= NULL;
size_t command_size= 0;
ulong len= 0;
uint logname_len= 0;
uint server_id= 0;
NET* net= NULL;
my_off_t old_off= start_position_mot;
... | 0 | [
"CWE-284",
"CWE-295"
] | mysql-server | 3bd5589e1a5a93f9c224badf983cd65c45215390 | 178,223,420,835,065,520,000,000,000,000,000,000,000 | 328 | WL#6791 : Redefine client --ssl option to imply enforced encryption
# Changed the meaning of the --ssl=1 option of all client binaries
to mean force ssl, not try ssl and fail over to eunecrypted
# Added a new MYSQL_OPT_SSL_ENFORCE mysql_options()
option to specify that an ssl connection is required.
# Added a new macr... |
static int vdbeRecordCompareInt(
int nKey1, const void *pKey1, /* Left key */
UnpackedRecord *pPKey2 /* Right key */
){
const u8 *aKey = &((const u8*)pKey1)[*(const u8*)pKey1 & 0x3F];
int serial_type = ((const u8*)pKey1)[1];
int res;
u32 y;
u64 x;
i64 v;
i64 lhs;
vdbeAssertFieldCountWithinLi... | 0 | [
"CWE-755"
] | sqlite | 8654186b0236d556aa85528c2573ee0b6ab71be3 | 149,753,929,398,744,110,000,000,000,000,000,000,000 | 87 | When an error occurs while rewriting the parser tree for window functions
in the sqlite3WindowRewrite() routine, make sure that pParse->nErr is set,
and make sure that this shuts down any subsequent code generation that might
depend on the transformations that were implemented. This fixes a problem
discovered by the Y... |
gint session_recv_msg(Session *session)
{
cm_return_val_if_fail(session->read_msg_buf->len == 0, -1);
session->state = SESSION_RECV;
if (session->read_buf_len > 0)
g_idle_add(session_recv_msg_idle_cb, session);
else
session->io_tag = sock_add_watch(session->sock, G_IO_IN,
session_read_msg_cb, session);... | 0 | [] | claws | fcc25329049b6f9bd8d890f1197ed61eb12e14d5 | 51,265,882,929,525,510,000,000,000,000,000,000,000 | 14 | fix STARTTLS protocol violation
with thanks to, and patch by Damian Poddebniak and Hanno Böck |
Bool mp4box_check_isom_fileopt(char *opt)
{
GF_GPACArg *arg = NULL;
u32 i=0;
while (m4b_imp_fileopt_args[i].name) {
arg = (GF_GPACArg *) &m4b_imp_fileopt_args[i];
i++;
if (!stricmp(arg->name, opt)) break;
arg = NULL;
}
if (!arg) {
fprintf(stderr, "Option %s not described in doc, please report to GPAC de... | 0 | [
"CWE-476"
] | gpac | 87afe070cd6866df7fe80f11b26ef75161de85e0 | 198,078,641,890,277,550,000,000,000,000,000,000,000 | 25 | fixed #1734 |
int ccid_get_builtin_ccids(u8 **ccid_array, u8 *array_len)
{
*ccid_array = kmalloc(ARRAY_SIZE(ccids), gfp_any());
if (*ccid_array == NULL)
return -ENOBUFS;
for (*array_len = 0; *array_len < ARRAY_SIZE(ccids); *array_len += 1)
(*ccid_array)[*array_len] = ccids[*array_len]->ccid_id;
return 0;
} | 0 | [
"CWE-476"
] | linux-2.6 | 8ed030dd0aa400d18c63861c2c6deb7c38f4edde | 10,071,646,179,332,369,000,000,000,000,000,000,000 | 10 | dccp: fix bug in cache allocation
This fixes a bug introduced in commit de4ef86cfce60d2250111f34f8a084e769f23b16
("dccp: fix dccp rmmod when kernel configured to use slub", 17 Jan): the
vsnprintf used sizeof(slab_name_fmt), which became truncated to 4 bytes, since
slab_name_fmt is now a 4-byte pointer and no longer a ... |
struct cdev *cdev_alloc(void)
{
struct cdev *p = kzalloc(sizeof(struct cdev), GFP_KERNEL);
if (p) {
INIT_LIST_HEAD(&p->list);
kobject_init(&p->kobj, &ktype_cdev_dynamic);
}
return p;
} | 0 | [
"CWE-362"
] | linux | 68faa679b8be1a74e6663c21c3a9d25d32f1c079 | 94,171,392,823,844,780,000,000,000,000,000,000,000 | 9 | chardev: Avoid potential use-after-free in 'chrdev_open()'
'chrdev_open()' calls 'cdev_get()' to obtain a reference to the
'struct cdev *' stashed in the 'i_cdev' field of the target inode
structure. If the pointer is NULL, then it is initialised lazily by
looking up the kobject in the 'cdev_map' and so the whole proc... |
static int set_user(struct cred *new)
{
struct user_struct *new_user;
new_user = alloc_uid(current_user_ns(), new->uid);
if (!new_user)
return -EAGAIN;
/*
* We don't fail in case of NPROC limit excess here because too many
* poorly written programs don't check set*uid() return code, assuming
* it never fa... | 0 | [
"CWE-264"
] | linux | 259e5e6c75a910f3b5e656151dc602f53f9d7548 | 152,651,750,542,674,800,000,000,000,000,000,000,000 | 25 | Add PR_{GET,SET}_NO_NEW_PRIVS to prevent execve from granting privs
With this change, calling
prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0)
disables privilege granting operations at execve-time. For example, a
process will not be able to execute a setuid binary to change their uid
or gid if this bit is set. The same is t... |
format_job_update(struct job *job)
{
struct format_job *fj = job_get_data(job);
struct evbuffer *evb = job_get_event(job)->input;
char *line = NULL, *next;
time_t t;
while ((next = evbuffer_readline(evb)) != NULL) {
free(line);
line = next;
}
if (line == NULL)
return;
fj->updated = 1;
free(fj->ou... | 0 | [] | src | b32e1d34e10a0da806823f57f02a4ae6e93d756e | 134,296,194,990,074,840,000,000,000,000,000,000,000 | 27 | evbuffer_new and bufferevent_new can both fail (when malloc fails) and
return NULL. GitHub issue 1547. |
irc_server_get_prefix_char_index (struct t_irc_server *server,
char prefix_char)
{
const char *prefix_chars;
char *pos;
if (server)
{
prefix_chars = irc_server_get_prefix_chars (server);
pos = strchr (prefix_chars, prefix_char);
if (pos)
... | 0 | [
"CWE-20"
] | weechat | c265cad1c95b84abfd4e8d861f25926ef13b5d91 | 269,462,309,679,969,470,000,000,000,000,000,000,000 | 16 | Fix verification of SSL certificates by calling gnutls verify callback (patch #7459) |
encodeJsonNotImplemented(const void *src, const UA_DataType *type, CtxJson *ctx) {
(void) src, (void) type, (void)ctx;
return UA_STATUSCODE_BADNOTIMPLEMENTED;
} | 0 | [
"CWE-703",
"CWE-787"
] | open62541 | c800e2987b10bb3af6ef644b515b5d6392f8861d | 122,853,907,744,075,740,000,000,000,000,000,000,000 | 4 | fix(json): Check max recursion depth in more places |
static void sig_complete_server(GList **list, WINDOW_REC *window,
const char *word, const char *line,
int *want_space)
{
g_return_if_fail(list != NULL);
g_return_if_fail(word != NULL);
*list = completion_get_servers(word);
if (*list != NULL) signal_stop();
} | 0 | [
"CWE-416"
] | irssi | 36564717c9f701e3a339da362ab46d220d27e0c1 | 55,805,315,721,112,670,000,000,000,000,000,000,000 | 10 | Merge branch 'security' into 'master'
Security
See merge request irssi/irssi!34
(cherry picked from commit b0d9cb33cd9ef9da7c331409e8b7c57a6f3aef3f) |
static int MOD_EXP_CTIME_COPY_TO_PREBUF(const BIGNUM *b, int top,
unsigned char *buf, int idx,
int window)
{
int i, j;
int width = 1 << window;
BN_ULONG *table = (BN_ULONG *)buf;
if (top > b->top)
top = b->top; ... | 0 | [
"CWE-200"
] | openssl | d6482a82bc2228327aa4ba98aeeecd9979542a31 | 211,767,564,746,182,950,000,000,000,000,000,000,000 | 17 | bn/bn_exp.c: constant-time MOD_EXP_CTIME_COPY_FROM_PREBUF.
Performance penalty varies from platform to platform, and even
key length. For rsa2048 sign it was observed to reach almost 10%.
CVE-2016-0702
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org> |
PHP_METHOD(Phar, getVersion)
{
PHAR_ARCHIVE_OBJECT();
if (zend_parse_parameters_none() == FAILURE) {
return;
}
RETURN_STRING(phar_obj->archive->version);
} | 0 | [
"CWE-20"
] | php-src | 1e9b175204e3286d64dfd6c9f09151c31b5e099a | 105,893,164,889,903,370,000,000,000,000,000,000,000 | 10 | Fix bug #71860: Require valid paths for phar filenames |
unsigned long ssl3_output_cert_chain(SSL *s, CERT_PKEY *cpk)
{
unsigned char *p;
unsigned long l = 3 + SSL_HM_HEADER_LENGTH(s);
if (!ssl_add_cert_chain(s, cpk, &l))
return 0;
l -= 3 + SSL_HM_HEADER_LENGTH(s);
p = ssl_handshake_start(s);
l2n3(l, p);
l += 3;
if (!ssl_set_handsha... | 0 | [
"CWE-400"
] | openssl | 4b390b6c3f8df925dc92a3dd6b022baa9a2f4650 | 331,394,511,415,218,030,000,000,000,000,000,000,000 | 19 | Excessive allocation of memory in tls_get_message_header()
A TLS message includes 3 bytes for its length in the header for the message.
This would allow for messages up to 16Mb in length. Messages of this length
are excessive and OpenSSL includes a check to ensure that a peer is sending
reasonably sized messages in or... |
enter_tabpage(
tabpage_T *tp,
buf_T *old_curbuf UNUSED,
int trigger_enter_autocmds,
int trigger_leave_autocmds)
{
int row;
int old_off = tp->tp_firstwin->w_winrow;
win_T *next_prevwin = tp->tp_prevwin;
tabpage_T *last_tab = curtab;
curtab = tp;
firstwin = tp->tp_firstwin;
... | 0 | [
"CWE-476"
] | vim | 0f6e28f686dbb59ab3b562408ab9b2234797b9b1 | 213,391,261,723,595,400,000,000,000,000,000,000,000 | 80 | patch 8.2.4428: crash when switching tabpage while in the cmdline window
Problem: Crash when switching tabpage while in the cmdline window.
Solution: Disallow switching tabpage when in the cmdline window. |
static void Process_ipfix_option_data(exporter_ipfix_domain_t *exporter, void *data_flowset, FlowSource_t *fs) {
option_offset_t *offset_table;
uint32_t id;
uint8_t *in;
id = GET_FLOWSET_ID(data_flowset);
offset_table = fs->option_offset_table;
while ( offset_table && offset_table->id != id )
offset_table = o... | 0 | [
"CWE-190"
] | nfdump | 3b006ededaf351f1723aea6c727c9edd1b1fff9b | 201,454,947,575,846,100,000,000,000,000,000,000,000 | 64 | Fix potential unsigned integer underflow |
do_close_read (GVfsBackend *backend,
GVfsJobCloseRead *close_read_job,
GVfsBackendHandle handle)
{
GVfsJob *job = G_VFS_JOB (close_read_job);
GInputStream *stream = handle;
GError *error = NULL;
g_input_stream_close (stream, job->cancellable, &error);
g_object_unref (stream);
... | 0 | [] | gvfs | d7d362995aa0cb8905c8d5c2a2a4c305d2ffff80 | 295,037,361,451,837,700,000,000,000,000,000,000,000 | 13 | admin: Use fsuid to ensure correct file ownership
Files created over admin backend should be owned by root, but they are
owned by the user itself. This is because the daemon drops the uid to
make dbus connection work. Use fsuid and euid to fix this issue.
Closes: https://gitlab.gnome.org/GNOME/gvfs/issues/21 |
auto ReferenceHandle::Delete(Local<Value> key_handle) -> Local<Value> {
return ThreePhaseTask::Run<async, DeleteRunner>(*isolate, *this, key_handle);
} | 0 | [
"CWE-913"
] | isolated-vm | 2646e6c1558bac66285daeab54c7d490ed332b15 | 23,313,722,878,600,720,000,000,000,000,000,000,000 | 3 | Don't invoke accessors or proxies via Reference functions |
void RemoveZeroAdd(HAdd** add, HConstant** constant) {
if (*add != NULL && (*constant)->Integer32Value() == 0) {
(*add)->DeleteAndReplaceWith((*add)->left());
(*constant)->DeleteAndReplaceWith(NULL);
}
} | 1 | [] | node | fd80a31e0697d6317ce8c2d289575399f4e06d21 | 221,566,419,311,731,000,000,000,000,000,000,000,000 | 6 | deps: backport 5f836c from v8 upstream
Original commit message:
Fix Hydrogen bounds check elimination
When combining bounds checks, they must all be moved before the first load/store
that they are guarding.
BUG=chromium:344186
LOG=y
R=svenpanne@chromium.org
Review URL: https://coderevie... |
const_iterator operator-(difference_type rhs) const {
if (charPtr_) {
return const_iterator(charPtr_ - rhs, char16Ptr_);
}
return const_iterator(charPtr_, char16Ptr_ - rhs);
} | 0 | [
"CWE-416",
"CWE-703"
] | hermes | d86e185e485b6330216dee8e854455c694e3a36e | 321,838,800,305,664,060,000,000,000,000,000,000,000 | 6 | Fix a bug in transient object property assignment and getUTF16Ref
Summary:
The returned `UTF16Ref` from `StringView::getUTF16Ref` can be invalidated by
appending more contents to the same allocator.
This case was encountered in `transientObjectPutErrorMessage`, resulting in
using free'd memory.
Reviewed By: tmikov
D... |
int ssl2_num_ciphers(void)
{
return (SSL2_NUM_CIPHERS);
} | 0 | [
"CWE-20"
] | openssl | 86f8fb0e344d62454f8daf3e15236b2b59210756 | 266,432,193,201,754,900,000,000,000,000,000,000,000 | 4 | Fix reachable assert in SSLv2 servers.
This assert is reachable for servers that support SSLv2 and export ciphers.
Therefore, such servers can be DoSed by sending a specially crafted
SSLv2 CLIENT-MASTER-KEY.
Also fix s2_srvr.c to error out early if the key lengths are malformed.
These lengths are sent unencrypted, so... |
static inline void free_ep_req(struct usb_ep *ep, struct usb_request *req)
{
kfree(req->buf);
usb_ep_free_request(ep, req);
} | 1 | [
"CWE-415"
] | linux | 7fafcfdf6377b18b2a726ea554d6e593ba44349f | 312,505,812,146,041,270,000,000,000,000,000,000,000 | 5 | USB: gadget: f_midi: fixing a possible double-free in f_midi
It looks like there is a possibility of a double-free vulnerability on an
error path of the f_midi_set_alt function in the f_midi driver. If the
path is feasible then free_ep_req gets called twice:
req->complete = f_midi_complete;
err = us... |
static ssize_t lbs_failcount_read(struct file *file, char __user *userbuf,
size_t count, loff_t *ppos)
{
return lbs_threshold_read(TLV_TYPE_FAILCOUNT, CMD_SUBSCRIBE_FAILCOUNT,
file, userbuf, count, ppos);
} | 0 | [
"CWE-703",
"CWE-189"
] | linux | a497e47d4aec37aaf8f13509f3ef3d1f6a717d88 | 254,383,471,798,918,900,000,000,000,000,000,000,000 | 6 | libertas: potential oops in debugfs
If we do a zero size allocation then it will oops. Also we can't be
sure the user passes us a NUL terminated string so I've added a
terminator.
This code can only be triggered by root.
Reported-by: Nico Golde <nico@ngolde.de>
Reported-by: Fabian Yamaguchi <fabs@goesec.de>
Signed-... |
static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info,
Image *image,ExceptionInfo *exception)
{
const char
*mode,
*option;
CompressionType
compression;
EndianType
endian_type;
int
tiff_status = 0;
MagickBooleanType
adjoin,
preserve_compression,
status;
Ma... | 0 | [
"CWE-703",
"CWE-787"
] | ImageMagick | 30ccf9a0da1f47161b5935a95be854fe84e6c2a2 | 192,037,117,839,910,900,000,000,000,000,000,000,000 | 914 | squash heap-buffer-overflow, PoC TIFF from Hardik |
static BOOL update_read_window_cached_icon_order(wStream* s, WINDOW_ORDER_INFO* orderInfo,
WINDOW_CACHED_ICON_ORDER* window_cached_icon)
{
WINPR_UNUSED(orderInfo);
return update_read_cached_icon_info(
s, &window_cached_icon->cachedIcon); /* cachedIcon (CACHED_ICON... | 0 | [
"CWE-125"
] | FreeRDP | 6b2bc41935e53b0034fe5948aeeab4f32e80f30f | 204,361,935,921,473,800,000,000,000,000,000,000,000 | 7 | Fix #6010: Check length in read_icon_info |
iobuf_read (iobuf_t a, void *buffer, unsigned int buflen)
{
unsigned char *buf = (unsigned char *)buffer;
int c, n;
if (a->nlimit)
{
/* Handle special cases. */
for (n = 0; n < buflen; n++)
{
if ((c = iobuf_readbyte (a)) == -1)
{
if (!n)
return -1; /* eof */
break;
}... | 0 | [
"CWE-20"
] | gnupg | 2183683bd633818dd031b090b5530951de76f392 | 335,170,731,533,478,560,000,000,000,000,000,000,000 | 55 | Use inline functions to convert buffer data to scalars.
* common/host2net.h (buf16_to_ulong, buf16_to_uint): New.
(buf16_to_ushort, buf16_to_u16): New.
(buf32_to_size_t, buf32_to_ulong, buf32_to_uint, buf32_to_u32): New.
--
Commit 91b826a38880fd8a989318585eb502582636ddd8 was not enough to
avoid all sign extension on ... |
int credssp_sizeof_nego_tokens(int length)
{
length = credssp_sizeof_nego_token(length);
length += ber_sizeof_sequence_tag(length);
length += ber_sizeof_sequence_tag(length);
length += ber_sizeof_contextual_tag(length);
return length;
} | 0 | [
"CWE-476"
] | FreeRDP | 0dc22d5a30a1c7d146b2a835b2032668127c33e9 | 250,404,895,903,209,000,000,000,000,000,000,000,000 | 8 | Fixed a range of BER boundary encoding bugs which would occur when any NLA packet hit the 127 character mark. Removed ber#get_content_length as it was not behaving deterministically. |
static void __init sun6i_ahb1_clk_setup(struct device_node *node)
{
sunxi_factors_clk_setup(node, &sun6i_ahb1_data);
} | 0 | [
"CWE-476"
] | linux | fcdf445ff42f036d22178b49cf64e92d527c1330 | 139,991,439,484,767,360,000,000,000,000,000,000,000 | 4 | clk-sunxi: fix a missing-check bug in sunxi_divs_clk_setup()
In sunxi_divs_clk_setup(), 'derived_name' is allocated by kstrndup().
It returns NULL when fails. 'derived_name' should be checked.
Signed-off-by: Gen Zhang <blackgod016574@gmail.com>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> |
cr_tknzr_parse_atkeyword (CRTknzr * a_this,
CRString ** a_str)
{
guint32 cur_char = 0;
CRInputPos init_pos;
gboolean str_needs_free = FALSE;
enum CRStatus status = CR_OK;
g_return_val_if_fail (a_this && PRIVATE (a_this)
&&... | 0 | [
"CWE-119"
] | libcroco | 9ad72875e9f08e4c519ef63d44cdbd94aa9504f7 | 241,520,711,796,104,500,000,000,000,000,000,000,000 | 39 | tknzr: support only max long rgb values
This fixes a possible out of bound when reading rgbs which
are longer than the support MAXLONG |
static void ExportGrayAlphaQuantum(const Image *image,QuantumInfo *quantum_info,
const MagickSizeType number_pixels,const Quantum *magick_restrict p,
unsigned char *magick_restrict q,ExceptionInfo *exception)
{
QuantumAny
range;
ssize_t
x;
assert(exception != (ExceptionInfo *) NULL);
assert(except... | 0 | [
"CWE-190"
] | ImageMagick | 5af1dffa4b6ab984b5f13d1e91c95760d75f12a6 | 63,525,910,961,898,160,000,000,000,000,000,000,000 | 205 | outside the range of representable values of type 'unsigned char' (#3083)
Co-authored-by: Zhang Xiaohui <ruc_zhangxiaohui@163.com> |
void addrconf_join_anycast(struct inet6_ifaddr *ifp)
{
struct in6_addr addr;
ipv6_addr_prefix(&addr, &ifp->addr, ifp->prefix_len);
if (ipv6_addr_any(&addr))
return;
ipv6_dev_ac_inc(ifp->idev->dev, &addr);
} | 0 | [
"CWE-200"
] | linux-2.6 | 8a47077a0b5aa2649751c46e7a27884e6686ccbf | 287,852,714,495,114,000,000,000,000,000,000,000,000 | 8 | [NETLINK]: Missing padding fields in dumped structures
Plug holes with padding fields and initialized them to zero.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net> |
bool respondWithError(JSContext *cx, HandleObject self) {
MOZ_RELEASE_ASSERT(state(self) == State::unhandled || state(self) == State::waitToRespond);
set_state(self, State::responsedWithError);
ResponseHandle response{INVALID_HANDLE};
BodyHandle body{INVALID_HANDLE};
return HANDLE_RESULT(cx, xqd_resp_new(&res... | 0 | [
"CWE-94"
] | js-compute-runtime | 65524ffc962644e9fc39f4b368a326b6253912a9 | 334,277,640,256,655,750,000,000,000,000,000,000,000 | 9 | use rangom_get instead of arc4random as arc4random does not work correctly with wizer
wizer causes the seed in arc4random to be the same between executions which is not random |
long keyctl_instantiate_key_common(key_serial_t id,
struct iov_iter *from,
key_serial_t ringid)
{
const struct cred *cred = current_cred();
struct request_key_auth *rka;
struct key *instkey, *dest_keyring;
size_t plen = from ? iov_iter_count(from) : 0;
void *payload;
long ret;
kenter("%d,,%zu,%d",... | 0 | [
"CWE-362"
] | linux | b4a1b4f5047e4f54e194681125c74c0aa64d637d | 159,648,326,082,637,750,000,000,000,000,000,000,000 | 72 | KEYS: Fix race between read and revoke
This fixes CVE-2015-7550.
There's a race between keyctl_read() and keyctl_revoke(). If the revoke
happens between keyctl_read() checking the validity of a key and the key's
semaphore being taken, then the key type read method will see a revoked key.
This causes a problem for t... |
TEST(InMatchExpression, MatchesScalar) {
BSONObj operand = BSON_ARRAY(5);
InMatchExpression in("a");
std::vector<BSONElement> equalities{operand.firstElement()};
ASSERT_OK(in.setEqualities(std::move(equalities)));
ASSERT(in.matchesBSON(BSON("a" << 5.0), NULL));
ASSERT(!in.matchesBSON(BSON("a" <... | 0 | [] | mongo | 64095239f41e9f3841d8be9088347db56d35c891 | 13,894,676,684,628,410,000,000,000,000,000,000,000 | 9 | SERVER-51083 Reject invalid UTF-8 from $regex match expressions |
R_API const char *r_str_get2(const char *str) {
return str? str: nullstr;
} | 0 | [
"CWE-78"
] | radare2 | 04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9 | 193,947,459,682,543,420,000,000,000,000,000,000,000 | 3 | Fix command injection on PDB download (#16966)
* Fix r_sys_mkdirp with absolute path on Windows
* Fix build with --with-openssl
* Use RBuffer in r_socket_http_answer()
* r_socket_http_answer: Fix read for big responses
* Implement r_str_escape_sh()
* Cleanup r_socket_connect() on Windows
* Fix socket being creat... |
HRESULT Http::HrFlushHeaders()
{
HRESULT hr = hrSuccess;
std::string strOutput, strConnection;
char lpszChar[128];
HrGetHeaderValue("Connection", &strConnection);
// Add misc. headers
HrResponseHeader("Server","Kopano");
struct tm dummy;
strftime(lpszChar, 127, "%a, %d %b %Y %H:%M:%S GMT", gmtime_safe(time(nul... | 0 | [
"CWE-770"
] | kopano-core | 512457466b87039c6a8d25887fdaca6173619546 | 287,019,352,431,824,440,000,000,000,000,000,000,000 | 39 | Set limit on header size to prevent bad alloc
This sets a hard limit of 64 KiB to the header to prevent a memory
allocation exception from being thrown during the parsing of the request
headers. |
static void session_destroy(struct avrcp *session, int err)
{
struct avrcp_server *server = session->server;
struct btd_service *service;
server->sessions = g_slist_remove(server->sessions, session);
session_abort_pending_pdu(session);
service = btd_device_get_service(session->dev, AVRCP_TARGET_UUID);
if (serv... | 0 | [
"CWE-200"
] | bluez | e2b0f0d8d63e1223bb714a9efb37e2257818268b | 165,891,061,950,697,970,000,000,000,000,000,000,000 | 45 | avrcp: Fix not checking if params_len match number of received bytes
This makes sure the number of bytes in the params_len matches the
remaining bytes received so the code don't end up accessing invalid
memory. |
g_vfs_backend_dav_send_message (GVfsBackend *backend, SoupMessage *message)
{
GVfsBackendHttp *http_backend;
SoupSession *session;
http_backend = G_VFS_BACKEND_HTTP (backend);
session = http_backend->session;
/* We have our own custom redirect handler */
soup_message_set_flags (message, SOUP_MESSAGE_N... | 0 | [] | gvfs | f81ff2108ab3b6e370f20dcadd8708d23f499184 | 278,586,499,490,360,760,000,000,000,000,000,000,000 | 16 | 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... |
getviscol2(colnr_T col, colnr_T coladd UNUSED)
{
colnr_T x;
pos_T pos;
pos.lnum = curwin->w_cursor.lnum;
pos.col = col;
pos.coladd = coladd;
getvvcol(curwin, &pos, &x, NULL, NULL);
return (int)x;
} | 0 | [
"CWE-120"
] | vim | 7ce5b2b590256ce53d6af28c1d203fb3bc1d2d97 | 43,029,912,887,243,330,000,000,000,000,000,000,000 | 11 | patch 8.2.4969: changing text in Visual mode may cause invalid memory access
Problem: Changing text in Visual mode may cause invalid memory access.
Solution: Check the Visual position after making a change. |
void _addReplyStringToList(client *c, const char *s, size_t len) {
robj *tail;
if (c->flags & CLIENT_CLOSE_AFTER_REPLY) return;
if (listLength(c->reply) == 0) {
robj *o = createStringObject(s,len);
listAddNodeTail(c->reply,o);
c->reply_bytes += getStringObjectSdsUsedMemory(o);
... | 0 | [
"CWE-254"
] | redis | 874804da0c014a7d704b3d285aa500098a931f50 | 16,876,895,381,879,094,000,000,000,000,000,000,000 | 30 | Security: Cross Protocol Scripting protection.
This is an attempt at mitigating problems due to cross protocol
scripting, an attack targeting services using line oriented protocols
like Redis that can accept HTTP requests as valid protocol, by
discarding the invalid parts and accepting the payloads sent, for
example, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.