func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
MOCK_IMPL(void,
connection_mark_unattached_ap_,(entry_connection_t *conn, int endreason,
int line, const char *file))
{
connection_t *base_conn = ENTRY_TO_CONN(conn);
edge_connection_t *edge_conn = ENTRY_TO_EDGE_CONN(conn);
tor_assert(base_conn->type == CONN_TYPE_AP);
ENTRY_TO_ED... | 0 | [
"CWE-20",
"CWE-617"
] | tor | 79b59a2dfcb68897ee89d98587d09e55f07e68d7 | 137,533,378,180,916,970,000,000,000,000,000,000,000 | 47 | TROVE-2017-004: Fix assertion failure in relay_send_end_cell_from_edge_
This fixes an assertion failure in relay_send_end_cell_from_edge_() when an
origin circuit and a cpath_layer = NULL were passed.
A service rendezvous circuit could do such a thing when a malformed BEGIN cell
is received but shouldn't in the first... |
interpret_long_date(const u_char *p)
{
double d;
time_t ret;
/* this gives us seconds since jan 1st 1601 (approx) */
d = (EXTRACT_LE_32BITS(p + 4) * 256.0 + p[3]) * (1.0e-7 * (1 << 24));
/* now adjust by 369 years to make the secs since 1970 */
d -= 369.0 * 365.25 * 24 * 60 * 60;
/* and a... | 0 | [
"CWE-674",
"CWE-787"
] | tcpdump | 24182d959f661327525a20d9a94c98a8ec016778 | 212,215,312,869,393,250,000,000,000,000,000,000,000 | 21 | (for 4.9.3) CVE-2018-16452/SMB: prevent stack exhaustion
Enforce a limit on how many times smb_fdata() can recurse.
This fixes a stack exhaustion discovered by Include Security working
under the Mozilla SOS program in 2018 by means of code audit. |
static void queue_interrupt(struct fuse_iqueue *fiq, struct fuse_req *req)
{
spin_lock(&fiq->waitq.lock);
if (test_bit(FR_FINISHED, &req->flags)) {
spin_unlock(&fiq->waitq.lock);
return;
}
if (list_empty(&req->intr_entry)) {
list_add_tail(&req->intr_entry, &fiq->interrupts);
wake_up_locked(&fiq->waitq);
}
... | 0 | [
"CWE-416"
] | linux | 15fab63e1e57be9fdb5eec1bbc5916e9825e9acb | 335,249,434,557,236,100,000,000,000,000,000,000,000 | 14 | fs: prevent page refcount overflow in pipe_buf_get
Change pipe_buf_get() to return a bool indicating whether it succeeded
in raising the refcount of the page (if the thing in the pipe is a page).
This removes another mechanism for overflowing the page refcount. All
callers converted to handle a failure.
Reported-by:... |
guards_retry_optimistic(const or_options_t *options)
{
if (! entry_list_is_constrained(options))
return 0;
mark_primary_guards_maybe_reachable(get_guard_selection_info());
return 1;
} | 0 | [
"CWE-200"
] | tor | 665baf5ed5c6186d973c46cdea165c0548027350 | 102,094,925,059,840,260,000,000,000,000,000,000,000 | 9 | Consider the exit family when applying guard restrictions.
When the new path selection logic went into place, I accidentally
dropped the code that considered the _family_ of the exit node when
deciding if the guard was usable, and we didn't catch that during
code review.
This patch makes the guard_restriction_t code ... |
static gps_mask_t aivdm_analyze(struct gps_device_t *session)
{
if (session->packet.type == AIVDM_PACKET) {
if (aivdm_decode
((char *)session->packet.outbuffer, session->packet.outbuflen,
session->aivdm, &session->gpsdata.ais, session->context->debug)) {
return ONLINE_SET | AIS_SET;
} else
re... | 0 | [] | gpsd | 08edc49d8f63c75bfdfb480b083b0d960310f94f | 327,412,092,233,378,180,000,000,000,000,000,000,000 | 16 | Address Savannah bug #38511:
ais_context->bitlen <= sizeof(ais_context->bits)/8 is not checked |
tc_dump_action(struct sk_buff *skb, struct netlink_callback *cb)
{
struct nlmsghdr *nlh;
unsigned char *b = skb->tail;
struct rtattr *x;
struct tc_action_ops *a_o;
struct tc_action a;
int ret = 0;
struct tcamsg *t = (struct tcamsg *) NLMSG_DATA(cb->nlh);
char *kind = find_dump_kind(cb->nlh);
if (kind == NULL)... | 1 | [
"CWE-200"
] | linux-2.6 | 9ef1d4c7c7aca1cd436612b6ca785b726ffb8ed8 | 122,821,627,952,760,090,000,000,000,000,000,000,000 | 60 | [NETLINK]: Missing initializations in dumped data
Mostly missing initialization of padding fields of 1 or 2 bytes length,
two instances of uninitialized nlmsgerr->msg of 16 bytes length.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net> |
void CompactProtocolReader::readFieldBegin(
std::string& /*name*/,
TType& fieldType,
int16_t& fieldId) {
int8_t byte;
int8_t type;
readByte(byte);
type = (byte & 0x0f);
// if it's a stop, then we can return immediately, as the struct is over.
if (type == TType::T_STOP) {
fieldType = TType:... | 0 | [
"CWE-703",
"CWE-770"
] | fbthrift | c9a903e5902834e95bbd4ab0e9fa53ba0189f351 | 269,336,146,660,230,460,000,000,000,000,000,000,000 | 39 | Better handling of truncated data when reading strings
Summary:
Currently we read string size and blindly pre-allocate it. This allows malicious attacker to send a few bytes message and cause server to allocate huge amount of memory (>1GB).
This diff changes the logic to check if we have enough data in the buffer bef... |
reaper(void)
{
time_t deadline = 0, now = monotime();
Identity *id, *nxt;
for (id = TAILQ_FIRST(&idtab->idlist); id; id = nxt) {
nxt = TAILQ_NEXT(id, next);
if (id->death == 0)
continue;
if (now >= id->death) {
debug("expiring key '%s'", id->comment);
TAILQ_REMOVE(&idtab->idlist, id, next);
free_i... | 0 | [
"CWE-399",
"CWE-415"
] | openssh-portable | e04fd6dde16de1cdc5a4d9946397ff60d96568db | 227,419,306,053,499,530,000,000,000,000,000,000,000 | 23 | upstream: factor SSH_AGENT_CONSTRAIN_EXTENSION parsing into its own
function and remove an unused variable; ok dtucker@
OpenBSD-Commit-ID: e1a938657fbf7ef0ba5e73b30365734a0cc96559 |
static void sp_delete(struct shared_policy *sp, struct sp_node *n)
{
pr_debug("deleting %lx-l%lx\n", n->start, n->end);
rb_erase(&n->nd, &sp->root);
mpol_put(n->policy);
kmem_cache_free(sn_cache, n);
} | 0 | [
"CWE-264"
] | linux-2.6 | 1a5a9906d4e8d1976b701f889d8f35d54b928f25 | 255,770,118,547,708,020,000,000,000,000,000,000,000 | 7 | mm: thp: fix pmd_bad() triggering in code paths holding mmap_sem read mode
In some cases it may happen that pmd_none_or_clear_bad() is called with
the mmap_sem hold in read mode. In those cases the huge page faults can
allocate hugepmds under pmd_none_or_clear_bad() and that can trigger a
false positive from pmd_bad(... |
void databox_box_del(GF_Box *s)
{
GF_DataBox *ptr = (GF_DataBox *) s;
if (ptr == NULL) return;
if (ptr->data)
gf_free(ptr->data);
gf_free(ptr);
} | 0 | [
"CWE-476"
] | gpac | 6170024568f4dda310e98ef7508477b425c58d09 | 236,634,691,024,300,030,000,000,000,000,000,000,000 | 9 | fixed potential crash - cf #1263 |
int LZ4_compress(const char* source, char* dest, int inputSize)
{
#if (HEAPMODE)
void* ctx = ALLOCATOR(LZ4_STREAMSIZE_U32, 4); /* Aligned on 4-bytes boundaries */
#else
U32 ctx[LZ4_STREAMSIZE_U32] = {0}; /* Ensure data is aligned on 4-bytes boundaries */
#endif
int result;
if (inputSize < (int)L... | 0 | [
"CWE-20"
] | lz4 | da5373197e84ee49d75b8334d4510689731d6e90 | 233,751,574,455,592,650,000,000,000,000,000,000,000 | 19 | Fixed : issue 52 (reported by Ludwig Strigeus) |
static int mboxlist_update_entry(const char *name, const mbentry_t *mbentry, struct txn **txn)
{
mbentry_t *old = NULL;
int r = 0;
mboxlist_mylookup(name, &old, txn, 0); // ignore errors, it will be NULL
if (!cyrusdb_fetch(mbdb, "$RACL", 5, NULL, NULL, txn)) {
r = mboxlist_update_racl(name, ol... | 0 | [
"CWE-20"
] | cyrus-imapd | 6bd33275368edfa71ae117de895488584678ac79 | 74,810,607,289,793,070,000,000,000,000,000,000,000 | 36 | mboxlist: fix uninitialised memory use where pattern is "Other Users" |
GF_Err cprt_Read(GF_Box *s,GF_BitStream *bs)
{
GF_CopyrightBox *ptr = (GF_CopyrightBox *)s;
gf_bs_read_int(bs, 1);
//the spec is unclear here, just says "the value 0 is interpreted as undetermined"
ptr->packedLanguageCode[0] = gf_bs_read_int(bs, 5);
ptr->packedLanguageCode[1] = gf_bs_read_int(bs, 5);
ptr->packed... | 0 | [
"CWE-400",
"CWE-401"
] | gpac | d2371b4b204f0a3c0af51ad4e9b491144dd1225c | 177,271,741,960,377,000,000,000,000,000,000,000,000 | 29 | prevent dref memleak on invalid input (#1183) |
static bool fuse_pages_realloc(struct fuse_fill_wb_data *data)
{
struct fuse_args_pages *ap = &data->wpa->ia.ap;
struct fuse_conn *fc = get_fuse_conn(data->inode);
struct page **pages;
struct fuse_page_desc *descs;
unsigned int npages = min_t(unsigned int,
max_t(unsigned int, data->max_pages * 2,
FU... | 0 | [
"CWE-459"
] | linux | 5d069dbe8aaf2a197142558b6fb2978189ba3454 | 127,142,627,174,381,860,000,000,000,000,000,000,000 | 25 | fuse: fix bad inode
Jan Kara's analysis of the syzbot report (edited):
The reproducer opens a directory on FUSE filesystem, it then attaches
dnotify mark to the open directory. After that a fuse_do_getattr() call
finds that attributes returned by the server are inconsistent, and calls
make_bad_inode() which,... |
static int ip6mr_vif_open(struct inode *inode, struct file *file)
{
return seq_open_net(inode, file, &ip6mr_vif_seq_ops,
sizeof(struct ipmr_vif_iter));
} | 0 | [
"CWE-20"
] | linux | 99253eb750fda6a644d5188fb26c43bad8d5a745 | 162,373,096,855,994,580,000,000,000,000,000,000,000 | 5 | ipv6: check sk sk_type and protocol early in ip_mroute_set/getsockopt
Commit 5e1859fbcc3c ("ipv4: ipmr: various fixes and cleanups") fixed
the issue for ipv4 ipmr:
ip_mroute_setsockopt() & ip_mroute_getsockopt() should not
access/set raw_sk(sk)->ipmr_table before making sure the socket
is a raw socket, and prot... |
xmlIsMixedElement(xmlDocPtr doc, const xmlChar *name) {
xmlElementPtr elemDecl;
if ((doc == NULL) || (doc->intSubset == NULL)) return(-1);
elemDecl = xmlGetDtdElementDesc(doc->intSubset, name);
if ((elemDecl == NULL) && (doc->extSubset != NULL))
elemDecl = xmlGetDtdElementDesc(doc->extSubset, name);
... | 0 | [] | libxml2 | 932cc9896ab41475d4aa429c27d9afd175959d74 | 118,118,807,342,499,020,000,000,000,000,000,000,000 | 25 | Fix buffer size checks in xmlSnprintfElementContent
xmlSnprintfElementContent failed to correctly check the available
buffer space in two locations.
Fixes bug 781333 (CVE-2017-9047) and bug 781701 (CVE-2017-9048).
Thanks to Marcel Böhme and Thuan Pham for the report. |
void fli_write_brun(FILE *f, s_fli_header *fli_header, unsigned char *framebuf)
{
unsigned long chunkpos;
s_fli_chunk chunk;
unsigned short yc;
unsigned char *linebuf;
chunkpos=ftell(f);
fseek(f, chunkpos+6, SEEK_SET);
for (yc=0; yc < fli_header->height; yc++) {
unsigned short xc, t1, pc, tc;
unsigned long... | 0 | [
"CWE-787"
] | GIMP | edb251a7ef1602d20a5afcbf23f24afb163de63b | 159,162,595,848,366,880,000,000,000,000,000,000,000 | 67 | 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... |
gpa_t kvm_mmu_gva_to_gpa_read(struct kvm_vcpu *vcpu, gva_t gva,
struct x86_exception *exception)
{
struct kvm_mmu *mmu = vcpu->arch.walk_mmu;
u32 access = (static_call(kvm_x86_get_cpl)(vcpu) == 3) ? PFERR_USER_MASK : 0;
return mmu->gva_to_gpa(vcpu, mmu, gva, access, exception);
} | 0 | [
"CWE-476"
] | linux | 55749769fe608fa3f4a075e42e89d237c8e37637 | 296,829,129,470,582,400,000,000,000,000,000,000,000 | 8 | KVM: x86: Fix wall clock writes in Xen shared_info not to mark page dirty
When dirty ring logging is enabled, any dirty logging without an active
vCPU context will cause a kernel oops. But we've already declared that
the shared_info page doesn't get dirty tracking anyway, since it would
be kind of insane to mark it di... |
int nla_get_labels(const struct nlattr *nla, u8 max_labels, u8 *labels,
u32 label[], struct netlink_ext_ack *extack)
{
unsigned len = nla_len(nla);
struct mpls_shim_hdr *nla_label;
u8 nla_labels;
bool bos;
int i;
/* len needs to be an even multiple of 4 (the label size). Number
* of labels is a u8 so chec... | 0 | [] | net | 6c8991f41546c3c472503dff1ea9daaddf9331c2 | 287,417,372,156,729,500,000,000,000,000,000,000,000 | 79 | net: ipv6_stub: use ip6_dst_lookup_flow instead of ip6_dst_lookup
ipv6_stub uses the ip6_dst_lookup function to allow other modules to
perform IPv6 lookups. However, this function skips the XFRM layer
entirely.
All users of ipv6_stub->ip6_dst_lookup use ip_route_output_flow (via the
ip_route_output_key and ip_route_o... |
static void posix_cpu_timers_init(struct task_struct *tsk)
{
tsk->cputime_expires.prof_exp = cputime_zero;
tsk->cputime_expires.virt_exp = cputime_zero;
tsk->cputime_expires.sched_exp = 0;
INIT_LIST_HEAD(&tsk->cpu_timers[0]);
INIT_LIST_HEAD(&tsk->cpu_timers[1]);
INIT_LIST_HEAD(&tsk->cpu_timers[2]);
} | 0 | [
"CWE-264"
] | linux-2.6 | 2d5516cbb9daf7d0e342a2e3b0fc6f8c39a81205 | 309,052,320,750,678,200,000,000,000,000,000,000,000 | 9 | copy_process: fix CLONE_PARENT && parent_exec_id interaction
CLONE_PARENT can fool the ->self_exec_id/parent_exec_id logic. If we
re-use the old parent, we must also re-use ->parent_exec_id to make
sure exit_notify() sees the right ->xxx_exec_id's when the CLONE_PARENT'ed
task exits.
Also, move down the "p->parent_ex... |
TEST(ModMatchExpression, MatchesElement) {
BSONObj match = BSON("a" << 1);
BSONObj largerMatch = BSON("a" << 4.0);
BSONObj longLongMatch = BSON("a" << 68719476736LL);
BSONObj notMatch = BSON("a" << 6);
BSONObj negativeNotMatch = BSON("a" << -2);
ModMatchExpression mod("", 3, 1);
ASSERT(mod.m... | 0 | [] | mongo | 64095239f41e9f3841d8be9088347db56d35c891 | 149,618,094,171,856,880,000,000,000,000,000,000,000 | 13 | SERVER-51083 Reject invalid UTF-8 from $regex match expressions |
gst_rtsp_connection_free (GstRTSPConnection * conn)
{
GstRTSPResult res;
g_return_val_if_fail (conn != NULL, GST_RTSP_EINVAL);
res = gst_rtsp_connection_close (conn);
if (conn->cancellable)
g_object_unref (conn->cancellable);
if (conn->client)
g_object_unref (conn->client);
if (conn->tls_database... | 0 | [] | gst-plugins-base | f672277509705c4034bc92a141eefee4524d15aa | 214,071,685,437,237,820,000,000,000,000,000,000,000 | 27 | gstrtspconnection: Security loophole making heap overflow
The former code allowed an attacker to create a heap overflow by
sending a longer than allowed session id in a response and including a
semicolon to change the maximum length. With this change, the parser
will never go beyond 512 bytes. |
_copyConstraintsSetStmt(const ConstraintsSetStmt *from)
{
ConstraintsSetStmt *newnode = makeNode(ConstraintsSetStmt);
COPY_NODE_FIELD(constraints);
COPY_SCALAR_FIELD(deferred);
return newnode;
} | 0 | [
"CWE-362"
] | postgres | 5f173040e324f6c2eebb90d86cf1b0cdb5890f0a | 214,073,668,529,880,030,000,000,000,000,000,000,000 | 9 | Avoid repeated name lookups during table and index DDL.
If the name lookups come to different conclusions due to concurrent
activity, we might perform some parts of the DDL on a different table
than other parts. At least in the case of CREATE INDEX, this can be
used to cause the permissions checks to be performed aga... |
inline half rol(const half a, const unsigned int n=1) {
return (half)rol((int)a,n);
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 24,162,803,429,784,333,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. |
int line6_pcm_acquire(struct snd_line6_pcm *line6pcm, int type, bool start)
{
struct line6_pcm_stream *pstr;
int ret = 0, dir;
/* TODO: We should assert SNDRV_PCM_STREAM_PLAYBACK/CAPTURE == 0/1 */
mutex_lock(&line6pcm->state_mutex);
for (dir = 0; dir < 2; dir++) {
pstr = get_stream(line6pcm, dir);
ret = line6... | 0 | [
"CWE-476"
] | linux | 3450121997ce872eb7f1248417225827ea249710 | 54,307,333,004,135,645,000,000,000,000,000,000,000 | 28 | ALSA: line6: Fix write on zero-sized buffer
LINE6 drivers allocate the buffers based on the value returned from
usb_maxpacket() calls. The manipulated device may return zero for
this, and this results in the kmalloc() with zero size (and it may
succeed) while the other part of the driver code writes the packet
data w... |
static noinline int setup_leaf_for_split(struct btrfs_trans_handle *trans,
struct btrfs_root *root,
struct btrfs_path *path, int ins_len)
{
struct btrfs_key key;
struct extent_buffer *leaf;
struct btrfs_file_extent_item *fi;
u64 extent_len = 0;
u32 item_size;
int ret;
leaf = path->nodes[0];
btrfs_i... | 0 | [
"CWE-416",
"CWE-362"
] | linux | 5f5bc6b1e2d5a6f827bc860ef2dc5b6f365d1339 | 163,839,079,682,894,430,000,000,000,000,000,000,000 | 64 | Btrfs: make xattr replace operations atomic
Replacing a xattr consists of doing a lookup for its existing value, delete
the current value from the respective leaf, release the search path and then
finally insert the new value. This leaves a time window where readers (getxattr,
listxattrs) won't see any value for the x... |
static void copy_workqueue_attrs(struct workqueue_attrs *to,
const struct workqueue_attrs *from)
{
to->nice = from->nice;
cpumask_copy(to->cpumask, from->cpumask);
/*
* Unlike hash and equality test, this function doesn't ignore
* ->no_numa as it is used for both pool and wq attrs. Instead,
* get_unbound... | 0 | [
"CWE-200"
] | tip | dfb4357da6ddbdf57d583ba64361c9d792b0e0b1 | 221,559,839,941,199,300,000,000,000,000,000,000,000 | 12 | 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... |
R_API RBinJavaAttrInfo *r_bin_java_annotation_default_attr_new(ut8 *buffer, ut64 sz, ut64 buf_offset) {
ut64 offset = 0;
RBinJavaAttrInfo *attr = NULL;
attr = r_bin_java_default_attr_new (buffer, sz, buf_offset);
offset += 6;
if (attr) {
attr->type = R_BIN_JAVA_ATTR_TYPE_ANNOTATION_DEFAULT_ATTR;
attr->info.ann... | 0 | [
"CWE-125"
] | radare2 | e9ce0d64faf19fa4e9c260250fbdf25e3c11e152 | 144,551,219,474,121,320,000,000,000,000,000,000,000 | 15 | Fix #10498 - Fix crash in fuzzed java files (#10511) |
/* {{{ php_idate
*/
PHPAPI int php_idate(char format, time_t ts, int localtime TSRMLS_DC)
{
timelib_time *t;
timelib_tzinfo *tzi;
int retval = -1;
timelib_time_offset *offset = NULL;
timelib_sll isoweek, isoyear;
t = timelib_time_ctor();
if (!localtime) {
tzi = get_timezone_info(TSRMLS_C);
t->tz_info = ... | 0 | [] | php-src | bb057498f7457e8b2eba98332a3bad434de4cf12 | 310,079,470,437,660,370,000,000,000,000,000,000,000 | 92 | Fix #70277: new DateTimeZone($foo) is ignoring text after null byte
The DateTimeZone constructors are not binary safe. They're parsing the timezone
as string, but discard the length when calling timezone_initialize(). This
patch adds a tz_len parameter and a respective check to timezone_initialize(). |
GF_Err avcc_box_read(GF_Box *s, GF_BitStream *bs)
{
u32 i, count;
GF_AVCConfigurationBox *ptr = (GF_AVCConfigurationBox *)s;
if (ptr->config) gf_odf_avc_cfg_del(ptr->config);
ptr->config = gf_odf_avc_cfg_new();
ISOM_DECREASE_SIZE(ptr, 7) //7 includes the 2 counts of sps and pps
Bool is_avcc;
if ((ptr->type==G... | 0 | [
"CWE-617",
"CWE-703"
] | gpac | 9ea93a2ec8f555ceed1ee27294cf94822f14f10f | 209,012,614,917,265,440,000,000,000,000,000,000,000 | 127 | fixed #2165 |
double duration() const { return duration_; } | 0 | [
"CWE-20"
] | libvpx | f00890eecdf8365ea125ac16769a83aa6b68792d | 288,872,243,061,975,470,000,000,000,000,000,000,000 | 1 | update libwebm to libwebm-1.0.0.27-352-g6ab9fcf
https://chromium.googlesource.com/webm/libwebm/+log/af81f26..6ab9fcf
Change-Id: I9d56e1fbaba9b96404b4fbabefddc1a85b79c25d |
static int is_dir_prefix(const char *prefix, size_t n, const char *path) {
return n < strlen(path) && memcmp(prefix, path, n) == 0 && path[n] == '/';
//(n == 0 || path[n] == MG_DIRSEP);
} | 0 | [
"CWE-552"
] | mongoose | c65c8fdaaa257e0487ab0aaae9e8f6b439335945 | 4,169,849,575,577,454,000,000,000,000,000,000,000 | 4 | Protect against the directory traversal in mg_upload() |
void advance_entry() { _n = 0; _e = _v; be::skip<W>(_v,2); } | 0 | [
"CWE-476"
] | graphite | db132b4731a9b4c9534144ba3a18e65b390e9ff6 | 161,949,066,395,435,130,000,000,000,000,000,000,000 | 1 | Deprecate and make ineffective gr_face_dumbRendering |
static const char *md_config_set_must_staple(cmd_parms *cmd, void *dc, const char *value)
{
md_srv_conf_t *config = md_config_get(cmd->server);
const char *err;
(void)dc;
if (!inside_md_section(cmd) && (err = ap_check_cmd_context(cmd, GLOBAL_ONLY))) {
return err;
}
if (!apr_strnatcasec... | 0 | [
"CWE-476"
] | mod_md | e71001955809247b3aa4d269e1e0741b4fe0fc3d | 69,692,362,504,881,930,000,000,000,000,000,000,000 | 22 | v1.1.12, notifycmd improvements |
Controller::whenSendingRequest_onRequestBody(Client *client, Request *req,
const MemoryKit::mbuf &buffer, int errcode)
{
TRACE_POINT();
if (buffer.size() > 0) {
// Data
if (req->bodyType == Request::RBT_CONTENT_LENGTH) {
SKC_TRACE(client, 3, "Forwarding " << buffer.size() <<
" bytes of client request bod... | 0 | [
"CWE-20",
"CWE-476"
] | passenger | ddb8ecc4ebf260e4967f57f271d4f5761abeac3e | 274,844,203,184,755,980,000,000,000,000,000,000,000 | 61 | Fix CVE-2015-7519 header collision vulnerability |
int ha_partition::read_range_next()
{
DBUG_ENTER("ha_partition::read_range_next");
if (m_ordered_scan_ongoing)
{
DBUG_RETURN(handle_ordered_next(table->record[0], eq_range));
}
DBUG_RETURN(handle_unordered_next(table->record[0], eq_range));
} | 0 | [] | mysql-server | be901b60ae59c93848c829d1b0b2cb523ab8692e | 160,171,085,748,769,990,000,000,000,000,000,000,000 | 10 | Bug#26390632: CREATE TABLE CAN CAUSE MYSQL TO EXIT.
Analysis
========
CREATE TABLE of InnoDB table with a partition name
which exceeds the path limit can cause the server
to exit.
During the preparation of the partition name,
there was no check to identify whether the complete
path name for partition exceeds the max ... |
static void kvmgt_detach_vgpu(void *p_vgpu)
{
int i;
struct intel_vgpu *vgpu = (struct intel_vgpu *)p_vgpu;
if (!vgpu->vdev.region)
return;
for (i = 0; i < vgpu->vdev.num_regions; i++)
if (vgpu->vdev.region[i].ops->release)
vgpu->vdev.region[i].ops->release(vgpu,
&vgpu->vdev.region[i]);
vgpu->vdev.nu... | 0 | [
"CWE-20"
] | linux | 51b00d8509dc69c98740da2ad07308b630d3eb7d | 328,357,644,710,806,650,000,000,000,000,000,000,000 | 16 | drm/i915/gvt: Fix mmap range check
This is to fix missed mmap range check on vGPU bar2 region
and only allow to map vGPU allocated GMADDR range, which means
user space should support sparse mmap to get proper offset for
mmap vGPU aperture. And this takes care of actual pgoff in mmap
request as original code always doe... |
double ensure_font_size(ASS_Renderer *priv, double size)
{
if (size < 1)
size = 1;
else if (size > priv->height * 2)
size = priv->height * 2;
return size;
} | 0 | [] | libass | 6835731c2fe4164a0c50bc91d12c43b2a2b4e799 | 134,550,545,325,733,940,000,000,000,000,000,000,000 | 9 | parse_tags: don't recurse for nested \t()
This fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4892
(stack overflow on deeply nested \t()).
This is possible because parentheses do not nest and the first ')'
terminates the whole tag. Thus something like \t(\t(\t(\t(\t() can be
read in a simple loop with no... |
static int smack_inode_setxattr(struct dentry *dentry, const char *name,
const void *value, size_t size, int flags)
{
struct smk_audit_info ad;
int rc = 0;
if (strcmp(name, XATTR_NAME_SMACK) == 0 ||
strcmp(name, XATTR_NAME_SMACKIPIN) == 0 ||
strcmp(name, XATTR_NAME_SMACKIPOUT) == 0) {
if (!capable(C... | 0 | [] | linux-2.6 | ee18d64c1f632043a02e6f5ba5e045bb26a5465f | 178,160,823,143,464,570,000,000,000,000,000,000,000 | 29 | 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... |
cosine_seek_read(wtap *wth, gint64 seek_off, struct wtap_pkthdr *phdr,
Buffer *buf, int *err, gchar **err_info)
{
int pkt_len;
char line[COSINE_LINE_LENGTH];
if (file_seek(wth->random_fh, seek_off, SEEK_SET, err) == -1)
return FALSE;
if (file_gets(line, COSINE_LINE_LENGTH, wth->random_fh) == NULL) {
*err = f... | 1 | [
"CWE-119",
"CWE-787"
] | wireshark | f5ec0afb766f19519ea9623152cca3bbe2229500 | 236,887,844,733,226,500,000,000,000,000,000,000,000 | 26 | Fix packet length handling.
Treat the packet length as unsigned - it shouldn't be negative in the
file. If it is, that'll probably cause the sscanf to fail, so we'll
report the file as bad.
Check it against WTAP_MAX_PACKET_SIZE to make sure we don't try to
allocate a huge amount of memory, just as we do in other fil... |
int btrfs_drop_inode(struct inode *inode)
{
struct btrfs_root *root = BTRFS_I(inode)->root;
if (root == NULL)
return 1;
/* the snap/subvol tree is on deleting */
if (btrfs_root_refs(&root->root_item) == 0)
return 1;
else
return generic_drop_inode(inode);
} | 0 | [
"CWE-200"
] | linux | 0305cd5f7fca85dae392b9ba85b116896eb7c1c7 | 52,919,771,327,240,130,000,000,000,000,000,000,000 | 13 | Btrfs: fix truncation of compressed and inlined extents
When truncating a file to a smaller size which consists of an inline
extent that is compressed, we did not discard (or made unusable) the
data between the new file size and the old file size, wasting metadata
space and allowing for the truncated data to be leaked... |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
auto* params =
reinterpret_cast<TfLiteDepthToSpaceParams*>(node->builtin_data);
const TfLiteEvalTensor* input =
tflite::micro::GetEvalInput(context, node, kInputTensor);
TfLiteEvalTensor* output =
tflite::micro::GetEvalOutput(context... | 0 | [
"CWE-369"
] | tensorflow | 106d8f4fb89335a2c52d7c895b7a7485465ca8d9 | 106,495,546,331,703,300,000,000,000,000,000,000,000 | 36 | Prevent division by 0 in TFLite
PiperOrigin-RevId: 370800311
Change-Id: I21ccdbd31c30118acc67df8751807ee2e0b12f91 |
CImg<T> get_shared_row(const unsigned int y0, const unsigned int z0=0, const unsigned int c0=0) {
return get_shared_rows(y0,y0,z0,c0);
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 157,888,416,095,470,240,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. |
FilterStateWrapper(const StreamInfo::FilterState& filter_state) : filter_state_(filter_state) {} | 0 | [] | envoy | 2c60632d41555ec8b3d9ef5246242be637a2db0f | 145,305,324,231,385,440,000,000,000,000,000,000,000 | 1 | http: header map security fixes for duplicate headers (#197)
Previously header matching did not match on all headers for
non-inline headers. This patch changes the default behavior to
always logically match on all headers. Multiple individual
headers will be logically concatenated with ',' similar to what
is done with... |
static void ExportIndexQuantum(const Image *image,QuantumInfo *quantum_info,
const MagickSizeType number_pixels,const Quantum *magick_restrict p,
unsigned char *magick_restrict q,ExceptionInfo *exception)
{
ssize_t
x;
ssize_t
bit;
if (image->storage_class != PseudoClass)
{
(void) ThrowMagi... | 1 | [
"CWE-190"
] | ImageMagick | 5af1dffa4b6ab984b5f13d1e91c95760d75f12a6 | 221,258,041,127,298,450,000,000,000,000,000,000,000 | 166 | outside the range of representable values of type 'unsigned char' (#3083)
Co-authored-by: Zhang Xiaohui <ruc_zhangxiaohui@163.com> |
static void vmx_complete_interrupts(struct vcpu_vmx *vmx)
{
__vmx_complete_interrupts(&vmx->vcpu, vmx->idt_vectoring_info,
VM_EXIT_INSTRUCTION_LEN,
IDT_VECTORING_ERROR_CODE);
} | 0 | [] | kvm | a642fc305053cc1c6e47e4f4df327895747ab485 | 57,593,508,779,124,250,000,000,000,000,000,000,000 | 6 | kvm: vmx: handle invvpid vm exit gracefully
On systems with invvpid instruction support (corresponding bit in
IA32_VMX_EPT_VPID_CAP MSR is set) guest invocation of invvpid
causes vm exit, which is currently not handled and results in
propagation of unknown exit to userspace.
Fix this by installing an invvpid vm exit ... |
void Compute(OpKernelContext* context) override {
const auto& input = context->input(0);
auto flat_in = input.flat<tstring>();
int fixed_length;
const auto& length_input = context->input(1);
OP_REQUIRES(context, TensorShapeUtils::IsScalar(length_input.shape()),
errors::InvalidArgu... | 1 | [
"CWE-787"
] | tensorflow | 698e01511f62a3c185754db78ebce0eee1f0184d | 146,552,813,611,946,800,000,000,000,000,000,000,000 | 72 | Fix `tf.io.decode_raw` bugs and update documentation.
Fixes cases where specifying `fixed_length` resulted in data loss and even segfault and corruption of the Python interpreter. The fix is subtle but needed due to pointer arithmetic rules.
Makes sure that `fixed_length` does not change the output when present but n... |
i64 get_ram(rzip_control *control)
{
i64 ramsize;
FILE *meminfo;
char aux[256];
ramsize = (i64)sysconf(_SC_PHYS_PAGES) * PAGE_SIZE;
if (ramsize > 0)
return ramsize;
/* Workaround for uclibc which doesn't properly support sysconf */
if(!(meminfo = fopen("/proc/meminfo", "r")))
fatal_return(("fopen\n"), -1);... | 0 | [
"CWE-703"
] | lrzip | 4b3942103b57c639c8e0f31d6d5fd7bac53bbdf4 | 278,988,597,159,615,800,000,000,000,000,000,000,000 | 26 | Fix possible race condition between zpaq_decompress_buf() and clear_rulist() function as reported by wcventure. |
SG_Exception::~SG_Exception() {} | 0 | [
"CWE-787"
] | gdal | 767e3a56144f676ca738ef8f700e0e56035bd05a | 103,922,490,403,034,920,000,000,000,000,000,000,000 | 1 | netCDF: avoid buffer overflow. master only. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=15143. Credit to OSS Fuzz |
char* encode_base64(byte* src,size_t ssize)
{
char* outbuf;
int pos;
int i, l, left;
unsigned long triple;
byte *inb;
/* Exit on empty input */
if (!ssize||src==NULL){
log_msg(LOG_LEVEL_DEBUG,"encode base64: empty string");
return NULL;
}
/* length of encoded base64 string (padded) */
si... | 0 | [
"CWE-787"
] | aide | 175d1f2626f4500b4fc5ecb7167bba9956b174bc | 164,577,173,542,843,230,000,000,000,000,000,000,000 | 81 | Precalculate buffer size in base64 functions
Aide uses a fixed size (16k bytes) for the return buffer in
encode_base64/decode_base64 functions. This results in a segfault if
aide processes a file with too large extended attribute value or ACL.
Fix this issue by precalculating the size of the return buffer depending o... |
static int collect_events(struct perf_event *group, int max_count,
struct perf_event *ctrs[], u64 *events,
unsigned int *flags)
{
int n = 0;
struct perf_event *event;
if (group->pmu->task_ctx_nr == perf_hw_context) {
if (n >= max_count)
return -1;
ctrs[n] = group;
flags[n] = group->hw.event_base;... | 0 | [
"CWE-476"
] | linux | 60b7ed54a41b550d50caf7f2418db4a7e75b5bdc | 299,582,562,943,241,950,000,000,000,000,000,000,000 | 26 | powerpc/perf: Fix crash in perf_instruction_pointer() when ppmu is not set
On systems without any specific PMU driver support registered, running
perf record causes Oops.
The relevant portion from call trace:
BUG: Kernel NULL pointer dereference on read at 0x00000040
Faulting instruction address: 0xc0021f0c
Oo... |
void rtnl_close(struct rtnl_handle *rth)
{
if (rth->fd >= 0) {
close(rth->fd);
rth->fd = -1;
}
} | 0 | [] | iproute2 | 8c50b728b226f6254251282697ce38a72639a6fc | 17,196,114,111,715,402,000,000,000,000,000,000,000 | 7 | libnetlink: fix use-after-free of message buf
In __rtnl_talk_iov() main loop, err is a pointer to memory in dynamically
allocated 'buf' that is used to store netlink messages. If netlink message
is an error message, buf is deallocated before returning with error code.
However, on return err->error code is checked one ... |
verify_type_compatibility (VerifyContext *ctx, MonoType *target, MonoType *candidate)
{
return verify_type_compatibility_full (ctx, target, candidate, FALSE);
} | 0 | [
"CWE-20"
] | mono | 4905ef1130feb26c3150b28b97e4a96752e0d399 | 34,350,419,374,724,635,000,000,000,000,000,000,000 | 4 | Handle invalid instantiation of generic methods.
* verify.c: Add new function to internal verifier API to check
method instantiations.
* reflection.c (mono_reflection_bind_generic_method_parameters):
Check the instantiation before returning it.
Fixes #655847 |
int udf_write_inode(struct inode *inode, struct writeback_control *wbc)
{
return udf_update_inode(inode, wbc->sync_mode == WB_SYNC_ALL);
} | 0 | [
"CWE-476"
] | linux | 7fc3b7c2981bbd1047916ade327beccb90994eee | 85,973,673,408,621,070,000,000,000,000,000,000,000 | 4 | udf: Fix NULL ptr deref when converting from inline format
udf_expand_file_adinicb() calls directly ->writepage to write data
expanded into a page. This however misses to setup inode for writeback
properly and so we can crash on inode->i_wb dereference when submitting
page for IO like:
BUG: kernel NULL pointer dere... |
_glat_iterator(const void * glat=0) : _e(reinterpret_cast<const byte *>(glat)), _v(_e+2*sizeof(W)), _n(0) {} | 0 | [
"CWE-476"
] | graphite | db132b4731a9b4c9534144ba3a18e65b390e9ff6 | 91,985,188,843,836,470,000,000,000,000,000,000,000 | 1 | Deprecate and make ineffective gr_face_dumbRendering |
dissect_kafka_write_txn_markers_request_topic(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int offset, kafka_api_version_t api_version)
{
int topic_start, topic_len;
proto_item *subti, *subsubti;
proto_tree *subtree, *subsubtree;
subtree = proto_tree_a... | 0 | [
"CWE-401"
] | wireshark | f4374967bbf9c12746b8ec3cd54dddada9dd353e | 174,229,439,467,746,140,000,000,000,000,000,000,000 | 23 | Kafka: Limit our decompression size.
Don't assume that the Internet has our best interests at heart when it
gives us the size of our decompression buffer. Assign an arbitrary limit
of 50 MB.
This fixes #16739 in that it takes care of
** (process:17681): WARNING **: 20:03:07.440: Dissector bug, protocol Kafka, in pac... |
static BROTLI_INLINE void StoreBlockSwitch(BlockSplitCode* code,
const uint32_t block_len,
const uint8_t block_type,
BROTLI_BOOL is_first_block,
siz... | 0 | [
"CWE-120"
] | brotli | 223d80cfbec8fd346e32906c732c8ede21f0cea6 | 325,993,277,136,158,160,000,000,000,000,000,000,000 | 20 | Update (#826)
* IMPORTANT: decoder: fix potential overflow when input chunk is >2GiB
* simplify max Huffman table size calculation
* eliminate symbol duplicates (static arrays in .h files)
* minor combing in research/ code |
fascist_firewall_allows_md_impl(const microdesc_t *md,
firewall_connection_t fw_connection,
int pref_only, int pref_ipv6)
{
if (!md) {
return 0;
}
/* Can't check dirport, it doesn't have one */
if (fw_connection == FIREWALL_DIR_CONNECTION) {
... | 0 | [] | tor | 1afc2ed956a35b40dfd1d207652af5b50c295da7 | 91,647,587,424,037,960,000,000,000,000,000,000,000 | 18 | Fix policies.c instance of the "if (r=(a-b)) return r" pattern
I think this one probably can't underflow, since the input ranges
are small. But let's not tempt fate.
This patch also replaces the "cmp" functions here with just "eq"
functions, since nothing actually checked for anything besides 0 and
nonzero.
Related... |
int am_read_post_data(request_rec *r, char **data, apr_size_t *length)
{
apr_size_t bytes_read;
apr_size_t bytes_left;
apr_size_t len;
long read_length;
int rc;
/* Prepare to receive data from the client. We request that apache
* dechunks data if it is chunked.
*/
rc = ap_setup_cl... | 0 | [
"CWE-200"
] | mod_auth_mellon | 47a767d5f37d1d3a1c004abbf8bb80d1b7eab328 | 315,081,720,567,585,770,000,000,000,000,000,000,000 | 56 | Ensure that all generated session IDs are cryptographically strong.
We used to call RAND_pseudo_bytes, which will generate cryptographically
strong random bytes in most cases. Under memory pressure or other error
conditions, it can return weak random bytes.
It is unlikely that there is a way for an attacker to set up... |
bool fuse_req_realloc_pages(struct fuse_conn *fc, struct fuse_req *req,
gfp_t flags)
{
struct page **pages;
struct fuse_page_desc *page_descs;
unsigned int npages = min_t(unsigned int,
max_t(unsigned int, req->max_pages * 2,
FUSE_DEFAULT_MAX_PAGES_PER_REQ),
fc->max_pages);
WARN_ON(npag... | 0 | [
"CWE-416"
] | linux | 15fab63e1e57be9fdb5eec1bbc5916e9825e9acb | 203,731,698,865,336,250,000,000,000,000,000,000,000 | 25 | fs: prevent page refcount overflow in pipe_buf_get
Change pipe_buf_get() to return a bool indicating whether it succeeded
in raising the refcount of the page (if the thing in the pipe is a page).
This removes another mechanism for overflowing the page refcount. All
callers converted to handle a failure.
Reported-by:... |
static struct sk_buff *l2cap_build_cmd(struct l2cap_conn *conn, u8 code,
u8 ident, u16 dlen, void *data)
{
struct sk_buff *skb, **frag;
struct l2cap_cmd_hdr *cmd;
struct l2cap_hdr *lh;
int len, count;
BT_DBG("conn %p, code 0x%2.2x, ident 0x%2.2x, len %u",
conn, code, ident, dlen);
if (conn->m... | 0 | [
"CWE-787"
] | linux | e860d2c904d1a9f38a24eb44c9f34b8f915a6ea3 | 326,716,963,764,934,130,000,000,000,000,000,000,000 | 65 | Bluetooth: Properly check L2CAP config option output buffer length
Validate the output buffer length for L2CAP config requests and responses
to avoid overflowing the stack buffer used for building the option blocks.
Cc: stable@vger.kernel.org
Signed-off-by: Ben Seri <ben@armis.com>
Signed-off-by: Marcel Holtmann <mar... |
static inline bool retp_compiler(void)
{
return __is_defined(RETPOLINE);
} | 0 | [
"CWE-362"
] | linux | fdf82a7856b32d905c39afc85e34364491e46346 | 327,127,385,058,202,650,000,000,000,000,000,000,000 | 4 | x86/speculation: Protect against userspace-userspace spectreRSB
The article "Spectre Returns! Speculation Attacks using the Return Stack
Buffer" [1] describes two new (sub-)variants of spectrev2-like attacks,
making use solely of the RSB contents even on CPUs that don't fallback to
BTB on RSB underflow (Skylake+).
... |
cleanup_func_redirects (list)
REDIRECT *list;
{
do_redirections (list, RX_ACTIVE);
} | 0 | [] | bash | 955543877583837c85470f7fb8a97b7aa8d45e6c | 92,227,095,647,920,760,000,000,000,000,000,000,000 | 5 | bash-4.4-rc2 release |
void fp_mod_2d(fp_int *a, int b, fp_int *c)
{
int x;
/* zero if count less than or equal to zero */
if (b <= 0) {
fp_zero(c);
return;
}
/* get copy of input */
fp_copy(a, c);
/* if 2**d is larger than we just return */
if (b >= (DIGIT_BIT * a->used)) {
return;
}
/* zer... | 0 | [
"CWE-326",
"CWE-203"
] | wolfssl | 1de07da61f0c8e9926dcbd68119f73230dae283f | 128,990,291,394,263,540,000,000,000,000,000,000,000 | 26 | Constant time EC map to affine for private operations
For fast math, use a constant time modular inverse when mapping to
affine when operation involves a private key - key gen, calc shared
secret, sign. |
compose_group16_nonknockout_nonblend_isolated_mask_common(uint16_t *tos_ptr, bool tos_isolated, int tos_planestride, int tos_rowstride, uint16_t alpha, uint16_t shape,
gs_blend_mode_t blend_mode, bool tos_has_shape, int tos_shape_offset, int tos_alpha_g_offset, int tos_tag_offset, bool tos_has_tag,
... | 0 | [
"CWE-476"
] | ghostpdl | 7870f4951bcc6a153f317e3439e14d0e929fd231 | 124,794,753,451,321,830,000,000,000,000,000,000,000 | 93 | Bug 701795: Segv due to image mask issue |
hup_init_nhwindows(argc_p, argv)
int *argc_p UNUSED;
char **argv UNUSED;
{
iflags.window_inited = 1;
} | 0 | [
"CWE-120",
"CWE-269"
] | NetHack | f3def5c0b999478da2d0a8f0b6a7c370a2065f77 | 236,046,368,324,550,130,000,000,000,000,000,000,000 | 6 | command line triggered buffer overruns
Prevent extremely long command line arguments from overflowing local
buffers in raw_printf or config_error_add. The increased buffer
sizes they recently got to deal with long configuration file values
aren't sufficient to handle command line induced overflows.
choose_windows(co... |
static int local_ata_check_ready(struct ata_link *link)
{
struct ata_port *ap = link->ap;
struct domain_device *dev = ap->private_data;
struct sas_internal *i = dev_to_sas_internal(dev);
if (i->dft->lldd_ata_check_ready)
return i->dft->lldd_ata_check_ready(dev);
else {
/* lldd's that don't implement 'ready' c... | 0 | [
"CWE-284"
] | linux | 0558f33c06bb910e2879e355192227a8e8f0219d | 303,701,901,849,036,730,000,000,000,000,000,000,000 | 16 | scsi: libsas: direct call probe and destruct
In commit 87c8331fcf72 ("[SCSI] libsas: prevent domain rediscovery
competing with ata error handling") introduced disco mutex to prevent
rediscovery competing with ata error handling and put the whole
revalidation in the mutex. But the rphy add/remove needs to wait for the
... |
static xmlNodePtr to_xml_datetime(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
{
return to_xml_datetime_ex(type, data, "%Y-%m-%dT%H:%M:%S", style, parent TSRMLS_CC);
} | 0 | [
"CWE-19"
] | php-src | c8eaca013a3922e8383def6158ece2b63f6ec483 | 168,692,223,839,228,320,000,000,000,000,000,000,000 | 4 | Added type checks |
static struct socket *sock_from_file(struct file *file, int *err)
{
if (file->f_op == &socket_file_ops)
return file->private_data; /* set in sock_map_fd */
*err = -ENOTSOCK;
return NULL;
} | 0 | [] | linux-2.6 | 644595f89620ba8446cc555be336d24a34464950 | 269,110,668,681,355,170,000,000,000,000,000,000,000 | 8 | compat: Handle COMPAT_USE_64BIT_TIME in net/socket.c
Use helper functions aware of COMPAT_USE_64BIT_TIME to write struct
timeval and struct timespec to userspace in net/socket.c.
Signed-off-by: H. Peter Anvin <hpa@zytor.com> |
acceptableEncoding()
{
static Str encodings = NULL;
struct compression_decoder *d;
TextList *l;
char *p;
if (encodings != NULL)
return encodings->ptr;
l = newTextList();
for (d = compression_decoders; d->type != CMP_NOCOMPRESS; d++) {
if (check_command(d->cmd, d->auxbin_p)) {
pushTex... | 0 | [
"CWE-476"
] | w3m | 59b91cd8e30c86f23476fa81ae005cabff49ebb6 | 110,131,963,726,123,660,000,000,000,000,000,000,000 | 23 | Prevent segfault with malformed input type
Bug-Debian: https://github.com/tats/w3m/issues/7 |
const char*oidc_request_state_get(request_rec *r, const char *key) {
/* get a handle to the global state, which is a table */
apr_table_t *state = oidc_request_state(r);
/* return the value from the table */
return apr_table_get(state, key);
} | 0 | [
"CWE-20"
] | mod_auth_openidc | 612e309bfffd6f9b8ad7cdccda3019fc0865f3b4 | 184,220,510,696,078,140,000,000,000,000,000,000,000 | 8 | don't echo query params on invalid requests to redirect URI; closes #212
thanks @LukasReschke; I'm sure there's some OWASP guideline that warns
against this |
void ssl_set_own_cert_alt( ssl_context *ssl, x509_cert *own_cert,
void *rsa_key,
rsa_decrypt_func rsa_decrypt,
rsa_sign_func rsa_sign,
rsa_key_len_func rsa_key_len )
{
ssl->own_cert = own_cert;
ssl->rsa... | 0 | [
"CWE-310"
] | polarssl | 4582999be608c9794d4518ae336b265084db9f93 | 248,831,809,247,386,850,000,000,000,000,000,000,000 | 12 | Fixed timing difference resulting from badly formatted padding. |
void *kmem_cache_alloc(struct kmem_cache *s, gfp_t gfpflags)
{
void *ret = slab_alloc(s, gfpflags, _RET_IP_);
trace_kmem_cache_alloc(_RET_IP_, ret, s->object_size,
s->size, gfpflags);
return ret;
} | 0 | [] | linux | fd4d9c7d0c71866ec0c2825189ebd2ce35bd95b8 | 253,538,092,732,308,280,000,000,000,000,000,000,000 | 9 | mm: slub: add missing TID bump in kmem_cache_alloc_bulk()
When kmem_cache_alloc_bulk() attempts to allocate N objects from a percpu
freelist of length M, and N > M > 0, it will first remove the M elements
from the percpu freelist, then call ___slab_alloc() to allocate the next
element and repopulate the percpu freelis... |
static void cdeque_free(struct cdeque* d) {
if(!d)
return;
if(!d->arr)
return;
free(d->arr);
d->arr = NULL;
d->beg_pos = -1;
d->end_pos = -1;
d->cap_mask = 0;
} | 0 | [
"CWE-20",
"CWE-125"
] | libarchive | 94821008d6eea81e315c5881cdf739202961040a | 326,496,892,233,416,450,000,000,000,000,000,000,000 | 14 | RAR5 reader: reject files that declare invalid header flags
One of the fields in RAR5's base block structure is the size of the
header. Some invalid files declare a 0 header size setting, which can
confuse the unpacker. Minimum header size for RAR5 base blocks is 7
bytes (4 bytes for CRC, and 3 bytes for the rest), so... |
static int userfaultfd_release(struct inode *inode, struct file *file)
{
struct userfaultfd_ctx *ctx = file->private_data;
struct mm_struct *mm = ctx->mm;
struct vm_area_struct *vma, *prev;
/* len == 0 means wake all */
struct userfaultfd_wake_range range = { .len = 0, };
unsigned long new_flags;
ACCESS_ONCE(ct... | 0 | [
"CWE-416"
] | linux | 384632e67e0829deb8015ee6ad916b180049d252 | 290,427,657,273,968,820,000,000,000,000,000,000,000 | 65 | userfaultfd: non-cooperative: fix fork use after free
When reading the event from the uffd, we put it on a temporary
fork_event list to detect if we can still access it after releasing and
retaking the event_wqh.lock.
If fork aborts and removes the event from the fork_event all is fine as
long as we're still in the u... |
static int common_getxattr(struct fuse *f, fuse_req_t req, fuse_ino_t ino,
const char *name, char *value, size_t size)
{
int err;
char *path;
err = -ENOENT;
pthread_rwlock_rdlock(&f->tree_lock);
path = get_path(f, ino);
if (path != NULL) {
struct fuse_intr_dat... | 0 | [] | ntfs-3g | fb28eef6f1c26170566187c1ab7dc913a13ea43c | 300,377,664,394,430,800,000,000,000,000,000,000,000 | 19 | Hardened the checking of directory offset requested by a readdir
When asked for the next directory entries, make sure the chunk offset
is within valid values, otherwise return no more entries in chunk. |
static void sctp_bucket_destroy(struct sctp_bind_bucket *pp)
{
if (pp && hlist_empty(&pp->owner)) {
__hlist_del(&pp->node);
kmem_cache_free(sctp_bucket_cachep, pp);
SCTP_DBG_OBJCNT_DEC(bind_bucket);
}
} | 0 | [] | linux-2.6 | 5e739d1752aca4e8f3e794d431503bfca3162df4 | 8,179,733,462,829,482,000,000,000,000,000,000,000 | 8 | sctp: fix potential panics in the SCTP-AUTH API.
All of the SCTP-AUTH socket options could cause a panic
if the extension is disabled and the API is envoked.
Additionally, there were some additional assumptions that
certain pointers would always be valid which may not
always be the case.
This patch hardens the API a... |
TIFFjpeg_read_raw_data(JPEGState* sp, JSAMPIMAGE data, int max_lines)
{
return CALLJPEG(sp, -1, (int) jpeg_read_raw_data(&sp->cinfo.d,
data, (JDIMENSION) max_lines));
} | 0 | [
"CWE-369"
] | libtiff | 47f2fb61a3a64667bce1a8398a8fcb1b348ff122 | 34,868,983,081,951,373,000,000,000,000,000,000,000 | 5 | * libtiff/tif_jpeg.c: avoid integer division by zero in
JPEGSetupEncode() when horizontal or vertical sampling is set to 0.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2653 |
f_test_getvalue(typval_T *argvars, typval_T *rettv)
{
if (in_vim9script() && check_for_string_arg(argvars, 0) == FAIL)
return;
if (argvars[0].v_type != VAR_STRING)
emsg(_(e_invalid_argument));
else
{
char_u *name = tv_get_string(&argvars[0]);
if (STRCMP(name, (char_u *)"need_fileinfo") == 0)
... | 0 | [
"CWE-121",
"CWE-787"
] | vim | 34f8117dec685ace52cd9e578e2729db278163fc | 298,678,521,544,612,020,000,000,000,000,000,000,000 | 17 | patch 8.2.4397: crash when using many composing characters in error message
Problem: Crash when using many composing characters in error message.
Solution: Use mb_cptr2char_adv() instead of mb_ptr2char_adv(). |
static void kvm_vcpu_ioctl_x86_get_debugregs(struct kvm_vcpu *vcpu,
struct kvm_debugregs *dbgregs)
{
memcpy(dbgregs->db, vcpu->arch.db, sizeof(vcpu->arch.db));
dbgregs->dr6 = vcpu->arch.dr6;
dbgregs->dr7 = vcpu->arch.dr7;
dbgregs->flags = 0;
} | 1 | [
"CWE-200"
] | kvm | 831d9d02f9522e739825a51a11e3bc5aa531a905 | 36,600,902,219,981,106,000,000,000,000,000,000,000 | 8 | KVM: x86: fix information leak to userland
Structures kvm_vcpu_events, kvm_debugregs, kvm_pit_state2 and
kvm_clock_data are copied to userland with some padding and reserved
fields unitialized. It leads to leaking of contents of kernel stack
memory. We have to initialize them to zero.
In patch v1 Jan Kiszka suggest... |
f_getqflist(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
#ifdef FEAT_QUICKFIX
get_qf_loc_list(TRUE, NULL, &argvars[0], rettv);
#endif
} | 0 | [
"CWE-78"
] | vim | 8c62a08faf89663e5633dc5036cd8695c80f1075 | 177,995,747,163,614,400,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. |
static int nl80211_dump_survey(struct sk_buff *skb, struct netlink_callback *cb)
{
struct nlattr **attrbuf;
struct survey_info survey;
struct cfg80211_registered_device *rdev;
struct wireless_dev *wdev;
int survey_idx = cb->args[2];
int res;
bool radio_stats;
attrbuf = kcalloc(NUM_NL80211_ATTR, sizeof(*attrbuf... | 0 | [
"CWE-120"
] | linux | f88eb7c0d002a67ef31aeb7850b42ff69abc46dc | 114,781,589,587,935,060,000,000,000,000,000,000,000 | 62 | nl80211: validate beacon head
We currently don't validate the beacon head, i.e. the header,
fixed part and elements that are to go in front of the TIM
element. This means that the variable elements there can be
malformed, e.g. have a length exceeding the buffer size, but
most downstream code from this assumes that thi... |
void LinkResolver::resolve_dynamic_call(CallInfo& result,
int pool_index,
Handle bootstrap_specifier,
Symbol* method_name, Symbol* method_signature,
Klass* curr... | 0 | [] | jdk11u | 132745902a4601dc64b2c8ca112ca30292feccb4 | 192,168,479,728,903,900,000,000,000,000,000,000,000 | 22 | 8281866: Enhance MethodHandle invocations
Reviewed-by: mbaesken
Backport-of: d974d9da365f787f67971d88c79371c8b0769f75 |
static void renameParseCleanup(Parse *pParse){
sqlite3 *db = pParse->db;
Index *pIdx;
if( pParse->pVdbe ){
sqlite3VdbeFinalize(pParse->pVdbe);
}
sqlite3DeleteTable(db, pParse->pNewTable);
while( (pIdx = pParse->pNewIndex)!=0 ){
pParse->pNewIndex = pIdx->pNext;
sqlite3FreeIndex(db, pIdx);
}
s... | 0 | [
"CWE-674",
"CWE-787"
] | sqlite | 38096961c7cd109110ac21d3ed7dad7e0cb0ae06 | 107,319,836,201,667,150,000,000,000,000,000,000,000 | 16 | Avoid infinite recursion in the ALTER TABLE code when a view contains an unused CTE that references, directly or indirectly, the view itself.
FossilOrigin-Name: 1d2e53a39b87e364685e21de137655b6eee725e4c6d27fc90865072d7c5892b5 |
inline uint8_t* WireFormatLite::WriteSInt64ToArray(
int field_number, const RepeatedField<int64_t>& value, uint8_t* target) {
return WritePrimitiveToArray(field_number, value, WriteSInt64ToArray, target);
} | 0 | [
"CWE-703"
] | protobuf | d1635e1496f51e0d5653d856211e8821bc47adc4 | 84,348,839,162,761,930,000,000,000,000,000,000,000 | 4 | Apply patch |
STATIC LONG WINAPI GC_write_fault_handler(
struct _EXCEPTION_POINTERS *exc_info)
# endif /* MSWIN32 || MSWINCE */
{
# if !defined(MSWIN32) && !defined(MSWINCE)
char *addr = si -> si_addr;
# else
char * addr = (char *) (exc_info -> ExceptionRecord
... | 0 | [
"CWE-119"
] | bdwgc | 7292c02fac2066d39dd1bcc37d1a7054fd1e32ee | 3,456,599,231,931,742,000,000,000,000,000,000,000 | 114 | 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... |
u16 capi20_get_profile(u32 contr, struct capi_profile *profp)
{
struct capi_ctr *ctr;
u16 ret;
if (contr == 0) {
profp->ncontroller = ncontrollers;
return CAPI_NOERROR;
}
mutex_lock(&capi_controller_lock);
ctr = get_capi_ctr_by_nr(contr);
if (ctr && ctr->state == CAPI_CTR_RUNNING) {
memcpy(profp, &ctr->... | 0 | [
"CWE-125"
] | linux | 1f3e2e97c003f80c4b087092b225c8787ff91e4d | 294,037,578,659,067,330,000,000,000,000,000,000,000 | 22 | isdn: cpai: check ctr->cnr to avoid array index out of bound
The cmtp_add_connection() would add a cmtp session to a controller
and run a kernel thread to process cmtp.
__module_get(THIS_MODULE);
session->task = kthread_run(cmtp_session, session, "kcmtpd_ctr_%d",
session->num);
During this process, the ker... |
analyze_window_size_store(GtkWidget *win, gpointer user_data)
{
gint32 xy[2];
GVariant *var;
gboolean is_max;
if (!screen.settings)
return;
is_max = FALSE != (GDK_WINDOW_STATE_MAXIMIZED &
gdk_window_get_state (gtk_widget_get_window (win)));
if (is_max)
return;
gtk_window_get_size (GTK_WINDOW (win), (gi... | 0 | [
"CWE-200"
] | gerbv | 319a8af890e4d0a5c38e6d08f510da8eefc42537 | 136,413,321,597,913,430,000,000,000,000,000,000,000 | 25 | Remove local alias to parameter array
Normalizing access to `gerbv_simplified_amacro_t::parameter` as a step to fix CVE-2021-40402 |
PyObject* PyTapeTensor::ZerosLike() const {
if (GetDType() == tensorflow::DT_RESOURCE) {
// Gradient functions for ops which return resource tensors accept
// None. This is the behavior of py_vspace->Zeros, but checking here avoids
// issues with ZerosLike.
Py_RETURN_NONE;
}
if (shape_.index() == ... | 0 | [
"CWE-476",
"CWE-908"
] | tensorflow | 237822b59fc504dda2c564787f5d3ad9c4aa62d9 | 44,302,464,951,908,840,000,000,000,000,000,000,000 | 18 | Fix tf.compat.v1.placeholder_with_default vulnerability with quantized types.
When iterating through the tensor to extract shape values, an underlying missing kernel
(`StridedSlice` for quantized types) causes an error, which then results in a `nullptr`
being passed to `ParseDimensionValue()`, causing a segfault.
The... |
static void unicode_escape_to_buffer(FBuffer *buffer, char buf[6], UTF16
character)
{
unicode_escape(buf, character);
fbuffer_append(buffer, buf, 6);
} | 0 | [
"CWE-119",
"CWE-787"
] | json | 8f782fd8e181d9cfe9387ded43a5ca9692266b85 | 246,673,937,152,580,920,000,000,000,000,000,000,000 | 6 | Fix arbitrary heap exposure problem |
static void entry_open_session(struct thread_smc_args *smc_args,
struct optee_msg_arg *arg, uint32_t num_params)
{
TEE_Result res;
TEE_ErrorOrigin err_orig = TEE_ORIGIN_TEE;
struct tee_ta_session *s = NULL;
TEE_Identity clnt_id;
TEE_UUID uuid;
struct tee_ta_param param;
size_t num_meta;
uint64_t saved... | 0 | [
"CWE-20",
"CWE-119",
"CWE-787"
] | optee_os | e3adcf566cb278444830e7badfdcc3983e334fd1 | 293,960,299,251,918,600,000,000,000,000,000,000,000 | 49 | core: ensure that supplied range matches MOBJ
In set_rmem_param() if the MOBJ is found by the cookie it's verified to
represent non-secure shared memory. Prior to this patch the supplied
sub-range to be used of the MOBJ was not checked here and relied on
later checks further down the chain. Those checks seems to be en... |
do_get_write_access(handle_t *handle, struct journal_head *jh,
int force_copy)
{
struct buffer_head *bh;
transaction_t *transaction = handle->h_transaction;
journal_t *journal;
int error;
char *frozen_buffer = NULL;
unsigned long start_lock, time_lock;
journal = transaction->t_journal;
jbd_debug(5, "journa... | 0 | [
"CWE-416"
] | linux | cc16eecae687912238ee6efbff71ad31e2bc414e | 79,200,573,427,991,020,000,000,000,000,000,000,000 | 191 | jbd2: fix use-after-free of transaction_t race
jbd2_journal_wait_updates() is called with j_state_lock held. But if
there is a commit in progress, then this transaction might get committed
and freed via jbd2_journal_commit_transaction() ->
jbd2_journal_free_transaction(), when we release j_state_lock.
So check for jou... |
void wait_task_inactive(struct task_struct *p)
{
unsigned long flags;
int running, on_rq;
struct rq *rq;
for (;;) {
/*
* We do the initial early heuristics without holding
* any task-queue locks at all. We'll only try to get
* the runqueue lock when things look like they will
* work out!
*/
rq =... | 0 | [] | linux-2.6 | 8f1bc385cfbab474db6c27b5af1e439614f3025c | 157,691,571,483,124,080,000,000,000,000,000,000,000 | 72 | sched: fair: weight calculations
In order to level the hierarchy, we need to calculate load based on the
root view. That is, each task's load is in the same unit.
A
/ \
B 1
/ \
2 3
To compute 1's load we do:
weight(1)
--------------
rq_weight(A)
To ... |
int SSL_set_ssl_method(SSL *s, const SSL_METHOD *meth)
{
int conn = -1;
int ret = 1;
if (s->method != meth) {
if (s->handshake_func != NULL)
conn = (s->handshake_func == s->method->ssl_connect);
if (s->method->version == meth->version)
s->method = meth;
else... | 0 | [
"CWE-310"
] | openssl | 56f1acf5ef8a432992497a04792ff4b3b2c6f286 | 144,671,944,727,904,400,000,000,000,000,000,000,000 | 24 | Disable SSLv2 default build, default negotiation and weak ciphers.
SSLv2 is by default disabled at build-time. Builds that are not
configured with "enable-ssl2" will not support SSLv2. Even if
"enable-ssl2" is used, users who want to negotiate SSLv2 via the
version-flexible SSLv23_method() will need to explicitly ca... |
TEST_F(HttpConnectionManagerImplTest, PerStreamIdleTimeoutAfterDownstreamHeaders) {
setup(false, "");
ON_CALL(route_config_provider_.route_config_->route_->route_entry_, idleTimeout())
.WillByDefault(Return(std::chrono::milliseconds(10)));
// Codec sends downstream request headers.
EXPECT_CALL(*codec_, d... | 0 | [
"CWE-400",
"CWE-703"
] | envoy | afc39bea36fd436e54262f150c009e8d72db5014 | 118,925,242,282,304,200,000,000,000,000,000,000,000 | 38 | 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... |
static int samldb_prim_group_change(struct samldb_ctx *ac)
{
struct ldb_context *ldb = ldb_module_get_ctx(ac->module);
const char * const attrs[] = {
"primaryGroupID",
"memberOf",
"userAccountControl",
NULL };
struct ldb_result *res, *group_res;
struct ldb_message_element *el;
struct ldb_message *msg;
uin... | 0 | [
"CWE-200"
] | samba | 0a3aa5f908e351201dc9c4d4807b09ed9eedff77 | 140,081,394,410,410,920,000,000,000,000,000,000,000 | 196 | CVE-2022-32746 ldb: Make use of functions for appending to an ldb_message
This aims to minimise usage of the error-prone pattern of searching for
a just-added message element in order to make modifications to it (and
potentially finding the wrong element).
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15009
Signed... |
static bool vmci_transport_stream_allow(u32 cid, u32 port)
{
static const u32 non_socket_contexts[] = {
VMADDR_CID_HYPERVISOR,
VMADDR_CID_RESERVED,
};
int i;
BUILD_BUG_ON(sizeof(cid) != sizeof(*non_socket_contexts));
for (i = 0; i < ARRAY_SIZE(non_socket_contexts); i++) {
if (cid == non_socket_contexts[i])... | 0 | [
"CWE-200"
] | linux | 680d04e0ba7e926233e3b9cee59125ce181f66ba | 112,985,483,632,616,370,000,000,000,000,000,000,000 | 17 | VSOCK: vmci - fix possible info leak in vmci_transport_dgram_dequeue()
In case we received no data on the call to skb_recv_datagram(), i.e.
skb->data is NULL, vmci_transport_dgram_dequeue() will return with 0
without updating msg_namelen leading to net/socket.c leaking the local,
uninitialized sockaddr_storage variabl... |
static VALUE cState_buffer_initial_length(VALUE self)
{
GET_STATE(self);
return LONG2FIX(state->buffer_initial_length);
} | 0 | [
"CWE-119",
"CWE-787"
] | json | 8f782fd8e181d9cfe9387ded43a5ca9692266b85 | 41,572,975,901,104,874,000,000,000,000,000,000,000 | 5 | Fix arbitrary heap exposure problem |
static void key_garbage_collector(struct work_struct *work)
{
struct rb_node *rb;
key_serial_t cursor;
struct key *key, *xkey;
time_t new_timer = LONG_MAX, limit;
kenter("");
if (test_and_set_bit(0, &key_gc_executing)) {
key_schedule_gc(current_kernel_time().tv_sec);
return;
}
limit = current_kernel_time... | 0 | [] | linux-2.6 | ee18d64c1f632043a02e6f5ba5e045bb26a5465f | 66,696,067,133,888,690,000,000,000,000,000,000,000 | 85 | 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 inline int map_signal(int sig)
{
if (current_thread_info()->exec_domain
&& current_thread_info()->exec_domain->signal_invmap
&& sig < 32)
return current_thread_info()->exec_domain->signal_invmap[sig];
else
return sig;
} | 0 | [] | linux-2.6 | ee18d64c1f632043a02e6f5ba5e045bb26a5465f | 227,566,801,943,958,100,000,000,000,000,000,000,000 | 9 | 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.