func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
static pj_status_t get_net_interface(pjsip_transport_type_e tp_type,
const pj_str_t *dst,
pj_str_t *itf_str_addr)
{
int af;
pj_sockaddr itf_addr;
pj_status_t status = -1;
af = (tp_type & PJSIP_TRANSPORT_IPV6)? pj_AF_INET6() : pj_AF_INET();
if (pjsip_cf... | 0 | [
"CWE-297",
"CWE-295"
] | pjproject | 67e46c1ac45ad784db5b9080f5ed8b133c122872 | 244,959,051,507,097,700,000,000,000,000,000,000,000 | 36 | Merge pull request from GHSA-8hcp-hm38-mfph
* Check hostname during TLS transport selection
* revision based on feedback
* remove the code in create_request that has been moved |
void CLASS parse_external_jpeg()
{
const char *file, *ext;
char *jname, *jfile, *jext;
#ifndef LIBRAW_LIBRARY_BUILD
FILE *save=ifp;
#else
#if defined (WIN32) && !defined(__MINGW32__)
if(ifp->wfname())
{
std::wstring rawfile(ifp->wfname());
rawfile.replace(rawfile.length()-3,3,L"JPG");
if(!ifp->subfil... | 0 | [
"CWE-703"
] | LibRaw | 11909cc59e712e09b508dda729b99aeaac2b29ad | 112,414,193,260,478,190,000,000,000,000,000,000,000 | 101 | cumulated data checks patch |
JOIN_TAB *next_explain_order_tab(JOIN* join, JOIN_TAB* tab)
{
/* If we're inside SJM nest and have reached its end, get out */
if (tab->last_leaf_in_bush)
return tab->bush_root_tab;
/* Move to next tab in the array we're traversing */
tab++;
if (tab == join->join_tab + join->top_join_tab_count)
... | 0 | [] | server | ff77a09bda884fe6bf3917eb29b9d3a2f53f919b | 141,394,799,710,186,530,000,000,000,000,000,000,000 | 17 | MDEV-22464 Server crash on UPDATE with nested subquery
Uninitialized ref_pointer_array[] because setup_fields() got empty
fields list. mysql_multi_update() for some reason does that by
substituting the fields list with empty total_list for the
mysql_select() call (looks like wrong merge since total_list is not
used a... |
NM nm_new_str(const char *str, int flags) {
char *p, buf[2048];
NM self;
if((p = strchr(str, '/'))) { /* mask separator */
strncpy(buf, str, p - str);
buf[p - str] = '\0';
self = parse_addr(buf, flags);
if(!self)
return NULL;
if(!parse_mask(self, p + 1, f... | 0 | [] | netmask | 29a9c239bd1008363f5b34ffd6c2cef906f3660c | 215,792,851,822,315,330,000,000,000,000,000,000,000 | 101 | bump version to 2.4.4
* remove checks for negative unsigned ints, fixes #2
* harden error logging functions, fixes #3 |
MagickExport void AnnotateComponentTerminus(void)
{
if (annotate_semaphore == (SemaphoreInfo *) NULL)
ActivateSemaphoreInfo(&annotate_semaphore);
DestroySemaphoreInfo(&annotate_semaphore);
} | 0 | [
"CWE-125"
] | ImageMagick6 | f6ffc702c6eecd963587273a429dcd608c648984 | 234,811,951,588,503,330,000,000,000,000,000,000,000 | 6 | https://github.com/ImageMagick/ImageMagick/issues/1588 |
cockpit_auth_login_finish (CockpitAuth *self,
GAsyncResult *result,
GIOStream *connection,
GHashTable *headers,
GError **error)
{
JsonObject *body = NULL;
CockpitCreds *creds = NULL;
CockpitSession *session... | 0 | [
"CWE-1021"
] | cockpit | 46f6839d1af4e662648a85f3e54bba2d57f39f0e | 337,578,273,267,205,200,000,000,000,000,000,000,000 | 91 | ws: Restrict our cookie to the login host only
Mark our cookie as `SameSite: Strict` [1]. The current `None` default
will soon be moved to `Lax` by Firefox and Chromium, and recent versions
started to throw a warning about it.
[1] https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite
https://... |
int process_zipfiles(__G) /* return PK-type error code */
__GDEF
{
#ifndef SFX
char *lastzipfn = (char *)NULL;
int NumWinFiles, NumLoseFiles, NumWarnFiles;
int NumMissDirs, NumMissFiles;
#endif
int error=0, error_in_archive=0;
/*------------------------------------------------------------------... | 0 | [
"CWE-400"
] | unzip | 47b3ceae397d21bf822bc2ac73052a4b1daf8e1c | 96,184,446,559,040,090,000,000,000,000,000,000,000 | 328 | Detect and reject a zip bomb using overlapped entries.
This detects an invalid zip file that has at least one entry that
overlaps with another entry or with the central directory to the
end of the file. A Fifield zip bomb uses overlapped local entries
to vastly increase the potential inflation ratio. Such an invalid
z... |
xdr_setkey3_arg(XDR *xdrs, setkey3_arg *objp)
{
if (!xdr_ui_4(xdrs, &objp->api_version)) {
return (FALSE);
}
if (!xdr_krb5_principal(xdrs, &objp->princ)) {
return (FALSE);
}
if (!xdr_krb5_boolean(xdrs, &objp->keepold)) {
return (FALSE);
}
if (!xdr_array(xdrs, (caddr_t *) &objp->ks_tuple,
(unsigned... | 0 | [
"CWE-703"
] | krb5 | a197e92349a4aa2141b5dff12e9dd44c2a2166e3 | 286,571,460,824,617,560,000,000,000,000,000,000,000 | 23 | Fix kadm5/gssrpc XDR double free [CVE-2014-9421]
[MITKRB5-SA-2015-001] In auth_gssapi_unwrap_data(), do not free
partial deserialization results upon failure to deserialize. This
responsibility belongs to the callers, svctcp_getargs() and
svcudp_getargs(); doing it in the unwrap function results in freeing
the result... |
const char *lj_debug_funcname(lua_State *L, TValue *frame, const char **name)
{
TValue *pframe;
GCfunc *fn;
BCPos pc;
if (frame <= tvref(L->stack))
return NULL;
if (frame_isvarg(frame))
frame = frame_prevd(frame);
pframe = frame_prev(frame);
fn = frame_func(pframe);
pc = debug_framepc(L, fn, fra... | 0 | [
"CWE-125"
] | LuaJIT | e296f56b825c688c3530a981dc6b495d972f3d01 | 105,691,908,107,176,950,000,000,000,000,000,000,000 | 27 | Call error function on rethrow after trace exit. |
int propagate_mnt(struct mount *dest_mnt, struct mountpoint *dest_mp,
struct mount *source_mnt, struct hlist_head *tree_list)
{
struct mount *m, *n;
int ret = 0;
/*
* we don't want to bother passing tons of arguments to
* propagate_one(); everything is serialized by namespace_sem,
* so globals will do j... | 1 | [
"CWE-703"
] | linux | 5ec0811d30378ae104f250bfc9b3640242d81e3f | 260,943,572,498,681,430,000,000,000,000,000,000,000 | 47 | propogate_mnt: Handle the first propogated copy being a slave
When the first propgated copy was a slave the following oops would result:
> BUG: unable to handle kernel NULL pointer dereference at 0000000000000010
> IP: [<ffffffff811fba4e>] propagate_one+0xbe/0x1c0
> PGD bacd4067 PUD bac66067 PMD 0
> Oops: 0000 [#1] SM... |
static int php_session_abort(void) /* {{{ */
{
if (PS(session_status) == php_session_active) {
if (PS(mod_data) || PS(mod_user_implemented)) {
PS(mod)->s_close(&PS(mod_data));
}
PS(session_status) = php_session_none;
return SUCCESS;
}
return FAILURE;
} | 0 | [
"CWE-476"
] | php-src | d76f7c6c636b8240e06a1fa29eebb98ad005008a | 335,290,668,194,686,600,000,000,000,000,000,000,000 | 11 | Fix bug #79221 - Null Pointer Dereference in PHP Session Upload Progress |
Mgr::QueryParams::Parse(Parser::Tokenizer &tok, QueryParams &aParams)
{
static const CharacterSet nameChars = CharacterSet("param-name", "_") + CharacterSet::ALPHA + CharacterSet::DIGIT;
static const CharacterSet valueChars = CharacterSet("param-value", "&= #").complement();
static const CharacterSet delimC... | 0 | [
"CWE-401"
] | squid | 26e65059bc06ebce508737b5cd0866478691566a | 263,661,658,413,405,430,000,000,000,000,000,000,000 | 31 | Bug 5106: Broken cache manager URL parsing (#788)
Use already parsed request-target URL in cache manager and
update CacheManager to Tokanizer based URL parse
Removing use of sscan() and regex string processing which have
proven to be problematic on many levels. Most particularly with
regards to tolerance of normally ... |
utf_ptr2cells_len(char_u *p, int size)
{
int c;
// Need to convert to a wide character.
if (size > 0 && *p >= 0x80)
{
if (utf_ptr2len_len(p, size) < utf8len_tab[*p])
return 1; // truncated
c = utf_ptr2char(p);
// An illegal byte is displayed as <xx>.
if (utf_ptr2len(p) == 1 || c == NUL)
... | 0 | [
"CWE-122",
"CWE-787"
] | vim | f6d39c31d2177549a986d170e192d8351bd571e2 | 163,313,123,758,844,630,000,000,000,000,000,000,000 | 20 | patch 9.0.0220: invalid memory access with for loop over NULL string
Problem: Invalid memory access with for loop over NULL string.
Solution: Make sure mb_ptr2len() consistently returns zero for NUL. |
static int dn_nl_fill_ifaddr(struct sk_buff *skb, struct dn_ifaddr *ifa,
u32 portid, u32 seq, int event, unsigned int flags)
{
struct ifaddrmsg *ifm;
struct nlmsghdr *nlh;
u32 ifa_flags = ifa->ifa_flags | IFA_F_PERMANENT;
nlh = nlmsg_put(skb, portid, seq, event, sizeof(*ifm), flags);
if (nlh == NULL)
re... | 0 | [
"CWE-264"
] | net | 90f62cf30a78721641e08737bda787552428061e | 254,585,222,673,795,930,000,000,000,000,000,000,000 | 32 | 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.
... |
static int mailimf_item_value_parse(const char * message, size_t length,
size_t * indx,
struct mailimf_item_value ** result)
{
size_t cur_token;
clist * angle_addr_list;
char * addr_spec;
char * atom;
char * domain;
char * msg_id;
int type;
struct mailimf_item_value * item_value;
int r... | 0 | [
"CWE-476"
] | libetpan | 1fe8fbc032ccda1db9af66d93016b49c16c1f22d | 209,902,113,319,176,830,000,000,000,000,000,000,000 | 97 | Fixed crash #274 |
static inline u64 min_vruntime(u64 min_vruntime, u64 vruntime)
{
s64 delta = (s64)(vruntime - min_vruntime);
if (delta < 0)
min_vruntime = vruntime;
return min_vruntime;
} | 0 | [] | linux-2.6 | 6a6029b8cefe0ca7e82f27f3904dbedba3de4e06 | 159,257,862,537,682,400,000,000,000,000,000,000,000 | 8 | sched: simplify sched_slice()
Use the existing calc_delta_mine() calculation for sched_slice(). This
saves a divide and simplifies the code because we share it with the
other /cfs_rq->load users.
It also improves code size:
text data bss dec hex filename
42659 2740 144 45543 b1e... |
static ut64 delta_for_access(RAnalOp *op, RAnalVarAccessType type) {
if (type == R_ANAL_VAR_ACCESS_TYPE_WRITE) {
if (op->dst) {
return op->dst->imm + op->dst->delta;
}
} else {
if (op->src[1] && (op->src[1]->imm || op->src[1]->delta)) {
return op->src[1]->imm + op->src[1]->delta;
}
if (op->src[0]) {
... | 0 | [
"CWE-416"
] | radare2 | 10517e3ff0e609697eb8cde60ec8dc999ee5ea24 | 55,862,472,090,962,100,000,000,000,000,000,000,000 | 15 | aaef on arm/thumb switches causes uaf ##crash
* Reported by peacock-doris via huntr.dev
* Reproducer: poc_uaf_r_reg_get |
static double mp_vector_print(_cimg_math_parser& mp) {
const bool print_string = (bool)mp.opcode[4];
cimg_pragma_openmp(critical(mp_vector_print))
{
CImg<charT> _expr(mp.opcode[2] - 5);
const ulongT *ptrs = mp.opcode._data + 5;
cimg_for(_expr,ptrd,char) *ptrd... | 0 | [
"CWE-119",
"CWE-787"
] | CImg | ac8003393569aba51048c9d67e1491559877b1d1 | 122,445,337,458,781,290,000,000,000,000,000,000,000 | 36 | . |
static void __exit qrtr_proto_fini(void)
{
qrtr_ns_remove();
sock_unregister(qrtr_family.family);
proto_unregister(&qrtr_proto);
} | 0 | [
"CWE-909"
] | linux | 50535249f624d0072cd885bcdce4e4b6fb770160 | 212,652,444,341,624,070,000,000,000,000,000,000,000 | 6 | net: qrtr: fix a kernel-infoleak in qrtr_recvmsg()
struct sockaddr_qrtr has a 2-byte hole, and qrtr_recvmsg() currently
does not clear it before copying kernel data to user space.
It might be too late to name the hole since sockaddr_qrtr structure is uapi.
BUG: KMSAN: kernel-infoleak in kmsan_copy_to_user+0x9c/0xb0 ... |
static int snd_pcm_sw_params_user(struct snd_pcm_substream *substream,
struct snd_pcm_sw_params __user * _params)
{
struct snd_pcm_sw_params params;
int err;
if (copy_from_user(¶ms, _params, sizeof(params)))
return -EFAULT;
err = snd_pcm_sw_params(substream, ¶ms);
if (copy_to_user(_params, ¶ms,... | 0 | [
"CWE-125"
] | linux | 92ee3c60ec9fe64404dc035e7c41277d74aa26cb | 229,004,660,571,639,150,000,000,000,000,000,000,000 | 12 | ALSA: pcm: Fix races among concurrent hw_params and hw_free calls
Currently we have neither proper check nor protection against the
concurrent calls of PCM hw_params and hw_free ioctls, which may result
in a UAF. Since the existing PCM stream lock can't be used for
protecting the whole ioctl operations, we need a new... |
void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp)
{
WARN_ON(!hlist_unhashed(&ifp->addr_lst));
#ifdef NET_REFCNT_DEBUG
pr_debug("%s\n", __func__);
#endif
in6_dev_put(ifp->idev);
if (cancel_delayed_work(&ifp->dad_work))
pr_notice("delayed DAD work was pending while freeing ifa=%p\n",
ifp);
if (ifp->... | 0 | [
"CWE-20"
] | linux | 77751427a1ff25b27d47a4c36b12c3c8667855ac | 265,921,056,756,752,000,000,000,000,000,000,000,000 | 22 | ipv6: addrconf: validate new MTU before applying it
Currently we don't check if the new MTU is valid or not and this allows
one to configure a smaller than minimum allowed by RFCs or even bigger
than interface own MTU, which is a problem as it may lead to packet
drops.
If you have a daemon like NetworkManager running... |
static inline unsigned int xfrm_sa_len(struct xfrm_state *x)
{
unsigned int l = 0;
if (x->aead)
l += nla_total_size(aead_len(x->aead));
if (x->aalg) {
l += nla_total_size(sizeof(struct xfrm_algo) +
(x->aalg->alg_key_len + 7) / 8);
l += nla_total_size(xfrm_alg_auth_len(x->aalg));
}
if (x->ealg)
l +=... | 0 | [
"CWE-125"
] | linux | b805d78d300bcf2c83d6df7da0c818b0fee41427 | 181,977,137,637,136,150,000,000,000,000,000,000,000 | 43 | xfrm: policy: Fix out-of-bound array accesses in __xfrm_policy_unlink
UBSAN report this:
UBSAN: Undefined behaviour in net/xfrm/xfrm_policy.c:1289:24
index 6 is out of range for type 'unsigned int [6]'
CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.4.162-514.55.6.9.x86_64+ #13
Hardware name: QEMU Standard PC (i440FX + P... |
static int mov_write_source_reference_tag(AVIOContext *pb, MOVTrack *track, const char *reel_name)
{
uint64_t str_size =strlen(reel_name);
int64_t pos = avio_tell(pb);
if (str_size >= UINT16_MAX){
av_log(NULL, AV_LOG_ERROR, "reel_name length %"PRIu64" is too large\n", str_size);
avio_wb16(p... | 0 | [
"CWE-369"
] | FFmpeg | 2c0e98a0b478284bdff6d7a4062522605a8beae5 | 91,831,383,506,709,970,000,000,000,000,000,000,000 | 18 | avformat/movenc: Write version 2 of audio atom if channels is not known
The version 1 needs the channel count and would divide by 0
Fixes: division by 0
Fixes: fpe_movenc.c_1108_1.ogg
Fixes: fpe_movenc.c_1108_2.ogg
Fixes: fpe_movenc.c_1108_3.wav
Found-by: #CHEN HONGXU# <HCHEN017@e.ntu.edu.sg>
Signed-off-by: Michael N... |
char *my_memmem (char *haystack, size_t haystacklen,
char *needle, size_t needlelen)
{
char *c;
for (c = haystack; c <= haystack + haystacklen - needlelen; c++)
if (!memcmp (c, needle, needlelen))
return c;
return 0;
} | 0 | [
"CWE-703"
] | LibRaw | 11909cc59e712e09b508dda729b99aeaac2b29ad | 118,977,742,387,848,000,000,000,000,000,000,000,000 | 9 | cumulated data checks patch |
static enum print_line_t print_trace_fmt(struct trace_iterator *iter)
{
struct trace_array *tr = iter->tr;
struct trace_seq *s = &iter->seq;
unsigned long sym_flags = (tr->trace_flags & TRACE_ITER_SYM_MASK);
struct trace_entry *entry;
struct trace_event *event;
entry = iter->ent;
test_cpu_buff_start(iter);
e... | 0 | [
"CWE-415"
] | linux | 4397f04575c44e1440ec2e49b6302785c95fd2f8 | 298,628,334,520,626,100,000,000,000,000,000,000,000 | 31 | tracing: Fix possible double free on failure of allocating trace buffer
Jing Xia and Chunyan Zhang reported that on failing to allocate part of the
tracing buffer, memory is freed, but the pointers that point to them are not
initialized back to NULL, and later paths may try to free the freed memory
again. Jing and Chu... |
int restore_altstack(const stack_t __user *uss)
{
stack_t new;
if (copy_from_user(&new, uss, sizeof(stack_t)))
return -EFAULT;
(void)do_sigaltstack(&new, NULL, current_user_stack_pointer(),
MINSIGSTKSZ);
/* squash all but EFAULT for now */
return 0;
} | 0 | [
"CWE-190"
] | linux | d1e7fd6462ca9fc76650fbe6ca800e35b24267da | 205,875,867,340,849,830,000,000,000,000,000,000,000 | 10 | signal: Extend exec_id to 64bits
Replace the 32bit exec_id with a 64bit exec_id to make it impossible
to wrap the exec_id counter. With care an attacker can cause exec_id
wrap and send arbitrary signals to a newly exec'd parent. This
bypasses the signal sending checks if the parent changes their
credentials during e... |
print_nodes(FILE * fp, struct node *root)
{
struct enum_list *ep;
struct index_list *ip;
struct varbind_list *vp;
struct node *np;
for (np = root; np; np = np->next) {
fprintf(fp, "%s ::= { %s %ld } (%d)\n", np->label, np->parent,
np->subid, np->type);
if (np->tc_... | 0 | [
"CWE-59",
"CWE-61"
] | net-snmp | 4fd9a450444a434a993bc72f7c3486ccce41f602 | 70,496,130,474,362,090,000,000,000,000,000,000,000 | 49 | CHANGES: snmpd: Stop reading and writing the mib_indexes/* files
Caching directory contents is something the operating system should do
and is not something Net-SNMP should do. Instead of storing a copy of
the directory contents in ${tmp_dir}/mib_indexes/${n}, always scan a
MIB directory. |
tracing_snapshot_write(struct file *filp, const char __user *ubuf, size_t cnt,
loff_t *ppos)
{
struct seq_file *m = filp->private_data;
struct trace_iterator *iter = m->private;
struct trace_array *tr = iter->tr;
unsigned long val;
int ret;
ret = tracing_update_buffers();
if (ret < 0)
return ret;
r... | 0 | [
"CWE-416"
] | linux | 15fab63e1e57be9fdb5eec1bbc5916e9825e9acb | 140,885,726,287,125,430,000,000,000,000,000,000,000 | 72 | fs: prevent page refcount overflow in pipe_buf_get
Change pipe_buf_get() to return a bool indicating whether it succeeded
in raising the refcount of the page (if the thing in the pipe is a page).
This removes another mechanism for overflowing the page refcount. All
callers converted to handle a failure.
Reported-by:... |
*/
static struct sk_buff *skb_checksum_maybe_trim(struct sk_buff *skb,
unsigned int transport_len)
{
struct sk_buff *skb_chk;
unsigned int len = skb_transport_offset(skb) + transport_len;
int ret;
if (skb->len < len)
return NULL;
else if (skb->len == len)
return skb;
skb_chk = skb_clone(skb, GF... | 0 | [
"CWE-703",
"CWE-125"
] | linux | 8605330aac5a5785630aec8f64378a54891937cc | 93,994,448,010,883,750,000,000,000,000,000,000,000 | 24 | tcp: fix SCM_TIMESTAMPING_OPT_STATS for normal skbs
__sock_recv_timestamp can be called for both normal skbs (for
receive timestamps) and for skbs on the error queue (for transmit
timestamps).
Commit 1c885808e456
(tcp: SOF_TIMESTAMPING_OPT_STATS option for SO_TIMESTAMPING)
assumes any skb passed to __sock_recv_timest... |
enum delta_result_type do_add_delta(conn *c, const char *key, const size_t nkey,
const bool incr, const int64_t delta,
char *buf, uint64_t *cas,
const uint32_t hv) {
char *ptr;
uint64_t value;
int res... | 0 | [
"CWE-189"
] | memcached | 6695ccbc525c36d693aaa3e8337b36aa0c784424 | 194,120,120,768,896,900,000,000,000,000,000,000,000 | 80 | Fix segfault on specially crafted packet. |
ipf_get_v6_enabled(struct ipf *ipf)
{
bool ifp_v6_enabled_;
atomic_read_relaxed(&ipf->ifp_v6_enabled, &ifp_v6_enabled_);
return ifp_v6_enabled_;
} | 0 | [
"CWE-401"
] | ovs | 803ed12e31b0377c37d7aa8c94b3b92f2081e349 | 26,946,544,087,280,550,000,000,000,000,000,000,000 | 6 | ipf: release unhandled packets from the batch
Since 640d4db788ed ("ipf: Fix a use-after-free error, ...") the ipf
framework unconditionally allocates a new dp_packet to track
individual fragments. This prevents a use-after-free. However, an
additional issue was present - even when the packet buffer is cloned,
if the... |
void PackLinuxElf32ppc::pack1(OutputFile *fo, Filter &ft)
{
super::pack1(fo, ft);
if (0!=xct_off) // shared library
return;
generateElfHdr(fo, stub_powerpc_linux_elf_fold, getbrk(phdri, e_phnum) );
} | 0 | [
"CWE-476"
] | upx | ef336dbcc6dc8344482f8cf6c909ae96c3286317 | 163,721,326,058,556,060,000,000,000,000,000,000,000 | 7 | Protect against bad crafted input.
https://github.com/upx/upx/issues/128
modified: p_lx_elf.cpp |
int expand_property(xmlNodePtr inroot, struct propfind_ctx *fctx,
struct namespace_t *namespace, const char *href,
parse_path_t parse_path, const struct prop_entry *lprops,
xmlNodePtr root, int depth)
{
int ret = 0, r;
struct propfind_ctx prev_ctx;
... | 0 | [] | cyrus-imapd | 6703ff881b6056e0c045a7b795ce8ba1bbb87027 | 144,547,747,894,803,630,000,000,000,000,000,000,000 | 112 | http_dav.c: add 'private' Cache-Control directive for cacheable responses that require authentication |
SSL_TICKET_STATUS tls_decrypt_ticket(SSL *s, const unsigned char *etick,
size_t eticklen, const unsigned char *sess_id,
size_t sesslen, SSL_SESSION **psess)
{
SSL_SESSION *sess = NULL;
unsigned char *sdec;
const unsigned char *p;
... | 0 | [
"CWE-476"
] | openssl | a87f3fe01a5a894aa27ccd6a239155fd129988e4 | 10,775,316,204,377,655,000,000,000,000,000,000,000 | 260 | Fix NULL dereference in SSL_check_chain() for TLS 1.3
In the tls1_check_sig_alg() helper function, we loop through the list of
"signature_algorithms_cert" values received from the client and attempt
to look up each one in turn in our internal table that maps wire
codepoint to string-form name, digest and/or signature ... |
static void __percpu *pcpu_alloc(size_t size, size_t align, bool reserved,
gfp_t gfp)
{
static int warn_limit = 10;
struct pcpu_chunk *chunk;
const char *err;
bool is_atomic = (gfp & GFP_KERNEL) != GFP_KERNEL;
int occ_pages = 0;
int slot, off, new_alloc, cpu, ret;
unsigned long flags;
void __percpu *ptr;
... | 0 | [] | linux | 6710e594f71ccaad8101bc64321152af7cd9ea28 | 111,969,133,604,279,920,000,000,000,000,000,000,000 | 178 | percpu: fix synchronization between synchronous map extension and chunk destruction
For non-atomic allocations, pcpu_alloc() can try to extend the area
map synchronously after dropping pcpu_lock; however, the extension
wasn't synchronized against chunk destruction and the chunk might get
freed while extension is in pr... |
mail_send (int argc, char **argv)
{
compose_env_t env;
int status;
int save_to = mu_isupper (argv[0][0]);
compose_init (&env);
if (argc < 2)
{
if (interactive)
compose_header_set (&env, MU_HEADER_TO, ml_readline_with_intr ("To: "),
COMPOSE_REPLACE);
else if (mailvar_is_true (mailvar_... | 0 | [] | mailutils | 4befcfd015256c568121653038accbd84820198f | 153,004,936,873,597,100,000,000,000,000,000,000,000 | 81 | mail: disable compose escapes in non-interctive mode.
* NEWS: Document changes.
* doc/texinfo/programs/mail.texi: Document changes.
* mail/send.c (mail_compose_send): Recognize escapes only in
interactive mode. |
zip_read_data_zipx_xz(struct archive_read *a, const void **buff,
size_t *size, int64_t *offset)
{
struct zip* zip = (struct zip *)(a->format->data);
int ret;
lzma_ret lz_ret;
const void* compressed_buf;
ssize_t bytes_avail, in_bytes, to_consume = 0;
(void) offset; /* UNUSED */
/* Initialize decompressor if no... | 0 | [
"CWE-399",
"CWE-401"
] | libarchive | ba641f73f3d758d9032b3f0e5597a9c6e593a505 | 231,421,017,935,971,300,000,000,000,000,000,000,000 | 82 | Fix typo in preprocessor macro in archive_read_format_zip_cleanup()
Frees lzma_stream on cleanup()
Fixes #1165 |
bool Http::CheckIfMatch(LPMAPIPROP lpProp)
{
bool ret = false, invert = false;
std::string strIf, strValue;
memory_ptr<SPropValue> ptrLastModTime;
if (lpProp != nullptr &&
HrGetOneProp(lpProp, PR_LAST_MODIFICATION_TIME, &~ptrLastModTime) == hrSuccess)
strValue = stringify_int64(FileTimeToUnixTime(ptrLastMod... | 0 | [
"CWE-770"
] | kopano-core | 512457466b87039c6a8d25887fdaca6173619546 | 20,941,424,626,266,380,000,000,000,000,000,000,000 | 36 | 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. |
void trim_trailing_slash_or_dot(char *path) {
assert(path);
char *end = strchr(path, '\0');
if ((end - path) > 1) {
end--;
while (*end == '/' ||
(*end == '.' && *(end - 1) == '/')) {
*end = '\0';
end--;
if (end == path)
break;
}
}
} | 0 | [
"CWE-269",
"CWE-94"
] | firejail | 27cde3d7d1e4e16d4190932347c7151dc2a84c50 | 69,429,916,649,534,180,000,000,000,000,000,000,000 | 15 | fixing CVE-2022-31214 |
static int clone_file(const char *from, const char *to,
const char **err_status, int copy_if_rename_fails) {
FILE *from_fp = NULL, *to_fp = NULL;
char buf[BUFSIZ];
size_t len;
int result = -1;
if (rename(from, to) == 0)
return 0;
if ((errno != EXDEV && errno != EBU... | 1 | [] | augeas | 163877441402e464266b45ee98e24bb652971def | 198,632,596,869,116,300,000,000,000,000,000,000,000 | 58 | Prevent symlink attacks via .augnew during saving
Instead of saving into a predictable PATH.augnew file, save into a securely
created PATH.augnew.XXXXXX
* src/transform.c (transform_save):
write changes to a temporary file in the same directory as the destination
(either the file's canonical path or the path ... |
static RBinPlugin *r_bin_get_binplugin_any(RBin *bin) {
return r_bin_get_binplugin_by_name (bin, "any");
} | 0 | [
"CWE-125"
] | radare2 | d31c4d3cbdbe01ea3ded16a584de94149ecd31d9 | 285,396,043,679,598,200,000,000,000,000,000,000,000 | 3 | Fix #8748 - Fix oobread on string search |
static int udf_symlink_filler(struct file *file, struct page *page)
{
struct inode *inode = page->mapping->host;
struct buffer_head *bh = NULL;
unsigned char *symlink;
int err;
unsigned char *p = kmap(page);
struct udf_inode_info *iinfo;
uint32_t pos;
/* We don't support symlinks longer than one block */
if (... | 0 | [
"CWE-119",
"CWE-703"
] | linux | e237ec37ec154564f8690c5bd1795339955eeef9 | 276,606,964,914,727,800,000,000,000,000,000,000,000 | 52 | udf: Check component length before reading it
Check that length specified in a component of a symlink fits in the
input buffer we are reading. Also properly ignore component length for
component types that do not use it. Otherwise we read memory after end
of buffer for corrupted udf image.
Reported-by: Carl Henrik Lu... |
show_tstamp_types_and_exit(pcap_t *pc, const char *device)
{
int n_tstamp_types;
int *tstamp_types = 0;
const char *tstamp_type_name;
int i;
n_tstamp_types = pcap_list_tstamp_types(pc, &tstamp_types);
if (n_tstamp_types < 0)
error("%s", pcap_geterr(pc));
if (n_tstamp_types == 0) {
fprintf(stderr, "Time sta... | 0 | [
"CWE-120",
"CWE-787"
] | tcpdump | 9ba91381954ad325ea4fd26b9c65a8bd9a2a85b6 | 181,332,929,224,975,560,000,000,000,000,000,000,000 | 30 | (for 4.9.3) CVE-2018-14879/fix -V to fail invalid input safely
get_next_file() did not check the return value of strlen() and
underflowed an array index if the line read by fgets() from the file
started with \0. This caused an out-of-bounds read and could cause a
write. Add the missing check.
This vulnerability was d... |
static int java_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int len) {
/* get opcode size */
//ut8 op_byte = data[0];
ut8 op_byte = data[0];
int sz = JAVA_OPS[op_byte].size;
if (!op) {
return sz;
}
memset (op, '\0', sizeof (RAnalOp));
IFDBG {
//eprintf ("Extracting op from buffer (%d byte(s)) @... | 0 | [
"CWE-125"
] | radare2 | 224e6bc13fa353dd3b7f7a2334588f1c4229e58d | 306,005,349,669,422,500,000,000,000,000,000,000,000 | 72 | Fix #10296 - Heap out of bounds read in java_switch_op() |
join_read_next_same(READ_RECORD *info)
{
int error;
TABLE *table= info->table;
JOIN_TAB *tab=table->reginfo.join_tab;
if ((error= table->file->ha_index_next_same(table->record[0],
tab->ref.key_buff,
tab->ref.key_length)... | 0 | [
"CWE-89"
] | server | 5ba77222e9fe7af8ff403816b5338b18b342053c | 150,818,905,896,645,300,000,000,000,000,000,000,000 | 17 | 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. |
genl_can_suspend_yes(VOID_ARGS)
{
return TRUE;
} | 0 | [
"CWE-120",
"CWE-269"
] | NetHack | f3def5c0b999478da2d0a8f0b6a7c370a2065f77 | 241,570,045,366,509,750,000,000,000,000,000,000,000 | 4 | command line triggered buffer overruns
Prevent extremely long command line arguments from overflowing local
buffers in raw_printf or config_error_add. The increased buffer
sizes they recently got to deal with long configuration file values
aren't sufficient to handle command line induced overflows.
choose_windows(co... |
static int nf_tables_fill_setelem_info(struct sk_buff *skb,
const struct nft_ctx *ctx, u32 seq,
u32 portid, int event, u16 flags,
const struct nft_set *set,
const struct nft_set_elem *elem)
{
struct nfgenmsg *nfmsg;
struct nlmsghdr *nlh;
struct nlattr *nest;
int err;
ev... | 0 | [
"CWE-19"
] | nf | a2f18db0c68fec96631c10cad9384c196e9008ac | 145,705,972,428,512,690,000,000,000,000,000,000,000 | 43 | netfilter: nf_tables: fix flush ruleset chain dependencies
Jumping between chains doesn't mix well with flush ruleset. Rules
from a different chain and set elements may still refer to us.
[ 353.373791] ------------[ cut here ]------------
[ 353.373845] kernel BUG at net/netfilter/nf_tables_api.c:1159!
[ 353.373896... |
MONGO_EXPORT int mongo_insert_batch( mongo *conn, const char *ns,
const bson **bsons, int count, mongo_write_concern *custom_write_concern,
int flags ) {
mongo_message *mm;
mongo_write_concern *write_concern = NULL;
int i;
char *... | 1 | [
"CWE-190"
] | mongo-c-driver-legacy | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | 45,618,245,763,839,210,000,000,000,000,000,000,000 | 56 | don't mix up int and size_t (first pass to fix that) |
management_kill_by_cid(void *arg, const unsigned long cid, const char *kill_msg)
{
struct multi_context *m = (struct multi_context *) arg;
struct multi_instance *mi = lookup_by_cid(m, cid);
if (mi)
{
send_restart(&mi->context, kill_msg); /* was: multi_signal_instance (m, mi, SIGTERM); */
... | 0 | [
"CWE-362",
"CWE-476"
] | openvpn | 37bc691e7d26ea4eb61a8a434ebd7a9ae76225ab | 290,523,545,524,774,780,000,000,000,000,000,000,000 | 15 | Fix illegal client float (CVE-2020-11810)
There is a time frame between allocating peer-id and initializing data
channel key (which is performed on receiving push request or on async
push-reply) in which the existing peer-id float checks do not work right.
If a "rogue" data channel packet arrives during that time fra... |
GF_Err segr_Write(GF_Box *s, GF_BitStream *bs)
{
u32 i, k;
GF_Err e;
FDSessionGroupBox *ptr = (FDSessionGroupBox *) s;
if (!s) return GF_BAD_PARAM;
e = gf_isom_box_write_header(s, bs);
if (e) return e;
gf_bs_write_u16(bs, ptr->num_session_groups);
for (i=0; i<ptr->num_session_groups; i++) {
gf_bs_write_u8(... | 0 | [
"CWE-416"
] | gpac | 6063b1a011c3f80cee25daade18154e15e4c058c | 154,349,273,495,316,940,000,000,000,000,000,000,000 | 24 | fix UAF in audio_sample_entry_Read (#1440) |
int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len)
{
int copied = 0;
while (len > 0) {
char buf[128];
int this_len, retval;
this_len = (len > sizeof(buf)) ? sizeof(buf) : len;
if (copy_from_user(buf, src, this_len))
return -EFAULT;
retval = access_process_vm(tsk... | 0 | [
"CWE-284",
"CWE-264"
] | linux | d049f74f2dbe71354d43d393ac3a188947811348 | 295,746,856,333,349,120,000,000,000,000,000,000,000 | 24 | exec/ptrace: fix get_dumpable() incorrect tests
The get_dumpable() return value is not boolean. Most users of the
function actually want to be testing for non-SUID_DUMP_USER(1) rather than
SUID_DUMP_DISABLE(0). The SUID_DUMP_ROOT(2) is also considered a
protected state. Almost all places did this correctly, excepti... |
iperf_set_send_state(struct iperf_test *test, signed char state)
{
test->state = state;
if (Nwrite(test->ctrl_sck, (char*) &state, sizeof(state), Ptcp) < 0) {
i_errno = IESENDMESSAGE;
return -1;
}
return 0;
} | 0 | [
"CWE-120",
"CWE-119",
"CWE-787"
] | iperf | 91f2fa59e8ed80dfbf400add0164ee0e508e412a | 266,277,446,965,182,540,000,000,000,000,000,000,000 | 9 | Fix a buffer overflow / heap corruption issue that could occur if a
malformed JSON string was passed on the control channel. This issue,
present in the cJSON library, was already fixed upstream, so was
addressed here in iperf3 by importing a newer version of cJSON (plus
local ESnet modifications).
Discovered and repo... |
static int __init qeth_core_init(void)
{
int rc;
pr_info("loading core functions\n");
INIT_LIST_HEAD(&qeth_core_card_list.list);
INIT_LIST_HEAD(&qeth_dbf_list);
rwlock_init(&qeth_core_card_list.rwlock);
mutex_init(&qeth_mod_mutex);
qeth_wq = create_singlethread_workqueue("qeth_wq");
rc = qeth_register_dbf_vi... | 0 | [
"CWE-200",
"CWE-119"
] | linux | 6fb392b1a63ae36c31f62bc3fc8630b49d602b62 | 319,282,669,322,781,740,000,000,000,000,000,000,000 | 55 | qeth: avoid buffer overflow in snmp ioctl
Check user-defined length in snmp ioctl request and allow request
only if it fits into a qeth command buffer.
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Reviewed-by: Heiko Carstens <heicars2@linux.vnet.ibm.c... |
procfsnext(FILE *procfs) {
char line[100];
char fsname[100];
while (fgets(line, sizeof(line), procfs)) {
if (sscanf (line, "nodev %[^#\n]\n", fsname) == 1) continue;
if (sscanf (line, " %[^# \n]\n", fsname) != 1) continue;
return xstrdup(fsname);
}
return 0;
} | 0 | [
"CWE-200"
] | util-linux | 0377ef91270d06592a0d4dd009c29e7b1ff9c9b8 | 233,678,428,078,950,550,000,000,000,000,000,000,000 | 11 | mount: (deprecated) drop --guess-fstype
The option is undocumented and unnecessary.
Signed-off-by: Karel Zak <kzak@redhat.com> |
DeleteAddress(PMIB_UNICASTIPADDRESS_ROW addr_row)
{
return DeleteUnicastIpAddressEntry(addr_row);
} | 0 | [
"CWE-415"
] | openvpn | 1394192b210cb3c6624a7419bcf3ff966742e79b | 233,616,948,902,774,200,000,000,000,000,000,000,000 | 4 | Fix potential double-free() in Interactive Service (CVE-2018-9336)
Malformed input data on the service pipe towards the OpenVPN interactive
service (normally used by the OpenVPN GUI to request openvpn instances
from the service) can result in a double free() in the error handling code.
This usually only leads to a pr... |
cls(const std::vector<std::pair<char32_t, char32_t>> &ranges) {
return std::make_shared<CharacterClass>(ranges, false);
} | 0 | [
"CWE-125"
] | cpp-peglib | b3b29ce8f3acf3a32733d930105a17d7b0ba347e | 333,768,866,972,203,900,000,000,000,000,000,000,000 | 3 | Fix #122 |
int phar_parse_tarfile(php_stream* fp, char *fname, int fname_len, char *alias, int alias_len, phar_archive_data** pphar, int is_data, php_uint32 compression, char **error TSRMLS_DC) /* {{{ */
{
char buf[512], *actual_alias = NULL, *p;
phar_entry_info entry = {0};
size_t pos = 0, read, totalsize;
tar_header *hdr;
... | 1 | [
"CWE-189"
] | php-src | 158d8a6b088662ce9d31e0c777c6ebe90efdc854 | 115,070,903,360,526,140,000,000,000,000,000,000,000 | 473 | fix unchecked emalloc |
MagickExport const char *GetDelegateCommands(const DelegateInfo *delegate_info)
{
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
assert(delegate_info != (DelegateInfo *) NULL);
assert(delegate_info->signature == MagickCoreSignature);
return(delegate_info->commands);
} | 0 | [
"CWE-476"
] | ImageMagick | 2c75f301d9ac84f91071393b02d8c88c8341c91c | 303,510,215,284,982,700,000,000,000,000,000,000,000 | 8 | https://github.com/ImageMagick/ImageMagick/issues/1225 |
ins_compl_bs(void)
{
char_u *line;
char_u *p;
line = ml_get_curline();
p = line + curwin->w_cursor.col;
MB_PTR_BACK(line, p);
// Stop completion when the whole word was deleted. For Omni completion
// allow the word to be deleted, we won't match everything.
// Respect the 'backspace' ... | 0 | [
"CWE-125"
] | vim | f12129f1714f7d2301935bb21d896609bdac221c | 244,974,948,274,768,430,000,000,000,000,000,000,000 | 36 | patch 9.0.0020: with some completion reading past end of string
Problem: With some completion reading past end of string.
Solution: Check the length of the string. |
int oidc_handle_jwks(request_rec *r, oidc_cfg *c) {
/* pickup requested JWKs type */
// char *jwks_type = NULL;
// oidc_util_get_request_parameter(r, "jwks", &jwks_type);
char *jwks = apr_pstrdup(r->pool, "{ \"keys\" : [");
apr_hash_index_t *hi = NULL;
apr_byte_t first = TRUE;
oidc_jose_error_t err;
if (c->pu... | 0 | [
"CWE-20"
] | mod_auth_openidc | 612e309bfffd6f9b8ad7cdccda3019fc0865f3b4 | 4,284,824,095,668,274,000,000,000,000,000,000,000 | 39 | don't echo query params on invalid requests to redirect URI; closes #212
thanks @LukasReschke; I'm sure there's some OWASP guideline that warns
against this |
static st64 buf_format(RBuffer *dst, RBuffer *src, const char *fmt, int n) {
st64 res = 0;
int i;
for (i = 0; i < n; i++) {
int j;
int m = 1;
int tsize = 2;
bool bigendian = true;
for (j = 0; fmt[j]; j++) {
switch (fmt[j]) {
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
... | 1 | [
"CWE-400",
"CWE-703"
] | radare2 | 634b886e84a5c568d243e744becc6b3223e089cf | 237,974,185,011,316,200,000,000,000,000,000,000,000 | 75 | Fix DoS in PE/QNX/DYLDCACHE/PSX parsers ##crash
* Reported by lazymio
* Reproducer: AAA4AAAAAB4= |
DECLAREreadFunc(readContigStripsIntoBuffer)
{
tsize_t scanlinesize = TIFFScanlineSize(in);
uint8* bufp = buf;
uint32 row;
(void) imagewidth; (void) spp;
for (row = 0; row < imagelength; row++) {
if (TIFFReadScanline(in, (tdata_t) bufp, row, 0) < 0
&& !ignore) {
TIFFError(TIFFFileName(in),
"Error... | 0 | [
"CWE-190"
] | libtiff | 43c0b81a818640429317c80fea1e66771e85024b | 215,525,370,213,615,900,000,000,000,000,000,000,000 | 20 | * tools/tiffcp.c: fix read of undefined variable in case of missing
required tags. Found on test case of MSVR 35100.
* tools/tiffcrop.c: fix read of undefined buffer in
readContigStripsIntoBuffer() due to uint16 overflow. Probably not a
security issue but I can be wrong. Reported as MSVR 35100 by Axel
Souchet from the ... |
static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb,
netdev_features_t features)
{
struct sk_buff *segs = ERR_PTR(-EINVAL);
unsigned int mss;
unsigned int unfrag_ip6hlen, unfrag_len;
struct frag_hdr *fptr;
u8 *packet_start, *prevhdr;
u8 nexthdr;
u8 frag_hdr_sz = sizeof(struct frag_hdr);
__wsum cs... | 0 | [
"CWE-125"
] | linux | 2423496af35d94a87156b063ea5cedffc10a70a1 | 121,695,549,454,774,060,000,000,000,000,000,000,000 | 103 | ipv6: Prevent overrun when parsing v6 header options
The KASAN warning repoted below was discovered with a syzkaller
program. The reproducer is basically:
int s = socket(AF_INET6, SOCK_RAW, NEXTHDR_HOP);
send(s, &one_byte_of_data, 1, MSG_MORE);
send(s, &more_than_mtu_bytes_data, 2000, 0);
The socket() call set... |
encode_jd(VALUE nth, int jd, VALUE *rjd)
{
if (f_zero_p(nth)) {
*rjd = INT2FIX(jd);
return;
}
*rjd = f_add(f_mul(INT2FIX(CM_PERIOD), nth), INT2FIX(jd));
} | 0 | [] | date | 3959accef8da5c128f8a8e2fd54e932a4fb253b0 | 148,384,595,767,967,760,000,000,000,000,000,000,000 | 8 | Add length limit option for methods that parses date strings
`Date.parse` now raises an ArgumentError when a given date string is
longer than 128. You can configure the limit by giving `limit` keyword
arguments like `Date.parse(str, limit: 1000)`. If you pass `limit: nil`,
the limit is disabled.
Not only `Date.parse`... |
PyParser_New(grammar *g, int start)
{
parser_state *ps;
if (!g->g_accel)
PyGrammar_AddAccelerators(g);
ps = (parser_state *)PyMem_MALLOC(sizeof(parser_state));
if (ps == NULL)
return NULL;
ps->p_grammar = g;
#ifdef PY_PARSER_REQUIRES_FUTURE_KEYWORD
ps->p_flags = 0;
#endif
ps... | 0 | [
"CWE-125"
] | cpython | dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c | 235,135,518,112,077,360,000,000,000,000,000,000,000 | 22 | bpo-35766: Merge typed_ast back into CPython (GH-11645) |
static bool finished_loading(const char *name)
{
struct module *mod;
bool ret;
/*
* The module_mutex should not be a heavily contended lock;
* if we get the occasional sleep here, we'll go an extra iteration
* in the wait_event_interruptible(), which is harmless.
*/
sched_annotate_sleep();
mutex_lock(&mod... | 0 | [
"CWE-362",
"CWE-347"
] | linux | 0c18f29aae7ce3dadd26d8ee3505d07cc982df75 | 303,433,599,828,197,960,000,000,000,000,000,000,000 | 18 | module: limit enabling module.sig_enforce
Irrespective as to whether CONFIG_MODULE_SIG is configured, specifying
"module.sig_enforce=1" on the boot command line sets "sig_enforce".
Only allow "sig_enforce" to be set when CONFIG_MODULE_SIG is configured.
This patch makes the presence of /sys/module/module/parameters/s... |
xsltFormatNumberConversion(xsltDecimalFormatPtr self,
xmlChar *format,
double number,
xmlChar **result)
{
xmlXPathError status = XPATH_EXPRESSION_OK;
xmlBufferPtr buffer;
xmlChar *the_format, *prefix = NULL, *suffix = NULL;
xmlChar *nprefix, *nsuffix = NULL;
xmlChar pchar;
int ... | 1 | [
"CWE-843"
] | libxslt | 6ce8de69330783977dd14f6569419489875fb71b | 87,617,033,634,558,700,000,000,000,000,000,000,000 | 413 | Fix uninitialized read with UTF-8 grouping chars
The character type in xsltFormatNumberConversion was too narrow and
an invalid character/length combination could be passed to
xsltNumberFormatDecimal, resulting in an uninitialized read.
Found by OSS-Fuzz. |
int __sb_start_write(struct super_block *sb, int level, bool wait)
{
retry:
if (unlikely(sb->s_writers.frozen >= level)) {
if (!wait)
return 0;
wait_event(sb->s_writers.wait_unfrozen,
sb->s_writers.frozen < level);
}
#ifdef CONFIG_LOCKDEP
acquire_freeze_lock(sb, level, !wait, _RET_IP_);
#endif
percpu_... | 0 | [
"CWE-17"
] | linux | eee5cc2702929fd41cce28058dc6d6717f723f87 | 111,820,171,971,204,020,000,000,000,000,000,000,000 | 25 | get rid of s_files and files_lock
The only thing we need it for is alt-sysrq-r (emergency remount r/o)
and these days we can do just as well without going through the
list of files.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> |
PG *OSD::lookup_lock_pg(spg_t pgid)
{
return _lookup_lock_pg(pgid);
} | 0 | [
"CWE-287",
"CWE-284"
] | ceph | 5ead97120e07054d80623dada90a5cc764c28468 | 1,141,492,833,233,194,600,000,000,000,000,000,000 | 4 | auth/cephx: add authorizer challenge
Allow the accepting side of a connection to reject an initial authorizer
with a random challenge. The connecting side then has to respond with an
updated authorizer proving they are able to decrypt the service's challenge
and that the new authorizer was produced for this specific ... |
pcmap(void)
{
} | 0 | [
"CWE-59",
"CWE-241"
] | w3m | 18dcbadf2771cdb0c18509b14e4e73505b242753 | 20,897,916,626,745,620,000,000,000,000,000,000,000 | 3 | Make temporary directory safely when ~/.w3m is unwritable |
int hfi1_device_create(struct hfi1_devdata *dd)
{
return user_add(dd);
} | 0 | [
"CWE-416"
] | linux | 3d2a9d642512c21a12d19b9250e7a835dcb41a79 | 297,817,120,952,281,100,000,000,000,000,000,000,000 | 4 | IB/hfi1: Ensure correct mm is used at all times
Two earlier bug fixes have created a security problem in the hfi1
driver. One fix aimed to solve an issue where current->mm was not valid
when closing the hfi1 cdev. It attempted to do this by saving a cached
value of the current->mm pointer at file open time. This is a ... |
monitor_read_log(struct monitor *pmonitor)
{
Buffer logmsg;
u_int len, level;
char *msg;
buffer_init(&logmsg);
/* Read length */
buffer_append_space(&logmsg, 4);
if (atomicio(read, pmonitor->m_log_recvfd,
buffer_ptr(&logmsg), buffer_len(&logmsg)) != buffer_len(&logmsg)) {
if (errno == EPIPE) {
buffer... | 0 | [
"CWE-20",
"CWE-200"
] | openssh-portable | d4697fe9a28dab7255c60433e4dd23cf7fce8a8b | 72,425,679,791,959,320,000,000,000,000,000,000,000 | 45 | Don't resend username to PAM; it already has it.
Pointed out by Moritz Jodeit; ok dtucker@ |
static void __generic_add_update_flags(RAnalOp *op, char t_d, ut64 v_d, char t_rk, ut64 v_rk) {
RStrBuf *d_strbuf, *rk_strbuf;
char *d, *rk;
d_strbuf = r_strbuf_new (NULL);
rk_strbuf = r_strbuf_new (NULL);
r_strbuf_setf (d_strbuf, t_d == 'r' ? "r%d" : "%" PFMT64d, v_d);
r_strbuf_setf (rk_strbuf, t_rk == 'r' ? ... | 0 | [
"CWE-125"
] | radare2 | 041e53cab7ca33481ae45ecd65ad596976d78e68 | 271,357,044,892,434,600,000,000,000,000,000,000,000 | 35 | Fix crash in anal.avr |
static int vmci_transport_recv_stream_cb(void *data, struct vmci_datagram *dg)
{
struct sock *sk;
struct sockaddr_vm dst;
struct sockaddr_vm src;
struct vmci_transport_packet *pkt;
struct vsock_sock *vsk;
bool bh_process_pkt;
int err;
sk = NULL;
err = VMCI_SUCCESS;
bh_process_pkt = false;
/* Ignore incomin... | 0 | [
"CWE-200"
] | linux | 680d04e0ba7e926233e3b9cee59125ce181f66ba | 61,300,807,946,687,420,000,000,000,000,000,000,000 | 131 | VSOCK: vmci - fix possible info leak in vmci_transport_dgram_dequeue()
In case we received no data on the call to skb_recv_datagram(), i.e.
skb->data is NULL, vmci_transport_dgram_dequeue() will return with 0
without updating msg_namelen leading to net/socket.c leaking the local,
uninitialized sockaddr_storage variabl... |
static int parse_tables(struct archive_read* a, struct rar5* rar,
const uint8_t* p)
{
int ret, value, i, w, idx = 0;
uint8_t bit_length[HUFF_BC],
table[HUFF_TABLE_SIZE],
nibble_mask = 0xF0,
nibble_shift = 4;
enum { ESCAPE = 15 };
/* The data for table generation is compressed using a simple RLE-like
*... | 0 | [
"CWE-20",
"CWE-125"
] | libarchive | 94821008d6eea81e315c5881cdf739202961040a | 314,170,838,578,279,850,000,000,000,000,000,000,000 | 178 | RAR5 reader: reject files that declare invalid header flags
One of the fields in RAR5's base block structure is the size of the
header. Some invalid files declare a 0 header size setting, which can
confuse the unpacker. Minimum header size for RAR5 base blocks is 7
bytes (4 bytes for CRC, and 3 bytes for the rest), so... |
drop_unnamed_stmt(void)
{
/* paranoia to avoid a dangling pointer in case of error */
if (unnamed_stmt_psrc)
{
CachedPlanSource *psrc = unnamed_stmt_psrc;
unnamed_stmt_psrc = NULL;
DropCachedPlan(psrc);
}
} | 0 | [
"CWE-89"
] | postgres | 2b3a8b20c2da9f39ffecae25ab7c66974fbc0d3b | 16,747,345,788,523,478,000,000,000,000,000,000,000 | 11 | Be more careful to not lose sync in the FE/BE protocol.
If any error occurred while we were in the middle of reading a protocol
message from the client, we could lose sync, and incorrectly try to
interpret a part of another message as a new protocol message. That will
usually lead to an "invalid frontend message" erro... |
set_tcltk_version(void)
{
if (tcltk_version.major) return;
Tcl_GetVersion(&(tcltk_version.major),
&(tcltk_version.minor),
&(tcltk_version.patchlevel),
&(tcltk_version.type));
} | 0 | [] | tk | ebd0fc80d62eeb7b8556522256f8d035e013eb65 | 77,746,176,451,108,620,000,000,000,000,000,000,000 | 9 | tcltklib.c: check argument
* ext/tk/tcltklib.c (ip_cancel_eval_core): check argument type and
length.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
ppmd_alloc(void *p, size_t size)
{
(void)p;
return malloc(size);
} | 0 | [
"CWE-119",
"CWE-787"
] | libarchive | 05caadc7eedbef471ac9610809ba683f0c698700 | 204,580,324,266,460,100,000,000,000,000,000,000,000 | 5 | Issue 719: Fix for TALOS-CAN-154
A RAR file with an invalid zero dictionary size was not being
rejected, leading to a zero-sized allocation for the dictionary
storage which was then overwritten during the dictionary initialization.
Thanks to the Open Source and Threat Intelligence project at Cisco for
reporting this... |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE_EQ(context, NumInputs(node), 2);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
// Reinterprete the opaque data provided by user.
OpData* data = reinterpret_cast<OpData*>(node->user_data);
const TfLiteTensor* input1;
TF_LITE... | 0 | [
"CWE-125",
"CWE-787"
] | tensorflow | 1970c2158b1ffa416d159d03c3370b9a462aee35 | 227,767,472,952,465,560,000,000,000,000,000,000,000 | 43 | [tflite]: Insert `nullptr` checks when obtaining tensors.
As part of ongoing refactoring, `tflite::GetInput`, `tflite::GetOutput`, `tflite::GetTemporary` and `tflite::GetIntermediates` will return `nullptr` in some cases. Hence, we insert the `nullptr` checks on all usages.
We also insert `nullptr` checks on usages o... |
static bool register_is_const(struct bpf_reg_state *reg)
{
return reg->type == SCALAR_VALUE && tnum_is_const(reg->var_off);
} | 0 | [
"CWE-119",
"CWE-681",
"CWE-787"
] | linux | 5b9fbeb75b6a98955f628e205ac26689bcb1383e | 274,038,182,428,222,540,000,000,000,000,000,000,000 | 4 | bpf: Fix scalar32_min_max_or bounds tracking
Simon reported an issue with the current scalar32_min_max_or() implementation.
That is, compared to the other 32 bit subreg tracking functions, the code in
scalar32_min_max_or() stands out that it's using the 64 bit registers instead
of 32 bit ones. This leads to bounds tra... |
static void write_header(FILE *sql_file, char *db_name)
{
if (opt_xml)
{
fputs("<?xml version=\"1.0\"?>\n", sql_file);
/*
Schema reference. Allows use of xsi:nil for NULL values and
xsi:type to define an element's data type.
*/
fputs("<mysqldump ", sql_file);
fputs("xmlns:xsi=\"htt... | 0 | [] | server | 5a43a31ee81bc181eeb5ef2bf0704befa6e0594d | 286,368,529,466,617,750,000,000,000,000,000,000,000 | 63 | mysqldump: comments and identifiers with new lines
don't let identifiers with new lines to break a comment |
pci_lintr_deassert(struct pci_vdev *dev)
{
assert(dev->lintr.pin > 0);
pthread_mutex_lock(&dev->lintr.lock);
if (dev->lintr.state == ASSERTED) {
dev->lintr.state = IDLE;
pci_irq_deassert(dev);
} else if (dev->lintr.state == PENDING)
dev->lintr.state = IDLE;
pthread_mutex_unlock(&dev->lintr.lock);
} | 1 | [
"CWE-617",
"CWE-703"
] | acrn-hypervisor | 2b3dedfb9ba13f15887f22b935d373f36c9a59fa | 147,581,661,678,829,900,000,000,000,000,000,000,000 | 12 | dm: pci: clean up assert() in pci core
Tracked-On: #3252
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Reviewed-by: Yonghua Huang <yonghua.huang@intel.com> |
CImg<Tfloat> get_blur_box(const float boxsize_x, const float boxsize_y, const float boxsize_z,
const unsigned int boundary_conditions=1) const {
return CImg<Tfloat>(*this,false).blur_box(boxsize_x,boxsize_y,boxsize_z,boundary_conditions);
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 317,423,367,431,222,050,000,000,000,000,000,000,000 | 4 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
resolve_choice_dflt(struct lys_node_choice *choic, const char *dflt)
{
struct lys_node *child, *ret;
LY_TREE_FOR(choic->child, child) {
if (child->nodetype == LYS_USES) {
ret = resolve_choice_dflt((struct lys_node_choice *)child, dflt);
if (ret) {
return ret;
... | 0 | [
"CWE-119"
] | libyang | 32fb4993bc8bb49e93e84016af3c10ea53964be5 | 244,313,296,328,469,100,000,000,000,000,000,000,000 | 20 | schema tree BUGFIX do not check features while still resolving schema
Fixes #723 |
int gnutls_subject_alt_names_set(gnutls_subject_alt_names_t sans,
unsigned int san_type,
const gnutls_datum_t * san,
const char *othername_oid)
{
int ret;
gnutls_datum_t copy;
char *ooc;
ret = _gnutls_set_strdatum(©, san->data, san->size);
if (ret < 0)
return gnutls_assert_val(ret);
if (oth... | 0 | [
"CWE-415"
] | gnutls | c5aaa488a3d6df712dc8dff23a049133cab5ec1b | 303,613,929,665,413,500,000,000,000,000,000,000,000 | 26 | gnutls_x509_ext_import_proxy: fix issue reading the policy language
If the language was set but the policy wasn't, that could lead to
a double free, as the value returned to the user was freed. |
int fuse_fs_read(struct fuse_fs *fs, const char *path, char *buf, size_t size,
off_t off, struct fuse_file_info *fi)
{
fuse_get_context()->private_data = fs->user_data;
if (fs->op.read)
return fs->op.read(path, buf, size, off, fi);
else
return -ENOSYS;
} | 0 | [] | ntfs-3g | fb28eef6f1c26170566187c1ab7dc913a13ea43c | 49,503,361,217,130,630,000,000,000,000,000,000,000 | 9 | Hardened the checking of directory offset requested by a readdir
When asked for the next directory entries, make sure the chunk offset
is within valid values, otherwise return no more entries in chunk. |
flatpak_context_add_shares (FlatpakContext *context,
FlatpakContextShares shares)
{
context->shares_valid |= shares;
context->shares |= shares;
} | 0 | [
"CWE-20"
] | flatpak | 902fb713990a8f968ea4350c7c2a27ff46f1a6c4 | 203,559,078,370,959,300,000,000,000,000,000,000,000 | 6 | Use seccomp to filter out TIOCSTI ioctl
This would otherwise let the sandbox add input to the controlling tty. |
GF_Err svhd_box_size(GF_Box *s)
{
GF_SphericalVideoInfoBox *ptr = (GF_SphericalVideoInfoBox *)s;
if (ptr->string)
s->size += (u32) strlen(ptr->string);
s->size += 1;
return GF_OK; | 0 | [
"CWE-476",
"CWE-787"
] | gpac | b8f8b202d4fc23eb0ab4ce71ae96536ca6f5d3f8 | 208,907,073,683,483,300,000,000,000,000,000,000,000 | 8 | fixed #1757 |
static void dn_unhash_sock_bh(struct sock *sk)
{
write_lock_bh(&dn_hash_lock);
sk_del_node_init(sk);
write_unlock_bh(&dn_hash_lock);
} | 0 | [] | net | 79462ad02e861803b3840cc782248c7359451cd9 | 113,663,552,897,052,400,000,000,000,000,000,000,000 | 6 | net: add validation for the socket syscall protocol argument
郭永刚 reported that one could simply crash the kernel as root by
using a simple program:
int socket_fd;
struct sockaddr_in addr;
addr.sin_port = 0;
addr.sin_addr.s_addr = INADDR_ANY;
addr.sin_family = 10;
socket_fd = socket(10,3,0x40000000);
connect(s... |
GF_Err bloc_Write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
u32 i;
GF_BaseLocationBox *ptr = (GF_BaseLocationBox *) s;
e = gf_isom_full_box_write(s, bs);
if (e) return e;
gf_bs_write_data(bs, (const char *) ptr->baseLocation, 256);
gf_bs_write_data(bs, (const char *) ptr->basePurlLocation, 256);
for (i=0; i < ... | 0 | [
"CWE-400",
"CWE-401"
] | gpac | d2371b4b204f0a3c0af51ad4e9b491144dd1225c | 308,498,601,073,717,670,000,000,000,000,000,000,000 | 15 | prevent dref memleak on invalid input (#1183) |
YieldFrom(expr_ty value, int lineno, int col_offset, int end_lineno, int
end_col_offset, PyArena *arena)
{
expr_ty p;
if (!value) {
PyErr_SetString(PyExc_ValueError,
"field value is required for YieldFrom");
return NULL;
}
p = (expr_ty)PyArena_Malloc(are... | 0 | [
"CWE-125"
] | cpython | dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c | 223,965,474,581,577,370,000,000,000,000,000,000,000 | 20 | bpo-35766: Merge typed_ast back into CPython (GH-11645) |
static void iscsi_save_designator(IscsiLun *lun,
struct scsi_inquiry_device_identification *inq_di)
{
struct scsi_inquiry_device_designator *desig, *copy = NULL;
for (desig = inq_di->designators; desig; desig = desig->next) {
if (desig->association ||
desig... | 0 | [
"CWE-125"
] | qemu | ff0507c239a246fd7215b31c5658fc6a3ee1e4c5 | 307,237,704,184,732,300,000,000,000,000,000,000,000 | 23 | block/iscsi:fix heap-buffer-overflow in iscsi_aio_ioctl_cb
There is an overflow, the source 'datain.data[2]' is 100 bytes,
but the 'ss' is 252 bytes.This may cause a security issue because
we can access a lot of unrelated memory data.
The len for sbp copy data should take the minimum of mx_sb_len and
sb_len_wr, no... |
void OSDService::pin_map_inc_bl(epoch_t e, bufferlist &bl)
{
Mutex::Locker l(map_cache_lock);
// cache a contiguous buffer
if (bl.get_num_buffers() > 1) {
bl.rebuild();
}
map_bl_inc_cache.pin(e, bl);
} | 0 | [
"CWE-287",
"CWE-284"
] | ceph | 5ead97120e07054d80623dada90a5cc764c28468 | 195,879,690,678,987,160,000,000,000,000,000,000,000 | 9 | auth/cephx: add authorizer challenge
Allow the accepting side of a connection to reject an initial authorizer
with a random challenge. The connecting side then has to respond with an
updated authorizer proving they are able to decrypt the service's challenge
and that the new authorizer was produced for this specific ... |
TPMI_ALG_SYM_OBJECT_Unmarshal(TPMI_ALG_SYM_OBJECT *target, BYTE **buffer, INT32 *size, BOOL allowNull)
{
TPM_RC rc = TPM_RC_SUCCESS;
TPMI_ALG_SYM_OBJECT orig_target = *target; // libtpms added
if (rc == TPM_RC_SUCCESS) {
rc = TPM_ALG_ID_Unmarshal(target, buffer, size);
}
if (rc == TPM_RC_SUCCESS... | 0 | [
"CWE-787"
] | libtpms | 5cc98a62dc6f204dcf5b87c2ee83ac742a6a319b | 286,906,076,131,211,700,000,000,000,000,000,000,000 | 34 | tpm2: Restore original value if unmarshalled value was illegal
Restore the original value of the memory location where data from
a stream was unmarshalled and the unmarshalled value was found to
be illegal. The goal is to not keep illegal values in memory.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> |
DECODE_JSON(UInt32) {
CHECK_TOKEN_BOUNDS;
CHECK_PRIMITIVE;
size_t tokenSize;
char* tokenData;
GET_TOKEN(tokenData, tokenSize);
UA_UInt64 out = 0;
UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
*dst = (UA_UInt32)out;
if(moveToken)
parseCtx->index++;
... | 0 | [
"CWE-703",
"CWE-787"
] | open62541 | c800e2987b10bb3af6ef644b515b5d6392f8861d | 148,486,568,199,937,060,000,000,000,000,000,000,000 | 15 | fix(json): Check max recursion depth in more places |
static void kfree_skbmem(struct sk_buff *skb)
{
struct sk_buff *other;
atomic_t *fclone_ref;
switch (skb->fclone) {
case SKB_FCLONE_UNAVAILABLE:
kmem_cache_free(skbuff_head_cache, skb);
break;
case SKB_FCLONE_ORIG:
fclone_ref = (atomic_t *) (skb + 2);
if (atomic_dec_and_test(fclone_ref))
kmem_cache_fr... | 0 | [
"CWE-416"
] | net | 36d5fe6a000790f56039afe26834265db0a3ad4c | 115,306,118,821,719,950,000,000,000,000,000,000,000 | 30 | core, nfqueue, openvswitch: Orphan frags in skb_zerocopy and handle errors
skb_zerocopy can copy elements of the frags array between skbs, but it doesn't
orphan them. Also, it doesn't handle errors, so this patch takes care of that
as well, and modify the callers accordingly. skb_tx_error() is also added to
the caller... |
h2_rx_push_promise(struct worker *wrk, struct h2_sess *h2, struct h2_req *r2)
{
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
ASSERT_RXTHR(h2);
CHECK_OBJ_ORNULL(r2, H2_REQ_MAGIC);
// rfc7540,l,2262,2267
return (H2CE_PROTOCOL_ERROR);
} | 0 | [
"CWE-444"
] | varnish-cache | d4c67d2a1a05304598895c24663c58a2e2932708 | 135,093,296,039,788,560,000,000,000,000,000,000,000 | 9 | Take content length into account on H/2 request bodies
When receiving H/2 data frames, make sure to take the advertised content
length into account, and fail appropriately if the combined sum of the
data frames does not match the content length. |
static inline int ccid_hc_tx_getsockopt(struct ccid *ccid, struct sock *sk,
const int optname, int len,
u32 __user *optval, int __user *optlen)
{
int rc = -ENOPROTOOPT;
if (ccid != NULL && ccid->ccid_ops->ccid_hc_tx_getsockopt != NULL)
rc = ccid->ccid_ops->ccid_hc_tx_getsockopt(sk, optname, len,
op... | 0 | [
"CWE-703"
] | linux | 276bdb82dedb290511467a5a4fdbe9f0b52dce6f | 184,240,462,969,946,830,000,000,000,000,000,000,000 | 10 | dccp: check ccid before dereferencing
ccid_hc_rx_getsockopt() and ccid_hc_tx_getsockopt() might be called with
a NULL ccid pointer leading to a NULL pointer dereference. This could
lead to a privilege escalation if the attacker is able to map page 0 and
prepare it with a fake ccid_ops pointer.
Signed-off-by: Mathias ... |
static double mp_arg(_cimg_math_parser& mp) {
const int _ind = (int)_mp_arg(4);
const unsigned int
nb_args = (unsigned int)mp.opcode[2] - 4,
ind = _ind<0?_ind + nb_args:(unsigned int)_ind,
siz = (unsigned int)mp.opcode[3];
if (siz>0) {
if (ind>=nb_ar... | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 2,935,332,138,654,192,000,000,000,000,000,000,000 | 14 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
inline void srand(const cimg_ulong seed) {
cimg::mutex(4);
cimg::rng() = seed;
cimg::mutex(4,0); | 0 | [
"CWE-119",
"CWE-787"
] | CImg | ac8003393569aba51048c9d67e1491559877b1d1 | 316,744,589,225,685,640,000,000,000,000,000,000,000 | 5 | . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.