func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
static int add_ref_tag(const char *path, const struct object_id *oid, int flag, void *cb_data)
{
struct object_id peeled;
if (starts_with(path, "refs/tags/") && /* is a tag? */
!peel_ref(path, peeled.hash) && /* peelable? */
packlist_find(&to_pack, peeled.hash, NULL)) /* object packed? */
add_obj... | 0 | [
"CWE-119",
"CWE-787"
] | git | de1e67d0703894cb6ea782e36abb63976ab07e60 | 16,362,567,786,896,416,000,000,000,000,000,000,000 | 10 | list-objects: pass full pathname to callbacks
When we find a blob at "a/b/c", we currently pass this to
our show_object_fn callbacks as two components: "a/b/" and
"c". Callbacks which want the full value then call
path_name(), which concatenates the two. But this is an
inefficient interface; the path is a strbuf, and ... |
void Image::setXmpPacket(const std::string& xmpPacket)
{
xmpPacket_ = xmpPacket;
if ( XmpParser::decode(xmpData_, xmpPacket) ) {
throw Error(54);
}
xmpPacket_ = xmpPacket;
} | 0 | [
"CWE-125"
] | exiv2 | 6e3855aed7ba8bb4731fc4087ca7f9078b2f3d97 | 52,570,579,740,807,750,000,000,000,000,000,000,000 | 8 | Fix https://github.com/Exiv2/exiv2/issues/55 |
static int compat_calc_entry(const struct ip6t_entry *e,
const struct xt_table_info *info,
const void *base, struct xt_table_info *newinfo)
{
const struct xt_entry_match *ematch;
const struct xt_entry_target *t;
unsigned int entry_offset;
int off, i, ret;
off = sizeof(struct ip6t_entry) - sizeof(s... | 0 | [
"CWE-200"
] | linux-2.6 | 6a8ab060779779de8aea92ce3337ca348f973f54 | 6,700,385,365,954,422,000,000,000,000,000,000,000 | 30 | ipv6: netfilter: ip6_tables: fix infoleak to userspace
Structures ip6t_replace, compat_ip6t_replace, and xt_get_revision are
copied from userspace. Fields of these structs that are
zero-terminated strings are not checked. When they are used as argument
to a format string containing "%s" in request_module(), some sen... |
static inline void GetMedianPixelList(PixelList *pixel_list,Quantum *pixel)
{
SkipList
*p;
size_t
color;
ssize_t
count;
/*
Find the median value for each of the color.
*/
p=(&pixel_list->skip_list);
color=65536L;
count=0;
do
{
color=p->nodes[color].next[0];
count+=p->nodes... | 0 | [] | ImageMagick | 4717744e4bb27de8ea978e51c6d5bcddf62ffe49 | 58,793,338,744,979,490,000,000,000,000,000,000,000 | 24 | https://github.com/ImageMagick/ImageMagick/issues/3332 |
rsvg_new_tspan (void)
{
RsvgNodeText *text;
text = g_new (RsvgNodeText, 1);
_rsvg_node_init (&text->super);
text->super.set_atts = _rsvg_node_tspan_set_atts;
text->x.factor = text->y.factor = 'n';
text->dx = text->dy = _rsvg_css_parse_length ("0");
return &text->super;
} | 1 | [] | librsvg | 34c95743ca692ea0e44778e41a7c0a129363de84 | 221,899,792,358,375,260,000,000,000,000,000,000,000 | 10 | Store node type separately in RsvgNode
The node name (formerly RsvgNode:type) cannot be used to infer
the sub-type of RsvgNode that we're dealing with, since for unknown
elements we put type = node-name. This lead to a (potentially exploitable)
crash e.g. when the element name started with "fe" which tricked
the old c... |
CImg<T> get_sort(const bool is_increasing=true, const char axis=0) const {
return (+*this).sort(is_increasing,axis);
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 125,894,168,278,033,450,000,000,000,000,000,000,000 | 3 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
SpoolssGetPrinterDriverDirectory_r(tvbuff_t *tvb, int offset,
packet_info *pinfo, proto_tree *tree,
dcerpc_info *di, guint8 *drep)
{
/* Parse packet */
offset = dissect_spoolss_string_parm(
tvb, offset, pinfo, tree, di, drep, "Directory");
offset = dissect_ndr_uint32(
tvb, offset, pinfo, tr... | 0 | [
"CWE-399"
] | wireshark | b4d16b4495b732888e12baf5b8a7e9bf2665e22b | 331,298,414,390,690,800,000,000,000,000,000,000,000 | 17 | SPOOLSS: Try to avoid an infinite loop.
Use tvb_reported_length_remaining in dissect_spoolss_uint16uni. Make
sure our offset always increments in dissect_spoolss_keybuffer.
Change-Id: I7017c9685bb2fa27161d80a03b8fca4ef630e793
Reviewed-on: https://code.wireshark.org/review/14687
Reviewed-by: Gerald Combs <gerald@wires... |
int __sk_mem_raise_allocated(struct sock *sk, int size, int amt, int kind)
{
struct proto *prot = sk->sk_prot;
long allocated = sk_memory_allocated_add(sk, amt);
if (mem_cgroup_sockets_enabled && sk->sk_memcg &&
!mem_cgroup_charge_skmem(sk->sk_memcg, amt))
goto suppress_allocation;
/* Under limit. */
if (... | 0 | [
"CWE-704"
] | linux | 9d538fa60bad4f7b23193c89e843797a1cf71ef3 | 301,967,493,800,424,100,000,000,000,000,000,000,000 | 71 | net: Set sk_prot_creator when cloning sockets to the right proto
sk->sk_prot and sk->sk_prot_creator can differ when the app uses
IPV6_ADDRFORM (transforming an IPv6-socket to an IPv4-one).
Which is why sk_prot_creator is there to make sure that sk_prot_free()
does the kmem_cache_free() on the right kmem_cache slab.
... |
bool agg_arg_charsets_for_string_result(DTCollation &c,
Item **items, uint nitems,
int item_sep= 1)
{
uint flags= MY_COLL_ALLOW_SUPERSET_CONV |
MY_COLL_ALLOW_COERCIBLE_CONV |
MY_COLL_ALLOW_NUMERIC... | 0 | [
"CWE-617"
] | server | 2e7891080667c59ac80f788eef4d59d447595772 | 229,454,471,091,480,400,000,000,000,000,000,000,000 | 9 | 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.... |
get_pppoe_secrets_cb (GtkDialog *dialog,
gint response,
gpointer user_data)
{
NMPppoeInfo *info = (NMPppoeInfo *) user_data;
NMAGConfConnection *gconf_connection;
NMSetting *setting;
GHashTable *settings_hash;
GHashTable *secrets;
GError *err = NULL;
/* Got a user response, clear the NMActiveConne... | 0 | [
"CWE-310"
] | network-manager-applet | 4020594dfbf566f1852f0acb36ad631a9e73a82b | 256,179,064,618,594,950,000,000,000,000,000,000,000 | 62 | core: fix CA cert mishandling after cert file deletion (deb #560067) (rh #546793)
If a connection was created with a CA certificate, but the user later
moved or deleted that CA certificate, the applet would simply provide the
connection to NetworkManager without any CA certificate. This could cause
NM to connect to t... |
dealloc_globals_chain(Dwarf_Debug dbg,
Dwarf_Chain head_chain)
{
Dwarf_Chain curr_chain = 0;
int chaintype = DW_DLA_CHAIN;
Dwarf_Global_Context lastcontext = 0;
Dwarf_Global_Context curcontext = 0;
curr_chain = head_chain;
for (; curr_chain; ) {
Dwarf_Global item = 0;
int it... | 0 | [
"CWE-703",
"CWE-125"
] | libdwarf-code | 8151575a6ace77d005ca5bb5d71c1bfdba3f7069 | 213,430,880,560,430,900,000,000,000,000,000,000,000 | 29 | Fixes vulnerability DW202205-001
Reports error instead of crashing the when reading
a specially crafted (corrupted) .debug_pubnames
or .debug_pubtypes section.
modified: src/lib/libdwarf/dwarf_global.c |
int MkvReader::Open(const char* fileName) {
if (fileName == NULL)
return -1;
if (m_file)
return -1;
#ifdef _MSC_VER
const errno_t e = fopen_s(&m_file, fileName, "rb");
if (e)
return -1; // error
#else
m_file = fopen(fileName, "rb");
if (m_file == NULL)
return -1;
#endif
return !GetFil... | 0 | [
"CWE-20"
] | libvpx | f00890eecdf8365ea125ac16769a83aa6b68792d | 73,630,674,406,445,990,000,000,000,000,000,000,000 | 20 | update libwebm to libwebm-1.0.0.27-352-g6ab9fcf
https://chromium.googlesource.com/webm/libwebm/+log/af81f26..6ab9fcf
Change-Id: I9d56e1fbaba9b96404b4fbabefddc1a85b79c25d |
static struct hash_cell *__get_dev_cell(uint64_t dev)
{
struct mapped_device *md;
struct hash_cell *hc;
md = dm_get_md(huge_decode_dev(dev));
if (!md)
return NULL;
hc = dm_get_mdptr(md);
if (!hc) {
dm_put(md);
return NULL;
}
return hc;
} | 0 | [
"CWE-787"
] | linux | 4edbe1d7bcffcd6269f3b5eb63f710393ff2ec7a | 172,287,720,137,078,230,000,000,000,000,000,000,000 | 17 | dm ioctl: fix out of bounds array access when no devices
If there are not any dm devices, we need to zero the "dev" argument in
the first structure dm_name_list. However, this can cause out of
bounds write, because the "needed" variable is zero and len may be
less than eight.
Fix this bug by reporting DM_BUFFER_FULL_... |
static enum hrtimer_restart apic_timer_fn(struct hrtimer *data)
{
struct kvm_timer *ktimer = container_of(data, struct kvm_timer, timer);
struct kvm_lapic *apic = container_of(ktimer, struct kvm_lapic, lapic_timer);
apic_timer_expired(apic, true);
if (lapic_is_periodic(apic)) {
advance_periodic_target_expiratio... | 0 | [
"CWE-703",
"CWE-459"
] | linux | f7d8a19f9a056a05c5c509fa65af472a322abfee | 317,530,261,493,345,470,000,000,000,000,000,000,000 | 14 | Revert "KVM: x86: Open code necessary bits of kvm_lapic_set_base() at vCPU RESET"
Revert a change to open code bits of kvm_lapic_set_base() when emulating
APIC RESET to fix an apic_hw_disabled underflow bug due to arch.apic_base
and apic_hw_disabled being unsyncrhonized when the APIC is created. If
kvm_arch_vcpu_crea... |
static size_t consume_locals (ut8 *buf, ut8 *max, ut32 count, RBinWasmCodeEntry *out, ut32 *offset) {
ut32 i = 0, j = 0;
if (count < 1) return 0;
// memory leak
if (!(out->locals = (struct r_bin_wasm_local_entry_t*) malloc (sizeof(struct r_bin_wasm_local_entry_t) * count))) {
return 0;
}
while (buf + i < max &&... | 0 | [
"CWE-125",
"CWE-787"
] | radare2 | d2632f6483a3ceb5d8e0a5fb11142c51c43978b4 | 297,908,742,573,299,630,000,000,000,000,000,000,000 | 22 | Fix crash in fuzzed wasm r2_hoobr_consume_init_expr |
static struct sctp_chunk *_sctp_make_chunk(const struct sctp_association *asoc,
__u8 type, __u8 flags, int paylen,
gfp_t gfp)
{
struct sctp_chunkhdr *chunk_hdr;
struct sctp_chunk *retval;
struct sk_buff *skb;
struct sock *sk;
/* No need to allocate LL here, as this is only a chunk. */
skb = alloc... | 1 | [
"CWE-20"
] | linux | 07f2c7ab6f8d0a7e7c5764c4e6cc9c52951b9d9c | 163,681,971,447,059,550,000,000,000,000,000,000,000 | 38 | sctp: verify size of a new chunk in _sctp_make_chunk()
When SCTP makes INIT or INIT_ACK packet the total chunk length
can exceed SCTP_MAX_CHUNK_LEN which leads to kernel panic when
transmitting these packets, e.g. the crash on sending INIT_ACK:
[ 597.804948] skbuff: skb_over_panic: text:00000000ffae06e4 len:120168
... |
int64 TotalByteSize() { return total_byte_size_; } | 0 | [
"CWE-476",
"CWE-703"
] | tensorflow | 6972f9dfe325636b3db4e0bc517ee22a159365c0 | 242,166,292,917,003,080,000,000,000,000,000,000,000 | 1 | Add missing valuidation to FusedBatchNorm.
PiperOrigin-RevId: 372460336
Change-Id: Ic8c4e4de67c58a741bd87f2e182bed07247d1126 |
rsvg_filter_primitive_composite_render (RsvgNode *node, RsvgFilterPrimitive *primitive, RsvgFilterContext *ctx)
{
RsvgFilterPrimitiveComposite *composite = (RsvgFilterPrimitiveComposite *) primitive;
RsvgIRect boundarys;
cairo_surface_t *output, *in, *in2;
boundarys = rsvg_filter_primitive_get_bounds (... | 0 | [
"CWE-369"
] | librsvg | ecf9267a24b2c3c0cd211dbdfa9ef2232511972a | 24,144,666,641,311,840,000,000,000,000,000,000,000 | 101 | bgo#783835 - Don't divide by zero in box_blur_line() for gaussian blurs
We were making the decision to use box blurs, instead of a true
Gaussian kernel, based on the size of *both* x and y dimensions. Do
them individually instead. |
int send_xattr(int f, stat_x *sxp)
{
int ndx = find_matching_xattr(sxp->xattr);
/* Send 0 (-1 + 1) to indicate that literal xattr data follows. */
write_varint(f, ndx + 1);
if (ndx < 0) {
rsync_xa *rxa;
int count = sxp->xattr->count;
write_varint(f, count);
for (rxa = sxp->xattr->items; count--; rxa++) {
... | 0 | [
"CWE-125"
] | rsync | 47a63d90e71d3e19e0e96052bb8c6b9cb140ecc1 | 42,874,231,256,516,790,000,000,000,000,000,000,000 | 48 | Enforce trailing \0 when receiving xattr name values.
Fixes bug 13112. |
static int check_purpose_ssl_client(const X509_PURPOSE *xp, const X509 *x, int ca)
{
if(xku_reject(x,XKU_SSL_CLIENT)) return 0;
if(ca) return check_ssl_ca(x);
/* We need to do digital signatures or key agreement */
if(ku_reject(x,KU_DIGITAL_SIGNATURE|KU_KEY_AGREEMENT)) return 0;
/* nsCertType if present should all... | 0 | [] | openssl | d65b8b2162f33ac0d53dace588a0847ed827626c | 113,243,185,665,258,520,000,000,000,000,000,000,000 | 10 | Backport OCSP fixes. |
JSObject *create(JSContext *cx, HandleObject requestInstance, HandleValue input,
HandleValue init_val) {
RequestHandle request_handle = {INVALID_HANDLE};
if (!HANDLE_RESULT(cx, xqd_req_new(&request_handle))) {
return nullptr;
}
BodyHandle body_handle = {INVALID_HANDLE};
if (!HANDLE_RESUL... | 0 | [
"CWE-94"
] | js-compute-runtime | 65524ffc962644e9fc39f4b368a326b6253912a9 | 201,647,612,050,397,500,000,000,000,000,000,000,000 | 445 | use rangom_get instead of arc4random as arc4random does not work correctly with wizer
wizer causes the seed in arc4random to be the same between executions which is not random |
struct razer_report razer_chroma_extended_matrix_get_brightness(unsigned char variable_storage, unsigned char led_id)
{
struct razer_report report = get_razer_report(0x0F, 0x84, 0x03);
report.transaction_id.id = 0x3F;
report.arguments[0] = variable_storage;
report.arguments[1] = led_id;
return rep... | 0 | [
"CWE-787"
] | openrazer | 7e8a04feb378a679f1bcdcae079a5100cc45663b | 87,409,541,586,449,740,000,000,000,000,000,000,000 | 10 | Fix oob memcpy in matrix_custom_frame methods
Adjust row_length if it exeeds the arguments array |
static longT _distance_dist_edt(const longT x, const longT i, const longT *const g) {
return (x - i)*(x - i) + g[i]; | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 2,325,269,488,231,348,800,000,000,000,000,000,000 | 3 | Fix other issues in 'CImg<T>::load_bmp()'. |
xfs_attr_rmtval_get(
struct xfs_da_args *args)
{
struct xfs_bmbt_irec map[ATTR_RMTVALUE_MAPSIZE];
struct xfs_mount *mp = args->dp->i_mount;
struct xfs_buf *bp;
xfs_dablk_t lblkno = args->rmtblkno;
__uint8_t *dst = args->value;
int valuelen = args->valuelen;
int nmap;
int error;
int blkcnt = args->r... | 1 | [
"CWE-241",
"CWE-19"
] | linux | 8275cdd0e7ac550dcce2b3ef6d2fb3b808c1ae59 | 243,798,225,644,280,060,000,000,000,000,000,000,000 | 57 | xfs: remote attribute overwrite causes transaction overrun
Commit e461fcb ("xfs: remote attribute lookups require the value
length") passes the remote attribute length in the xfs_da_args
structure on lookup so that CRC calculations and validity checking
can be performed correctly by related code. This, unfortunately h... |
static int usbredir_put_packet_id_q(QEMUFile *f, void *priv, size_t unused,
const VMStateField *field,
JSONWriter *vmdesc)
{
struct PacketIdQueue *q = priv;
USBRedirDevice *dev = q->dev;
struct PacketIdQueueEntry *e;
int remain = q-... | 0 | [
"CWE-770"
] | qemu | 7ec54f9eb62b5d177e30eb8b1cad795a5f8d8986 | 315,772,254,474,601,920,000,000,000,000,000,000,000 | 19 | usb/redir: avoid dynamic stack allocation (CVE-2021-3527)
Use autofree heap allocation instead.
Fixes: 4f4321c11ff ("usb: use iovecs in USBPacket")
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id:... |
g_socket_client_set_proxy_resolver (GSocketClient *client,
GProxyResolver *proxy_resolver)
{
/* We have to be careful to avoid calling
* g_proxy_resolver_get_default() until we're sure we need it,
* because trying to load the default proxy resolver module will
* break som... | 0 | [
"CWE-754"
] | glib | d553d92d6e9f53cbe5a34166fcb919ba652c6a8e | 116,114,293,117,843,800,000,000,000,000,000,000,000 | 18 | 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 |
send_status(u_int32_t id, u_int32_t status)
{
struct sshbuf *msg;
int r;
debug3("request %u: sent status %u", id, status);
if (log_level > SYSLOG_LEVEL_VERBOSE ||
(status != SSH2_FX_OK && status != SSH2_FX_EOF))
logit("sent status %s", status_to_message(status));
if ((msg = sshbuf_new()) == NULL)
fatal("... | 0 | [
"CWE-732",
"CWE-703",
"CWE-269"
] | src | a6981567e8e215acc1ef690c8dbb30f2d9b00a19 | 267,654,041,104,374,650,000,000,000,000,000,000,000 | 24 | disallow creation (of empty files) in read-only mode; reported by
Michal Zalewski, feedback & ok deraadt@ |
static av_cold int che_configure(AACContext *ac,
enum ChannelPosition che_pos,
int type, int id, int *channels)
{
if (*channels >= MAX_CHANNELS)
return AVERROR_INVALIDDATA;
if (che_pos) {
if (!ac->che[type][id]) {
if (... | 0 | [
"CWE-703"
] | FFmpeg | 6e42ccb9dbc13836cd52cda594f819d17af9afa2 | 299,204,491,859,367,850,000,000,000,000,000,000,000 | 30 | avcodec/aacdec: Fix pulse position checks in decode_pulses()
Fixes out of array read
Fixes: asan_static-oob_1efed25_1887_cov_2013541199_HeyYa_RA10_AAC_192K_30s.rm
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> |
static int kvaser_usb_leaf_get_software_info_inner(struct kvaser_usb *dev)
{
struct kvaser_cmd cmd;
int err;
err = kvaser_usb_leaf_send_simple_cmd(dev, CMD_GET_SOFTWARE_INFO, 0);
if (err)
return err;
err = kvaser_usb_leaf_wait_cmd(dev, CMD_GET_SOFTWARE_INFO_REPLY, &cmd);
if (err)
return err;
switch (dev->... | 0 | [
"CWE-200",
"CWE-908"
] | linux | da2311a6385c3b499da2ed5d9be59ce331fa93e9 | 304,052,538,409,621,700,000,000,000,000,000,000,000 | 28 | can: kvaser_usb: kvaser_usb_leaf: Fix some info-leaks to USB devices
Uninitialized Kernel memory can leak to USB devices.
Fix this by using kzalloc() instead of kmalloc().
Signed-off-by: Xiaolong Huang <butterflyhuangxx@gmail.com>
Fixes: 7259124eac7d ("can: kvaser_usb: Split driver into kvaser_usb_core.c and kvaser_... |
xmlFreeParserInputBuffer(xmlParserInputBufferPtr in) {
if (in == NULL) return;
if (in->raw) {
xmlBufFree(in->raw);
in->raw = NULL;
}
if (in->encoder != NULL) {
xmlCharEncCloseFunc(in->encoder);
}
if (in->closecallback != NULL) {
in->closecallback(in->context);
}
if (in... | 0 | [
"CWE-134"
] | libxml2 | 4472c3a5a5b516aaf59b89be602fbce52756c3e9 | 192,108,261,236,101,460,000,000,000,000,000,000,000 | 20 | Fix some format string warnings with possible format string vulnerability
For https://bugzilla.gnome.org/show_bug.cgi?id=761029
Decorate every method in libxml2 with the appropriate
LIBXML_ATTR_FORMAT(fmt,args) macro and add some cleanups
following the reports. |
void AddReplyFromClient(client *dst, client *src) {
/* If the source client contains a partial response due to client output
* buffer limits, propagate that to the dest rather than copy a partial
* reply. We don't wanna run the risk of copying partial response in case
* for some reason the output lim... | 0 | [
"CWE-770"
] | redis | 5674b0057ff2903d43eaff802017eddf37c360f8 | 66,728,797,670,434,840,000,000,000,000,000,000,000 | 36 | 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... |
static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC)... | 0 | [] | php-src | ce96fd6b0761d98353761bf78d5bfb55291179fd | 142,791,140,839,811,780,000,000,000,000,000,000,000 | 30 | - fix #39863, do not accept paths with NULL in them. See http://news.php.net/php.internals/50191, trunk will have the patch later (adding a macro and/or changing (some) APIs. Patch by Rasmus |
void CLASS sony_arw_load_raw()
{
ushort huff[32768];
static const ushort tab[18] =
{ 0xf11,0xf10,0xe0f,0xd0e,0xc0d,0xb0c,0xa0b,0x90a,0x809,
0x708,0x607,0x506,0x405,0x304,0x303,0x300,0x202,0x201 };
int i, c, n, col, row, len, diff, sum=0;
for (n=i=0; i < 18; i++)
FORC(32768 >> (tab[i] >> 8)) huff[n++]... | 0 | [
"CWE-703"
] | LibRaw | 11909cc59e712e09b508dda729b99aeaac2b29ad | 330,593,011,841,766,850,000,000,000,000,000,000,000 | 49 | cumulated data checks patch |
dvi_document_load (EvDocument *document,
const char *uri,
GError **error)
{
gchar *filename;
DviDocument *dvi_document = DVI_DOCUMENT(document);
filename = g_filename_from_uri (uri, NULL, error);
if (!filename)
return FALSE;
g_mutex_lock (&dvi_context_mutex);
if (dvi_document->context... | 0 | [
"CWE-78"
] | evince | 350404c76dc8601e2cdd2636490e2afc83d3090e | 256,796,813,216,915,700,000,000,000,000,000,000,000 | 41 | dvi: Mitigate command injection attacks by quoting filename
With commit 1fcca0b8041de0d6074d7e17fba174da36c65f99 came a DVI backend.
It exports to PDF via the dvipdfm tool.
It calls that tool with the filename of the currently loaded document.
If that filename is cleverly crafted, it can escape the currently
used manu... |
static void timeout_func(unsigned long data)
{
struct aio_timeout *to = (struct aio_timeout *)data;
to->timed_out = 1;
wake_up_process(to->p);
} | 0 | [
"CWE-190"
] | linux-2.6 | 75e1c70fc31490ef8a373ea2a4bea2524099b478 | 115,531,390,632,230,740,000,000,000,000,000,000,000 | 7 | aio: check for multiplication overflow in do_io_submit
Tavis Ormandy pointed out that do_io_submit does not do proper bounds
checking on the passed-in iocb array:
if (unlikely(nr < 0))
return -EINVAL;
if (unlikely(!access_ok(VERIFY_READ, iocbpp, (nr*sizeof(iocbpp)))))
retu... |
assert_resolve_ok(cached_resolve_t *resolve)
{
tor_assert(resolve);
tor_assert(resolve->magic == CACHED_RESOLVE_MAGIC);
tor_assert(strlen(resolve->address) < MAX_ADDRESSLEN);
tor_assert(tor_strisnonupper(resolve->address));
if (resolve->state != CACHE_STATE_PENDING) {
tor_assert(!resolve->pending_connecti... | 0 | [
"CWE-399"
] | tor | 62637fa22405278758febb1743da9af562524d4c | 322,519,303,897,331,530,000,000,000,000,000,000,000 | 18 | Avoid hard (impossible?)-to-trigger double-free in dns_resolve()
Fixes 6480; fix on 0.2.0.1-alpha; based on pseudonymous patch. |
void Http2FloodMitigationTest::sendFame(const Http2Frame& frame) {
ASSERT_TRUE(tcp_client_->connected());
tcp_client_->write(std::string(frame), false, false);
} | 0 | [
"CWE-400",
"CWE-703"
] | envoy | afc39bea36fd436e54262f150c009e8d72db5014 | 48,398,544,651,198,050,000,000,000,000,000,000,000 | 4 | Track byteSize of HeaderMap internally.
Introduces a cached byte size updated internally in HeaderMap. The value
is stored as an optional, and is cleared whenever a non-const pointer or
reference to a HeaderEntry is accessed. The cached value can be set with
refreshByteSize() which performs an iteration over the Heade... |
print_stats ()
{
int i;
for (i = 0; i < DIM (lkup_stats); i++)
{
if (lkup_stats[i].any)
fprintf (stderr,
"lookup stats: mode=%-2d ok=%-6d nokey=%-6d err=%-6d\n",
i,
lkup_stats[i].okay_count,
lkup_stats[i].nokey_count, lkup_stats[i].error_count);
}
} | 0 | [
"CWE-310"
] | gnupg | 4bde12206c5bf199dc6e12a74af8da4558ba41bf | 16,294,236,008,901,619,000,000,000,000,000,000,000 | 13 | gpg: Distinguish between missing and cleared key flags.
* include/cipher.h (PUBKEY_USAGE_NONE): New.
* g10/getkey.c (parse_key_usage): Set new flag.
--
We do not want to use the default capabilities (derived from the
algorithm) if any key flags are given in a signature. Thus if key
flags are used in any way, the def... |
static void ath10k_usb_flush_all(struct ath10k *ar)
{
struct ath10k_usb *ar_usb = ath10k_usb_priv(ar);
int i;
for (i = 0; i < ATH10K_USB_PIPE_MAX; i++) {
if (ar_usb->pipes[i].ar_usb) {
usb_kill_anchored_urbs(&ar_usb->pipes[i].urb_submitted);
cancel_work_sync(&ar_usb->pipes[i].io_complete_work);
}
}
} | 0 | [
"CWE-476"
] | linux | bfd6e6e6c5d2ee43a3d9902b36e01fc7527ebb27 | 323,949,402,007,875,300,000,000,000,000,000,000,000 | 12 | ath10k: Fix a NULL-ptr-deref bug in ath10k_usb_alloc_urb_from_pipe
The `ar_usb` field of `ath10k_usb_pipe_usb_pipe` objects
are initialized to point to the containing `ath10k_usb` object
according to endpoint descriptors read from the device side, as shown
below in `ath10k_usb_setup_pipe_resources`:
for (i = 0; i < i... |
static xmlDocPtr php_xsl_apply_stylesheet(zval *id, xsl_object *intern, xsltStylesheetPtr style, zval *docp TSRMLS_DC) /* {{{ */
{
xmlDocPtr newdocp;
xmlDocPtr doc = NULL;
xmlNodePtr node = NULL;
xsltTransformContextPtr ctxt;
php_libxml_node_object *object;
char **params = NULL;
int clone;
zval *doXInclude, *me... | 0 | [] | php-src | ce96fd6b0761d98353761bf78d5bfb55291179fd | 237,055,113,157,538,360,000,000,000,000,000,000,000 | 95 | - fix #39863, do not accept paths with NULL in them. See http://news.php.net/php.internals/50191, trunk will have the patch later (adding a macro and/or changing (some) APIs. Patch by Rasmus |
CBINDInstallDlg::RegisterService() {
SC_HANDLE hSCManager;
SC_HANDLE hService;
CString StartName;
if (m_accountName == LOCAL_SERVICE)
StartName = LOCAL_SERVICE;
else
StartName = ".\\" + m_accountName;
/*
* We need to change the service rather than create it
* if the service already exists. Do nothing if ... | 1 | [
"CWE-284"
] | bind9 | 967a3b9419a3c12b8c0870c86d1ee3840bcbbad7 | 221,897,965,253,146,670,000,000,000,000,000,000,000 | 56 | [master] quote service registry paths
4532. [security] The BIND installer on Windows used an unquoted
service path, which can enable privilege escalation.
(CVE-2017-3141) [RT #45229] |
static void ql_petbi_init_ex(struct ql3_adapter *qdev)
{
ql_petbi_reset_ex(qdev);
ql_petbi_start_neg_ex(qdev);
} | 0 | [
"CWE-401"
] | linux | 1acb8f2a7a9f10543868ddd737e37424d5c36cf4 | 233,803,286,406,418,400,000,000,000,000,000,000,000 | 5 | net: qlogic: Fix memory leak in ql_alloc_large_buffers
In ql_alloc_large_buffers, a new skb is allocated via netdev_alloc_skb.
This skb should be released if pci_dma_mapping_error fails.
Fixes: 0f8ab89e825f ("qla3xxx: Check return code from pci_map_single() in ql_release_to_lrg_buf_free_list(), ql_populate_free_queue... |
static void deinit_qxl_surface(QXLSurfaceCmd *qxl)
{
g_free(from_physical(qxl->u.surface_create.data));
} | 0 | [
"CWE-193"
] | spice | a4a16ac42d2f19a17e36556546aa94d5cd83745f | 251,456,817,976,240,300,000,000,000,000,000,000,000 | 4 | memslot: Fix off-by-one error in group/slot boundary check
RedMemSlotInfo keeps an array of groups, and each group contains an
array of slots. Unfortunately, these checks are off by 1, they check
that the index is greater or equal to the number of elements in the
array, while these arrays are 0 based. The check should... |
png_handle_hIST(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
{
unsigned int num, i;
png_uint_16 readbuf[PNG_MAX_PALETTE_LENGTH];
png_debug(1, "in png_handle_hIST");
if ((png_ptr->mode & PNG_HAVE_IHDR) == 0)
png_chunk_error(png_ptr, "missing IHDR");
else if ((png_ptr->mode & PNG... | 0 | [
"CWE-120"
] | libpng | a901eb3ce6087e0afeef988247f1a1aa208cb54d | 16,576,808,849,089,822,000,000,000,000,000,000,000 | 48 | [libpng16] Prevent reading over-length PLTE chunk (Cosmin Truta). |
teardown_key_sizes(void) {
memset(&keySizes, 0, sizeof(struct key_sizes));
} | 0 | [
"CWE-703",
"CWE-770"
] | open62541 | b79db1ac78146fc06b0b8435773d3967de2d659c | 36,115,671,778,527,740,000,000,000,000,000,000,000 | 3 | fix(plugin): Add default limits for chunks and message size
Based on a reported DoS vulnerability reported by Team82 (Claroty
Research). |
u32 gf_utf8_wcslen (const unsigned short *s)
{
const unsigned short* ptr;
for (ptr = s; *ptr != (unsigned short)'\0'; ptr++) {
}
return (u32) ( ptr - s );
} | 0 | [
"CWE-276"
] | gpac | 96699aabae042f8f55cf8a85fa5758e3db752bae | 248,572,618,992,337,900,000,000,000,000,000,000,000 | 7 | fixed #2061 |
int filemap_fdatawrite(struct address_space *mapping)
{
return __filemap_fdatawrite(mapping, WB_SYNC_ALL);
} | 0 | [
"CWE-193"
] | linux-2.6 | 94ad374a0751f40d25e22e036c37f7263569d24c | 61,650,871,680,405,930,000,000,000,000,000,000,000 | 4 | Fix off-by-one error in iov_iter_advance()
The iov_iter_advance() function would look at the iov->iov_len entry
even though it might have iterated over the whole array, and iov was
pointing past the end. This would cause DEBUG_PAGEALLOC to trigger a
kernel page fault if the allocation was at the end of a page, and th... |
static void JSON_mark(void *ptr)
{
JSON_Parser *json = ptr;
rb_gc_mark_maybe(json->Vsource);
rb_gc_mark_maybe(json->create_id);
rb_gc_mark_maybe(json->object_class);
rb_gc_mark_maybe(json->array_class);
rb_gc_mark_maybe(json->decimal_class);
rb_gc_mark_maybe(json->match_string);
} | 0 | [
"CWE-20"
] | ruby | 36e9ed7fef6eb2d14becf6c52452e4ab16e4bf01 | 132,646,329,067,539,060,000,000,000,000,000,000,000 | 10 | backport 80b5a0ff2a7709367178f29d4ebe1c54122b1c27 partially as a securify fix for CVE-2020-10663.
The patch was provided by Jeremy Evans.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@67856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
ZEND_VM_HANDLER(25, ZEND_ASSIGN_STATIC_PROP, ANY, ANY, CACHE_SLOT, SPEC(OP_DATA=CONST|TMP|VAR|CV))
{
USE_OPLINE
zend_free_op free_op_data;
zval *prop, *value;
zend_property_info *prop_info;
SAVE_OPLINE();
if (zend_fetch_static_property_address(&prop, &prop_info, opline->extended_value, BP_VAR_W, 0 OPLINE_CC EXE... | 0 | [
"CWE-787"
] | php-src | f1ce8d5f5839cb2069ea37ff424fb96b8cd6932d | 276,261,884,724,784,570,000,000,000,000,000,000,000 | 31 | 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 void debug_hrtimer_deactivate(struct hrtimer *timer)
{
debug_object_deactivate(timer, &hrtimer_debug_descr);
} | 0 | [
"CWE-200"
] | tip | dfb4357da6ddbdf57d583ba64361c9d792b0e0b1 | 314,713,220,419,390,750,000,000,000,000,000,000,000 | 4 | time: Remove CONFIG_TIMER_STATS
Currently CONFIG_TIMER_STATS exposes process information across namespaces:
kernel/time/timer_list.c print_timer():
SEQ_printf(m, ", %s/%d", tmp, timer->start_pid);
/proc/timer_list:
#11: <0000000000000000>, hrtimer_wakeup, S:01, do_nanosleep, cron/2570
Given that the trac... |
explicit Value(Object &&o) noexcept : type_(OBJECT_TYPE),
object_value_(std::move(o)) {} | 0 | [
"CWE-20"
] | tinygltf | 52ff00a38447f06a17eab1caa2cf0730a119c751 | 125,825,973,270,951,080,000,000,000,000,000,000,000 | 2 | Do not expand file path since its not necessary for glTF asset path(URI) and for security reason(`wordexp`). |
Http::Http1::CodecStats& http1CodecStats() {
return Http::Http1::CodecStats::atomicGet(http1_codec_stats_, store_);
} | 0 | [
"CWE-770"
] | envoy | 7ca28ff7d46454ae930e193d97b7d08156b1ba59 | 52,467,526,172,381,260,000,000,000,000,000,000,000 | 3 | [http1] Include request URL in request header size computation, and reject partial headers that exceed configured limits (#145)
Signed-off-by: antonio <avd@google.com> |
CImg<Tfloat> get_RGBtoHSL() const {
return CImg<Tfloat>(*this,false).RGBtoHSL();
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 19,039,467,015,177,488,000,000,000,000,000,000,000 | 3 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
ves_icall_System_Reflection_Assembly_GetManifestResourceInfoInternal (MonoReflectionAssembly *assembly, MonoString *name, MonoManifestResourceInfo *info)
{
MonoTableInfo *table = &assembly->assembly->image->tables [MONO_TABLE_MANIFESTRESOURCE];
int i;
guint32 cols [MONO_MANIFEST_SIZE];
guint32 file_cols [MONO_FILE_... | 0 | [
"CWE-264"
] | mono | 035c8587c0d8d307e45f1b7171a0d337bb451f1e | 60,488,351,317,379,480,000,000,000,000,000,000,000 | 63 | Allow only primitive types/enums in RuntimeHelpers.InitializeArray (). |
validate_user(cupsd_job_t *job, /* I - Job */
cupsd_client_t *con, /* I - Client connection */
const char *owner, /* I - Owner of job/resource */
char *username, /* O - Authenticated username */
size_t userlen) /* I - Length of username */
{
cu... | 0 | [
"CWE-20"
] | cups | 49fa4983f25b64ec29d548ffa3b9782426007df3 | 236,181,666,493,569,130,000,000,000,000,000,000,000 | 33 | DBUS notifications could crash the scheduler (Issue #5143)
- scheduler/ipp.c: Make sure requesting-user-name string is valid UTF-8. |
static void ext4_readahead(struct readahead_control *rac)
{
struct inode *inode = rac->mapping->host;
/* If the file has inline data, no need to do readahead. */
if (ext4_has_inline_data(inode))
return;
ext4_mpage_readpages(inode, rac, NULL);
} | 0 | [
"CWE-703"
] | linux | ce9f24cccdc019229b70a5c15e2b09ad9c0ab5d1 | 133,564,697,207,154,660,000,000,000,000,000,000,000 | 10 | ext4: check journal inode extents more carefully
Currently, system zones just track ranges of block, that are "important"
fs metadata (bitmaps, group descriptors, journal blocks, etc.). This
however complicates how extent tree (or indirect blocks) can be checked
for inodes that actually track such metadata - currently... |
static struct hid_usage *hidinput_locate_usage(struct hid_device *hid,
const struct input_keymap_entry *ke,
unsigned int *index)
{
struct hid_usage *usage;
unsigned int scancode;
if (ke->flags & INPUT_KEYMAP_BY_INDEX)
usage = hidinput_find_key(hid, match_index, ke->index, index);
else if (input_scancod... | 0 | [
"CWE-787"
] | linux | 35556bed836f8dc07ac55f69c8d17dce3e7f0e25 | 165,223,698,102,013,320,000,000,000,000,000,000,000 | 16 | HID: core: Sanitize event code and type when mapping input
When calling into hid_map_usage(), the passed event code is
blindly stored as is, even if it doesn't fit in the associated bitmap.
This event code can come from a variety of sources, including devices
masquerading as input devices, only a bit more "programmab... |
evdns_request_transmit(struct request *req) {
int retcode = 0, r;
ASSERT_LOCKED(req->base);
ASSERT_VALID_REQUEST(req);
/* if we fail to send this packet then this flag marks it */
/* for evdns_transmit */
req->transmit_me = 1;
EVUTIL_ASSERT(req->trans_id != 0xffff);
if (!req->ns)
{
/* unable to transmit re... | 0 | [
"CWE-125"
] | libevent | 96f64a022014a208105ead6c8a7066018449d86d | 70,300,720,617,677,470,000,000,000,000,000,000,000 | 49 | evdns: name_parse(): fix remote stack overread
@asn-the-goblin-slayer:
"the name_parse() function in libevent's DNS code is vulnerable to a buffer overread.
971 if (cp != name_out) {
972 if (cp + 1 >= end) return -1;
973 *cp++ = '.';
974 }
975 if (cp + ... |
auth_pin_reset_oberthur_style(struct sc_card *card, unsigned int type,
struct sc_pin_cmd_data *data, int *tries_left)
{
struct sc_card_driver *iso_drv = sc_get_iso7816_driver();
struct sc_pin_cmd_data pin_cmd;
struct sc_path tmp_path;
struct sc_file *tmp_file = NULL;
struct sc_apdu apdu;
unsigned char puk[OBERT... | 0 | [
"CWE-125"
] | OpenSC | 8fe377e93b4b56060e5bbfb6f3142ceaeca744fa | 310,394,677,758,253,440,000,000,000,000,000,000,000 | 94 | fixed out of bounds reads
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting and suggesting security fixes. |
static void writer_print_time(WriterContext *wctx, const char *key,
int64_t ts, const AVRational *time_base, int is_duration)
{
char buf[128];
if ((!is_duration && ts == AV_NOPTS_VALUE) || (is_duration && ts == 0)) {
writer_print_string(wctx, key, "N/A", PRINT_STRING_OPT);... | 0 | [
"CWE-476"
] | FFmpeg | 837cb4325b712ff1aab531bf41668933f61d75d2 | 136,935,771,710,330,830,000,000,000,000,000,000,000 | 16 | ffprobe: Fix null pointer dereference with color primaries
Found-by: AD-lab of venustech
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> |
_gnutls_ciphertext2compressed (gnutls_session_t session,
opaque * compress_data,
int compress_size,
gnutls_datum_t ciphertext, uint8_t type,
record_parameters_st * params)
{
uint8_t MAC[MAX_HASH... | 1 | [
"CWE-310"
] | gnutls | 422214868061370aeeb0ac9cd0f021a5c350a57d | 144,752,126,457,427,140,000,000,000,000,000,000,000 | 157 | better check decrypted data. |
static void __sdma_process_event(struct sdma_engine *sde,
enum sdma_events event)
{
struct sdma_state *ss = &sde->state;
int need_progress = 0;
/* CONFIG SDMA temporary */
#ifdef CONFIG_SDMA_VERBOSITY
dd_dev_err(sde->dd, "CONFIG SDMA(%u) [%s] %s\n", sde->this_idx,
sdma_state_names[ss->current_state],
... | 0 | [
"CWE-400",
"CWE-401"
] | linux | 34b3be18a04ecdc610aae4c48e5d1b799d8689f6 | 166,337,102,902,243,300,000,000,000,000,000,000,000 | 482 | RDMA/hfi1: Prevent memory leak in sdma_init
In sdma_init if rhashtable_init fails the allocated memory for
tmp_sdma_rht should be released.
Fixes: 5a52a7acf7e2 ("IB/hfi1: NULL pointer dereference when freeing rhashtable")
Link: https://lore.kernel.org/r/20190925144543.10141-1-navid.emamdoost@gmail.com
Signed-off-by: ... |
compile_expr3(char_u **arg, cctx_T *cctx, ppconst_T *ppconst)
{
int ppconst_used = ppconst->pp_used;
// get the first variable
if (compile_expr4(arg, cctx, ppconst) == FAIL)
return FAIL;
// || and && work almost the same
return compile_and_or(arg, cctx, "&&", ppconst, ppconst_used);
} | 0 | [
"CWE-200",
"CWE-122"
] | vim | 5f25c3855071bd7e26255c68bf458b1b5cf92f39 | 315,092,905,708,029,670,000,000,000,000,000,000,000 | 11 | patch 8.2.4049: Vim9: reading before the start of the line with "$"
Problem: Vim9: reading before the start of the line with "$" by itself.
Solution: Do not subtract one when reporting the error. |
DiagnosticInfoInner_decodeJson(void* dst, const UA_DataType* type,
CtxJson* ctx, ParseCtx* parseCtx, UA_Boolean moveToken) {
UA_DiagnosticInfo *inner = (UA_DiagnosticInfo*)UA_calloc(1, sizeof(UA_DiagnosticInfo));
if(inner == NULL) {
return UA_STATUSCODE_BADOUTOFMEMORY;
... | 0 | [
"CWE-703",
"CWE-787"
] | open62541 | c800e2987b10bb3af6ef644b515b5d6392f8861d | 224,404,093,486,602,550,000,000,000,000,000,000,000 | 9 | fix(json): Check max recursion depth in more places |
static void RSA_get0_factors(const RSA *r, const BIGNUM **p, const BIGNUM **q)
{
*p = r->p;
*q = r->q;
} | 0 | [
"CWE-326"
] | php-src | 0216630ea2815a5789a24279a1211ac398d4de79 | 9,237,506,391,133,546,000,000,000,000,000,000,000 | 5 | Fix bug #79601 (Wrong ciphertext/tag in AES-CCM encryption for a 12 bytes IV) |
read_in_old_ascii (struct cpio_file_stat *file_hdr, int in_des)
{
struct old_ascii_header ascii_header;
unsigned long dev;
tape_buffered_read (ascii_header.c_dev, in_des,
sizeof ascii_header - sizeof ascii_header.c_magic);
dev = FROM_OCTAL (ascii_header.c_dev);
file_hdr->c_dev_maj = major (dev);
fi... | 0 | [
"CWE-190"
] | cpio | dd96882877721703e19272fe25034560b794061b | 58,444,715,879,706,990,000,000,000,000,000,000,000 | 53 | Rewrite dynamic string support.
* src/dstring.c (ds_init): Take a single argument.
(ds_free): New function.
(ds_resize): Take a single argument. Use x2nrealloc to expand
the storage.
(ds_reset,ds_append,ds_concat,ds_endswith): New function.
(ds_fgetstr): Rewrite. In particular, this fixes integer overflow.
* src/dst... |
static void sctp_generate_timeout_event(struct sctp_association *asoc,
sctp_event_timeout_t timeout_type)
{
struct sock *sk = asoc->base.sk;
struct net *net = sock_net(sk);
int error = 0;
bh_lock_sock(sk);
if (sock_owned_by_user(sk)) {
pr_debug("%s: sock is busy: timer %d\n", __func__,
timeout_type);
... | 0 | [
"CWE-362"
] | linux | 635682a14427d241bab7bbdeebb48a7d7b91638e | 149,505,477,550,556,480,000,000,000,000,000,000,000 | 37 | sctp: Prevent soft lockup when sctp_accept() is called during a timeout event
A case can occur when sctp_accept() is called by the user during
a heartbeat timeout event after the 4-way handshake. Since
sctp_assoc_migrate() changes both assoc->base.sk and assoc->ep, the
bh_sock_lock in sctp_generate_heartbeat_event() ... |
static uint32_t rtl8139_io_readw(void *opaque, uint8_t addr)
{
RTL8139State *s = opaque;
uint32_t ret;
switch (addr)
{
case TxAddr0 ... TxAddr0+4*4-1:
ret = rtl8139_TxStatus_TxAddr_read(s, s->TxAddr, TxAddr0, addr, 2);
break;
case IntrMask:
ret = rtl8... | 0 | [
"CWE-835"
] | qemu | 5311fb805a4403bba024e83886fa0e7572265de4 | 84,072,356,806,641,920,000,000,000,000,000,000,000 | 77 | rtl8139: 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
Buglink: https://bugs.launchpad.net/qemu/+bug/1910826... |
void enable_kernel_altivec(void)
{
unsigned long cpumsr;
WARN_ON(preemptible());
cpumsr = msr_check_and_set(MSR_VEC);
if (current->thread.regs && (current->thread.regs->msr & MSR_VEC)) {
check_if_tm_restore_required(current);
/*
* If a thread has already been reclaimed then the
* checkpointed registers... | 0 | [] | linux | 5d176f751ee3c6eededd984ad409bff201f436a7 | 227,573,940,101,260,650,000,000,000,000,000,000,000 | 22 | powerpc: tm: Enable transactional memory (TM) lazily for userspace
Currently the MSR TM bit is always set if the hardware is TM capable.
This adds extra overhead as it means the TM SPRS (TFHAR, TEXASR and
TFAIR) must be swapped for each process regardless of if they use TM.
For processes that don't use TM the TM MSR ... |
QPDFWriter::writeStringNoQDF(std::string const& str)
{
if (! this->m->qdf_mode)
{
writeString(str);
}
} | 0 | [
"CWE-125"
] | qpdf | 1868a10f8b06631362618bfc85ca8646da4b4b71 | 322,491,641,435,331,470,000,000,000,000,000,000,000 | 7 | Replace all atoi calls with QUtil::string_to_int
The latter catches underflow/overflow. |
static int __cil_fill_expr(struct cil_tree_node *current, enum cil_flavor flavor, struct cil_list *expr)
{
int rc = SEPOL_ERR;
if (current->cl_head == NULL) {
enum cil_flavor op = __cil_get_expr_operator_flavor(current->data);
if (op != CIL_NONE) {
cil_log(CIL_ERR, "Operator (%s) not in an expression\n", (cha... | 0 | [
"CWE-125"
] | selinux | 340f0eb7f3673e8aacaf0a96cbfcd4d12a405521 | 92,002,756,718,763,970,000,000,000,000,000,000,000 | 27 | libsepol/cil: Check for statements not allowed in optional blocks
While there are some checks for invalid statements in an optional
block when resolving the AST, there are no checks when building the
AST.
OSS-Fuzz found the following policy which caused a null dereference
in cil_tree_get_next_path().
(blockinherit ... |
void MMDB_close(MMDB_s *const mmdb)
{
free_mmdb_struct(mmdb);
} | 0 | [] | libmaxminddb | 51255f113fe3c7b63ffe957636a7656a3ff9d1ff | 112,312,750,152,688,360,000,000,000,000,000,000,000 | 4 | Fix several segfaults from missing bounds checks
These were found using afl-fuzz. There are several more similar failure
that warrant investigation. If we want to add tests, I have several
corrupt databases we could add, but these are trivially reproducible
when using the existing test databases as input to afl-fuzz. |
int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi6 *fl6,
struct ipv6_txoptions *opt)
{
struct net *net = sock_net(sk);
struct ipv6_pinfo *np = inet6_sk(sk);
struct in6_addr *first_hop = &fl6->daddr;
struct dst_entry *dst = skb_dst(skb);
struct ipv6hdr *hdr;
u8 proto = fl6->flowi6_proto;
int ... | 0 | [
"CWE-703"
] | linux | 87c48fa3b4630905f98268dde838ee43626a060c | 170,888,247,888,143,620,000,000,000,000,000,000,000 | 84 | ipv6: make fragment identifications less predictable
IPv6 fragment identification generation is way beyond what we use for
IPv4 : It uses a single generator. Its not scalable and allows DOS
attacks.
Now inetpeer is IPv6 aware, we can use it to provide a more secure and
scalable frag ident generator (per destination, ... |
template<typename t>
CImgList<T> get_split(const CImg<t>& values, const char axis=0, const bool keep_values=true) const {
CImgList<T> res;
if (is_empty()) return res;
const ulongT vsiz = values.size();
const char _axis = cimg::lowercase(axis);
if (!vsiz) return CImgList<T>(*this);
... | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 106,209,469,157,223,670,000,000,000,000,000,000,000 | 144 | Fix other issues in 'CImg<T>::load_bmp()'. |
void st_select_lex_unit::exclude_tree()
{
for (SELECT_LEX *sl= first_select(); sl; sl= sl->next_select())
{
// unlink current level from global SELECTs list
if (sl->link_prev && (*sl->link_prev= sl->link_next))
sl->link_next->link_prev= sl->link_prev;
// unlink underlay levels
for (SELECT_LEX... | 0 | [
"CWE-476"
] | server | 3a52569499e2f0c4d1f25db1e81617a9d9755400 | 285,490,823,051,012,700,000,000,000,000,000,000,000 | 19 | MDEV-25636: Bug report: abortion in sql/sql_parse.cc:6294
The asserion failure was caused by this query
select /*id=1*/ from t1
where
col= ( select /*id=2*/ from ... where corr_cond1
union
select /*id=4*/ from ... where corr_cond2)
Here,
- select with id=2 was correlated due to corr_cond1.... |
static const char *set_override(cmd_parms *cmd, void *d_, const char *l)
{
core_dir_config *d = d_;
char *w;
char *k, *v;
const char *err;
/* Throw a warning if we're in <Location> or <Files> */
if (ap_check_cmd_context(cmd, NOT_IN_LOCATION | NOT_IN_FILES)) {
ap_log_error(APLOG_MARK, AP... | 0 | [
"CWE-416",
"CWE-284"
] | httpd | 4cc27823899e070268b906ca677ee838d07cf67a | 250,536,694,966,789,630,000,000,000,000,000,000,000 | 71 | core: Disallow Methods' registration at run time (.htaccess), they may be
used only if registered at init time (httpd.conf).
Calling ap_method_register() in children processes is not the right scope
since it won't be shared for all requests.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1807655 13f7... |
DEFUN(shiftl, SHIFT_LEFT, "Shift screen left")
{
int column;
if (Currentbuf->firstLine == NULL)
return;
column = Currentbuf->currentColumn;
columnSkip(Currentbuf, searchKeyNum() * (-Currentbuf->COLS + 1) + 1);
shiftvisualpos(Currentbuf, Currentbuf->currentColumn - column);
displayBuffer(Curren... | 0 | [
"CWE-59",
"CWE-241"
] | w3m | 18dcbadf2771cdb0c18509b14e4e73505b242753 | 182,766,397,551,255,860,000,000,000,000,000,000,000 | 11 | Make temporary directory safely when ~/.w3m is unwritable |
static void zrle_write_u24a(VncState *vs, uint32_t value)
{
vnc_write(vs, (uint8_t *)&value, 3);
} | 0 | [
"CWE-125"
] | qemu | 9f64916da20eea67121d544698676295bbb105a7 | 277,245,139,319,405,920,000,000,000,000,000,000,000 | 4 | 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 void pptp_timeout(struct triton_timer_t *t)
{
struct pptp_conn_t *conn = container_of(t, typeof(*conn), timeout_timer);
disconnect(conn);
} | 0 | [
"CWE-787"
] | accel-ppp | a0b8bfc4e74ff31b15ccfa6c626e3bbc591ba98f | 102,883,604,062,718,070,000,000,000,000,000,000,000 | 5 | Fix post_msg implementation bug
I think the error handling code of `post_msg` is wrongly implemented due to coding typo. The `EPIPE` should be also considered and then return -1, just like `PPTP_write`:
https://github.com/xebd/accel-ppp/blob/1b8711cf75a7c278d99840112bc7a396398e0205/accel-pppd/ctrl/pptp/pptp.c#L539-L5... |
parserConstructViaModAndName(modInfo_t *__restrict__ pMod, uchar *const __restrict__ pName, void *pInst)
{
rsRetVal localRet;
parser_t *pParser = NULL;
DEFiRet;
if(pInst == NULL && pMod->mod.pm.newParserInst != NULL) {
/* this happens for the default instance on ModLoad time */
CHKiRet(pMod->mod.pm.newParserIn... | 0 | [] | rsyslog | 20f8237870eb5e971fa068e4dd4d296f1dbef329 | 180,009,839,052,628,260,000,000,000,000,000,000,000 | 30 | core: fix potential misadressing in parser message sanitizer
misadressing could happen when an oversize message made it to the
sanitizer AND contained a control character in the oversize part
of the message. Note that it is an error in itself that such an
oversize message enters the system, but we harden the sanitizer... |
static unsigned int event_status_media(IDEState *s,
uint8_t *buf)
{
uint8_t event_code, media_status;
media_status = 0;
if (s->tray_open) {
media_status = MS_TRAY_OPEN;
} else if (bdrv_is_inserted(s->bs)) {
media_status = MS_MEDIA_PRESENT;
}
... | 0 | [] | qemu | ce560dcf20c14194db5ef3b9fc1ea592d4e68109 | 167,677,556,472,229,460,000,000,000,000,000,000,000 | 33 | ATAPI: STARTSTOPUNIT only eject/load media if powercondition is 0
The START STOP UNIT command will only eject/load media if
power condition is zero.
If power condition is !0 then LOEJ and START will be ignored.
From MMC (sbc contains similar wordings too)
The Power Conditions field requests the block device to be ... |
int tipc_nl_node_flush_key(struct sk_buff *skb, struct genl_info *info)
{
int err;
rtnl_lock();
err = __tipc_nl_node_flush_key(skb, info);
rtnl_unlock();
return err;
} | 0 | [] | linux | 0217ed2848e8538bcf9172d97ed2eeb4a26041bb | 236,741,902,596,802,100,000,000,000,000,000,000,000 | 10 | tipc: better validate user input in tipc_nl_retrieve_key()
Before calling tipc_aead_key_size(ptr), we need to ensure
we have enough data to dereference ptr->keylen.
We probably also want to make sure tipc_aead_key_size()
wont overflow with malicious ptr->keylen values.
Syzbot reported:
BUG: KMSAN: uninit-value in _... |
static unsigned short fli_read_short(FILE *f)
{
unsigned char b[2];
fread(&b,1,2,f);
return (unsigned short)(b[1]<<8) | b[0];
} | 0 | [
"CWE-787"
] | GIMP | edb251a7ef1602d20a5afcbf23f24afb163de63b | 154,419,561,761,888,400,000,000,000,000,000,000,000 | 6 | Bug 739133 - (CVE-2017-17785) Heap overflow while parsing FLI files.
It is possible to trigger a heap overflow while parsing FLI files. The
RLE decoder is vulnerable to out of boundary writes due to lack of
boundary checks.
The variable "framebuf" points to a memory area which was allocated
with fli_header->width * f... |
write_http_response_header(dir_connection_t *conn, ssize_t length,
int compressed, long cache_lifetime)
{
write_http_response_header_impl(conn, length,
compressed?"application/octet-stream":"text/plain",
compressed?"deflate":"identity",
... | 0 | [] | tor | 973c18bf0e84d14d8006a9ae97fde7f7fb97e404 | 243,926,277,450,284,970,000,000,000,000,000,000,000 | 9 | Fix assertion failure in tor_timegm.
Fixes bug 6811. |
void Magick::Image::contrast(const bool sharpen_)
{
modifyImage();
GetPPException;
ContrastImage(image(),(MagickBooleanType) sharpen_,exceptionInfo);
ThrowImageException;
} | 0 | [
"CWE-416"
] | ImageMagick | 8c35502217c1879cb8257c617007282eee3fe1cc | 304,005,814,727,503,550,000,000,000,000,000,000,000 | 7 | Added missing return to avoid use after free. |
static bool known_siginfo_layout(unsigned sig, int si_code)
{
if (si_code == SI_KERNEL)
return true;
else if ((si_code > SI_USER)) {
if (sig_specific_sicodes(sig)) {
if (si_code <= sig_sicodes[sig].limit)
return true;
}
else if (si_code <= NSIGPOLL)
return true;
}
else if (si_code >= SI_DETHREAD)
... | 0 | [
"CWE-190"
] | linux | d1e7fd6462ca9fc76650fbe6ca800e35b24267da | 36,307,247,290,948,406,000,000,000,000,000,000,000 | 18 | signal: Extend exec_id to 64bits
Replace the 32bit exec_id with a 64bit exec_id to make it impossible
to wrap the exec_id counter. With care an attacker can cause exec_id
wrap and send arbitrary signals to a newly exec'd parent. This
bypasses the signal sending checks if the parent changes their
credentials during e... |
_gnutls_supported_ciphersuites (gnutls_session_t session,
cipher_suite_st ** _ciphers)
{
unsigned int i, ret_count, j;
unsigned int count = CIPHER_SUITES_COUNT;
cipher_suite_st *tmp_ciphers;
cipher_suite_st *ciphers;
gnutls_protocol_t version;
if (count == 0)
{
return 0;
}
tmp_ciphers... | 0 | [
"CWE-310"
] | gnutls | 34d87a7c3f12794a3ec2305cd2fdbae152bf2a76 | 135,281,826,686,697,050,000,000,000,000,000,000,000 | 95 | (_gnutls_x509_oid2mac_algorithm): Don't crash trying to strcmp the
NULL OID value in the hash_algorithms array, which happens when the
input OID doesn't match our OIDs for SHA1, MD5, MD2 or RIPEMD160.
Reported by satyakumar <satyam_kkd@hyd.hellosoft.com>. |
void bond_select_active_slave(struct bonding *bond)
{
struct slave *best_slave;
int rv;
ASSERT_RTNL();
best_slave = bond_find_best_slave(bond);
if (best_slave != rtnl_dereference(bond->curr_active_slave)) {
bond_change_active_slave(bond, best_slave);
rv = bond_set_carrier(bond);
if (!rv)
return;
if (... | 0 | [
"CWE-476",
"CWE-703"
] | linux | 105cd17a866017b45f3c45901b394c711c97bf40 | 185,055,689,894,432,350,000,000,000,000,000,000,000 | 20 | bonding: fix null dereference in bond_ipsec_add_sa()
If bond doesn't have real device, bond->curr_active_slave is null.
But bond_ipsec_add_sa() dereferences bond->curr_active_slave without
null checking.
So, null-ptr-deref would occur.
Test commands:
ip link add bond0 type bond
ip link set bond0 up
ip x s... |
static void do_delete_pass(void)
{
char fbuf[MAXPATHLEN];
STRUCT_STAT st;
int j;
/* dry_run is incremented when the destination doesn't exist yet. */
if (dry_run > 1 || list_only)
return;
for (j = 0; j < cur_flist->used; j++) {
struct file_struct *file = cur_flist->sorted[j];
if (!F_IS_ACTIVE(file))
c... | 0 | [
"CWE-59"
] | rsync | e12a6c087ca1eecdb8eae5977be239c24f4dd3d9 | 193,111,083,433,204,280,000,000,000,000,000,000,000 | 37 | Add parent-dir validation for --no-inc-recurse too. |
static void kiocb_free(struct kiocb *req)
{
if (req->ki_filp)
fput(req->ki_filp);
if (req->ki_eventfd != NULL)
eventfd_ctx_put(req->ki_eventfd);
kmem_cache_free(kiocb_cachep, req);
} | 0 | [
"CWE-399"
] | linux | d558023207e008a4476a3b7bb8706b2a2bf5d84f | 70,850,649,489,711,400,000,000,000,000,000,000,000 | 8 | aio: prevent double free in ioctx_alloc
ioctx_alloc() calls aio_setup_ring() to allocate a ring. If aio_setup_ring()
fails to do so it would call aio_free_ring() before returning, but
ioctx_alloc() would call aio_free_ring() again causing a double free of
the ring.
This is easily reproducible from userspace.
Signed-... |
GF_Err uuid_Write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
GF_UnknownUUIDBox *ptr = (GF_UnknownUUIDBox*)s;
if (!s) return GF_BAD_PARAM;
e = gf_isom_box_write_header(s, bs);
if (e) return e;
if (ptr->data) {
gf_bs_write_data(bs, ptr->data, ptr->dataSize);
}
return GF_OK;
} | 0 | [
"CWE-400",
"CWE-401"
] | gpac | d2371b4b204f0a3c0af51ad4e9b491144dd1225c | 151,151,968,785,781,000,000,000,000,000,000,000,000 | 13 | prevent dref memleak on invalid input (#1183) |
GF_Err gf_isom_flac_config_get(GF_ISOFile *the_file, u32 trackNumber, u32 StreamDescriptionIndex, u8 **dsi, u32 *dsi_size)
{
u32 type;
GF_TrackBox *trak;
GF_MPEGAudioSampleEntryBox *entry;
trak = gf_isom_get_track_from_file(the_file, trackNumber);
if (dsi) *dsi = NULL;
if (dsi_size) *dsi_size = 0;
if (!trak || !... | 0 | [
"CWE-476",
"CWE-401"
] | gpac | 328c6d682698fdb9878dbb4f282963d42c538c01 | 108,509,089,340,098,600,000,000,000,000,000,000,000 | 26 | fixed #1756 |
IsoPresentation_parseAcceptMessage(IsoPresentation* self, ByteBuffer* byteBuffer)
{
uint8_t* buffer = byteBuffer->buffer;
int maxBufPos = byteBuffer->size;
int bufPos = 0;
uint8_t cpTag = buffer[bufPos++];
if (cpTag != 0x31) {
if (DEBUG_PRES)
printf("PRES: not a CPA message\n"... | 0 | [
"CWE-703",
"CWE-835"
] | libiec61850 | cfa94cbf10302bedc779703f874ee2e8387a0721 | 44,173,198,381,713,100,000,000,000,000,000,000,000 | 62 | - fixed - Bug in presentation layer parser can cause infinite loop (LIB61850-302) |
GC_INNER void GC_unmap(ptr_t start, size_t bytes)
{
ptr_t start_addr = GC_unmap_start(start, bytes);
ptr_t end_addr = GC_unmap_end(start, bytes);
word len = end_addr - start_addr;
if (0 == start_addr) return;
# ifdef USE_WINALLOC
while (len != 0) {
MEMORY_BASIC_INFORMATION mem_info;
... | 0 | [
"CWE-119"
] | bdwgc | 7292c02fac2066d39dd1bcc37d1a7054fd1e32ee | 162,535,292,738,991,000,000,000,000,000,000,000,000 | 37 | Fix malloc routines to prevent size value wrap-around
See issue #135 on Github.
* allchblk.c (GC_allochblk, GC_allochblk_nth): Use
OBJ_SZ_TO_BLOCKS_CHECKED instead of OBJ_SZ_TO_BLOCKS.
* malloc.c (GC_alloc_large): Likewise.
* alloc.c (GC_expand_hp_inner): Type of "bytes" local variable changed
from word to size_t; ca... |
static int isofs_read_inode(struct inode *inode)
{
struct super_block *sb = inode->i_sb;
struct isofs_sb_info *sbi = ISOFS_SB(sb);
unsigned long bufsize = ISOFS_BUFFER_SIZE(inode);
unsigned long block;
int high_sierra = sbi->s_high_sierra;
struct buffer_head *bh = NULL;
struct iso_directory_record *de;
struct i... | 1 | [
"CWE-20",
"CWE-399"
] | linux | 410dd3cf4c9b36f27ed4542ee18b1af5e68645a4 | 301,594,582,055,296,240,000,000,000,000,000,000,000 | 195 | isofs: Fix unbounded recursion when processing relocated directories
We did not check relocated directory in any way when processing Rock
Ridge 'CL' tag. Thus a corrupted isofs image can possibly have a CL
entry pointing to another CL entry leading to possibly unbounded
recursion in kernel code and thus stack overflow... |
static MagickBooleanType ReadPSDChannel(Image *image,
const ImageInfo *image_info,const PSDInfo *psd_info,LayerInfo* layer_info,
const size_t channel,const PSDCompressionType compression,
ExceptionInfo *exception)
{
Image
*channel_image,
*mask;
MagickOffsetType
offset;
MagickBooleanType
st... | 0 | [
"CWE-125"
] | ImageMagick6 | 4745eb1047617330141e9abfd5ae01236a71ae12 | 99,963,463,545,652,600,000,000,000,000,000,000,000 | 100 | https://github.com/ImageMagick/ImageMagick/issues/1249 |
storageConnectFindStoragePoolSources(virConnectPtr conn,
const char *type,
const char *srcSpec,
unsigned int flags)
{
int backend_type;
virStorageBackend *backend;
if (virConnectFindStoragePoolSou... | 0 | [] | libvirt | 447f69dec47e1b0bd15ecd7cd49a9fd3b050fb87 | 140,932,904,918,232,030,000,000,000,000,000,000,000 | 31 | storage_driver: Unlock object on ACL fail in storagePoolLookupByTargetPath
'virStoragePoolObjListSearch' returns a locked and refed object, thus we
must release it on ACL permission failure.
Fixes: 7aa0e8c0cb8
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1984318
Signed-off-by: Peter Krempa <pkrempa@redhat.co... |
read_public_subkey(cdk_stream_t inp, size_t pktlen, cdk_pkt_pubkey_t pk)
{
if (!inp || !pk)
return CDK_Inv_Value;
return read_public_key(inp, pktlen, pk);
} | 0 | [
"CWE-119"
] | gnutls | 94fcf1645ea17223237aaf8d19132e004afddc1a | 199,476,035,441,631,700,000,000,000,000,000,000,000 | 6 | opencdk: read_attribute: added more precise checks when reading stream
That addresses heap read overflows found using oss-fuzz:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=338
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=346
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com> |
pax_decode_header (struct tar_sparse_file *file)
{
if (file->stat_info->sparse_major > 0)
{
uintmax_t u;
char nbuf[UINTMAX_STRSIZE_BOUND];
union block *blk;
char *p;
size_t i;
off_t start;
#define COPY_BUF(b,buf,src) do \
{ ... | 0 | [
"CWE-476"
] | tar | cb07844454d8cc9fb21f53ace75975f91185a120 | 55,034,378,042,940,070,000,000,000,000,000,000,000 | 84 | Fix possible NULL dereference (savannah bug #55369)
* src/sparse.c (pax_decode_header): Check return from find_next_block. |
static size_t num_nl(char *file)
{
FILE *fp;
char buf[80];
size_t len, num = 0;
fp = fopen(file, "r");
if (!fp)
return 0;
do {
char *ptr = buf;
len = fread(buf, sizeof(char), sizeof(buf) - 1, fp);
if (len > 0) {
buf[len] = 0;
while ((ptr = strchr(ptr, '\n'))) {
ptr++;
num++;
}
}
} w... | 0 | [
"CWE-120",
"CWE-787"
] | uftpd | 0fb2c031ce0ace07cc19cd2cb2143c4b5a63c9dd | 332,004,980,262,970,300,000,000,000,000,000,000,000 | 26 | FTP: Fix buffer overflow in PORT parser, reported by Aaron Esau
Signed-off-by: Joachim Nilsson <troglobit@gmail.com> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.