func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
win_strncat_to_utf16(struct archive_string *as16, const void *_p,
size_t length, struct archive_string_conv *sc, int bigendian)
{
const char *s = (const char *)_p;
char *u16;
size_t count, avail;
if (archive_string_ensure(as16,
as16->length + (length + 1) * 2) == NULL)
return (-1);
u16 = as16->s + as1... | 0 | [
"CWE-476"
] | libarchive | 42a3408ac7df1e69bea9ea12b72e14f59f7400c0 | 221,252,768,700,430,400,000,000,000,000,000,000,000 | 76 | archive_strncat_l(): allocate and do not convert if length == 0
This ensures e.g. that archive_mstring_copy_mbs_len_l() does not set
aes_set = AES_SET_MBS with aes_mbs.s == NULL.
Resolves possible null-pointer dereference reported by OSS-Fuzz.
Reported-By: OSS-Fuzz issue 286 |
static int smack_task_movememory(struct task_struct *p)
{
return smk_curacc_on_task(p, MAY_WRITE);
} | 0 | [] | linux-2.6 | ee18d64c1f632043a02e6f5ba5e045bb26a5465f | 319,795,735,611,563,730,000,000,000,000,000,000,000 | 4 | KEYS: Add a keyctl to install a process's session keyring on its parent [try #6]
Add a keyctl to install a process's session keyring onto its parent. This
replaces the parent's session keyring. Because the COW credential code does
not permit one process to change another process's credentials directly, the
change is... |
TEST_P(Http2CodecImplFlowControlTest, LargeServerBodyFlushTimeout) {
initialize();
InSequence s;
MockStreamCallbacks client_stream_callbacks;
request_encoder_->getStream().addCallbacks(client_stream_callbacks);
TestRequestHeaderMapImpl request_headers;
HttpTestUtility::addDefaultHeaders(request_headers);
... | 0 | [
"CWE-400"
] | envoy | 0e49a495826ea9e29134c1bd54fdeb31a034f40c | 229,621,562,660,635,730,000,000,000,000,000,000,000 | 30 | http/2: add stats and stream flush timeout (#139)
This commit adds a new stream flush timeout to guard against a
remote server that does not open window once an entire stream has
been buffered for flushing. Additional stats have also been added
to better understand the codecs view of active streams as well as
amount o... |
NAN_METHOD(XmlDocument::GetDtd)
{
Nan::HandleScope scope;
XmlDocument* document = Nan::ObjectWrap::Unwrap<XmlDocument>(info.Holder());
assert(document);
xmlDtdPtr dtd = xmlGetIntSubset(document->xml_obj);
if (!dtd) {
return info.GetReturnValue().Set(Nan::Null());
}
const char* nam... | 0 | [
"CWE-400"
] | libxmljs | 2501807bde9b38cfaed06d1e140487516d91379d | 203,883,366,738,996,660,000,000,000,000,000,000,000 | 43 | Ensure parseXml/parseHtml input is string or buffer (#594) |
int pmd_huge(pmd_t pmd)
{
return !pmd_none(pmd) &&
(pmd_val(pmd) & (_PAGE_PRESENT|_PAGE_PSE)) != _PAGE_PRESENT;
} | 0 | [
"CWE-119"
] | linux | 1be7107fbe18eed3e319a6c3e83c78254b693acb | 67,930,346,351,025,450,000,000,000,000,000,000,000 | 5 | mm: larger stack guard gap, between vmas
Stack guard page is a useful feature to reduce a risk of stack smashing
into a different mapping. We have been using a single page gap which
is sufficient to prevent having stack adjacent to a different mapping.
But this seems to be insufficient in the light of the stack usage ... |
static int handle_ip_over_ddp(struct sk_buff *skb)
{
struct net_device *dev = __dev_get_by_name(&init_net, "ipddp0");
struct net_device_stats *stats;
/* This needs to be able to handle ipddp"N" devices */
if (!dev) {
kfree_skb(skb);
return NET_RX_DROP;
}
skb->protocol = htons(ETH_P_IP);
skb_pull(skb, 13);
... | 0 | [
"CWE-416"
] | linux | 6377f787aeb945cae7abbb6474798de129e1f3ac | 215,341,547,246,117,080,000,000,000,000,000,000,000 | 21 | appletalk: Fix use-after-free in atalk_proc_exit
KASAN report this:
BUG: KASAN: use-after-free in pde_subdir_find+0x12d/0x150 fs/proc/generic.c:71
Read of size 8 at addr ffff8881f41fe5b0 by task syz-executor.0/2806
CPU: 0 PID: 2806 Comm: syz-executor.0 Not tainted 5.0.0-rc7+ #45
Hardware name: QEMU Standard PC (i440... |
static int unix_seqpacket_recvmsg(struct kiocb *iocb, struct socket *sock,
struct msghdr *msg, size_t size,
int flags)
{
struct sock *sk = sock->sk;
if (sk->sk_state != TCP_ESTABLISHED)
return -ENOTCONN;
return unix_dgram_recvmsg(iocb, sock, msg, size, flags);
} | 0 | [] | linux-2.6 | 16e5726269611b71c930054ffe9b858c1cea88eb | 270,556,754,145,714,700,000,000,000,000,000,000,000 | 11 | af_unix: dont send SCM_CREDENTIALS by default
Since commit 7361c36c5224 (af_unix: Allow credentials to work across
user and pid namespaces) af_unix performance dropped a lot.
This is because we now take a reference on pid and cred in each write(),
and release them in read(), usually done from another process,
eventua... |
static int fib6_rule_action_alt(struct fib_rule *rule, struct flowi *flp,
int flags, struct fib_lookup_arg *arg)
{
struct fib6_result *res = arg->result;
struct flowi6 *flp6 = &flp->u.ip6;
struct net *net = rule->fr_net;
struct fib6_table *table;
int err, *oif;
u32 tb_id;
switch (rule->action) {
case FR_AC... | 0 | [
"CWE-772",
"CWE-401"
] | linux | ca7a03c4175366a92cee0ccc4fec0038c3266e26 | 267,177,460,498,958,460,000,000,000,000,000,000,000 | 37 | ipv6: do not free rt if FIB_LOOKUP_NOREF is set on suppress rule
Commit 7d9e5f422150 removed references from certain dsts, but accounting
for this never translated down into the fib6 suppression code. This bug
was triggered by WireGuard users who use wg-quick(8), which uses the
"suppress-prefix" directive to ip-rule(8... |
static int selinux_shm_shmctl(struct kern_ipc_perm *shp, int cmd)
{
int perms;
int err;
switch (cmd) {
case IPC_INFO:
case SHM_INFO:
/* No specific object, just general system-wide information. */
return avc_has_perm(&selinux_state,
current_sid(), SECINITSID_KERNEL,
SECCLASS_SYSTEM, SYSTEM__IP... | 0 | [
"CWE-349"
] | linux | fb73974172ffaaf57a7c42f35424d9aece1a5af6 | 255,913,525,325,488,850,000,000,000,000,000,000,000 | 34 | selinux: properly handle multiple messages in selinux_netlink_send()
Fix the SELinux netlink_send hook to properly handle multiple netlink
messages in a single sk_buff; each message is parsed and subject to
SELinux access control. Prior to this patch, SELinux only inspected
the first message in the sk_buff.
Cc: stab... |
static int ntop_is_dir(lua_State* vm) {
char *path;
struct stat buf;
int rc;
ntop->getTrace()->traceEvent(TRACE_DEBUG, "%s() called", __FUNCTION__);
if(ntop_lua_check(vm, __FUNCTION__, 1, LUA_TSTRING)) return(CONST_LUA_ERROR);
path = (char*)lua_tostring(vm, 1);
rc = ((stat(path, &buf) != 0) || (!S_ISDI... | 0 | [
"CWE-476"
] | ntopng | 01f47e04fd7c8d54399c9e465f823f0017069f8f | 12,737,886,623,544,693,000,000,000,000,000,000,000 | 15 | Security fix: prevents empty host from being used |
irc_server_get_prefix_char_for_mode (struct t_irc_server *server, char mode)
{
const char *prefix_chars;
int index;
if (server)
{
prefix_chars = irc_server_get_prefix_chars (server);
index = irc_server_get_prefix_mode_index (server, mode);
if (index >= 0)
return ... | 0 | [
"CWE-20"
] | weechat | c265cad1c95b84abfd4e8d861f25926ef13b5d91 | 54,307,838,081,910,880,000,000,000,000,000,000,000 | 15 | Fix verification of SSL certificates by calling gnutls verify callback (patch #7459) |
static int btrfs_extent_same(struct inode *src, u64 loff, u64 olen,
struct inode *dst, u64 dst_loff)
{
int ret;
u64 len = olen;
struct cmp_pages cmp;
int same_inode = 0;
u64 same_lock_start = 0;
u64 same_lock_len = 0;
if (src == dst)
same_inode = 1;
if (len == 0)
return 0;
if (same_inode) {
mu... | 0 | [
"CWE-200"
] | linux | 8039d87d9e473aeb740d4fdbd59b9d2f89b2ced9 | 276,846,403,841,236,700,000,000,000,000,000,000,000 | 98 | Btrfs: fix file corruption and data loss after cloning inline extents
Currently the clone ioctl allows to clone an inline extent from one file
to another that already has other (non-inlined) extents. This is a problem
because btrfs is not designed to deal with files having inline and regular
extents, if a file has an ... |
rpc_C_FindObjectsFinal (CK_X_FUNCTION_LIST *self,
p11_rpc_message *msg)
{
CK_SESSION_HANDLE session;
BEGIN_CALL (FindObjectsFinal);
IN_ULONG (session);
PROCESS_CALL ((self, session));
END_CALL;
} | 0 | [
"CWE-190"
] | p11-kit | 5307a1d21a50cacd06f471a873a018d23ba4b963 | 43,289,130,450,275,170,000,000,000,000,000,000,000 | 10 | Check for arithmetic overflows before allocating |
void sqlite3WhereEnd(WhereInfo *pWInfo){
Parse *pParse = pWInfo->pParse;
Vdbe *v = pParse->pVdbe;
int i;
WhereLevel *pLevel;
WhereLoop *pLoop;
SrcList *pTabList = pWInfo->pTabList;
sqlite3 *db = pParse->db;
int iEnd = sqlite3VdbeCurrentAddr(v);
int nRJ = 0;
/* Generate loop termination code.
*/
... | 0 | [
"CWE-129"
] | sqlite | effc07ec9c6e08d3bd17665f8800054770f8c643 | 4,700,005,216,578,405,500,000,000,000,000,000,000 | 310 | Fix the whereKeyStats() routine (part of STAT4 processing only) so that it
is able to cope with row-value comparisons against the primary key index
of a WITHOUT ROWID table.
[forum:/forumpost/3607259d3c|Forum post 3607259d3c].
FossilOrigin-Name: 2a6f761864a462de5c2d5bc666b82fb0b7e124a03443cd1482620dde344b34bb |
htab_map_lookup_batch(struct bpf_map *map, const union bpf_attr *attr,
union bpf_attr __user *uattr)
{
return __htab_map_lookup_and_delete_batch(map, attr, uattr, false,
false, false);
} | 0 | [
"CWE-787"
] | bpf | c4eb1f403243fc7bbb7de644db8587c03de36da6 | 7,835,091,108,191,554,000,000,000,000,000,000,000 | 6 | bpf: Fix integer overflow involving bucket_size
In __htab_map_lookup_and_delete_batch(), hash buckets are iterated
over to count the number of elements in each bucket (bucket_size).
If bucket_size is large enough, the multiplication to calculate
kvmalloc() size could overflow, resulting in out-of-bounds write
as repor... |
upnp_get_redirection_infos_by_index(int index,
unsigned short * eport, char * protocol,
unsigned short * iport,
char * iaddr, int iaddrlen,
char * desc, int desclen,
... | 0 | [
"CWE-476"
] | miniupnp | f321c2066b96d18afa5158dfa2d2873a2957ef38 | 209,143,269,991,691,460,000,000,000,000,000,000,000 | 39 | upnp_redirect(): accept NULL desc argument |
static int flush_pending_x87_faults(struct x86_emulate_ctxt *ctxt)
{
int rc;
ctxt->ops->get_fpu(ctxt);
rc = asm_safe("fwait");
ctxt->ops->put_fpu(ctxt);
if (unlikely(rc != X86EMUL_CONTINUE))
return emulate_exception(ctxt, MF_VECTOR, 0, false);
return X86EMUL_CONTINUE;
} | 0 | [
"CWE-284"
] | linux | 33ab91103b3415e12457e3104f0e4517ce12d0f3 | 33,321,102,639,135,080,000,000,000,000,000,000,000 | 13 | KVM: x86: fix emulation of "MOV SS, null selector"
This is CVE-2017-2583. On Intel this causes a failed vmentry because
SS's type is neither 3 nor 7 (even though the manual says this check is
only done for usable SS, and the dmesg splat says that SS is unusable!).
On AMD it's worse: svm.c is confused and sets CPL to ... |
void HeaderMapImpl::clear() {
clearInline();
headers_.clear();
cached_byte_size_ = 0;
} | 0 | [] | envoy | 2c60632d41555ec8b3d9ef5246242be637a2db0f | 306,168,561,472,669,000,000,000,000,000,000,000,000 | 5 | http: header map security fixes for duplicate headers (#197)
Previously header matching did not match on all headers for
non-inline headers. This patch changes the default behavior to
always logically match on all headers. Multiple individual
headers will be logically concatenated with ',' similar to what
is done with... |
GF_Err ftyp_box_write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
u32 i;
GF_FileTypeBox *ptr = (GF_FileTypeBox *) s;
e = gf_isom_box_write_header(s, bs);
if (e) return e;
gf_bs_write_u32(bs, ptr->majorBrand);
gf_bs_write_u32(bs, ptr->minorVersion);
for (i=0; i<ptr->altCount; i++) {
gf_bs_write_u32(bs, ptr->altB... | 0 | [
"CWE-787"
] | gpac | 388ecce75d05e11fc8496aa4857b91245007d26e | 331,121,480,050,794,300,000,000,000,000,000,000,000 | 15 | fixed #1587 |
archive_read_format_rar_seek_data(struct archive_read *a, int64_t offset,
int whence)
{
int64_t client_offset, ret;
unsigned int i;
struct rar *rar = (struct rar *)(a->format->data);
if (rar->compression_method == COMPRESS_METHOD_STORE)
{
/* Modify the offset for use with SEEK_SET */
switch (when... | 0 | [
"CWE-119",
"CWE-787"
] | libarchive | 05caadc7eedbef471ac9610809ba683f0c698700 | 191,276,710,718,262,960,000,000,000,000,000,000,000 | 152 | 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... |
static int snd_seq_deliver_single_event(struct snd_seq_client *client,
struct snd_seq_event *event,
int filter, int atomic, int hop)
{
struct snd_seq_client *dest = NULL;
struct snd_seq_client_port *dest_port = NULL;
int result = -ENOENT;
int direct;
direct = snd_seq_ev_is_direct(event);
dest = get_ev... | 0 | [
"CWE-703"
] | linux | 030e2c78d3a91dd0d27fef37e91950dde333eba1 | 59,450,599,900,935,000,000,000,000,000,000,000,000 | 56 | ALSA: seq: Fix missing NULL check at remove_events ioctl
snd_seq_ioctl_remove_events() calls snd_seq_fifo_clear()
unconditionally even if there is no FIFO assigned, and this leads to
an Oops due to NULL dereference. The fix is just to add a proper NULL
check.
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Tested-by... |
_public_ int sd_bus_set_connected_signal(sd_bus *bus, int b) {
assert_return(bus, -EINVAL);
assert_return(bus = bus_resolve(bus), -ENOPKG);
assert_return(bus->state == BUS_UNSET, -EPERM);
assert_return(!bus_pid_changed(bus), -ECHILD);
bus->connected_signal = !!b;
return ... | 0 | [
"CWE-416"
] | systemd | 1068447e6954dc6ce52f099ed174c442cb89ed54 | 231,860,202,840,721,100,000,000,000,000,000,000,000 | 9 | sd-bus: introduce API for re-enqueuing incoming messages
When authorizing via PolicyKit we want to process incoming method calls
twice: once to process and figure out that we need PK authentication,
and a second time after we aquired PK authentication to actually execute
the operation. With this new call sd_bus_enqueu... |
void seq_parameter_set::set_TB_log2size_range(int mini,int maxi)
{
log2_min_transform_block_size = mini;
log2_diff_max_min_transform_block_size = maxi-mini;
} | 0 | [
"CWE-787"
] | libde265 | 8e89fe0e175d2870c39486fdd09250b230ec10b8 | 300,181,450,398,762,760,000,000,000,000,000,000,000 | 5 | error on out-of-range cpb_cnt_minus1 (oss-fuzz issue 27590) |
move_lines(buf_T *frombuf, buf_T *tobuf)
{
buf_T *tbuf = curbuf;
int retval = OK;
linenr_T lnum;
char_u *p;
/* Copy the lines in "frombuf" to "tobuf". */
curbuf = tobuf;
for (lnum = 1; lnum <= frombuf->b_ml.ml_line_count; ++lnum)
{
p = vim_strsave(ml_get_buf(frombuf, lnum, FALSE));
i... | 0 | [
"CWE-200",
"CWE-668"
] | vim | 5a73e0ca54c77e067c3b12ea6f35e3e8681e8cf8 | 315,798,467,125,172,800,000,000,000,000,000,000,000 | 38 | patch 8.0.1263: others can read the swap file if a user is careless
Problem: Others can read the swap file if a user is careless with his
primary group.
Solution: If the group permission allows for reading but the world
permissions doesn't, make sure the group is right. |
void OAuth2Filter::onGetAccessTokenSuccess(const std::string& access_code,
const std::string& id_token,
const std::string& refresh_token,
std::chrono::seconds expires_in) {
access_token_ = ... | 0 | [
"CWE-416"
] | envoy | 7ffda4e809dec74449ebc330cebb9d2f4ab61360 | 157,522,002,912,694,100,000,000,000,000,000,000,000 | 14 | oauth2: do not blindly accept requests with a token in the Authorization headera (781)
The logic was broken because it assumed an additional call would be
performed to the auth server, which isn't the case. Per the filter
documentation, a request is only considered subsequently authenticated
if there's valid cookie th... |
R_API int r_socket_read_block(RSocket *s, ut8 *buf, int len) {
int ret = 0;
for (ret = 0; ret < len; ) {
int r = r_socket_read (s, buf + ret, len - ret);
if (r == -1) {
#if HAVE_LIB_SSL
if (SSL_get_error (s->sfd, r) == SSL_ERROR_WANT_READ) {
if (r_socket_ready (s, 1, 0) == 1) {
continue;
}
}
#e... | 0 | [
"CWE-78"
] | radare2 | 04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9 | 264,959,666,055,801,900,000,000,000,000,000,000,000 | 21 | 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... |
ServerLifecycleNotifier::HandlePtr InstanceImpl::registerCallback(Stage stage,
StageCallback callback) {
auto& callbacks = stage_callbacks_[stage];
return std::make_unique<LifecycleCallbackHandle<StageCallback>>(callbacks, callback);
} | 0 | [
"CWE-400"
] | envoy | 542f84c66e9f6479bc31c6f53157c60472b25240 | 233,643,594,883,966,870,000,000,000,000,000,000,000 | 5 | overload: Runtime configurable global connection limits (#147)
Signed-off-by: Tony Allen <tony@allen.gg> |
void getElemMatchOrPushdownDescendants(MatchExpression* node, std::vector<MatchExpression*>* out) {
if (node->getTag() && node->getTag()->getType() == TagType::OrPushdownTag) {
out->push_back(node);
} else if (node->matchType() == MatchExpression::ELEM_MATCH_OBJECT ||
node->matchType() ==... | 0 | [
"CWE-834"
] | mongo | 94d0e046baa64d1aa1a6af97e2d19bb466cc1ff5 | 234,537,332,770,948,160,000,000,000,000,000,000,000 | 16 | SERVER-38164 $or pushdown optimization does not correctly handle $not within an $elemMatch |
R_API int r_core_bin_set_env(RCore *r, RBinFile *binfile) {
RBinObject *binobj = binfile ? binfile->o: NULL;
RBinInfo *info = binobj ? binobj->info: NULL;
if (info) {
int va = info->has_va;
const char * arch = info->arch;
ut16 bits = info->bits;
ut64 baseaddr = r_bin_get_baddr (r->bin);
r_config_set_i (r->... | 0 | [
"CWE-125"
] | radare2 | 1f37c04f2a762500222dda2459e6a04646feeedf | 46,688,739,190,908,290,000,000,000,000,000,000,000 | 24 | Fix #9904 - crash in r2_hoobr_r_read_le32 (over 9000 entrypoints) and read_le oobread (#9923) |
int PKCS7_set_digest(PKCS7 *p7, const EVP_MD *md)
{
if (PKCS7_type_is_digest(p7)) {
if (!(p7->d.digest->md->parameter = ASN1_TYPE_new())) {
PKCS7err(PKCS7_F_PKCS7_SET_DIGEST, ERR_R_MALLOC_FAILURE);
return 0;
}
p7->d.digest->md->parameter->type = V_ASN1_NULL;
p... | 0 | [] | openssl | c0334c2c92dd1bc3ad8138ba6e74006c3631b0f9 | 99,068,826,012,039,780,000,000,000,000,000,000,000 | 15 | PKCS#7: avoid NULL pointer dereferences with missing content
In PKCS#7, the ASN.1 content component is optional.
This typically applies to inner content (detached signatures),
however we must also handle unexpected missing outer content
correctly.
This patch only addresses functions reachable from parsing,
decryption... |
int ldb_dn_get_extended_comp_num(struct ldb_dn *dn)
{
if ( ! ldb_dn_validate(dn)) {
return -1;
}
return dn->ext_comp_num;
} | 0 | [
"CWE-200"
] | samba | 7f51ec8c4ed9ba1f53d722e44fb6fb3cde933b72 | 45,259,874,072,529,130,000,000,000,000,000,000,000 | 7 | CVE-2015-5330: ldb_dn: simplify and fix ldb_dn_escape_internal()
Previously we relied on NUL terminated strings and jumped back and
forth between copying escaped bytes and memcpy()ing un-escaped chunks.
This simple version is easier to reason about and works with
unterminated strings. It may also be faster as it avoid... |
void imap_get_parent(const char *mbox, char delim, char *buf, size_t buflen)
{
/* Make a copy of the mailbox name, but only if the pointers are different */
if (mbox != buf)
mutt_str_copy(buf, mbox, buflen);
int n = mutt_str_len(buf);
/* Let's go backwards until the next delimiter
*
* If buf[n] is a... | 0 | [
"CWE-125"
] | neomutt | fa1db5785e5cfd9d3cd27b7571b9fe268d2ec2dc | 143,020,363,752,895,000,000,000,000,000,000,000,000 | 31 | Fix seqset iterator when it ends in a comma
If the seqset ended with a comma, the substr_end marker would be just
before the trailing nul. In the next call, the loop to skip the
marker would iterate right past the end of string too.
The fix is simple: place the substr_end marker and skip past it
immediately. |
static pj_status_t ssl_do_handshake(pj_ssl_sock_t *ssock)
{
ossl_sock_t *ossock = (ossl_sock_t *)ssock;
pj_status_t status;
int err;
/* Perform SSL handshake */
pj_lock_acquire(ssock->write_mutex);
err = SSL_do_handshake(ossock->ossl_ssl);
pj_lock_release(ssock->write_mutex);
/* SSL_do... | 0 | [
"CWE-362",
"CWE-703"
] | pjproject | d5f95aa066f878b0aef6a64e60b61e8626e664cd | 295,662,942,928,312,780,000,000,000,000,000,000,000 | 37 | Merge pull request from GHSA-cv8x-p47p-99wr
* - Avoid SSL socket parent/listener getting destroyed during handshake by increasing parent's reference count.
- Add missing SSL socket close when the newly accepted SSL socket is discarded in SIP TLS transport.
* - Fix silly mistake: accepted active socket created without... |
void dpy_gl_ctx_destroy(QemuConsole *con, QEMUGLContext ctx)
{
assert(con->gl);
con->gl->ops->dpy_gl_ctx_destroy(con->gl, ctx);
} | 0 | [
"CWE-416"
] | qemu | a4afa548fc6dd9842ed86639b4d37d4d1c4ad480 | 338,523,614,243,551,740,000,000,000,000,000,000,000 | 5 | char: move front end handlers in CharBackend
Since the hanlders are associated with a CharBackend, rather than the
CharDriverState, it is more appropriate to store in CharBackend. This
avoids the handler copy dance in qemu_chr_fe_set_handlers() then
mux_chr_update_read_handler(), by storing the CharBackend pointer
dir... |
static double mp_self_bitwise_or(_cimg_math_parser& mp) {
double &val = _mp_arg(1);
return val = (double)((longT)val | (longT)_mp_arg(2)); | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 60,705,174,599,560,370,000,000,000,000,000,000,000 | 4 | Fix other issues in 'CImg<T>::load_bmp()'. |
int setup_ui_method(void)
{
ui_method = UI_create_method("OpenSSL application user interface");
UI_method_set_opener(ui_method, ui_open);
UI_method_set_reader(ui_method, ui_read);
UI_method_set_writer(ui_method, ui_write);
UI_method_set_closer(ui_method, ui_close);
return 0;
} | 0 | [] | openssl | a70da5b3ecc3160368529677006801c58cb369db | 281,433,086,369,651,120,000,000,000,000,000,000,000 | 9 | New functions to check a hostname email or IP address against a
certificate. Add options to s_client, s_server and x509 utilities
to print results of checks. |
static inline size_t xfrm_sa_len(struct xfrm_state *x)
{
size_t 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 += nla_total_s... | 0 | [
"CWE-264"
] | net | 90f62cf30a78721641e08737bda787552428061e | 72,727,723,525,290,580,000,000,000,000,000,000,000 | 33 | 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 void emit_bpf_tail_call_direct(struct bpf_jit_poke_descriptor *poke,
u8 **pprog, int addr, u8 *image,
bool *callee_regs_used, u32 stack_depth)
{
int tcc_off = -4 - round_up(stack_depth, 8);
u8 *prog = *pprog;
int pop_bytes = 0;
int off1 = 20;
int poke_off;
int cnt = 0;
/* count the ad... | 0 | [
"CWE-77"
] | linux | e4d4d456436bfb2fe412ee2cd489f7658449b098 | 2,876,051,313,119,000,400,000,000,000,000,000,000 | 62 | bpf, x86: Validate computation of branch displacements for x86-64
The branch displacement logic in the BPF JIT compilers for x86 assumes
that, for any generated branch instruction, the distance cannot
increase between optimization passes.
But this assumption can be violated due to how the distances are
computed. Spec... |
static void iattr_to_fattr(struct fuse_conn *fc, struct iattr *iattr,
struct fuse_setattr_in *arg, bool trust_local_cmtime)
{
unsigned ivalid = iattr->ia_valid;
if (ivalid & ATTR_MODE)
arg->valid |= FATTR_MODE, arg->mode = iattr->ia_mode;
if (ivalid & ATTR_UID)
arg->valid |= FATTR_UID, arg->uid = fro... | 0 | [
"CWE-459"
] | linux | 5d069dbe8aaf2a197142558b6fb2978189ba3454 | 72,075,864,780,034,220,000,000,000,000,000,000,000 | 33 | fuse: fix bad inode
Jan Kara's analysis of the syzbot report (edited):
The reproducer opens a directory on FUSE filesystem, it then attaches
dnotify mark to the open directory. After that a fuse_do_getattr() call
finds that attributes returned by the server are inconsistent, and calls
make_bad_inode() which,... |
void vrend_set_tess_state(UNUSED struct vrend_context *ctx, const float tess_factors[6])
{
if (has_feature(feat_tessellation)) {
if (!vrend_state.use_gles) {
glPatchParameterfv(GL_PATCH_DEFAULT_OUTER_LEVEL, tess_factors);
glPatchParameterfv(GL_PATCH_DEFAULT_INNER_LEVEL, &tess_factors[4]);
... | 0 | [
"CWE-787"
] | virglrenderer | cbc8d8b75be360236cada63784046688aeb6d921 | 101,177,214,147,638,680,000,000,000,000,000,000,000 | 11 | vrend: check transfer bounds for negative values too and report error
Closes #138
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com> |
static int cpu_shares_write_uint(struct cgroup *cgrp, struct cftype *cftype,
u64 shareval)
{
return sched_group_set_shares(cgroup_tg(cgrp), shareval);
} | 0 | [] | linux-2.6 | 8f1bc385cfbab474db6c27b5af1e439614f3025c | 253,102,871,804,469,900,000,000,000,000,000,000,000 | 5 | sched: fair: weight calculations
In order to level the hierarchy, we need to calculate load based on the
root view. That is, each task's load is in the same unit.
A
/ \
B 1
/ \
2 3
To compute 1's load we do:
weight(1)
--------------
rq_weight(A)
To ... |
int php_module_shutdown_wrapper(sapi_module_struct *sapi_globals)
{
php_module_shutdown();
return SUCCESS;
} | 0 | [] | php-src | 9a07245b728714de09361ea16b9c6fcf70cb5685 | 87,622,482,530,967,570,000,000,000,000,000,000,000 | 5 | Fixed bug #71273 A wrong ext directory setup in php.ini leads to crash |
ffs_fs_kill_sb(struct super_block *sb)
{
ENTER();
kill_litter_super(sb);
if (sb->s_fs_info) {
ffs_release_dev(sb->s_fs_info);
ffs_data_closed(sb->s_fs_info);
ffs_data_put(sb->s_fs_info);
}
} | 0 | [
"CWE-416",
"CWE-362"
] | linux | 38740a5b87d53ceb89eb2c970150f6e94e00373a | 56,817,304,301,397,460,000,000,000,000,000,000,000 | 11 | usb: gadget: f_fs: Fix use-after-free
When using asynchronous read or write operations on the USB endpoints the
issuer of the IO request is notified by calling the ki_complete() callback
of the submitted kiocb when the URB has been completed.
Calling this ki_complete() callback will free kiocb. Make sure that the
str... |
static const char *func_id_name(int id)
{
BUILD_BUG_ON(ARRAY_SIZE(func_id_str) != __BPF_FUNC_MAX_ID);
if (id >= 0 && id < __BPF_FUNC_MAX_ID && func_id_str[id])
return func_id_str[id];
else
return "unknown";
} | 0 | [
"CWE-200"
] | linux | 0d0e57697f162da4aa218b5feafe614fb666db07 | 127,697,952,206,217,560,000,000,000,000,000,000,000 | 9 | bpf: don't let ldimm64 leak map addresses on unprivileged
The patch fixes two things at once:
1) It checks the env->allow_ptr_leaks and only prints the map address to
the log if we have the privileges to do so, otherwise it just dumps 0
as we would when kptr_restrict is enabled on %pK. Given the latter is
of... |
goa_utils_keyfile_set_boolean (GoaAccount *account, const gchar *key, gboolean value)
{
GError *error;
GKeyFile *key_file;
gchar *contents;
gchar *group;
gchar *path;
gsize length;
contents = NULL;
path = g_strdup_printf ("%s/goa-1.0/accounts.conf", g_get_user_config_dir ());
group = g_strdup_printf... | 0 | [
"CWE-310"
] | gnome-online-accounts | edde7c63326242a60a075341d3fea0be0bc4d80e | 217,126,147,435,805,270,000,000,000,000,000,000,000 | 48 | Guard against invalid SSL certificates
None of the branded providers (eg., Google, Facebook and Windows Live)
should ever have an invalid certificate. So set "ssl-strict" on the
SoupSession object being used by GoaWebView.
Providers like ownCloud and Exchange might have to deal with
certificates that are not up to th... |
abandon_cmdline(void)
{
VIM_CLEAR(ccline.cmdbuff);
if (msg_scrolled == 0)
compute_cmdrow();
msg("");
redraw_cmdline = TRUE;
} | 0 | [
"CWE-122",
"CWE-787"
] | vim | 85b6747abc15a7a81086db31289cf1b8b17e6cb1 | 12,189,494,339,543,424,000,000,000,000,000,000,000 | 8 | patch 8.2.4214: illegal memory access with large 'tabstop' in Ex mode
Problem: Illegal memory access with large 'tabstop' in Ex mode.
Solution: Allocate enough memory. |
static s32 gf_media_vvc_read_vps_bs_internal(GF_BitStream *bs, VVCState *vvc, Bool stop_at_vps_ext)
{
u32 i, j;
s32 vps_id;
VVC_VPS *vps;
Bool vps_default_ptl_dpb_hrd_max_tid_flag=0;
//nalu header already parsed
vps_id = gf_bs_read_int_log(bs, 4, "vps_id");
if ((vps_id<0) || (vps_id >= 16)) return -1;
if (!vps... | 0 | [
"CWE-190",
"CWE-787"
] | gpac | 51cdb67ff7c5f1242ac58c5aa603ceaf1793b788 | 187,951,357,298,057,500,000,000,000,000,000,000,000 | 88 | add safety in avc/hevc/vvc sps/pps/vps ID check - cf #1720 #1721 #1722 |
correlation_coefficient(double sxx, double syy, double sxy)
{
double coe, tmp;
tmp = sxx * syy;
if (tmp < Tiny)
tmp = Tiny;
coe = sxy / sqrt(tmp);
if (coe > 1.)
return 1.;
if (coe < -1.)
return -1.;
return coe;
} | 0 | [
"CWE-119"
] | w3m | 67a3db378f5ee3047c158eae4342f7e3245a2ab1 | 228,716,102,704,351,830,000,000,000,000,000,000,000 | 13 | Fix table rowspan and colspan
Origin: https://github.com/tats/w3m/pull/19
Bug-Debian: https://github.com/tats/w3m/issues/8 |
server_client_suspend(struct client *c)
{
struct session *s = c->session;
if (s == NULL || (c->flags & CLIENT_DETACHING))
return;
tty_stop_tty(&c->tty);
c->flags |= CLIENT_SUSPENDED;
proc_send(c->peer, MSG_SUSPEND, -1, NULL, 0);
} | 0 | [] | src | b32e1d34e10a0da806823f57f02a4ae6e93d756e | 237,287,119,811,900,170,000,000,000,000,000,000,000 | 11 | evbuffer_new and bufferevent_new can both fail (when malloc fails) and
return NULL. GitHub issue 1547. |
onig_global_callout_names_free(void)
{
free_callout_func_list(GlobalCalloutNameList);
GlobalCalloutNameList = 0;
global_callout_name_table_free();
return ONIG_NORMAL;
} | 0 | [
"CWE-400",
"CWE-399",
"CWE-674"
] | oniguruma | 4097828d7cc87589864fecf452f2cd46c5f37180 | 59,930,580,043,408,250,000,000,000,000,000,000,000 | 8 | fix #147: Stack Exhaustion Problem caused by some parsing functions in regcomp.c making recursive calls to themselves. |
CJSON_PUBLIC(void) cJSON_DeleteItemFromObject(cJSON *object, const char *string)
{
cJSON_Delete(cJSON_DetachItemFromObject(object, string));
} | 0 | [
"CWE-754",
"CWE-787"
] | cJSON | be749d7efa7c9021da746e685bd6dec79f9dd99b | 329,136,467,871,654,200,000,000,000,000,000,000,000 | 4 | Fix crash of cJSON_GetObjectItemCaseSensitive when calling it on arrays |
void child_process_clear(struct child_process *child)
{
argv_array_clear(&child->args);
argv_array_clear(&child->env_array);
} | 0 | [] | git | 321fd82389742398d2924640ce3a61791fd27d60 | 61,275,820,500,831,800,000,000,000,000,000,000,000 | 5 | run-command: mark path lookup errors with ENOENT
Since commit e3a434468f (run-command: use the
async-signal-safe execv instead of execvp, 2017-04-19),
prepare_cmd() does its own PATH lookup for any commands we
run (on non-Windows platforms).
However, its logic does not match the old execvp call when
we fail to find a... |
ImagingNewArray(const char *mode, int xsize, int ysize)
{
Imaging im;
ImagingSectionCookie cookie;
int y;
char* p;
im = ImagingNewPrologue(mode, xsize, ysize);
if (!im)
return NULL;
ImagingSectionEnter(&cookie);
/* Allocate image as an array of lines */
for (y = 0; y < im... | 0 | [
"CWE-284"
] | Pillow | 5d8a0be45aad78c5a22c8d099118ee26ef8144af | 274,060,827,322,753,200,000,000,000,000,000,000,000 | 32 | Memory error in Storage.c when accepting negative image size arguments |
static int vhost_worker(void *data)
{
struct vhost_dev *dev = data;
struct vhost_work *work, *work_next;
struct llist_node *node;
mm_segment_t oldfs = get_fs();
set_fs(USER_DS);
use_mm(dev->mm);
for (;;) {
/* mb paired w/ kthread_stop */
set_current_state(TASK_INTERRUPTIBLE);
if (kthread_should_stop()) ... | 0 | [
"CWE-120"
] | linux | 060423bfdee3f8bc6e2c1bac97de24d5415e2bc4 | 241,720,952,644,208,950,000,000,000,000,000,000,000 | 38 | vhost: make sure log_num < in_num
The code assumes log_num < in_num everywhere, and that is true as long as
in_num is incremented by descriptor iov count, and log_num by 1. However
this breaks if there's a zero sized descriptor.
As a result, if a malicious guest creates a vring desc with desc.len = 0,
it may cause th... |
static int fts3RollbackMethod(sqlite3_vtab *pVtab){
Fts3Table *p = (Fts3Table*)pVtab;
sqlite3Fts3PendingTermsClear(p);
assert( p->inTransaction!=0 );
TESTONLY( p->inTransaction = 0 );
TESTONLY( p->mxSavepoint = -1; );
return SQLITE_OK;
} | 0 | [
"CWE-787"
] | sqlite | c72f2fb7feff582444b8ffdc6c900c69847ce8a9 | 194,959,407,062,163,650,000,000,000,000,000,000,000 | 8 | More improvements to shadow table corruption detection in FTS3.
FossilOrigin-Name: 51525f9c3235967bc00a090e84c70a6400698c897aa4742e817121c725b8c99d |
attributeCertificateExactNormalize(
slap_mask_t usage,
Syntax *syntax,
MatchingRule *mr,
struct berval *val,
struct berval *normalized,
void *ctx )
{
BerElementBuffer berbuf;
BerElement *ber = (BerElement *)&berbuf;
ber_tag_t tag;
ber_len_t len;
char issuer_serialbuf[SLAP_SN_BUFLEN], serialbuf[SLAP_SN_BUFLEN... | 0 | [
"CWE-617"
] | openldap | 3539fc33212b528c56b716584f2c2994af7c30b0 | 274,125,306,659,879,100,000,000,000,000,000,000,000 | 118 | ITS#9454 fix issuerAndThisUpdateCheck |
static void jpc_qcc_destroyparms(jpc_ms_t *ms)
{
jpc_qcc_t *qcc = &ms->parms.qcc;
jpc_qcx_destroycompparms(&qcc->compparms);
} | 0 | [] | jasper | 4031ca321d8cb5798c316ab39c7a5dc88a61fdd7 | 82,327,777,048,794,720,000,000,000,000,000,000,000 | 5 | Incorporated changes from patch
jasper-1.900.3-libjasper-stepsizes-overflow.patch |
void *X509_STORE_CTX_get_ex_data(X509_STORE_CTX *ctx, int idx)
{
return CRYPTO_get_ex_data(&ctx->ex_data, idx);
} | 0 | [
"CWE-119"
] | openssl | 370ac320301e28bb615cee80124c042649c95d14 | 311,417,332,860,164,700,000,000,000,000,000,000,000 | 4 | Fix length checks in X509_cmp_time to avoid out-of-bounds reads.
Also tighten X509_cmp_time to reject more than three fractional
seconds in the time; and to reject trailing garbage after the offset.
CVE-2015-1789
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org> |
message_add_date (mu_message_t msg)
{
mu_header_t hdr;
char buf[MU_DATETIME_RFC822_LENGTH+1];
struct tm ltm;
time_t t;
int rc;
rc = mu_message_get_header (msg, &hdr);
if (rc)
{
mu_diag_funcall (MU_DIAG_ERROR, "mu_message_get_header", NULL, rc);
return;
}
t = time (NULL);
localt... | 0 | [] | mailutils | 4befcfd015256c568121653038accbd84820198f | 1,955,786,356,151,080,000,000,000,000,000,000,000 | 23 | 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. |
static int sched_rt_global_constraints(void)
{
unsigned long flags;
int i;
spin_lock_irqsave(&def_rt_bandwidth.rt_runtime_lock, flags);
for_each_possible_cpu(i) {
struct rt_rq *rt_rq = &cpu_rq(i)->rt;
spin_lock(&rt_rq->rt_runtime_lock);
rt_rq->rt_runtime = global_rt_runtime();
spin_unlock(&rt_rq->rt_runti... | 0 | [] | linux-2.6 | 8f1bc385cfbab474db6c27b5af1e439614f3025c | 204,622,566,499,479,100,000,000,000,000,000,000,000 | 17 | sched: fair: weight calculations
In order to level the hierarchy, we need to calculate load based on the
root view. That is, each task's load is in the same unit.
A
/ \
B 1
/ \
2 3
To compute 1's load we do:
weight(1)
--------------
rq_weight(A)
To ... |
getJsmnType(const ParseCtx *parseCtx) {
if(parseCtx->index >= parseCtx->tokenCount)
return JSMN_UNDEFINED;
return parseCtx->tokenArray[parseCtx->index].type;
} | 0 | [
"CWE-703",
"CWE-787"
] | open62541 | c800e2987b10bb3af6ef644b515b5d6392f8861d | 51,204,856,751,650,530,000,000,000,000,000,000,000 | 5 | fix(json): Check max recursion depth in more places |
read_layer_block (FILE *f,
gint image_ID,
guint total_len,
PSPimage *ia)
{
gint i;
long block_start, sub_block_start, channel_start;
gint sub_id;
guint32 sub_init_len, sub_total_len;
gchar *name = NULL;
guint16 namelen;
guchar type, opacit... | 0 | [
"CWE-125"
] | gimp | eb2980683e6472aff35a3117587c4f814515c74d | 265,376,429,059,256,680,000,000,000,000,000,000,000 | 316 | Bug 790853 - (CVE-2017-17787) heap overread in psp importer.
As any external data, we have to check that strings being read at fixed
length are properly nul-terminated. |
gx_ttfReader *gx_ttfReader__create(gs_memory_t *mem)
{
gx_ttfReader *r = gs_alloc_struct(mem, gx_ttfReader, &st_gx_ttfReader, "gx_ttfReader__create");
if (r != NULL) {
r->super.Eof = gx_ttfReader__Eof;
r->super.Read = gx_ttfReader__Read;
r->super.Seek = gx_ttfReader__Seek;
r->su... | 0 | [
"CWE-125"
] | ghostpdl | 937ccd17ac65935633b2ebc06cb7089b91e17e6b | 237,985,100,204,944,450,000,000,000,000,000,000,000 | 22 | Bug 698056: make bounds check in gx_ttfReader__Read more robust |
const string name() override { return "complete_multipart"; } | 0 | [
"CWE-770"
] | ceph | ab29bed2fc9f961fe895de1086a8208e21ddaddc | 292,355,334,234,175,800,000,000,000,000,000,000,000 | 1 | rgw: fix issues with 'enforce bounds' patch
The patch to enforce bounds on max-keys/max-uploads/max-parts had a few
issues that would prevent us from compiling it. Instead of changing the
code provided by the submitter, we're addressing them in a separate
commit to maintain the DCO.
Signed-off-by: Joao Eduardo Luis <... |
int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
size_t num, const EC_POINT *points[], const BIGNUM *scalars[],
BN_CTX *ctx)
{
const EC_POINT *generator = NULL;
EC_POINT *tmp = NULL;
size_t totalnum;
size_t blocksize = 0, numblocks = 0; /* for wNA... | 0 | [
"CWE-327",
"CWE-320"
] | openssl | b1d6d55ece1c26fa2829e2b819b038d7b6d692b4 | 129,859,981,798,289,770,000,000,000,000,000,000,000 | 383 | Timing vulnerability in ECDSA signature generation (CVE-2018-0735)
Preallocate an extra limb for some of the big numbers to avoid a reallocation
that can potentially provide a side channel.
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/7486)
(cherry pick... |
static dma_addr_t __intel_map_single(struct device *dev, phys_addr_t paddr,
size_t size, int dir, u64 dma_mask)
{
struct dmar_domain *domain;
phys_addr_t start_paddr;
unsigned long iova_pfn;
int prot = 0;
int ret;
struct intel_iommu *iommu;
unsigned long paddr_pfn = paddr >> PAGE_SHIFT;
BUG_ON(dir == ... | 0 | [] | linux | fb58fdcd295b914ece1d829b24df00a17a9624bc | 283,049,073,282,824,240,000,000,000,000,000,000,000 | 58 | iommu/vt-d: Do not enable ATS for untrusted devices
Currently Linux automatically enables ATS (Address Translation Service)
for any device that supports it (and IOMMU is turned on). ATS is used to
accelerate DMA access as the device can cache translations locally so
there is no need to do full translation on IOMMU sid... |
static char *get_frame_label(int type) {
static char label[128];
int nf = egg->lang.nfunctions;
int nb = egg->lang.nbrackets;
int ct = context;
/* TODO: this type hack to substruct nb and ctx looks weird */
#if 1
if (type == 1) {
nb--;
} else if (type == 2) {
ct--;
}
#endif
/* THIS IS GAS_ONLY */
snprintf... | 0 | [
"CWE-416"
] | radare2 | 93af319e0af787ede96537d46210369f5c24240c | 64,887,660,470,703,560,000,000,000,000,000,000,000 | 17 | Fix #14296 - Segfault in ragg2 (#14308) |
static int peak_usb_create_dev(const struct peak_usb_adapter *peak_usb_adapter,
struct usb_interface *intf, int ctrl_idx)
{
struct usb_device *usb_dev = interface_to_usbdev(intf);
int sizeof_candev = peak_usb_adapter->sizeof_dev_private;
struct peak_usb_device *dev;
struct net_device *netdev;
int i, err;... | 1 | [
"CWE-909"
] | linux | f7a1337f0d29b98733c8824e165fca3371d7d4fd | 337,480,791,575,728,400,000,000,000,000,000,000,000 | 112 | can: peak_usb: fix slab info leak
Fix a small slab info leak due to a failure to clear the command buffer
at allocation.
The first 16 bytes of the command buffer are always sent to the device
in pcan_usb_send_cmd() even though only the first two may have been
initialised in case no argument payload is provided (e.g. ... |
_lyd_insert_hash(struct lyd_node *node, int keyless_list_check)
{
struct lyd_node *iter;
int i;
if (node->parent) {
if ((node->schema->nodetype != LYS_LIST) || lyd_list_has_keys(node)) {
if ((node->schema->nodetype == LYS_LEAF) && lys_is_key((struct lys_node_leaf *)node->schema, NULL)) ... | 0 | [
"CWE-119"
] | libyang | 32fb4993bc8bb49e93e84016af3c10ea53964be5 | 285,987,883,810,735,970,000,000,000,000,000,000,000 | 51 | schema tree BUGFIX do not check features while still resolving schema
Fixes #723 |
static int setup_kmem_cache_nodes(struct kmem_cache *cachep, gfp_t gfp)
{
int ret;
int node;
struct kmem_cache_node *n;
for_each_online_node(node) {
ret = setup_kmem_cache_node(cachep, node, gfp, true);
if (ret)
goto fail;
}
return 0;
fail:
if (!cachep->list.next) {
/* Cache is not active yet. Roll ... | 0 | [
"CWE-703"
] | linux | c4e490cf148e85ead0d1b1c2caaba833f1d5b29f | 254,959,806,428,147,870,000,000,000,000,000,000,000 | 32 | mm/slab.c: fix SLAB freelist randomization duplicate entries
This patch fixes a bug in the freelist randomization code. When a high
random number is used, the freelist will contain duplicate entries. It
will result in different allocations sharing the same chunk.
It will result in odd behaviours and crashes. It sh... |
static inline void nm_order(NM *low, NM *high) {
if(u128_cmp((*low)->neta, (*high)->neta) > 0) {
NM tmp = *low;
*low = *high;
*high = tmp;
}
} | 0 | [] | netmask | 29a9c239bd1008363f5b34ffd6c2cef906f3660c | 146,878,439,598,457,090,000,000,000,000,000,000,000 | 7 | bump version to 2.4.4
* remove checks for negative unsigned ints, fixes #2
* harden error logging functions, fixes #3 |
struct inode *proc_pid_make_inode(struct super_block * sb,
struct task_struct *task, umode_t mode)
{
struct inode * inode;
struct proc_inode *ei;
/* We need a new inode */
inode = new_inode(sb);
if (!inode)
goto out;
/* Common stuff */
ei = PROC_I(inode);
inode->i_mode = mode;
inode->i_ino = get_nex... | 0 | [
"CWE-119"
] | linux | 7f7ccc2ccc2e70c6054685f5e3522efa81556830 | 143,523,665,840,500,000,000,000,000,000,000,000,000 | 36 | proc: do not access cmdline nor environ from file-backed areas
proc_pid_cmdline_read() and environ_read() directly access the target
process' VM to retrieve the command line and environment. If this
process remaps these areas onto a file via mmap(), the requesting
process may experience various issues such as extra de... |
ms_escher_get_data (MSEscherState *state,
gint offset, /* bytes from logical start of the stream */
gint num_bytes, /*how many bytes we want, NOT incl prefix */
gboolean * needs_free)
{
BiffQuery *q = state->q;
guint8 *res;
g_return_val_if_fail (offset >= state->start_offset, NULL);
/* find t... | 1 | [
"CWE-119"
] | gnumeric | b5480b69345b3c6d56ee0ed9c9e9880bb2a08cdc | 257,840,832,045,771,400,000,000,000,000,000,000,000 | 94 | xls: fuzzed file crash. |
void sctp_addr_wq_mgmt(struct net *net, struct sctp_sockaddr_entry *addr, int cmd)
{
struct sctp_sockaddr_entry *addrw;
unsigned long timeo_val;
/* first, we check if an opposite message already exist in the queue.
* If we found such message, it is removed.
* This operation is a bit stupid, but the DHCP client ... | 0 | [
"CWE-119",
"CWE-787"
] | linux | 8e2d61e0aed2b7c4ecb35844fe07e0b2b762dee4 | 309,540,950,325,623,580,000,000,000,000,000,000,000 | 46 | sctp: fix race on protocol/netns initialization
Consider sctp module is unloaded and is being requested because an user
is creating a sctp socket.
During initialization, sctp will add the new protocol type and then
initialize pernet subsys:
status = sctp_v4_protosw_init();
if (status)
... |
static int set_journal_csum_feature_set(struct super_block *sb)
{
int ret = 1;
int compat, incompat;
struct ext4_sb_info *sbi = EXT4_SB(sb);
if (ext4_has_metadata_csum(sb)) {
/* journal checksum v3 */
compat = 0;
incompat = JBD2_FEATURE_INCOMPAT_CSUM_V3;
} else {
/* journal checksum v1 */
compat = JBD2_... | 0 | [
"CWE-362"
] | linux | ea3d7209ca01da209cda6f0dea8be9cc4b7a933b | 146,552,137,835,944,850,000,000,000,000,000,000 | 38 | ext4: fix races between page faults and hole punching
Currently, page faults and hole punching are completely unsynchronized.
This can result in page fault faulting in a page into a range that we
are punching after truncate_pagecache_range() has been called and thus
we can end up with a page mapped to disk blocks that... |
void ass_blur1246_vert_c(int16_t *dst, const int16_t *src,
uintptr_t src_width, uintptr_t src_height,
const int16_t *param)
{
uintptr_t dst_height = src_height + 12;
uintptr_t step = STRIPE_WIDTH * src_height;
for (uintptr_t x = 0; x < src_width; x += STRIP... | 0 | [
"CWE-119",
"CWE-787"
] | libass | 08e754612019ed84d1db0d1fc4f5798248decd75 | 31,465,668,515,541,167,000,000,000,000,000,000,000 | 28 | Fix blur coefficient calculation buffer overflow
Found by fuzzer test case id:000082,sig:11,src:002579,op:havoc,rep:8.
Correctness should be checked, but this fixes the overflow for good. |
zroute_lookup(u_int zroute)
{
u_int i;
if (zroute >= sizeof(route_types)/sizeof(route_types[0]))
{
zlog_err("unknown zebra route type: %u", zroute);
return &unknown;
}
if (zroute == route_types[zroute].type)
return &route_types[zroute];
for (i = 0; i < sizeof(route_types)/sizeof(route_t... | 0 | [
"CWE-125"
] | frr | 6d58272b4cf96f0daa846210dd2104877900f921 | 86,967,922,627,418,260,000,000,000,000,000,000,000 | 23 | [bgpd] cleanup, compact and consolidate capability parsing code
2007-07-26 Paul Jakma <paul.jakma@sun.com>
* (general) Clean up and compact capability parsing slightly.
Consolidate validation of length and logging of generic TLV, and
memcpy of capability data, thus removing such from cap specifc
code (not a... |
static struct sk_buff *__skb_udp_tunnel_segment(struct sk_buff *skb,
netdev_features_t features,
struct sk_buff *(*gso_inner_segment)(struct sk_buff *skb,
netdev_features_t features),
__be16 new_protocol, bool is_ipv6)
{
int tnl_hlen = skb_inner_mac_header(skb) - skb_transport_header(skb);
bool remcsum, ... | 0 | [
"CWE-400",
"CWE-703"
] | linux | fac8e0f579695a3ecbc4d3cac369139d7f819971 | 260,311,272,867,991,450,000,000,000,000,000,000,000 | 114 | tunnels: Don't apply GRO to multiple layers of encapsulation.
When drivers express support for TSO of encapsulated packets, they
only mean that they can do it for one layer of encapsulation.
Supporting additional levels would mean updating, at a minimum,
more IP length fields and they are unaware of this.
No encapsul... |
STATIC int GC_hblk_fl_from_blocks(word blocks_needed)
{
if (blocks_needed <= UNIQUE_THRESHOLD) return (int)blocks_needed;
if (blocks_needed >= HUGE_THRESHOLD) return N_HBLK_FLS;
return (int)(blocks_needed - UNIQUE_THRESHOLD)/FL_COMPRESSION
+ UNIQUE_THRESHOLD;
} | 0 | [
"CWE-119"
] | bdwgc | 7292c02fac2066d39dd1bcc37d1a7054fd1e32ee | 64,099,042,106,534,220,000,000,000,000,000,000,000 | 8 | 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... |
pdf14_spot_get_color_comp_index(gx_device *dev, const char *pname,
int name_size, int component_type, int num_process_colors)
{
pdf14_device *pdev = (pdf14_device *)dev;
gx_device *tdev = pdev->target;
gs_devn_params *pdevn_params = &pdev->devn_params;
gs_separations *pseparations;
int comp_inde... | 0 | [] | ghostpdl | c432131c3fdb2143e148e8ba88555f7f7a63b25e | 331,480,083,711,168,840,000,000,000,000,000,000,000 | 92 | Bug 699661: Avoid sharing pointers between pdf14 compositors
If a copdevice is triggered when the pdf14 compositor is the device, we make
a copy of the device, then throw an error because, by default we're only allowed
to copy the device prototype - then freeing it calls the finalize, which frees
several pointers shar... |
void FilterManager::contextOnContinue(ScopeTrackedObjectStack& tracked_object_stack) {
tracked_object_stack.add(connection_);
tracked_object_stack.add(filter_manager_callbacks_.scope());
} | 0 | [
"CWE-416"
] | envoy | 148de954ed3585d8b4298b424aa24916d0de6136 | 332,350,549,121,030,300,000,000,000,000,000,000,000 | 4 | CVE-2021-43825
Response filter manager crash
Signed-off-by: Yan Avlasov <yavlasov@google.com> |
static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
{
xmlNodePtr xmlParam;
HashTable *prop = NULL;
int i;
sdlTypePtr sdlType = type->sdl_type;
if (!data || Z_TYPE_P(data) == IS_NULL) {
xmlParam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, xmlPa... | 0 | [
"CWE-19"
] | php-src | c8eaca013a3922e8383def6158ece2b63f6ec483 | 175,743,267,038,816,780,000,000,000,000,000,000,000 | 199 | Added type checks |
static int gtextfield_focus(GGadget *g, GEvent *event) {
GTextField *gt = (GTextField *) g;
if ( g->state == gs_invisible || g->state == gs_disabled )
return( false );
if ( gt->cursor!=NULL ) {
GDrawCancelTimer(gt->cursor);
gt->cursor = NULL;
gt->cursor_on = false;
}
if ( gt->hidden_cursor && !... | 0 | [
"CWE-119",
"CWE-787"
] | fontforge | 626f751752875a0ddd74b9e217b6f4828713573c | 24,082,460,988,952,600,000,000,000,000,000,000,000 | 30 | Warn users before discarding their unsaved scripts (#3852)
* Warn users before discarding their unsaved scripts
This closes #3846. |
dns_transmit_free (struct dns_transmit *d)
{
queryfree (d);
socketfree (d);
packetfree (d);
} | 0 | [
"CWE-362"
] | ndjbdns | 177b5522e9b3d25778001c8cebfddd4d2973fcfd | 7,787,545,845,369,236,000,000,000,000,000,000,000 | 6 | Merge identical outgoing requests - patch 2.
This patch fixes dnscache to combine *same* client queries into one
single outgoing request, thus securing the server from possible cache
poisoning attacks. The merges operation takes place in the
dns_transmit layer, rather than between query and dns_transmit layers,
as don... |
static inline enum fbq_type fbq_classify_rq(struct rq *rq)
{
if (rq->nr_running > rq->nr_numa_running)
return regular;
if (rq->nr_running > rq->nr_preferred_running)
return remote;
return all;
} | 0 | [
"CWE-400",
"CWE-703",
"CWE-835"
] | linux | c40f7d74c741a907cfaeb73a7697081881c497d0 | 219,370,794,266,081,640,000,000,000,000,000,000,000 | 8 | sched/fair: Fix infinite loop in update_blocked_averages() by reverting a9e7f6544b9c
Zhipeng Xie, Xie XiuQi and Sargun Dhillon reported lockups in the
scheduler under high loads, starting at around the v4.18 time frame,
and Zhipeng Xie tracked it down to bugs in the rq->leaf_cfs_rq_list
manipulation.
Do a (manual) re... |
static int jpc_coc_dumpparms(jpc_ms_t *ms, FILE *out)
{
jpc_coc_t *coc = &ms->parms.coc;
fprintf(out, "compno = %"PRIuFAST16"; csty = 0x%02x; numdlvls = %d;\n",
coc->compno, coc->compparms.csty, coc->compparms.numdlvls);
fprintf(out, "cblkwidthval = %d; cblkheightval = %d; "
"cblksty = 0x%02x; qmfbid = %d;\n",... | 0 | [
"CWE-20",
"CWE-399"
] | jasper | ba2b9d000660313af7b692542afbd374c5685865 | 336,695,328,501,029,900,000,000,000,000,000,000,000 | 10 | Ensure that not all tiles lie outside the image area. |
word_list_split (list)
WORD_LIST *list;
{
WORD_LIST *result, *t, *tresult, *e;
for (t = list, result = (WORD_LIST *)NULL; t; t = t->next)
{
tresult = word_split (t->word, ifs_value);
if (result == 0)
result = e = tresult;
else
{
e->next = tresult;
while (e->next)
e = ... | 0 | [] | bash | 955543877583837c85470f7fb8a97b7aa8d45e6c | 86,480,590,485,243,530,000,000,000,000,000,000,000 | 19 | bash-4.4-rc2 release |
uint offset(uchar *record) const
{
return (uint) (ptr - record);
} | 0 | [
"CWE-416",
"CWE-703"
] | server | 08c7ab404f69d9c4ca6ca7a9cf7eec74c804f917 | 169,200,847,404,871,860,000,000,000,000,000,000,000 | 4 | MDEV-24176 Server crashes after insert in the table with virtual
column generated using date_format() and if()
vcol_info->expr is allocated on expr_arena at parsing stage. Since
expr item is allocated on expr_arena all its containee items must be
allocated on expr_arena too. Otherwise fix_session_expr() will
encounter... |
static void ftrace_profile_reset(struct ftrace_profile_stat *stat)
{
struct ftrace_profile_page *pg;
pg = stat->pages = stat->start;
while (pg) {
memset(pg->records, 0, PROFILE_RECORDS_SIZE);
pg->index = 0;
pg = pg->next;
}
memset(stat->hash, 0,
FTRACE_PROFILE_HASH_SIZE * sizeof(struct hlist_head)... | 0 | [
"CWE-703"
] | linux | 6a76f8c0ab19f215af2a3442870eeb5f0e81998d | 325,589,909,986,693,250,000,000,000,000,000,000,000 | 15 | 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... |
static int mxf_parse_structural_metadata(MXFContext *mxf)
{
MXFPackage *material_package = NULL;
MXFPackage *temp_package = NULL;
int i, j, k, ret;
av_dlog(mxf->fc, "metadata sets count %d\n", mxf->metadata_sets_count);
/* TODO: handle multiple material packages (OP3x) */
for (i = 0; i < mxf->p... | 0 | [
"CWE-703"
] | FFmpeg | f173cdfe669556aa92857adafe60cbe5f2aa1210 | 245,187,236,012,802,480,000,000,000,000,000,000,000 | 331 | avformat/mxfdec: Fix DoS issues in mxf_read_index_entry_array()
Fixes: 20170829A.mxf
Co-Author: 张洪亮(望初)" <wangchu.zhl@alibaba-inc.com>
Found-by: Xiaohei and Wangchu from Alibaba Security Team
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 900f39692ca0337a98a7cf047e4e2611071810c... |
static const char * pgpValStr(pgpValTbl vs, uint8_t val)
{
do {
if (vs->val == val)
break;
} while ((++vs)->val != -1);
return vs->str;
} | 0 | [
"CWE-347",
"CWE-284"
] | rpm | bd36c5dc9fb6d90c46fbfed8c2d67516fc571ec8 | 4,205,087,090,995,429,000,000,000,000,000,000,000 | 8 | Validate and require subkey binding signatures on PGP public keys
All subkeys must be followed by a binding signature by the primary key
as per the OpenPGP RFC, enforce the presence and validity in the parser.
The implementation is as kludgey as they come to work around our
simple-minded parser structure without touc... |
static inline void ext4_decode_extra_time(struct timespec *time, __le32 extra)
{
if (sizeof(time->tv_sec) > 4)
time->tv_sec |= (__u64)(le32_to_cpu(extra) & EXT4_EPOCH_MASK)
<< 32;
time->tv_nsec = (le32_to_cpu(extra) & EXT4_NSEC_MASK) >> 2; | 0 | [
"CWE-399"
] | linux-2.6 | 06a279d636734da32bb62dd2f7b0ade666f65d7c | 3,770,292,732,448,600,000,000,000,000,000,000,000 | 7 | ext4: only use i_size_high for regular files
Directories are not allowed to be bigger than 2GB, so don't use
i_size_high for anything other than regular files. E2fsck should
complain about these inodes, but the simplest thing to do for the
kernel is to only use i_size_high for regular files.
This prevents an intenti... |
void SetDataTypeToAttr(DataType dtype, const string& attr_name, NodeDef* node) {
(*node->mutable_attr())[attr_name].set_type(dtype);
} | 0 | [
"CWE-476"
] | tensorflow | e6340f0665d53716ef3197ada88936c2a5f7a2d3 | 25,829,078,784,244,700,000,000,000,000,000,000,000 | 3 | Handle a special grappler case resulting in crash.
It might happen that a malformed input could be used to trick Grappler into trying to optimize a node with no inputs. This, in turn, would produce a null pointer dereference and a segfault.
PiperOrigin-RevId: 369242852
Change-Id: I2e5cbe7aec243d34a6d60220ac8ac9b16f13... |
static int send_msg(struct kiocb *iocb, struct socket *sock,
struct msghdr *m, size_t total_len)
{
struct sock *sk = sock->sk;
struct tipc_port *tport = tipc_sk_port(sk);
struct sockaddr_tipc *dest = (struct sockaddr_tipc *)m->msg_name;
int needs_conn;
long timeout_val;
int res = -EINVAL;
if (unlikely(!de... | 0 | [
"CWE-20",
"CWE-269"
] | linux | f3d3342602f8bcbf37d7c46641cb9bca7618eb1c | 161,381,026,077,327,930,000,000,000,000,000,000,000 | 94 | net: rework recvmsg handler msg_name and msg_namelen logic
This patch now always passes msg->msg_namelen as 0. recvmsg handlers must
set msg_namelen to the proper size <= sizeof(struct sockaddr_storage)
to return msg_name to the user.
This prevents numerous uninitialized memory leaks we had in the
recvmsg handlers an... |
aclmask_direct(const Acl *acl, Oid roleid, Oid ownerId,
AclMode mask, AclMaskHow how)
{
AclMode result;
AclItem *aidat;
int i,
num;
/*
* Null ACL should not happen, since caller should have inserted
* appropriate default
*/
if (acl == NULL)
elog(ERROR, "null ACL");
check_acl(acl);
/* Q... | 0 | [
"CWE-264"
] | postgres | fea164a72a7bfd50d77ba5fb418d357f8f2bb7d0 | 203,833,802,081,055,570,000,000,000,000,000,000,000 | 52 | Shore up ADMIN OPTION restrictions.
Granting a role without ADMIN OPTION is supposed to prevent the grantee
from adding or removing members from the granted role. Issuing SET ROLE
before the GRANT bypassed that, because the role itself had an implicit
right to add or remove members. Plug that hole by recognizing tha... |
Stream::Stream(Http2Handler *handler, int32_t stream_id)
: balloc(1024, 1024),
header{},
handler(handler),
file_ent(nullptr),
body_length(0),
body_offset(0),
header_buffer_size(0),
stream_id(stream_id),
echo_upload(false) {
auto config = handler->get_config();
ev_... | 0 | [] | nghttp2 | 95efb3e19d174354ca50c65d5d7227d92bcd60e1 | 110,001,704,945,509,040,000,000,000,000,000,000,000 | 16 | Don't read too greedily |
ex_startinsert(exarg_T *eap)
{
if (eap->forceit)
{
// cursor line can be zero on startup
if (!curwin->w_cursor.lnum)
curwin->w_cursor.lnum = 1;
set_cursor_for_append_to_line();
}
#ifdef FEAT_TERMINAL
// Ignore this when running in an active terminal.
if (term_job_running(curbuf->b_term))
re... | 0 | [
"CWE-122"
] | vim | 35a319b77f897744eec1155b736e9372c9c5575f | 259,198,561,400,060,000,000,000,000,000,000,000,000 | 37 | patch 8.2.3489: ml_get error after search with range
Problem: ml_get error after search with range.
Solution: Limit the line number to the buffer line count. |
static void vmx_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
{
struct vcpu_vmx *vmx = to_vmx(vcpu);
u64 phys_addr = __pa(per_cpu(vmxarea, cpu));
if (!vmm_exclusive)
kvm_cpu_vmxon(phys_addr);
else if (vmx->loaded_vmcs->cpu != cpu)
loaded_vmcs_clear(vmx->loaded_vmcs);
if (per_cpu(current_vmcs, cpu) != vmx->loaded... | 0 | [] | kvm | a642fc305053cc1c6e47e4f4df327895747ab485 | 311,545,832,637,719,370,000,000,000,000,000,000,000 | 47 | kvm: vmx: handle invvpid vm exit gracefully
On systems with invvpid instruction support (corresponding bit in
IA32_VMX_EPT_VPID_CAP MSR is set) guest invocation of invvpid
causes vm exit, which is currently not handled and results in
propagation of unknown exit to userspace.
Fix this by installing an invvpid vm exit ... |
static void h2_session_ev_conn_error(h2_session *session, int arg, const char *msg)
{
switch (session->state) {
case H2_SESSION_ST_INIT:
case H2_SESSION_ST_DONE:
/* just leave */
transit(session, "conn error", H2_SESSION_ST_DONE);
break;
default:
... | 0 | [] | mod_h2 | 5e75e5685dd043fe93a5a08a15edd087a43f6968 | 75,843,014,729,313,780,000,000,000,000,000,000,000 | 17 | v1.11.0
--------------------------------------------------------------------------------
* connection IO event handling reworked. Instead of reacting on incoming bytes, the
state machine now acts on incoming frames that are affecting it. This reduces
state transitions.
* pytest suite now covers some basic tests... |
static BROTLI_INLINE BROTLI_BOOL DecodeCommandBlockSwitchInternal(
int safe, BrotliDecoderState* s) {
if (!DecodeBlockTypeAndLength(safe, s, 1)) {
return BROTLI_FALSE;
}
s->htree_command = s->insert_copy_hgroup.htrees[s->block_type_rb[3]];
return BROTLI_TRUE;
} | 0 | [
"CWE-120"
] | brotli | 223d80cfbec8fd346e32906c732c8ede21f0cea6 | 325,762,299,558,380,060,000,000,000,000,000,000,000 | 8 | Update (#826)
* IMPORTANT: decoder: fix potential overflow when input chunk is >2GiB
* simplify max Huffman table size calculation
* eliminate symbol duplicates (static arrays in .h files)
* minor combing in research/ code |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.