func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
void msetGenericCommand(client *c, int nx) {
int j;
if ((c->argc % 2) == 0) {
addReplyError(c,"wrong number of arguments for MSET");
return;
}
/* Handle the NX flag. The MSETNX semantic is to return zero and don't
* set anything if at least one key already exists. */
if (nx) {... | 0 | [
"CWE-190"
] | redis | 92e3b1802f72ca0c5b0bde97f01d9b57a758d85c | 3,273,439,207,418,615,700,000,000,000,000,000,000 | 27 | Fix integer overflow in STRALGO LCS (CVE-2021-29477)
An integer overflow bug in Redis version 6.0 or newer could be exploited using
the STRALGO LCS command to corrupt the heap and potentially result with remote
code execution.
(cherry picked from commit f0c5f920d0f88bd8aa376a2c05af4902789d1ef9) |
static int process_command(MYSQL_THD thd, LEX_CSTRING event_command,
my_bool consume_event)
{
LEX_CSTRING abort_ret_command= { C_STRING_WITH_LEN("ABORT_RET") };
if (!my_charset_latin1.coll->strnncoll(&my_charset_latin1,
(const uchar *)event_comman... | 0 | [] | mysql-server | 914590c737dab0e3e7d9f023aef4c704a443ed7f | 175,176,651,494,259,860,000,000,000,000,000,000,000 | 40 | Bug#24493829 SETTING THE NULL_AUDIT_EVENT_RECORD CAUSES SEGMENTATION FAULT
Post-push fix. Memory leak fixed (reported by Valgrind). |
static bool kvm_arch_setup_async_pf(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa,
gfn_t gfn)
{
struct kvm_arch_async_pf arch;
arch.token = alloc_apf_token(vcpu);
arch.gfn = gfn;
arch.direct_map = vcpu->arch.mmu->direct_map;
arch.cr3 = vcpu->arch.mmu->get_guest_pgd(vcpu);
return kvm_setup_async_pf(vcpu, cr2_o... | 0 | [
"CWE-476"
] | linux | 9f46c187e2e680ecd9de7983e4d081c3391acc76 | 266,152,863,711,183,070,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... |
PHP_METHOD(Phar, convertToExecutable)
{
char *ext = NULL;
int is_data;
size_t ext_len = 0;
php_uint32 flags;
zend_object *ret;
/* a number that is not 0, 1 or 2 (Which is also Greg's birthday, so there) */
zend_long format = 9021976, method = 9021976;
PHAR_ARCHIVE_OBJECT();
if (zend_parse_parameters(ZEND_NUM_... | 0 | [
"CWE-20"
] | php-src | 1e9b175204e3286d64dfd6c9f09151c31b5e099a | 38,477,760,376,438,534,000,000,000,000,000,000,000 | 97 | Fix bug #71860: Require valid paths for phar filenames |
copy_text_attr(
int off,
char_u *buf,
int len,
int attr)
{
int i;
mch_memmove(ScreenLines + off, buf, (size_t)len);
if (enc_utf8)
vim_memset(ScreenLinesUC + off, 0, sizeof(u8char_T) * (size_t)len);
for (i = 0; i < len; ++i)
ScreenAttrs[off + i] = attr;
} | 0 | [
"CWE-122"
] | vim | 826bfe4bbd7594188e3d74d2539d9707b1c6a14b | 290,830,325,325,424,480,000,000,000,000,000,000,000 | 14 | patch 8.2.3487: illegal memory access if buffer name is very long
Problem: Illegal memory access if buffer name is very long.
Solution: Make sure not to go over the end of the buffer. |
static inline void expire_data_free(struct expire_data *data) {
if (!data)
return;
safe_close(data->dev_autofs_fd);
safe_close(data->ioctl_fd);
free(data);
} | 0 | [
"CWE-362"
] | systemd | e7d54bf58789545a9eb0b3964233defa0b007318 | 4,369,431,581,797,274,600,000,000,000,000,000,000 | 8 | automount: ack automount requests even when already mounted (#5916)
If a process accesses an autofs filesystem while systemd is in the
middle of starting the mount unit on top of it, it is possible for the
autofs_ptype_missing_direct request from the kernel to be received after
the mount unit has been fully started... |
virDomainDelIOThread(virDomainPtr domain,
unsigned int iothread_id,
unsigned int flags)
{
virConnectPtr conn;
VIR_DOMAIN_DEBUG(domain, "iothread_id=%u, flags=%x", iothread_id, flags);
virResetLastError();
virCheckDomainReturn(domain, -1);
virCheckReadOnly... | 0 | [
"CWE-254"
] | libvirt | 506e9d6c2d4baaf580d489fff0690c0ff2ff588f | 172,478,135,843,154,140,000,000,000,000,000,000,000 | 30 | virDomainGetTime: Deny on RO connections
We have a policy that if API may end up talking to a guest agent
it should require RW connection. We don't obey the rule in
virDomainGetTime().
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> |
DocumentSourceLookUp::DocumentSourceLookUp(NamespaceString fromNs,
std::string as,
std::vector<BSONObj> pipeline,
BSONObj letVariables,
const boost:... | 0 | [
"CWE-416"
] | mongo | d6133a3a5464fac202f512b0310dfeb200c126f9 | 128,616,807,683,523,480,000,000,000,000,000,000,000 | 28 | SERVER-43350 $lookup with no local default or user-specified collation should explicitly set the simple collation on the foreign expression context |
static int b43_validate_chipaccess(struct b43_wldev *dev)
{
u32 v, backup0, backup4;
backup0 = b43_shm_read32(dev, B43_SHM_SHARED, 0);
backup4 = b43_shm_read32(dev, B43_SHM_SHARED, 4);
/* Check for read/write and endianness problems. */
b43_shm_write32(dev, B43_SHM_SHARED, 0, 0x55AAAA55);
if (b43_shm_read32(dev... | 0 | [
"CWE-134"
] | wireless | 9538cbaab6e8b8046039b4b2eb6c9d614dc782bd | 15,118,307,960,996,430,000,000,000,000,000,000,000 | 55 | b43: stop format string leaking into error msgs
The module parameter "fwpostfix" is userspace controllable, unfiltered,
and is used to define the firmware filename. b43_do_request_fw() populates
ctx->errors[] on error, containing the firmware filename. b43err()
parses its arguments as a format string. For systems with... |
static word32 SetBitString16Bit(word16 val, byte* output)
{
word32 idx;
int len;
byte lastByte;
byte unusedBits = 0;
if ((val >> 8) != 0) {
len = 2;
lastByte = (byte)(val >> 8);
}
else {
len = 1;
lastByte = (byte)val;
}
while (((lastByte >> un... | 0 | [
"CWE-125",
"CWE-345"
] | wolfssl | f93083be72a3b3d956b52a7ec13f307a27b6e093 | 319,595,743,258,333,050,000,000,000,000,000,000,000 | 26 | OCSP: improve handling of OCSP no check extension |
GF_Err gf_isom_set_visual_color_info(GF_ISOFile *movie, u32 trackNumber, u32 StreamDescriptionIndex, u32 colour_type, u16 colour_primaries, u16 transfer_characteristics, u16 matrix_coefficients, Bool full_range_flag, u8 *icc_data, u32 icc_size)
{
GF_Err e;
GF_TrackBox *trak;
GF_SampleEntryBox *entry;
GF_SampleDescr... | 0 | [
"CWE-476"
] | gpac | ebfa346eff05049718f7b80041093b4c5581c24e | 115,063,983,844,803,200,000,000,000,000,000,000,000 | 53 | fixed #1706 |
void SQLiteDBInstance::init() {
primary_ = false;
openOptimized(db_);
} | 0 | [
"CWE-77",
"CWE-295"
] | osquery | c3f9a3dae22d43ed3b4f6a403cbf89da4cba7c3c | 205,561,467,745,950,050,000,000,000,000,000,000,000 | 4 | Merge pull request from GHSA-4g56-2482-x7q8
* Proposed fix for attach tables vulnerability
* Add authorizer to ATC tables and cleanups
- Add unit test for authorizer function |
NTSTATUS posix_fget_nt_acl(struct files_struct *fsp, uint32_t security_info,
SEC_DESC **ppdesc)
{
SMB_STRUCT_STAT sbuf;
SMB_ACL_T posix_acl = NULL;
struct pai_val *pal;
*ppdesc = NULL;
DEBUG(10,("posix_fget_nt_acl: called for file %s\n", fsp->fsp_name ));
/* can it happen that fsp_name == NULL ? */
if (... | 0 | [
"CWE-264"
] | samba | d6c28913f3109d1327a3d1369b6eafd3874b2dca | 3,526,075,031,887,491,500,000,000,000,000,000,000 | 30 | Bug 6488: acl_group_override() call in posix acls references an uninitialized variable.
(cherry picked from commit f92195e3a1baaddda47a5d496f9488c8445b41ad) |
GF_Err txtc_box_size(GF_Box *s)
{
GF_TextConfigBox *ptr = (GF_TextConfigBox *)s;
if (ptr->config)
ptr->size += strlen(ptr->config);
ptr->size++;
return GF_OK; | 0 | [
"CWE-787"
] | gpac | 388ecce75d05e11fc8496aa4857b91245007d26e | 169,374,128,788,365,450,000,000,000,000,000,000,000 | 8 | fixed #1587 |
void set_ndpi_flow_malloc(void *(*__ndpi_flow_malloc)(size_t size)) {
_ndpi_flow_malloc = __ndpi_flow_malloc;
} | 0 | [
"CWE-416",
"CWE-787"
] | nDPI | 6a9f5e4f7c3fd5ddab3e6727b071904d76773952 | 40,894,725,048,518,080,000,000,000,000,000,000,000 | 3 | Fixed use after free caused by dangling pointer
* This fix also improved RCE Injection detection
Signed-off-by: Toni Uhlig <matzeton@googlemail.com> |
static void wait_for_snapshot_creation(struct btrfs_root *root)
{
while (true) {
int ret;
ret = btrfs_start_write_no_snapshoting(root);
if (ret)
break;
wait_on_atomic_t(&root->will_be_snapshoted,
wait_snapshoting_atomic_t,
TASK_UNINTERRUPTIBLE);
}
} | 0 | [
"CWE-200"
] | linux | 0305cd5f7fca85dae392b9ba85b116896eb7c1c7 | 172,943,824,282,263,470,000,000,000,000,000,000,000 | 13 | Btrfs: fix truncation of compressed and inlined extents
When truncating a file to a smaller size which consists of an inline
extent that is compressed, we did not discard (or made unusable) the
data between the new file size and the old file size, wasting metadata
space and allowing for the truncated data to be leaked... |
check_LEARN(const struct ofpact_learn *a,
const struct ofpact_check_params *cp)
{
return learn_check(a, cp->match);
} | 0 | [
"CWE-416"
] | ovs | 77cccc74deede443e8b9102299efc869a52b65b2 | 252,446,886,058,440,000,000,000,000,000,000,000,000 | 5 | ofp-actions: Fix use-after-free while decoding RAW_ENCAP.
While decoding RAW_ENCAP action, decode_ed_prop() might re-allocate
ofpbuf if there is no enough space left. However, function
'decode_NXAST_RAW_ENCAP' continues to use old pointer to 'encap'
structure leading to write-after-free and incorrect decoding.
==3... |
xfs_getbmap_format(void **ap, struct getbmapx *bmv, int *full)
{
struct getbmap __user *base = *ap;
/* copy only getbmap portion (not getbmapx) */
if (copy_to_user(base, bmv, sizeof(struct getbmap)))
return XFS_ERROR(EFAULT);
*ap += sizeof(struct getbmap);
return 0;
} | 0 | [
"CWE-200"
] | linux-2.6 | af24ee9ea8d532e16883251a6684dfa1be8eec29 | 117,086,212,977,187,900,000,000,000,000,000,000,000 | 11 | xfs: zero proper structure size for geometry calls
Commit 493f3358cb289ccf716c5a14fa5bb52ab75943e5 added this call to
xfs_fs_geometry() in order to avoid passing kernel stack data back
to user space:
+ memset(geo, 0, sizeof(*geo));
Unfortunately, one of the callers of that function passes the
address of a smal... |
for (p = head; p; ) {
next_node = p->next;
Free(p);
p = next_node;
} | 0 | [
"CWE-189"
] | chrony | 7712455d9aa33d0db0945effaa07e900b85987b1 | 298,735,337,718,626,400,000,000,000,000,000,000,000 | 5 | Fix buffer overflow when processing crafted command packets
When the length of the REQ_SUBNETS_ACCESSED, REQ_CLIENT_ACCESSES
command requests and the RPY_SUBNETS_ACCESSED, RPY_CLIENT_ACCESSES,
RPY_CLIENT_ACCESSES_BY_INDEX, RPY_MANUAL_LIST command replies is
calculated, the number of items stored in the packet is not v... |
static int jpc_dec_process_siz(jpc_dec_t *dec, jpc_ms_t *ms)
{
jpc_siz_t *siz = &ms->parms.siz;
int compno;
int tileno;
jpc_dec_tile_t *tile;
jpc_dec_tcomp_t *tcomp;
int htileno;
int vtileno;
jpc_dec_cmpt_t *cmpt;
size_t size;
dec->xstart = siz->xoff;
dec->ystart = siz->yoff;
dec->xend = siz->width;
dec->... | 1 | [
"CWE-20",
"CWE-399"
] | jasper | ba2b9d000660313af7b692542afbd374c5685865 | 115,562,972,089,464,580,000,000,000,000,000,000,000 | 103 | Ensure that not all tiles lie outside the image area. |
char *qemu_mac_strdup_printf(const uint8_t *macaddr)
{
return g_strdup_printf("%.2x:%.2x:%.2x:%.2x:%.2x:%.2x",
macaddr[0], macaddr[1], macaddr[2],
macaddr[3], macaddr[4], macaddr[5]);
} | 0 | [
"CWE-190"
] | qemu | 25c01bd19d0e4b66f357618aeefda1ef7a41e21a | 197,054,384,551,309,840,000,000,000,000,000,000,000 | 6 | net: drop too large packet early
We try to detect and drop too large packet (>INT_MAX) in 1592a9947036
("net: ignore packet size greater than INT_MAX") during packet
delivering. Unfortunately, this is not sufficient as we may hit
another integer overflow when trying to queue such large packet in
qemu_net_queue_append_... |
dump_job_history(cupsd_job_t *job) /* I - Job */
{
int i, /* Looping var */
oldsize; /* Current MaxLogSize */
struct tm *date; /* Date/time value */
cupsd_joblog_t *message; /* Current message */
char temp[2048], /* Log message */
*ptr, /* Pointer into log message */
start[256], /* Start time *... | 0 | [] | cups | d47f6aec436e0e9df6554436e391471097686ecc | 130,525,624,792,789,130,000,000,000,000,000,000,000 | 104 | Fix local privilege escalation to root and sandbox bypasses in scheduler
(rdar://37836779, rdar://37836995, rdar://37837252, rdar://37837581) |
static size_t tcp_opt_stats_get_size(void)
{
return
nla_total_size_64bit(sizeof(u64)) + /* TCP_NLA_BUSY */
nla_total_size_64bit(sizeof(u64)) + /* TCP_NLA_RWND_LIMITED */
nla_total_size_64bit(sizeof(u64)) + /* TCP_NLA_SNDBUF_LIMITED */
nla_total_size_64bit(sizeof(u64)) + /* TCP_NLA_DATA_SEGS_OUT */
nla_total_... | 0 | [
"CWE-190"
] | net | 3b4929f65b0d8249f19a50245cd88ed1a2f78cff | 202,867,945,699,192,570,000,000,000,000,000,000,000 | 27 | 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... |
void cmp_item_row::store_value(Item *item)
{
DBUG_ENTER("cmp_item_row::store_value");
DBUG_ASSERT(comparators);
DBUG_ASSERT(n == item->cols());
item->bring_value();
item->null_value= 0;
for (uint i=0; i < n; i++)
{
DBUG_ASSERT(comparators[i]);
comparators[i]->store_value(item->element_index(i));
... | 0 | [
"CWE-617"
] | server | 807945f2eb5fa22e6f233cc17b85a2e141efe2c8 | 272,196,356,212,565,970,000,000,000,000,000,000,000 | 15 | MDEV-26402: A SEGV in Item_field::used_tables/update_depend_map_for_order...
When doing condition pushdown from HAVING into WHERE,
Item_equal::create_pushable_equalities() calls
item->set_extraction_flag(IMMUTABLE_FL) for constant items.
Then, Item::cleanup_excluding_immutables_processor() checks for this flag
to see ... |
void Item_trigger_field::setup_field(THD *thd, TABLE *table,
GRANT_INFO *table_grant_info)
{
/*
It is too early to mark fields used here, because before execution
of statement that will invoke trigger other statements may use same
TABLE object, so all such mark-up will... | 0 | [
"CWE-416"
] | server | c02ebf3510850ba78a106be9974c94c3b97d8585 | 223,337,564,203,049,700,000,000,000,000,000,000,000 | 23 | MDEV-24176 Preparations
1. moved fix_vcol_exprs() call to open_table()
mysql_alter_table() doesn't do lock_tables() so it cannot win from
fix_vcol_exprs() from there. Tests affected: main.default_session
2. Vanilla cleanups and comments. |
BGD_DECLARE(void) gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color)
{
int lastBorder;
/* Seek left */
int leftLimit, rightLimit;
int i;
int restoreAlphaBleding;
if (border < 0 || color < 0) {
/* Refuse to fill to a non-solid border */
return;
}
if (!im->trueColor) {
if (color > (i... | 0 | [
"CWE-476"
] | libgd | a93eac0e843148dc2d631c3ba80af17e9c8c860f | 232,491,452,677,774,230,000,000,000,000,000,000,000 | 89 | Fix potential NULL pointer dereference in gdImageClone() |
//! Cumulate image values, optionally along specified axis \newinstance.
CImg<Tlong> get_cumulate(const char axis=0) const {
return CImg<Tlong>(*this,false).cumulate(axis); | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 178,340,254,598,177,400,000,000,000,000,000,000,000 | 3 | Fix other issues in 'CImg<T>::load_bmp()'. |
static int r_cmd_java_get_class_names_from_input (const char *input, char **class_name, ut32 *class_name_len, char **new_class_name, ut32 *new_class_name_len) {
const char *p = input;
ut32 cmd_sz = input && *input ? strlen (input) : 0;
int res = false;
if (!class_name || *class_name) {
return res;
} else if (!... | 0 | [
"CWE-703",
"CWE-193"
] | radare2 | ced0223c7a1b3b5344af315715cd28fe7c0d9ebc | 139,353,614,437,738,530,000,000,000,000,000,000,000 | 47 | Fix unmatched array length in core_java.c (issue #16304) (#16313) |
static INLINE void write_pixel_8(BYTE* _buf, BYTE _pix)
{
*_buf = _pix;
} | 0 | [
"CWE-787"
] | FreeRDP | 7b1d4b49391b4512402840431757703a96946820 | 197,399,087,384,697,700,000,000,000,000,000,000,000 | 4 | Fix CVE-2020-11524: out of bounds access in interleaved
Thanks to Sunglin and HuanGMz from Knownsec 404 |
static my_bool get_view_structure(char *table, char* db)
{
MYSQL_RES *table_res;
MYSQL_ROW row;
MYSQL_FIELD *field;
char *result_table, *opt_quoted_table;
char table_buff[NAME_LEN*2+3];
char table_buff2[NAME_LEN*2+3];
char query[QUERY_LENGTH];
FILE *sql_file= md_result_fi... | 0 | [] | server | 5a43a31ee81bc181eeb5ef2bf0704befa6e0594d | 153,441,934,677,864,600,000,000,000,000,000,000,000 | 199 | mysqldump: comments and identifiers with new lines
don't let identifiers with new lines to break a comment |
void imap_make_date (char *buf, time_t timestamp)
{
struct tm* tm = localtime (×tamp);
time_t tz = mutt_local_tz (timestamp);
tz /= 60;
snprintf (buf, IMAP_DATELEN, "%02d-%s-%d %02d:%02d:%02d %+03d%02d",
tm->tm_mday, Months[tm->tm_mon], tm->tm_year + 1900,
tm->tm_hour, tm->tm_min,... | 0 | [
"CWE-125"
] | mutt | 7c4779ac24d2fb68a2a47b58c7904118f40965d5 | 72,256,094,177,985,870,000,000,000,000,000,000,000 | 12 | Fix seqset iterator when it ends in a comma.
If the seqset ended with a comma, the substr_end marker would be just
before the trailing nul. In the next call, the loop to skip the
marker would iterate right past the end of string too.
The fix is simple: place the substr_end marker and skip past it
immediately. |
ParseOnOff(act, var)
struct action *act;
int *var;
{
register int num = -1;
char **args = act->args;
if (args[1] == 0)
{
if (strcmp(args[0], "on") == 0)
num = 1;
else if (strcmp(args[0], "off") == 0)
num = 0;
}
if (num < 0)
{
Msg(0, "%s: %s: invalid argument. Give 'on' or 'off'"... | 0 | [] | screen | c5db181b6e017cfccb8d7842ce140e59294d9f62 | 312,842,623,350,495,800,000,000,000,000,000,000,000 | 22 | ansi: add support for xterm OSC 11
It allows for getting and setting the background color. Notably, Vim uses
OSC 11 to learn whether it's running on a light or dark colored terminal
and choose a color scheme accordingly.
Tested with gnome-terminal and xterm. When called with "?" argument the
current background color ... |
int ssl_cipher_ptr_id_cmp(const SSL_CIPHER * const *ap,
const SSL_CIPHER * const *bp)
{
long l;
l=(*ap)->id-(*bp)->id;
if (l == 0L)
return(0);
else
return((l > 0)?1:-1);
} | 0 | [] | openssl | ee2ffc279417f15fef3b1073c7dc81a908991516 | 291,721,560,562,615,520,000,000,000,000,000,000,000 | 11 | Add Next Protocol Negotiation. |
dns_reset_correctness_checks(void)
{
strmap_free(dns_wildcard_response_count, _tor_free);
dns_wildcard_response_count = NULL;
n_wildcard_requests = 0;
if (dns_wildcard_list) {
SMARTLIST_FOREACH(dns_wildcard_list, char *, cp, tor_free(cp));
smartlist_clear(dns_wildcard_list);
}
if (dns_wildcarded_t... | 0 | [
"CWE-399"
] | tor | 62637fa22405278758febb1743da9af562524d4c | 173,444,390,388,208,170,000,000,000,000,000,000,000 | 19 | Avoid hard (impossible?)-to-trigger double-free in dns_resolve()
Fixes 6480; fix on 0.2.0.1-alpha; based on pseudonymous patch. |
static int core_cmd0_wrapper(void *core, const char *cmd) {
return r_core_cmd0 ((RCore *)core, cmd);
} | 0 | [
"CWE-78"
] | radare2 | dd739f5a45b3af3d1f65f00fe19af1dbfec7aea7 | 210,062,131,782,986,500,000,000,000,000,000,000,000 | 3 | Fix #14990 - multiple quoted command parsing issue ##core
> "?e hello""?e world"
hello
world"
> "?e hello";"?e world"
hello
world |
cmsBool IsTypeSupported(cmsTagDescriptor* TagDescriptor, cmsTagTypeSignature Type)
{
cmsUInt32Number i, nMaxTypes;
nMaxTypes = TagDescriptor->nSupportedTypes;
if (nMaxTypes >= MAX_TYPES_IN_LCMS_PLUGIN)
nMaxTypes = MAX_TYPES_IN_LCMS_PLUGIN;
for (i=0; i < nMaxTypes; i++) {
if (Type == Ta... | 0 | [] | Little-CMS | d2d902b9a03583ae482c782b2f243f7e5268a47d | 173,734,046,224,090,500,000,000,000,000,000,000,000 | 14 | >Changes from Richard Hughes |
h_trunc(VALUE h, VALUE *fr)
{
VALUE rh;
if (wholenum_p(h)) {
rh = to_integer(h);
*fr = INT2FIX(0);
}
else {
rh = f_idiv(h, INT2FIX(1));
*fr = f_mod(h, INT2FIX(1));
*fr = f_quo(*fr, INT2FIX(24));
}
return rh;
} | 0 | [] | date | 3959accef8da5c128f8a8e2fd54e932a4fb253b0 | 275,941,076,348,877,500,000,000,000,000,000,000,000 | 15 | Add length limit option for methods that parses date strings
`Date.parse` now raises an ArgumentError when a given date string is
longer than 128. You can configure the limit by giving `limit` keyword
arguments like `Date.parse(str, limit: 1000)`. If you pass `limit: nil`,
the limit is disabled.
Not only `Date.parse`... |
static inline void SetPixelBackgoundColor(const Image *restrict image,
Quantum *restrict pixel)
{
register ssize_t
i;
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
pixel[i]=0;
pixel[image->channel_map[RedPixelChannel].offset]=
ClampToQuantum(image->background_color.red);
pixel[image->chan... | 0 | [
"CWE-119",
"CWE-787"
] | ImageMagick | 450bd716ed3b9186dd10f9e60f630a3d9eeea2a4 | 265,621,998,759,265,980,000,000,000,000,000,000,000 | 22 | |
void module_register(void) {
plugin_register_complex_config("snmp", csnmp_config);
plugin_register_init("snmp", csnmp_init);
plugin_register_shutdown("snmp", csnmp_shutdown);
} /* void module_register */ | 0 | [
"CWE-415"
] | collectd | d16c24542b2f96a194d43a73c2e5778822b9cb47 | 160,052,342,584,243,180,000,000,000,000,000,000,000 | 5 | snmp plugin: Fix double free of request PDU
snmp_sess_synch_response() always frees request PDU, in both case of request
error and success. If error condition occurs inside of `while (status == 0)`
loop, double free of `req` happens.
Issue: #2291
Signed-off-by: Florian Forster <octo@collectd.org> |
dissect_usb_vid_descriptor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
int offset = 0;
guint8 descriptor_len;
guint8 descriptor_type;
gint bytes_available;
usb_conv_info_t *usb_conv_info = (usb_conv_info_t *)data;
tvbuff_t *desc_tvb;
descriptor_len = t... | 0 | [
"CWE-476"
] | wireshark | 2cb5985bf47bdc8bea78d28483ed224abdd33dc6 | 152,033,379,640,860,750,000,000,000,000,000,000,000 | 39 | Make class "type" for USB conversations.
USB dissectors can't assume that only their class type has been passed around in the conversation. Make explicit check that class type expected matches the dissector and stop/prevent dissection if there isn't a match.
Bug: 12356
Change-Id: Ib23973a4ebd0fbb51952ffc118daf95e338... |
static size_t copy_page_to_iter_iovec(struct page *page, size_t offset, size_t bytes,
struct iov_iter *i)
{
size_t skip, copy, left, wanted;
const struct iovec *iov;
char __user *buf;
void *kaddr, *from;
if (unlikely(bytes > i->count))
bytes = i->count;
if (unlikely(!bytes))
return 0;
might_fault();
... | 0 | [
"CWE-665",
"CWE-284"
] | linux | 9d2231c5d74e13b2a0546fee6737ee4446017903 | 315,907,889,209,691,620,000,000,000,000,000,000,000 | 83 | lib/iov_iter: initialize "flags" in new pipe_buffer
The functions copy_page_to_iter_pipe() and push_pipe() can both
allocate a new pipe_buffer, but the "flags" member initializer is
missing.
Fixes: 241699cd72a8 ("new iov_iter flavour: pipe-backed")
To: Alexander Viro <viro@zeniv.linux.org.uk>
To: linux-fsdevel@vger.k... |
static void ttxt_parse_text_style(GF_TXTIn *ctx, GF_XMLNode *n, GF_StyleRecord *style)
{
u32 i=0;
GF_XMLAttribute *att;
memset(style, 0, sizeof(GF_StyleRecord));
style->fontID = 1;
style->font_size = ctx->fontsize ;
style->text_color = 0xFFFFFFFF;
while ( (att=(GF_XMLAttribute *)gf_list_enum(n->attributes, &i))... | 0 | [
"CWE-276"
] | gpac | 96699aabae042f8f55cf8a85fa5758e3db752bae | 93,201,553,777,739,340,000,000,000,000,000,000,000 | 23 | fixed #2061 |
static void __init report_hugepages(void)
{
struct hstate *h;
for_each_hstate(h) {
char buf[32];
string_get_size(huge_page_size(h), 1, STRING_UNITS_2, buf, 32);
pr_info("HugeTLB registered %s page size, pre-allocated %ld pages\n",
buf, h->free_huge_pages);
}
} | 0 | [
"CWE-703"
] | linux | 5af10dfd0afc559bb4b0f7e3e8227a1578333995 | 76,713,146,662,103,630,000,000,000,000,000,000,000 | 12 | userfaultfd: hugetlbfs: remove superfluous page unlock in VM_SHARED case
huge_add_to_page_cache->add_to_page_cache implicitly unlocks the page
before returning in case of errors.
The error returned was -EEXIST by running UFFDIO_COPY on a non-hole
offset of a VM_SHARED hugetlbfs mapping. It was an userland bug that
t... |
map_possibly_volatile_file_to_real (GFile *volatile_file,
GCancellable *cancellable,
GError **error)
{
GFile *real_file = NULL;
GFileInfo *info = NULL;
info = g_file_query_info (volatile_file,
... | 0 | [
"CWE-20"
] | nautilus | 1630f53481f445ada0a455e9979236d31a8d3bb0 | 256,453,946,291,234,550,000,000,000,000,000,000,000 | 42 | mime-actions: use file metadata for trusting desktop files
Currently we only trust desktop files that have the executable bit
set, and don't replace the displayed icon or the displayed name until
it's trusted, which prevents for running random programs by a malicious
desktop file.
However, the executable permission i... |
ParserCallbacks::handleObject(QPDFObjectHandle obj)
{
std::cout << obj.getTypeName() << ": ";
if (obj.isInlineImage())
{
std::cout << QUtil::hex_encode(obj.getInlineImageValue()) << std::endl;
}
else
{
std::cout << obj.unparse() << std::endl;
}
} | 0 | [
"CWE-125"
] | qpdf | 1868a10f8b06631362618bfc85ca8646da4b4b71 | 181,411,742,704,969,940,000,000,000,000,000,000,000 | 12 | Replace all atoi calls with QUtil::string_to_int
The latter catches underflow/overflow. |
_asn1_set_value_m (asn1_node node, void *value, unsigned int len)
{
if (node == NULL)
return node;
if (node->value)
{
if (node->value != node->small_value)
free (node->value);
node->value = NULL;
node->value_len = 0;
}
if (!len)
return node;
node->value = value;
node->val... | 0 | [
"CWE-119"
] | libtasn1 | 4d4f992826a4962790ecd0cce6fbba4a415ce149 | 163,799,251,541,281,270,000,000,000,000,000,000,000 | 21 | increased size of LTOSTR_MAX_SIZE to account for sign and null byte
This address an overflow found by Hanno Böck in DER decoding. |
template<typename tc>
CImg<T>& draw_circle(const int x0, const int y0, int radius,
const tc *const color, const float opacity,
const unsigned int pattern) {
cimg::unused(pattern);
if (is_empty()) return *this;
if (!color)
throw CImgArgu... | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 320,503,849,278,587,560,000,000,000,000,000,000,000 | 29 | Fix other issues in 'CImg<T>::load_bmp()'. |
cmsBool Type_Chromaticity_Write(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, void* Ptr, cmsUInt32Number nItems)
{
cmsCIExyYTRIPLE* chrm = (cmsCIExyYTRIPLE*) Ptr;
if (!_cmsWriteUInt16Number(io, 3)) return FALSE; // nChannels
if (!_cmsWriteUInt16Number(io, 0)) return FALSE; // Table... | 0 | [] | Little-CMS | 41d222df1bc6188131a8f46c32eab0a4d4cdf1b6 | 123,451,573,353,150,140,000,000,000,000,000,000,000 | 16 | Memory squeezing fix: lcms2 cmsPipeline construction
When creating a new pipeline, lcms would often try to allocate a stage
and pass it to cmsPipelineInsertStage without checking whether the
allocation succeeded. cmsPipelineInsertStage would then assert (or crash)
if it had not.
The fix here is to change cmsPipelineI... |
void nntp_acache_free(struct NntpData *nntp_data)
{
for (int i = 0; i < NNTP_ACACHE_LEN; i++)
{
if (nntp_data->acache[i].path)
{
unlink(nntp_data->acache[i].path);
FREE(&nntp_data->acache[i].path);
}
}
} | 0 | [
"CWE-119",
"CWE-787"
] | neomutt | 6296f7153f0c9d5e5cd3aaf08f9731e56621bdd3 | 90,427,714,026,124,780,000,000,000,000,000,000,000 | 11 | Set length modifiers for group and desc
nntp_add_group parses a line controlled by the connected nntp server.
Restrict the maximum lengths read into the stack buffers group, and
desc. |
static void test_bug31669()
{
int rc;
static char buff[LARGE_BUFFER_SIZE+1];
#ifndef EMBEDDED_LIBRARY
static char user[OLD_USERNAME_CHAR_LENGTH+1];
static char db[NAME_CHAR_LEN+1];
static char query[LARGE_BUFFER_SIZE*2];
#endif
MYSQL* conn;
DBUG_ENTER("test_bug31669");
myheader("test_bug31669");
con... | 0 | [
"CWE-416"
] | server | eef21014898d61e77890359d6546d4985d829ef6 | 211,791,975,116,003,600,000,000,000,000,000,000,000 | 102 | 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... |
stack_slot_is_boxed_value (ILStackDesc *value)
{
return (value->stype & BOXED_MASK) == BOXED_MASK;
} | 0 | [
"CWE-20"
] | mono | 4905ef1130feb26c3150b28b97e4a96752e0d399 | 287,702,354,452,249,350,000,000,000,000,000,000,000 | 4 | Handle invalid instantiation of generic methods.
* verify.c: Add new function to internal verifier API to check
method instantiations.
* reflection.c (mono_reflection_bind_generic_method_parameters):
Check the instantiation before returning it.
Fixes #655847 |
static int __dm_get_module_param_int(int *module_param, int min, int max)
{
int param = ACCESS_ONCE(*module_param);
int modified_param = 0;
bool modified = true;
if (param < min)
modified_param = min;
else if (param > max)
modified_param = max;
else
modified = false;
if (modified) {
(void)cmpxchg(modul... | 0 | [
"CWE-362"
] | linux | b9a41d21dceadf8104812626ef85dc56ee8a60ed | 304,310,015,574,038,850,000,000,000,000,000,000,000 | 20 | dm: fix race between dm_get_from_kobject() and __dm_destroy()
The following BUG_ON was hit when testing repeat creation and removal of
DM devices:
kernel BUG at drivers/md/dm.c:2919!
CPU: 7 PID: 750 Comm: systemd-udevd Not tainted 4.1.44
Call Trace:
[<ffffffff81649e8b>] dm_get_from_kobject+0x34/0x3a
... |
ISOMChannel *isor_create_channel(ISOMReader *read, GF_FilterPid *pid, u32 track, u32 item_id, Bool force_no_extractors)
{
ISOMChannel *ch;
const GF_PropertyValue *p;
s64 ts_shift;
if (!read->mov) return NULL;
GF_SAFEALLOC(ch, ISOMChannel);
if (!ch) {
return NULL;
}
ch->owner = read;
ch->pid = pid;
ch->to_i... | 0 | [
"CWE-787"
] | gpac | da37ec8582266983d0ec4b7550ec907401ec441e | 174,630,733,473,694,600,000,000,000,000,000,000,000 | 109 | fixed crashes for very long path - cf #1908 |
dissect_kafka_write_txn_markers_response_partition(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
int offset, kafka_api_version_t api_version _U_)
{
guint32 partition_id;
kafka_error_t partition_error_code;
proto_item *subti;
proto_tree *s... | 0 | [
"CWE-401"
] | wireshark | f4374967bbf9c12746b8ec3cd54dddada9dd353e | 244,896,122,418,356,400,000,000,000,000,000,000,000 | 29 | Kafka: Limit our decompression size.
Don't assume that the Internet has our best interests at heart when it
gives us the size of our decompression buffer. Assign an arbitrary limit
of 50 MB.
This fixes #16739 in that it takes care of
** (process:17681): WARNING **: 20:03:07.440: Dissector bug, protocol Kafka, in pac... |
ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group)
{
struct ext4_group_desc *desc;
struct ext4_sb_info *sbi = EXT4_SB(sb);
struct buffer_head *bh = NULL;
ext4_fsblk_t bitmap_blk;
int err;
desc = ext4_get_group_desc(sb, block_group, NULL);
if (!desc)
return ERR_PTR(-EFSCORRUPTED);
bitma... | 0 | [
"CWE-416"
] | linux | 8844618d8aa7a9973e7b527d038a2a589665002c | 37,148,280,367,883,950,000,000,000,000,000,000,000 | 96 | ext4: only look at the bg_flags field if it is valid
The bg_flags field in the block group descripts is only valid if the
uninit_bg or metadata_csum feature is enabled. We were not
consistently looking at this field; fix this.
Also block group #0 must never have uninitialized allocation bitmaps,
or need to be zeroed... |
static MemTxResult memory_region_dispatch_read1(struct uc_struct *uc, MemoryRegion *mr,
hwaddr addr,
uint64_t *pval,
unsigned size,
... | 0 | [
"CWE-476"
] | unicorn | 3d3deac5e6d38602b689c4fef5dac004f07a2e63 | 161,371,635,617,569,320,000,000,000,000,000,000,000 | 22 | Fix crash when mapping a big memory and calling uc_close |
virDomainMemoryTargetDefFormat(virBufferPtr buf,
virDomainMemoryDefPtr def)
{
virBufferAddLit(buf, "<target>\n");
virBufferAdjustIndent(buf, 2);
virBufferAsprintf(buf, "<size unit='KiB'>%llu</size>\n", def->size);
if (def->targetNode >= 0)
virBufferAsprintf(buf, "... | 0 | [
"CWE-212"
] | libvirt | a5b064bf4b17a9884d7d361733737fb614ad8979 | 8,434,923,567,052,682,000,000,000,000,000,000,000 | 22 | 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... |
static ssize_t aac_show_flags(struct device *cdev,
struct device_attribute *attr, char *buf)
{
int len = 0;
struct aac_dev *dev = (struct aac_dev*)class_to_shost(cdev)->hostdata;
if (nblank(dprintk(x)))
len = snprintf(buf, PAGE_SIZE, "dprintk\n");
#ifdef AAC_DETAILED_STATUS_INFO
len += snprintf(buf + le... | 0 | [
"CWE-284",
"CWE-264"
] | linux | f856567b930dfcdbc3323261bf77240ccdde01f5 | 285,652,115,612,620,400,000,000,000,000,000,000,000 | 25 | aacraid: missing capable() check in compat ioctl
In commit d496f94d22d1 ('[SCSI] aacraid: fix security weakness') we
added a check on CAP_SYS_RAWIO to the ioctl. The compat ioctls need the
check as well.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torv... |
proto_registrar_get_id_byname(const char *field_name)
{
header_field_info *hfinfo;
hfinfo = proto_registrar_get_byname(field_name);
if (!hfinfo)
return -1;
return hfinfo->id;
} | 0 | [
"CWE-401"
] | wireshark | a9fc769d7bb4b491efb61c699d57c9f35269d871 | 30,412,639,169,571,620,000,000,000,000,000,000,000 | 11 | epan: Fix a memory leak.
Make sure _proto_tree_add_bits_ret_val allocates a bits array using the
packet scope, otherwise we leak memory. Fixes #17032. |
GF_Err audio_sample_entry_AddBox(GF_Box *s, GF_Box *a)
{
GF_UnknownBox *wave = NULL;
Bool drop_wave=GF_FALSE;
GF_MPEGAudioSampleEntryBox *ptr = (GF_MPEGAudioSampleEntryBox *)s;
switch (a->type) {
case GF_ISOM_BOX_TYPE_ESDS:
if (ptr->esd) ERROR_ON_DUPLICATED_BOX(a, ptr)
ptr->esd = (GF_ESDBox *)a;
ptr->is_qtf... | 0 | [
"CWE-416"
] | gpac | 6063b1a011c3f80cee25daade18154e15e4c058c | 95,516,106,651,523,030,000,000,000,000,000,000,000 | 140 | fix UAF in audio_sample_entry_Read (#1440) |
zlog_backtrace_sigsafe(int priority, void *program_counter)
{
#ifdef HAVE_STACK_TRACE
static const char pclabel[] = "Program counter: ";
void *array[20];
int size;
char buf[100];
char *s;
#define LOC s,buf+sizeof(buf)-s
#ifdef HAVE_GLIBC_BACKTRACE
if (((size = backtrace(array,sizeof(array)/sizeof(array[0])... | 0 | [
"CWE-125"
] | frr | 6d58272b4cf96f0daa846210dd2104877900f921 | 43,763,755,969,644,070,000,000,000,000,000,000,000 | 74 | [bgpd] cleanup, compact and consolidate capability parsing code
2007-07-26 Paul Jakma <paul.jakma@sun.com>
* (general) Clean up and compact capability parsing slightly.
Consolidate validation of length and logging of generic TLV, and
memcpy of capability data, thus removing such from cap specifc
code (not a... |
static void int_dsa_free(EVP_PKEY *pkey)
{
DSA_free(pkey->pkey.dsa);
} | 0 | [] | openssl | ab4a81f69ec88d06c9d8de15326b9296d7f498ed | 117,067,201,981,857,200,000,000,000,000,000,000,000 | 4 | Remove broken DSA private key workarounds.
Remove old code that handled various invalid DSA formats in ancient
software.
This also fixes a double free bug when parsing malformed DSA private keys.
Thanks to Adam Langley (Google/BoringSSL) for discovering this bug using
libFuzzer.
CVE-2016-0705
Reviewed-by: Emilia K... |
mrb_obj_new(mrb_state *mrb, struct RClass *c, mrb_int argc, const mrb_value *argv)
{
mrb_value obj;
mrb_sym mid;
obj = mrb_instance_alloc(mrb, mrb_obj_value(c));
mid = MRB_SYM(initialize);
if (!mrb_func_basic_p(mrb, obj, mid, mrb_bob_init)) {
mrb_funcall_argv(mrb, obj, mid, argc, argv);
}
return obj;... | 0 | [
"CWE-476",
"CWE-190"
] | mruby | f5e10c5a79a17939af763b1dcf5232ce47e24a34 | 236,232,793,862,147,420,000,000,000,000,000,000,000 | 12 | proc.c: add `mrb_state` argument to `mrb_proc_copy()`.
The function may invoke the garbage collection and it requires
`mrb_state` to run. |
static int em_pushf(struct x86_emulate_ctxt *ctxt)
{
ctxt->src.val = (unsigned long)ctxt->eflags & ~EFLG_VM;
return em_push(ctxt);
} | 0 | [
"CWE-362",
"CWE-269"
] | linux | f3747379accba8e95d70cec0eae0582c8c182050 | 76,692,213,862,729,490,000,000,000,000,000,000,000 | 5 | KVM: x86: SYSENTER emulation is broken
SYSENTER emulation is broken in several ways:
1. It misses the case of 16-bit code segments completely (CVE-2015-0239).
2. MSR_IA32_SYSENTER_CS is checked in 64-bit mode incorrectly (bits 0 and 1 can
still be set without causing #GP).
3. MSR_IA32_SYSENTER_EIP and MSR_IA32_SYSE... |
gst_mpegts_section_get_pmt (GstMpegtsSection * section)
{
g_return_val_if_fail (section->section_type == GST_MPEGTS_SECTION_PMT, NULL);
g_return_val_if_fail (section->cached_parsed || section->data, NULL);
if (!section->cached_parsed)
section->cached_parsed =
__common_section_checks (section, 16, _pa... | 0 | [
"CWE-125"
] | gst-plugins-bad | d58f668ece8795bddb3316832e1848c7b7cf38ac | 84,158,605,378,063,430,000,000,000,000,000,000,000 | 12 | mpegtssection: Add more section size checks
The smallest section ever needs to be at least 3 bytes (i.e. just the short
header).
Non-short headers need to be at least 11 bytes long (3 for the minimum header,
5 for the non-short header, and 4 for the CRC).
https://bugzilla.gnome.org/show_bug.cgi?id=775048 |
get_description (NautilusFile *file)
{
const char *mime_type;
char *description;
g_assert (NAUTILUS_IS_FILE (file));
mime_type = eel_ref_str_peek (file->details->mime_type);
if (eel_str_is_empty (mime_type)) {
return NULL;
}
if (g_content_type_is_unknown (mime_type) &&
nautilus_file_is_executable (file... | 0 | [] | nautilus | 7632a3e13874a2c5e8988428ca913620a25df983 | 210,341,012,493,341,630,000,000,000,000,000,000,000 | 24 | Check for trusted desktop file launchers.
2009-02-24 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-directory-async.c:
Check for trusted desktop file launchers.
* libnautilus-private/nautilus-file-private.h:
* libnautilus-private/nautilus-file.c:
* libnautilus-... |
static int uevent_filter(struct kset *kset, struct kobject *kobj)
{
struct kobj_type *ktype = get_ktype(kobj);
if (ktype == &slab_ktype)
return 1;
return 0; | 0 | [
"CWE-189"
] | linux | f8bd2258e2d520dff28c855658bd24bdafb5102d | 77,367,650,739,680,030,000,000,000,000,000,000,000 | 8 | remove div_long_long_rem
x86 is the only arch right now, which provides an optimized for
div_long_long_rem and it has the downside that one has to be very careful that
the divide doesn't overflow.
The API is a little akward, as the arguments for the unsigned divide are
signed. The signed version also doesn't handle ... |
restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *peax)
{
unsigned int err = 0;
/* Always make any pending restarted system calls return -EINTR */
current_thread_info()->restart_block.fn = do_no_restart_syscall;
#define COPY(x) err |= __get_user(regs->x, &sc->x)
#define COPY_SEG(seg) ... | 0 | [
"CWE-399"
] | linux-2.6 | e40cd10ccff3d9fbffd57b93780bee4b7b9bff51 | 171,660,535,001,939,200,000,000,000,000,000,000,000 | 73 | x86: clear DF before calling signal handler
The Linux kernel currently does not clear the direction flag before
calling a signal handler, whereas the x86/x86-64 ABI requires that.
Linux had this behavior/bug forever, but this becomes a real problem
with gcc version 4.3, which assumes that the direction flag is
correc... |
static inline int vma_growsdown(struct vm_area_struct *vma, unsigned long addr)
{
return vma && (vma->vm_end == addr) && (vma->vm_flags & VM_GROWSDOWN);
} | 1 | [
"CWE-119"
] | linux | 1be7107fbe18eed3e319a6c3e83c78254b693acb | 272,689,751,564,048,220,000,000,000,000,000,000,000 | 4 | mm: larger stack guard gap, between vmas
Stack guard page is a useful feature to reduce a risk of stack smashing
into a different mapping. We have been using a single page gap which
is sufficient to prevent having stack adjacent to a different mapping.
But this seems to be insufficient in the light of the stack usage ... |
static double Hamming(const double x,
const ResizeFilter *magick_unused(resize_filter))
{
/*
Offset cosine window function:
.54 + .46 cos(pi x).
*/
const double cosine = cos((double) (MagickPI*x));
magick_unreferenced(resize_filter);
return(0.54+0.46*cosine);
} | 0 | [
"CWE-369"
] | ImageMagick | 43539e67a47d2f8de832d33a5b26dc2a7a12294f | 53,845,134,636,121,740,000,000,000,000,000,000,000 | 11 | https://github.com/ImageMagick/ImageMagick/issues/1718 |
int vnc_raw_send_framebuffer_update(VncState *vs, int x, int y, int w, int h)
{
int i;
uint8_t *row;
VncDisplay *vd = vs->vd;
row = vnc_server_fb_ptr(vd, x, y);
for (i = 0; i < h; i++) {
vs->write_pixels(vs, row, w * VNC_SERVER_FB_BYTES);
row += vnc_server_fb_stride(vd);
}
r... | 0 | [
"CWE-125"
] | qemu | bea60dd7679364493a0d7f5b54316c767cf894ef | 7,145,876,035,282,111,000,000,000,000,000,000,000 | 13 | ui/vnc: fix potential memory corruption issues
this patch makes the VNC server work correctly if the
server surface and the guest surface have different sizes.
Basically the server surface is adjusted to not exceed VNC_MAX_WIDTH
x VNC_MAX_HEIGHT and additionally the width is rounded up to multiple of
VNC_DIRTY_PIXELS... |
MagickExport MagickBooleanType GetImageMedian(const Image *image,double *median,
ExceptionInfo *exception)
{
ChannelStatistics
*channel_statistics;
assert(image != (Image *) NULL);
assert(image->signature == MagickCoreSignature);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMa... | 0 | [] | ImageMagick | 4717744e4bb27de8ea978e51c6d5bcddf62ffe49 | 262,913,597,767,768,180,000,000,000,000,000,000,000 | 18 | https://github.com/ImageMagick/ImageMagick/issues/3332 |
static int fp_div_d(fp_int *a, fp_digit b, fp_int *c, fp_digit *d)
{
#ifndef WOLFSSL_SMALL_STACK
fp_int q[1];
#else
fp_int *q;
#endif
fp_word w;
fp_digit t;
int ix;
/* cannot divide by zero */
if (b == 0) {
return FP_VAL;
}
/* quick outs */
if (b == 1 || fp_iszero(a) == FP_YES) {
... | 0 | [
"CWE-326",
"CWE-203"
] | wolfssl | 1de07da61f0c8e9926dcbd68119f73230dae283f | 178,406,316,226,351,600,000,000,000,000,000,000,000 | 79 | Constant time EC map to affine for private operations
For fast math, use a constant time modular inverse when mapping to
affine when operation involves a private key - key gen, calc shared
secret, sign. |
inline uint64_t make_type(FMT_GEN15(FMT_ARG_TYPE_DEFAULT)) {
return t0.type | (t1.type << 4) | (t2.type << 8) | (t3.type << 12) |
(t4.type << 16) | (t5.type << 20) | (t6.type << 24) | (t7.type << 28) |
(t8.type << 32) | (t9.type << 36) | (t10.type << 40) | (t11.type << 44) |
(t12.type << 48) | (t13.... | 0 | [
"CWE-134",
"CWE-119",
"CWE-787"
] | fmt | 8cf30aa2be256eba07bb1cefb998c52326e846e7 | 123,879,026,586,532,870,000,000,000,000,000,000,000 | 6 | Fix segfault on complex pointer formatting (#642) |
mrb_full_gc(mrb_state *mrb)
{
mrb_gc *gc = &mrb->gc;
if (gc->disabled) return;
GC_INVOKE_TIME_REPORT("mrb_full_gc()");
GC_TIME_START;
if (is_generational(gc)) {
/* clear all the old objects back to young */
clear_all_old(mrb, gc);
gc->full = TRUE;
}
else if (gc->state != MRB_GC_STATE_ROOT) ... | 0 | [
"CWE-416"
] | mruby | 5c114c91d4ff31859fcd84cf8bf349b737b90d99 | 244,861,931,565,271,940,000,000,000,000,000,000,000 | 29 | Clear unused stack region that may refer freed objects; fix #3596 |
tty_add(struct tty *tty, const char *buf, size_t len)
{
struct client *c = tty->client;
if (tty->flags & TTY_BLOCK) {
tty->discarded += len;
return;
}
evbuffer_add(tty->out, buf, len);
log_debug("%s: %.*s", c->name, (int)len, buf);
c->written += len;
if (tty_log_fd != -1)
write(tty_log_fd, buf, len);
i... | 0 | [] | src | b32e1d34e10a0da806823f57f02a4ae6e93d756e | 269,105,004,637,307,350,000,000,000,000,000,000,000 | 18 | evbuffer_new and bufferevent_new can both fail (when malloc fails) and
return NULL. GitHub issue 1547. |
xmlParseName(xmlParserCtxtPtr ctxt) {
const xmlChar *in;
const xmlChar *ret;
int count = 0;
GROW;
#ifdef DEBUG
nbParseName++;
#endif
/*
* Accelerator for simple ASCII names
*/
in = ctxt->input->cur;
if (((*in >= 0x61) && (*in <= 0x7A)) ||
((*in >= 0x41) && (*in <= 0x5A)) ||... | 0 | [
"CWE-119"
] | libxml2 | 6a36fbe3b3e001a8a840b5c1fdd81cefc9947f0d | 206,100,726,279,295,000,000,000,000,000,000,000,000 | 44 | Fix potential out of bound access |
template<typename tf>
static CImg<floatT> cylinder3d(CImgList<tf>& primitives,
const float radius=50, const float size_z=100, const unsigned int subdivisions=24) {
primitives.assign();
if (!subdivisions) return CImg<floatT>();
CImgList<floatT> vertices(2,1,3,... | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 174,716,708,711,060,170,000,000,000,000,000,000,000 | 21 | Fix other issues in 'CImg<T>::load_bmp()'. |
asmlinkage void vmread_error(unsigned long field, bool fault)
{
if (fault)
kvm_spurious_fault();
else
vmx_insn_failed("kvm: vmread failed: field=%lx\n", field);
} | 0 | [
"CWE-787"
] | linux | 04c4f2ee3f68c9a4bf1653d15f1a9a435ae33f7a | 49,335,649,640,441,615,000,000,000,000,000,000,000 | 7 | KVM: VMX: Don't use vcpu->run->internal.ndata as an array index
__vmx_handle_exit() uses vcpu->run->internal.ndata as an index for
an array access. Since vcpu->run is (can be) mapped to a user address
space with a writer permission, the 'ndata' could be updated by the
user process at anytime (the user process can set... |
xps_parse_path_figure(fz_context *doc, fz_path *path, fz_xml *root, int stroking)
{
fz_xml *node;
char *is_closed_att;
char *start_point_att;
char *is_filled_att;
int is_closed = 0;
int is_filled = 1;
float start_x = 0;
float start_y = 0;
int skipped_stroke = 0;
is_closed_att = fz_xml_att(root, "IsClosed"... | 0 | [
"CWE-119"
] | mupdf | 60dabde18d7fe12b19da8b509bdfee9cc886aafc | 107,684,148,209,888,260,000,000,000,000,000,000,000 | 51 | Bug 694957: fix stack buffer overflow in xps_parse_color
xps_parse_color happily reads more than FZ_MAX_COLORS values out of a
ContextColor array which overflows the passed in samples array.
Limiting the number of allowed samples to FZ_MAX_COLORS and make sure
to use that constant for all callers fixes the problem.
T... |
static ssize_t sec_write(struct Curl_easy *data, struct connectdata *conn,
curl_socket_t fd, const char *buffer, size_t length)
{
ssize_t tx = 0, len = conn->buffer_size;
if(len <= 0)
len = length;
while(length) {
if(length < (size_t)len)
len = length;
do_sec_send(data... | 0 | [] | curl | 6ecdf5136b52af747e7bda08db9a748256b1cd09 | 221,242,498,229,170,550,000,000,000,000,000,000,000 | 18 | krb5: return error properly on decode errors
Bug: https://curl.se/docs/CVE-2022-32208.html
CVE-2022-32208
Reported-by: Harry Sintonen
Closes #9051 |
void subs_box_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_SubSampl... | 0 | [
"CWE-787"
] | gpac | 77510778516803b7f7402d7423c6d6bef50254c3 | 117,732,759,449,507,350,000,000,000,000,000,000,000 | 21 | fixed #2255 |
int ring_buffer_resize(struct trace_buffer *buffer, unsigned long size,
int cpu_id)
{
struct ring_buffer_per_cpu *cpu_buffer;
unsigned long nr_pages;
int cpu, err;
/*
* Always succeed at resizing a non-existent buffer:
*/
if (!buffer)
return 0;
/* Make sure the requested buffer exists */
if (cpu_id !=... | 0 | [
"CWE-835"
] | linux | 67f0d6d9883c13174669f88adac4f0ee656cc16a | 206,367,687,837,773,370,000,000,000,000,000,000,000 | 188 | tracing: Fix bug in rb_per_cpu_empty() that might cause deadloop.
The "rb_per_cpu_empty()" misinterpret the condition (as not-empty) when
"head_page" and "commit_page" of "struct ring_buffer_per_cpu" points to
the same buffer page, whose "buffer_data_page" is empty and "read" field
is non-zero.
An error scenario coul... |
SYSCALL_DEFINE0(restart_syscall)
{
struct restart_block *restart = ¤t->restart_block;
return restart->fn(restart);
} | 0 | [
"CWE-119",
"CWE-787"
] | linux | 4ea77014af0d6205b05503d1c7aac6eace11d473 | 252,598,219,600,036,780,000,000,000,000,000,000,000 | 5 | 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 ... |
void nfnl_unlock(__u8 subsys_id)
{
mutex_unlock(&table[subsys_id].mutex);
} | 0 | [
"CWE-264"
] | net | 90f62cf30a78721641e08737bda787552428061e | 170,009,301,528,980,720,000,000,000,000,000,000,000 | 4 | net: Use netlink_ns_capable to verify the permisions of netlink messages
It is possible by passing a netlink socket to a more privileged
executable and then to fool that executable into writing to the socket
data that happens to be valid netlink message to do something that
privileged executable did not intend to do.
... |
static int packet_notifier(struct notifier_block *this,
unsigned long msg, void *ptr)
{
struct sock *sk;
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
struct net *net = dev_net(dev);
rcu_read_lock();
sk_for_each_rcu(sk, &net->packet.sklist) {
struct packet_sock *po = pkt_sk(sk);
switch (ms... | 0 | [] | linux | c700525fcc06b05adfea78039de02628af79e07a | 132,948,355,924,978,080,000,000,000,000,000,000,000 | 49 | net/packet: fix slab-out-of-bounds access in packet_recvmsg()
syzbot found that when an AF_PACKET socket is using PACKET_COPY_THRESH
and mmap operations, tpacket_rcv() is queueing skbs with
garbage in skb->cb[], triggering a too big copy [1]
Presumably, users of af_packet using mmap() already gets correct
metadata fr... |
getsize_application_api(
disk_estimates_t *est,
int nb_level,
int *levels,
backup_support_option_t *bsu)
{
dle_t *dle = est->dle;
int pipeinfd[2], pipeoutfd[2], pipeerrfd[2];
pid_t dumppid;
off_t size = (off_t)-1;
FILE *dumpout;
FILE *dumperr... | 0 | [
"CWE-264"
] | amanda | 4bf5b9b356848da98560ffbb3a07a9cb5c4ea6d7 | 232,886,613,264,353,140,000,000,000,000,000,000,000 | 260 | * Add a /etc/amanda-security.conf file
git-svn-id: https://svn.code.sf.net/p/amanda/code/amanda/branches/3_3@6486 a8d146d6-cc15-0410-8900-af154a0219e0 |
RAW_PUTCHAR(c)
int c;
{
ASSERT(display);
#ifdef FONT
# ifdef UTF8
if (D_encoding == UTF8)
{
c = (c & 255) | (unsigned char)D_rend.font << 8 | (unsigned char)D_rend.fontx << 16;
# ifdef DW_CHARS
if (D_mbcs)
{
c = D_mbcs;
if (D_x == D_width)
D_x += D_AM ? 1 : -1;
D_mbcs = 0;
}
... | 0 | [] | screen | c5db181b6e017cfccb8d7842ce140e59294d9f62 | 33,784,156,018,607,585,000,000,000,000,000,000,000 | 99 | ansi: add support for xterm OSC 11
It allows for getting and setting the background color. Notably, Vim uses
OSC 11 to learn whether it's running on a light or dark colored terminal
and choose a color scheme accordingly.
Tested with gnome-terminal and xterm. When called with "?" argument the
current background color ... |
struct sock *udp6_lib_lookup(struct net *net, const struct in6_addr *saddr, __be16 sport,
const struct in6_addr *daddr, __be16 dport, int dif)
{
return __udp6_lib_lookup(net, saddr, sport, daddr, dport, dif, &udp_table);
} | 0 | [
"CWE-20"
] | net | bceaa90240b6019ed73b49965eac7d167610be69 | 48,813,594,024,600,120,000,000,000,000,000,000,000 | 5 | inet: prevent leakage of uninitialized memory to user in recv syscalls
Only update *addr_len when we actually fill in sockaddr, otherwise we
can return uninitialized memory from the stack to the caller in the
recvfrom, recvmmsg and recvmsg syscalls. Drop the the (addr_len == NULL)
checks because we only get called wit... |
void WebPImage::readMetadata()
{
if (io_->open() != 0) throw Error(kerDataSourceOpenFailed, io_->path(), strError());
IoCloser closer(*io_);
// Ensure that this is the correct image type
if (!isWebPType(*io_, true)) {
if (io_->error() || io_->eof()) throw Error(kerFai... | 1 | [
"CWE-190"
] | exiv2 | c73d1e27198a389ce7caf52ac30f8e2120acdafd | 160,787,766,558,744,150,000,000,000,000,000,000,000 | 22 | Avoid negative integer overflow when `filesize < io_->tell()`.
This fixes #791. |
bool handle_select(THD *thd, LEX *lex, select_result *result,
ulong setup_tables_done_option)
{
bool res;
SELECT_LEX *select_lex = &lex->select_lex;
DBUG_ENTER("handle_select");
MYSQL_SELECT_START(thd->query());
if (select_lex->master_unit()->is_union() ||
select_lex->master_unit()-... | 0 | [
"CWE-89"
] | server | 5ba77222e9fe7af8ff403816b5338b18b342053c | 306,961,298,427,324,150,000,000,000,000,000,000,000 | 61 | MDEV-21028 Server crashes in Query_arena::set_query_arena upon SELECT from view
if the view has algorithm=temptable it is not updatable,
so DEFAULT() for its fields is meaningless,
and thus it's NULL or 0/'' for NOT NULL columns. |
static void virtio_net_tx_complete(NetClientState *nc, ssize_t len)
{
VirtIONet *n = qemu_get_nic_opaque(nc);
VirtIONetQueue *q = virtio_net_get_subqueue(nc);
VirtIODevice *vdev = VIRTIO_DEVICE(n);
virtqueue_push(q->tx_vq, &q->async_tx.elem, 0);
virtio_notify(vdev, q->tx_vq);
q->async_tx.elem.... | 0 | [
"CWE-119"
] | qemu | 98f93ddd84800f207889491e0b5d851386b459cf | 37,432,523,511,765,000,000,000,000,000,000,000,000 | 14 | virtio-net: out-of-bounds buffer write on load
CVE-2013-4149 QEMU 1.3.0 out-of-bounds buffer write in
virtio_net_load()@hw/net/virtio-net.c
> } else if (n->mac_table.in_use) {
> uint8_t *buf = g_malloc0(n->mac_table.in_use);
We are allocating buffer of size n->mac_table.in_use
> qemu... |
static int fp_mod_d(fp_int *a, fp_digit b, fp_digit *c)
{
return fp_div_d(a, b, NULL, c);
} | 0 | [
"CWE-326",
"CWE-203"
] | wolfssl | 1de07da61f0c8e9926dcbd68119f73230dae283f | 194,016,163,872,571,560,000,000,000,000,000,000,000 | 4 | Constant time EC map to affine for private operations
For fast math, use a constant time modular inverse when mapping to
affine when operation involves a private key - key gen, calc shared
secret, sign. |
xfs_ioc_inumbers(
struct xfs_mount *mp,
unsigned int cmd,
struct xfs_inumbers_req __user *arg)
{
struct xfs_bulk_ireq hdr;
struct xfs_ibulk breq = {
.mp = mp,
};
int error;
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
if (xfs_is_shutdown(mp))
return -EIO;
if (copy_from_user(&hdr, &arg->hdr, ... | 0 | [
"CWE-125"
] | linux | 983d8e60f50806f90534cc5373d0ce867e5aaf79 | 297,512,556,692,573,750,000,000,000,000,000,000,000 | 37 | xfs: map unwritten blocks in XFS_IOC_{ALLOC,FREE}SP just like fallocate
The old ALLOCSP/FREESP ioctls in XFS can be used to preallocate space at
the end of files, just like fallocate and RESVSP. Make the behavior
consistent with the other ioctls.
Reported-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Darric... |
static const char *ctxload_probe_data(const u8 *probe_data, u32 size, GF_FilterProbeScore *score)
{
const char *mime_type = NULL;
char *dst = NULL;
u8 *res;
/* check gzip magic header */
if ((size>2) && (probe_data[0] == 0x1f) && (probe_data[1] == 0x8b)) {
*score = GF_FPROBE_EXT_MATCH;
return "btz|bt.gz|xmt.g... | 1 | [
"CWE-276"
] | gpac | 96699aabae042f8f55cf8a85fa5758e3db752bae | 53,395,394,904,337,960,000,000,000,000,000,000,000 | 134 | fixed #2061 |
static int l2cap_build_conf_rsp(struct l2cap_chan *chan, void *data,
u16 result, u16 flags)
{
struct l2cap_conf_rsp *rsp = data;
void *ptr = rsp->data;
BT_DBG("chan %p", chan);
rsp->scid = cpu_to_le16(chan->dcid);
rsp->result = cpu_to_le16(result);
rsp->flags = cpu_to_le16(flags);
return ptr - data;
} | 0 | [
"CWE-787"
] | linux | e860d2c904d1a9f38a24eb44c9f34b8f915a6ea3 | 87,779,188,529,018,020,000,000,000,000,000,000,000 | 14 | Bluetooth: Properly check L2CAP config option output buffer length
Validate the output buffer length for L2CAP config requests and responses
to avoid overflowing the stack buffer used for building the option blocks.
Cc: stable@vger.kernel.org
Signed-off-by: Ben Seri <ben@armis.com>
Signed-off-by: Marcel Holtmann <mar... |
static void ext4_da_page_release_reservation(struct page *page,
unsigned long offset)
{
int to_release = 0;
struct buffer_head *head, *bh;
unsigned int curr_off = 0;
head = page_buffers(page);
bh = head;
do {
unsigned int next_off = curr_off + bh->b_size;
if ((offset <= curr_off) && (buffer_delay(bh))... | 0 | [
"CWE-399"
] | linux-2.6 | 06a279d636734da32bb62dd2f7b0ade666f65d7c | 34,636,291,986,542,837,000,000,000,000,000,000,000 | 20 | ext4: only use i_size_high for regular files
Directories are not allowed to be bigger than 2GB, so don't use
i_size_high for anything other than regular files. E2fsck should
complain about these inodes, but the simplest thing to do for the
kernel is to only use i_size_high for regular files.
This prevents an intenti... |
span_renderer_fini (cairo_abstract_span_renderer_t *_r,
cairo_int_status_t status)
{
cairo_image_span_renderer_t *r = (cairo_image_span_renderer_t *) _r;
TRACE ((stderr, "%s\n", __FUNCTION__));
if (likely (status == CAIRO_INT_STATUS_SUCCESS)) {
if (r->base.finish)
r->base.finish (r);
}
... | 0 | [] | cairo | 03a820b173ed1fdef6ff14b4468f5dbc02ff59be | 51,142,016,846,399,070,000,000,000,000,000,000,000 | 30 | Fix mask usage in image-compositor |
static inline int open_to_namei_flags(int flag)
{
if ((flag+1) & O_ACCMODE)
flag++;
return flag;
} | 0 | [
"CWE-120"
] | linux-2.6 | d70b67c8bc72ee23b55381bd6a884f4796692f77 | 134,781,373,985,387,470,000,000,000,000,000,000,000 | 6 | [patch] vfs: fix lookup on deleted directory
Lookup can install a child dentry for a deleted directory. This keeps
the directory dentry alive, and the inode pinned in the cache and on
disk, even after all external references have gone away.
This isn't a big problem normally, since memory pressure or umount
will clea... |
server_add_char(struct xrdp_mod* mod, int font, int charactor,
int offset, int baseline,
int width, int height, char* data)
{
struct xrdp_font_char fi;
fi.offset = offset;
fi.baseline = baseline;
fi.width = width;
fi.height = height;
fi.incby = 0;
fi.data = data;
return ... | 0 | [] | xrdp | d8f9e8310dac362bb9578763d1024178f94f4ecc | 1,603,172,997,808,457,800,000,000,000,000,000,000 | 15 | move temp files from /tmp to /tmp/.xrdp |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.