func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
explicit ArithmeticOptimizerContext(SetVector<NodeDef*>* nodes_to_simplify)
: nodes_to_simplify(nodes_to_simplify) {} | 0 | [
"CWE-476"
] | tensorflow | e6340f0665d53716ef3197ada88936c2a5f7a2d3 | 181,144,736,259,669,800,000,000,000,000,000,000,000 | 2 | Handle a special grappler case resulting in crash.
It might happen that a malformed input could be used to trick Grappler into trying to optimize a node with no inputs. This, in turn, would produce a null pointer dereference and a segfault.
PiperOrigin-RevId: 369242852
Change-Id: I2e5cbe7aec243d34a6d60220ac8ac9b16f13... |
static int __ftrace_function_set_filter(int filter, char *buf, int len,
struct function_filter_data *data)
{
int i, re_cnt, ret = -EINVAL;
int *reset;
char **re;
reset = filter ? &data->first_filter : &data->first_notrace;
/*
* The 'ip' field could have multiple filters set, separated
* either by space ... | 0 | [
"CWE-787"
] | linux | 70303420b5721c38998cf987e6b7d30cc62d4ff1 | 109,189,296,427,139,110,000,000,000,000,000,000,000 | 31 | tracing: Check for no filter when processing event filters
The syzkaller detected a out-of-bounds issue with the events filter code,
specifically here:
prog[N].pred = NULL; /* #13 */
prog[N].target = 1; /* TRUE */
prog[N+1].pred = NULL;
prog[N+1].target = 0; /* FALSE */
-> prog[N-1].target = N;
prog[N-1].w... |
set_phy_ctrl(E1000State *s, int index, uint16_t val)
{
if ((val & MII_CR_AUTO_NEG_EN) && (val & MII_CR_RESTART_AUTO_NEG)) {
s->nic->nc.link_down = true;
e1000_link_down(s);
s->phy_reg[PHY_STATUS] &= ~MII_SR_AUTONEG_COMPLETE;
DBGOUT(PHY, "Start link auto negotiation\n");
qemu_... | 0 | [
"CWE-120"
] | qemu | b0d9ffcd0251161c7c92f94804dcf599dfa3edeb | 307,804,479,494,585,300,000,000,000,000,000,000,000 | 10 | e1000: Discard packets that are too long if !SBP and !LPE
The e1000_receive function for the e1000 needs to discard packets longer than
1522 bytes if the SBP and LPE flags are disabled. The linux driver assumes
this behavior and allocates memory based on this assumption.
Signed-off-by: Michael Contreras <michael@inet... |
OperatorShellMake(const char *operatorName,
Oid operatorNamespace,
Oid leftTypeId,
Oid rightTypeId)
{
Relation pg_operator_desc;
Oid operatorObjectId;
int i;
HeapTuple tup;
Datum values[Natts_pg_operator];
bool nulls[Natts_pg_operator];
NameData oname;
TupleDesc tupDesc;
/*
* validat... | 0 | [
"CWE-94"
] | postgres | f52d2fbd8c62f667191b61228acf9d8aa53607b9 | 217,935,380,151,042,100,000,000,000,000,000,000,000 | 88 | In extensions, don't replace objects not belonging to the extension.
Previously, if an extension script did CREATE OR REPLACE and there was
an existing object not belonging to the extension, it would overwrite
the object and adopt it into the extension. This is problematic, first
because the overwrite is probably uni... |
kg_unseal_v1(context, minor_status, ctx, ptr, bodysize, message_buffer,
conf_state, qop_state, toktype)
krb5_context context;
OM_uint32 *minor_status;
krb5_gss_ctx_id_rec *ctx;
unsigned char *ptr;
int bodysize;
gss_buffer_t message_buffer;
int *conf_state;
gss_qop_t *qop_sta... | 0 | [
"CWE-125"
] | krb5 | fb99962cbd063ac04c9a9d2cc7c75eab73f3533d | 262,684,353,738,615,930,000,000,000,000,000,000,000 | 409 | Handle invalid RFC 1964 tokens [CVE-2014-4341...]
Detect the following cases which would otherwise cause invalid memory
accesses and/or integer underflow:
* An RFC 1964 token being processed by an RFC 4121-only context
[CVE-2014-4342]
* A header with fewer than 22 bytes after the token ID or an
incomplete checks... |
SdMmcSoftwareReset (
IN SD_MMC_HC_PRIVATE_DATA *Private,
IN UINT8 Slot,
IN UINT16 ErrIntStatus
)
{
UINT8 SwReset;
EFI_STATUS Status;
SwReset = 0;
if ((ErrIntStatus & 0x0F) != 0) {
SwReset |= BIT1;
}
if ((ErrIntStatus & 0x70) != 0) {
S... | 0 | [] | edk2 | e36d5ac7d10a6ff5becb0f52fdfd69a1752b0d14 | 301,259,077,544,060,540,000,000,000,000,000,000,000 | 44 | MdeModulePkg/SdMmcPciHcDxe: Fix double PciIo Unmap in TRB creation (CVE-2019-14587)
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1989
The commit will avoid unmapping the same resource in error handling logic
for function BuildAdmaDescTable() and SdMmcCreateTrb().
For the error handling in BuildAdmaDescTable():... |
PamBackend::~PamBackend() {
delete m_data;
delete m_pam;
} | 0 | [
"CWE-613",
"CWE-287",
"CWE-284"
] | sddm | 147cec383892d143b5e02daa70f1e7def50f5d98 | 275,658,418,030,067,700,000,000,000,000,000,000,000 | 4 | Fix authentication when reusing an existing session
- Check the success value before unlocking the session
- Don't attempt to use the nonexistant "sddm-check" PAM service |
static int cap_socket_accept(struct socket *sock, struct socket *newsock)
{
return 0;
} | 0 | [] | linux-2.6 | ee18d64c1f632043a02e6f5ba5e045bb26a5465f | 318,398,755,651,835,400,000,000,000,000,000,000,000 | 4 | KEYS: Add a keyctl to install a process's session keyring on its parent [try #6]
Add a keyctl to install a process's session keyring onto its parent. This
replaces the parent's session keyring. Because the COW credential code does
not permit one process to change another process's credentials directly, the
change is... |
static void cgw_remove_all_jobs(void)
{
struct cgw_job *gwj = NULL;
struct hlist_node *nx;
ASSERT_RTNL();
hlist_for_each_entry_safe(gwj, nx, &cgw_list, list) {
hlist_del(&gwj->list);
cgw_unregister_filter(gwj);
kmem_cache_free(cgw_cache, gwj);
}
} | 0 | [
"CWE-264"
] | net | 90f62cf30a78721641e08737bda787552428061e | 174,537,300,225,301,800,000,000,000,000,000,000,000 | 13 | 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.
... |
xfs_inode_item_format_data_fork(
struct xfs_inode_log_item *iip,
struct xfs_inode_log_format *ilf,
struct xfs_log_vec *lv,
struct xfs_log_iovec **vecp)
{
struct xfs_inode *ip = iip->ili_inode;
size_t data_bytes;
switch (ip->i_d.di_format) {
case XFS_DINODE_FMT_EXTENTS:
iip->ili_fields &=
~(XFS_ILOG_DDAT... | 0 | [
"CWE-19"
] | linux | fc0561cefc04e7803c0f6501ca4f310a502f65b8 | 138,398,629,932,559,050,000,000,000,000,000,000,000 | 97 | xfs: optimise away log forces on timestamp updates for fdatasync
xfs: timestamp updates cause excessive fdatasync log traffic
Sage Weil reported that a ceph test workload was writing to the
log on every fdatasync during an overwrite workload. Event tracing
showed that the only metadata modification being made was the... |
static int dvb_usbv2_download_firmware(struct dvb_usb_device *d,
const char *name)
{
int ret;
const struct firmware *fw;
dev_dbg(&d->udev->dev, "%s:\n", __func__);
if (!d->props->download_firmware) {
ret = -EINVAL;
goto err;
}
ret = request_firmware(&fw, name, &d->udev->dev);
if (ret < 0) {
dev_err(&d-... | 0 | [
"CWE-119",
"CWE-787"
] | linux | 005145378c9ad7575a01b6ce1ba118fb427f583a | 218,363,515,849,131,480,000,000,000,000,000,000,000 | 33 | [media] dvb-usb-v2: avoid use-after-free
I ran into a stack frame size warning because of the on-stack copy of
the USB device structure:
drivers/media/usb/dvb-usb-v2/dvb_usb_core.c: In function 'dvb_usbv2_disconnect':
drivers/media/usb/dvb-usb-v2/dvb_usb_core.c:1029:1: error: the frame size of 1104 bytes is larger th... |
const CImg<T>& save_off(const CImgList<tf>& primitives, const CImgList<tc>& colors,
std::FILE *const file) const {
return _save_off(primitives,colors,file,0);
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 175,534,862,953,687,400,000,000,000,000,000,000,000 | 4 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
fix_glyph_scaling(ASS_Renderer *priv, GlyphInfo *glyph)
{
double ft_size;
if (priv->settings.hinting == ASS_HINTING_NONE) {
// arbitrary, not too small to prevent grid fitting rounding effects
// XXX: this is a rather crude hack
ft_size = 256.0;
} else {
// If hinting is enab... | 0 | [
"CWE-125"
] | libass | f4f48950788b91c6a30029cc28a240b834713ea7 | 139,927,730,050,104,520,000,000,000,000,000,000,000 | 16 | 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... |
iobuf_tell (iobuf_t a)
{
return a->ntotal + a->nbytes;
} | 0 | [
"CWE-20"
] | gnupg | 2183683bd633818dd031b090b5530951de76f392 | 136,394,847,183,470,620,000,000,000,000,000,000,000 | 4 | 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 void MSCFree(void* ptr)
{
free(ptr);
} | 0 | [
"CWE-190",
"CWE-189",
"CWE-703"
] | ImageMagick | 0f6fc2d5bf8f500820c3dbcf0d23ee14f2d9f734 | 223,537,725,215,557,940,000,000,000,000,000,000,000 | 4 | |
static MagickBooleanType WriteRGBImage(const ImageInfo *image_info,Image *image)
{
MagickBooleanType
status;
MagickOffsetType
scene;
QuantumInfo
*quantum_info;
QuantumType
quantum_type;
size_t
imageListLength,
length;
ssize_t
count,
y;
unsigned char
*pixels;
/*... | 0 | [
"CWE-401"
] | ImageMagick6 | 210474b2fac6a661bfa7ed563213920e93e76395 | 313,428,304,870,144,600,000,000,000,000,000,000,000 | 382 | Fix ultra rare but potential memory-leak |
static void vt_event_wait(struct vt_event_wait *vw)
{
__vt_event_queue(vw);
__vt_event_wait(vw);
__vt_event_dequeue(vw);
} | 0 | [
"CWE-662"
] | linux | 90bfdeef83f1d6c696039b6a917190dcbbad3220 | 269,927,584,358,172,740,000,000,000,000,000,000,000 | 6 | tty: make FONTX ioctl use the tty pointer they were actually passed
Some of the font tty ioctl's always used the current foreground VC for
their operations. Don't do that then.
This fixes a data race on fg_console.
Side note: both Michael Ellerman and Jiri Slaby point out that all these
ioctls are deprecated, and s... |
void WebContents::BeforeUnloadFired(content::WebContents* tab,
bool proceed,
bool* proceed_to_fire_unload) {
if (type_ == Type::BROWSER_WINDOW || type_ == Type::OFF_SCREEN)
*proceed_to_fire_unload = proceed;
else
*proceed_to_fire_unload... | 0 | [
"CWE-284",
"CWE-693"
] | electron | 18613925610ba319da7f497b6deed85ad712c59b | 268,298,648,768,769,900,000,000,000,000,000,000,000 | 10 | refactor: wire will-navigate up to a navigation throttle instead of OpenURL (#25108)
* refactor: wire will-navigate up to a navigation throttle instead of OpenURL (#25065)
* refactor: wire will-navigate up to a navigation throttle instead of OpenURL
* spec: add test for x-site _top navigation
* chore: old cod... |
qf_pop_dir(struct dir_stack_T **stackptr)
{
struct dir_stack_T *ds_ptr;
// TODO: Should we check if dirbuf is the directory on top of the stack?
// What to do if it isn't?
// pop top element and free it
if (*stackptr != NULL)
{
ds_ptr = *stackptr;
*stackptr = (*stackptr)->next;
vim_free(ds... | 0 | [
"CWE-416"
] | vim | 4f1b083be43f351bc107541e7b0c9655a5d2c0bb | 23,807,015,907,869,250,000,000,000,000,000,000,000 | 19 | patch 9.0.0322: crash when no errors and 'quickfixtextfunc' is set
Problem: Crash when no errors and 'quickfixtextfunc' is set.
Solution: Do not handle errors if there aren't any. |
_cairo_image_bounded_opaque_spans (void *abstract_renderer,
int y, int height,
const cairo_half_open_span_t *spans,
unsigned num_spans)
{
cairo_image_span_renderer_t *r = abstract_renderer;
if (num_spans == 0)
return CAIRO_STATUS_SUCCESS;
do {
if (spans[0].coverage)
pixman_imag... | 0 | [
"CWE-787"
] | cairo | c986a7310bb06582b7d8a566d5f007ba4e5e75bf | 297,165,334,754,253,280,000,000,000,000,000,000,000 | 21 | image: Enable inplace compositing with opacities for general routines
On a SNB i5-2500:
Speedups
========
firefox-chalkboard 34284.16 -> 19637.40: 1.74x speedup
swfdec-giant-steps 778.35 -> 665.37: 1.17x speedup
ocitysmap 485.64 -> 431.94: 1.12x speedup
Slowdowns
===... |
static void php_zip_free_entry(zend_resource *rsrc)
{
zip_read_rsrc *zr_rsrc = (zip_read_rsrc *) rsrc->ptr;
if (zr_rsrc) {
if (zr_rsrc->zf) {
zip_fclose(zr_rsrc->zf);
zr_rsrc->zf = NULL;
}
efree(zr_rsrc);
rsrc->ptr = NULL;
}
} | 0 | [
"CWE-190"
] | php-src | 3b8d4de300854b3517c7acb239b84f7726c1353c | 249,958,479,886,737,440,000,000,000,000,000,000,000 | 13 | Fix bug #71923 - integer overflow in ZipArchive::getFrom* |
s_aos_close(stream * s)
{
gs_free_object(s->memory, s->cbuf, "s_aos_close(buffer)");
s->cbuf = 0;
/* Increment the IDs to prevent further access. */
s->read_id = s->write_id = (s->read_id | s->write_id) + 1;
return 0;
} | 0 | [] | ghostpdl | 04b37bbce174eed24edec7ad5b920eb93db4d47d | 104,020,584,158,416,260,000,000,000,000,000,000,000 | 8 | Bug 697799: have .rsdparams check its parameters
The Ghostscript internal operator .rsdparams wasn't checking the number or
type of the operands it was being passed. Do so. |
virDomainHostdevMatchSubsysPCI(virDomainHostdevDefPtr first,
virDomainHostdevDefPtr second)
{
virDomainHostdevSubsysPCIPtr first_pcisrc = &first->source.subsys.u.pci;
virDomainHostdevSubsysPCIPtr second_pcisrc = &second->source.subsys.u.pci;
if (first_pcisrc->addr.domain == s... | 0 | [
"CWE-212"
] | libvirt | a5b064bf4b17a9884d7d361733737fb614ad8979 | 264,363,439,013,006,100,000,000,000,000,000,000,000 | 13 | conf: Don't format http cookies unless VIR_DOMAIN_DEF_FORMAT_SECURE is used
Starting with 3b076391befc3fe72deb0c244ac6c2b4c100b410
(v6.1.0-122-g3b076391be) we support http cookies. Since they may contain
somewhat sensitive information we should not format them into the XML
unless VIR_DOMAIN_DEF_FORMAT_SECURE is assert... |
static void save_screen(struct vc_data *vc)
{
WARN_CONSOLE_UNLOCKED();
if (vc->vc_sw->con_save_screen)
vc->vc_sw->con_save_screen(vc);
} | 0 | [
"CWE-125"
] | linux | 3c4e0dff2095c579b142d5a0693257f1c58b4804 | 91,629,715,567,701,600,000,000,000,000,000,000,000 | 7 | vt: Disable KD_FONT_OP_COPY
It's buggy:
On Fri, Nov 06, 2020 at 10:30:08PM +0800, Minh Yuan wrote:
> We recently discovered a slab-out-of-bounds read in fbcon in the latest
> kernel ( v5.10-rc2 for now ). The root cause of this vulnerability is that
> "fbcon_do_set_font" did not handle "vc->vc_font.data" and
> "vc->... |
Image::AutoPtr newBigTiffInstance(BasicIo::AutoPtr io, bool)
{
return Image::AutoPtr(new BigTiffImage(io));
} | 0 | [
"CWE-617"
] | exiv2 | 1647908e00a4df7246d76678e59587e62c690dcd | 265,065,689,844,316,600,000,000,000,000,000,000,000 | 4 | fix for crash in bigtiff (issue #208) |
void __init __weak arch_task_cache_init(void) { } | 0 | [
"CWE-416",
"CWE-703"
] | linux | 2b7e8665b4ff51c034c55df3cff76518d1a9ee3a | 315,339,787,981,553,930,000,000,000,000,000,000,000 | 1 | fork: fix incorrect fput of ->exe_file causing use-after-free
Commit 7c051267931a ("mm, fork: make dup_mmap wait for mmap_sem for
write killable") made it possible to kill a forking task while it is
waiting to acquire its ->mmap_sem for write, in dup_mmap().
However, it was overlooked that this introduced an new erro... |
void cmp_item_decimal::store_value(Item *item)
{
my_decimal *val= item->val_decimal(&value);
/* val may be zero if item is nnull */
if (val && val != &value)
my_decimal2decimal(val, &value);
m_null_value= item->null_value;
} | 0 | [
"CWE-617"
] | server | 807945f2eb5fa22e6f233cc17b85a2e141efe2c8 | 248,216,381,770,508,500,000,000,000,000,000,000,000 | 8 | MDEV-26402: A SEGV in Item_field::used_tables/update_depend_map_for_order...
When doing condition pushdown from HAVING into WHERE,
Item_equal::create_pushable_equalities() calls
item->set_extraction_flag(IMMUTABLE_FL) for constant items.
Then, Item::cleanup_excluding_immutables_processor() checks for this flag
to see ... |
void ompl::geometric::VFRRT::setup()
{
RRT::setup();
vfdim_ = si_->getStateSpace()->getValueLocations().size();
} | 0 | [
"CWE-703"
] | ompl | abb4fadcb4e4fe4c9cf41e5e7706143a66948eb7 | 258,584,341,316,277,340,000,000,000,000,000,000,000 | 5 | fix memory leak in VFRRT. closes #839 |
static int direct_page_fault(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault)
{
bool is_tdp_mmu_fault = is_tdp_mmu(vcpu->arch.mmu);
unsigned long mmu_seq;
int r;
fault->gfn = fault->addr >> PAGE_SHIFT;
fault->slot = kvm_vcpu_gfn_to_memslot(vcpu, fault->gfn);
if (page_fault_handle_page_track(vcpu, fault))
... | 0 | [
"CWE-476"
] | linux | 9f46c187e2e680ecd9de7983e4d081c3391acc76 | 217,074,184,658,069,530,000,000,000,000,000,000,000 | 57 | KVM: x86/mmu: fix NULL pointer dereference on guest INVPCID
With shadow paging enabled, the INVPCID instruction results in a call
to kvm_mmu_invpcid_gva. If INVPCID is executed with CR0.PG=0, the
invlpg callback is not set and the result is a NULL pointer dereference.
Fix it trivially by checking for mmu->invlpg befo... |
void tfdt_box_del(GF_Box *s)
{
gf_free(s);
} | 0 | [
"CWE-787"
] | gpac | 77510778516803b7f7402d7423c6d6bef50254c3 | 85,731,231,595,751,140,000,000,000,000,000,000,000 | 4 | fixed #2255 |
SMB2_ioctl(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid,
u64 volatile_fid, u32 opcode, bool is_fsctl,
char *in_data, u32 indatalen, u32 max_out_data_len,
char **out_data, u32 *plen /* returned data len */)
{
struct smb_rqst rqst;
struct smb2_ioctl_rsp *rsp = NULL;
struct cifs_ses *s... | 0 | [
"CWE-416",
"CWE-200"
] | linux | 6a3eb3360667170988f8a6477f6686242061488a | 86,487,791,495,872,740,000,000,000,000,000,000,000 | 99 | cifs: Fix use-after-free in SMB2_write
There is a KASAN use-after-free:
BUG: KASAN: use-after-free in SMB2_write+0x1342/0x1580
Read of size 8 at addr ffff8880b6a8e450 by task ln/4196
Should not release the 'req' because it will use in the trace.
Fixes: eccb4422cf97 ("smb3: Add ftrace tracepoints for improved SMB3 de... |
void tq_freeze(struct thread_q *tq)
{
tq_freezethaw(tq, true);
} | 0 | [
"CWE-20",
"CWE-703"
] | sgminer | 910c36089940e81fb85c65b8e63dcd2fac71470c | 325,135,419,859,798,200,000,000,000,000,000,000,000 | 4 | stratum: parse_notify(): Don't die on malformed bbversion/prev_hash/nbit/ntime.
Might have introduced a memory leak, don't have time to check. :(
Should the other hex2bin()'s be checked?
Thanks to Mick Ayzenberg <mick.dejavusecurity.com> for finding this. |
autoar_extractor_signal_error (AutoarExtractor *self)
{
if (self->error != NULL) {
if (self->error->domain == G_IO_ERROR &&
self->error->code == G_IO_ERROR_CANCELLED) {
g_error_free (self->error);
self->error = NULL;
autoar_extractor_signal_cancelled (self);
} else {
autoar_com... | 0 | [
"CWE-22"
] | gnome-autoar | adb067e645732fdbe7103516e506d09eb6a54429 | 210,285,819,663,176,340,000,000,000,000,000,000,000 | 15 | 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... |
int evm_inode_setattr(struct dentry *dentry, struct iattr *attr)
{
unsigned int ia_valid = attr->ia_valid;
enum integrity_status evm_status;
if (!(ia_valid & (ATTR_MODE | ATTR_UID | ATTR_GID)))
return 0;
evm_status = evm_verify_current_integrity(dentry);
if ((evm_status == INTEGRITY_PASS) ||
(evm_status ==... | 0 | [
"CWE-241",
"CWE-19"
] | linux | 613317bd212c585c20796c10afe5daaa95d4b0a1 | 151,570,008,107,514,180,000,000,000,000,000,000,000 | 16 | EVM: Use crypto_memneq() for digest comparisons
This patch fixes vulnerability CVE-2016-2085. The problem exists
because the vm_verify_hmac() function includes a use of memcmp().
Unfortunately, this allows timing side channel attacks; specifically
a MAC forgery complexity drop from 2^128 to 2^12. This patch changes
... |
R_API RBinFile *r_bin_file_find_by_id(RBin *bin, ut32 binfile_id) {
RBinFile *binfile = NULL;
RListIter *iter = NULL;
r_list_foreach (bin->binfiles, iter, binfile) {
if (binfile->id == binfile_id) {
break;
}
binfile = NULL;
}
return binfile;
} | 0 | [
"CWE-125"
] | radare2 | 3fcf41ed96ffa25b38029449520c8d0a198745f3 | 262,223,107,939,649,900,000,000,000,000,000,000,000 | 11 | Fix #9902 - Fix oobread in RBin.string_scan_range |
static inline int parse_mask(NM self, const char *str, int flags) {
char *p;
uint32_t v;
struct in6_addr s6;
struct in_addr s;
v = strtoul(str, &p, 0);
if(*p == '\0') {
/* read it as a CIDR value */
if(is_v4(self)) {
if(v < 0 || v > 32) return 0;
v += 96;... | 1 | [] | netmask | 29a9c239bd1008363f5b34ffd6c2cef906f3660c | 269,093,484,129,150,300,000,000,000,000,000,000,000 | 45 | bump version to 2.4.4
* remove checks for negative unsigned ints, fixes #2
* harden error logging functions, fixes #3 |
template<typename tf, typename tc, typename te>
CImg<floatT> get_elevation3d(CImgList<tf>& primitives, CImgList<tc>& colors, const CImg<te>& elevation) const {
if (!is_sameXY(elevation) || elevation._depth>1 || elevation._spectrum>1)
throw CImgArgumentException(_cimg_instance
... | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 266,508,455,434,780,260,000,000,000,000,000,000,000 | 24 | Fix other issues in 'CImg<T>::load_bmp()'. |
static int tg3_wait_macro_done(struct tg3 *tp)
{
int limit = 100;
while (limit--) {
u32 tmp32;
if (!tg3_readphy(tp, MII_TG3_DSP_CONTROL, &tmp32)) {
if ((tmp32 & 0x1000) == 0)
break;
}
}
if (limit < 0)
return -EBUSY;
return 0;
} | 0 | [
"CWE-476",
"CWE-119"
] | linux | 715230a44310a8cf66fbfb5a46f9a62a9b2de424 | 97,866,134,296,339,960,000,000,000,000,000,000,000 | 17 | tg3: fix length overflow in VPD firmware parsing
Commit 184b89044fb6e2a74611dafa69b1dce0d98612c6 ("tg3: Use VPD fw version
when present") introduced VPD parsing that contained a potential length
overflow.
Limit the hardware's reported firmware string length (max 255 bytes) to
stay inside the driver's firmware string ... |
static int snd_pcm_hw_params_choose(struct snd_pcm_substream *pcm,
struct snd_pcm_hw_params *params)
{
static const int vars[] = {
SNDRV_PCM_HW_PARAM_ACCESS,
SNDRV_PCM_HW_PARAM_FORMAT,
SNDRV_PCM_HW_PARAM_SUBFORMAT,
SNDRV_PCM_HW_PARAM_CHANNELS,
SNDRV_PCM_HW_PARAM_RATE,
SNDRV_PCM_HW_PARAM_PERIOD_TIME... | 0 | [
"CWE-125"
] | linux | 92ee3c60ec9fe64404dc035e7c41277d74aa26cb | 309,339,799,132,213,960,000,000,000,000,000,000,000 | 51 | ALSA: pcm: Fix races among concurrent hw_params and hw_free calls
Currently we have neither proper check nor protection against the
concurrent calls of PCM hw_params and hw_free ioctls, which may result
in a UAF. Since the existing PCM stream lock can't be used for
protecting the whole ioctl operations, we need a new... |
Item_datetime_literal(THD *thd, MYSQL_TIME *ltime, uint dec_arg):
Item_temporal_literal(thd, ltime, dec_arg)
{
max_length= MAX_DATETIME_WIDTH + (decimals ? decimals + 1 : 0);
fixed= 1;
// See the comment on maybe_null in Item_date_literal
maybe_null= !ltime->month || !ltime->day;
} | 0 | [
"CWE-617"
] | server | 2e7891080667c59ac80f788eef4d59d447595772 | 128,106,558,223,069,500,000,000,000,000,000,000,000 | 8 | MDEV-25635 Assertion failure when pushing from HAVING into WHERE of view
This bug could manifest itself after pushing a where condition over a
mergeable derived table / view / CTE DT into a grouping view / derived
table / CTE V whose item list contained set functions with constant
arguments such as MIN(2), SUM(1) etc.... |
GF_Err gf_isom_set_ipod_compatible(GF_ISOFile *the_file, u32 trackNumber)
{
GF_TrackBox *trak;
GF_Err e;
GF_MPEGVisualSampleEntryBox *entry;
e = CanAccessMovie(the_file, GF_ISOM_OPEN_WRITE);
if (e) return e;
trak = gf_isom_get_track_from_file(the_file, trackNumber);
if (!trak || !trak->Media) return GF_BAD_PARA... | 0 | [
"CWE-476"
] | gpac | ebfa346eff05049718f7b80041093b4c5581c24e | 47,609,732,661,615,120,000,000,000,000,000,000,000 | 38 | fixed #1706 |
ctnetlink_update_status(struct nf_conn *ct, const struct nlattr * const cda[])
{
unsigned int status = ntohl(nla_get_be32(cda[CTA_STATUS]));
unsigned long d = ct->status ^ status;
if (d & IPS_SEEN_REPLY && !(status & IPS_SEEN_REPLY))
/* SEEN_REPLY bit can only be set */
return -EBUSY;
if (d & IPS_ASSURED && !... | 0 | [
"CWE-120"
] | linux | 1cc5ef91d2ff94d2bf2de3b3585423e8a1051cb6 | 149,477,185,349,715,520,000,000,000,000,000,000,000 | 22 | netfilter: ctnetlink: add a range check for l3/l4 protonum
The indexes to the nf_nat_l[34]protos arrays come from userspace. So
check the tuple's family, e.g. l3num, when creating the conntrack in
order to prevent an OOB memory access during setup. Here is an example
kernel panic on 4.14.180 when userspace passes in ... |
PHP_FUNCTION(mkdir)
{
char *dir;
int dir_len;
zval *zcontext = NULL;
long mode = 0777;
zend_bool recursive = 0;
php_stream_context *context;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|lbr", &dir, &dir_len, &mode, &recursive, &zcontext) == FAILURE) {
RETURN_FALSE;
}
context = php_stream_context... | 0 | [
"CWE-19"
] | php-src | be9b2a95adb504abd5acdc092d770444ad6f6854 | 272,977,691,917,554,400,000,000,000,000,000,000,000 | 17 | Fixed bug #69418 - more s->p fixes for filenames |
cpu_cgroup_css_alloc(struct cgroup_subsys_state *parent_css)
{
struct task_group *parent = css_tg(parent_css);
struct task_group *tg;
if (!parent) {
/* This is early initialization for the top cgroup */
return &root_task_group.css;
}
tg = sched_create_group(parent);
if (IS_ERR(tg))
return ERR_PTR(-ENOMEM)... | 0 | [
"CWE-200"
] | linux | 4efbc454ba68def5ef285b26ebfcfdb605b52755 | 43,390,279,912,493,730,000,000,000,000,000,000,000 | 16 | 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 ... |
const struct sockaddr_storage *smbXcli_conn_remote_sockaddr(struct smbXcli_conn *conn)
{
return &conn->remote_ss;
} | 0 | [
"CWE-20"
] | samba | a819d2b440aafa3138d95ff6e8b824da885a70e9 | 70,602,610,150,303,300,000,000,000,000,000,000,000 | 4 | CVE-2015-5296: libcli/smb: make sure we require signing when we demand encryption on a session
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11536
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org> |
ip_invoke_with_position(argc, argv, obj, position)
int argc;
VALUE *argv;
VALUE obj;
Tcl_QueuePosition position;
{
struct invoke_queue *ivq;
#ifdef RUBY_USE_NATIVE_THREAD
struct tcltkip *ptr;
#endif
int *alloc_done;
int thr_crit_bup;
volatile VALUE current = rb_thread_current();
... | 0 | [] | tk | d098136e3f62a4879a7d7cd34bbd50f482ba3331 | 165,380,260,633,092,320,000,000,000,000,000,000,000 | 173 | 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... |
void preventCommandReplication(client *c) {
c->flags |= CLIENT_PREVENT_REPL_PROP;
} | 0 | [
"CWE-770"
] | redis | 5674b0057ff2903d43eaff802017eddf37c360f8 | 89,387,347,546,800,370,000,000,000,000,000,000,000 | 3 | Prevent unauthenticated client from easily consuming lots of memory (CVE-2021-32675)
This change sets a low limit for multibulk and bulk length in the
protocol for unauthenticated connections, so that they can't easily
cause redis to allocate massive amounts of memory by sending just a few
characters on the network.
T... |
void RGWPutBucketTags_ObjStore_S3::send_response()
{
if (op_ret)
set_req_state_err(s, op_ret);
dump_errno(s);
end_header(s, this, "application/xml");
dump_start(s);
} | 0 | [
"CWE-79"
] | ceph | 8f90658c731499722d5f4393c8ad70b971d05f77 | 261,281,775,946,825,400,000,000,000,000,000,000,000 | 8 | rgw: reject unauthenticated response-header actions
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Reviewed-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit d8dd5e513c0c62bbd7d3044d7e2eddcd897bd400) |
static void crypto_rfc4309_exit_tfm(struct crypto_aead *tfm)
{
struct crypto_rfc4309_ctx *ctx = crypto_aead_ctx(tfm);
crypto_free_aead(ctx->child);
} | 0 | [
"CWE-119",
"CWE-787"
] | linux | 3b30460c5b0ed762be75a004e924ec3f8711e032 | 75,113,388,487,953,380,000,000,000,000,000,000,000 | 6 | crypto: ccm - move cbcmac input off the stack
Commit f15f05b0a5de ("crypto: ccm - switch to separate cbcmac driver")
refactored the CCM driver to allow separate implementations of the
underlying MAC to be provided by a platform. However, in doing so, it
moved some data from the linear region to the stack, which violat... |
int r_jwe_add_key_symmetric(jwe_t * jwe, const unsigned char * key, size_t key_len) {
int ret = RHN_OK;
jwa_alg alg;
jwk_t * j_key = NULL;
if (jwe != NULL && key != NULL && key_len) {
if (r_jwk_init(&j_key) == RHN_OK && r_jwk_import_from_symmetric_key(j_key, key, key_len) == RHN_OK) {
if (r_jwks_appe... | 0 | [
"CWE-787"
] | rhonabwy | b4c2923a1ba4fabf9b55a89244127e153a3e549b | 267,274,443,920,288,780,000,000,000,000,000,000,000 | 24 | Fix buffer overflow on r_jwe_aesgcm_key_unwrap |
archive_acl_from_text_l(struct archive_acl *acl, const char *text,
int want_type, struct archive_string_conv *sc)
{
struct {
const char *start;
const char *end;
} field[6], name;
const char *s, *st;
int numfields, fields, n, r, sol, ret;
int type, types, tag, permset, id;
size_t len;
char sep;
switch ... | 0 | [
"CWE-476"
] | libarchive | 15bf44fd2c1ad0e3fd87048b3fcc90c4dcff1175 | 194,837,968,984,706,200,000,000,000,000,000,000,000 | 261 | Skip 0-length ACL fields
Currently, it is possible to create an archive that crashes bsdtar
with a malformed ACL:
Program received signal SIGSEGV, Segmentation fault.
archive_acl_from_text_l (acl=<optimised out>, text=0x7e2e92 "", want_type=<optimised out>, sc=<optimised out>) at libarchive/archive_acl.c:1726
1726 ... |
static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
Image
*image;
MagickBooleanType
status;
MagickSizeType
number_pixels;
MemoryInfo
*pixel_info;
register Quantum
*q;
register ssize_t
i,
x;
register unsigned char
*p;
SGIInfo
iris_... | 0 | [
"CWE-125"
] | ImageMagick | 8f8959033e4e59418d6506b345829af1f7a71127 | 42,688,279,263,493,930,000,000,000,000,000,000,000 | 464 | ... |
CImg<T>& _load_raw(std::FILE *const file, const char *const filename,
const unsigned int size_x, const unsigned int size_y,
const unsigned int size_z, const unsigned int size_c,
const bool is_multiplexed, const bool invert_endianness,
const ulongT offset) {
i... | 0 | [
"CWE-119",
"CWE-787"
] | CImg | ac8003393569aba51048c9d67e1491559877b1d1 | 145,792,470,679,987,790,000,000,000,000,000,000,000 | 48 | . |
static inline u64 perf_cgroup_event_cgrp_time(struct perf_event *event)
{
return 0;
} | 0 | [
"CWE-703",
"CWE-189"
] | linux | 8176cced706b5e5d15887584150764894e94e02f | 258,052,789,467,048,340,000,000,000,000,000,000,000 | 4 | perf: Treat attr.config as u64 in perf_swevent_init()
Trinity discovered that we fail to check all 64 bits of
attr.config passed by user space, resulting to out-of-bounds
access of the perf_swevent_enabled array in
sw_perf_event_destroy().
Introduced in commit b0a873ebb ("perf: Register PMU
implementations").
Signed... |
int waitForRWData(int fd, bool waitForRead, int seconds, int useconds)
{
int ret;
struct pollfd pfd;
memset(&pfd, 0, sizeof(pfd));
pfd.fd = fd;
if(waitForRead)
pfd.events=POLLIN;
else
pfd.events=POLLOUT;
ret = poll(&pfd, 1, seconds * 1000 + useconds/1000);
if ( ret == -1 )
errno = ETIME... | 0 | [
"CWE-399"
] | pdns | 881b5b03a590198d03008e4200dd00cc537712f3 | 154,061,024,335,211,130,000,000,000,000,000,000,000 | 19 | Reject qname's wirelength > 255, `chopOff()` handle dot inside labels |
void OSD::_add_heartbeat_peer(int p)
{
if (p == whoami)
return;
HeartbeatInfo *hi;
map<int,HeartbeatInfo>::iterator i = heartbeat_peers.find(p);
if (i == heartbeat_peers.end()) {
pair<ConnectionRef,ConnectionRef> cons = service.get_con_osd_hb(p, osdmap->get_epoch());
if (!cons.first)
return;
... | 0 | [
"CWE-287",
"CWE-284"
] | ceph | 5ead97120e07054d80623dada90a5cc764c28468 | 101,246,970,032,854,430,000,000,000,000,000,000,000 | 35 | 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 ... |
onig_set_callout_user_data_of_match_param(OnigMatchParam* param, void* user_data)
{
#ifdef USE_CALLOUT
param->callout_user_data = user_data;
return ONIG_NORMAL;
#else
return ONIG_NO_SUPPORT_CONFIG;
#endif
} | 0 | [
"CWE-125"
] | oniguruma | d3e402928b6eb3327f8f7d59a9edfa622fec557b | 251,898,441,219,789,650,000,000,000,000,000,000,000 | 9 | fix heap-buffer-overflow |
void kvm_lapic_sync_to_vapic(struct kvm_vcpu *vcpu)
{
u32 data, tpr;
int max_irr, max_isr;
struct kvm_lapic *apic = vcpu->arch.apic;
void *vapic;
apic_sync_pv_eoi_to_guest(vcpu, apic);
if (!test_bit(KVM_APIC_CHECK_VAPIC, &vcpu->arch.apic_attention))
return;
tpr = kvm_apic_get_reg(apic, APIC_TASKPRI) & 0xff;... | 1 | [
"CWE-20"
] | linux | fda4e2e85589191b123d31cdc21fd33ee70f50fd | 189,376,184,270,113,900,000,000,000,000,000,000,000 | 25 | KVM: x86: Convert vapic synchronization to _cached functions (CVE-2013-6368)
In kvm_lapic_sync_from_vapic and kvm_lapic_sync_to_vapic there is the
potential to corrupt kernel memory if userspace provides an address that
is at the end of a page. This patches concerts those functions to use
kvm_write_guest_cached and k... |
static struct inode *ext4_get_journal_inode(struct super_block *sb,
unsigned int journal_inum)
{
struct inode *journal_inode;
/*
* Test for the existence of a valid inode on disk. Bad things
* happen if we iget() an unused inode, as the subsequent iput()
* will try to delete it.
*/
journal_inode ... | 0 | [
"CWE-416",
"CWE-401"
] | linux | 4ea99936a1630f51fc3a2d61a58ec4a1c4b7d55a | 313,703,761,472,682,800,000,000,000,000,000,000,000 | 31 | ext4: add more paranoia checking in ext4_expand_extra_isize handling
It's possible to specify a non-zero s_want_extra_isize via debugging
option, and this can cause bad things(tm) to happen when using a file
system with an inode size of 128 bytes.
Add better checking when the file system is mounted, as well as when
w... |
__must_hold(&req->ctx->completion_lock)
{
struct io_kiocb *nxt, *link = req->link;
req->link = NULL;
while (link) {
nxt = link->link;
link->link = NULL;
trace_io_uring_fail_link(req, link);
io_cqring_fill_event(link->ctx, link->user_data, -ECANCELED, 0);
io_put_req_deferred(link, 2);
link = nxt;
}
} | 0 | [
"CWE-787"
] | linux | d1f82808877bb10d3deee7cf3374a4eb3fb582db | 29,150,748,885,869,050,000,000,000,000,000,000,000 | 15 | io_uring: truncate lengths larger than MAX_RW_COUNT on provide buffers
Read and write operations are capped to MAX_RW_COUNT. Some read ops rely on
that limit, and that is not guaranteed by the IORING_OP_PROVIDE_BUFFERS.
Truncate those lengths when doing io_add_buffers, so buffer addresses still
use the uncapped lengt... |
static void FixSDTPInTRAF(GF_MovieFragmentBox *moof)
{
u32 k;
if (!moof)
return;
for (k = 0; k < gf_list_count(moof->TrackList); k++) {
GF_TrackFragmentBox *traf = gf_list_get(moof->TrackList, k);
if (traf->sdtp) {
GF_TrackFragmentRunBox *trun;
u32 j = 0, sample_index = 0;
if (traf->sdtp->sampleCoun... | 0 | [
"CWE-401"
] | gpac | fe5155cf047252d1c4cb91602048bfa682af0ea7 | 204,338,853,142,673,200,000,000,000,000,000,000,000 | 38 | fixed #1783 (fuzz) |
const Publisher* DataWriterImpl::get_publisher() const
{
return publisher_->get_publisher();
} | 0 | [
"CWE-284"
] | Fast-DDS | d2aeab37eb4fad4376b68ea4dfbbf285a2926384 | 78,573,602,639,793,590,000,000,000,000,000,000,000 | 4 | check remote permissions (#1387)
* Refs 5346. Blackbox test
Signed-off-by: Iker Luengo <ikerluengo@eprosima.com>
* Refs 5346. one-way string compare
Signed-off-by: Iker Luengo <ikerluengo@eprosima.com>
* Refs 5346. Do not add partition separator on last partition
Signed-off-by: Iker Luengo <ikerluengo@e... |
static int raw_cmd_copyout(int cmd, void __user *param,
struct floppy_raw_cmd *ptr)
{
int ret;
while (ptr) {
struct floppy_raw_cmd cmd = *ptr;
cmd.next = NULL;
cmd.kernel_data = NULL;
ret = copy_to_user(param, &cmd, sizeof(cmd));
if (ret)
return -EFAULT;
param += sizeof(struct floppy_raw_cmd);
... | 0 | [
"CWE-200",
"CWE-264",
"CWE-754"
] | linux | 2145e15e0557a01b9195d1c7199a1b92cb9be81f | 223,610,657,874,578,700,000,000,000,000,000,000,000 | 28 | floppy: don't write kernel-only members to FDRAWCMD ioctl output
Do not leak kernel-only floppy_raw_cmd structure members to userspace.
This includes the linked-list pointer and the pointer to the allocated
DMA space.
Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
Signed-off-by: Linus Torvalds <torvalds@linux-found... |
MagickPrivate void CacheComponentTerminus(void)
{
if (cache_semaphore == (SemaphoreInfo *) NULL)
ActivateSemaphoreInfo(&cache_semaphore);
/* no op-- nothing to destroy */
RelinquishSemaphoreInfo(&cache_semaphore);
} | 0 | [
"CWE-772"
] | ImageMagick | 7a42f63927e7f2e26846b7ed4560e9cb4984af7b | 24,166,932,899,745,200,000,000,000,000,000,000,000 | 7 | https://github.com/ImageMagick/ImageMagick/issues/903 |
main (int argc, char *argv[])
{
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/socket-client/happy-eyeballs/slow", test_happy_eyeballs);
g_test_add_func ("/socket-client/happy-eyeballs/cancellation", test_happy_eyeballs_cancel);
return g_test_run ();
} | 0 | [
"CWE-754"
] | glib | d553d92d6e9f53cbe5a34166fcb919ba652c6a8e | 51,749,024,232,509,160,000,000,000,000,000,000,000 | 9 | gsocketclient: Fix criticals
This ensures the parent GTask is kept alive as long as an enumeration
is running and trying to connect.
Closes #1646
Closes #1649 |
static void i40e_pci_error_resume(struct pci_dev *pdev)
{
struct i40e_pf *pf = pci_get_drvdata(pdev);
dev_dbg(&pdev->dev, "%s\n", __func__);
if (test_bit(__I40E_SUSPENDED, pf->state))
return;
i40e_handle_reset_warning(pf, false);
} | 0 | [
"CWE-400",
"CWE-401"
] | linux | 27d461333459d282ffa4a2bdb6b215a59d493a8f | 277,529,256,858,870,000,000,000,000,000,000,000,000 | 10 | i40e: prevent memory leak in i40e_setup_macvlans
In i40e_setup_macvlans if i40e_setup_channel fails the allocated memory
for ch should be released.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> |
static MngInfo *MngInfoFreeStruct(MngInfo *mng_info)
{
register ssize_t
i;
if (mng_info == (MngInfo *) NULL)
return((MngInfo *) NULL);
for (i=1; i < MNG_MAX_OBJECTS; i++)
MngInfoDiscardObject(mng_info,i);
if (mng_info->global_plte != (png_colorp) NULL)
mng_info->global_plte=(png_colorp)
... | 0 | [
"CWE-476"
] | ImageMagick | 816ecab6c532ae086ff4186b3eaf4aa7092d536f | 252,149,932,303,677,040,000,000,000,000,000,000,000 | 17 | https://github.com/ImageMagick/ImageMagick/issues/58 |
static int edge_calc_num_ports(struct usb_serial *serial,
struct usb_serial_endpoints *epds)
{
struct device *dev = &serial->interface->dev;
unsigned char num_ports = serial->type->num_ports;
/* Make sure we have the required endpoints when in download mode. */
if (serial->interface->cur_altsetting->desc.bNumE... | 0 | [
"CWE-369"
] | linux | 6aeb75e6adfaed16e58780309613a578fe1ee90b | 318,657,606,695,179,150,000,000,000,000,000,000,000 | 18 | USB: serial: io_ti: fix div-by-zero in set_termios
Fix a division-by-zero in set_termios when debugging is enabled and a
high-enough speed has been requested so that the divisor value becomes
zero.
Instead of just fixing the offending debug statement, cap the baud rate
at the base as a zero divisor value also appears... |
xmlBufferShrink(xmlBufferPtr buf, unsigned int len) {
if (buf == NULL) return(-1);
if (len == 0) return(0);
if (len > buf->use) return(-1);
buf->use -= len;
if ((buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) ||
((buf->alloc == XML_BUFFER_ALLOC_IO) && (buf->contentIO != NULL))) {
/*
* we just... | 0 | [
"CWE-190"
] | libxml2 | 6c283d83eccd940bcde15634ac8c7f100e3caefd | 95,660,936,943,638,900,000,000,000,000,000,000,000 | 34 | [CVE-2022-29824] Fix integer overflows in xmlBuf and xmlBuffer
In several places, the code handling string buffers didn't check for
integer overflow or used wrong types for buffer sizes. This could
result in out-of-bounds writes or other memory errors when working on
large, multi-gigabyte buffers.
Thanks to Felix Wil... |
static int sctp_v4_skb_iif(const struct sk_buff *skb)
{
return inet_iif(skb);
} | 0 | [
"CWE-119",
"CWE-787"
] | linux | 8e2d61e0aed2b7c4ecb35844fe07e0b2b762dee4 | 66,075,278,684,288,800,000,000,000,000,000,000,000 | 4 | sctp: fix race on protocol/netns initialization
Consider sctp module is unloaded and is being requested because an user
is creating a sctp socket.
During initialization, sctp will add the new protocol type and then
initialize pernet subsys:
status = sctp_v4_protosw_init();
if (status)
... |
int TABLE::fix_vcol_exprs(THD *thd)
{
for (Field **vf= vfield; vf && *vf; vf++)
if (fix_session_vcol_expr(thd, (*vf)->vcol_info))
return 1;
for (Field **df= default_field; df && *df; df++)
if ((*df)->default_value &&
fix_session_vcol_expr(thd, (*df)->default_value))
return 1;
for (Vi... | 1 | [
"CWE-416"
] | server | c02ebf3510850ba78a106be9974c94c3b97d8585 | 291,222,374,320,680,330,000,000,000,000,000,000,000 | 17 | MDEV-24176 Preparations
1. moved fix_vcol_exprs() call to open_table()
mysql_alter_table() doesn't do lock_tables() so it cannot win from
fix_vcol_exprs() from there. Tests affected: main.default_session
2. Vanilla cleanups and comments. |
if(epollfd < 0 && errno == ENOSYS)
# endif
{
DBGPRINTF("imptcp uses epoll_create()\n");
/* reading the docs, the number of epoll events passed to
* epoll_create() seems not to be used at all in kernels. So
* we just provide "a" number, happens to be 10.
*/
epollfd = epoll_create(10);
} | 0 | [
"CWE-190"
] | rsyslog | 0381a0de64a5a048c3d48b79055bd9848d0c7fc2 | 201,214,233,922,273,140,000,000,000,000,000,000,000 | 10 | imptcp: fix Segmentation Fault when octet count is to high |
onig2posix_error_code(int code)
{
static const O2PERR o2p[] = {
{ ONIG_MISMATCH, REG_NOMATCH },
{ ONIG_NO_SUPPORT_CONFIG, REG_EONIG_INTERNAL },
{ ONIGERR_MEMORY, REG_ESPACE },
{ ONIGERR_MATCH_STACK_LI... | 0 | [
"CWE-125"
] | oniguruma | 65a9b1aa03c9bc2dc01b074295b9603232cb3b78 | 180,305,197,950,815,900,000,000,000,000,000,000,000 | 76 | onig-5.9.2 |
compute_energy(struct task_struct *p, int dst_cpu, struct perf_domain *pd)
{
unsigned int max_util, util_cfs, cpu_util, cpu_cap;
unsigned long sum_util, energy = 0;
struct task_struct *tsk;
int cpu;
for (; pd; pd = pd->next) {
struct cpumask *pd_mask = perf_domain_span(pd);
/*
* The energy model mandates ... | 0 | [
"CWE-400",
"CWE-703"
] | linux | de53fd7aedb100f03e5d2231cfce0e4993282425 | 7,381,471,348,294,076,000,000,000,000,000,000,000 | 57 | sched/fair: Fix low cpu usage with high throttling by removing expiration of cpu-local slices
It has been observed, that highly-threaded, non-cpu-bound applications
running under cpu.cfs_quota_us constraints can hit a high percentage of
periods throttled while simultaneously not consuming the allocated
amount of quota... |
f_test_autochdir(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
#if defined(FEAT_AUTOCHDIR)
test_autochdir = TRUE;
#endif
} | 0 | [
"CWE-78"
] | vim | 8c62a08faf89663e5633dc5036cd8695c80f1075 | 38,632,903,561,891,030,000,000,000,000,000,000,000 | 6 | patch 8.1.0881: can execute shell commands in rvim through interfaces
Problem: Can execute shell commands in rvim through interfaces.
Solution: Disable using interfaces in restricted mode. Allow for writing
file with writefile(), histadd() and a few others. |
ecma_bigint_add_sub (ecma_value_t left_value, /**< left BigInt value */
ecma_value_t right_value, /**< right BigInt value */
bool is_add) /**< true if add operation should be performed */
{
JERRY_ASSERT (ecma_is_value_bigint (left_value) && ecma_is_value_bigint (right_value))... | 0 | [
"CWE-416"
] | jerryscript | 3bcd48f72d4af01d1304b754ef19fe1a02c96049 | 236,709,778,993,526,300,000,000,000,000,000,000,000 | 73 | Improve parse_identifier (#4691)
Ascii string length is no longer computed during string allocation.
JerryScript-DCO-1.0-Signed-off-by: Daniel Batiz batizjob@gmail.com |
ConnectClientToTcpAddrWithTimeout(unsigned int host, int port, unsigned int timeout)
{
rfbSocket sock;
struct sockaddr_in addr;
int one = 1;
addr.sin_family = AF_INET;
addr.sin_port = htons(port);
addr.sin_addr.s_addr = host;
sock = socket(AF_INET, SOCK_STREAM, 0);
if (sock == RFB_INVALID_SOCKET) {
#i... | 0 | [
"CWE-703",
"CWE-835"
] | libvncserver | 57433015f856cc12753378254ce4f1c78f5d9c7b | 205,873,676,897,792,940,000,000,000,000,000,000,000 | 42 | libvncclient: handle half-open TCP connections
When a connection is not reset properly at the TCP level (e.g. sudden
power loss or process crash) the TCP connection becomes half-open and
read() always returns -1 with errno = EAGAIN while select() always
returns 0. This leads to an infinite loop and can be fixed by clo... |
parse_device(dev_t *pdev, struct archive *a, char *val)
{
#define MAX_PACK_ARGS 3
unsigned long numbers[MAX_PACK_ARGS];
char *p, *dev;
int argc;
pack_t *pack;
dev_t result;
const char *error = NULL;
memset(pdev, 0, sizeof(*pdev));
if ((dev = strchr(val, ',')) != NULL) {
/*
* Device's major/minor are given... | 1 | [
"CWE-476",
"CWE-119"
] | libarchive | a550daeecf6bc689ade371349892ea17b5b97c77 | 338,341,661,334,186,700,000,000,000,000,000,000,000 | 55 | Fix libarchive/archive_read_support_format_mtree.c:1388:11: error: array subscript is above array bounds |
MemoryRegion *vga_init_io(VGACommonState *s, Object *obj,
const MemoryRegionPortio **vga_ports,
const MemoryRegionPortio **vbe_ports)
{
MemoryRegion *vga_mem;
*vga_ports = vga_portio_list;
*vbe_ports = vbe_portio_list;
vga_mem = g_malloc(sizeof(*vga_... | 0 | [
"CWE-200"
] | qemu | c1b886c45dc70f247300f549dce9833f3fa2def5 | 241,316,143,910,334,340,000,000,000,000,000,000,000 | 16 | vbe: rework sanity checks
Plug a bunch of holes in the bochs dispi interface parameter checking.
Add a function doing verification on all registers. Call that
unconditionally on every register write. That way we should catch
everything, even changing one register affecting the valid range of
another register.
Some ... |
dp_packet_size(const struct dp_packet *b)
{
return b->mbuf.pkt_len;
} | 0 | [
"CWE-400"
] | ovs | 79349cbab0b2a755140eedb91833ad2760520a83 | 69,115,694,704,401,630,000,000,000,000,000,000,000 | 4 | 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... |
sp_variable *LEX::sp_param_init(LEX_CSTRING *name)
{
if (spcont->find_variable(name, true))
{
my_error(ER_SP_DUP_PARAM, MYF(0), name->str);
return NULL;
}
sp_variable *spvar= spcont->add_variable(thd, name);
init_last_field(&spvar->field_def, name,
thd->variables.collation_database);... | 0 | [
"CWE-703"
] | server | 39feab3cd31b5414aa9b428eaba915c251ac34a2 | 276,338,735,705,203,000,000,000,000,000,000,000,000 | 12 | MDEV-26412 Server crash in Item_field::fix_outer_field for INSERT SELECT
IF an INSERT/REPLACE SELECT statement contained an ON expression in the top
level select and this expression used a subquery with a column reference
that could not be resolved then an attempt to resolve this reference as
an outer reference caused... |
bool LEX::stmt_execute(const Lex_ident_sys_st &ident, List<Item> *params)
{
sql_command= SQLCOM_EXECUTE;
prepared_stmt.set(ident, NULL, params);
return stmt_prepare_validate("EXECUTE..USING");
} | 0 | [
"CWE-703"
] | server | 39feab3cd31b5414aa9b428eaba915c251ac34a2 | 22,680,583,703,445,467,000,000,000,000,000,000,000 | 6 | MDEV-26412 Server crash in Item_field::fix_outer_field for INSERT SELECT
IF an INSERT/REPLACE SELECT statement contained an ON expression in the top
level select and this expression used a subquery with a column reference
that could not be resolved then an attempt to resolve this reference as
an outer reference caused... |
GF_Err vmhd_Write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
GF_VideoMediaHeaderBox *ptr = (GF_VideoMediaHeaderBox *)s;
e = gf_isom_full_box_write(s, bs);
if (e) return e;
gf_bs_write_u64(bs, ptr->reserved);
return GF_OK;
} | 0 | [
"CWE-125"
] | gpac | bceb03fd2be95097a7b409ea59914f332fb6bc86 | 184,637,246,758,701,400,000,000,000,000,000,000,000 | 10 | fixed 2 possible heap overflows (inc. #1088) |
Client::sentRequestBody(const CommIoCbParams &io)
{
debugs(11, 5, "sentRequestBody: FD " << io.fd << ": size " << io.size << ": errflag " << io.flag << ".");
debugs(32,3,HERE << "sentRequestBody called");
requestSender = NULL;
if (io.size > 0) {
fd_bytes(io.fd, io.size, FD_WRITE);
stat... | 0 | [
"CWE-20"
] | squid | 1e05a85bd28c22c9ca5d3ac9f5e86d6269ec0a8c | 209,120,136,158,985,620,000,000,000,000,000,000,000 | 46 | Handle more partial responses (#791) |
radix__hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
unsigned long len, unsigned long pgoff,
unsigned long flags)
{
struct mm_struct *mm = current->mm;
struct vm_area_struct *vma;
struct hstate *h = hstate_file(file);
struct vm_unmapped_area_info info;
if (unlikely(addr > mm->context.ad... | 1 | [
"CWE-119"
] | linux | 1be7107fbe18eed3e319a6c3e83c78254b693acb | 241,306,794,657,289,400,000,000,000,000,000,000,000 | 46 | mm: larger stack guard gap, between vmas
Stack guard page is a useful feature to reduce a risk of stack smashing
into a different mapping. We have been using a single page gap which
is sufficient to prevent having stack adjacent to a different mapping.
But this seems to be insufficient in the light of the stack usage ... |
static void ext2_xattr_rehash(struct ext2_xattr_header *header,
struct ext2_xattr_entry *entry)
{
struct ext2_xattr_entry *here;
__u32 hash = 0;
ext2_xattr_hash_entry(header, entry);
here = ENTRY(header+1);
while (!IS_LAST_ENTRY(here)) {
if (!here->e_hash) {
/* Block is not shared if an entry's has... | 0 | [
"CWE-241",
"CWE-19"
] | linux | be0726d33cb8f411945884664924bed3cb8c70ee | 181,304,242,134,108,000,000,000,000,000,000,000,000 | 21 | ext2: convert to mbcache2
The conversion is generally straightforward. We convert filesystem from
a global cache to per-fs one. Similarly to ext4 the tricky part is that
xattr block corresponding to found mbcache entry can get freed before we
get buffer lock for that block. So we have to check whether the entry is
sti... |
void CWebServer::Cmd_SystemReboot(WebEmSession & session, const request& req, Json::Value &root)
{
if (session.rights != 2)
{
session.reply_status = reply::forbidden;
return; //Only admin user allowed
}
#ifdef WIN32
int ret = system("shutdown -r -f -t 1 -d up:125:1");
#else
int ret = system("... | 0 | [
"CWE-89"
] | domoticz | ee70db46f81afa582c96b887b73bcd2a86feda00 | 156,360,856,354,366,340,000,000,000,000,000,000,000 | 20 | Fixed possible SQL Injection Vulnerability (Thanks to Fabio Carretto!) |
static unsigned char *get_params(unsigned char *p, int *param, int *len)
{
int n;
*len = 0;
while (*p != '\0') {
while (*p == ' ' || *p == '\t') {
p++;
}
if (isdigit(*p)) {
for (n = 0; isdigit(*p); p++) {
n = n * 10 + (*p - '0');
}... | 0 | [
"CWE-399",
"CWE-119"
] | ImageMagick | eedd0c35bb2d8af7aa05f215689fdebd11633fa1 | 157,558,428,896,910,800,000,000,000,000,000,000,000 | 32 | Prevent buffer overflow in SIXEL, PDB, MAP, and CALS coders (bug report from Donghai Zhu) |
static void f3(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
int *ok = (int *) fn_data;
// LOG(LL_INFO, ("%d", ev));
if (ev == MG_EV_CONNECT) {
// c->is_hexdumping = 1;
mg_printf(c, "GET / HTTP/1.0\r\nHost: %s\r\n\r\n",
c->peer.is_ip6 ? "ipv6.google.com" : "cesanta.com");
... | 0 | [
"CWE-552"
] | mongoose | c65c8fdaaa257e0487ab0aaae9e8f6b439335945 | 115,032,596,977,364,680,000,000,000,000,000,000,000 | 19 | Protect against the directory traversal in mg_upload() |
static void sco_skb_put_cmsg(struct sk_buff *skb, struct msghdr *msg,
struct sock *sk)
{
if (sco_pi(sk)->cmsg_mask & SCO_CMSG_PKT_STATUS)
put_cmsg(msg, SOL_BLUETOOTH, BT_SCM_PKT_STATUS,
sizeof(bt_cb(skb)->sco.pkt_status),
&bt_cb(skb)->sco.pkt_status);
} | 0 | [] | linux | f6b8c6b5543983e9de29dc14716bfa4eb3f157c4 | 225,527,747,106,409,500,000,000,000,000,000,000,000 | 8 | Bluetooth: sco: Fix crash when using BT_SNDMTU/BT_RCVMTU option
This commit add the invalid check for connected socket, without it will
causes the following crash due to sco_pi(sk)->conn being NULL:
KASAN: null-ptr-deref in range [0x0000000000000050-0x0000000000000057]
CPU: 3 PID: 4284 Comm: test_sco Not tainted 5.10... |
static inline void ide_abort_command(IDEState *s)
{
ide_transfer_stop(s);
s->status = READY_STAT | ERR_STAT;
s->error = ABRT_ERR;
} | 0 | [
"CWE-399"
] | qemu | 3251bdcf1c67427d964517053c3d185b46e618e8 | 104,883,885,242,131,400,000,000,000,000,000,000,000 | 6 | ide: Correct handling of malformed/short PRDTs
This impacts both BMDMA and AHCI HBA interfaces for IDE.
Currently, we confuse the difference between a PRDT having
"0 bytes" and a PRDT having "0 complete sectors."
When we receive an incomplete sector, inconsistent error checking
leads to an infinite loop wherein the c... |
flatpak_save_override_keyfile (GKeyFile *metakey,
const char *app_id,
gboolean user,
GError **error)
{
g_autoptr(GFile) base_dir = NULL;
g_autoptr(GFile) override_dir = NULL;
g_autoptr(GFile) file = NULL;
g_auto... | 0 | [
"CWE-668"
] | flatpak | cd2142888fc4c199723a0dfca1f15ea8788a5483 | 202,040,079,617,642,950,000,000,000,000,000,000,000 | 33 | Don't expose /proc when running apply_extra
As shown by CVE-2019-5736, it is sometimes possible for the sandbox
app to access outside files using /proc/self/exe. This is not
typically an issue for flatpak as the sandbox runs as the user which
has no permissions to e.g. modify the host files.
However, when installing ... |
sec_establish_key(void)
{
uint32 length = g_server_public_key_len + SEC_PADDING_SIZE;
uint32 flags = SEC_EXCHANGE_PKT;
STREAM s;
s = sec_init(flags, length + 4);
out_uint32_le(s, length);
out_uint8p(s, g_sec_crypted_random, g_server_public_key_len);
out_uint8s(s, SEC_PADDING_SIZE);
s_mark_end(s);
sec_send(s... | 0 | [
"CWE-119",
"CWE-125",
"CWE-703",
"CWE-787"
] | rdesktop | 4dca546d04321a610c1835010b5dad85163b65e1 | 98,374,837,213,370,420,000,000,000,000,000,000,000 | 15 | 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 ... |
d2s_clip_array (const double *src, int count, short *dest, double scale)
{ while (--count >= 0)
{ double tmp = scale * src [count] ;
if (CPU_CLIPS_POSITIVE == 0 && tmp > 32767.0)
dest [count] = SHRT_MAX ;
else if (CPU_CLIPS_NEGATIVE == 0 && tmp < -32768.0)
dest [count] = SHRT_MIN ;
else
dest [count] = ... | 0 | [
"CWE-369"
] | libsndfile | 85c877d5072866aadbe8ed0c3e0590fbb5e16788 | 22,499,077,447,043,435,000,000,000,000,000,000,000 | 12 | double64_init: Check psf->sf.channels against upper bound
This prevents division by zero later in the code.
While the trivial case to catch this (i.e. sf.channels < 1) has already
been covered, a crafted file may report a number of channels that is
so high (i.e. > INT_MAX/sizeof(double)) that it "somehow" gets
miscal... |
nfsd4_encode_readdir(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_readdir *readdir)
{
int maxcount;
int bytes_left;
loff_t offset;
__be64 wire_offset;
struct xdr_stream *xdr = &resp->xdr;
int starting_len = xdr->buf->len;
__be32 *p;
if (nfserr)
return nfserr;
p = xdr_reserve_space(xdr, NFS4_... | 0 | [
"CWE-20",
"CWE-129"
] | linux | f961e3f2acae94b727380c0b74e2d3954d0edf79 | 236,006,352,750,615,500,000,000,000,000,000,000,000 | 91 | nfsd: encoders mustn't use unitialized values in error cases
In error cases, lgp->lg_layout_type may be out of bounds; so we
shouldn't be using it until after the check of nfserr.
This was seen to crash nfsd threads when the server receives a LAYOUTGET
request with a large layout type.
GETDEVICEINFO has the same pro... |
static bool is_inf(const long double val) {
#ifdef isinf
return (bool)isinf(val);
#else
return !is_nan(val) && (val<cimg::type<half>::min() || val>cimg::type<half>::max());
#endif
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 110,500,332,030,821,030,000,000,000,000,000,000,000 | 7 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
BOOL update_write_cache_bitmap_v2_order(wStream* s, CACHE_BITMAP_V2_ORDER* cache_bitmap_v2,
BOOL compressed, UINT16* flags)
{
BYTE bitsPerPixelId;
if (!Stream_EnsureRemainingCapacity(
s, update_approximate_cache_bitmap_v2_order(cache_bitmap_v2, compressed, flags)))
... | 1 | [
"CWE-125"
] | FreeRDP | b8beb55913471952f92770c90c372139d78c16c0 | 162,081,631,190,877,050,000,000,000,000,000,000,000 | 68 | Fixed OOB read in update_read_cache_bitmap_v3_order
CVE-2020-11096 thanks @antonio-morales for finding this. |
static long usbdev_do_ioctl(struct file *file, unsigned int cmd,
void __user *p)
{
struct usb_dev_state *ps = file->private_data;
struct inode *inode = file_inode(file);
struct usb_device *dev = ps->dev;
int ret = -ENOTTY;
if (!(file->f_mode & FMODE_WRITE))
return -EPERM;
usb_lock_device(dev);
/* Reap o... | 0 | [
"CWE-200"
] | linux | 681fef8380eb818c0b845fca5d2ab1dcbab114ee | 260,129,296,747,565,380,000,000,000,000,000,000,000 | 194 | USB: usbfs: fix potential infoleak in devio
The stack object “ci” has a total size of 8 bytes. Its last 3 bytes
are padding bytes which are not initialized and leaked to userland
via “copy_to_user”.
Signed-off-by: Kangjie Lu <kjlu@gatech.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
respip_inform_super(struct module_qstate* qstate, int id,
struct module_qstate* super)
{
struct respip_qstate* rq = (struct respip_qstate*)super->minfo[id];
struct reply_info* new_rep = NULL;
rq->state = RESPIP_SUBQUERY_FINISHED;
/* respip subquery should have always been created with a valid reply
* in super.... | 0 | [
"CWE-190"
] | unbound | 02080f6b180232f43b77f403d0c038e9360a460f | 313,190,841,660,354,060,000,000,000,000,000,000,000 | 32 | - Fix Integer Overflows in Size Calculations,
reported by X41 D-Sec. |
void Field::hash(ulong *nr, ulong *nr2)
{
if (is_null())
{
*nr^= (*nr << 1) | 1;
}
else
{
uint len= pack_length();
CHARSET_INFO *cs= sort_charset();
cs->coll->hash_sort(cs, ptr, len, nr, nr2);
}
} | 0 | [
"CWE-416",
"CWE-703"
] | server | 08c7ab404f69d9c4ca6ca7a9cf7eec74c804f917 | 247,304,641,605,944,020,000,000,000,000,000,000,000 | 13 | MDEV-24176 Server crashes after insert in the table with virtual
column generated using date_format() and if()
vcol_info->expr is allocated on expr_arena at parsing stage. Since
expr item is allocated on expr_arena all its containee items must be
allocated on expr_arena too. Otherwise fix_session_expr() will
encounter... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.