func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
report_trash_progress (CommonJob *job,
int files_trashed,
int total_files)
{
int files_left;
char *s;
files_left = total_files - files_trashed;
nautilus_progress_info_take_status (job->progress,
f (_("Moving files to trash")));
s = f (ngettext ("%'d file left to trash",
"%'d files... | 0 | [] | nautilus | ca2fd475297946f163c32dcea897f25da892b89d | 287,125,126,229,088,400,000,000,000,000,000,000,000 | 22 | Add nautilus_file_mark_desktop_file_trusted(), this now adds a #! line if
2009-02-24 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-file-operations.c:
* libnautilus-private/nautilus-file-operations.h:
Add nautilus_file_mark_desktop_file_trusted(), this now
adds a #! line if th... |
static inline bool vrend_format_can_sample(enum virgl_formats format)
{
if (tex_conv_table[format].bindings & VIRGL_BIND_SAMPLER_VIEW)
return true;
#ifdef ENABLE_MINIGBM_ALLOCATION
uint32_t gbm_format = 0;
if (virgl_gbm_convert_format(&format, &gbm_format))
return false;
if (!gbm || !gbm->devi... | 0 | [
"CWE-787"
] | virglrenderer | 95e581fd181b213c2ed7cdc63f2abc03eaaa77ec | 2,195,533,100,379,006,500,000,000,000,000,000,000 | 19 | vrend: Add test to resource OOB write and fix it
v2: Also check that no depth != 1 has been send when none is due
Closes: #250
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com> |
u32 parse_rap_ref(char *arg_val, u32 opt)
{
if (arg_val) {
TrackIdentifier tkid;
if (parse_track_id(&tkid, arg_val, GF_FALSE)) {
parse_track_action(arg_val, opt ? TRACK_ACTION_REM_NON_REFS : TRACK_ACTION_REM_NON_RAP);
}
}
#ifndef GPAC_DISABLE_STREAMING
hint_flags |= GP_RTP_PCK_SIGNAL_RAP;
#endif
seg_at_ra... | 0 | [
"CWE-787"
] | gpac | 4e56ad72ac1afb4e049a10f2d99e7512d7141f9d | 197,600,788,254,093,900,000,000,000,000,000,000,000 | 14 | fixed #2216 |
static void stbi__hdr_convert(float *output, stbi_uc *input, int req_comp)
{
if ( input[3] != 0 ) {
float f1;
// Exponent
f1 = (float) ldexp(1.0f, input[3] - (int)(128 + 8));
if (req_comp <= 2)
output[0] = (input[0] + input[1] + input[2]) * f1 / 3;
else {
output[0] = i... | 0 | [
"CWE-787"
] | stb | 5ba0baaa269b3fd681828e0e3b3ac0f1472eaf40 | 63,316,104,177,706,080,000,000,000,000,000,000,000 | 26 | stb_image: Reject fractional JPEG component subsampling ratios
The component resamplers are not written to support this and I've
never seen it happen in a real (non-crafted) JPEG file so I'm
fine rejecting this as outright corrupt.
Fixes issue #1178. |
static inline int netlink_capable(const struct socket *sock, unsigned int flag)
{
return (nl_table[sock->sk->sk_protocol].nl_nonroot & flag) ||
capable(CAP_NET_ADMIN);
} | 0 | [
"CWE-287",
"CWE-284"
] | linux | e0e3cea46d31d23dc40df0a49a7a2c04fe8edfea | 4,282,040,772,633,002,500,000,000,000,000,000,000 | 5 | af_netlink: force credentials passing [CVE-2012-3520]
Pablo Neira Ayuso discovered that avahi and
potentially NetworkManager accept spoofed Netlink messages because of a
kernel bug. The kernel passes all-zero SCM_CREDENTIALS ancillary data
to the receiver if the sender did not provide such data, instead of not
includ... |
double JOIN::get_examined_rows()
{
double examined_rows;
double prev_fanout= 1;
double records;
JOIN_TAB *tab= first_breadth_first_tab();
JOIN_TAB *prev_tab= tab;
records= (double)tab->get_examined_rows();
while ((tab= next_breadth_first_tab(first_breadth_first_tab(),
... | 0 | [] | server | ff77a09bda884fe6bf3917eb29b9d3a2f53f919b | 320,704,890,392,397,170,000,000,000,000,000,000,000 | 23 | MDEV-22464 Server crash on UPDATE with nested subquery
Uninitialized ref_pointer_array[] because setup_fields() got empty
fields list. mysql_multi_update() for some reason does that by
substituting the fields list with empty total_list for the
mysql_select() call (looks like wrong merge since total_list is not
used a... |
static json_t *parse_object(lex_t *lex, size_t flags, json_error_t *error)
{
json_t *object = json_object();
if(!object)
return NULL;
lex_scan(lex, error);
if(lex->token == '}')
return object;
while(1) {
char *key;
size_t len;
json_t *value;
if(lex-... | 0 | [
"CWE-20"
] | jansson | 64ce0ad3731ebd77e02897b07920eadd0e2cc318 | 7,318,362,110,019,602,000,000,000,000,000,000,000 | 78 | Fix for issue #282
The fix limits recursion depths when parsing arrays and objects.
The limit is configurable via the `JSON_PARSER_MAX_DEPTH` setting
within `jansson_config.h` and is set by default to 2048.
Update the RFC conformance document to note the limit; the RFC
allows limits to be set by the implementation so... |
sync_min_store(struct mddev *mddev, const char *buf, size_t len)
{
unsigned int min;
int rv;
if (strncmp(buf, "system", 6)==0) {
min = 0;
} else {
rv = kstrtouint(buf, 10, &min);
if (rv < 0)
return rv;
if (min == 0)
return -EINVAL;
}
mddev->sync_speed_min = min;
return len;
} | 0 | [
"CWE-200"
] | linux | b6878d9e03043695dbf3fa1caa6dfc09db225b16 | 199,122,619,277,286,760,000,000,000,000,000,000,000 | 17 | md: use kzalloc() when bitmap is disabled
In drivers/md/md.c get_bitmap_file() uses kmalloc() for creating a
mdu_bitmap_file_t called "file".
5769 file = kmalloc(sizeof(*file), GFP_NOIO);
5770 if (!file)
5771 return -ENOMEM;
This structure is copied to user space at the end of the fun... |
inline void Softmax(const float* input_data, const RuntimeShape& input_shape,
float beta, float* output_data,
const RuntimeShape& output_shape) {
SoftmaxParams params;
params.beta = beta;
Softmax(params, input_shape, input_data, output_shape, output_data);
} | 0 | [
"CWE-703",
"CWE-835"
] | tensorflow | dfa22b348b70bb89d6d6ec0ff53973bacb4f4695 | 261,897,749,513,251,300,000,000,000,000,000,000,000 | 7 | Prevent a division by 0 in average ops.
PiperOrigin-RevId: 385184660
Change-Id: I7affd4554f9b336fca29ac68f633232c094d0bd3 |
void blk_start_plug(struct blk_plug *plug)
{
struct task_struct *tsk = current;
/*
* If this is a nested plug, don't actually assign it.
*/
if (tsk->plug)
return;
INIT_LIST_HEAD(&plug->list);
INIT_LIST_HEAD(&plug->mq_list);
INIT_LIST_HEAD(&plug->cb_list);
/*
* Store ordering should not be needed here, ... | 0 | [
"CWE-416",
"CWE-703"
] | linux | 54648cf1ec2d7f4b6a71767799c45676a138ca24 | 277,773,197,028,427,080,000,000,000,000,000,000,000 | 19 | block: blk_init_allocated_queue() set q->fq as NULL in the fail case
We find the memory use-after-free issue in __blk_drain_queue()
on the kernel 4.14. After read the latest kernel 4.18-rc6 we
think it has the same problem.
Memory is allocated for q->fq in the blk_init_allocated_queue().
If the elevator init function... |
static void vgacon_set_palette(struct vc_data *vc, const unsigned char *table)
{
if (vga_video_type != VIDEO_TYPE_VGAC || vga_palette_blanked
|| !con_is_visible(vc))
return;
vga_set_palette(vc, table);
} | 0 | [
"CWE-125"
] | linux | 973c096f6a85e5b5f2a295126ba6928d9a6afd45 | 284,953,449,934,519,840,000,000,000,000,000,000,000 | 7 | vgacon: remove software scrollback support
Yunhai Zhang recently fixed a VGA software scrollback bug in commit
ebfdfeeae8c0 ("vgacon: Fix for missing check in scrollback handling"),
but that then made people look more closely at some of this code, and
there were more problems on the vgacon side, but also the fbcon sof... |
u_save_cursor(void)
{
return (u_save((linenr_T)(curwin->w_cursor.lnum - 1),
(linenr_T)(curwin->w_cursor.lnum + 1)));
} | 0 | [
"CWE-190"
] | vim | 3eb1637b1bba19519885dd6d377bd5596e91d22c | 2,262,424,923,109,353,200,000,000,000,000,000,000 | 5 | patch 8.0.0377: possible overflow when reading corrupted undo file
Problem: Possible overflow when reading corrupted undo file.
Solution: Check if allocated size is not too big. (King) |
ReadRankDims(mat_t *mat, matvar_t *matvar, enum matio_types data_type, mat_uint32_t nbytes,
size_t *read_bytes)
{
int err = MATIO_E_NO_ERROR;
/* Rank and dimension */
if ( data_type == MAT_T_INT32 ) {
matvar->rank = nbytes / sizeof(mat_uint32_t);
matvar->dims = (size_t *)malloc(... | 0 | [
"CWE-200",
"CWE-401"
] | matio | b53b62b756920f4c1509f4ee06427f66c3b5c9c4 | 44,291,973,589,033,290,000,000,000,000,000,000,000 | 45 | Fix memory leak
As reported by https://github.com/tbeu/matio/issues/186 |
static void find_best_method(BlurMethod *blur, double r2)
{
static const int index[][4] = {
{ 1, 2, 3, 4 },
{ 1, 2, 3, 5 },
{ 1, 2, 4, 6 },
};
double mu[5];
if (r2 < 1.9) {
blur->level = blur->prefilter = blur->filter = 0;
if (r2 < 0.5) {
mu[2] = 0.0... | 0 | [
"CWE-119",
"CWE-787"
] | libass | 08e754612019ed84d1db0d1fc4f5798248decd75 | 204,619,877,334,753,000,000,000,000,000,000,000,000 | 53 | Fix blur coefficient calculation buffer overflow
Found by fuzzer test case id:000082,sig:11,src:002579,op:havoc,rep:8.
Correctness should be checked, but this fixes the overflow for good. |
xfrm_state_sort(struct xfrm_state **dst, struct xfrm_state **src, int n,
unsigned short family)
{
int i;
int err = 0;
struct xfrm_state_afinfo *afinfo = xfrm_state_get_afinfo(family);
struct net *net = xs_net(*src);
if (!afinfo)
return -EAFNOSUPPORT;
spin_lock_bh(&net->xfrm.xfrm_state_lock);
if (afinfo->st... | 0 | [
"CWE-416"
] | linux | dbb2483b2a46fbaf833cfb5deb5ed9cace9c7399 | 108,196,928,099,161,700,000,000,000,000,000,000,000 | 21 | 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... |
static double y2scr_sub(ASS_Renderer *render_priv, double y)
{
if (render_priv->state.explicit)
return y2scr_pos(render_priv, y);
if (render_priv->settings.use_margins)
return y * render_priv->orig_height_nocrop /
render_priv->track->PlayResY +
FFMAX(render_priv->settings... | 0 | [
"CWE-125"
] | libass | f4f48950788b91c6a30029cc28a240b834713ea7 | 254,351,995,727,634,800,000,000,000,000,000,000,000 | 14 | Fix line wrapping mode 0/3 bugs
This fixes two separate bugs:
a) Don't move a linebreak into the first symbol. This results in a empty
line at the front, which does not help to equalize line lengths at all.
Instead, merge line with the second one.
b) When moving a linebreak into a symbol that already is a break... |
static int starts_with_dot_slash(const char *str)
{
return str[0] == '.' && (str[1] == '/' || str[1] == '\\');
} | 0 | [
"CWE-522"
] | git | c44088ecc4b0722636e0a305f9608d3047197282 | 264,647,716,455,044,100,000,000,000,000,000,000,000 | 4 | credential: treat URL without scheme as invalid
libcurl permits making requests without a URL scheme specified. In
this case, it guesses the URL from the hostname, so I can run
git ls-remote http::ftp.example.com/path/to/repo
and it would make an FTP request.
Any user intentionally using such a URL is likely to h... |
int ext4_setattr(struct dentry *dentry, struct iattr *attr)
{
struct inode *inode = d_inode(dentry);
int error, rc = 0;
int orphan = 0;
const unsigned int ia_valid = attr->ia_valid;
error = inode_change_ok(inode, attr);
if (error)
return error;
if (is_quota_modification(inode, attr)) {
error = dquot_initia... | 0 | [
"CWE-362"
] | linux | ea3d7209ca01da209cda6f0dea8be9cc4b7a933b | 106,231,558,647,198,680,000,000,000,000,000,000,000 | 154 | ext4: fix races between page faults and hole punching
Currently, page faults and hole punching are completely unsynchronized.
This can result in page fault faulting in a page into a range that we
are punching after truncate_pagecache_range() has been called and thus
we can end up with a page mapped to disk blocks that... |
ref_stack_push_block(ref_stack_t *pstack, uint keep, uint add)
{
const ref_stack_params_t *params = pstack->params;
uint count = pstack->p - pstack->bot + 1;
uint move = count - keep;
ref_stack_block *pcur = (ref_stack_block *) pstack->current.value.refs;
ref next;
ref_stack_block *pnext;
re... | 0 | [] | ghostpdl | 13b0a36f8181db66a91bcc8cea139998b53a8996 | 222,220,911,880,335,300,000,000,000,000,000,000,000 | 49 | Sanitize op stack for error conditions
We save the stacks to an array and store the array for the error handler to
access.
For SAFER, we traverse the array, and deep copy any op arrays (procedures). As
we make these copies, we check for operators that do *not* exist in systemdict,
when we find one, we replace the ope... |
lookup_hashtable( ulong table, const byte *key, size_t keylen,
int (*cmpfnc)(const void*, const TRUSTREC *),
const void *cmpdata, TRUSTREC *rec )
{
int rc;
ulong hashrec, item;
int msb;
int level=0;
hashrec = table;
next_level:
msb = key[level];
hashrec += msb / ITEM... | 0 | [
"CWE-20"
] | gnupg | 2183683bd633818dd031b090b5530951de76f392 | 72,347,017,455,856,420,000,000,000,000,000,000,000 | 76 | 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 ... |
static JSValue js_bs_is_align(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
{
GET_JSBS
if (!bs) return GF_JS_EXCEPTION(ctx);
if (gf_bs_is_align(bs)) return JS_TRUE;
return JS_FALSE;
} | 0 | [
"CWE-787"
] | gpac | ea1eca00fd92fa17f0e25ac25652622924a9a6a0 | 274,279,335,646,656,250,000,000,000,000,000,000,000 | 7 | fixed #2138 |
htmlnamePop(htmlParserCtxtPtr ctxt)
{
const xmlChar *ret;
if (ctxt->nameNr <= 0)
return (NULL);
ctxt->nameNr--;
if (ctxt->nameNr < 0)
return (NULL);
if (ctxt->nameNr > 0)
ctxt->name = ctxt->nameTab[ctxt->nameNr - 1];
else
ctxt->name = NULL;
ret = ctxt->nameTa... | 0 | [
"CWE-399"
] | libxml2 | de0cc20c29cb3f056062925395e0f68d2250a46f | 298,076,466,332,445,860,000,000,000,000,000,000,000 | 17 | Fix some buffer conversion issues
https://bugzilla.gnome.org/show_bug.cgi?id=690202
Buffer overflow errors originating from xmlBufGetInputBase in 2.9.0
The pointers from the context input were not properly reset after
that call which can do reallocations. |
do_ed_script (char const *inname, char const *outname,
bool *outname_needs_removal, FILE *ofp)
{
static char const editor_program[] = EDITOR_PROGRAM;
file_offset beginning_of_this_line;
size_t chars_read;
FILE *tmpfp = 0;
char const *tmpname;
int tmpfd;
pid_t pid;
if (! dry_run ... | 1 | [
"CWE-78"
] | patch | 3fcd042d26d70856e826a42b5f93dc4854d80bf0 | 338,700,816,905,051,350,000,000,000,000,000,000,000 | 115 | Invoke ed directly instead of using the shell
* src/pch.c (do_ed_script): Invoke ed directly instead of using a shell
command to avoid quoting vulnerabilities. |
static ssize_t DecodePSDPixels(const size_t number_compact_pixels,
const unsigned char *compact_pixels,const ssize_t depth,
const size_t number_pixels,unsigned char *pixels)
{
#define CheckNumberCompactPixels \
if (packets == 0) \
return(i); \
packets--
#define CheckNumberPixels(count) \
if (((ssize_t) i... | 0 | [
"CWE-125"
] | ImageMagick | 30eec879c8b446b0ea9a3bb0da1a441cc8482bc4 | 324,494,240,002,674,950,000,000,000,000,000,000,000 | 129 | Moved check for https://github.com/ImageMagick/ImageMagick/issues/92. |
xmlReadIO(xmlInputReadCallback ioread, xmlInputCloseCallback ioclose,
void *ioctx, const char *URL, const char *encoding, int options)
{
xmlParserCtxtPtr ctxt;
xmlParserInputBufferPtr input;
xmlParserInputPtr stream;
if (ioread == NULL)
return (NULL);
input = xmlParserInputBuffer... | 0 | [
"CWE-125"
] | libxml2 | 77404b8b69bc122d12231807abf1a837d121b551 | 130,741,325,976,063,730,000,000,000,000,000,000,000 | 28 | Make sure the parser returns when getting a Stop order
patch backported from chromiun bug fixes, assuming author is Chris |
static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock,
struct msghdr *msg, size_t size,
int flags)
{
struct sock_iocb *siocb = kiocb_to_siocb(iocb);
struct scm_cookie tmp_scm;
struct sock *sk = sock->sk;
struct unix_sock *u = unix_sk(sk);
struct sockaddr_un *sunaddr=msg->msg_na... | 0 | [] | linux-2.6 | 6209344f5a3795d34b7f2c0061f49802283b6bdd | 135,694,475,495,273,000,000,000,000,000,000,000,000 | 147 | net: unix: fix inflight counting bug in garbage collector
Previously I assumed that the receive queues of candidates don't
change during the GC. This is only half true, nothing can be received
from the queues (see comment in unix_gc()), but buffers could be added
through the other half of the socket pair, which may s... |
static inline int ccid_hc_tx_send_packet(struct ccid *ccid, struct sock *sk,
struct sk_buff *skb)
{
if (ccid->ccid_ops->ccid_hc_tx_send_packet != NULL)
return ccid->ccid_ops->ccid_hc_tx_send_packet(sk, skb);
return CCID_PACKET_SEND_AT_ONCE;
} | 0 | [
"CWE-703"
] | linux | 276bdb82dedb290511467a5a4fdbe9f0b52dce6f | 41,795,028,001,791,673,000,000,000,000,000,000,000 | 7 | dccp: check ccid before dereferencing
ccid_hc_rx_getsockopt() and ccid_hc_tx_getsockopt() might be called with
a NULL ccid pointer leading to a NULL pointer dereference. This could
lead to a privilege escalation if the attacker is able to map page 0 and
prepare it with a fake ccid_ops pointer.
Signed-off-by: Mathias ... |
void CModule::SetNetwork(CIRCNetwork* pNetwork) { m_pNetwork = pNetwork; } | 0 | [
"CWE-20",
"CWE-264"
] | znc | 8de9e376ce531fe7f3c8b0aa4876d15b479b7311 | 219,945,879,976,031,160,000,000,000,000,000,000,000 | 1 | Fix remote code execution and privilege escalation vulnerability.
To trigger this, need to have a user already.
Thanks for Jeriko One <jeriko.one@gmx.us> for finding and reporting this.
CVE-2019-12816 |
TEST(FormatterTest, ZeroFlag) {
EXPECT_EQ("42", format("{0:0}", 42));
EXPECT_EQ("-0042", format("{0:05}", -42));
EXPECT_EQ("00042", format("{0:05}", 42u));
EXPECT_EQ("-0042", format("{0:05}", -42l));
EXPECT_EQ("00042", format("{0:05}", 42ul));
EXPECT_EQ("-0042", format("{0:05}", -42ll));
EXPECT_EQ("00042"... | 0 | [
"CWE-134",
"CWE-119",
"CWE-787"
] | fmt | 8cf30aa2be256eba07bb1cefb998c52326e846e7 | 64,937,697,228,618,850,000,000,000,000,000,000,000 | 19 | Fix segfault on complex pointer formatting (#642) |
eval_queue_handler(evPtr, flags)
Tcl_Event *evPtr;
int flags;
{
struct eval_queue *q = (struct eval_queue *)evPtr;
volatile VALUE ret;
volatile VALUE q_dat;
volatile VALUE thread = q->thread;
struct tcltkip *ptr;
DUMP2("do_eval_queue_handler : evPtr = %p", evPtr);
DUMP2("eval_queue_... | 0 | [] | tk | d098136e3f62a4879a7d7cd34bbd50f482ba3331 | 318,295,341,666,958,770,000,000,000,000,000,000,000 | 96 | tcltklib.c: use StringValueCStr [ci skip]
* ext/tk/tcltklib.c (set_max_block_time, tcl_protect_core,
ip_init, ip_create_slave_core, get_obj_from_str,
ip_cancel_eval_core, lib_set_system_encoding,
alloc_invoke_arguments, lib_merge_tklist): use StringValueCStr
instead of StringValuePtr for values to be passed to... |
rd_parse_cdb(struct se_cmd *cmd)
{
return sbc_parse_cdb(cmd, &rd_sbc_ops);
} | 0 | [
"CWE-200",
"CWE-264"
] | linux | 4442dc8a92b8f9ad8ee9e7f8438f4c04c03a22dc | 199,597,239,841,028,570,000,000,000,000,000,000,000 | 4 | target/rd: Refactor rd_build_device_space + rd_release_device_space
This patch refactors rd_build_device_space() + rd_release_device_space()
into rd_allocate_sgl_table() + rd_release_device_space() so that they
may be used seperatly for setup + release of protection information
scatterlists.
Also add explicit memset ... |
size_t srvstr_pull_req_talloc(TALLOC_CTX *ctx, struct smb_request *req,
char **dest, const uint8_t *src, int flags)
{
ssize_t bufrem = smbreq_bufrem(req, src);
if (bufrem == 0) {
return 0;
}
return pull_string_talloc(ctx, req->inbuf, req->flags2, dest, src,
bufrem, flags);
} | 0 | [
"CWE-200"
] | samba | 3ddc9344c2fa7461336899fbddb0bb80995e9170 | 188,524,147,631,761,470,000,000,000,000,000,000,000 | 12 | CVE-2022-32742: s3: smbd: Harden the smbreq_bufrem() macro.
Fixes the raw.write.bad-write test.
NB. We need the two (==0) changes in source3/smbd/smb2_reply.c
as the gcc optimizer now knows that the return from
smbreq_bufrem() can never be less than zero.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15085
Remove... |
static int rds_cmsg_recv(struct rds_incoming *inc, struct msghdr *msg)
{
int ret = 0;
if (inc->i_rdma_cookie) {
ret = put_cmsg(msg, SOL_RDS, RDS_CMSG_RDMA_DEST,
sizeof(inc->i_rdma_cookie), &inc->i_rdma_cookie);
if (ret)
return ret;
}
return 0;
} | 0 | [
"CWE-200"
] | linux-2.6 | 06b6a1cf6e776426766298d055bb3991957d90a7 | 282,242,654,305,658,700,000,000,000,000,000,000,000 | 13 | rds: set correct msg_namelen
Jay Fenlason (fenlason@redhat.com) found a bug,
that recvfrom() on an RDS socket can return the contents of random kernel
memory to userspace if it was called with a address length larger than
sizeof(struct sockaddr_in).
rds_recvmsg() also fails to set the addr_len paramater properly befor... |
bool btrfs_inc_nocow_writers(struct btrfs_fs_info *fs_info, u64 bytenr)
{
struct btrfs_block_group *bg;
bool ret = true;
bg = btrfs_lookup_block_group(fs_info, bytenr);
if (!bg)
return false;
spin_lock(&bg->lock);
if (bg->ro)
ret = false;
else
atomic_inc(&bg->nocow_writers);
spin_unlock(&bg->lock);
/*... | 0 | [
"CWE-703",
"CWE-667"
] | linux | 1cb3db1cf383a3c7dbda1aa0ce748b0958759947 | 304,977,588,160,728,100,000,000,000,000,000,000,000 | 22 | 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... |
g_getenv(const char* name)
{
#if defined(_WIN32)
return 0;
#else
return getenv(name);
#endif
} | 0 | [] | xrdp | d8f9e8310dac362bb9578763d1024178f94f4ecc | 218,323,306,473,857,920,000,000,000,000,000,000,000 | 8 | move temp files from /tmp to /tmp/.xrdp |
CURLcode Curl_add_custom_headers(struct Curl_easy *data,
bool is_connect,
#ifndef USE_HYPER
struct dynbuf *req
#else
void *req
#endif
)
{
struct connectdata *conn = data->conn;
char *ptr;
struct curl_slist *h[2];
... | 1 | [] | curl | 139a54ed0a172adaaf1a78d6f4fff50b2c3f9e08 | 19,147,805,000,754,688,000,000,000,000,000,000,000 | 152 | openssl: don't leak the SRP credentials in redirects either
Follow-up to 620ea21410030
Reported-by: Harry Sintonen
Closes #8751 |
irc_server_msgq_add_msg (struct t_irc_server *server, const char *msg)
{
struct t_irc_message *message;
if (!server->unterminated_message && !msg[0])
return;
message = malloc (sizeof (*message));
if (!message)
{
weechat_printf (server->buffer,
_("%s%... | 0 | [
"CWE-20"
] | weechat | c265cad1c95b84abfd4e8d861f25926ef13b5d91 | 144,821,657,038,650,620,000,000,000,000,000,000,000 | 50 | Fix verification of SSL certificates by calling gnutls verify callback (patch #7459) |
uint8_t ucStreamBufferGetStreamBufferType( StreamBufferHandle_t xStreamBuffer )
{
return( xStreamBuffer->ucFlags & sbFLAGS_IS_MESSAGE_BUFFER );
}
| 0 | [
"CWE-190"
] | FreeRTOS-Kernel | d05b9c123f2bf9090bce386a244fc934ae44db5b | 24,245,898,962,623,940,000,000,000,000,000,000,000 | 4 | Add addition overflow check for stream buffer (#226) |
mbfl_buffer_converter_result(mbfl_buffer_converter *convd, mbfl_string *result)
{
if (convd == NULL || result == NULL) {
return NULL;
}
result->no_encoding = convd->to->no_encoding;
return mbfl_memory_device_result(&convd->device, result);
} | 0 | [
"CWE-119"
] | php-src | 64f42c73efc58e88671ad76b6b6bc8e2b62713e1 | 309,347,480,164,518,300,000,000,000,000,000,000,000 | 8 | Fixed bug #71906: AddressSanitizer: negative-size-param (-1) in mbfl_strcut |
static int nfs_writepages_callback(struct page *page, struct writeback_control *wbc, void *data)
{
int ret;
ret = nfs_do_writepage(page, wbc, data);
unlock_page(page);
return ret;
} | 0 | [] | linux | c7559663e42f4294ffe31fe159da6b6a66b35d61 | 226,078,416,770,303,020,000,000,000,000,000,000,000 | 8 | NFS: Allow nfs_updatepage to extend a write under additional circumstances
Currently nfs_updatepage allows a write to be extended to cover a full
page only if we don't have a byte range lock lock on the file... but if
we have a write delegation on the file or if we have the whole file
locked for writing then we should... |
static bool tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb,
bool *is_cwnd_limited,
bool *is_rwnd_limited,
u32 max_segs)
{
const struct inet_connection_sock *icsk = inet_csk(sk);
u32 send_win, cong_win, limit, in_flight;
struct tcp_sock *tp = tcp_sk(sk);
struct sk_buff *head;
int win_divis... | 0 | [
"CWE-190"
] | net | 3b4929f65b0d8249f19a50245cd88ed1a2f78cff | 314,191,645,990,756,260,000,000,000,000,000,000,000 | 101 | 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... |
static int udp_lib_lport_inuse(struct net *net, __u16 num,
const struct udp_hslot *hslot,
unsigned long *bitmap,
struct sock *sk,
int (*saddr_comp)(const struct sock *sk1,
const struct sock *sk2,
bool match_wildcard),
unsigned int log)
{
struct sock *sk2;... | 0 | [] | linux | a612769774a30e4fc143c4cb6395c12573415660 | 138,099,126,763,780,520,000,000,000,000,000,000,000 | 30 | udp: prevent bugcheck if filter truncates packet too much
If socket filter truncates an udp packet below the length of UDP header
in udpv6_queue_rcv_skb() or udp_queue_rcv_skb(), it will trigger a
BUG_ON in skb_pull_rcsum(). This BUG_ON (and therefore a system crash if
kernel is configured that way) can be easily enfo... |
static inline bool file_mmap_ok(struct file *file, struct inode *inode,
unsigned long pgoff, unsigned long len)
{
u64 maxsize = file_mmap_size_max(file, inode);
if (maxsize && len > maxsize)
return false;
maxsize -= len;
if (pgoff > maxsize >> PAGE_SHIFT)
return false;
return true;
} | 0 | [
"CWE-476"
] | linux | 0a1d52994d440e21def1c2174932410b4f2a98a1 | 38,315,964,046,946,160,000,000,000,000,000,000,000 | 12 | mm: enforce min addr even if capable() in expand_downwards()
security_mmap_addr() does a capability check with current_cred(), but
we can reach this code from contexts like a VFS write handler where
current_cred() must not be used.
This can be abused on systems without SMAP to make NULL pointer
dereferences exploitab... |
static void sctp_generate_fwdtsn(struct sctp_outq *q, __u32 ctsn)
{
struct sctp_association *asoc = q->asoc;
struct sctp_chunk *ftsn_chunk = NULL;
struct sctp_fwdtsn_skip ftsn_skip_arr[10];
int nskips = 0;
int skip_pos = 0;
__u32 tsn;
struct sctp_chunk *chunk;
struct list_head *lchunk, *temp;
if (!asoc->peer.... | 0 | [] | linux | 196d67593439b03088913227093e374235596e33 | 189,742,722,605,055,900,000,000,000,000,000,000,000 | 104 | sctp: Add support to per-association statistics via a new SCTP_GET_ASSOC_STATS call
The current SCTP stack is lacking a mechanism to have per association
statistics. This is an implementation modeled after OpenSolaris'
SCTP_GET_ASSOC_STATS.
Userspace part will follow on lksctp if/when there is a general ACK on
this.
... |
static void __sco_sock_close(struct sock *sk)
{
BT_DBG("sk %p state %d socket %p", sk, sk->sk_state, sk->sk_socket);
switch (sk->sk_state) {
case BT_LISTEN:
sco_sock_cleanup_listen(sk);
break;
case BT_CONNECTED:
case BT_CONFIG:
if (sco_pi(sk)->conn->hcon) {
sk->sk_state = BT_DISCONN;
sco_sock_set_tim... | 0 | [
"CWE-20",
"CWE-269"
] | linux | f3d3342602f8bcbf37d7c46641cb9bca7618eb1c | 101,237,334,397,122,670,000,000,000,000,000,000,000 | 31 | net: rework recvmsg handler msg_name and msg_namelen logic
This patch now always passes msg->msg_namelen as 0. recvmsg handlers must
set msg_namelen to the proper size <= sizeof(struct sockaddr_storage)
to return msg_name to the user.
This prevents numerous uninitialized memory leaks we had in the
recvmsg handlers an... |
static bool flatview_access_valid(struct uc_struct *uc, FlatView *fv, hwaddr addr, hwaddr len,
bool is_write, MemTxAttrs attrs)
{
MemoryRegion *mr;
hwaddr l, xlat;
while (len > 0) {
l = len;
mr = flatview_translate(uc, fv, addr, &xlat, &l, is_write, attrs);... | 0 | [
"CWE-476"
] | unicorn | 3d3deac5e6d38602b689c4fef5dac004f07a2e63 | 174,262,643,503,301,830,000,000,000,000,000,000,000 | 21 | Fix crash when mapping a big memory and calling uc_close |
static void ati_cursor_invalidate(VGACommonState *vga)
{
ATIVGAState *s = container_of(vga, ATIVGAState, vga);
int size = (s->regs.crtc_gen_cntl & CRTC2_CUR_EN) ? 64 : 0;
if (s->regs.cur_offset & BIT(31)) {
return; /* Do not update cursor if locked */
}
if (s->cursor_size != size ||
... | 0 | [
"CWE-125"
] | qemu | aab0e2a661b2b6bf7915c0aefe807fb60d6d9d13 | 266,577,956,805,958,800,000,000,000,000,000,000,000 | 26 | ati: use vga_read_byte in ati_cursor_define
This makes sure reads are confined to vga video memory.
v3: use uint32_t, fix cut+paste bug.
v2: fix ati_cursor_draw_line too.
Reported-by: xu hang <flier_m@outlook.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: BALATON Zoltan <balaton@eik.bme.hu>
Revie... |
mount_cancel (NautilusDirectory *directory)
{
if (directory->details->mount_state != NULL) {
g_cancellable_cancel (directory->details->mount_state->cancellable);
directory->details->mount_state->directory = NULL;
directory->details->mount_state = NULL;
async_job_end (directory, "mount");
}
} | 0 | [] | nautilus | 7632a3e13874a2c5e8988428ca913620a25df983 | 9,631,030,262,281,049,000,000,000,000,000,000,000 | 9 | 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-... |
setup_syscalls_segments(struct x86_emulate_ctxt *ctxt,
struct kvm_segment *cs, struct kvm_segment *ss)
{
memset(cs, 0, sizeof(struct kvm_segment));
kvm_x86_ops->get_segment(ctxt->vcpu, cs, VCPU_SREG_CS);
memset(ss, 0, sizeof(struct kvm_segment));
cs->l = 0; /* will be adjusted later */
cs->base = 0; /* flat se... | 0 | [
"CWE-20"
] | kvm | e42d9b8141d1f54ff72ad3850bb110c95a5f3b88 | 41,505,413,980,803,766,000,000,000,000,000,000,000 | 27 | KVM: x86 emulator: limit instructions to 15 bytes
While we are never normally passed an instruction that exceeds 15 bytes,
smp games can cause us to attempt to interpret one, which will cause
large latencies in non-preempt hosts.
Cc: stable@kernel.org
Signed-off-by: Avi Kivity <avi@redhat.com> |
init_buffer_source(j_decompress_ptr)
{
} | 0 | [
"CWE-787"
] | qpdf | d71f05ca07eb5c7cfa4d6d23e5c1f2a800f52e8e | 142,691,626,596,723,310,000,000,000,000,000,000,000 | 3 | Fix sign and conversion warnings (major)
This makes all integer type conversions that have potential data loss
explicit with calls that do range checks and raise an exception. After
this commit, qpdf builds with no warnings when -Wsign-conversion
-Wconversion is used with gcc or clang or when -W3 -Wd4800 is used
with ... |
static void check_str_end(compiler_common *common, jump_list **end_reached)
{
/* Does not affect registers. Usually used in a tight spot. */
DEFINE_COMPILER;
struct sljit_jump *jump;
if (common->mode == PCRE2_JIT_COMPLETE)
{
add_jump(compiler, end_reached, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0));
retur... | 0 | [
"CWE-125"
] | php-src | 8947fd9e9fdce87cd6c59817b1db58e789538fe9 | 26,523,747,786,988,610,000,000,000,000,000,000,000 | 29 | Fix #78338: Array cross-border reading in PCRE
We backport r1092 from pcre2. |
int is_error_page(struct page *page)
{
return page == bad_page || page == hwpoison_page || page == fault_page;
} | 0 | [
"CWE-399"
] | kvm | 5b40572ed5f0344b9dbee486a17c589ce1abe1a3 | 225,295,383,332,014,050,000,000,000,000,000,000,000 | 4 | KVM: Ensure all vcpus are consistent with in-kernel irqchip settings
If some vcpus are created before KVM_CREATE_IRQCHIP, then
irqchip_in_kernel() and vcpu->arch.apic will be inconsistent, leading
to potential NULL pointer dereferences.
Fix by:
- ensuring that no vcpus are installed when KVM_CREATE_IRQCHIP is called
... |
void markTransformBlockBoundary(de265_image* img, int x0,int y0,
int log2TrafoSize,int trafoDepth,
int filterLeftCbEdge, int filterTopCbEdge)
{
logtrace(LogDeblock,"markTransformBlockBoundary(%d,%d, %d,%d, %d,%d)\n",x0,y0,
log2TrafoSize,trafoD... | 0 | [
"CWE-703"
] | libde265 | 45904e5667c5bf59c67fcdc586dfba110832894c | 122,806,686,933,767,960,000,000,000,000,000,000,000 | 31 | fix reading invalid images where shdr references are NULL in part of the image (#302) |
efind(name)
char *name;
{
static char efbuf[100];
my_regex_t re;
sprintf(efbuf, "REG_%s", name);
assert(strlen(efbuf) < sizeof(efbuf));
re.re_endp = efbuf;
(void) my_regerror(REG_ATOI, &re, efbuf, sizeof(efbuf));
return(atoi(efbuf));
} | 1 | [
"CWE-200"
] | mysql-server | 0dbd5a8797ed4bd18e8b883988fb62177eb0f73f | 184,068,539,660,847,450,000,000,000,000,000,000,000 | 12 | Bug#21973610: BUFFER OVERFLOW ISSUES
Description : Incorrect usage of sprintf/strcpy caused
possible buffer overflow issues at various
places.
Solution : - Fixed mysql_plugin and mysqlshow
- Fixed regex library issues
Reviewed-By : Georgi Kodinov <georgi.kodinov@oracle.com>
Rev... |
static __u32 secure_tcp_syn_cookie(const struct in6_addr *saddr,
const struct in6_addr *daddr,
__be16 sport, __be16 dport, __u32 sseq,
__u32 data)
{
u32 count = tcp_cookie_time();
return (cookie_hash(saddr, daddr, sport, dport, 0, 0) +
sseq + (count << COOKIEBITS) +
((cookie_hash(saddr, daddr... | 0 | [
"CWE-416",
"CWE-284",
"CWE-264"
] | linux | 45f6fad84cc305103b28d73482b344d7f5b76f39 | 272,596,760,333,452,850,000,000,000,000,000,000,000 | 11 | ipv6: add complete rcu protection around np->opt
This patch addresses multiple problems :
UDP/RAW sendmsg() need to get a stable struct ipv6_txoptions
while socket is not locked : Other threads can change np->opt
concurrently. Dmitry posted a syzkaller
(http://github.com/google/syzkaller) program desmonstrating
use-a... |
static int load_capng(void)
{
if (!cap_loaded) {
pthread_mutex_lock(&cap.mutex);
capng_restore_state(&cap.saved);
/*
* restore_state free's the saved copy
* so make another.
*/
cap.saved = capng_save_state();
if (!cap.saved) {
pthread_mu... | 0 | [] | qemu | 6084633dff3a05d63176e06d7012c7e15aba15be | 199,368,839,042,932,680,000,000,000,000,000,000,000 | 26 | tools/virtiofsd: xattr name mappings: Add option
Add an option to define mappings of xattr names so that
the client and server filesystems see different views.
This can be used to have different SELinux mappings as
seen by the guest, to run the virtiofsd with less privileges
(e.g. in a case where it can't set trusted/... |
AbstractSqlMigrator::AbstractSqlMigrator()
: _query(0)
{
} | 0 | [
"CWE-89"
] | quassel | aa1008be162cb27da938cce93ba533f54d228869 | 111,128,122,823,725,240,000,000,000,000,000,000,000 | 4 | Fixing security vulnerability with Qt 4.8.5+ and PostgreSQL.
Properly detects whether Qt performs slash escaping in SQL queries or
not, and then configures PostgreSQL accordingly. This bug was a
introduced due to a bugfix in Qt 4.8.5 disables slash escaping when
binding queries: https://bugreports.qt-project.org/brows... |
int iwl_sta_rx_agg_start(struct iwl_priv *priv, struct ieee80211_sta *sta,
int tid, u16 ssn)
{
unsigned long flags;
int sta_id;
struct iwl_addsta_cmd sta_cmd;
lockdep_assert_held(&priv->shrd->mutex);
sta_id = iwl_sta_id(sta);
if (sta_id == IWL_INVALID_STATION)
return -ENXIO;
spin_lock_irqsave(&priv->shr... | 0 | [
"CWE-119",
"CWE-787"
] | linux | 2da424b0773cea3db47e1e81db71eeebde8269d4 | 173,100,590,969,890,060,000,000,000,000,000,000,000 | 24 | iwlwifi: Sanity check for sta_id
On my testing, I saw some strange behavior
[ 421.739708] iwlwifi 0000:01:00.0: ACTIVATE a non DRIVER active station id 148 addr 00:00:00:00:00:00
[ 421.739719] iwlwifi 0000:01:00.0: iwl_sta_ucode_activate Added STA id 148 addr 00:00:00:00:00:00 to uCode
not sure how it happen, but ... |
BasicMemoryWriter &operator=(BasicMemoryWriter &&other) {
buffer_ = std::move(other.buffer_);
return *this;
} | 0 | [
"CWE-134",
"CWE-119",
"CWE-787"
] | fmt | 8cf30aa2be256eba07bb1cefb998c52326e846e7 | 47,161,290,272,269,960,000,000,000,000,000,000,000 | 4 | Fix segfault on complex pointer formatting (#642) |
PJ_DEF(const char*) pjsip_transport_get_type_desc(pjsip_transport_type_e type)
{
/* Return the description. */
return get_tpname(type)->description;
} | 0 | [
"CWE-297",
"CWE-295"
] | pjproject | 67e46c1ac45ad784db5b9080f5ed8b133c122872 | 99,622,598,446,957,540,000,000,000,000,000,000,000 | 5 | Merge pull request from GHSA-8hcp-hm38-mfph
* Check hostname during TLS transport selection
* revision based on feedback
* remove the code in create_request that has been moved |
garp_group_interface_handler(vector_t *strvec)
{
interface_t *ifp = if_get_by_ifname(strvec_slot(strvec, 1), IF_CREATE_IF_DYNAMIC);
if (!ifp) {
report_config_error(CONFIG_GENERAL_ERROR, "WARNING - interface %s specified for garp_group doesn't exist", FMT_STR_VSLOT(strvec, 1));
return;
}
if (ifp->garp_delay) {
... | 0 | [
"CWE-59",
"CWE-61"
] | keepalived | 04f2d32871bb3b11d7dc024039952f2fe2750306 | 205,951,265,543,835,900,000,000,000,000,000,000,000 | 22 | 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 ... |
void color_esycc_to_rgb(opj_image_t *image)
{
int y, cb, cr, sign1, sign2, val;
unsigned int w, h, max, i;
int flip_value = (1 << (image->comps[0].prec - 1));
int max_value = (1 << image->comps[0].prec) - 1;
if (
(image->numcomps < 3)
|| (image->comps[0].dx != image->comps[1].dx) ||... | 0 | [
"CWE-119",
"CWE-787"
] | openjpeg | 2e5ab1d9987831c981ff05862e8ccf1381ed58ea | 153,105,585,157,778,260,000,000,000,000,000,000,000 | 76 | color_apply_icc_profile: avoid potential heap buffer overflow
Derived from a patch by Thuan Pham |
static void SFDFixupUndoRefs(SplineFont *sf) {
int i=0;
Undoes *undo = 0;
for ( i=0; i<sf->glyphcnt; ++i ) {
if ( sf->glyphs[i]!=NULL ) {
SplineChar *sc = sf->glyphs[i];
int layer = 0;
for ( layer=0; layer<sc->layer_cnt; ++layer ) {
if( sc->layers[layer].undoes ) {
undo = sc->layers... | 0 | [
"CWE-416"
] | fontforge | 048a91e2682c1a8936ae34dbc7bd70291ec05410 | 2,393,179,389,595,787,400,000,000,000,000,000,000 | 23 | Fix for #4084 Use-after-free (heap) in the SFD_GetFontMetaData() function
Fix for #4086 NULL pointer dereference in the SFDGetSpiros() function
Fix for #4088 NULL pointer dereference in the SFD_AssignLookups() function
Add empty sf->fontname string if it isn't set, fixing #4089 #4090 and many
other potential issues (... |
static int do_command(cmd_request_t cmd)
{
struct booth_site *site;
struct boothc_ticket_msg reply;
struct booth_transport const *tpt;
uint32_t leader_id;
int rv;
int reply_cnt = 0, msg_logged = 0;
const char *op_str = "";
if (cmd == CMD_GRANT)
op_str = "grant";
else if (cmd == CMD_REVOKE)
op_str = "revok... | 0 | [
"CWE-287",
"CWE-284"
] | booth | 35bf0b7b048d715f671eb68974fb6b4af6528c67 | 94,773,440,968,237,540,000,000,000,000,000,000,000 | 112 | Revert "Refactor: main: substitute is_auth_req macro"
This reverts commit da79b8ba28ad4837a0fee13e5f8fb6f89fe0e24c.
authfile != authkey
Signed-off-by: Jan Friesse <jfriesse@redhat.com> |
static void reset_buffer_flags(struct n_tty_data *ldata)
{
ldata->read_head = ldata->canon_head = ldata->read_tail = 0;
ldata->echo_head = ldata->echo_tail = ldata->echo_commit = 0;
ldata->echo_mark = 0;
ldata->line_start = 0;
ldata->erasing = 0;
bitmap_zero(ldata->read_flags, N_TTY_BUF_SIZE);
ldata->push = 0;
... | 0 | [
"CWE-362"
] | tty | 4291086b1f081b869c6d79e5b7441633dc3ace00 | 123,067,295,016,834,340,000,000,000,000,000,000,000 | 11 | n_tty: Fix n_tty_write crash when echoing in raw mode
The tty atomic_write_lock does not provide an exclusion guarantee for
the tty driver if the termios settings are LECHO & !OPOST. And since
it is unexpected and not allowed to call TTY buffer helpers like
tty_insert_flip_string concurrently, this may lead to crashe... |
XSetSizeHints( /* old routine */
Display *dpy,
Window w,
XSizeHints *hints,
Atom property)
{
xPropSizeHints prop;
memset(&prop, 0, sizeof(prop));
prop.flags = (hints->flags & (USPosition|USSize|PAllHints));
if (hints->flags & (USPosition|PPosition)) {
prop.x = hints->x;
prop.y = hints->y;
}
... | 0 | [
"CWE-120"
] | libx11 | 8d2e02ae650f00c4a53deb625211a0527126c605 | 184,826,251,712,955,180,000,000,000,000,000,000,000 | 39 | Reject string longer than USHRT_MAX before sending them on the wire
The X protocol uses CARD16 values to represent the length so
this would overflow.
CVE-2021-31535
Signed-off-by: Matthieu Herrb <matthieu@herrb.eu> |
OPJ_BOOL opj_j2k_end_compress(opj_j2k_t *p_j2k,
opj_stream_private_t *p_stream,
opj_event_mgr_t * p_manager)
{
/* customization of the encoding */
if (! opj_j2k_setup_end_compress(p_j2k, p_manager)) {
return OPJ_FALSE;
}
if (! opj_j2k_... | 0 | [
"CWE-416",
"CWE-787"
] | openjpeg | 4241ae6fbbf1de9658764a80944dc8108f2b4154 | 98,360,745,065,090,100,000,000,000,000,000,000,000 | 15 | Fix assertion in debug mode / heap-based buffer overflow in opj_write_bytes_LE for Cinema profiles with numresolutions = 1 (#985) |
_rl_signal_handler (sig)
int sig;
{
_rl_caught_signal = 0; /* XXX */
#if defined (SIGWINCH)
if (sig == SIGWINCH)
{
rl_resize_terminal ();
/* XXX - experimental for now */
/* Call a signal hook because though we called the original signal handler
in rl_sigwinch_handler below, we will no... | 0 | [] | bash | 955543877583837c85470f7fb8a97b7aa8d45e6c | 255,457,228,435,685,740,000,000,000,000,000,000,000 | 22 | bash-4.4-rc2 release |
int platform_get_irq_byname_optional(struct platform_device *dev,
const char *name)
{
return __platform_get_irq_byname(dev, name);
} | 0 | [
"CWE-787"
] | linux | aa838896d87af561a33ecefea1caa4c15a68bc47 | 258,930,858,078,094,570,000,000,000,000,000,000,000 | 5 | drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions
Convert the various sprintf fmaily calls in sysfs device show functions
to sysfs_emit and sysfs_emit_at for PAGE_SIZE buffer safety.
Done with:
$ spatch -sp-file sysfs_emit_dev.cocci --in-place --max-width=80 .
And cocci script:
$ cat s... |
int FoFiTrueType::checkGIDInCoverage(Guint coverage, Guint orgGID)
{
int index = -1;
Guint format;
Guint count;
Guint i;
Guint pos;
pos = coverage;
format = getU16BE(pos,&parsedOk);
pos += 2;
switch (format) {
case 1:
count = getU16BE(pos,&parsedOk);
pos += 2;
// In some poor CJK fonts,... | 0 | [
"CWE-125"
] | poppler | cdb7ad95f7c8fbf63ade040d8a07ec96467042fc | 148,851,267,196,154,140,000,000,000,000,000,000,000 | 58 | Fix malformed file crash in bug #85243 |
mswin_handle_fclose(gx_io_device * iodev, gp_file * file)
{
gp_fclose(file);
return 0;
} | 0 | [
"CWE-20"
] | ghostpdl | a9bd3dec9fde03327a4a2c69dad1036bf9632e20 | 61,712,528,344,087,790,000,000,000,000,000,000,000 | 5 | Bug 704342: Include device specifier strings in access validation
for the "%pipe%", %handle%" and %printer% io devices.
We previously validated only the part after the "%pipe%" Postscript device
specifier, but this proved insufficient.
This rebuilds the original file name string, and validates it complete. The
sligh... |
int cgroup1_parse_param(struct fs_context *fc, struct fs_parameter *param)
{
struct cgroup_fs_context *ctx = cgroup_fc2context(fc);
struct cgroup_subsys *ss;
struct fs_parse_result result;
int opt, i;
opt = fs_parse(fc, cgroup1_fs_parameters, param, &result);
if (opt == -ENOPARAM) {
int ret;
ret = vfs_parse... | 0 | [
"CWE-287",
"CWE-269"
] | linux | 24f6008564183aa120d07c03d9289519c2fe02af | 296,705,981,820,607,070,000,000,000,000,000,000,000 | 88 | cgroup-v1: Require capabilities to set release_agent
The cgroup release_agent is called with call_usermodehelper. The function
call_usermodehelper starts the release_agent with a full set fo capabilities.
Therefore require capabilities when setting the release_agaent.
Reported-by: Tabitha Sable <tabitha.c.sable@gmai... |
Item_field::create_tmp_field_from_item_field(TABLE *new_table,
Item_ref *orig_item,
const Tmp_field_param *param)
{
DBUG_ASSERT(!is_result_field());
Field *result;
LEX_CSTRING *new_name= (orig_item ? &orig_item->name :
... | 0 | [] | server | 8c34eab9688b4face54f15f89f5d62bdfd93b8a7 | 114,794,333,205,397,980,000,000,000,000,000,000,000 | 52 | MDEV-28094 Window function in expression in ORDER BY
call item->split_sum_func() in setup_order() just as
it's done in setup_fields() |
static void setup_private_mount(const char *snap_name)
{
char tmpdir[MAX_BUF] = { 0 };
// Create a 0700 base directory, this is the base dir that is
// protected from other users.
//
// Under that basedir, we put a 1777 /tmp dir that is then bind
// mounted for the applications to use
sc_must_snprintf(tmpdir, s... | 0 | [
"CWE-59",
"CWE-703"
] | snapd | bdbfeebef03245176ae0dc323392bb0522a339b1 | 101,653,594,738,746,240,000,000,000,000,000,000,000 | 44 | cmd/snap-confine: chown private /tmp parent to root.root
When snap-confine creates a private /tmp directory for a given snap it
first creates a temporary directory in /tmp/ named after the snap, along
with a random name. Inside that directory it creates a /tmp directory
with permissions appropriate for a future /tmp, ... |
static void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
size_t frame_size)
{
unsigned long sp;
/* Default to using normal stack */
sp = regs->sp;
/* This is the X/Open sanctioned signal stack switching. */
if (ka->sa.sa_flags & SA_ONSTACK) {
if (sas_ss_flags(sp) == 0)
sp = curre... | 0 | [
"CWE-399"
] | linux-2.6 | e40cd10ccff3d9fbffd57b93780bee4b7b9bff51 | 183,770,217,219,950,520,000,000,000,000,000,000,000 | 26 | 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... |
sph_enc64be(void *dst, sph_u64 val)
{
#if defined SPH_UPTR
#if SPH_UNALIGNED
#if SPH_LITTLE_ENDIAN
val = sph_bswap64(val);
#endif
*(sph_u64 *)dst = val;
#else
if (((SPH_UPTR)dst & 7) == 0) {
#if SPH_LITTLE_ENDIAN
val = sph_bswap64(val);
#endif
*(sph_u64 *)dst = val;
} else {
((unsigned char *)dst)[0] = (val >... | 0 | [
"CWE-787"
] | qpdf | d71f05ca07eb5c7cfa4d6d23e5c1f2a800f52e8e | 135,733,052,327,457,460,000,000,000,000,000,000,000 | 36 | Fix sign and conversion warnings (major)
This makes all integer type conversions that have potential data loss
explicit with calls that do range checks and raise an exception. After
this commit, qpdf builds with no warnings when -Wsign-conversion
-Wconversion is used with gcc or clang or when -W3 -Wd4800 is used
with ... |
ostream& print_actions(ostream& m, const uint64_t a) {
bool begun = false;
m << "[ ";
for (auto i = 0U; i < s3Count; ++i) {
if (a & (1 << i)) {
if (begun) {
m << ", ";
} else {
begun = true;
}
m << action_bit_string(1 << i);
}
}
if (begun) {
m << " ]";
} else {
m <<... | 0 | [
"CWE-617"
] | ceph | b3118cabb8060a8cc6a01c4e8264cb18e7b1745a | 193,105,427,019,693,360,000,000,000,000,000,000,000 | 20 | rgw: Remove assertions in IAM Policy
A couple of them could be triggered by user input.
Signed-off-by: Adam C. Emerson <aemerson@redhat.com> |
str_dup(UChar* s, UChar* end)
{
int len = end - s;
if (len > 0) {
UChar* r = (UChar* )xmalloc(len + 1);
CHECK_NULL_RETURN(r);
xmemcpy(r, s, len);
r[len] = (UChar )0;
return r;
}
else return NULL;
} | 0 | [
"CWE-125"
] | php-src | c6e34d91b88638966662caac62c4d0e90538e317 | 16,014,245,470,230,160,000,000,000,000,000,000,000 | 13 | Fix bug #77371 (heap buffer overflow in mb regex functions - compile_string_node) |
void schi_box_del(GF_Box *s)
{
gf_free(s);
} | 0 | [
"CWE-703"
] | gpac | f19668964bf422cf5a63e4dbe1d3c6c75edadcbb | 117,166,059,391,851,120,000,000,000,000,000,000,000 | 4 | fixed #1879 |
void BN_consttime_swap(BN_ULONG condition, BIGNUM *a, BIGNUM *b, int nwords)
{
BN_ULONG t;
int i;
bn_wcheck_size(a, nwords);
bn_wcheck_size(b, nwords);
assert(a != b);
assert((condition & (condition - 1)) == 0);
assert(sizeof(BN_ULONG) >= sizeof(int));
condition = ((condition - 1) >> ... | 0 | [] | openssl | b18162a7c9bbfb57112459a4d6631fa258fd8c0c | 35,091,066,796,950,010,000,000,000,000,000,000,000 | 85 | CVE-2018-5407 fix: ECC ladder
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/7593) |
const ZRtp::zrtpInfo* ZRtp::getDetailInfo() {
return &detailInfo;
} | 0 | [
"CWE-119"
] | ZRTPCPP | c8617100f359b217a974938c5539a1dd8a120b0e | 336,281,996,811,425,920,000,000,000,000,000,000,000 | 3 | Fix vulnerabilities found and reported by Mark Dowd
- limit length of memcpy
- limit number of offered algorithms in Hello packet
- length check in PING packet
- fix a small coding error |
void lodepng_chunk_generate_crc(unsigned char* chunk)
{
unsigned length = lodepng_chunk_length(chunk);
unsigned CRC = lodepng_crc32(&chunk[4], length + 4);
lodepng_set32bitInt(chunk + 8 + length, CRC);
} | 0 | [
"CWE-401"
] | FreeRDP | 9fee4ae076b1ec97b97efb79ece08d1dab4df29a | 260,539,469,715,999,500,000,000,000,000,000,000,000 | 6 | Fixed #5645: realloc return handling |
addr_policy_append_reject_addr_list(smartlist_t **dest,
const smartlist_t *addrs)
{
tor_assert(dest);
tor_assert(addrs);
SMARTLIST_FOREACH_BEGIN(addrs, tor_addr_t *, addr) {
addr_policy_append_reject_addr(dest, addr);
} SMARTLIST_FOREACH_END(addr);
} | 0 | [] | tor | 1afc2ed956a35b40dfd1d207652af5b50c295da7 | 305,359,905,121,193,420,000,000,000,000,000,000,000 | 10 | Fix policies.c instance of the "if (r=(a-b)) return r" pattern
I think this one probably can't underflow, since the input ranges
are small. But let's not tempt fate.
This patch also replaces the "cmp" functions here with just "eq"
functions, since nothing actually checked for anything besides 0 and
nonzero.
Related... |
void traf_del(GF_Box *s)
{
GF_TrackFragmentBox *ptr = (GF_TrackFragmentBox *)s;
if (ptr == NULL) return;
if (ptr->tfhd) gf_isom_box_del((GF_Box *) ptr->tfhd);
if (ptr->sdtp) gf_isom_box_del((GF_Box *) ptr->sdtp);
if (ptr->sub_samples) gf_isom_box_array_del(ptr->sub_samples);
if (ptr->tfdt) gf_isom_box_del((GF_Box... | 0 | [
"CWE-400",
"CWE-401"
] | gpac | d2371b4b204f0a3c0af51ad4e9b491144dd1225c | 152,462,485,587,299,850,000,000,000,000,000,000,000 | 16 | prevent dref memleak on invalid input (#1183) |
static void mark_request_serialising(BdrvTrackedRequest *req, uint64_t align)
{
int64_t overlap_offset = req->offset & ~(align - 1);
unsigned int overlap_bytes = ROUND_UP(req->offset + req->bytes, align)
- overlap_offset;
if (!req->serialising) {
req->bs->serialising_... | 0 | [
"CWE-190"
] | qemu | 8f4754ede56e3f9ea3fd7207f4a7c4453e59285b | 28,628,783,694,039,820,000,000,000,000,000,000,000 | 14 | block: Limit request size (CVE-2014-0143)
Limiting the size of a single request to INT_MAX not only fixes a
direct integer overflow in bdrv_check_request() (which would only
trigger bad behaviour with ridiculously huge images, as in close to
2^64 bytes), but can also prevent overflows in all block drivers.
Signed-off... |
static void tcp_undo_cwr(struct sock *sk, const bool undo_ssthresh)
{
struct tcp_sock *tp = tcp_sk(sk);
if (tp->prior_ssthresh) {
const struct inet_connection_sock *icsk = inet_csk(sk);
if (icsk->icsk_ca_ops->undo_cwnd)
tp->snd_cwnd = icsk->icsk_ca_ops->undo_cwnd(sk);
else
tp->snd_cwnd = max(tp->snd_cwn... | 0 | [] | net-next | fdf5af0daf8019cec2396cdef8fb042d80fe71fa | 99,721,249,527,401,010,000,000,000,000,000,000,000 | 21 | tcp: drop SYN+FIN messages
Denys Fedoryshchenko reported that SYN+FIN attacks were bringing his
linux machines to their limits.
Dont call conn_request() if the TCP flags includes SYN flag
Reported-by: Denys Fedoryshchenko <denys@visp.net.lb>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S... |
__must_hold(RCU)
{
struct hlist_nulls_node *n;
struct io_worker *worker;
n = rcu_dereference(hlist_nulls_first_rcu(&wqe->free_list));
if (is_a_nulls(n))
return false;
worker = hlist_nulls_entry(n, struct io_worker, nulls_node);
if (io_worker_get(worker)) {
wake_up(&worker->wait);
io_worker_release(worker... | 0 | [] | linux | 181e448d8709e517c9c7b523fcd209f24eb38ca7 | 170,557,807,520,095,060,000,000,000,000,000,000,000 | 18 | io_uring: async workers should inherit the user creds
If we don't inherit the original task creds, then we can confuse users
like fuse that pass creds in the request header. See link below on
identical aio issue.
Link: https://lore.kernel.org/linux-fsdevel/26f0d78e-99ca-2f1b-78b9-433088053a61@scylladb.com/T/#u
Signed... |
static void test_prepare_multi_statements()
{
MYSQL *mysql_local;
MYSQL_STMT *stmt;
char query[MAX_TEST_QUERY_LENGTH];
myheader("test_prepare_multi_statements");
if (!(mysql_local= mysql_client_init(NULL)))
{
fprintf(stderr, "\n mysql_client_init() failed");
exit(1);
}
if (!(mysql_real_connect... | 0 | [
"CWE-416"
] | mysql-server | 4797ea0b772d5f4c5889bc552424132806f46e93 | 80,994,427,869,101,880,000,000,000,000,000,000,000 | 26 | BUG#17512527: LIST HANDLING INCORRECT IN MYSQL_PRUNE_STMT_LIST()
Analysis:
---------
Invalid memory access maybe observed when using prepared statements if:
a) The mysql client connection is lost after statement preparation
is complete and
b) There is at least one statement which is in initialized state but
not ... |
static int sctp_send_asconf(struct sctp_association *asoc,
struct sctp_chunk *chunk)
{
int retval = 0;
/* If there is an outstanding ASCONF chunk, queue it for later
* transmission.
*/
if (asoc->addip_last_asconf) {
list_add_tail(&chunk->list, &asoc->addip_chunk_list);
goto out;
}
/* Hold the chun... | 0 | [
"CWE-362"
] | linux | b166a20b07382b8bc1dcee2a448715c9c2c81b5b | 305,112,704,140,747,420,000,000,000,000,000,000,000 | 24 | net/sctp: fix race condition in sctp_destroy_sock
If sctp_destroy_sock is called without sock_net(sk)->sctp.addr_wq_lock
held and sp->do_auto_asconf is true, then an element is removed
from the auto_asconf_splist without any proper locking.
This can happen in the following functions:
1. In sctp_accept, if sctp_sock_m... |
static void php_zlib_output_handler_context_dtor(void *opaq TSRMLS_DC)
{
php_zlib_context *ctx = (php_zlib_context *) opaq;
if (ctx) {
if (ctx->buffer.data) {
efree(ctx->buffer.data);
}
efree(ctx);
}
} | 0 | [
"CWE-20"
] | php-src | 52b93f0cfd3cba7ff98cc5198df6ca4f23865f80 | 63,207,431,282,248,380,000,000,000,000,000,000,000 | 11 | Fixed bug #69353 (Missing null byte checks for paths in various PHP extensions) |
static int vidioc_enum_input(struct file *file, void *priv,
struct v4l2_input *vi)
{
struct usb_usbvision *usbvision = video_drvdata(file);
int chan;
if (vi->index >= usbvision->video_inputs)
return -EINVAL;
if (usbvision->have_tuner)
chan = vi->index;
else
chan = vi->index + 1; /* skip Television strin... | 0 | [
"CWE-17"
] | media_tree | fa52bd506f274b7619955917abfde355e3d19ffe | 104,023,654,739,768,400,000,000,000,000,000,000,000 | 50 | [media] usbvision: fix crash on detecting device with invalid configuration
The usbvision driver crashes when a specially crafted usb device with invalid
number of interfaces or endpoints is detected. This fix adds checks that the
device has proper configuration expected by the driver.
Reported-by: Ralf Spenneberg <r... |
int handler::ha_rnd_init_with_error(bool scan)
{
int error;
if (likely(!(error= ha_rnd_init(scan))))
return 0;
table->file->print_error(error, MYF(0));
return error;
} | 0 | [
"CWE-416"
] | server | af810407f78b7f792a9bb8c47c8c532eb3b3a758 | 71,124,880,515,199,090,000,000,000,000,000,000,000 | 8 | MDEV-28098 incorrect key in "dup value" error after long unique
reset errkey after using it, so that it wouldn't affect
the next error message in the next statement |
int llhttp__internal__c_test_flags_2(
llhttp__internal_t* state,
const unsigned char* p,
const unsigned char* endp) {
return (state->flags & 32) == 32;
} | 0 | [
"CWE-444"
] | node | af488f8dc82d69847992ea1cd2f53dc8082b3b91 | 227,443,527,715,860,140,000,000,000,000,000,000,000 | 6 | deps: update llhttp to 6.0.4
Refs: https://hackerone.com/reports/1238099
Refs: https://hackerone.com/reports/1238709
Refs: https://github.com/nodejs-private/llhttp-private/pull/6
Refs: https://github.com/nodejs-private/llhttp-private/pull/5
CVE-ID: CVE-2021-22959
CVE-ID: CVE-2021-22960
PR-URL: https://github.com/node... |
uint WavInFile::getNumChannels() const
{
return header.format.channel_number;
}
| 0 | [
"CWE-119"
] | soundtouch | 9e02d9b04fda6c1f44336ff00bb5af1e2ffc039e | 313,566,312,290,014,260,000,000,000,000,000,000,000 | 4 | Added minimum size check for WAV header block lengh values |
//! Convert Ascii character to lower case.
inline char lowercase(const char x) {
return (char)((x<'A'||x>'Z')?x:x - 'A' + 'a'); | 0 | [
"CWE-119",
"CWE-787"
] | CImg | ac8003393569aba51048c9d67e1491559877b1d1 | 278,816,815,121,494,580,000,000,000,000,000,000,000 | 3 | . |
_gettemp (char *path,
int *doopen,
int domkdir,
int slen)
{
static const char padchar[] =
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
static const int maxpathlen = 1024;
char *start, *trv, *suffp, *carryp;
char *pad;
struct stat sbuf;
int rval;
int rnd;
cha... | 0 | [
"CWE-190"
] | p11-kit | bd670b1d4984b27d6a397b9ddafaf89ab26e4e7f | 244,027,618,773,830,630,000,000,000,000,000,000,000 | 111 | Follow-up to arithmetic overflow fix
Check if nmemb is zero in p11_rpc_message_alloc_extra_array to avoid a
division by zero trap. Additionally, change the reallocarray
compatibility shim so that it won't assert when resizing an array to
zero, and add the same nmemb != 0 check there. |
onig_node_new_enclosure(int type)
{
return node_new_enclosure(type);
} | 0 | [
"CWE-787"
] | oniguruma | ddbf55698b5f7ffdfa737b0b8e0079af1fdd7cb1 | 51,929,108,824,052,100,000,000,000,000,000,000,000 | 4 | re-fix #60 by check val_type |
bool OAuth2CookieValidator::hmacIsValid() const {
auto& crypto_util = Envoy::Common::Crypto::UtilitySingleton::get();
const auto hmac_payload = absl::StrCat(host_, expires_, token_, id_token_, refresh_token_);
const auto pre_encoded_hmac = Hex::encode(crypto_util.getSha256Hmac(secret_, hmac_payload));
std::stri... | 0 | [
"CWE-416"
] | envoy | 7ffda4e809dec74449ebc330cebb9d2f4ab61360 | 200,933,054,361,068,520,000,000,000,000,000,000,000 | 9 | oauth2: do not blindly accept requests with a token in the Authorization headera (781)
The logic was broken because it assumed an additional call would be
performed to the auth server, which isn't the case. Per the filter
documentation, a request is only considered subsequently authenticated
if there's valid cookie th... |
struct address_space *hugetlb_page_mapping_lock_write(struct page *hpage)
{
struct address_space *mapping = page_mapping(hpage);
if (!mapping)
return mapping;
if (i_mmap_trylock_write(mapping))
return mapping;
return NULL;
} | 0 | [] | linux | a4a118f2eead1d6c49e00765de89878288d4b890 | 284,718,832,807,138,930,000,000,000,000,000,000,000 | 12 | hugetlbfs: flush TLBs correctly after huge_pmd_unshare
When __unmap_hugepage_range() calls to huge_pmd_unshare() succeed, a TLB
flush is missing. This TLB flush must be performed before releasing the
i_mmap_rwsem, in order to prevent an unshared PMDs page from being
released and reused before the TLB flush took place... |
static void gdImageVLine(gdImagePtr im, int x, int y1, int y2, int col)
{
if (im->thick > 1) {
int thickhalf = im->thick >> 1;
gdImageFilledRectangle(im, x - thickhalf, y1, x + im->thick - thickhalf - 1, y2, col);
} else {
if (y2 < y1) {
int t = y1;
y1 = y2;
y2 = t;
}
for (; y1 <= y2; y1++) {
g... | 0 | [
"CWE-119",
"CWE-787"
] | libgd | 77f619d48259383628c3ec4654b1ad578e9eb40e | 127,401,559,523,413,830,000,000,000,000,000,000,000 | 18 | fix #215 gdImageFillToBorder stack-overflow when invalid color is used |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.