func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
struct hlist_node *seq_hlist_start_rcu(struct hlist_head *head,
loff_t pos)
{
struct hlist_node *node;
__hlist_for_each_rcu(node, head)
if (pos-- == 0)
return node;
return NULL;
} | 0 | [
"CWE-120",
"CWE-787"
] | linux | 8cae8cd89f05f6de223d63e6d15e31c8ba9cf53b | 221,988,915,717,276,200,000,000,000,000,000,000,000 | 10 | seq_file: disallow extremely large seq buffer allocations
There is no reasonable need for a buffer larger than this, and it avoids
int overflow pitfalls.
Fixes: 058504edd026 ("fs/seq_file: fallback to vmalloc allocation")
Suggested-by: Al Viro <viro@zeniv.linux.org.uk>
Reported-by: Qualys Security Advisory <qsa@qualy... |
findtags_matchargs_init(findtags_match_args_T *margs, int flags)
{
margs->matchoff = 0; // match offset
margs->match_re = FALSE; // match with regexp
margs->match_no_ic = FALSE; // matches with case
margs->has_re = (flags & TAG_REGEXP); // regexp used
margs->sortic = FALSE; // tag file sorte... | 0 | [
"CWE-416"
] | vim | adce965162dd89bf29ee0e5baf53652e7515762c | 13,874,247,829,267,926,000,000,000,000,000,000,000 | 9 | patch 9.0.0246: using freed memory when 'tagfunc' deletes the buffer
Problem: Using freed memory when 'tagfunc' deletes the buffer.
Solution: Make a copy of the tag name. |
void InitSL_NULL(GF_SLConfig *slc)
{
memset(slc, 0, sizeof(GF_SLConfig));
slc->tag = GF_ODF_SLC_TAG;
slc->predefined = 0x01;
} | 0 | [
"CWE-476"
] | gpac | ebfa346eff05049718f7b80041093b4c5581c24e | 145,847,373,292,572,720,000,000,000,000,000,000,000 | 6 | fixed #1706 |
static int binlog_commit(handlerton *hton, THD *thd, bool all)
{
int error= 0;
DBUG_ENTER("binlog_commit");
binlog_cache_mngr *const cache_mngr=
(binlog_cache_mngr*) thd_get_ha_data(thd, binlog_hton);
DBUG_PRINT("debug",
("all: %d, in_transaction: %s, all.modified_non_trans_table: %s, stmt.mod... | 0 | [
"CWE-264"
] | mysql-server | 48bd8b16fe382be302c6f0b45931be5aa6f29a0e | 53,072,821,099,779,750,000,000,000,000,000,000,000 | 45 | Bug#24388753: PRIVILEGE ESCALATION USING MYSQLD_SAFE
[This is the 5.5/5.6 version of the bugfix].
The problem was that it was possible to write log files ending
in .ini/.cnf that later could be parsed as an options file.
This made it possible for users to specify startup options
without the permissions to do so.
Thi... |
void ssl3_free(SSL *s)
{
if(s == NULL)
return;
#ifdef TLSEXT_TYPE_opaque_prf_input
if (s->s3->client_opaque_prf_input != NULL)
OPENSSL_free(s->s3->client_opaque_prf_input);
if (s->s3->server_opaque_prf_input != NULL)
OPENSSL_free(s->s3->server_opaque_prf_input);
#endif
ssl3_cleanup_key_block(s);
if (s-... | 1 | [] | openssl | 8671b898609777c95aedf33743419a523874e6e8 | 10,867,963,634,833,920,000,000,000,000,000,000,000 | 38 | Memory saving patch. |
read_timer(vector_t *strvec, size_t index, unsigned long *res, unsigned long min_time, unsigned long max_time, __attribute__((unused)) bool ignore_error)
{
unsigned long timer;
char *endptr;
char *warn = "";
#ifndef _STRICT_CONFIG_
if (ignore_error && !__test_bit(CONFIG_TEST_BIT, &debug))
warn = "WARNING - ";
#e... | 0 | [
"CWE-59",
"CWE-61"
] | keepalived | 04f2d32871bb3b11d7dc024039952f2fe2750306 | 298,062,690,513,711,800,000,000,000,000,000,000,000 | 35 | When opening files for write, ensure they aren't symbolic links
Issue #1048 identified that if, for example, a non privileged user
created a symbolic link from /etc/keepalvied.data to /etc/passwd,
writing to /etc/keepalived.data (which could be invoked via DBus)
would cause /etc/passwd to be overwritten.
This commit ... |
int kvm_arch_hardware_setup(void)
{
int r;
r = kvm_x86_ops->hardware_setup();
if (r != 0)
return r;
if (kvm_has_tsc_control) {
/*
* Make sure the user can only configure tsc_khz values that
* fit into a signed integer.
* A min value is not calculated needed because it will always
* be 1 on all mac... | 0 | [
"CWE-369"
] | linux | 0185604c2d82c560dab2f2933a18f797e74ab5a8 | 56,895,842,748,493,620,000,000,000,000,000,000,000 | 25 | KVM: x86: Reload pit counters for all channels when restoring state
Currently if userspace restores the pit counters with a count of 0
on channels 1 or 2 and the guest attempts to read the count on those
channels, then KVM will perform a mod of 0 and crash. This will ensure
that 0 values are converted to 65536 as per... |
static int ieee80211_leave_mesh(struct wiphy *wiphy, struct net_device *dev)
{
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
ieee80211_stop_mesh(sdata);
mutex_lock(&sdata->local->mtx);
ieee80211_vif_release_channel(sdata);
mutex_unlock(&sdata->local->mtx);
return 0;
} | 0 | [
"CWE-287"
] | linux | 3e493173b7841259a08c5c8e5cbe90adb349da7e | 244,282,648,735,583,670,000,000,000,000,000,000,000 | 11 | 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-... |
input_gssapi_token(int type, u_int32_t plen, struct ssh *ssh)
{
Authctxt *authctxt = ssh->authctxt;
Gssctxt *gssctxt;
gss_buffer_desc send_tok = GSS_C_EMPTY_BUFFER;
gss_buffer_desc recv_tok;
OM_uint32 maj_status, min_status, flags;
u_char *p;
size_t len;
int r;
if (authctxt == NULL || (authctxt->methoddata ==... | 0 | [
"CWE-200",
"CWE-362",
"CWE-703"
] | src | 779974d35b4859c07bc3cb8a12c74b43b0a7d1e0 | 169,779,340,145,559,250,000,000,000,000,000,000,000 | 62 | delay bailout for invalid authenticating user until after the packet
containing the request has been fully parsed. Reported by Dariusz Tytko
and Michał Sajdak; ok deraadt |
zcolor_remap_one(
i_ctx_t * i_ctx_p,
const ref * pproc,
gx_transfer_map * pmap,
const gs_gstate * pgs,
op_proc_t finish_proc )
{
os_ptr op;
/*
* Detect the identity function, which is a common value for one or
* more of these functions... | 0 | [] | ghostpdl | b326a71659b7837d3acde954b18bda1a6f5e9498 | 293,296,239,107,056,630,000,000,000,000,000,000,000 | 34 | Bug 699655: Properly check the return value....
...when getting a value from a dictionary |
gst_asf_demux_find_stream_with_complete_payload (GstASFDemux * demux)
{
AsfPayload *best_payload = NULL;
AsfStream *best_stream = NULL;
guint i;
for (i = 0; i < demux->num_streams; ++i) {
AsfStream *stream;
int j;
stream = &demux->stream[i];
/* Don't push any data until we have at least one p... | 0 | [
"CWE-125",
"CWE-787"
] | gst-plugins-ugly | d21017b52a585f145e8d62781bcc1c5fefc7ee37 | 187,014,848,417,397,200,000,000,000,000,000,000,000 | 102 | asfdemux: Check that we have enough data available before parsing bool/uint extended content descriptors
https://bugzilla.gnome.org/show_bug.cgi?id=777955 |
TEST(BitTestMatchExpression, MatchesNegativeInteger) {
BSONArray bas = BSON_ARRAY(1 << 3 << 6 << 7 << 33);
BSONArray bac = BSON_ARRAY(0 << 2 << 4 << 5);
std::vector<uint32_t> bitPositionsSet = bsonArrayToBitPositions(bas);
std::vector<uint32_t> bitPositionsClear = bsonArrayToBitPositions(bac);
BSON... | 0 | [] | mongo | 64095239f41e9f3841d8be9088347db56d35c891 | 282,113,360,379,753,860,000,000,000,000,000,000,000 | 32 | SERVER-51083 Reject invalid UTF-8 from $regex match expressions |
TPM_ECC_CURVE_Marshal(TPM_ECC_CURVE *source, BYTE **buffer, INT32 *size)
{
UINT16 written = 0;
written += UINT16_Marshal(source, buffer, size);
return written;
} | 0 | [
"CWE-787"
] | libtpms | 3ef9b26cb9f28bd64d738bff9505a20d4eb56acd | 81,888,491,913,850,350,000,000,000,000,000,000,000 | 6 | tpm2: Add maxSize parameter to TPM2B_Marshal for sanity checks
Add maxSize parameter to TPM2B_Marshal and assert on it checking
the size of the data intended to be marshaled versus the maximum
buffer size.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> |
static void get_new_segment(struct f2fs_sb_info *sbi,
unsigned int *newseg, bool new_sec, int dir)
{
struct free_segmap_info *free_i = FREE_I(sbi);
unsigned int segno, secno, zoneno;
unsigned int total_zones = MAIN_SECS(sbi) / sbi->secs_per_zone;
unsigned int hint = GET_SEC_FROM_SEG(sbi, *newseg);
unsigned int ... | 0 | [
"CWE-20"
] | linux | 638164a2718f337ea224b747cf5977ef143166a4 | 48,388,616,352,701,560,000,000,000,000,000,000,000 | 87 | f2fs: fix potential panic during fstrim
As Ju Hyung Park reported:
"When 'fstrim' is called for manual trim, a BUG() can be triggered
randomly with this patch.
I'm seeing this issue on both x86 Desktop and arm64 Android phone.
On x86 Desktop, this was caused during Ubuntu boot-up. I have a
cronjob installed which c... |
int __dev_change_flags(struct net_device *dev, unsigned int flags,
struct netlink_ext_ack *extack)
{
unsigned int old_flags = dev->flags;
int ret;
ASSERT_RTNL();
/*
* Set the flags on our device.
*/
dev->flags = (flags & (IFF_DEBUG | IFF_NOTRAILERS | IFF_NOARP |
IFF_DYNAMIC | IFF_MULTICA... | 0 | [
"CWE-416"
] | linux | a4270d6795b0580287453ea55974d948393e66ef | 266,895,132,512,919,660,000,000,000,000,000,000,000 | 65 | net-gro: fix use-after-free read in napi_gro_frags()
If a network driver provides to napi_gro_frags() an
skb with a page fragment of exactly 14 bytes, the call
to gro_pull_from_frag0() will 'consume' the fragment
by calling skb_frag_unref(skb, 0), and the page might
be freed and reused.
Reading eth->h_proto at the en... |
archive_string_conversion_set_opt(struct archive_string_conv *sc, int opt)
{
switch (opt) {
/*
* A filename in UTF-8 was made with libarchive 2.x in a wrong
* assumption that wchar_t was Unicode.
* This option enables simulating the assumption in order to read
* that filename correctly.
*/
case SCONV_SET_O... | 0 | [
"CWE-476"
] | libarchive | 42a3408ac7df1e69bea9ea12b72e14f59f7400c0 | 120,106,567,138,309,340,000,000,000,000,000,000,000 | 55 | 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 |
void ms_handle_accept(Connection *con) override { }; | 0 | [
"CWE-287",
"CWE-284"
] | ceph | 5ead97120e07054d80623dada90a5cc764c28468 | 280,621,910,182,713,520,000,000,000,000,000,000,000 | 1 | auth/cephx: add authorizer challenge
Allow the accepting side of a connection to reject an initial authorizer
with a random challenge. The connecting side then has to respond with an
updated authorizer proving they are able to decrypt the service's challenge
and that the new authorizer was produced for this specific ... |
int vc4_queue_seqno_cb(struct drm_device *dev,
struct vc4_seqno_cb *cb, uint64_t seqno,
void (*func)(struct vc4_seqno_cb *cb))
{
struct vc4_dev *vc4 = to_vc4_dev(dev);
int ret = 0;
unsigned long irqflags;
cb->func = func;
INIT_WORK(&cb->work, vc4_seqno_cb_work);
spin_lock_irqsave(&vc4->job_loc... | 0 | [
"CWE-190",
"CWE-703"
] | linux | 0f2ff82e11c86c05d051cae32b58226392d33bbf | 84,438,357,214,239,430,000,000,000,000,000,000,000 | 22 | drm/vc4: Fix an integer overflow in temporary allocation layout.
We copy the unvalidated ioctl arguments from the user into kernel
temporary memory to run the validation from, to avoid a race where the
user updates the unvalidate contents in between validating them and
copying them into the validated BO.
However, in ... |
CImg<Tfloat> get_maxabs(const char *const expression) const {
return CImg<Tfloat>(*this,false).maxabs(expression);
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 226,715,544,195,186,900,000,000,000,000,000,000,000 | 3 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
void sdma_wait(struct hfi1_devdata *dd)
{
int i;
for (i = 0; i < dd->num_sdma; i++) {
struct sdma_engine *sde = &dd->per_sdma[i];
sdma_wait_for_packet_egress(sde, 0);
}
} | 0 | [
"CWE-400",
"CWE-401"
] | linux | 34b3be18a04ecdc610aae4c48e5d1b799d8689f6 | 335,814,121,156,624,320,000,000,000,000,000,000,000 | 10 | RDMA/hfi1: Prevent memory leak in sdma_init
In sdma_init if rhashtable_init fails the allocated memory for
tmp_sdma_rht should be released.
Fixes: 5a52a7acf7e2 ("IB/hfi1: NULL pointer dereference when freeing rhashtable")
Link: https://lore.kernel.org/r/20190925144543.10141-1-navid.emamdoost@gmail.com
Signed-off-by: ... |
pango_bidi_type_for_unichar (gunichar ch)
{
FriBidiCharType fribidi_ch_type;
G_STATIC_ASSERT (sizeof (FriBidiChar) == sizeof (gunichar));
fribidi_ch_type = fribidi_get_bidi_type (ch);
switch (fribidi_ch_type)
{
case FRIBIDI_TYPE_LTR: return PANGO_BIDI_TYPE_L;
case FRIBIDI_TYPE_LRE: return PANGO... | 0 | [
"CWE-787"
] | pango | 490f8979a260c16b1df055eab386345da18a2d54 | 286,075,463,663,275,520,000,000,000,000,000,000,000 | 36 | bidi: Be safer against bad input
Don't run off the end of an array that we
allocated to certain length.
Closes: https://gitlab.gnome.org/GNOME/pango/issues/342 |
static inline void dx_set_block(struct dx_entry *entry, ext4_lblk_t value)
{
entry->block = cpu_to_le32(value);
} | 0 | [
"CWE-20"
] | linux-2.6 | e6b8bc09ba2075cd91fbffefcd2778b1a00bd76f | 64,019,472,998,423,740,000,000,000,000,000,000,000 | 4 | ext4: Add sanity check to make_indexed_dir
Make sure the rec_len field in the '..' entry is sane, lest we overrun
the directory block and cause a kernel oops on a purposefully
corrupted filesystem.
Thanks to Sami Liedes for reporting this bug.
http://bugzilla.kernel.org/show_bug.cgi?id=12430
Signed-off-by: "Theodor... |
DLLEXPORT int tjDecompressHeader(tjhandle handle, unsigned char *jpegBuf,
unsigned long jpegSize, int *width,
int *height)
{
int jpegSubsamp;
return tjDecompressHeader2(handle, jpegBuf, jpegSize, width, height,
&jpegSubs... | 0 | [
"CWE-787"
] | libjpeg-turbo | 3d9c64e9f8aa1ee954d1d0bb3390fc894bb84da3 | 276,762,524,680,346,060,000,000,000,000,000,000,000 | 9 | tjLoadImage(): Fix int overflow/segfault w/big BMP
Fixes #304 |
static int ethtool_phys_id(struct net_device *dev, void __user *useraddr)
{
struct ethtool_value id;
if (!dev->ethtool_ops->phys_id)
return -EOPNOTSUPP;
if (copy_from_user(&id, useraddr, sizeof(id)))
return -EFAULT;
return dev->ethtool_ops->phys_id(dev, id.data);
} | 0 | [
"CWE-190"
] | linux-2.6 | db048b69037e7fa6a7d9e95a1271a50dc08ae233 | 105,359,470,044,724,100,000,000,000,000,000,000,000 | 12 | ethtool: Fix potential kernel buffer overflow in ETHTOOL_GRXCLSRLALL
On a 32-bit machine, info.rule_cnt >= 0x40000000 leads to integer
overflow and the buffer may be smaller than needed. Since
ETHTOOL_GRXCLSRLALL is unprivileged, this can presumably be used for at
least denial of service.
Signed-off-by: Ben Hutching... |
void visit(CharacterClass &ope) override {
found_ope = ope.shared_from_this();
} | 0 | [
"CWE-125"
] | cpp-peglib | b3b29ce8f3acf3a32733d930105a17d7b0ba347e | 84,987,742,424,662,050,000,000,000,000,000,000,000 | 3 | Fix #122 |
void open_file(const char *name)
{
char buff[FN_REFLEN];
size_t length;
const char *curname= cur_file->file_name;
DBUG_ENTER("open_file");
DBUG_PRINT("enter", ("name: %s", name));
if (cur_file == file_stack_end)
die("Source directives are nesting too deep");
if (test_if_hard_path(name))
{
if (... | 0 | [] | server | 01b39b7b0730102b88d8ea43ec719a75e9316a1e | 117,263,576,010,807,760,000,000,000,000,000,000,000 | 112 | mysqltest: don't eat new lines in --exec
pass them through as is |
GF_Err hvcc_box_size(GF_Box *s)
{
u32 i, count, j, subcount;
GF_HEVCConfigurationBox *ptr = (GF_HEVCConfigurationBox *)s;
if (!ptr->config) {
ptr->size = 0;
return GF_OK;
}
if (!ptr->config->is_lhvc)
ptr->size += 23;
else
ptr->size += 6;
count = gf_list_count(ptr->config->param_array);
for (i=0; i<co... | 0 | [
"CWE-401"
] | gpac | 0a85029d694f992f3631e2f249e4999daee15cbf | 47,773,931,432,672,070,000,000,000,000,000,000,000 | 26 | fixed #1785 (fuzz) |
XML_SetNamespaceDeclHandler(XML_Parser parser,
XML_StartNamespaceDeclHandler start,
XML_EndNamespaceDeclHandler end) {
if (parser == NULL)
return;
parser->m_startNamespaceDeclHandler = start;
parser->m_endNamespaceDeclHandler = end;
} | 0 | [
"CWE-611",
"CWE-776",
"CWE-415",
"CWE-125"
] | libexpat | c20b758c332d9a13afbbb276d30db1d183a85d43 | 260,589,159,950,302,040,000,000,000,000,000,000,000 | 8 | xmlparse.c: Deny internal entities closing the doctype |
QPDF::allowModifyAssembly()
{
int R = 0;
int P = 0;
bool status = true;
if (isEncrypted(R, P))
{
if (R < 3)
{
status = is_bit_set(P, 4);
}
else
{
status = is_bit_set(P, 11);
}
}
return status;
} | 0 | [
"CWE-125"
] | qpdf | dea704f0ab7f625e1e7b3f9a1110b45b63157317 | 217,927,625,033,683,760,000,000,000,000,000,000,000 | 18 | Pad keys to avoid memory errors (fixes #147) |
donote(struct magic_set *ms, void *vbuf, size_t offset, size_t size,
int clazz, int swap, size_t align, int *flags, uint16_t *notecount,
int fd, off_t ph_off, int ph_num, off_t fsize)
{
Elf32_Nhdr nh32;
Elf64_Nhdr nh64;
size_t noff, doff;
uint32_t namesz, descsz;
unsigned char *nbuf = CAST(unsigned char *,... | 0 | [
"CWE-787"
] | file | d65781527c8134a1202b2649695d48d5701ac60b | 280,802,001,140,790,270,000,000,000,000,000,000,000 | 138 | PR/62: spinpx: limit size of file_printable. |
static size_t inbound_frame_payload_readlen(nghttp2_inbound_frame *iframe,
const uint8_t *in,
const uint8_t *last) {
return nghttp2_min((size_t)(last - in), iframe->payloadleft);
} | 0 | [] | nghttp2 | 0a6ce87c22c69438ecbffe52a2859c3a32f1620f | 272,360,150,629,827,840,000,000,000,000,000,000,000 | 5 | Add nghttp2_option_set_max_outbound_ack |
void subs_del(GF_Box *s)
{
GF_SubSampleInformationBox *ptr = (GF_SubSampleInformationBox *)s;
if (ptr == NULL) return;
while (gf_list_count(ptr->Samples)) {
GF_SubSampleInfoEntry *pSamp;
pSamp = (GF_SubSampleInfoEntry*)gf_list_get(ptr->Samples, 0);
while (gf_list_count(pSamp->SubSamples)) {
GF_SubSampleEnt... | 0 | [
"CWE-125"
] | gpac | bceb03fd2be95097a7b409ea59914f332fb6bc86 | 131,882,714,379,422,450,000,000,000,000,000,000,000 | 21 | fixed 2 possible heap overflows (inc. #1088) |
Tfloat _cubic_atXY(const float fx, const float fy, const int z=0, const int c=0) const {
const float
nfx = cimg::type<float>::is_nan(fx)?0:cimg::cut(fx,0,width() - 1),
nfy = cimg::type<float>::is_nan(fy)?0:cimg::cut(fy,0,height() - 1);
const int x = (int)nfx, y = (int)nfy;
const f... | 0 | [
"CWE-119",
"CWE-787"
] | CImg | ac8003393569aba51048c9d67e1491559877b1d1 | 172,436,867,736,875,500,000,000,000,000,000,000,000 | 24 | . |
explicit Value(Array &&a) noexcept : type_(ARRAY_TYPE),
array_value_(std::move(a)) {} | 0 | [
"CWE-20"
] | tinygltf | 52ff00a38447f06a17eab1caa2cf0730a119c751 | 71,406,062,821,290,950,000,000,000,000,000,000,000 | 2 | Do not expand file path since its not necessary for glTF asset path(URI) and for security reason(`wordexp`). |
SMB2_set_eof(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid,
u64 volatile_fid, u32 pid, __le64 *eof)
{
struct smb2_file_eof_info info;
void *data;
unsigned int size;
info.EndOfFile = *eof;
data = &info;
size = sizeof(struct smb2_file_eof_info);
return send_set_info(xid, tcon, persist... | 0 | [
"CWE-416",
"CWE-200"
] | linux | 6a3eb3360667170988f8a6477f6686242061488a | 332,436,519,633,781,800,000,000,000,000,000,000,000 | 16 | cifs: Fix use-after-free in SMB2_write
There is a KASAN use-after-free:
BUG: KASAN: use-after-free in SMB2_write+0x1342/0x1580
Read of size 8 at addr ffff8880b6a8e450 by task ln/4196
Should not release the 'req' because it will use in the trace.
Fixes: eccb4422cf97 ("smb3: Add ftrace tracepoints for improved SMB3 de... |
void TearDown() override {
cleanUpXdsConnection();
cleanupUpstreamAndDownstream();
codec_client_.reset();
test_server_.reset();
fake_upstreams_.clear();
} | 0 | [
"CWE-400"
] | envoy | 0e49a495826ea9e29134c1bd54fdeb31a034f40c | 60,256,363,639,695,930,000,000,000,000,000,000,000 | 9 | 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... |
static inline struct net *xs_net(struct xfrm_state *x)
{
return read_pnet(&x->xs_net);
} | 0 | [
"CWE-416"
] | linux | dbb2483b2a46fbaf833cfb5deb5ed9cace9c7399 | 35,501,861,290,038,576,000,000,000,000,000,000,000 | 4 | xfrm: clean up xfrm protocol checks
In commit 6a53b7593233 ("xfrm: check id proto in validate_tmpl()")
I introduced a check for xfrm protocol, but according to Herbert
IPSEC_PROTO_ANY should only be used as a wildcard for lookup, so
it should be removed from validate_tmpl().
And, IPSEC_PROTO_ANY is expected to only m... |
fetch_name_with_level(OnigCodePoint start_code, UChar** src, UChar* end,
UChar** rname_end, ScanEnv* env,
int* rback_num, int* rlevel)
{
int r, sign, is_num, exist_level;
OnigCodePoint end_code;
OnigCodePoint c = 0;
OnigEncoding enc = env->enc;
UChar *name_end;
UChar *pnum_head;
UChar *p =... | 0 | [
"CWE-125"
] | oniguruma | 65a9b1aa03c9bc2dc01b074295b9603232cb3b78 | 9,815,528,085,148,319,000,000,000,000,000,000,000 | 107 | onig-5.9.2 |
static void handleClient(
T_ASC_Association **assoc,
const char *dbfolder,
OFBool opt_bitpreserving,
OFBool useTLS,
OFBool opt_correctUIDPadding)
{
OFCondition cond = ASC_acknowledgeAssociation(*assoc);
if (! errorCond(cond, "Cannot acknowledge association:"))
{
OFLOG_INFO(dcmpsrcvLogger, "Associati... | 0 | [
"CWE-264"
] | dcmtk | beaf5a5c24101daeeafa48c375120b16197c9e95 | 149,556,196,594,558,190,000,000,000,000,000,000,000 | 89 | Make sure to handle setuid() return code properly.
In some tools the return value of setuid() is not checked. In the worst
case this could lead to privilege escalation since the process does not
give up its root privileges and continue as root. |
static void arcmsr_hbaD_message_isr(struct AdapterControlBlock *acb)
{
struct MessageUnit_D *reg = acb->pmuD;
writel(ARCMSR_ARC1214_IOP2DRV_MESSAGE_CMD_DONE, reg->outbound_doorbell);
readl(reg->outbound_doorbell);
schedule_work(&acb->arcmsr_do_message_isr_bh);
} | 0 | [
"CWE-119",
"CWE-787"
] | linux | 7bc2b55a5c030685b399bb65b6baa9ccc3d1f167 | 160,885,903,616,533,270,000,000,000,000,000,000,000 | 8 | scsi: arcmsr: Buffer overflow in arcmsr_iop_message_xfer()
We need to put an upper bound on "user_len" so the memcpy() doesn't
overflow.
Cc: <stable@vger.kernel.org>
Reported-by: Marco Grassi <marco.gra@gmail.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Sig... |
static void blk_mq_sched_tags_teardown(struct request_queue *q)
{
struct blk_mq_tag_set *set = q->tag_set;
struct blk_mq_hw_ctx *hctx;
int i;
queue_for_each_hw_ctx(q, hctx, i)
blk_mq_sched_free_tags(set, hctx, i);
} | 1 | [
"CWE-416"
] | linux | c3e2219216c92919a6bd1711f340f5faa98695e6 | 58,185,184,655,784,780,000,000,000,000,000,000,000 | 9 | block: free sched's request pool in blk_cleanup_queue
In theory, IO scheduler belongs to request queue, and the request pool
of sched tags belongs to the request queue too.
However, the current tags allocation interfaces are re-used for both
driver tags and sched tags, and driver tags is definitely host wide,
and doe... |
rb_str_match_m(str, re)
VALUE str, re;
{
return rb_funcall(get_pat(re, 0), rb_intern("match"), 1, str);
} | 0 | [
"CWE-20"
] | ruby | e926ef5233cc9f1035d3d51068abe9df8b5429da | 88,951,778,892,704,550,000,000,000,000,000,000,000 | 5 | * random.c (rb_genrand_int32, rb_genrand_real), intern.h: Export.
* string.c (rb_str_tmp_new), intern.h: New function.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
QStringList JlCompress::extractFiles(QuaZip &zip, const QStringList &files, const QString &dir)
{
if(!zip.open(QuaZip::mdUnzip)) {
return QStringList();
}
// Estraggo i file
QStringList extracted;
for (int i=0; i<files.count(); i++) {
QString absPath = QDir(dir).absoluteFilePath(fil... | 0 | [
"CWE-22"
] | quazip | 5d2fc16a1976e5bf78d2927b012f67a2ae047a98 | 76,910,409,311,228,840,000,000,000,000,000,000,000 | 26 | Fixed the Zip Slip vulnerability in JlCompress
When extracting a file with a dangerous path like "../evil.exe"
from a ZIP archive with JlCompress::extractDir(), the target
file would be created outside of the target directory, potentially
even overwriting an existing file there. |
cupsdFreeAllJobs(void)
{
cupsd_job_t *job; /* Current job */
if (!Jobs)
return;
cupsdHoldSignals();
cupsdStopAllJobs(CUPSD_JOB_FORCE, 0);
cupsdSaveAllJobs();
for (job = (cupsd_job_t *)cupsArrayFirst(Jobs);
job;
job = (cupsd_job_t *)cupsArrayNext(Jobs))
cupsdDeleteJob(job, CUPSD_... | 0 | [] | cups | d47f6aec436e0e9df6554436e391471097686ecc | 273,972,975,600,575,100,000,000,000,000,000,000,000 | 20 | Fix local privilege escalation to root and sandbox bypasses in scheduler
(rdar://37836779, rdar://37836995, rdar://37837252, rdar://37837581) |
static int mszip_read_lens(struct mszip_stream *zip) {
/* for the bit buffer and huffman decoding */
register unsigned int bit_buffer;
register int bits_left;
unsigned char *i_ptr, *i_end;
/* bitlen Huffman codes -- immediate lookup, 7 bit max code length */
unsigned short bl_table[(1 << 7)];
unsigned ch... | 0 | [] | clamav-devel | 158c35e81a25ea5fda55a2a7f62ea9fec2e883d9 | 86,198,352,407,994,310,000,000,000,000,000,000,000 | 64 | libclamav/mspack.c: improve unpacking of malformed cabinets (bb#1826) |
int wc_RsaPrivateDecrypt(const byte* in, word32 inLen, byte* out,
word32 outLen, RsaKey* key)
{
WC_RNG* rng;
#ifdef WC_RSA_BLINDING
rng = key->rng;
#else
rng = NULL;
#endif
return RsaPrivateDecryptEx((byte*)in, inLen, out, outLen, NULL, key,
RSA_P... | 0 | [
"CWE-310",
"CWE-787"
] | wolfssl | fb2288c46dd4c864b78f00a47a364b96a09a5c0f | 191,051,072,655,836,060,000,000,000,000,000,000,000 | 13 | 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. |
EXPORTED int mailbox_reload_index_record(struct mailbox *mailbox,
struct index_record *record)
{
if (record->recno)
return mailbox_read_index_record(mailbox, record->recno, record);
else
return mailbox_find_index_record(mailbox, record->uid, record);
} | 0 | [] | cyrus-imapd | 1d6d15ee74e11a9bd745e80be69869e5fb8d64d6 | 246,106,774,100,803,280,000,000,000,000,000,000,000 | 8 | mailbox.c/reconstruct.c: Add mailbox_mbentry_from_path() |
void test_nghttp2_submit_headers(void) {
nghttp2_session *session;
nghttp2_session_callbacks callbacks;
my_user_data ud;
nghttp2_outbound_item *item;
nghttp2_stream *stream;
accumulator acc;
nghttp2_frame frame;
nghttp2_hd_inflater inflater;
nva_out out;
nghttp2_bufs bufs;
nghttp2_mem *mem;
nght... | 0 | [] | nghttp2 | 0a6ce87c22c69438ecbffe52a2859c3a32f1620f | 262,845,047,172,154,170,000,000,000,000,000,000,000 | 98 | Add nghttp2_option_set_max_outbound_ack |
static void addrconf_verify_rtnl(void)
{
unsigned long now, next, next_sec, next_sched;
struct inet6_ifaddr *ifp;
int i;
ASSERT_RTNL();
rcu_read_lock_bh();
now = jiffies;
next = round_jiffies_up(now + ADDR_CHECK_FREQUENCY);
cancel_delayed_work(&addr_chk_work);
for (i = 0; i < IN6_ADDR_HSIZE; i++) {
restart... | 0 | [
"CWE-20"
] | linux | 77751427a1ff25b27d47a4c36b12c3c8667855ac | 289,228,682,380,717,140,000,000,000,000,000,000,000 | 114 | ipv6: addrconf: validate new MTU before applying it
Currently we don't check if the new MTU is valid or not and this allows
one to configure a smaller than minimum allowed by RFCs or even bigger
than interface own MTU, which is a problem as it may lead to packet
drops.
If you have a daemon like NetworkManager running... |
static int shash_async_update(struct ahash_request *req)
{
return shash_ahash_update(req, ahash_request_ctx(req));
} | 0 | [
"CWE-787"
] | linux | af3ff8045bbf3e32f1a448542e73abb4c8ceb6f1 | 130,974,852,476,815,960,000,000,000,000,000,000,000 | 4 | crypto: hmac - require that the underlying hash algorithm is unkeyed
Because the HMAC template didn't check that its underlying hash
algorithm is unkeyed, trying to use "hmac(hmac(sha3-512-generic))"
through AF_ALG or through KEYCTL_DH_COMPUTE resulted in the inner HMAC
being used without having been keyed, resulting ... |
MagickExport Image *MorphImages(const Image *image,const size_t number_frames,
ExceptionInfo *exception)
{
#define MorphImageTag "Morph/Image"
double
alpha,
beta;
Image
*morph_image,
*morph_images;
MagickBooleanType
status;
MagickOffsetType
scene;
register const Image
*next... | 0 | [
"CWE-119",
"CWE-703"
] | ImageMagick | 3cbfb163cff9e5b8cdeace8312e9bfee810ed02b | 317,196,653,071,172,170,000,000,000,000,000,000,000 | 205 | https://github.com/ImageMagick/ImageMagick/issues/296 |
hashTableIterInit(HASH_TABLE_ITER *iter, const HASH_TABLE *table)
{
iter->p = table->v;
iter->end = iter->p + table->size;
} | 0 | [
"CWE-119"
] | libexpat | ba0f9c3b40c264b8dd392e02a7a060a8fa54f032 | 191,777,532,238,972,530,000,000,000,000,000,000,000 | 5 | CVE-2015-1283 Sanity check size calculations. r=peterv, a=abillings
https://sourceforge.net/p/expat/bugs/528/ |
static void vmxnet3_update_features(VMXNET3State *s)
{
uint32_t guest_features;
int rxcso_supported;
PCIDevice *d = PCI_DEVICE(s);
guest_features = VMXNET3_READ_DRV_SHARED32(d, s->drv_shmem,
devRead.misc.uptFeatures);
rxcso_supported = VMXNET_FLAG_IS_... | 0 | [
"CWE-416"
] | qemu | 6c352ca9b4ee3e1e286ea9e8434bd8e69ac7d0d8 | 240,357,785,018,875,650,000,000,000,000,000,000,000 | 25 | net: vmxnet3: check for device_active before write
Vmxnet3 device emulator does not check if the device is active,
before using it for write. It leads to a use after free issue,
if the vmxnet3_io_bar0_write routine is called after the device is
deactivated. Add check to avoid it.
Reported-by: Li Qiang <liqiang6-s@360... |
void Http2Session::OnStreamAfterWrite(WriteWrap* w, int status) {
Debug(this, "write finished with status %d", status);
CHECK_NE(flags_ & SESSION_STATE_WRITE_IN_PROGRESS, 0);
flags_ &= ~SESSION_STATE_WRITE_IN_PROGRESS;
// Inform all pending writes about their completion.
ClearOutgoing(status);
if ((flags... | 0 | [
"CWE-416"
] | node | 7f178663ebffc82c9f8a5a1b6bf2da0c263a30ed | 147,285,837,759,140,550,000,000,000,000,000,000,000 | 26 | src: use unique_ptr for WriteWrap
This commit attempts to avoid a use-after-free error by using unqiue_ptr
and passing a reference to it.
CVE-ID: CVE-2020-8265
Fixes: https://github.com/nodejs-private/node-private/issues/227
PR-URL: https://github.com/nodejs-private/node-private/pull/238
Reviewed-By: Michael Dawson <... |
static length_t compress_packet(uint8_t *dest, const uint8_t *source, length_t len, int level) {
if(level == 0) {
memcpy(dest, source, len);
return len;
} else if(level == 10) {
#ifdef HAVE_LZO
lzo_uint lzolen = MAXSIZE;
lzo1x_1_compress(source, len, dest, &lzolen, lzo_wrkmem);
return lzolen;
#else
return... | 0 | [
"CWE-200",
"CWE-119"
] | tinc | 17a33dfd95b1a29e90db76414eb9622df9632320 | 34,974,180,472,528,233,000,000,000,000,000,000,000 | 32 | Drop packets forwarded via TCP if they are too big (CVE-2013-1428).
Normally all requests sent via the meta connections are checked so that they
cannot be larger than the input buffer. However, when packets are forwarded via
meta connections, they are copied into a packet buffer without checking whether
it fits into i... |
win_size_save(garray_T *gap)
{
win_T *wp;
ga_init2(gap, sizeof(int), 1);
if (ga_grow(gap, win_count() * 2 + 1) == OK)
{
// first entry is value of 'lines'
((int *)gap->ga_data)[gap->ga_len++] = Rows;
FOR_ALL_WINDOWS(wp)
{
((int *)gap->ga_data)[gap->ga_len++] =
wp->w_width + wp->w... | 0 | [
"CWE-476"
] | vim | 0f6e28f686dbb59ab3b562408ab9b2234797b9b1 | 258,252,262,283,350,900,000,000,000,000,000,000,000 | 19 | 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. |
ffi_prep_closure_loc (ffi_closure *closure,
ffi_cif* cif,
void (*fun)(ffi_cif*,void*,void**,void*),
void *user_data,
void *codeloc)
{
if (cif->abi != FFI_SYSV)
return FFI_BAD_ABI;
void (*start)(void);
if (cif->flags & ... | 1 | [
"CWE-787"
] | libffi | 44a6c28545186d78642487927952844156fc7ab5 | 72,372,105,978,015,390,000,000,000,000,000,000,000 | 43 | aarch64: Flush code mapping in addition to data mapping (#471)
This needs a new function, ffi_data_to_code_pointer, to translate
from data pointers to code pointers.
Fixes issue #470. |
static int bnx2x_eeh_nic_unload(struct bnx2x *bp)
{
bp->state = BNX2X_STATE_CLOSING_WAIT4_HALT;
bp->rx_mode = BNX2X_RX_MODE_NONE;
if (CNIC_LOADED(bp))
bnx2x_cnic_notify(bp, CNIC_CTL_STOP_CMD);
/* Stop Tx */
bnx2x_tx_disable(bp);
/* Delete all NAPI objects */
bnx2x_del_all_napi(bp);
if (CNIC_LOADED(bp))
b... | 0 | [
"CWE-20"
] | linux | 8914a595110a6eca69a5e275b323f5d09e18f4f9 | 176,514,646,490,984,150,000,000,000,000,000,000,000 | 32 | bnx2x: disable GSO where gso_size is too big for hardware
If a bnx2x card is passed a GSO packet with a gso_size larger than
~9700 bytes, it will cause a firmware error that will bring the card
down:
bnx2x: [bnx2x_attn_int_deasserted3:4323(enP24p1s0f0)]MC assert!
bnx2x: [bnx2x_mc_assert:720(enP24p1s0f0)]XSTORM_ASSERT... |
Capitalise(str) /* return a pointer to an capitalised */
register char *str;
{
register char *ptr;
static char area[STRINGSIZE];
ptr = area;
while (*str)
{
*(ptr++) = CRACK_TOLOWER(*str);
str++;
}
*ptr = '\0';
area[0] = CRACK_TOUPPER(area[0]);
return (area);
} | 0 | [
"CWE-787"
] | cracklib | 33d7fa4585247cd2247a1ffa032ad245836c6edb | 195,376,495,587,849,340,000,000,000,000,000,000,000 | 17 | Fix a buffer overflow processing long words
A buffer overflow processing long words has been discovered. This commit
applies the patch from
https://build.opensuse.org/package/view_file/Base:System/cracklib/0004-overflow-processing-long-words.patch
by Howard Guo.
See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=8... |
PHP_FUNCTION(imagesettile)
{
zval *IM, *TILE;
gdImagePtr im, tile;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &IM, &TILE) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(im, gdImagePtr, &IM, -1, "Image", le_gd);
ZEND_FETCH_RESOURCE(tile, gdImagePtr, &TILE, -1, "Image", le_gd);
gdImageSetTile(im,... | 0 | [
"CWE-703",
"CWE-189"
] | php-src | 2938329ce19cb8c4197dec146c3ec887c6f61d01 | 46,179,862,772,766,540,000,000,000,000,000,000,000 | 16 | Fixed bug #66356 (Heap Overflow Vulnerability in imagecrop())
And also fixed the bug: arguments are altered after some calls |
static inline void extwriter_counter_inc(struct btrfs_transaction *trans,
unsigned int type)
{
if (type & TRANS_EXTWRITERS)
atomic_inc(&trans->num_extwriters);
} | 0 | [
"CWE-703",
"CWE-667"
] | linux | 1cb3db1cf383a3c7dbda1aa0ce748b0958759947 | 41,473,687,920,018,280,000,000,000,000,000,000,000 | 6 | btrfs: fix deadlock with concurrent chunk allocations involving system chunks
When a task attempting to allocate a new chunk verifies that there is not
currently enough free space in the system space_info and there is another
task that allocated a new system chunk but it did not finish yet the
creation of the respecti... |
FindAnchorVolumeDescriptorPointer (
IN EFI_BLOCK_IO_PROTOCOL *BlockIo,
IN EFI_DISK_IO_PROTOCOL *DiskIo,
OUT UDF_ANCHOR_VOLUME_DESCRIPTOR_POINTER *AnchorPoint,
OUT EFI_LBA *LastRecordedBlock
)
{
EFI_STATUS ... | 1 | [] | edk2 | 4df8f5bfa28b8b881e506437e8f08d92c1a00370 | 107,604,175,535,655,930,000,000,000,000,000,000,000 | 183 | MdeModulePkg/PartitionDxe: Add check for underlying device block size
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=828
Within FindAnchorVolumeDescriptorPointer():
Add a check for the underlying device block size to ensure it is greater
than the size of an Anchor Volume Descriptor Pointer.
Cc: Ruiyu Ni <ruiyu.... |
static void init_buffer_callbacks(vpx_codec_alg_priv_t *ctx) {
VP9_COMMON *const cm = &ctx->pbi->common;
BufferPool *const pool = cm->buffer_pool;
cm->new_fb_idx = INVALID_IDX;
cm->byte_alignment = ctx->byte_alignment;
cm->skip_loop_filter = ctx->skip_loop_filter;
if (ctx->get_ext_fb_cb != NULL && ctx->re... | 0 | [
"CWE-125"
] | libvpx | 0681cff1ad36b3ef8ec242f59b5a6c4234ccfb88 | 279,190,036,839,196,140,000,000,000,000,000,000,000 | 23 | vp9: fix OOB read in decoder_peek_si_internal
Profile 1 or 3 bitstreams may require 11 bytes for the header in the
intra-only case.
Additionally add a check on the bit reader's error handler callback to
ensure it's non-NULL before calling to avoid future regressions.
This has existed since at least (pre-1.4.0):
09bf... |
GF_Err co64_box_write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
u32 i;
GF_ChunkLargeOffsetBox *ptr = (GF_ChunkLargeOffsetBox *) s;
e = gf_isom_full_box_write(s, bs);
if (e) return e;
gf_bs_write_u32(bs, ptr->nb_entries);
for (i = 0; i < ptr->nb_entries; i++ ) {
gf_bs_write_u64(bs, ptr->offsets[i]);
}
return ... | 0 | [
"CWE-787"
] | gpac | 388ecce75d05e11fc8496aa4857b91245007d26e | 4,880,008,120,904,665,000,000,000,000,000,000,000 | 14 | fixed #1587 |
static bool kvm_age_rmapp(struct kvm *kvm, struct kvm_rmap_head *rmap_head,
struct kvm_memory_slot *slot, gfn_t gfn, int level,
pte_t unused)
{
u64 *sptep;
struct rmap_iterator iter;
int young = 0;
for_each_rmap_spte(rmap_head, &iter, sptep)
young |= mmu_spte_age(sptep);
return young;
} | 0 | [
"CWE-476"
] | linux | 9f46c187e2e680ecd9de7983e4d081c3391acc76 | 252,316,118,626,794,060,000,000,000,000,000,000,000 | 13 | KVM: x86/mmu: fix NULL pointer dereference on guest INVPCID
With shadow paging enabled, the INVPCID instruction results in a call
to kvm_mmu_invpcid_gva. If INVPCID is executed with CR0.PG=0, the
invlpg callback is not set and the result is a NULL pointer dereference.
Fix it trivially by checking for mmu->invlpg befo... |
pxa3xx_gcu_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
unsigned long flags;
struct pxa3xx_gcu_priv *priv = to_pxa3xx_gcu_priv(file);
switch (cmd) {
case PXA3XX_GCU_IOCTL_RESET:
spin_lock_irqsave(&priv->spinlock, flags);
pxa3xx_gcu_reset(priv);
spin_unlock_irqrestore(&priv->spinlock, flags... | 0 | [
"CWE-190",
"CWE-703"
] | linux | a09d2d00af53b43c6f11e6ab3cb58443c2cac8a7 | 77,940,488,713,595,430,000,000,000,000,000,000,000 | 18 | video: fbdev: pxa3xx-gcu: Fix integer overflow in pxa3xx_gcu_write
In pxa3xx_gcu_write, a count parameter of type size_t is passed to words of
type int. Then, copy_from_user() may cause a heap overflow because it is used
as the third argument of copy_from_user().
Signed-off-by: Hyunwoo Kim <imv4bel@gmail.com>
Signed... |
void shm_init_ns(struct ipc_namespace *ns)
{
ns->shm_ctlmax = SHMMAX;
ns->shm_ctlall = SHMALL;
ns->shm_ctlmni = SHMMNI;
ns->shm_rmid_forced = 0;
ns->shm_tot = 0;
ipc_init_ids(&shm_ids(ns));
} | 0 | [] | linux | 95e91b831f87ac8e1f8ed50c14d709089b4e01b8 | 40,335,338,601,711,224,000,000,000,000,000,000,000 | 9 | ipc/shm: Fix shmat mmap nil-page protection
The issue is described here, with a nice testcase:
https://bugzilla.kernel.org/show_bug.cgi?id=192931
The problem is that shmat() calls do_mmap_pgoff() with MAP_FIXED, and
the address rounded down to 0. For the regular mmap case, the
protection mentioned above is that... |
bash_dequote_filename (text, quote_char)
char *text;
int quote_char;
{
char *ret, *p, *r;
int l, quoted;
l = strlen (text);
ret = (char *)xmalloc (l + 1);
for (quoted = quote_char, p = text, r = ret; p && *p; p++)
{
/* Allow backslash-escaped characters to pass through unscathed. */
... | 0 | [
"CWE-273",
"CWE-787"
] | bash | 951bdaad7a18cc0dc1036bba86b18b90874d39ff | 122,669,827,956,754,930,000,000,000,000,000,000,000 | 44 | commit bash-20190628 snapshot |
void CLASS fill_holes(int holes)
{
int row, col, val[4];
for (row = 2; row < height - 2; row++)
{
if (!HOLE(row))
continue;
for (col = 1; col < width - 1; col += 4)
{
val[0] = RAW(row - 1, col - 1);
val[1] = RAW(row - 1, col + 1);
val[2] = RAW(row + 1, col - 1);
val[3] =... | 0 | [
"CWE-476",
"CWE-119"
] | LibRaw | d7c3d2cb460be10a3ea7b32e9443a83c243b2251 | 47,505,719,100,664,980,000,000,000,000,000,000,000 | 29 | Secunia SA75000 advisory: several buffer overruns |
void ext4_update_dynamic_rev(struct super_block *sb)
{
struct ext4_super_block *es = EXT4_SB(sb)->s_es;
if (le32_to_cpu(es->s_rev_level) > EXT4_GOOD_OLD_REV)
return;
ext4_warning(sb, __func__,
"updating to rev %d because of new feature flag, "
"running e2fsck is recommended",
EXT4_DYNAMIC_RE... | 0 | [
"CWE-20"
] | linux-2.6 | 4ec110281379826c5cf6ed14735e47027c3c5765 | 331,657,114,710,527,280,000,000,000,000,000,000,000 | 24 | ext4: Add sanity checks for the superblock before mounting the filesystem
This avoids insane superblock configurations that could lead to kernel
oops due to null pointer derefences.
http://bugzilla.kernel.org/show_bug.cgi?id=12371
Thanks to David Maciejak at Fortinet's FortiGuard Global Security
Research Team who di... |
static int snd_timer_user_tselect(struct file *file,
struct snd_timer_select __user *_tselect)
{
struct snd_timer_user *tu;
struct snd_timer_select tselect;
char str[32];
int err = 0;
tu = file->private_data;
if (tu->timeri) {
snd_timer_close(tu->timeri);
tu->timeri = NULL;
}
if (copy_from_user(&tsel... | 1 | [
"CWE-200"
] | linux | ba3021b2c79b2fa9114f92790a99deb27a65b728 | 202,705,296,596,120,630,000,000,000,000,000,000,000 | 55 | ALSA: timer: Fix missing queue indices reset at SNDRV_TIMER_IOCTL_SELECT
snd_timer_user_tselect() reallocates the queue buffer dynamically, but
it forgot to reset its indices. Since the read may happen
concurrently with ioctl and snd_timer_user_tselect() allocates the
buffer via kmalloc(), this may lead to the leak o... |
static inline int security_sb_show_options(struct seq_file *m,
struct super_block *sb)
{
return 0;
} | 0 | [] | linux-2.6 | ee18d64c1f632043a02e6f5ba5e045bb26a5465f | 224,943,230,589,758,200,000,000,000,000,000,000,000 | 5 | KEYS: Add a keyctl to install a process's session keyring on its parent [try #6]
Add a keyctl to install a process's session keyring onto its parent. This
replaces the parent's session keyring. Because the COW credential code does
not permit one process to change another process's credentials directly, the
change is... |
static int __init dn_rtmsg_init(void)
{
int rv = 0;
struct netlink_kernel_cfg cfg = {
.groups = DNRNG_NLGRP_MAX,
.input = dnrmg_receive_user_skb,
};
dnrmg = netlink_kernel_create(&init_net, NETLINK_DNRTMSG, &cfg);
if (dnrmg == NULL) {
printk(KERN_ERR "dn_rtmsg: Cannot create netlink socket");
return -ENOM... | 0 | [
"CWE-264"
] | net | 90f62cf30a78721641e08737bda787552428061e | 260,005,071,796,413,680,000,000,000,000,000,000,000 | 21 | 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.
... |
cb_loglinelen(const union sudo_defs_val *sd_un)
{
debug_decl(cb_loglinelen, SUDOERS_DEBUG_PLUGIN);
eventlog_set_file_maxlen(sd_un->ival);
debug_return_bool(true);
} | 0 | [
"CWE-193"
] | sudo | 1f8638577d0c80a4ff864a2aad80a0d95488e9a8 | 139,109,365,788,480,850,000,000,000,000,000,000,000 | 8 | Fix potential buffer overflow when unescaping backslashes in user_args.
Also, do not try to unescaping backslashes unless in run mode *and*
we are running the command via a shell.
Found by Qualys, this fixes CVE-2021-3156. |
static int initpipe(void)
{
int pipenum;
char *initpipe, *endptr;
initpipe = getenv("_LIBCONTAINER_INITPIPE");
if (initpipe == NULL || *initpipe == '\0')
return -1;
pipenum = strtol(initpipe, &endptr, 10);
if (*endptr != '\0')
bail("unable to parse _LIBCONTAINER_INITPIPE");
return pipenum;
} | 0 | [
"CWE-78",
"CWE-216"
] | runc | 0a8e4117e7f715d5fbeef398405813ce8e88558b | 240,643,697,176,707,970,000,000,000,000,000,000,000 | 15 | nsenter: clone /proc/self/exe to avoid exposing host binary to container
There are quite a few circumstances where /proc/self/exe pointing to a
pretty important container binary is a _bad_ thing, so to avoid this we
have to make a copy (preferably doing self-clean-up and not being
writeable).
We require memfd_create(... |
ATExecClusterOn(Relation rel, const char *indexName, LOCKMODE lockmode)
{
Oid indexOid;
indexOid = get_relname_relid(indexName, rel->rd_rel->relnamespace);
if (!OidIsValid(indexOid))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("index \"%s\" for table \"%s\" does not exist",
indexNa... | 0 | [
"CWE-362"
] | postgres | 5f173040e324f6c2eebb90d86cf1b0cdb5890f0a | 94,567,539,982,643,230,000,000,000,000,000,000,000 | 18 | Avoid repeated name lookups during table and index DDL.
If the name lookups come to different conclusions due to concurrent
activity, we might perform some parts of the DDL on a different table
than other parts. At least in the case of CREATE INDEX, this can be
used to cause the permissions checks to be performed aga... |
static void vdagent_connection_class_init(VDAgentConnectionClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
gobject_class->dispose = vdagent_connection_dispose;
gobject_class->finalize = vdagent_connection_finalize;
} | 0 | [
"CWE-362"
] | spice-vd_agent | 51c415df82a52e9ec033225783c77df95f387891 | 64,266,690,926,333,740,000,000,000,000,000,000,000 | 6 | Avoids user session hijacking
Avoids user hijacking sessions by reusing PID.
In theory an attacker could:
- open a connection to the daemon;
- fork and exit the process but keep the file descriptor open
(inheriting or duplicating it in forked process);
- force OS to recycle the initial PID, by creating many short li... |
njs_data_view_prototype_set(njs_vm_t *vm, njs_value_t *args,
njs_uint_t nargs, njs_index_t type)
{
double v;
uint8_t *u8;
uint32_t u32;
uint64_t index;
njs_int_t ret;
njs_bool_t swap;
njs_value_t *this;
njs_con... | 0 | [
"CWE-703"
] | njs | 5c6130a2a0b4c41ab415f6b8992aa323636338b9 | 287,341,423,290,750,500,000,000,000,000,000,000,000 | 106 | Fixed Array.prototype.fill() for typed-arrays.
This closes #478 issue on Github. |
static inline int security_task_fix_setuid(struct cred *new,
const struct cred *old,
int flags)
{
return cap_task_fix_setuid(new, old, flags);
} | 0 | [] | linux-2.6 | ee18d64c1f632043a02e6f5ba5e045bb26a5465f | 246,307,427,085,298,800,000,000,000,000,000,000,000 | 6 | 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... |
control_pcsc (int slot, pcsc_dword_t ioctl_code,
const unsigned char *cntlbuf, size_t len,
unsigned char *buffer, pcsc_dword_t *buflen)
{
#ifdef NEED_PCSC_WRAPPER
return control_pcsc_wrapped (slot, ioctl_code, cntlbuf, len, buffer, buflen);
#else
return control_pcsc_direct (slot, ioctl_c... | 0 | [
"CWE-20"
] | gnupg | 2183683bd633818dd031b090b5530951de76f392 | 251,690,541,321,882,600,000,000,000,000,000,000,000 | 10 | Use inline functions to convert buffer data to scalars.
* common/host2net.h (buf16_to_ulong, buf16_to_uint): New.
(buf16_to_ushort, buf16_to_u16): New.
(buf32_to_size_t, buf32_to_ulong, buf32_to_uint, buf32_to_u32): New.
--
Commit 91b826a38880fd8a989318585eb502582636ddd8 was not enough to
avoid all sign extension on ... |
void prepareForAccessPlanning(MatchExpression* tree) {
resolveOrPushdowns(tree);
sortUsingTags(tree);
} | 0 | [
"CWE-834"
] | mongo | 94d0e046baa64d1aa1a6af97e2d19bb466cc1ff5 | 141,347,964,068,592,440,000,000,000,000,000,000,000 | 4 | SERVER-38164 $or pushdown optimization does not correctly handle $not within an $elemMatch |
static int snd_hrtimer_stop(struct snd_timer *t)
{
struct snd_hrtimer *stime = t->private_data;
atomic_set(&stime->running, 0);
return 0;
} | 1 | [
"CWE-20"
] | linux | 2ba1fe7a06d3624f9a7586d672b55f08f7c670f3 | 233,184,886,515,704,900,000,000,000,000,000,000,000 | 6 | ALSA: hrtimer: Fix stall by hrtimer_cancel()
hrtimer_cancel() waits for the completion from the callback, thus it
must not be called inside the callback itself. This was already a
problem in the past with ALSA hrtimer driver, and the early commit
[fcfdebe70759: ALSA: hrtimer - Fix lock-up] tried to address it.
Howev... |
onig_number_of_captures(regex_t* reg)
{
return reg->num_mem;
} | 0 | [
"CWE-125"
] | oniguruma | 690313a061f7a4fa614ec5cc8368b4f2284e059b | 192,062,948,952,794,460,000,000,000,000,000,000,000 | 4 | fix #57 : DATA_ENSURE() check must be before data access |
_equalReindexStmt(const ReindexStmt *a, const ReindexStmt *b)
{
COMPARE_SCALAR_FIELD(kind);
COMPARE_NODE_FIELD(relation);
COMPARE_STRING_FIELD(name);
COMPARE_SCALAR_FIELD(do_system);
COMPARE_SCALAR_FIELD(do_user);
return true;
} | 0 | [
"CWE-362"
] | postgres | 5f173040e324f6c2eebb90d86cf1b0cdb5890f0a | 329,312,794,439,646,100,000,000,000,000,000,000,000 | 10 | Avoid repeated name lookups during table and index DDL.
If the name lookups come to different conclusions due to concurrent
activity, we might perform some parts of the DDL on a different table
than other parts. At least in the case of CREATE INDEX, this can be
used to cause the permissions checks to be performed aga... |
bool isinf(double x) {
return _isinf(x);
} | 0 | [
"CWE-190"
] | icu | 53d8c8f3d181d87a6aa925b449b51c4a2c922a51 | 245,039,643,619,068,850,000,000,000,000,000,000,000 | 3 | ICU-20246 Fixing another integer overflow in number parsing. |
bool StringMatching::matchString(const char* str1, const char* str2)
{
if(PathMatchSpec(str1,str2))
return true;
if(PathMatchSpec(str2,str1))
return true;
return false;
} | 1 | [
"CWE-284"
] | Fast-DDS | d2aeab37eb4fad4376b68ea4dfbbf285a2926384 | 295,994,857,779,518,440,000,000,000,000,000,000,000 | 8 | check remote permissions (#1387)
* Refs 5346. Blackbox test
Signed-off-by: Iker Luengo <ikerluengo@eprosima.com>
* Refs 5346. one-way string compare
Signed-off-by: Iker Luengo <ikerluengo@eprosima.com>
* Refs 5346. Do not add partition separator on last partition
Signed-off-by: Iker Luengo <ikerluengo@e... |
rsvg_cairo_push_render_stack (RsvgDrawingCtx * ctx)
{
/* XXX: Untested, probably needs help wrt filters */
RsvgCairoRender *render = RSVG_CAIRO_RENDER (ctx->render);
cairo_surface_t *surface;
cairo_t *child_cr;
RsvgBbox *bbox;
RsvgState *state = rsvg_current_state (ctx);
gboolean lateclip =... | 0 | [
"CWE-20"
] | librsvg | d1c9191949747f6dcfd207831d15dd4ba00e31f2 | 27,788,108,973,833,924,000,000,000,000,000,000,000 | 50 | state: Store mask as reference
Instead of immediately looking up the mask, store the reference and look
it up on use. |
static int tight_fill_palette(VncState *vs, int x, int y,
size_t count, uint32_t *bg, uint32_t *fg,
VncPalette **palette)
{
int max;
max = count / tight_conf[vs->tight.compression].idx_max_colors_divisor;
if (max < 2 &&
count >= tight_conf... | 1 | [
"CWE-125"
] | qemu | 9f64916da20eea67121d544698676295bbb105a7 | 199,168,057,779,989,000,000,000,000,000,000,000,000 | 26 | pixman/vnc: use pixman images in vnc.
The vnc code uses *three* DisplaySurfaces:
First is the surface of the actual QemuConsole, usually the guest
screen, but could also be a text console (monitor/serial reachable via
Ctrl-Alt-<nr> keys). This is left as-is.
Second is the current server's view of the screen content... |
static vpx_codec_err_t decoder_destroy(vpx_codec_alg_priv_t *ctx) {
if (ctx->pbi != NULL) {
vp9_decoder_remove(ctx->pbi);
}
if (ctx->buffer_pool) {
vp9_free_ref_frame_buffers(ctx->buffer_pool);
vp9_free_internal_frame_buffers(&ctx->buffer_pool->int_frame_buffers);
}
vpx_free(ctx->buffer_pool);
... | 0 | [
"CWE-125"
] | libvpx | 0681cff1ad36b3ef8ec242f59b5a6c4234ccfb88 | 336,473,619,523,120,100,000,000,000,000,000,000,000 | 14 | vp9: fix OOB read in decoder_peek_si_internal
Profile 1 or 3 bitstreams may require 11 bytes for the header in the
intra-only case.
Additionally add a check on the bit reader's error handler callback to
ensure it's non-NULL before calling to avoid future regressions.
This has existed since at least (pre-1.4.0):
09bf... |
virDomainChrFind(virDomainDefPtr def,
virDomainChrDefPtr target)
{
virDomainChrDefPtr chr;
const virDomainChrDef **arrPtr;
size_t i, cnt;
virDomainChrGetDomainPtrs(def, target->deviceType, &arrPtr, &cnt);
for (i = 0; i < cnt; i++) {
/* Cast away const */
chr = (vir... | 0 | [
"CWE-212"
] | libvirt | a5b064bf4b17a9884d7d361733737fb614ad8979 | 296,523,678,444,172,900,000,000,000,000,000,000,000 | 17 | conf: Don't format http cookies unless VIR_DOMAIN_DEF_FORMAT_SECURE is used
Starting with 3b076391befc3fe72deb0c244ac6c2b4c100b410
(v6.1.0-122-g3b076391be) we support http cookies. Since they may contain
somewhat sensitive information we should not format them into the XML
unless VIR_DOMAIN_DEF_FORMAT_SECURE is assert... |
void nfs_access_zap_cache(struct inode *inode)
{
/* Remove from global LRU init */
if (test_and_clear_bit(NFS_INO_ACL_LRU_SET, &NFS_FLAGS(inode))) {
spin_lock(&nfs_access_lru_lock);
list_del_init(&NFS_I(inode)->access_cache_inode_lru);
spin_unlock(&nfs_access_lru_lock);
}
spin_lock(&inode->i_lock);
/* This ... | 0 | [
"CWE-20"
] | linux-2.6 | 54af3bb543c071769141387a42deaaab5074da55 | 264,423,125,513,845,800,000,000,000,000,000,000,000 | 13 | NFS: Fix an Oops in encode_lookup()
It doesn't look as if the NFS file name limit is being initialised correctly
in the struct nfs_server. Make sure that we limit whatever is being set in
nfs_probe_fsinfo() and nfs_init_server().
Also ensure that readdirplus and nfs4_path_walk respect our file name
limits.
Signed-of... |
static void bcm_remove_op(struct bcm_op *op)
{
hrtimer_cancel(&op->timer);
hrtimer_cancel(&op->thrtimer);
if ((op->frames) && (op->frames != &op->sframe))
kfree(op->frames);
if ((op->last_frames) && (op->last_frames != &op->last_sframe))
kfree(op->last_frames);
kfree(op);
} | 0 | [
"CWE-362"
] | linux | d5f9023fa61ee8b94f37a93f08e94b136cf1e463 | 2,129,044,097,472,312,500,000,000,000,000,000,000 | 13 | can: bcm: delay release of struct bcm_op after synchronize_rcu()
can_rx_register() callbacks may be called concurrently to the call to
can_rx_unregister(). The callbacks and callback data, though, are
protected by RCU and the struct sock reference count.
So the callback data is really attached to the life of sk, mean... |
static int recv_msg(struct kiocb *iocb, struct socket *sock,
struct msghdr *m, size_t buf_len, int flags)
{
struct sock *sk = sock->sk;
struct tipc_port *tport = tipc_sk_port(sk);
struct sk_buff *buf;
struct tipc_msg *msg;
long timeout;
unsigned int sz;
u32 err;
int res;
/* Catch invalid receive request... | 1 | [
"CWE-200"
] | linux | 60085c3d009b0df252547adb336d1ccca5ce52ec | 58,364,694,776,604,840,000,000,000,000,000,000,000 | 93 | tipc: fix info leaks via msg_name in recv_msg/recv_stream
The code in set_orig_addr() does not initialize all of the members of
struct sockaddr_tipc when filling the sockaddr info -- namely the union
is only partly filled. This will make recv_msg() and recv_stream() --
the only users of this function -- leak kernel st... |
CImg<T>& assign(const unsigned int size_x, const unsigned int size_y,
const unsigned int size_z, const unsigned int size_c,
const int value0, const int value1, ...) {
assign(size_x,size_y,size_z,size_c);
_CImg_stdarg(*this,value0,value1,safe_size(size_x,size_y,siz... | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 113,105,825,236,084,000,000,000,000,000,000,000,000 | 7 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
ctnetlink_glue_build(struct sk_buff *skb, struct nf_conn *ct,
enum ip_conntrack_info ctinfo,
u_int16_t ct_attr, u_int16_t ct_info_attr)
{
struct nlattr *nest_parms;
nest_parms = nla_nest_start(skb, ct_attr);
if (!nest_parms)
goto nla_put_failure;
if (__ctnetlink_glue_build(skb, ct) < 0)
goto nla... | 0 | [
"CWE-120"
] | linux | 1cc5ef91d2ff94d2bf2de3b3585423e8a1051cb6 | 49,249,412,944,894,520,000,000,000,000,000,000,000 | 23 | netfilter: ctnetlink: add a range check for l3/l4 protonum
The indexes to the nf_nat_l[34]protos arrays come from userspace. So
check the tuple's family, e.g. l3num, when creating the conntrack in
order to prevent an OOB memory access during setup. Here is an example
kernel panic on 4.14.180 when userspace passes in ... |
static bool parse_braces(decoflags_t *decoflags)
{
int i, j;
i = tokval.t_type;
while (true) {
switch (i) {
case TOKEN_OPMASK:
if (*decoflags & OPMASK_MASK) {
nasm_nonfatal("opmask k%"PRIu64" is already set",
*decoflags & OPMASK_MAS... | 0 | [
"CWE-416"
] | nasm | 6ac6ac57e3d01ea8ed4ea47706eb724b59176461 | 174,993,525,246,357,700,000,000,000,000,000,000,000 | 44 | parser: when flattening an eop, must preserve any data buffer
An eop may have a data buffer associated with it as part of the same
memory allocation. Therefore, we need to move "subexpr" up instead of
merging it into "eop".
This *partially* resolves BR 3392707, but that test case still
triggers a violation when using... |
void NumberFormatTest::runIndexedTest( int32_t index, UBool exec, const char* &name, char* /*par*/ )
{
TESTCASE_AUTO_BEGIN;
TESTCASE_AUTO(TestCurrencySign);
TESTCASE_AUTO(TestCurrency);
TESTCASE_AUTO(TestParse);
TESTCASE_AUTO(TestRounding487);
TESTCASE_AUTO(TestQuotes);
TESTCASE_AUTO(TestExponential);
T... | 0 | [
"CWE-190"
] | icu | 53d8c8f3d181d87a6aa925b449b51c4a2c922a51 | 160,775,609,167,252,990,000,000,000,000,000,000,000 | 137 | ICU-20246 Fixing another integer overflow in number parsing. |
on_email_address_or_password_changed (GtkEditable *editable, gpointer user_data)
{
AddAccountData *data = user_data;
gboolean can_add;
const gchar *email;
gchar *domain;
gchar *url;
gchar *username;
can_add = FALSE;
domain = NULL;
url = NULL;
username = NULL;
email = gtk_entry_get_text (GTK_ENTR... | 0 | [
"CWE-310"
] | gnome-online-accounts | edde7c63326242a60a075341d3fea0be0bc4d80e | 66,755,222,838,098,980,000,000,000,000,000,000,000 | 32 | 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... |
static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int target)
{
struct sched_domain *this_sd;
u64 avg_cost, avg_idle;
u64 time, cost;
s64 delta;
int cpu, nr = INT_MAX;
int this = smp_processor_id();
this_sd = rcu_dereference(*this_cpu_ptr(&sd_llc));
if (!this_sd)
return -1;
/*
* ... | 0 | [
"CWE-416"
] | linux | 16d51a590a8ce3befb1308e0e7ab77f3b661af33 | 78,761,785,026,609,020,000,000,000,000,000,000,000 | 49 | sched/fair: Don't free p->numa_faults with concurrent readers
When going through execve(), zero out the NUMA fault statistics instead of
freeing them.
During execve, the task is reachable through procfs and the scheduler. A
concurrent /proc/*/sched reader can read data from a freed ->numa_faults
allocation (confirmed... |
static void signal_delivered(struct ksignal *ksig, int stepping)
{
sigset_t blocked;
/* A signal was successfully delivered, and the
saved sigmask was stored on the signal frame,
and will be restored by sigreturn. So we can
simply clear the restore sigmask flag. */
clear_restore_sigmask();
sigorsets... | 0 | [
"CWE-119",
"CWE-787"
] | linux | 4ea77014af0d6205b05503d1c7aac6eace11d473 | 132,721,459,896,624,120,000,000,000,000,000,000,000 | 16 | kernel/signal.c: avoid undefined behaviour in kill_something_info
When running kill(72057458746458112, 0) in userspace I hit the following
issue.
UBSAN: Undefined behaviour in kernel/signal.c:1462:11
negation of -2147483648 cannot be represented in type 'int':
CPU: 226 PID: 9849 Comm: test Tainted: G B ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.