func
string
target
int64
cwe
list
project
string
commit_id
string
hash
float64
size
int64
message
string
static int ext4_find_delayed_extent(struct inode *inode, struct extent_status *newes) { struct extent_status es; ext4_lblk_t block, next_del; if (newes->es_pblk == 0) { ext4_es_find_delayed_extent_range(inode, newes->es_lblk, newes->es_lblk + newes->es_len - 1, &es); /* * No extent in extent-tre...
0
[ "CWE-362" ]
linux
ea3d7209ca01da209cda6f0dea8be9cc4b7a933b
241,018,629,246,517,940,000,000,000,000,000,000,000
37
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...
template<typename t> CImgDisplay& operator=(const CImg<t>& img) { return display(img);
0
[ "CWE-125" ]
CImg
10af1e8c1ad2a58a0a3342a856bae63e8f257abb
71,291,018,923,156,070,000,000,000,000,000,000,000
3
Fix other issues in 'CImg<T>::load_bmp()'.
WERROR dsdb_savereps(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ctx, struct ldb_dn *dn, const char *attr, struct repsFromToBlob *r, uint32_t count) { TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx); struct ldb_message *msg; struct ldb_message_element *el; unsigned int i; msg = ldb_msg_new(tmp_ctx); msg->dn = ...
0
[ "CWE-200" ]
samba
0a3aa5f908e351201dc9c4d4807b09ed9eedff77
201,411,208,074,556,780,000,000,000,000,000,000,000
47
CVE-2022-32746 ldb: Make use of functions for appending to an ldb_message This aims to minimise usage of the error-prone pattern of searching for a just-added message element in order to make modifications to it (and potentially finding the wrong element). BUG: https://bugzilla.samba.org/show_bug.cgi?id=15009 Signed...
int handle_data(bufferlist& bl, off_t bl_ofs, off_t bl_len) override { return op->get_data_cb(bl, bl_ofs, bl_len); }
0
[ "CWE-770" ]
ceph
ab29bed2fc9f961fe895de1086a8208e21ddaddc
205,287,796,349,997,800,000,000,000,000,000,000,000
3
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 <...
static inline int get_words(OHCIState *ohci, dma_addr_t addr, uint16_t *buf, int num) { int i; addr += ohci->localmem_base; for (i = 0; i < num; i++, buf++, addr += sizeof(*buf)) { if (dma_memory_read(ohci->as, addr, buf, sizeof(*buf))) { return -1; ...
0
[ "CWE-835" ]
qemu
95ed56939eb2eaa4e2f349fe6dcd13ca4edfd8fb
293,652,466,964,783,540,000,000,000,000,000,000,000
16
usb: ohci: limit the number of link eds The guest may builds an infinite loop with link eds. This patch limit the number of linked ed to avoid this. Signed-off-by: Li Qiang <liqiang6-s@360.cn> Message-id: 5899a02e.45ca240a.6c373.93c1@mx.google.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
static void parse_sec_attr(sc_card_t *card, sc_file_t *file, const u8 *buf, size_t len) { unsigned int op; /* list directory is not covered by ACLs - so always add an entry */ sc_file_add_acl_entry (file, SC_AC_OP_LIST_FILES, SC_AC_NONE, SC_AC_KEY_REF_NONE);...
0
[ "CWE-787" ]
OpenSC
9d294de90d1cc66956389856e60b6944b27b4817
284,667,084,980,065,300,000,000,000,000,000,000,000
62
prevent out of bounds write fixes https://oss-fuzz.com/testcase-detail/5226571123392512
sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg) { void __user *p = (void __user *)arg; int __user *ip = p; int result, val, read_only; Sg_device *sdp; Sg_fd *sfp; Sg_request *srp; unsigned long iflags; if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp))) return -ENXIO;...
0
[ "CWE-732" ]
android_kernel_xiaomi_msm8996
4e624aeb719ba0a13390f70b18f2388372614b94
11,912,360,595,371,602,000,000,000,000,000,000,000
316
ANDROID: scsi: Add segment checking in sg_read Bug: 65023233 Signed-off-by: Roberto Pereira <rpere@google.com> Change-Id: I91b6b5dbcea7c39643beffdc12a23ee3d8f8775d
struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority) { struct sock *newsk; bool is_charged = true; newsk = sk_prot_alloc(sk->sk_prot, priority, sk->sk_family); if (newsk != NULL) { struct sk_filter *filter; sock_copy(newsk, sk); newsk->sk_prot_creator = sk->sk_prot; /* SANITY */ if ...
0
[ "CWE-704" ]
linux
9d538fa60bad4f7b23193c89e843797a1cf71ef3
263,991,809,958,759,730,000,000,000,000,000,000,000
103
net: Set sk_prot_creator when cloning sockets to the right proto sk->sk_prot and sk->sk_prot_creator can differ when the app uses IPV6_ADDRFORM (transforming an IPv6-socket to an IPv4-one). Which is why sk_prot_creator is there to make sure that sk_prot_free() does the kmem_cache_free() on the right kmem_cache slab. ...
WriteControlFile(void) { int fd; char buffer[PG_CONTROL_SIZE]; /* need not be aligned */ /* * Initialize version and compatibility-check fields */ ControlFile->pg_control_version = PG_CONTROL_VERSION; ControlFile->catalog_version_no = CATALOG_VERSION_NO; ControlFile->maxAlign = MAXIMUM_ALIGNOF; Control...
0
[ "CWE-119" ]
postgres
01824385aead50e557ca1af28640460fa9877d51
36,953,578,821,802,530,000,000,000,000,000,000,000
82
Prevent potential overruns of fixed-size buffers. Coverity identified a number of places in which it couldn't prove that a string being copied into a fixed-size buffer would fit. We believe that most, perhaps all of these are in fact safe, or are copying data that is coming from a trusted source so that any overrun i...
static void mce_unmap_kpfn(unsigned long pfn) { unsigned long decoy_addr; /* * Unmap this page from the kernel 1:1 mappings to make sure * we don't log more errors because of speculative access to * the page. * We would like to just call: * set_memory_np((unsigned long)pfn_to_kaddr(pfn), 1); * but doing ...
0
[ "CWE-362" ]
linux
b3b7c4795ccab5be71f080774c45bbbcc75c2aaf
192,966,158,477,867,700,000,000,000,000,000,000,000
37
x86/MCE: Serialize sysfs changes The check_interval file in /sys/devices/system/machinecheck/machinecheck<cpu number> directory is a global timer value for MCE polling. If it is changed by one CPU, mce_restart() broadcasts the event to other CPUs to delete and restart the MCE polling timer and __mcheck_cpu_init_ti...
void MonClient::_add_conns(uint64_t global_id) { // collect the next batch of candidates who are listed right next to the ones // already tried auto get_next_batch = [this]() -> std::vector<unsigned> { std::multimap<uint16_t, unsigned> ranks_by_priority; boost::copy( monmap.mon_info | boost::adaptor...
0
[ "CWE-294" ]
ceph
6c14c2fb5650426285428dfe6ca1597e5ea1d07d
144,526,064,170,485,550,000,000,000,000,000,000,000
57
mon/MonClient: bring back CEPHX_V2 authorizer challenges Commit c58c5754dfd2 ("msg/async/ProtocolV1: use AuthServer and AuthClient") introduced a backwards compatibility issue into msgr1. To fix it, commit 321548010578 ("mon/MonClient: skip CEPHX_V2 challenge if client doesn't support it") set out to skip authorizer c...
input_reset_cell(struct input_ctx *ictx) { memcpy(&ictx->cell.cell, &grid_default_cell, sizeof ictx->cell.cell); ictx->cell.set = 0; ictx->cell.g0set = ictx->cell.g1set = 0; memcpy(&ictx->old_cell, &ictx->cell, sizeof ictx->old_cell); ictx->old_cx = 0; ictx->old_cy = 0; }
0
[]
tmux
2ffbd5b5f05dded1564ba32a6a00b0b417439b2f
301,749,122,863,254,380,000,000,000,000,000,000,000
10
When searching for tabs, start from screen width, fixes out-of-bounds read found by Kuang-che Wu.
Status ModelWeights::Initialize(OpKernelContext* const context) { OpInputList sparse_indices_inputs; TF_RETURN_IF_ERROR( context->input_list("sparse_indices", &sparse_indices_inputs)); OpInputList sparse_weights_inputs; TF_RETURN_IF_ERROR( context->input_list("sparse_weights", &sparse_weights_inputs...
0
[ "CWE-703", "CWE-125" ]
tensorflow
a4e138660270e7599793fa438cd7b2fc2ce215a6
204,965,177,866,836,920,000,000,000,000,000,000,000
70
Add remaining validation to `sdca_internal.cc` PiperOrigin-RevId: 387738010 Change-Id: I28eedcfd87a53aaf34deb075acea1f8c95470808
e1000e_write_packet_to_guest(E1000ECore *core, struct NetRxPkt *pkt, const E1000E_RxRing *rxr, const E1000E_RSSInfo *rss_info) { PCIDevice *d = core->owner; dma_addr_t base; uint8_t desc[E1000_MAX_RX_DESC_LEN]; size_t desc_size; size_t desc_o...
0
[ "CWE-835" ]
qemu
4154c7e03fa55b4cf52509a83d50d6c09d743b77
168,504,586,426,694,270,000,000,000,000,000,000,000
123
net: e1000e: fix an infinite loop issue This issue is like the issue in e1000 network card addressed in this commit: e1000: eliminate infinite loops on out-of-bounds transfer start. Signed-off-by: Li Qiang <liqiang6-s@360.cn> Reviewed-by: Dmitry Fleytman <dmitry@daynix.com> Signed-off-by: Jason Wang <jasowang@redhat....
ExprList *sqlite3ExprListDup(sqlite3 *db, ExprList *p, int flags){ ExprList *pNew; struct ExprList_item *pItem, *pOldItem; int i; Expr *pPriorSelectCol = 0; assert( db!=0 ); if( p==0 ) return 0; pNew = sqlite3DbMallocRawNN(db, sqlite3DbMallocSize(db, p)); if( pNew==0 ) return 0; pNew->nExpr = p->nExpr...
0
[ "CWE-476" ]
sqlite
57f7ece78410a8aae86aa4625fb7556897db384c
74,459,218,766,382,730,000,000,000,000,000,000,000
43
Fix a problem that comes up when using generated columns that evaluate to a constant in an index and then making use of that index in a join. FossilOrigin-Name: 8b12e95fec7ce6e0de82a04ca3dfcf1a8e62e233b7382aa28a8a9be6e862b1af
TRIO_PUBLIC_STRING int trio_lower TRIO_ARGS1((target), char* target) { assert(target); return trio_span_function(target, target, trio_to_lower); }
0
[ "CWE-190", "CWE-125" ]
FreeRDP
05cd9ea2290d23931f615c1b004d4b2e69074e27
159,273,253,388,379,970,000,000,000,000,000,000,000
6
Fixed TrioParse and trio_length limts. CVE-2020-4030 thanks to @antonio-morales for finding this.
static int _hostfs_rewinddir(oe_fd_t* desc) { int ret = -1; dir_t* dir = _cast_dir(desc); if (!dir) OE_RAISE_ERRNO(OE_EINVAL); if (oe_syscall_rewinddir_ocall(dir->host_dir) != OE_OK) OE_RAISE_ERRNO(OE_EINVAL); ret = 0; done: return ret; }
0
[ "CWE-200", "CWE-552" ]
openenclave
bcac8e7acb514429fee9e0b5d0c7a0308fd4d76b
273,629,448,577,187,000,000,000,000,000,000,000,000
16
Merge pull request from GHSA-525h-wxcc-f66m Signed-off-by: Ming-Wei Shih <mishih@microsoft.com>
static struct hlist_node *get_first(struct seq_file *seq) { struct iter_state *st = seq->private; struct net *net; struct nfnl_queue_net *q; if (!st) return NULL; net = seq_file_net(seq); q = nfnl_queue_pernet(net); for (st->bucket = 0; st->bucket < INSTANCE_BUCKETS; st->bucket++) { if (!hlist_empty(&q->in...
0
[ "CWE-416" ]
net
36d5fe6a000790f56039afe26834265db0a3ad4c
133,079,209,976,055,210,000,000,000,000,000,000,000
17
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...
VirtualThreadPacketReader(uint8_t stream_id, Sirikata::MuxReader * mr, VP8ComponentDecoder::SendToVirtualThread*base) { this->base = base; this->stream_id = stream_id; this->mux_reader_ = mr; last = NULL; }
0
[ "CWE-1187" ]
lepton
82167c144a322cc956da45407f6dce8d4303d346
295,929,143,425,926,150,000,000,000,000,000,000,000
6
fix #87 : always check that threads_required set up the appropriate number of threads---fire off nop functions on unused threads for consistency
typedef struct { GF_Fraction64 period_start; const char *period_id; } PeriodInfo; static u32 dasher_period_count(GF_List *streams_in /*GF_DashStream*/) { u32 nb_periods, i, j; PeriodInfo *info; GF_List *pinfos = gf_list_new(); for (i=0; i < gf_list_count(streams_in); i++) { Bool same_period = GF_FALSE; GF_...
0
[ "CWE-787" ]
gpac
ea1eca00fd92fa17f0e25ac25652622924a9a6a0
284,790,351,338,142,250,000,000,000,000,000,000,000
42
fixed #2138
ALWAYS_INLINE void MulAdd(const Packet a, const bfloat16** binp, float** out) { auto inp = reinterpret_cast<const float*>(*binp); const auto b = LOAD(inp); EXPAND_BFLOAT_L(b, b_0); EXPAND_BFLOAT_U(b, b_1); *binp += 2 * kNumOperands; auto c1 = LOAD(*out); auto c2 = LOAD(*out + kNumOperands); FMA(a, b_0, ...
0
[ "CWE-125" ]
tensorflow
e6cf28c72ba2eb949ca950d834dd6d66bb01cfae
232,225,578,688,348,600,000,000,000,000,000,000,000
14
Validate that matrix dimension sizes in SparseMatMul are positive. PiperOrigin-RevId: 401149683 Change-Id: Ib33eafc561a39c8741ece80b2edce6d4aae9a57d
int gnutls_pcert_import_openpgp (gnutls_pcert_st* pcert, gnutls_openpgp_crt_t crt, unsigned int flags) { int ret; size_t sz; memset(pcert, 0, sizeof(*pcert)); pcert->type = GNUTLS_CRT_OPENPGP; pcert->cert.data = NULL; sz = 0; ret = gnutls_openpgp_crt_export(crt, GNUTLS_OPENPGP_FMT_RAW, NULL, &sz); if (r...
1
[ "CWE-399" ]
gnutls
9c62f4feb2bdd6fbbb06eb0c60bfdea80d21bbb8
232,099,906,775,437,980,000,000,000,000,000,000,000
56
Deinitialize the correct number of certificates. Reported by Remi Gacogne.
int wc_RsaPSS_Verify_ex(byte* in, word32 inLen, byte* out, word32 outLen, enum wc_HashType hash, int mgf, int saltLen, RsaKey* key) { WC_RNG* rng; #ifdef WC_RSA_BLINDING rng = key->rng; #else rng = NULL; #endif return RsaPrivateDecryptEx(in, inLen, out, ou...
0
[ "CWE-310", "CWE-787" ]
wolfssl
fb2288c46dd4c864b78f00a47a364b96a09a5c0f
255,001,962,891,198,000,000,000,000,000,000,000,000
14
RSA-PSS: Handle edge case with encoding message to hash When the key is small relative to the digest (1024-bit key, 64-byte hash, 61-byte salt length), the internal message to hash is larger than the output size. Allocate a buffer for the message when this happens.
static ZIPARCHIVE_METHOD(unchangeName) { struct zip *intern; zval *self = getThis(); struct zip_stat sb; char *name; size_t name_len; if (!self) { RETURN_FALSE; } ZIP_FROM_OBJECT(intern, self); if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) { return; } if (name_len < 1)...
0
[ "CWE-190" ]
php-src
3b8d4de300854b3517c7acb239b84f7726c1353c
199,243,026,272,495,570,000,000,000,000,000,000,000
30
Fix bug #71923 - integer overflow in ZipArchive::getFrom*
enum nss_status _nss_mymachines_getpwuid_r( uid_t uid, struct passwd *pwd, char *buffer, size_t buflen, int *errnop) { _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; _cleanup_bus_message_unref_ sd_bus_message* reply = NUL...
0
[ "CWE-415", "CWE-119" ]
systemd
cb31827d62066a04b02111df3052949fda4b6888
209,411,555,129,403,440,000,000,000,000,000,000,000
70
nss-mymachines: do not allow overlong machine names https://github.com/systemd/systemd/issues/2002
int sqlite3CheckObjectName( Parse *pParse, /* Parsing context */ const char *zName, /* Name of the object to check */ const char *zType, /* Type of this object */ const char *zTblName /* Parent table name for triggers and indexes */ ){ sqlite3 *db = pParse->db; if( sqlite3Writa...
1
[]
sqlite
527cbd4a104cb93bf3994b3dd3619a6299a78b13
117,415,989,088,592,900,000,000,000,000,000,000,000
32
Do not allow CREATE TABLE or CREATE VIEW of an object with a name that looks like a shadow table name. FossilOrigin-Name: 6aef58b629d89955f85f65191ba2be67b2adfac4f0327fe9a7141cb2705dbc00
int mwifiex_set_mgmt_ies(struct mwifiex_private *priv, struct cfg80211_beacon_data *info) { int ret; ret = mwifiex_uap_parse_tail_ies(priv, info); if (ret) return ret; return mwifiex_set_mgmt_beacon_data_ies(priv, info); }
0
[ "CWE-120", "CWE-787" ]
linux
7caac62ed598a196d6ddf8d9c121e12e082cac3a
103,442,851,495,791,420,000,000,000,000,000,000,000
12
mwifiex: Fix three heap overflow at parsing element in cfg80211_ap_settings mwifiex_update_vs_ie(),mwifiex_set_uap_rates() and mwifiex_set_wmm_params() call memcpy() without checking the destination size.Since the source is given from user-space, this may trigger a heap buffer overflow. Fix them by putting the length...
propname2ctype(ScanEnv* env, const char* propname) { UChar* name = (UChar* )propname; UChar* name_end = name + strlen(propname); int ctype = env->enc->property_name_to_ctype(ONIG_ENCODING_ASCII, name, name_end); if (ctype < 0) { onig_scan_env_set_error_string(env, ctype, name, name_end); } return ...
0
[ "CWE-476" ]
Onigmo
00cc7e28a3ed54b3b512ef3b58ea737a57acf1f9
235,768,030,182,268,370,000,000,000,000,000,000,000
11
Fix SEGV in onig_error_code_to_str() (Fix #132) When onig_new(ONIG_SYNTAX_PERL) fails with ONIGERR_INVALID_GROUP_NAME, onig_error_code_to_str() crashes. onig_scan_env_set_error_string() should have been used when returning ONIGERR_INVALID_GROUP_NAME.
void cpu_exec_initfn(CPUState *cpu) { cpu->num_ases = 1; cpu->as = &(cpu->uc->address_space_memory); cpu->memory = cpu->uc->system_memory; }
0
[ "CWE-476" ]
unicorn
3d3deac5e6d38602b689c4fef5dac004f07a2e63
135,113,085,536,011,530,000,000,000,000,000,000,000
6
Fix crash when mapping a big memory and calling uc_close
void Compute(OpKernelContext* context) override { const Tensor& data = context->input(0); const Tensor& weights = context->input(1); bool use_weights = weights.NumElements() > 0; OP_REQUIRES(context, TensorShapeUtils::IsVector(data.shape()) || TensorShapeUtils::IsM...
0
[ "CWE-369" ]
tensorflow
da5ff2daf618591f64b2b62d9d9803951b945e9f
100,130,268,272,273,820,000,000,000,000,000,000,000
63
Fix FPE issue with `tf.raw_ops.DenseCountSparseOutput`. PiperOrigin-RevId: 370946862 Change-Id: I3752584ad04aaecb327ff6793a9640ac56acfe7a
xmlXPathFreeObject(xmlXPathObjectPtr obj) { if (obj == NULL) return; if ((obj->type == XPATH_NODESET) || (obj->type == XPATH_XSLT_TREE)) { if (obj->boolval) { #if 0 if (obj->user != NULL) { xmlXPathFreeNodeSet(obj->nodesetval); xmlFreeNodeList((xmlNodePtr) obj->user); } else #endif ...
0
[ "CWE-119" ]
libxml2
91d19754d46acd4a639a8b9e31f50f31c78f8c9c
334,835,543,352,256,530,000,000,000,000,000,000,000
31
Fix the semantic of XPath axis for namespace/attribute context nodes The processing of namespace and attributes nodes was not compliant to the XPath-1.0 specification
static inline void io_init_req_batch(struct req_batch *rb) { rb->to_free = 0; rb->task_refs = 0; rb->task = NULL; }
0
[]
linux
0f2122045b946241a9e549c2a76cea54fa58a7ff
45,428,686,322,211,055,000,000,000,000,000,000,000
6
io_uring: don't rely on weak ->files references Grab actual references to the files_struct. To avoid circular references issues due to this, we add a per-task note that keeps track of what io_uring contexts a task has used. When the tasks execs or exits its assigned files, we cancel requests based on this tracking. W...
void sctp_inq_push(struct sctp_inq *q, struct sctp_chunk *chunk) { /* Directly call the packet handling routine. */ if (chunk->rcvr->dead) { sctp_chunk_free(chunk); return; } /* We are now calling this either from the soft interrupt * or from the backlog processing. * Eventually, we should clean up inqueue...
1
[]
linux
196d67593439b03088913227093e374235596e33
336,909,108,859,073,450,000,000,000,000,000,000,000
16
sctp: Add support to per-association statistics via a new SCTP_GET_ASSOC_STATS call The current SCTP stack is lacking a mechanism to have per association statistics. This is an implementation modeled after OpenSolaris' SCTP_GET_ASSOC_STATS. Userspace part will follow on lksctp if/when there is a general ACK on this. ...
static void tcp_update_skb_after_send(struct sock *sk, struct sk_buff *skb, u64 prior_wstamp) { struct tcp_sock *tp = tcp_sk(sk); if (sk->sk_pacing_status != SK_PACING_NONE) { unsigned long rate = sk->sk_pacing_rate; /* Original sch_fq does not pace first 10 MSS * Note that tp->data_segs_out overfl...
0
[ "CWE-190" ]
net
3b4929f65b0d8249f19a50245cd88ed1a2f78cff
13,133,865,659,895,996,000,000,000,000,000,000,000
23
tcp: limit payload size of sacked skbs Jonathan Looney reported that TCP can trigger the following crash in tcp_shifted_skb() : BUG_ON(tcp_skb_pcount(skb) < pcount); This can happen if the remote peer has advertized the smallest MSS that linux TCP accepts : 48 An skb can hold 17 fragments, and each fragment can ho...
int ath6kl_wmi_ap_set_beacon_intvl_cmd(struct wmi *wmi, u8 if_idx, u32 beacon_intvl) { struct sk_buff *skb; struct set_beacon_int_cmd *cmd; skb = ath6kl_wmi_get_new_buf(sizeof(*cmd)); if (!skb) return -ENOMEM; cmd = (struct set_beacon_int_cmd *) skb->data; cmd->beacon_intvl = cpu_to_le32(beacon_in...
0
[ "CWE-125" ]
linux
5d6751eaff672ea77642e74e92e6c0ac7f9709ab
69,705,637,879,149,680,000,000,000,000,000,000,000
16
ath6kl: add some bounds checking The "ev->traffic_class" and "reply->ac" variables come from the network and they're used as an offset into the wmi->stream_exist_for_ac[] array. Those variables are u8 so they can be 0-255 but the stream_exist_for_ac[] array only has WMM_NUM_AC (4) elements. We need to add a couple bo...
static void __init init_mount_tree(void) { struct vfsmount *mnt; struct mnt_namespace *ns; mnt = do_kern_mount("rootfs", 0, "rootfs", NULL); if (IS_ERR(mnt)) panic("Can't create rootfs"); ns = kmalloc(sizeof(*ns), GFP_KERNEL); if (!ns) panic("Can't allocate initial namespace"); atomic_set(&ns->count, 1); I...
0
[ "CWE-269" ]
linux-2.6
ee6f958291e2a768fd727e7a67badfff0b67711a
297,573,248,824,917,050,000,000,000,000,000,000,000
25
check privileges before setting mount propagation There's a missing check for CAP_SYS_ADMIN in do_change_type(). Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torva...
static bool send_version(struct pool *pool, json_t *val) { char s[RBUFSIZE]; int id = json_integer_value(json_object_get(val, "id")); if (!id) return false; sprintf(s, "{\"id\": %d, \"result\": \""PACKAGE"/"VERSION"\", \"error\": null}", id); if (!stratum_send(pool, s, strlen(s))) return false; return true...
0
[ "CWE-20", "CWE-703" ]
sgminer
910c36089940e81fb85c65b8e63dcd2fac71470c
329,338,727,316,890,160,000,000,000,000,000,000,000
14
stratum: parse_notify(): Don't die on malformed bbversion/prev_hash/nbit/ntime. Might have introduced a memory leak, don't have time to check. :( Should the other hex2bin()'s be checked? Thanks to Mick Ayzenberg <mick.dejavusecurity.com> for finding this.
int nntp_post(const char *msg) { struct NntpData *nntp_data, nntp_tmp; char buf[LONG_STRING]; if (Context && Context->magic == MUTT_NNTP) nntp_data = Context->data; else { CurrentNewsSrv = nntp_select_server(NewsServer, false); if (!CurrentNewsSrv) return -1; nntp_data = &nntp_tmp; ...
0
[ "CWE-20" ]
neomutt
9e927affe3a021175f354af5fa01d22657c20585
278,325,596,342,126,900,000,000,000,000,000,000,000
73
Add alloc fail check in nntp_fetch_headers
f_test_setmouse(typval_T *argvars, typval_T *rettv UNUSED) { if (in_vim9script() && (check_for_number_arg(argvars, 0) == FAIL || check_for_number_arg(argvars, 1) == FAIL)) return; if (argvars[0].v_type != VAR_NUMBER || (argvars[1].v_type) != VAR_NUMBER) { emsg(_(e_invalid_argument)); return; ...
0
[ "CWE-121", "CWE-787" ]
vim
34f8117dec685ace52cd9e578e2729db278163fc
283,865,023,235,463,570,000,000,000,000,000,000,000
16
patch 8.2.4397: crash when using many composing characters in error message Problem: Crash when using many composing characters in error message. Solution: Use mb_cptr2char_adv() instead of mb_ptr2char_adv().
static void lsr_read_eRR(GF_LASeRCodec *lsr, GF_Node *elt) { u32 err; GF_LSR_READ_INT(lsr, err, 1, "externalResourcesRequired"); if (err) { GF_FieldInfo info; lsr->last_error = gf_node_get_attribute_by_tag(elt, TAG_SVG_ATT_externalResourcesRequired, 1, 0, &info); *(SVG_Boolean*)info.far_ptr = 1; } }
0
[ "CWE-190" ]
gpac
faa75edde3dfeba1e2cf6ffa48e45a50f1042096
177,153,458,616,066,670,000,000,000,000,000,000,000
10
fixed #2213
static void _xml_xmlchar_zval(const XML_Char *s, int len, const XML_Char *encoding, zval *ret) { if (s == NULL) { ZVAL_FALSE(ret); return; } if (len == 0) { len = _xml_xmlcharlen(s); } ZVAL_STR(ret, xml_utf8_decode(s, len, encoding)); }
0
[ "CWE-190" ]
php-src
57b997ebf99e0eb9a073e0dafd2ab100bd4a112d
252,980,176,395,153,230,000,000,000,000,000,000,000
11
Fix bug #71637: Multiple Heap Overflow due to integer overflows
static int cit_read_reg(struct gspca_dev *gspca_dev, u16 index, int verbose) { struct usb_device *udev = gspca_dev->dev; __u8 *buf = gspca_dev->usb_buf; int res; res = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 0x01, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT, 0x00, index, buf, 8, 1000); if (res...
0
[ "CWE-476" ]
linux
a246b4d547708f33ff4d4b9a7a5dbac741dc89d8
257,467,439,010,783,880,000,000,000,000,000,000,000
21
media: xirlink_cit: add missing descriptor sanity checks Make sure to check that we have two alternate settings and at least one endpoint before accessing the second altsetting structure and dereferencing the endpoint arrays. This specifically avoids dereferencing NULL-pointers or corrupting memory when a device does...
static int ieee80211_set_cqm_rssi_config(struct wiphy *wiphy, struct net_device *dev, s32 rssi_thold, u32 rssi_hyst) { struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); struct ieee80211_vif *vif = &sdata->vif; struct ieee80211_bss_conf *bss_conf = &vif->bss_conf; if (rssi_thold == bss...
0
[ "CWE-287" ]
linux
3e493173b7841259a08c5c8e5cbe90adb349da7e
183,331,285,006,417,300,000,000,000,000,000,000,000
29
mac80211: Do not send Layer 2 Update frame before authorization The Layer 2 Update frame is used to update bridges when a station roams to another AP even if that STA does not transmit any frames after the reassociation. This behavior was described in IEEE Std 802.11F-2003 as something that would happen based on MLME-...
static bool kvm_page_in_dirty_ring(struct kvm *kvm, unsigned long pgoff) { #if KVM_DIRTY_LOG_PAGE_OFFSET > 0 return (pgoff >= KVM_DIRTY_LOG_PAGE_OFFSET) && (pgoff < KVM_DIRTY_LOG_PAGE_OFFSET + kvm->dirty_ring_size / PAGE_SIZE); #else return false; #endif }
0
[ "CWE-119" ]
linux
f8be156be163a052a067306417cd0ff679068c97
75,809,192,281,798,340,000,000,000,000,000,000,000
10
KVM: do not allow mapping valid but non-reference-counted pages It's possible to create a region which maps valid but non-refcounted pages (e.g., tail pages of non-compound higher order allocations). These host pages can then be returned by gfn_to_page, gfn_to_pfn, etc., family of APIs, which take a reference to the p...
find_command(exarg_T *eap, int *full UNUSED) { int len; char_u *p; int i; /* * Isolate the command and search for it in the command table. * Exceptions: * - the 'k' command can directly be followed by any character. * - the 's' command can be followed directly by 'c', 'g', 'i', 'I...
0
[ "CWE-78" ]
vim
8c62a08faf89663e5633dc5036cd8695c80f1075
39,811,639,975,753,293,000,000,000,000,000,000
113
patch 8.1.0881: can execute shell commands in rvim through interfaces Problem: Can execute shell commands in rvim through interfaces. Solution: Disable using interfaces in restricted mode. Allow for writing file with writefile(), histadd() and a few others.
int __init fib6_init(void) { int ret = -ENOMEM; fib6_node_kmem = kmem_cache_create("fib6_nodes", sizeof(struct fib6_node), 0, SLAB_HWCACHE_ALIGN, NULL); if (!fib6_node_kmem) goto out; ret = register_pernet_subsys(&fib6_net_ops); if (ret) goto out_kmem_cache_create; ret = rtnl_regist...
0
[ "CWE-755" ]
linux
7b09c2d052db4b4ad0b27b97918b46a7746966fa
13,015,520,839,928,960,000,000,000,000,000,000,000
30
ipv6: fix a typo in fib6_rule_lookup() Yi Ren reported an issue discovered by syzkaller, and bisected to the cited commit. Many thanks to Yi, this trivial patch does not reflect the patient work that has been done. Fixes: d64a1f574a29 ("ipv6: honor RT6_LOOKUP_F_DST_NOREF in rule lookup logic") Signed-off-by: Eric Du...
long kvm_arch_vm_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg) { struct kvm *kvm = filp->private_data; void __user *argp = (void __user *)arg; int r = -ENOTTY; /* * This union makes it completely explicit to gcc-3.x * that these two variables' stack usage should be * combined, not a...
0
[ "CWE-476" ]
linux
e97f852fd4561e77721bb9a4e0ea9d98305b1e93
177,338,333,303,927,250,000,000,000,000,000,000,000
312
KVM: X86: Fix scan ioapic use-before-initialization Reported by syzkaller: BUG: unable to handle kernel NULL pointer dereference at 00000000000001c8 PGD 80000003ec4da067 P4D 80000003ec4da067 PUD 3f7bfa067 PMD 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 7 PID: 5059 Comm: debug Tainted: G OE 4.19.0-rc5 #16...
entering_window(win_T *win) { // Only matters for a prompt window. if (!bt_prompt(win->w_buffer)) return; // When switching to a prompt buffer that was in Insert mode, don't stop // Insert mode, it may have been set in leaving_window(). if (win->w_buffer->b_prompt_insert != NUL) stop_insert_mode ...
0
[ "CWE-476" ]
vim
0f6e28f686dbb59ab3b562408ab9b2234797b9b1
28,332,160,702,044,835,000,000,000,000,000,000,000
16
patch 8.2.4428: crash when switching tabpage while in the cmdline window Problem: Crash when switching tabpage while in the cmdline window. Solution: Disallow switching tabpage when in the cmdline window.
static void ieee80211_rx_handlers(struct ieee80211_rx_data *rx, struct sk_buff_head *frames) { ieee80211_rx_result res = RX_DROP_MONITOR; struct sk_buff *skb; #define CALL_RXH(rxh) \ do { \ res = rxh(rx); \ if (res != RX_CONTINUE) \ goto rxh_next; \ } while (0) /* Lock here to avoid hitting a...
0
[]
linux
588f7d39b3592a36fb7702ae3b8bdd9be4621e2f
30,050,753,744,273,700,000,000,000,000,000,000,000
62
mac80211: drop robust management frames from unknown TA When receiving a robust management frame, drop it if we don't have rx->sta since then we don't have a security association and thus couldn't possibly validate the frame. Cc: stable@vger.kernel.org Signed-off-by: Johannes Berg <johannes.berg@intel.com>
static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) { BMPInfo bmp_info; Image *image; MagickBooleanType status; MagickOffsetType offset, start_position; MemoryInfo *pixel_info; Quantum index; register Quantum *q; register ssize_t i,...
1
[ "CWE-787" ]
ImageMagick
ae04fa4be910255e5d363edebd77adeee99a525d
233,159,568,862,512,000,000,000,000,000,000,000,000
965
https://github.com/ImageMagick/ImageMagick/issues/1177
R_API ut64 r_bin_java_local_variable_table_attr_calc_size(RBinJavaAttrInfo *attr) { ut64 size = 0; // ut64 offset = 0; RListIter *iter; // RBinJavaLocalVariableAttribute *lvattr; if (!attr) { return 0LL; } size += 6; // attr->info.local_variable_table_attr.table_length = R_BIN_JAVA_USHORT (buffer, offset); s...
0
[ "CWE-119", "CWE-788" ]
radare2
6c4428f018d385fc80a33ecddcb37becea685dd5
261,913,213,456,655,420,000,000,000,000,000,000,000
26
Improve boundary checks to fix oobread segfaults ##crash * Reported by Cen Zhang via huntr.dev * Reproducer: bins/fuzzed/javaoob-havoc.class
CWD_API void realpath_cache_del(const char *path, int path_len TSRMLS_DC) /* {{{ */ { #ifdef PHP_WIN32 unsigned long key = realpath_cache_key(path, path_len TSRMLS_CC); #else unsigned long key = realpath_cache_key(path, path_len); #endif unsigned long n = key % (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_ca...
1
[ "CWE-190" ]
php-src
0218acb7e756a469099c4ccfb22bce6c2bd1ef87
324,255,597,646,772,940,000,000,000,000,000,000,000
30
Fix for bug #72513
process_bmpcache2(STREAM s, uint16 flags, RD_BOOL compressed) { RD_HBITMAP bitmap; int y; uint8 cache_id, cache_idx_low, width, height, Bpp; uint16 cache_idx, bufsize; uint8 *data, *bmpdata, *bitmap_id; bitmap_id = NULL; /* prevent compiler warning */ cache_id = flags & ID_MASK; Bpp = ((flags & MODE_MASK) >> M...
0
[ "CWE-787" ]
rdesktop
766ebcf6f23ccfe8323ac10242ae6e127d4505d2
258,502,136,407,436,440,000,000,000,000,000,000,000
77
Malicious RDP server security fixes This commit includes fixes for a set of 21 vulnerabilities in rdesktop when a malicious RDP server is used. All vulnerabilities was identified and reported by Eyal Itkin. * Add rdp_protocol_error function that is used in several fixes * Refactor of process_bitmap_updates * Fix pos...
void yr_re_ast_destroy( RE_AST* re_ast) { if (re_ast->root_node != NULL) yr_re_node_destroy(re_ast->root_node); yr_free(re_ast); }
0
[ "CWE-125" ]
yara
83d799804648c2a0895d40a19835d9b757c6fa4e
330,127,623,815,529,130,000,000,000,000,000,000,000
8
Fix issue #646 (#648) * Fix issue #646 and some edge cases with wide regexps using \b and \B * Rename function IS_WORD_CHAR to _yr_re_is_word_char
* Common for date_sunrise() and date_sunset() functions */ static void php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAMETERS, int calc_sunset) { double latitude = 0.0, longitude = 0.0, zenith = 0.0, gmt_offset = 0, altitude; double h_rise, h_set, N; timelib_sll rise, set, transit; long time, retformat = 0; in...
0
[]
php-src
bb057498f7457e8b2eba98332a3bad434de4cf12
76,367,501,024,093,420,000,000,000,000,000,000,000
82
Fix #70277: new DateTimeZone($foo) is ignoring text after null byte The DateTimeZone constructors are not binary safe. They're parsing the timezone as string, but discard the length when calling timezone_initialize(). This patch adds a tz_len parameter and a respective check to timezone_initialize().
static void tag_pool_dirty(PgPool *pool) { struct List *item, *tmp; struct PgSocket *server; /* reset welcome msg */ if (pool->welcome_msg) { pktbuf_free(pool->welcome_msg); pool->welcome_msg = NULL; } pool->welcome_msg_ready = 0; /* drop all existing servers ASAP */ for_each_server(pool, tag_dirty); /*...
0
[]
pgbouncer
4b92112b820830b30cd7bc91bef3dd8f35305525
9,916,364,735,040,464,000,000,000,000,000,000,000
21
add_database: fail gracefully if too long db name Truncating & adding can lead to fatal() later. It was not an issue before, but with audodb (* in [databases] section) the database name can some from network, thus allowing remote shutdown..
void unregister_one_node(int nid) { if (!node_devices[nid]) return; unregister_node(node_devices[nid]); node_devices[nid] = NULL; }
0
[ "CWE-787" ]
linux
aa838896d87af561a33ecefea1caa4c15a68bc47
202,601,834,082,759,570,000,000,000,000,000,000,000
8
drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions Convert the various sprintf fmaily calls in sysfs device show functions to sysfs_emit and sysfs_emit_at for PAGE_SIZE buffer safety. Done with: $ spatch -sp-file sysfs_emit_dev.cocci --in-place --max-width=80 . And cocci script: $ cat s...
TEST_F(EncryptionUtilTest, sm4_test_by_case) { std::string case_1 = "P/Ub8/arZ22TW+rAT5sgYg=="; // base64 for encrypted "hello, doris" std::string source_1 = "hello, doris"; std::string case_2 = "2I+UW9axOP2Tv35BGYgy+g=="; // base64 for encrypted "doris test" std::string source_2 = "doris test"; st...
0
[ "CWE-200" ]
incubator-doris
246ac4e37aa4da6836b7850cb990f02d1c3725a3
259,293,920,983,708,100,000,000,000,000,000,000,000
26
[fix] fix a bug of encryption function with iv may return wrong result (#8277)
static int rsa_pub_encode(X509_PUBKEY *pk, const EVP_PKEY *pkey) { unsigned char *penc = NULL; int penclen; penclen = i2d_RSAPublicKey(pkey->pkey.rsa, &penc); if (penclen <= 0) return 0; if (X509_PUBKEY_set0_param(pk, OBJ_nid2obj(EVP_PKEY_RSA), V_ASN1_NULL, NUL...
0
[]
openssl
4b22cce3812052fe64fc3f6d58d8cc884e3cb834
17,873,518,699,628,115,000,000,000,000,000,000,000
14
Reject invalid PSS parameters. Fix a bug where invalid PSS parameters are not rejected resulting in a NULL pointer exception. This can be triggered during certificate verification so could be a DoS attack against a client or a server enabling client authentication. Thanks to Brian Carpenter for reporting this issues....
void BytecodeModuleGenerator::setFunctionGenerator( Function *F, unique_ptr<BytecodeFunctionGenerator> BFG) { assert( functionGenerators_.find(F) == functionGenerators_.end() && "Adding same function twice."); functionGenerators_[F] = std::move(BFG); }
0
[ "CWE-125", "CWE-787" ]
hermes
091835377369c8fd5917d9b87acffa721ad2a168
214,799,270,241,452,230,000,000,000,000,000,000,000
8
Correctly restore whether or not a function is an inner generator Summary: If a generator was large enough to be lazily compiled, we would lose that information when reconstituting the function's context. This meant the function was generated as a regular function instead of a generator. #utd-hermes-ignore-android R...
void mono_reflection_setup_generic_class (MonoReflectionTypeBuilder *tb) {
0
[ "CWE-20" ]
mono
4905ef1130feb26c3150b28b97e4a96752e0d399
40,748,541,846,180,168,000,000,000,000,000,000,000
3
Handle invalid instantiation of generic methods. * verify.c: Add new function to internal verifier API to check method instantiations. * reflection.c (mono_reflection_bind_generic_method_parameters): Check the instantiation before returning it. Fixes #655847
GF_Err gf_isom_get_pssh(GF_ISOFile *file, u32 pssh_index, u8 **pssh_data, u32 *pssh_size) { GF_Err e; u32 i=0; GF_BitStream *bs; u32 count=1; GF_Box *pssh; while ((pssh = (GF_Box *)gf_list_enum(file->moov->child_boxes, &i))) { if (pssh->type != GF_ISOM_BOX_TYPE_PSSH) continue; if (count == pssh_index) break; ...
0
[ "CWE-787" ]
gpac
f0a41d178a2dc5ac185506d9fa0b0a58356b16f7
19,159,853,865,584,944,000,000,000,000,000,000,000
21
fixed #2120
int CodedSizeLengthSigned(int64 Length, unsigned int SizeLength) { unsigned int CodedSize; // prepare the head of the size (000...01xxxxxx) // optimal size if (Length > -64 && Length < 64) // 2^6 CodedSize = 1; else if (Length > -8192 && Length < 8192) // 2^13 CodedSize = 2; else if (Length > -10485...
0
[ "CWE-200" ]
libebml
24e5cd7c666b1ddd85619d60486db0a5481c1b90
49,491,516,684,760,770,000,000,000,000,000,000,000
22
EbmlElement: don't read beyond end of buffer when reading variable length integers
static int sg_emulated_host(struct request_queue *q, int __user *p) { return put_user(1, p); }
0
[ "CWE-399" ]
linux-2.6
f2f1fa78a155524b849edf359e42a3001ea652c0
221,537,137,532,059,500,000,000,000,000,000,000
4
Enforce a minimum SG_IO timeout There's no point in having too short SG_IO timeouts, since if the command does end up timing out, we'll end up through the reset sequence that is several seconds long in order to abort the command that timed out. As a result, shorter timeouts than a few seconds simply do not make sense...
static int compute_code (RCore* core) { int code = 0; SdbListIter *iter; RIOMap *map; ls_foreach (core->io->maps, iter, map) { if (map->perm & R_PERM_X) { code += map->itv.size; } } return code; }
0
[ "CWE-703", "CWE-908" ]
radare2
4d3811681a80f92a53e795f6a64c4b0fc2c8dd22
136,481,189,615,541,060,000,000,000,000,000,000,000
11
Fix segfault in adf (#16230)
void setGradientDescentIterations(int val) CV_OVERRIDE { grad_descent_iter = val; }
0
[ "CWE-125", "CWE-369" ]
opencv
d1615ba11a93062b1429fce9f0f638d1572d3418
23,258,147,921,578,430,000,000,000,000,000,000,000
1
video:fixed DISOpticalFlow segfault from small img
static int virtio_net_handle_rx_mode(VirtIONet *n, uint8_t cmd, struct iovec *iov, unsigned int iov_cnt) { uint8_t on; size_t s; NetClientState *nc = qemu_get_queue(n->nic); s = iov_to_buf(iov, iov_cnt, 0, &on, sizeof(on)); if (s != sizeof(on)) { return ...
0
[ "CWE-119" ]
qemu
98f93ddd84800f207889491e0b5d851386b459cf
189,356,742,400,256,040,000,000,000,000,000,000,000
32
virtio-net: out-of-bounds buffer write on load CVE-2013-4149 QEMU 1.3.0 out-of-bounds buffer write in virtio_net_load()@hw/net/virtio-net.c > } else if (n->mac_table.in_use) { > uint8_t *buf = g_malloc0(n->mac_table.in_use); We are allocating buffer of size n->mac_table.in_use > qemu...
PHP_FUNCTION(dns_check_record) { #ifndef MAXPACKET #define MAXPACKET 8192 /* max packet size used internally by BIND */ #endif u_char ans[MAXPACKET]; char *hostname, *rectype = NULL; int hostname_len, rectype_len = 0; int type = T_MX, i; #if defined(HAVE_DNS_SEARCH) struct sockaddr_storage from; uint32_t fromsiz...
0
[ "CWE-119", "CWE-787" ]
php-src
2fefae47716d501aec41c1102f3fd4531f070b05
106,871,357,268,352,110,000,000,000,000,000,000,000
69
Fixed Sec Bug #67717 segfault in dns_get_record CVE-2014-3597 Incomplete fix for CVE-2014-4049 Check possible buffer overflow - pass real buffer end to dn_expand calls - check buffer len before each read
OperatorShellMake(const char *operatorName, Oid operatorNamespace, Oid leftTypeId, Oid rightTypeId) { Relation pg_operator_desc; Oid operatorObjectId; int i; HeapTuple tup; Datum values[Natts_pg_operator]; bool nulls[Natts_pg_operator]; NameData oname; TupleDesc tupDesc; /* * validat...
0
[ "CWE-94" ]
postgres
7e92f78abe80e4b30e648a40073abb59057e21f8
711,073,829,281,776,800,000,000,000,000,000,000
91
In extensions, don't replace objects not belonging to the extension. Previously, if an extension script did CREATE OR REPLACE and there was an existing object not belonging to the extension, it would overwrite the object and adopt it into the extension. This is problematic, first because the overwrite is probably uni...
static pci_ers_result_t i40e_pci_error_slot_reset(struct pci_dev *pdev) { struct i40e_pf *pf = pci_get_drvdata(pdev); pci_ers_result_t result; u32 reg; dev_dbg(&pdev->dev, "%s\n", __func__); if (pci_enable_device_mem(pdev)) { dev_info(&pdev->dev, "Cannot re-enable PCI device after reset.\n"); result = PCI...
0
[ "CWE-400", "CWE-401" ]
linux
27d461333459d282ffa4a2bdb6b215a59d493a8f
160,542,935,847,162,250,000,000,000,000,000,000,000
26
i40e: prevent memory leak in i40e_setup_macvlans In i40e_setup_macvlans if i40e_setup_channel fails the allocated memory for ch should be released. Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
static void cma_listen_on_dev(struct rdma_id_private *id_priv, struct cma_device *cma_dev) { struct rdma_id_private *dev_id_priv; struct rdma_cm_id *id; int ret; if (cma_family(id_priv) == AF_IB && rdma_node_get_transport(cma_dev->device->node_type) != RDMA_TRANSPORT_IB) return; id = rdma_create_...
0
[ "CWE-20" ]
linux
b2853fd6c2d0f383dbdf7427e263eb576a633867
192,000,987,297,273,280,000,000,000,000,000,000,000
33
IB/core: Don't resolve passive side RoCE L2 address in CMA REQ handler The code that resolves the passive side source MAC within the rdma_cm connection request handler was both redundant and buggy, so remove it. It was redundant since later, when an RC QP is modified to RTR state, the resolution will take place in th...
CheckKeyExplicit(XkbDescPtr xkb, xkbSetMapReq * req, CARD8 **wireRtrn, int *errorRtrn) { register CARD8 *wire = *wireRtrn; CARD8 *start; register unsigned i; int first, last; if (((req->present & XkbExplicitComponentsMask) == 0) || (req->nKeyExplicit < 1)) { req->pr...
0
[ "CWE-119" ]
xserver
f7cd1276bbd4fe3a9700096dec33b52b8440788d
292,459,347,266,758,580,000,000,000,000,000,000,000
39
Correct bounds checking in XkbSetNames() CVE-2020-14345 / ZDI 11428 This vulnerability was discovered by: Jan-Niklas Sohn working with Trend Micro Zero Day Initiative Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
static void free_xattrmap(struct lo_data *lo) { XattrMapEntry *map = lo->xattr_map_list; size_t i; if (!map) { return; } for (i = 0; i < lo->xattr_map_nentries; i++) { g_free(map[i].key); g_free(map[i].prepend); }; g_free(map); lo->xattr_map_list = NULL; lo...
0
[]
qemu
6084633dff3a05d63176e06d7012c7e15aba15be
246,764,149,946,266,170,000,000,000,000,000,000,000
18
tools/virtiofsd: xattr name mappings: Add option Add an option to define mappings of xattr names so that the client and server filesystems see different views. This can be used to have different SELinux mappings as seen by the guest, to run the virtiofsd with less privileges (e.g. in a case where it can't set trusted/...
static int test_ifdefine_section(cmd_parms *cmd, const char *arg) { return ap_exists_config_define(arg); }
0
[ "CWE-416", "CWE-284" ]
httpd
4cc27823899e070268b906ca677ee838d07cf67a
259,573,554,148,706,400,000,000,000,000,000,000,000
4
core: Disallow Methods' registration at run time (.htaccess), they may be used only if registered at init time (httpd.conf). Calling ap_method_register() in children processes is not the right scope since it won't be shared for all requests. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1807655 13f7...
void CrwMap::encodeArray(const Image& image, const CrwMapping* pCrwMapping, CiffHeader* pHead) { assert(pCrwMapping != 0); assert(pHead != 0); IfdId ifdId = ifdIdNotSet; switch (pCrwMapping->tag_) { cas...
0
[ "CWE-400" ]
exiv2
b3d077dcaefb6747fff8204490f33eba5a144edb
265,677,693,301,702,460,000,000,000,000,000,000,000
29
Fix #460 by adding more checks in CiffDirectory::readDirectory
ImportForeignSchema(ImportForeignSchemaStmt *stmt) { ForeignServer *server; ForeignDataWrapper *fdw; FdwRoutine *fdw_routine; AclResult aclresult; List *cmd_list; ListCell *lc; /* Check that the foreign server exists and that we have USAGE on it */ server = GetForeignServerByName(stmt->server_name, false)...
0
[ "CWE-94" ]
postgres
b9b21acc766db54d8c337d508d0fe2f5bf2daab0
264,845,717,326,346,270,000,000,000,000,000,000,000
111
In extensions, don't replace objects not belonging to the extension. Previously, if an extension script did CREATE OR REPLACE and there was an existing object not belonging to the extension, it would overwrite the object and adopt it into the extension. This is problematic, first because the overwrite is probably uni...
static void test_rewind(void) { MYSQL_STMT *stmt; MYSQL_BIND my_bind; int rc = 0; const char *stmt_text; long unsigned int length=4, Data=0; my_bool isnull=0; myheader("test_rewind"); stmt_text= "CREATE TABLE t1 (a int)"; rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); myquery(rc); st...
0
[ "CWE-416" ]
server
eef21014898d61e77890359d6546d4985d829ef6
95,931,528,957,032,270,000,000,000,000,000,000,000
63
MDEV-11933 Wrong usage of linked list in mysql_prune_stmt_list mysql_prune_stmt_list() was walking the list following element->next pointers, but inside the loop it was invoking list_add(element) that modified element->next. So, mysql_prune_stmt_list() failed to visit and reset all elements, and some of them were left...
GF_Err urn_Size(GF_Box *s) { GF_DataEntryURNBox *ptr = (GF_DataEntryURNBox *)s; if ( !(ptr->flags & 1)) { if (ptr->nameURN) ptr->size += 1 + strlen(ptr->nameURN); if (ptr->location) ptr->size += 1 + strlen(ptr->location); } return GF_OK; }
0
[ "CWE-400", "CWE-401" ]
gpac
d2371b4b204f0a3c0af51ad4e9b491144dd1225c
199,994,493,263,652,500,000,000,000,000,000,000,000
10
prevent dref memleak on invalid input (#1183)
static int ReadBlobLZWByte(LZWInfo *lzw_info) { int code; size_t one, value; ssize_t count; if (lzw_info->stack->index != lzw_info->stack->codes) return(PopLZWStack(lzw_info->stack)); if (lzw_info->genesis != MagickFalse) { lzw_info->genesis=MagickFalse; do { ...
0
[ "CWE-200" ]
ImageMagick
9fd10cf630832b36a588c1545d8736539b2f1fb5
35,491,654,447,232,980,000,000,000,000,000,000,000
70
https://github.com/ImageMagick/ImageMagick/issues/592
static void ini_print_str(WriterContext *wctx, const char *key, const char *value) { AVBPrint buf; av_bprint_init(&buf, 1, AV_BPRINT_SIZE_UNLIMITED); printf("%s=", ini_escape_str(&buf, key)); av_bprint_clear(&buf); printf("%s\n", ini_escape_str(&buf, value)); av_bprint_finalize(&buf, NULL); }
0
[ "CWE-476" ]
FFmpeg
837cb4325b712ff1aab531bf41668933f61d75d2
42,124,686,493,653,657,000,000,000,000,000,000,000
10
ffprobe: Fix null pointer dereference with color primaries Found-by: AD-lab of venustech Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
static void relink_to_local(struct snd_pcm_substream *substream) { snd_pcm_stream_lock_nested(substream); snd_pcm_group_assign(substream, &substream->self_group); snd_pcm_stream_unlock(substream); }
0
[ "CWE-125" ]
linux
92ee3c60ec9fe64404dc035e7c41277d74aa26cb
67,478,495,672,848,030,000,000,000,000,000,000,000
6
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...
static int __ext4_ext_check(const char *function, unsigned int line, struct inode *inode, struct ext4_extent_header *eh, int depth, ext4_fsblk_t pblk) { const char *error_msg; int max = 0, err = -EFSCORRUPTED; if (unlikely(eh->eh_magic != EXT4_EXT_MAGIC)) { error_msg = "invalid magic"; goto corrup...
0
[ "CWE-362" ]
linux
ea3d7209ca01da209cda6f0dea8be9cc4b7a933b
165,021,279,724,631,040,000,000,000,000,000,000,000
51
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 readWriteTestWithAbsoluateCoordinates (int channelCount, int testTimes, const std::string & tempDir) { cout << "Testing files with " << channelCount << " channels, using absolute coordinates " << testTimes...
0
[ "CWE-125" ]
openexr
e79d2296496a50826a15c667bf92bdc5a05518b4
86,799,549,813,805,760,000,000,000,000,000,000,000
49
fix memory leaks and invalid memory accesses Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
void Compute(OpKernelContext *ctx) override { const Tensor *a_indices_t, *a_values_t, *a_shape_t, *b_indices_t, *b_values_t, *b_shape_t; OP_REQUIRES_OK(ctx, ctx->input("a_indices", &a_indices_t)); OP_REQUIRES_OK(ctx, ctx->input("a_values", &a_values_t)); OP_REQUIRES_OK(ctx, ctx->input("a_shape...
1
[ "CWE-120", "CWE-125" ]
tensorflow
ba6822bd7b7324ba201a28b2f278c29a98edbef2
317,480,187,426,403,560,000,000,000,000,000,000,000
104
Fix OOB issue with `tf.raw_ops.SparseSparseMinimum`. PiperOrigin-RevId: 371005787 Change-Id: Ib686ccc077836e8b980b8b5a03936d36a8ecaf71
static int vhost_vdpa_map(struct vhost_vdpa *v, u64 iova, u64 size, u64 pa, u32 perm, void *opaque) { struct vhost_dev *dev = &v->vdev; struct vdpa_device *vdpa = v->vdpa; const struct vdpa_config_ops *ops = vdpa->config; int r = 0; r = vhost_iotlb_add_range_ctx(dev->iotlb, iova, iova + size - 1, p...
0
[ "CWE-190" ]
linux
870aaff92e959e29d40f9cfdb5ed06ba2fc2dae0
12,239,770,879,651,560,000,000,000,000,000,000,000
32
vdpa: clean up get_config_size ret value handling The return type of get_config_size is size_t so it makes sense to change the type of the variable holding its result. That said, this already got taken care of (differently, and arguably not as well) by commit 3ed21c1451a1 ("vdpa: check that offsets are within bounds"...
void Filter::onResponseTimeout() { ENVOY_STREAM_LOG(debug, "upstream timeout", *callbacks_); // If we had an upstream request that got a "good" response, save its // upstream timing information into the downstream stream info. if (final_upstream_request_) { callbacks_->streamInfo().setUpstreamTiming(final_...
0
[ "CWE-400", "CWE-703" ]
envoy
afc39bea36fd436e54262f150c009e8d72db5014
220,408,114,862,757,600,000,000,000,000,000,000,000
37
Track byteSize of HeaderMap internally. Introduces a cached byte size updated internally in HeaderMap. The value is stored as an optional, and is cleared whenever a non-const pointer or reference to a HeaderEntry is accessed. The cached value can be set with refreshByteSize() which performs an iteration over the Heade...
transit_finish (void) { hash_free (transit_hash); transit_hash = NULL; }
0
[]
quagga
8794e8d229dc9fe29ea31424883433d4880ef408
95,352,866,260,311,160,000,000,000,000,000,000,000
5
bgpd: Fix regression in args consolidation, total should be inited from args * bgp_attr.c: (bgp_attr_unknown) total should be initialised from the args.
php_apache_server_startup(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s) { void *data = NULL; const char *userdata_key = "apache2hook_post_config"; /* Apache will load, unload and then reload a DSO module. This * prevents us from starting PHP until the second load. */ apr_pool_userdata_ge...
0
[ "CWE-20" ]
php-src
809610f5ea38a83b284e1125d1fff129bdd615e7
281,092,966,596,968,470,000,000,000,000,000,000,000
32
Fix bug #68486 and bug #69218 (segfault in apache2handler with apache 2.4)
GF_Err lsrc_Write(GF_Box *s, GF_BitStream *bs) { GF_Err e; GF_LASERConfigurationBox *ptr = (GF_LASERConfigurationBox *)s; e = gf_isom_box_write_header(s, bs); if (e) return e; gf_bs_write_data(bs, ptr->hdr, ptr->hdr_size); return GF_OK; }
0
[ "CWE-125" ]
gpac
bceb03fd2be95097a7b409ea59914f332fb6bc86
292,694,212,206,988,770,000,000,000,000,000,000,000
9
fixed 2 possible heap overflows (inc. #1088)
static struct inode *new_simple_dir(struct super_block *s, struct btrfs_key *key, struct btrfs_root *root) { struct inode *inode = new_inode(s); if (!inode) return ERR_PTR(-ENOMEM); BTRFS_I(inode)->root = root; memcpy(&BTRFS_I(inode)->location, key, sizeof(*key)); set_bit(BTRFS_INODE_DUMMY, &BT...
0
[ "CWE-310" ]
linux-2.6
9c52057c698fb96f8f07e7a4bcf4801a092bda89
154,992,429,205,411,240,000,000,000,000,000,000,000
21
Btrfs: fix hash overflow handling The handling for directory crc hash overflows was fairly obscure, split_leaf returns EOVERFLOW when we try to extend the item and that is supposed to bubble up to userland. For a while it did so, but along the way we added better handling of errors and forced the FS readonly if we hi...
static char *uncompress(int16_t field_count, char *start, char *end, char *ptr, char *uncompressed, int uncomp_len, char **uncompressed_ptr) { char *uptr = *uncompressed_ptr; /* position in result buffer */ char * const uncomp_end = uncompressed + uncomp_len - 1; debug("count %d ptr %p end %p uptr %p", field_...
0
[ "CWE-787" ]
connman
e4079a20f617a4b076af503f6e4e8b0304c9f2cb
216,598,813,768,583,350,000,000,000,000,000,000,000
138
dnsproxy: Add length checks to prevent buffer overflow Fixes: CVE-2021-26675
void extcap_interfaces() { printf("extcap {version=%s}\n", ndpi_revision()); printf("interface {value=ndpi}{display=nDPI interface}\n"); exit(0); }
0
[ "CWE-125" ]
nDPI
b7e666e465f138ae48ab81976726e67deed12701
36,096,365,554,513,055,000,000,000,000,000,000,000
5
Added fix to avoid potential heap buffer overflow in H.323 dissector Modified HTTP report information to make it closer to the HTTP field names
__perf_read(struct perf_event *event, char __user *buf, size_t count) { u64 read_format = event->attr.read_format; int ret; /* * Return end-of-file for a read on a event that is in * error state (i.e. because it was pinned but it couldn't be * scheduled on to the CPU at some point). */ if (event->state == ...
0
[ "CWE-416", "CWE-362" ]
linux
12ca6ad2e3a896256f086497a7c7406a547ee373
95,099,571,414,975,200,000,000,000,000,000,000,000
24
perf: Fix race in swevent hash There's a race on CPU unplug where we free the swevent hash array while it can still have events on. This will result in a use-after-free which is BAD. Simply do not free the hash array on unplug. This leaves the thing around and no use-after-free takes place. When the last swevent die...
got_transfer_quota(isc_task_t *task, isc_event_t *event) { isc_result_t result = ISC_R_SUCCESS; dns_peer_t *peer = NULL; char master[ISC_SOCKADDR_FORMATSIZE]; char source[ISC_SOCKADDR_FORMATSIZE]; dns_rdatatype_t xfrtype; dns_zone_t *zone = event->ev_arg; isc_netaddr_t masterip; isc_sockaddr_t sourceaddr; isc_...
0
[ "CWE-327" ]
bind9
f09352d20a9d360e50683cd1d2fc52ccedcd77a0
274,441,880,364,755,870,000,000,000,000,000,000,000
166
Update keyfetch_done compute_tag check If in keyfetch_done the compute_tag fails (because for example the algorithm is not supported), don't crash, but instead ignore the key.
flatpak_deploy_data_get_eol (GVariant *deploy_data) { return flatpak_deploy_data_get_string (deploy_data, "eol"); }
0
[ "CWE-668" ]
flatpak
cd2142888fc4c199723a0dfca1f15ea8788a5483
74,797,101,822,158,600,000,000,000,000,000,000,000
4
Don't expose /proc when running apply_extra As shown by CVE-2019-5736, it is sometimes possible for the sandbox app to access outside files using /proc/self/exe. This is not typically an issue for flatpak as the sandbox runs as the user which has no permissions to e.g. modify the host files. However, when installing ...
flatpak_context_remove_devices (FlatpakContext *context, FlatpakContextDevices devices) { context->devices_valid |= devices; context->devices &= ~devices; }
0
[ "CWE-20" ]
flatpak
902fb713990a8f968ea4350c7c2a27ff46f1a6c4
20,185,604,279,703,394,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.
TEE_Result syscall_cryp_obj_get_attr(unsigned long obj, unsigned long attr_id, void *buffer, uint64_t *size) { TEE_Result res; struct tee_ta_session *sess; struct tee_obj *o; const struct tee_cryp_obj_type_props *type_props; int idx; const struct attr_ops *ops; void *attr; res = tee_ta_get_current_session(&...
0
[ "CWE-119", "CWE-787" ]
optee_os
a637243270fc1faae16de059091795c32d86e65e
97,770,696,134,543,120,000,000,000,000,000,000,000
43
svc: check for allocation overflow in crypto calls Without checking for overflow there is a risk of allocating a buffer with size smaller than anticipated and as a consequence of that it might lead to a heap based overflow with attacker controlled data written outside the boundaries of the buffer. Fixes: OP-TEE-2018-...
static struct OpenAttr *find_loaded_attr(struct ntfs_log *log, const struct ATTRIB *attr, CLST rno) { struct OPEN_ATTR_ENRTY *oe = NULL; while ((oe = enum_rstbl(log->open_attr_tbl, oe))) { struct OpenAttr *op_attr; if (ino_get(&oe->ref) != rno) continue; op_attr = (struct OpenAttr *)oe->ptr; if (!...
0
[ "CWE-416" ]
linux
f26967b9f7a830e228bb13fb41bd516ddd9d789d
294,183,753,986,969,160,000,000,000,000,000,000,000
17
fs/ntfs3: Fix invalid free in log_replay log_read_rst() returns ENOMEM error when there is not enough memory. In this case, if info is returned without initialization, it attempts to kfree the uninitialized info->r_page pointer. This patch moves the memset initialization code to before log_read_rst() is called. Repor...
static void *lr_memmem(const void *l, size_t l_len, const void *s, size_t s_len) { register char *cur, *last; const char *cl = (const char *)l; const char *cs = (const char *)s; /* we need something to compare */ if (l_len == 0 || s_len == 0) return NULL; /* "s" must be smaller or equal to "l" */ if (l_len <...
0
[ "CWE-129" ]
LibRaw
89d065424f09b788f443734d44857289489ca9e2
235,919,498,753,050,600,000,000,000,000,000,000,000
26
fixed two more problems found by fuzzer
void DumpByLine(const std::string& data, std::ostream& os, string_view prefix) { std::vector<string_view> lines; Split(data, '\n', false, &lines); std::size_t size = 0; for (const auto& line : lines) { os << prefix; if (line.size() + size > kMaxDumpSize) { os.write(line.data(), kMaxDumpSize - s...
0
[ "CWE-22" ]
webcc
55a45fd5039061d5cc62e9f1b9d1f7e97a15143f
229,059,336,623,095,850,000,000,000,000,000,000,000
19
fix static file serving security issue; fix url path encoding issue