func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
my_os_charset_to_mysql_charset(const char *csname)
{
const MY_CSET_OS_NAME *csp;
for (csp= charsets; csp->os_name; csp++)
{
if (!my_strcasecmp(&my_charset_latin1, csp->os_name, csname))
{
switch (csp->param)
{
case my_cs_exact:
return csp->my_name;
case my_cs_approx:
... | 0 | [
"CWE-254"
] | server | f0d774d48416bb06063184380b684380ca005a41 | 228,928,027,179,510,200,000,000,000,000,000,000,000 | 40 | MDEV-9212 ssl-validate-cert incorrect hostname check
Reimplement ssl_verify_server_cert() using the logic
from https://wiki.openssl.org/index.php/Hostname_validation
The bug was discovered by Alex Gaynor. |
cmd_serialno (assuan_context_t ctx, char *line)
{
ctrl_t ctrl = assuan_get_pointer (ctx);
int rc = 0;
char *serial;
time_t stamp;
int retries = 0;
/* Clear the remove flag so that the open_card is able to reread it. */
retry:
if (ctrl->server_local->card_removed)
{
if ( IS_LOCKED (ctrl) )
... | 0 | [] | gnupg | b0b3803e8c2959dd67ca96debc54b5c6464f0d41 | 210,569,582,917,172,300,000,000,000,000,000,000,000 | 34 | scd: Avoid double-free on error condition in scd
* scd/command.c (cmd_readkey): avoid double-free of cert
--
When ksba_cert_new() fails, cert will be double-freed.
Debian-Bug-Id: 773471
Original patch changed by wk to do the free only at leave. |
*/
static void php_wddx_push_element(void *user_data, const XML_Char *name, const XML_Char **atts)
{
st_entry ent;
wddx_stack *stack = (wddx_stack *)user_data;
if (!strcmp(name, EL_PACKET)) {
int i;
if (atts) for (i=0; atts[i]; i++) {
if (!strcmp(atts[i], EL_VERSION)) {
/* nothing for now */
}
}
... | 0 | [] | php-src | 1785d2b805f64eaaacf98c14c9e13107bf085ab1 | 247,872,664,725,074,100,000,000,000,000,000,000,000 | 174 | Fixed bug #70741: Session WDDX Packet Deserialization Type Confusion Vulnerability |
byte* FileIo::mmap(bool isWriteable)
{
assert(p_->fp_ != 0);
if (munmap() != 0) {
#ifdef EXV_UNICODE_PATH
if (p_->wpMode_ == Impl::wpUnicode) {
throw WError(kerCallFailed, wpath(), strError().c_str(), "munmap");
}
else
#endif
{
... | 0 | [
"CWE-190"
] | exiv2 | c73d1e27198a389ce7caf52ac30f8e2120acdafd | 90,728,079,826,490,160,000,000,000,000,000,000,000 | 139 | Avoid negative integer overflow when `filesize < io_->tell()`.
This fixes #791. |
uid_t session_info_uid_for_session(struct session_info *info, const char *session)
{
DBusError error;
DBusMessage *message = NULL;
DBusMessage *reply = NULL;
uint32_t uid;
uid_t ret = -1;
const char *err_msg;
g_return_val_if_fail(info != NULL, ret);
g_return_val_if_fail(info->connection... | 0 | [
"CWE-362"
] | spice-vd_agent | 5c50131797e985d0a5654c1fd7000ae945ed29a7 | 113,139,351,020,181,480,000,000,000,000,000,000,000 | 66 | Better check for sessions
Do not allow other users to hijack a session checking that
the process is launched by the owner of the session.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <uril@redhat.com> |
make_snapshot_rec(frame_T *fr, frame_T **frp)
{
*frp = ALLOC_CLEAR_ONE(frame_T);
if (*frp == NULL)
return;
(*frp)->fr_layout = fr->fr_layout;
(*frp)->fr_width = fr->fr_width;
(*frp)->fr_height = fr->fr_height;
if (fr->fr_next != NULL)
make_snapshot_rec(fr->fr_next, &((*frp)->fr_next));
if ... | 0 | [
"CWE-416"
] | vim | ec66c41d84e574baf8009dbc0bd088d2bc5b2421 | 100,064,979,744,804,270,000,000,000,000,000,000,000 | 15 | patch 8.1.2136: using freed memory with autocmd from fuzzer
Problem: using freed memory with autocmd from fuzzer. (Dhiraj Mishra,
Dominique Pelle)
Solution: Avoid using "wp" after autocommands. (closes #5041) |
rdp_disconnect(void)
{
logger(Protocol, Debug, "%s()", __func__);
sec_disconnect();
} | 0 | [
"CWE-119",
"CWE-125",
"CWE-703",
"CWE-787"
] | rdesktop | 4dca546d04321a610c1835010b5dad85163b65e1 | 54,665,480,228,459,110,000,000,000,000,000,000,000 | 5 | Malicious RDP server security fixes
This commit includes fixes for a set of 21 vulnerabilities in
rdesktop when a malicious RDP server is used.
All vulnerabilities was identified and reported by Eyal Itkin.
* Add rdp_protocol_error function that is used in several fixes
* Refactor of process_bitmap_updates
* Fix ... |
int ha_maria::index_end()
{
active_index=MAX_KEY;
ma_set_index_cond_func(file, NULL, 0);
in_range_check_pushed_down= FALSE;
ds_mrr.dsmrr_close();
return 0;
} | 0 | [
"CWE-400"
] | server | 9e39d0ae44595dbd1570805d97c9c874778a6be8 | 145,602,969,605,283,500,000,000,000,000,000,000,000 | 8 | MDEV-25787 Bug report: crash on SELECT DISTINCT thousands_blob_fields
fix a debug assert to account for not opened temp tables |
ZEND_API int ZEND_FASTCALL zend_binary_strcasecmp(const char *s1, size_t len1, const char *s2, size_t len2) /* {{{ */
{
size_t len;
int c1, c2;
if (s1 == s2) {
return 0;
}
len = MIN(len1, len2);
while (len--) {
c1 = zend_tolower_ascii(*(unsigned char *)s1++);
c2 = zend_tolower_ascii(*(unsigned char *)s2++... | 0 | [
"CWE-787"
] | php-src | f1ce8d5f5839cb2069ea37ff424fb96b8cd6932d | 39,767,109,805,482,197,000,000,000,000,000,000,000 | 20 | Fix #73122: Integer Overflow when concatenating strings
We must avoid integer overflows in memory allocations, so we introduce
an additional check in the VM, and bail out in the rare case of an
overflow. Since the recent fix for bug #74960 still doesn't catch all
possible overflows, we fix that right away. |
static inline int tg_has_rt_tasks(struct task_group *tg)
{
struct task_struct *g, *p;
do_each_thread(g, p) {
if (rt_task(p) && task_rq(p)->rt.tg == tg)
return 1;
} while_each_thread(g, p);
return 0;
} | 0 | [
"CWE-200"
] | linux | 4efbc454ba68def5ef285b26ebfcfdb605b52755 | 54,668,051,785,017,550,000,000,000,000,000,000,000 | 11 | sched: Fix information leak in sys_sched_getattr()
We're copying the on-stack structure to userspace, but forgot to give
the right number of bytes to copy. This allows the calling process to
obtain up to PAGE_SIZE bytes from the stack (and possibly adjacent
kernel memory).
This fix copies only as much as we actually ... |
static void vmx_set_msr_bitmap(struct kvm_vcpu *vcpu)
{
unsigned long *msr_bitmap;
if (is_guest_mode(vcpu))
msr_bitmap = vmx_msr_bitmap_nested;
else if (cpu_has_secondary_exec_ctrls() &&
(vmcs_read32(SECONDARY_VM_EXEC_CONTROL) &
SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE)) {
if (is_long_mode(vcpu))
msr_bit... | 0 | [
"CWE-284",
"CWE-264"
] | linux | 3ce424e45411cf5a13105e0386b6ecf6eeb4f66f | 252,218,524,384,993,750,000,000,000,000,000,000,000 | 22 | kvm:vmx: more complete state update on APICv on/off
The function to update APICv on/off state (in particular, to deactivate
it when enabling Hyper-V SynIC) is incomplete: it doesn't adjust
APICv-related fields among secondary processor-based VM-execution
controls. As a result, Windows 2012 guests get stuck when SynIC... |
ushort CLASS sget2Rev(uchar *s) // specific to some Canon Makernotes fields, where they have endian in reverse
{
if (order == 0x4d4d) /* "II" means little-endian, and we reverse to "MM" - big endian */
return s[0] | s[1] << 8;
else /* "MM" means big-endian... */
return s[0] << 8 | s[1];
} | 0 | [
"CWE-476",
"CWE-119"
] | LibRaw | d7c3d2cb460be10a3ea7b32e9443a83c243b2251 | 191,281,443,874,139,820,000,000,000,000,000,000,000 | 7 | Secunia SA75000 advisory: several buffer overruns |
static void rgb_prepare_row24(VncState *vs, uint8_t *dst, int x, int y,
int count)
{
VncDisplay *vd = vs->vd;
uint32_t *fbptr;
uint32_t pix;
fbptr = vnc_server_fb_ptr(vd, x, y);
while (count--) {
pix = *fbptr++;
*dst++ = (uint8_t)(pix >> vs->ds->surfac... | 0 | [
"CWE-125"
] | qemu | 9f64916da20eea67121d544698676295bbb105a7 | 130,109,387,047,108,910,000,000,000,000,000,000,000 | 16 | pixman/vnc: use pixman images in vnc.
The vnc code uses *three* DisplaySurfaces:
First is the surface of the actual QemuConsole, usually the guest
screen, but could also be a text console (monitor/serial reachable via
Ctrl-Alt-<nr> keys). This is left as-is.
Second is the current server's view of the screen content... |
static errcode_t get_next_block(ext2_filsys fs, struct out_dir *outdir,
char ** ret)
{
errcode_t retval;
if (outdir->num >= outdir->max) {
retval = alloc_size_dir(fs, outdir, outdir->max + 50);
if (retval)
return retval;
}
*ret = outdir->buf + (outdir->num++ * fs->blocksize);
memset(*ret, 0, fs->blocks... | 0 | [
"CWE-787"
] | e2fsprogs | 8dd73c149f418238f19791f9d666089ef9734dff | 171,611,435,987,886,700,000,000,000,000,000,000,000 | 14 | e2fsck: abort if there is a corrupted directory block when rehashing
In e2fsck pass 3a, when we are rehashing directories, at least in
theory, all of the directories should have had corruptions with
respect to directory entry structure fixed. However, it's possible
(for example, if the user declined a fix) that we ca... |
const CImg<T>& _save_png(std::FILE *const file, const char *const filename,
const unsigned int bytes_per_pixel=0) const {
if (!file && !filename)
throw CImgArgumentException(_cimg_instance
"save_png(): Specified filename is (null).",
... | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 199,432,166,078,189,300,000,000,000,000,000,000,000 | 199 | Fix other issues in 'CImg<T>::load_bmp()'. |
yaml_parser_stale_simple_keys(yaml_parser_t *parser)
{
yaml_simple_key_t *simple_key;
/* Check for a potential simple key for each flow level. */
for (simple_key = parser->simple_keys.start;
simple_key != parser->simple_keys.top; simple_key ++)
{
/*
* The specification req... | 0 | [
"CWE-20"
] | libyaml | e6aa721cc0e5a48f408c52355559fd36780ba32a | 35,922,255,785,790,300,000,000,000,000,000,000,000 | 34 | Fix for https://bitbucket.org/xi/libyaml/issue/10/
https://bitbucket.org/xi/libyaml/issue/10/wrapped-strings-cause-assert-failure
Commenting out the assert makes the scanner do the right thing and
results in just a simple parse failure. |
test_max_startups_conf (Test *test,
gconstpointer data)
{
const StartupFixture *fix = data;
g_assert_cmpuint (fix->max_startups_begin, ==, test->auth->max_startups_begin);
g_assert_cmpuint (fix->max_startups, ==, test->auth->max_startups);
g_assert_cmpuint (fix->max_startups_rate, ==, ... | 0 | [] | cockpit | c51f6177576d7e12614c64d316cf0b67addd17c9 | 9,960,861,199,791,233,000,000,000,000,000,000,000 | 8 | ws: Fix bug parsing invalid base64 headers
The len parameter to g_base64_decode_inplace() is a inout
parameter, and needs to be initialized. Lets just use
the simpler g_base64_decode() function. This fixes a segfault.
Closes #10819 |
static ssize_t vfio_pci_read(void *device_data, char __user *buf,
size_t count, loff_t *ppos)
{
if (!count)
return 0;
return vfio_pci_rw(device_data, buf, count, ppos, false);
} | 0 | [
"CWE-399",
"CWE-190"
] | linux | 05692d7005a364add85c6e25a6c4447ce08f913a | 10,908,548,836,687,858,000,000,000,000,000,000,000 | 8 | vfio/pci: Fix integer overflows, bitmask check
The VFIO_DEVICE_SET_IRQS ioctl did not sufficiently sanitize
user-supplied integers, potentially allowing memory corruption. This
patch adds appropriate integer overflow checks, checks the range bounds
for VFIO_IRQ_SET_DATA_NONE, and also verifies that only single element... |
void get_variable_pos(const char *variable_name, unsigned int &pos, unsigned int &rpos) {
char c1, c2, c3, c4;
pos = rpos = ~0U;
if (!variable_name || !*variable_name) return;
unsigned int rp = variable_name[1]?~0U:*variable_name; // One-char variable
if (variable_name[1] ... | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 19,966,007,611,434,514,000,000,000,000,000,000,000 | 53 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
_sv_to_datum_finfo(Oid typid, FmgrInfo *finfo, Oid *typioparam)
{
Oid typinput;
/* XXX would be better to cache these lookups */
getTypeInputInfo(typid,
&typinput, typioparam);
fmgr_info(typinput, finfo);
} | 0 | [
"CWE-264"
] | postgres | 537cbd35c893e67a63c59bc636c3e888bd228bc7 | 263,598,050,760,286,770,000,000,000,000,000,000,000 | 9 | Prevent privilege escalation in explicit calls to PL validators.
The primary role of PL validators is to be called implicitly during
CREATE FUNCTION, but they are also normal functions that a user can call
explicitly. Add a permissions check to each validator to ensure that a
user cannot use explicit validator calls ... |
xsltNewStylePreComp(xsltStylesheetPtr style, xsltStyleType type) {
xsltStylePreCompPtr cur;
#ifdef XSLT_REFACTORED
size_t size;
#endif
if (style == NULL)
return(NULL);
#ifdef XSLT_REFACTORED
/*
* URGENT TODO: Use specialized factory functions in order
* to avoid this ugliness.
*/... | 0 | [] | libxslt | 7ca19df892ca22d9314e95d59ce2abdeff46b617 | 138,922,717,387,264,420,000,000,000,000,000,000,000 | 148 | Fix for type confusion in preprocessing attributes
CVE-2015-7995 http://www.openwall.com/lists/oss-security/2015/10/27/10
We need to check that the parent node is an element before dereferencing
its namespace |
autoar_extractor_get_output_is_dest (AutoarExtractor *self)
{
g_return_val_if_fail (AUTOAR_IS_EXTRACTOR (self), FALSE);
return self->output_is_dest;
} | 0 | [
"CWE-22"
] | gnome-autoar | adb067e645732fdbe7103516e506d09eb6a54429 | 21,464,449,625,932,600,000,000,000,000,000,000,000 | 5 | AutoarExtractor: Do not extract files outside the destination dir
Currently, a malicious archive can cause that the files are extracted
outside of the destination dir. This can happen if the archive contains
a file whose parent is a symbolic link, which points outside of the
destination dir. This is potentially a secu... |
void uwsgi_set_cpu_affinity() {
char buf[4096];
int ret;
int pos = 0;
if (uwsgi.cpu_affinity) {
int base_cpu = (uwsgi.mywid - 1) * uwsgi.cpu_affinity;
if (base_cpu >= uwsgi.cpus) {
base_cpu = base_cpu % uwsgi.cpus;
}
ret = snprintf(buf, 4096, "mapping worker %d to CPUs:", uwsgi.mywid);
if (ret < 25 || ... | 0 | [
"CWE-119",
"CWE-703",
"CWE-787"
] | uwsgi | cb4636f7c0af2e97a4eef7a3cdcbd85a71247bfe | 240,157,902,421,751,400,000,000,000,000,000,000,000 | 49 | improve uwsgi_expand_path() to sanitize input, avoiding stack corruption and potential security issue |
DECODE_JSON(QualifiedName) {
ALLOW_NULL;
CHECK_OBJECT;
DecodeEntry entries[2] = {
{UA_JSONKEY_NAME, &dst->name, (decodeJsonSignature) String_decodeJson, false, NULL},
{UA_JSONKEY_URI, &dst->namespaceIndex, (decodeJsonSignature) UInt16_decodeJson, false, NULL}
};
return decodeFields... | 0 | [
"CWE-703",
"CWE-787"
] | open62541 | c800e2987b10bb3af6ef644b515b5d6392f8861d | 252,152,540,774,279,900,000,000,000,000,000,000,000 | 11 | fix(json): Check max recursion depth in more places |
static int putglyph(VTermGlyphInfo *info, VTermPos pos, void *user)
{
int i;
int col;
VTermRect rect;
VTermScreen *screen = user;
ScreenCell *cell = getcell(screen, pos.row, pos.col);
if(!cell)
return 0;
for(i = 0; i < VTERM_MAX_CHARS_PER_CELL && info->chars[i]; i++) {
cell->chars[i] = info->ch... | 0 | [
"CWE-476"
] | vim | cd929f7ba8cc5b6d6dcf35c8b34124e969fed6b8 | 137,680,326,680,123,030,000,000,000,000,000,000,000 | 35 | patch 8.1.0633: crash when out of memory while opening a terminal window
Problem: Crash when out of memory while opening a terminal window.
Solution: Handle out-of-memory more gracefully. |
estack_pop(void)
{
if (exestack.ga_len == 0)
return NULL;
--exestack.ga_len;
return ((estack_T *)exestack.ga_data) + exestack.ga_len;
} | 0 | [
"CWE-122"
] | vim | 2bdad6126778f907c0b98002bfebf0e611a3f5db | 230,972,796,972,721,020,000,000,000,000,000,000,000 | 7 | patch 8.2.4647: "source" can read past end of copied line
Problem: "source" can read past end of copied line.
Solution: Add a terminating NUL. |
void __noreturn __module_put_and_exit(struct module *mod, long code)
{
module_put(mod);
do_exit(code);
} | 0 | [
"CWE-362",
"CWE-347"
] | linux | 0c18f29aae7ce3dadd26d8ee3505d07cc982df75 | 256,768,668,451,866,060,000,000,000,000,000,000,000 | 5 | module: limit enabling module.sig_enforce
Irrespective as to whether CONFIG_MODULE_SIG is configured, specifying
"module.sig_enforce=1" on the boot command line sets "sig_enforce".
Only allow "sig_enforce" to be set when CONFIG_MODULE_SIG is configured.
This patch makes the presence of /sys/module/module/parameters/s... |
static void MapCLAHEHistogram(const RangeInfo *range_info,
const size_t number_bins,const size_t number_pixels,size_t *histogram)
{
double
scale,
sum;
register ssize_t
i;
/*
Rescale histogram to range [min-intensity .. max-intensity].
*/
scale=(double) (range_info->max-range_info->min)/num... | 0 | [
"CWE-399",
"CWE-119",
"CWE-787"
] | ImageMagick | d4fc44b58a14f76b1ac997517d742ee12c9dc5d3 | 67,681,572,048,830,530,000,000,000,000,000,000,000 | 23 | https://github.com/ImageMagick/ImageMagick/issues/1611 |
rsvg_filter_store_output (GString * name, RsvgFilterPrimitiveOutput result, RsvgFilterContext * ctx)
{
RsvgFilterPrimitiveOutput *store;
cairo_surface_destroy (ctx->lastresult.surface);
store = g_new (RsvgFilterPrimitiveOutput, 1);
*store = result;
if (name->str[0] != '\0') {
cairo_surfac... | 0 | [] | librsvg | a51919f7e1ca9c535390a746fbf6e28c8402dc61 | 142,651,094,034,950,900,000,000,000,000,000,000,000 | 17 | rsvg: Add rsvg_acquire_node()
This function does proper recursion checks when looking up resources
from URLs and thereby helps avoiding infinite loops when cyclic
references span multiple types of elements. |
int dn_destroy_timer(struct sock *sk)
{
struct dn_scp *scp = DN_SK(sk);
scp->persist = dn_nsp_persist(sk);
switch (scp->state) {
case DN_DI:
dn_nsp_send_disc(sk, NSP_DISCINIT, 0, GFP_ATOMIC);
if (scp->nsp_rxtshift >= decnet_di_count)
scp->state = DN_CN;
return 0;
case DN_DR:
dn_nsp_send_disc(sk, NSP_... | 0 | [] | net | 79462ad02e861803b3840cc782248c7359451cd9 | 52,501,728,451,114,870,000,000,000,000,000,000,000 | 41 | net: add validation for the socket syscall protocol argument
郭永刚 reported that one could simply crash the kernel as root by
using a simple program:
int socket_fd;
struct sockaddr_in addr;
addr.sin_port = 0;
addr.sin_addr.s_addr = INADDR_ANY;
addr.sin_family = 10;
socket_fd = socket(10,3,0x40000000);
connect(s... |
best_effort_strncat_from_utf16be(struct archive_string *as, const void *_p,
size_t bytes, struct archive_string_conv *sc)
{
return (best_effort_strncat_from_utf16(as, _p, bytes, sc, 1));
} | 0 | [
"CWE-476"
] | libarchive | 42a3408ac7df1e69bea9ea12b72e14f59f7400c0 | 287,241,681,007,502,900,000,000,000,000,000,000,000 | 5 | archive_strncat_l(): allocate and do not convert if length == 0
This ensures e.g. that archive_mstring_copy_mbs_len_l() does not set
aes_set = AES_SET_MBS with aes_mbs.s == NULL.
Resolves possible null-pointer dereference reported by OSS-Fuzz.
Reported-By: OSS-Fuzz issue 286 |
*/
void
xmlXPathSumFunction(xmlXPathParserContextPtr ctxt, int nargs) {
xmlXPathObjectPtr cur;
int i;
double res = 0.0;
CHECK_ARITY(1);
if ((ctxt->value == NULL) ||
((ctxt->value->type != XPATH_NODESET) &&
(ctxt->value->type != XPATH_XSLT_TREE)))
XP_ERROR(XPATH_INVALID_TYPE);
cur = valuePo... | 0 | [
"CWE-119"
] | libxml2 | 91d19754d46acd4a639a8b9e31f50f31c78f8c9c | 7,243,825,512,972,264,000,000,000,000,000,000,000 | 20 | Fix the semantic of XPath axis for namespace/attribute context nodes
The processing of namespace and attributes nodes was not compliant
to the XPath-1.0 specification |
static OPJ_BOOL opj_j2k_read_ppm(
opj_j2k_t *p_j2k,
OPJ_BYTE * p_header_data,
OPJ_UINT32 p_header_size,
opj_event_mgr_t * p_manager)
{
opj_cp_t *l_cp = 00;
OPJ_UINT32 l_Z_ppm;
/* preconditions */
assert(p_header_data != 00);
assert(p_j2k != 00);
assert(p_manager != 00);
/* ... | 0 | [
"CWE-416",
"CWE-787"
] | openjpeg | 4241ae6fbbf1de9658764a80944dc8108f2b4154 | 95,132,376,161,614,800,000,000,000,000,000,000,000 | 71 | Fix assertion in debug mode / heap-based buffer overflow in opj_write_bytes_LE for Cinema profiles with numresolutions = 1 (#985) |
static ssize_t n_tty_chars_in_buffer(struct tty_struct *tty)
{
ssize_t n;
WARN_ONCE(1, "%s is deprecated and scheduled for removal.", __func__);
down_write(&tty->termios_rwsem);
n = chars_in_buffer(tty);
up_write(&tty->termios_rwsem);
return n;
} | 0 | [
"CWE-362"
] | tty | 4291086b1f081b869c6d79e5b7441633dc3ace00 | 20,837,734,176,751,945,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... |
int kvmppc_ld(struct kvm_vcpu *vcpu, ulong *eaddr, int size, void *ptr,
bool data)
{
ulong mp_pa = vcpu->arch.magic_page_pa & KVM_PAM & PAGE_MASK;
struct kvmppc_pte pte;
int rc;
vcpu->stat.ld++;
rc = kvmppc_xlate(vcpu, *eaddr, data ? XLATE_DATA : XLATE_INST,
XLATE_READ, &pte);
if (rc)
return rc;
... | 0 | [
"CWE-476"
] | linux | ac64115a66c18c01745bbd3c47a36b124e5fd8c0 | 249,758,635,478,752,760,000,000,000,000,000,000,000 | 37 | KVM: PPC: Fix oops when checking KVM_CAP_PPC_HTM
The following program causes a kernel oops:
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/kvm.h>
main()
{
int fd = open("/dev/kvm", O_RDWR);
ioctl(fd, KVM_CHECK_EXTENSION, KVM_CAP_PPC_HTM);
}
This happe... |
handle_chap(netdissect_options *ndo,
const u_char *p, int length)
{
u_int code, len;
int val_size, name_size, msg_size;
const u_char *p0;
int i;
p0 = p;
if (length < 1) {
ND_PRINT((ndo, "[|chap]"));
return;
} else if (length < 4) {
ND_TCHECK(*p);
ND_PRINT((ndo, "[|chap 0x%02x]", *p));
retu... | 0 | [
"CWE-119"
] | tcpdump | 0f95d441e4b5d7512cc5c326c8668a120e048eda | 308,875,897,814,762,880,000,000,000,000,000,000,000 | 77 | Do bounds checking when unescaping PPP.
Clean up a const issue while we're at it. |
yang_tpdf_free(struct ly_ctx *ctx, struct lys_tpdf *tpdf, uint16_t start, uint16_t size)
{
uint8_t i;
assert(ctx);
if (!tpdf) {
return;
}
for (i = start; i < size; ++i) {
lydict_remove(ctx, tpdf[i].name);
lydict_remove(ctx, tpdf[i].dsc);
lydict_remove(ctx, tpdf[i].r... | 0 | [
"CWE-415"
] | libyang | d9feacc4a590d35dbc1af21caf9080008b4450ed | 262,828,272,302,704,340,000,000,000,000,000,000,000 | 21 | yang parser BUGFIX double free
Fixes #742 |
static int reglevel (FuncState *fs, int nvar) {
while (nvar-- > 0) {
Vardesc *vd = getlocalvardesc(fs, nvar); /* get previous variable */
if (vd->vd.kind != RDKCTC) /* is in a register? */
return vd->vd.ridx + 1;
}
return 0; /* no variables in registers */
} | 0 | [
"CWE-125"
] | lua | 1f3c6f4534c6411313361697d98d1145a1f030fa | 150,423,628,922,089,540,000,000,000,000,000,000,000 | 8 | Bug: Lua can generate wrong code when _ENV is <const> |
SES_Wait(struct sess *sp, const struct transport *xp)
{
struct pool *pp;
struct waited *wp;
unsigned u;
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
CHECK_OBJ_NOTNULL(xp, TRANSPORT_MAGIC);
pp = sp->pool;
CHECK_OBJ_NOTNULL(pp, POOL_MAGIC);
assert(sp->fd > 0);
/*
* XXX: waiter_epoll prevents us from zeroing the struct ... | 0 | [
"CWE-617"
] | varnish-cache | 2d8fc1a784a1e26d78c30174923a2b14ee2ebf62 | 266,136,241,369,967,860,000,000,000,000,000,000,000 | 41 | Take sizeof pool_task into account when reserving WS in SES_Wait
The assert on WS_ReserveSize() in ses_handle() can not trip because
sizeof (struct pool_task) is less than sizeof (struct waited). But to safe
guard against future problems if that were to change, this patch makes
sure that the session workspace can hold... |
static inline unsigned int ablkcipher_done_fast(struct ablkcipher_walk *walk,
unsigned int n)
{
scatterwalk_advance(&walk->in, n);
scatterwalk_advance(&walk->out, n);
return n;
} | 0 | [
"CWE-310"
] | linux | 9a5467bf7b6e9e02ec9c3da4e23747c05faeaac6 | 311,451,210,401,452,300,000,000,000,000,000,000,000 | 8 | crypto: user - fix info leaks in report API
Three errors resulting in kernel memory disclosure:
1/ The structures used for the netlink based crypto algorithm report API
are located on the stack. As snprintf() does not fill the remainder of
the buffer with null bytes, those stack bytes will be disclosed to users
of th... |
static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino)
{
return ino == EXT4_ROOT_INO ||
(ino >= EXT4_FIRST_INO(sb) &&
ino <= le32_to_cpu(EXT4_SB(sb)->s_es->s_inodes_count)); | 0 | [
"CWE-787"
] | linux | c37e9e013469521d9adb932d17a1795c139b36db | 26,062,696,528,624,000,000,000,000,000,000,000,000 | 6 | ext4: add more inode number paranoia checks
If there is a directory entry pointing to a system inode (such as a
journal inode), complain and declare the file system to be corrupted.
Also, if the superblock's first inode number field is too small,
refuse to mount the file system.
This addresses CVE-2018-10882.
https... |
read_rle_pixel(tga_source_ptr sinfo)
/* Read one Targa pixel from the input file, expanding RLE data as needed */
{
register int i;
/* Duplicate previously read pixel? */
if (sinfo->dup_pixel_count > 0) {
sinfo->dup_pixel_count--;
return;
}
/* Time to read RLE block header? */
if (--sinfo->block_c... | 0 | [
"CWE-834"
] | libjpeg-turbo | 909a8cfc7bca9b2e6707425bdb74da997e8fa499 | 90,048,779,483,415,400,000,000,000,000,000,000,000 | 27 | Fix CVE-2018-11813
Refer to change log for details.
Fixes #242 |
const char *avcodec_configuration(void)
{
return FFMPEG_CONFIGURATION;
} | 0 | [
"CWE-703"
] | FFmpeg | e5c7229999182ad1cef13b9eca050dba7a5a08da | 77,655,047,492,071,890,000,000,000,000,000,000,000 | 4 | avcodec/utils: set AVFrame format unconditional
Fixes inconsistency and out of array accesses
Fixes: 10cdd7e63e7f66e3e66273939e0863dd-asan_heap-oob_1a4ff32_7078_cov_4056274555_mov_h264_aac__mp4box_frag.mp4
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> |
GF_Err rtpo_box_size(GF_Box *s)
{
s->size += 4;
return GF_OK;
} | 0 | [
"CWE-787"
] | gpac | 388ecce75d05e11fc8496aa4857b91245007d26e | 73,020,101,963,369,280,000,000,000,000,000,000,000 | 5 | fixed #1587 |
static int xfrm_exp_policy_notify(struct xfrm_policy *xp, int dir, const struct km_event *c)
{
struct net *net = xp_net(xp);
struct sk_buff *skb;
skb = nlmsg_new(xfrm_polexpire_msgsize(xp), GFP_ATOMIC);
if (skb == NULL)
return -ENOMEM;
if (build_polexpire(skb, xp, dir, c) < 0)
BUG();
return nlmsg_multicast... | 0 | [
"CWE-264"
] | net | 90f62cf30a78721641e08737bda787552428061e | 194,668,139,401,064,300,000,000,000,000,000,000,000 | 14 | 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.
... |
size_t mg_iobuf_del(struct mg_iobuf *io, size_t ofs, size_t len) {
if (ofs > io->len) ofs = io->len;
if (ofs + len > io->len) len = io->len - ofs;
memmove(io->buf + ofs, io->buf + ofs + len, io->len - ofs - len);
zeromem(io->buf + io->len - len, len);
io->len -= len;
return len;
} | 0 | [
"CWE-552"
] | mongoose | c65c8fdaaa257e0487ab0aaae9e8f6b439335945 | 140,362,430,421,268,370,000,000,000,000,000,000,000 | 8 | Protect against the directory traversal in mg_upload() |
Track* Segment::AddTrack(int32_t number) {
Track* const track = new (std::nothrow) Track(&seed_); // NOLINT
if (!track)
return NULL;
if (!tracks_.AddTrack(track, number)) {
delete track;
return NULL;
}
return track;
} | 0 | [
"CWE-20"
] | libvpx | f00890eecdf8365ea125ac16769a83aa6b68792d | 35,092,532,815,585,405,000,000,000,000,000,000,000 | 13 | update libwebm to libwebm-1.0.0.27-352-g6ab9fcf
https://chromium.googlesource.com/webm/libwebm/+log/af81f26..6ab9fcf
Change-Id: I9d56e1fbaba9b96404b4fbabefddc1a85b79c25d |
CImg<Tfloat> get_blur_patch(const float sigma_s, const float sigma_r, const unsigned int patch_size=3,
const unsigned int lookup_size=4, const float smoothness=0,
const bool is_fast_approx=true) const {
return get_blur_patch(*this,sigma_s,sigma_r... | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 262,418,920,119,579,280,000,000,000,000,000,000,000 | 5 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
void session_set_send_data_notify(Session *session, SendDataNotify notify_func,
gpointer data)
{
session->send_data_notify = notify_func;
session->send_data_notify_data = data;
} | 0 | [] | claws | fcc25329049b6f9bd8d890f1197ed61eb12e14d5 | 93,652,474,860,836,960,000,000,000,000,000,000,000 | 6 | fix STARTTLS protocol violation
with thanks to, and patch by Damian Poddebniak and Hanno Böck |
static int handle_task_switch(struct kvm_vcpu *vcpu)
{
struct vcpu_vmx *vmx = to_vmx(vcpu);
unsigned long exit_qualification;
bool has_error_code = false;
u32 error_code = 0;
u16 tss_selector;
int reason, type, idt_v, idt_index;
idt_v = (vmx->idt_vectoring_info & VECTORING_INFO_VALID_MASK);
idt_index = (vmx->i... | 0 | [
"CWE-284"
] | linux | 727ba748e110b4de50d142edca9d6a9b7e6111d8 | 22,326,166,424,090,210,000,000,000,000,000,000,000 | 64 | kvm: nVMX: Enforce cpl=0 for VMX instructions
VMX instructions executed inside a L1 VM will always trigger a VM exit
even when executed with cpl 3. This means we must perform the
privilege check in software.
Fixes: 70f3aac964ae("kvm: nVMX: Remove superfluous VMX instruction fault checks")
Cc: stable@vger.kernel.org
S... |
static inline struct io_kiocb *io_req_find_next(struct io_kiocb *req)
{
struct io_kiocb *nxt;
/*
* If LINK is set, we have dependent requests in this chain. If we
* didn't fail this request, queue the first one up, moving any other
* dependencies to the next request. In case of failure, fail the rest
* of th... | 0 | [
"CWE-416"
] | linux | 9cae36a094e7e9d6e5fe8b6dcd4642138b3eb0c7 | 104,278,879,121,647,810,000,000,000,000,000,000,000 | 16 | io_uring: reinstate the inflight tracking
After some debugging, it was realized that we really do still need the
old inflight tracking for any file type that has io_uring_fops assigned.
If we don't, then trivial circular references will mean that we never get
the ctx cleaned up and hence it'll leak.
Just bring back t... |
g_tls_connection_base_close_internal (GIOStream *stream,
GTlsDirection direction,
gint64 timeout,
GCancellable *cancellable,
GError **error)
{
... | 0 | [
"CWE-295"
] | glib-networking | 29513946809590c4912550f6f8620468f9836d94 | 35,065,589,448,003,964,000,000,000,000,000,000,000 | 88 | Return bad identity error if identity is unset
When the server-identity property of GTlsClientConnection is unset, the
documentation sasy we need to fail the certificate verification with
G_TLS_CERTIFICATE_BAD_IDENTITY. This is important because otherwise,
it's easy for applications to fail to specify server identity.... |
static int rfcomm_sock_getsockopt_old(struct socket *sock, int optname, char __user *optval, int __user *optlen)
{
struct sock *sk = sock->sk;
struct sock *l2cap_sk;
struct l2cap_conn *conn;
struct rfcomm_conninfo cinfo;
int len, err = 0;
u32 opt;
BT_DBG("sk %p", sk);
if (get_user(len, optlen))
return -EFAU... | 0 | [
"CWE-476"
] | linux | 951b6a0717db97ce420547222647bcc40bf1eacd | 59,376,795,025,947,255,000,000,000,000,000,000,000 | 74 | Bluetooth: Fix potential NULL dereference in RFCOMM bind callback
addr can be NULL and it should not be dereferenced before NULL checking.
Signed-off-by: Jaganath Kanakkassery <jaganath.k@samsung.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org> |
output_buffer& operator<<(output_buffer& output, const ServerKeyExchange& sk)
{
output.write(sk.getKey(), sk.getKeyLength());
return output;
} | 0 | [] | mysql-server | b9768521bdeb1a8069c7b871f4536792b65fd79b | 136,182,398,398,580,760,000,000,000,000,000,000,000 | 5 | Updated yassl to yassl-2.3.8
(cherry picked from commit 7f9941eab55ed672bfcccd382dafbdbcfdc75aaa) |
TfLiteStatus ResizeAndTransposeWeights(TfLiteContext* context,
const TfLiteTensor* weights,
TfLiteTensor* transposed_weights) {
TfLiteIntArray* transposed_weights_shape_array = TfLiteIntArrayCreate(4);
const RuntimeShape& input_shape = Ge... | 0 | [
"CWE-369"
] | tensorflow | 801c1c6be5324219689c98e1bd3e0ca365ee834d | 322,272,648,503,409,000,000,000,000,000,000,000,000 | 49 | Fix another division by 0 in TFLite
PiperOrigin-RevId: 370800181
Change-Id: I924809166a6131f5075e6d45c455106538d755f9 |
static struct vm_area_struct *vma_to_resize(unsigned long addr,
unsigned long old_len, unsigned long new_len, unsigned long *p)
{
struct mm_struct *mm = current->mm;
struct vm_area_struct *vma = find_vma(mm, addr);
if (!vma || vma->vm_start > addr)
goto Efault;
if (is_vm_hugetlb_page(vma))
goto Einval;
/* ... | 1 | [
"CWE-703",
"CWE-189"
] | linux | 982134ba62618c2d69fbbbd166d0a11ee3b7e3d8 | 123,027,390,223,167,920,000,000,000,000,000,000,000 | 51 | mm: avoid wrapping vm_pgoff in mremap()
The normal mmap paths all avoid creating a mapping where the pgoff
inside the mapping could wrap around due to overflow. However, an
expanding mremap() can take such a non-wrapping mapping and make it
bigger and cause a wrapping condition.
Noticed by Robert Swiecki when runnin... |
static uint8_t LoRaMacCheckForBeaconAcquisition( void )
{
if( ( LoRaMacConfirmQueueIsCmdActive( MLME_BEACON_ACQUISITION ) == true ) &&
( MacCtx.MacFlags.Bits.McpsReq == 0 ) )
{
if( MacCtx.MacFlags.Bits.MlmeReq == 1 )
{
MacCtx.MacState &= ~LORAMAC_TX_RUNNING;
... | 0 | [
"CWE-120",
"CWE-787"
] | LoRaMac-node | e3063a91daa7ad8a687223efa63079f0c24568e4 | 182,957,115,402,545,730,000,000,000,000,000,000,000 | 13 | Added received buffer size checks. |
static int lock_pi_update_atomic(u32 __user *uaddr, u32 uval, u32 newval)
{
u32 uninitialized_var(curval);
if (unlikely(should_fail_futex(true)))
return -EFAULT;
if (unlikely(cmpxchg_futex_value_locked(&curval, uaddr, uval, newval)))
return -EFAULT;
/*If user space value changed, let the caller retry */
ret... | 0 | [
"CWE-416"
] | linux | 65d8fc777f6dcfee12785c057a6b57f679641c90 | 127,709,672,135,495,820,000,000,000,000,000,000,000 | 13 | futex: Remove requirement for lock_page() in get_futex_key()
When dealing with key handling for shared futexes, we can drastically reduce
the usage/need of the page lock. 1) For anonymous pages, the associated futex
object is the mm_struct which does not require the page lock. 2) For inode
based, keys, we can check un... |
ModuleExport size_t RegisterXCFImage(void)
{
MagickInfo
*entry;
entry=AcquireMagickInfo("XCF","XCF","GIMP image");
entry->decoder=(DecodeImageHandler *) ReadXCFImage;
entry->magick=(IsImageFormatHandler *) IsXCF;
entry->flags|=CoderSeekableStreamFlag;
(void) RegisterMagickInfo(entry);
return(MagickIm... | 0 | [
"CWE-125"
] | ImageMagick | a2e1064f288a353bc5fef7f79ccb7683759e775c | 98,301,723,252,313,790,000,000,000,000,000,000,000 | 12 | https://github.com/ImageMagick/ImageMagick/issues/104 |
term_buffer_source(j_decompress_ptr)
{
} | 0 | [
"CWE-787"
] | qpdf | d71f05ca07eb5c7cfa4d6d23e5c1f2a800f52e8e | 335,723,740,096,397,450,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 ... |
void Magick::Image::adaptiveSharpen(const double radius_,const double sigma_)
{
MagickCore::Image
*newImage;
GetPPException;
newImage=AdaptiveSharpenImage(constImage(),radius_,sigma_,exceptionInfo);
replaceImage(newImage);
ThrowImageException;
} | 0 | [
"CWE-416"
] | ImageMagick | 8c35502217c1879cb8257c617007282eee3fe1cc | 87,582,672,419,545,370,000,000,000,000,000,000,000 | 10 | Added missing return to avoid use after free. |
Binary::range_t Binary::va_ranges() const {
const auto it_min = std::min_element(
std::begin(segments_), std::end(segments_),
[] (const SegmentCommand* lhs, const SegmentCommand* rhs) {
if (lhs->virtual_address() == 0 || rhs->virtual_address() == 0) {
return true;
}
retur... | 0 | [
"CWE-703"
] | LIEF | 7acf0bc4224081d4f425fcc8b2e361b95291d878 | 336,146,210,687,659,760,000,000,000,000,000,000,000 | 18 | Resolve #764 |
process_ftp_ctl_v4(struct conntrack *ct,
struct dp_packet *pkt,
const struct conn *conn_for_expectation,
ovs_be32 *v4_addr_rep,
char **ftp_data_v4_start,
size_t *addr_offset_from_ftp_data_start,
size_t *add... | 0 | [
"CWE-400"
] | ovs | abd7a457652e6734902720fe6a5dddb3fc0d1e3b | 125,423,170,523,971,330,000,000,000,000,000,000,000 | 136 | flow: Support extra padding length.
Although not required, padding can be optionally added until
the packet length is MTU bytes. A packet with extra padding
currently fails sanity checks.
Vulnerability: CVE-2020-35498
Fixes: fa8d9001a624 ("miniflow_extract: Properly handle small IP packets.")
Reported-by: Joakim Hind... |
static void lan9118_16bit_mode_write(void *opaque, hwaddr offset,
uint64_t val, unsigned size)
{
switch (size) {
case 2:
lan9118_writew(opaque, offset, (uint32_t)val);
return;
case 4:
lan9118_writel(opaque, offset, val, size);
return;
... | 0 | [
"CWE-835"
] | qemu | 37cee01784ff0df13e5209517e1b3594a5e792d1 | 309,665,895,103,991,700,000,000,000,000,000,000,000 | 14 | lan9118: switch to use qemu_receive_packet() for loopback
This patch switches to use qemu_receive_packet() which can detect
reentrancy and return early.
This is intended to address CVE-2021-3416.
Cc: Prasad J Pandit <ppandit@redhat.com>
Cc: qemu-stable@nongnu.org
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.co... |
int apparmor_bprm_set_creds(struct linux_binprm *bprm)
{
struct aa_task_cxt *cxt;
struct aa_profile *profile, *new_profile = NULL;
struct aa_namespace *ns;
char *buffer = NULL;
unsigned int state;
struct file_perms perms = {};
struct path_cond cond = {
bprm->file->f_path.dentry->d_inode->i_uid,
bprm->file->f... | 0 | [
"CWE-264"
] | linux | 259e5e6c75a910f3b5e656151dc602f53f9d7548 | 174,526,324,131,325,250,000,000,000,000,000,000,000 | 179 | Add PR_{GET,SET}_NO_NEW_PRIVS to prevent execve from granting privs
With this change, calling
prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0)
disables privilege granting operations at execve-time. For example, a
process will not be able to execute a setuid binary to change their uid
or gid if this bit is set. The same is t... |
Status getUserDescription(OperationContext* opCtx,
const UserName& userName,
BSONObj* result) override {
return _getUserDocument(opCtx, userName, result);
} | 0 | [
"CWE-863"
] | mongo | a93cfd354467981c9cf944a4ada748d0226fdfb0 | 290,757,658,745,256,400,000,000,000,000,000,000,000 | 5 | SERVER-45472 Ensure RoleGraph can serialize authentication restrictions to BSON
(cherry picked from commit 521e56b407ac72bc69a97a24d1253f51a5b6e81b)
(cherry picked from commit a10d0a22d5d009d27664967181042933ec1bef36)
(cherry picked from commit fb87cc88ecb5d300f14cda7bc238d7d5132118f5) |
char *uwsgi_num2str(int num) {
char *str = uwsgi_malloc(11);
snprintf(str, 11, "%d", num);
return str;
} | 0 | [
"CWE-119",
"CWE-703",
"CWE-787"
] | uwsgi | cb4636f7c0af2e97a4eef7a3cdcbd85a71247bfe | 114,102,712,748,392,440,000,000,000,000,000,000,000 | 7 | improve uwsgi_expand_path() to sanitize input, avoiding stack corruption and potential security issue |
static int session_call_on_frame_send(nghttp2_session *session,
nghttp2_frame *frame) {
int rv;
if (session->callbacks.on_frame_send_callback) {
rv = session->callbacks.on_frame_send_callback(session, frame,
session->user_d... | 0 | [] | nghttp2 | 0a6ce87c22c69438ecbffe52a2859c3a32f1620f | 339,943,490,058,147,960,000,000,000,000,000,000,000 | 12 | Add nghttp2_option_set_max_outbound_ack |
static int conflict_name_icmp(const void *a, const void *b)
{
const git_index_name_entry *name_a = a;
const git_index_name_entry *name_b = b;
if (name_a->ancestor && !name_b->ancestor)
return 1;
if (!name_a->ancestor && name_b->ancestor)
return -1;
if (name_a->ancestor)
return strcasecmp(name_a->ancestor,... | 0 | [
"CWE-415",
"CWE-190"
] | libgit2 | 3db1af1f370295ad5355b8f64b865a2a357bcac0 | 193,833,823,177,359,900,000,000,000,000,000,000,000 | 19 | index: error out on unreasonable prefix-compressed path lengths
When computing the complete path length from the encoded
prefix-compressed path, we end up just allocating the complete path
without ever checking what the encoded path length actually is. This can
easily lead to a denial of service by just encoding an un... |
void Monitor::collect_metadata(Metadata *m)
{
collect_sys_info(m, g_ceph_context);
(*m)["addr"] = stringify(messenger->get_myaddr());
} | 0 | [
"CWE-287",
"CWE-284"
] | ceph | 5ead97120e07054d80623dada90a5cc764c28468 | 184,900,553,796,282,270,000,000,000,000,000,000,000 | 5 | auth/cephx: add authorizer challenge
Allow the accepting side of a connection to reject an initial authorizer
with a random challenge. The connecting side then has to respond with an
updated authorizer proving they are able to decrypt the service's challenge
and that the new authorizer was produced for this specific ... |
DefragInit(void)
{
intmax_t tracker_pool_size;
if (!ConfGetInt("defrag.trackers", &tracker_pool_size)) {
tracker_pool_size = DEFAULT_DEFRAG_HASH_SIZE;
}
/* Load the defrag-per-host lookup. */
DefragPolicyLoadFromConfig();
/* Allocate the DefragContext. */
defrag_context = DefragCon... | 0 | [
"CWE-358"
] | suricata | 4a04f814b15762eb446a5ead4d69d021512df6f8 | 215,324,962,272,693,600,000,000,000,000,000,000,000 | 21 | defrag - take protocol into account during re-assembly
The IP protocol was not being used to match fragments with
their packets allowing a carefully constructed packet
with a different protocol to be matched, allowing re-assembly
to complete, creating a packet that would not be re-assembled
by the destination host. |
static void l2cap_le_flowctl_init(struct l2cap_chan *chan)
{
chan->sdu = NULL;
chan->sdu_last_frag = NULL;
chan->sdu_len = 0;
chan->tx_credits = 0;
/* Derive MPS from connection MTU to stop HCI fragmentation */
chan->mps = min_t(u16, chan->imtu, chan->conn->mtu - L2CAP_HDR_SIZE);
/* Give enough credits for a ful... | 0 | [
"CWE-125"
] | linux | 7c9cbd0b5e38a1672fcd137894ace3b042dfbf69 | 313,567,473,363,825,320,000,000,000,000,000,000,000 | 13 | Bluetooth: Verify that l2cap_get_conf_opt provides large enough buffer
The function l2cap_get_conf_opt will return L2CAP_CONF_OPT_SIZE + opt->len
as length value. The opt->len however is in control over the remote user
and can be used by an attacker to gain access beyond the bounds of the
actual packet.
To prevent an... |
nfsd4_setattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
struct nfsd4_setattr *setattr)
{
__be32 status = nfs_ok;
int err;
if (setattr->sa_iattr.ia_valid & ATTR_SIZE) {
status = nfs4_preprocess_stateid_op(rqstp, cstate,
&cstate->current_fh, &setattr->sa_stateid,
WR_STATE, NULL, NU... | 0 | [
"CWE-20",
"CWE-129"
] | linux | b550a32e60a4941994b437a8d662432a486235a5 | 14,521,667,750,093,358,000,000,000,000,000,000,000 | 41 | nfsd: fix undefined behavior in nfsd4_layout_verify
UBSAN: Undefined behaviour in fs/nfsd/nfs4proc.c:1262:34
shift exponent 128 is too large for 32-bit type 'int'
Depending on compiler+architecture, this may cause the check for
layout_type to succeed for overly large values (which seems to be the
case with amd64)... |
static void *ddgenunicodedata(void *_gt,int32 *len) {
void *temp = genunicodedata(_gt,len);
GTextField *gt = _gt;
_GTextFieldReplace(gt,nullstr);
_ggadget_redraw(>->g);
return( temp );
} | 0 | [
"CWE-119",
"CWE-787"
] | fontforge | 626f751752875a0ddd74b9e217b6f4828713573c | 331,032,324,078,047,970,000,000,000,000,000,000,000 | 7 | Warn users before discarding their unsaved scripts (#3852)
* Warn users before discarding their unsaved scripts
This closes #3846. |
OFCondition DcmSCP::receiveDIMSEDataset(T_ASC_PresentationContextID *presID,
DcmDataset **dataObject)
{
if (m_assoc == NULL)
return DIMSE_ILLEGALASSOCIATION;
OFCondition cond;
/* call the corresponding DIMSE function to receive the dataset */
if (m_cfg->getProgressNo... | 0 | [
"CWE-264"
] | dcmtk | beaf5a5c24101daeeafa48c375120b16197c9e95 | 162,072,963,367,867,380,000,000,000,000,000,000,000 | 27 | Make sure to handle setuid() return code properly.
In some tools the return value of setuid() is not checked. In the worst
case this could lead to privilege escalation since the process does not
give up its root privileges and continue as root. |
readWholeFiles (const std::string & fn)
{
Array2D<unsigned int> uData;
Array2D<float> fData;
Array2D<half> hData;
MultiPartInputFile file(fn.c_str());
for (size_t i = 0; i < static_cast<size_t>(file.parts()); i++)
{
const Header& header = file.header(i);
assert (header.displayWi... | 0 | [
"CWE-125"
] | openexr | e79d2296496a50826a15c667bf92bdc5a05518b4 | 110,091,360,499,457,030,000,000,000,000,000,000,000 | 130 | fix memory leaks and invalid memory accesses
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz> |
void CLASS process_Sony_0x9050 (uchar * buf, unsigned id)
{
ushort lid;
if ((imgdata.lens.makernotes.CameraMount != LIBRAW_MOUNT_Sony_E) &&
(imgdata.lens.makernotes.CameraMount != LIBRAW_MOUNT_FixedLens))
{
if (buf[0])
imgdata.lens.makernotes.MaxAp4CurFocal =
my_roundf(powf64(2.0f... | 0 | [
"CWE-119",
"CWE-125",
"CWE-787"
] | LibRaw | d13e8f6d1e987b7491182040a188c16a395f1d21 | 137,643,210,467,717,900,000,000,000,000,000,000,000 | 107 | CVE-2017-1438 credits; fix for Kodak 65000 out of bounds access |
dirserv_have_any_serverdesc(smartlist_t *fps, int spool_src)
{
time_t publish_cutoff = time(NULL)-ROUTER_MAX_AGE_TO_PUBLISH;
SMARTLIST_FOREACH(fps, const char *, fp, {
switch (spool_src)
{
case DIR_SPOOL_EXTRA_BY_DIGEST:
if (extrainfo_get_by_descriptor_digest(fp)) return 1;
b... | 0 | [
"CWE-264"
] | tor | 00fffbc1a15e2696a89c721d0c94dc333ff419ef | 116,198,736,238,348,880,000,000,000,000,000,000,000 | 22 | Don't give the Guard flag to relays without the CVE-2011-2768 fix |
struct sk_buff *nfc_alloc_send_skb(struct nfc_dev *dev, struct sock *sk,
unsigned int flags, unsigned int size,
unsigned int *err)
{
struct sk_buff *skb;
unsigned int total_size;
total_size = size +
dev->tx_headroom + dev->tx_tailroom + NFC_HEADER_SIZE;
skb = sock_alloc_send_skb(sk, total_size, fl... | 0 | [] | linux | 3e3b5dfcd16a3e254aab61bd1e8c417dd4503102 | 245,614,775,810,978,640,000,000,000,000,000,000,000 | 16 | NFC: reorder the logic in nfc_{un,}register_device
There is a potential UAF between the unregistration routine and the NFC
netlink operations.
The race that cause that UAF can be shown as below:
(FREE) | (USE)
nfcmrvl_nci_unregister_dev | nfc_genl_dev_up
nci_close_device |
nci... |
void DefaultCertValidator::updateDigestForSessionId(bssl::ScopedEVP_MD_CTX& md,
uint8_t hash_buffer[EVP_MAX_MD_SIZE],
unsigned hash_length) {
int rc;
// Hash all the settings that affect whether the server will ... | 0 | [
"CWE-362",
"CWE-295"
] | envoy | e9f936d85dc1edc34fabd0a1725ec180f2316353 | 314,364,953,570,083,320,000,000,000,000,000,000,000 | 62 | CVE-2022-21654
tls allows re-use when some cert validation settings have changed
Signed-off-by: Yan Avlasov <yavlasov@google.com> |
static bool __splice_segment(struct page *page, unsigned int poff,
unsigned int plen, unsigned int *off,
unsigned int *len,
struct splice_pipe_desc *spd, bool linear,
struct sock *sk,
struct pipe_inode_info *pipe)
{
if (!*len)
return true;
/* skip this segment if already pro... | 0 | [
"CWE-416"
] | net | 36d5fe6a000790f56039afe26834265db0a3ad4c | 162,313,425,930,683,120,000,000,000,000,000,000,000 | 34 | core, nfqueue, openvswitch: Orphan frags in skb_zerocopy and handle errors
skb_zerocopy can copy elements of the frags array between skbs, but it doesn't
orphan them. Also, it doesn't handle errors, so this patch takes care of that
as well, and modify the callers accordingly. skb_tx_error() is also added to
the caller... |
static ssize_t bql_show_inflight(struct netdev_queue *queue,
char *buf)
{
struct dql *dql = &queue->dql;
return sprintf(buf, "%u\n", dql->num_queued - dql->num_completed); | 0 | [
"CWE-401"
] | linux | 895a5e96dbd6386c8e78e5b78e067dcc67b7f0ab | 140,943,161,218,134,630,000,000,000,000,000,000,000 | 7 | net-sysfs: Fix mem leak in netdev_register_kobject
syzkaller report this:
BUG: memory leak
unreferenced object 0xffff88837a71a500 (size 256):
comm "syz-executor.2", pid 9770, jiffies 4297825125 (age 17.843s)
hex dump (first 32 bytes):
00 00 00 00 ad 4e ad de ff ff ff ff 00 00 00 00 .....N..........
ff ff ... |
static void nf_tables_commit_chain_free_rules_old(struct nft_rule **rules)
{
struct nft_rule **r = rules;
struct nft_rules_old *old;
while (*r)
r++;
r++; /* rcu_head is after end marker */
old = (void *) r;
old->start = rules;
call_rcu(&old->h, __nf_tables_commit_chain_free_rules_old);
} | 0 | [
"CWE-665"
] | linux | ad9f151e560b016b6ad3280b48e42fa11e1a5440 | 99,555,665,360,103,900,000,000,000,000,000,000,000 | 14 | netfilter: nf_tables: initialize set before expression setup
nft_set_elem_expr_alloc() needs an initialized set if expression sets on
the NFT_EXPR_GC flag. Move set fields initialization before expression
setup.
[4512935.019450] ==================================================================
[4512935.019456] BUG: ... |
tty_cursor_pane(struct tty *tty, const struct tty_ctx *ctx, u_int cx, u_int cy)
{
tty_cursor(tty, ctx->xoff + cx - ctx->ox, ctx->yoff + cy - ctx->oy);
} | 0 | [] | src | b32e1d34e10a0da806823f57f02a4ae6e93d756e | 52,619,593,847,259,105,000,000,000,000,000,000,000 | 4 | evbuffer_new and bufferevent_new can both fail (when malloc fails) and
return NULL. GitHub issue 1547. |
GF_Err udta_AddBox(GF_Box *s, GF_Box *a)
{
GF_Err e;
u32 box_type;
GF_UserDataMap *map;
GF_UserDataBox *ptr = (GF_UserDataBox *)s;
if (!ptr) return GF_BAD_PARAM;
if (!a) return GF_OK;
/* for unknown udta boxes, we reference them by their original box type */
box_type = a->type;
if (box_type == GF_ISOM_BOX_TY... | 0 | [
"CWE-400",
"CWE-401"
] | gpac | d2371b4b204f0a3c0af51ad4e9b491144dd1225c | 21,772,118,212,324,210,000,000,000,000,000,000,000 | 36 | prevent dref memleak on invalid input (#1183) |
_dbus_validate_bus_name (const DBusString *str,
int start,
int len)
{
const unsigned char *s;
const unsigned char *end;
const unsigned char *iface;
const unsigned char *last_dot;
_dbus_assert (start >= 0);
_dbus_assert (len >=... | 0 | [
"CWE-20"
] | dbus | 7b10b46c5c8658449783ce45f1273dd35c353bce | 97,408,342,945,371,020,000,000,000,000,000,000,000 | 85 | Bug 17803: Panic from dbus_signature_validate
* dbus/dbus-marshal-validate.c: Ensure we validate
a basic type before calling is_basic on it.
* dbus-marshal-validate-util.c: Test. |
static Token *dup_tlistn(const Token *list, size_t cnt, Token ***tailp)
{
Token *newlist = NULL;
Token **tailpp = &newlist;
const Token *t;
list_for_each(t, list) {
Token *nt;
if (!cnt--)
break;
*tailpp = nt = dup_Token(NULL, t);
tailpp = &nt->next;
}
... | 0 | [] | nasm | 6299a3114ce0f3acd55d07de201a8ca2f0a83059 | 135,884,150,901,420,770,000,000,000,000,000,000,000 | 22 | BR 3392708: fix NULL pointer reference for invalid %stacksize
After issuing an error message for a missing %stacksize argument, need
to quit rather than continuing to try to access the pointer.
Fold uses of tok_text() while we are at it.
Reported-by: Suhwan <prada960808@gmail.com>
Signed-off-by: H. Peter Anvin (Inte... |
onig_print_names(FILE* fp, regex_t* reg)
{
int i, j;
NameEntry* e;
NameTable* t = (NameTable* )reg->name_table;
if (IS_NOT_NULL(t) && t->num > 0) {
fprintf(fp, "name table\n");
for (i = 0; i < t->num; i++) {
e = &(t->e[i]);
fprintf(fp, "%s: ", e->name);
if (e->back_num == 0) {
fputs(... | 0 | [
"CWE-476"
] | Onigmo | 00cc7e28a3ed54b3b512ef3b58ea737a57acf1f9 | 247,791,820,930,983,200,000,000,000,000,000,000,000 | 29 | Fix SEGV in onig_error_code_to_str() (Fix #132)
When onig_new(ONIG_SYNTAX_PERL) fails with ONIGERR_INVALID_GROUP_NAME,
onig_error_code_to_str() crashes.
onig_scan_env_set_error_string() should have been used when returning
ONIGERR_INVALID_GROUP_NAME. |
void dcc_chat_deinit(void)
{
dcc_unregister_type("CHAT");
command_unbind("msg", (SIGNAL_FUNC) cmd_msg);
command_unbind("me", (SIGNAL_FUNC) cmd_me);
command_unbind("action", (SIGNAL_FUNC) cmd_action);
command_unbind("ctcp", (SIGNAL_FUNC) cmd_ctcp);
command_unbind("dcc chat", (SIGNAL_FUNC) cmd_dcc_chat);
co... | 0 | [
"CWE-416"
] | irssi | 43e44d553d44e313003cee87e6ea5e24d68b84a1 | 22,978,682,344,733,190,000,000,000,000,000,000,000 | 19 | Merge branch 'security' into 'master'
Security
Closes GL#12, GL#13, GL#14, GL#15, GL#16
See merge request irssi/irssi!23 |
R_API RBinJavaStackMapFrame *r_bin_java_default_stack_frame(void) {
RBinJavaStackMapFrame *sf = R_NEW0 (RBinJavaStackMapFrame);
if (!sf) {
return NULL;
}
sf->metas = R_NEW0 (RBinJavaMetaInfo);
if (!sf->metas) {
free (sf);
return NULL;
}
sf->metas->type_info = (void *) &R_BIN_JAVA_STACK_MAP_FRAME_METAS[R_BI... | 0 | [
"CWE-119",
"CWE-788"
] | radare2 | 6c4428f018d385fc80a33ecddcb37becea685dd5 | 305,205,613,243,077,660,000,000,000,000,000,000,000 | 18 | Improve boundary checks to fix oobread segfaults ##crash
* Reported by Cen Zhang via huntr.dev
* Reproducer: bins/fuzzed/javaoob-havoc.class |
check_never_users(uid_t uid, uid_t *nusers)
{
int i;
if (!nusers) return FALSE;
for (i = 1; i <= (int)(nusers[0]); i++) if (nusers[i] == uid) return TRUE;
return FALSE;
} | 0 | [
"CWE-78"
] | exim | d740d2111f189760593a303124ff6b9b1f83453d | 224,343,127,139,288,620,000,000,000,000,000,000,000 | 7 | Fix CVE-2019-10149 |
static bool is_ereg_8l(u32 reg)
{
return is_ereg(reg) ||
(1 << reg) & (BIT(BPF_REG_1) |
BIT(BPF_REG_2) |
BIT(BPF_REG_FP));
} | 0 | [
"CWE-77"
] | linux | e4d4d456436bfb2fe412ee2cd489f7658449b098 | 43,920,900,055,078,240,000,000,000,000,000,000,000 | 7 | bpf, x86: Validate computation of branch displacements for x86-64
The branch displacement logic in the BPF JIT compilers for x86 assumes
that, for any generated branch instruction, the distance cannot
increase between optimization passes.
But this assumption can be violated due to how the distances are
computed. Spec... |
krb5_gss_pseudo_random(OM_uint32 *minor_status,
gss_ctx_id_t context,
int prf_key,
const gss_buffer_t prf_in,
ssize_t desired_output_len,
gss_buffer_t prf_out)
{
krb5_error_code code;
krb5_key key ... | 1 | [
"CWE-703"
] | krb5 | 82dc33da50338ac84c7b4102dc6513d897d0506a | 15,606,522,119,887,186,000,000,000,000,000,000,000 | 101 | Fix gss_process_context_token() [CVE-2014-5352]
[MITKRB5-SA-2015-001] The krb5 gss_process_context_token() should not
actually delete the context; that leaves the caller with a dangling
pointer and no way to know that it is invalid. Instead, mark the
context as terminated, and check for terminated contexts in the GSS... |
RGWGetLC() { } | 0 | [
"CWE-770"
] | ceph | ab29bed2fc9f961fe895de1086a8208e21ddaddc | 294,231,243,653,732,900,000,000,000,000,000,000,000 | 1 | rgw: fix issues with 'enforce bounds' patch
The patch to enforce bounds on max-keys/max-uploads/max-parts had a few
issues that would prevent us from compiling it. Instead of changing the
code provided by the submitter, we're addressing them in a separate
commit to maintain the DCO.
Signed-off-by: Joao Eduardo Luis <... |
mrb_gc_mark_mt_size(mrb_state *mrb, struct RClass *c)
{
struct mt_tbl *h = c->mt;
if (!h) return 0;
return (size_t)h->size;
} | 0 | [
"CWE-787"
] | mruby | b1d0296a937fe278239bdfac840a3fd0e93b3ee9 | 8,101,569,913,808,359,000,000,000,000,000,000,000 | 7 | class.c: clear method cache after `remove_method`. |
static u64 __skb_get_nlattr_nest(u64 ctx, u64 A, u64 X, u64 r4, u64 r5)
{
struct sk_buff *skb = (struct sk_buff *)(long) ctx;
struct nlattr *nla;
if (skb_is_nonlinear(skb))
return 0;
if (skb->len < sizeof(struct nlattr))
return 0;
if (A > skb->len - sizeof(struct nlattr))
return 0;
nla = (struct nlattr ... | 0 | [
"CWE-416",
"CWE-125",
"CWE-189"
] | linux | 05ab8f2647e4221cbdb3856dd7d32bd5407316b3 | 49,936,337,969,752,850,000,000,000,000,000,000,000 | 24 | filter: prevent nla extensions to peek beyond the end of the message
The BPF_S_ANC_NLATTR and BPF_S_ANC_NLATTR_NEST extensions fail to check
for a minimal message length before testing the supplied offset to be
within the bounds of the message. This allows the subtraction of the nla
header to underflow and therefore -... |
UnicodeString __fastcall TCommandSet::GetLastLine()
{
return LAST_LINE;
}
| 0 | [
"CWE-20"
] | winscp | 49d876f2c5fc00bcedaa986a7cf6dedd6bf16f54 | 155,248,789,167,927,680,000,000,000,000,000,000,000 | 4 | Bug 1675: Prevent SCP server sending files that were not requested
https://winscp.net/tracker/1675
Source commit: 4aa587620973bf793fb6e783052277c0f7be4b55 |
gc_disable(mrb_state *mrb, mrb_value obj)
{
mrb_bool old = mrb->gc.disabled;
mrb->gc.disabled = TRUE;
return mrb_bool_value(old);
} | 0 | [
"CWE-415"
] | mruby | 97319697c8f9f6ff27b32589947e1918e3015503 | 96,285,349,812,131,620,000,000,000,000,000,000,000 | 8 | Cancel 9cdf439
Should not free the pointer in `realloc` since it can cause
use-after-free problem. |
void jbd2_journal_file_buffer(struct journal_head *jh,
transaction_t *transaction, int jlist)
{
jbd_lock_bh_state(jh2bh(jh));
spin_lock(&transaction->t_journal->j_list_lock);
__jbd2_journal_file_buffer(jh, transaction, jlist);
spin_unlock(&transaction->t_journal->j_list_lock);
jbd_unlock_bh_state(jh2bh(jh));
} | 0 | [
"CWE-787"
] | linux | e09463f220ca9a1a1ecfda84fcda658f99a1f12a | 63,495,616,862,421,570,000,000,000,000,000,000,000 | 9 | jbd2: don't mark block as modified if the handle is out of credits
Do not set the b_modified flag in block's journal head should not
until after we're sure that jbd2_journal_dirty_metadat() will not
abort with an error due to there not being enough space reserved in
the jbd2 handle.
Otherwise, future attempts to modi... |
Thd_charset_adapter(THD *thd_arg) : thd (thd_arg) {} | 0 | [] | mysql-server | 25d1b7e03b9b375a243fabdf0556c063c7282361 | 252,580,623,967,103,170,000,000,000,000,000,000,000 | 1 | Bug #22722946: integer overflow may lead to wrong results in get_56_lenc_string |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.