func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
put_bytes(FILE *fd, long_u nr, int len)
{
int i;
for (i = len - 1; i >= 0; --i)
if (putc((int)(nr >> (i * 8)), fd) == EOF)
return FAIL;
return OK;
} | 0 | [
"CWE-120"
] | vim | 7ce5b2b590256ce53d6af28c1d203fb3bc1d2d97 | 189,121,533,229,617,760,000,000,000,000,000,000,000 | 9 | patch 8.2.4969: changing text in Visual mode may cause invalid memory access
Problem: Changing text in Visual mode may cause invalid memory access.
Solution: Check the Visual position after making a change. |
tuplesort_getindextuple(Tuplesortstate *state, bool forward,
bool *should_free)
{
MemoryContext oldcontext = MemoryContextSwitchTo(state->sortcontext);
SortTuple stup;
if (!tuplesort_gettuple_common(state, forward, &stup, should_free))
stup.tuple = NULL;
MemoryContextSwitchTo(oldcontext);
return (IndexT... | 0 | [
"CWE-209"
] | postgres | 804b6b6db4dcfc590a468e7be390738f9f7755fb | 66,153,639,424,563,025,000,000,000,000,000,000,000 | 13 | Fix column-privilege leak in error-message paths
While building error messages to return to the user,
BuildIndexValueDescription, ExecBuildSlotValueDescription and
ri_ReportViolation would happily include the entire key or entire row in
the result returned to the user, even if the user didn't have access to
view all o... |
static inline int dl_bw_cpus(int i)
{
struct root_domain *rd = cpu_rq(i)->rd;
int cpus = 0;
for_each_cpu_and(i, rd->span, cpu_active_mask)
cpus++;
return cpus;
} | 0 | [
"CWE-200"
] | linux | 4efbc454ba68def5ef285b26ebfcfdb605b52755 | 256,865,562,622,895,750,000,000,000,000,000,000,000 | 10 | sched: Fix information leak in sys_sched_getattr()
We're copying the on-stack structure to userspace, but forgot to give
the right number of bytes to copy. This allows the calling process to
obtain up to PAGE_SIZE bytes from the stack (and possibly adjacent
kernel memory).
This fix copies only as much as we actually ... |
int imap_complete(char *buf, size_t buflen, const char *path)
{
struct ImapAccountData *adata = NULL;
struct ImapMboxData *mdata = NULL;
char tmp[2048];
struct ImapList listresp = { 0 };
char completion[1024];
int clen;
size_t matchlen = 0;
int completions = 0;
int rc;
if (imap_adata_find(path, &ad... | 0 | [
"CWE-522",
"CWE-287",
"CWE-755"
] | neomutt | 9c36717a3e2af1f2c1b7242035455ec8112b4b06 | 288,717,760,491,404,050,000,000,000,000,000,000,000 | 69 | imap: close connection on all failures
Thanks to Gabriel Salles-Loustau for spotting the problem.
Co-authored-by: Kevin McCarthy <kevin@8t8.us> |
static int wm_strncasecmp(const char *s1, const char *s2, size_t n) {
const char * p1 = s1;
const char * p2 = s2;
char c1, c2;
if (p1 == p2 || n == 0) return 0;
do {
c1 = wm_tolower (*p1++);
c2 = wm_tolower (*p2++);
if (c1 == '\0' || c1 != c2) break;
} while (--n > 0);
... | 0 | [
"CWE-200",
"CWE-119"
] | wildmidi | 814f31d8eceda8401eb812fc2e94ed143fdad0ab | 65,013,324,166,141,100,000,000,000,000,000,000,000 | 13 | wildmidi_lib.c (WildMidi_Open, WildMidi_OpenBuffer): refuse to proceed if less then 18 bytes of input
Fixes bug #178. |
GfxFont *GfxResources::lookupFont(char *name) {
GfxFont *font;
GfxResources *resPtr;
for (resPtr = this; resPtr; resPtr = resPtr->next) {
if (resPtr->fonts) {
if ((font = resPtr->fonts->lookup(name)))
return font;
}
}
error(-1, "Unknown font tag '%s'", name);
return NULL;
} | 0 | [] | poppler | abf167af8b15e5f3b510275ce619e6fdb42edd40 | 144,032,698,493,579,620,000,000,000,000,000,000,000 | 13 | Implement tiling/patterns in SplashOutputDev
Fixes bug 13518 |
init_job_options(jobopt_T *opt)
{
clear_job_options(opt);
opt->jo_mode = MODE_RAW;
opt->jo_out_mode = MODE_RAW;
opt->jo_err_mode = MODE_RAW;
opt->jo_set = JO_MODE | JO_OUT_MODE | JO_ERR_MODE;
} | 0 | [
"CWE-476"
] | vim | cd929f7ba8cc5b6d6dcf35c8b34124e969fed6b8 | 113,003,091,721,140,140,000,000,000,000,000,000,000 | 9 | patch 8.1.0633: crash when out of memory while opening a terminal window
Problem: Crash when out of memory while opening a terminal window.
Solution: Handle out-of-memory more gracefully. |
TPMI_RH_HIERARCHY_Unmarshal(TPMI_RH_HIERARCHY *target, BYTE **buffer, INT32 *size, BOOL allowNull)
{
TPM_RC rc = TPM_RC_SUCCESS;
if (rc == TPM_RC_SUCCESS) {
rc = TPM_HANDLE_Unmarshal(target, buffer, size);
}
if (rc == TPM_RC_SUCCESS) {
switch (*target) {
case TPM_RH_OWNER:
case TPM_RH_PLATFOR... | 1 | [
"CWE-787"
] | libtpms | 5cc98a62dc6f204dcf5b87c2ee83ac742a6a319b | 327,981,079,826,963,370,000,000,000,000,000,000,000 | 23 | tpm2: Restore original value if unmarshalled value was illegal
Restore the original value of the memory location where data from
a stream was unmarshalled and the unmarshalled value was found to
be illegal. The goal is to not keep illegal values in memory.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> |
uint size_of() const { return sizeof(*this); } | 0 | [
"CWE-416",
"CWE-703"
] | server | 08c7ab404f69d9c4ca6ca7a9cf7eec74c804f917 | 274,071,862,178,200,300,000,000,000,000,000,000,000 | 1 | MDEV-24176 Server crashes after insert in the table with virtual
column generated using date_format() and if()
vcol_info->expr is allocated on expr_arena at parsing stage. Since
expr item is allocated on expr_arena all its containee items must be
allocated on expr_arena too. Otherwise fix_session_expr() will
encounter... |
gsicc_new_devicen(gsicc_manager_t *icc_manager)
{
/* Allocate a new deviceN ICC profile entry in the deviceN list */
gsicc_devicen_entry_t *device_n_entry =
gs_alloc_struct(icc_manager->memory, gsicc_devicen_entry_t,
&st_gsicc_devicen_entry, "gsicc_new_devicen");
if (device_n_entry == NU... | 0 | [] | ghostpdl | 6d444c273da5499a4cd72f21cb6d4c9a5256807d | 297,594,119,565,477,940,000,000,000,000,000,000,000 | 31 | Bug 697178: Add a file permissions callback
For the rare occasions when the graphics library directly opens a file
(currently for reading), this allows us to apply any restrictions on
file access normally applied in the interpteter. |
void visit(CaptureScope & /*ope*/) override { name = "CaptureScope"; } | 0 | [
"CWE-125"
] | cpp-peglib | b3b29ce8f3acf3a32733d930105a17d7b0ba347e | 302,503,412,325,432,520,000,000,000,000,000,000,000 | 1 | Fix #122 |
QByteArray Cipher::blowfishECB(QByteArray cipherText, bool direction)
{
QCA::Initializer init;
QByteArray temp = cipherText;
//do padding ourselves
if (direction)
{
while ((temp.length() % 8) != 0) temp.append('\0');
}
else
{
temp = b64ToByte(temp);
while ((temp.... | 1 | [
"CWE-125"
] | quassel | 8b5ecd226f9208af3074b33d3b7cf5e14f55b138 | 265,013,214,695,046,000,000,000,000,000,000,000,000 | 29 | Check for invalid input in encrypted buffers
The ECB Blowfish decryption function assumed that encrypted input would
always come in blocks of 12 characters, as specified. However, buggy
clients or annoying people may not adhere to that assumption, causing
the core to crash while trying to process the invalid base64 in... |
validateForeignKeyConstraint(char *conname,
Relation rel,
Relation pkrel,
Oid pkindOid,
Oid constraintOid)
{
HeapScanDesc scan;
HeapTuple tuple;
Trigger trig;
Snapshot snapshot;
ereport(DEBUG1,
(errmsg("validating foreign key constraint \"%s\"", conname)));
/*
* Build a tri... | 0 | [
"CWE-362"
] | postgres | 5f173040e324f6c2eebb90d86cf1b0cdb5890f0a | 265,550,897,715,495,100,000,000,000,000,000,000,000 | 76 | 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... |
static int fsl_hv_close(struct inode *inode, struct file *filp)
{
struct doorbell_queue *dbq = filp->private_data;
unsigned long flags;
int ret = 0;
spin_lock_irqsave(&db_list_lock, flags);
list_del(&dbq->list);
spin_unlock_irqrestore(&db_list_lock, flags);
kfree(dbq);
return ret;
} | 0 | [
"CWE-190"
] | linux | 6a024330650e24556b8a18cc654ad00cfecf6c6c | 267,068,001,607,594,880,000,000,000,000,000,000,000 | 15 | drivers/virt/fsl_hypervisor.c: prevent integer overflow in ioctl
The "param.count" value is a u64 thatcomes from the user. The code
later in the function assumes that param.count is at least one and if
it's not then it leads to an Oops when we dereference the ZERO_SIZE_PTR.
Also the addition can have an integer over... |
int X509_NAME_get_index_by_NID(X509_NAME* name,int nid, int lastpos)
{
int idx = -1; // not found
const char* start = &name->GetName()[lastpos + 1];
switch (nid) {
case NID_commonName:
const char* found = strstr(start, "/CN=");
if (found) {
found += 4; // advance to str
... | 1 | [
"CWE-254"
] | mysql-server | e7061f7e5a96c66cb2e0bf46bec7f6ff35801a69 | 139,967,927,501,564,740,000,000,000,000,000,000,000 | 17 | Bug #22738607: YASSL FUNCTION X509_NAME_GET_INDEX_BY_NID IS NOT WORKING AS EXPECTED. |
void SplashOutputDev::setSoftMask(GfxState *state, const double *bbox,
bool alpha, Function *transferFunc,
GfxColor *backdropColor) {
SplashBitmap *softMask, *tBitmap;
Splash *tSplash;
SplashTransparencyGroup *transpGroup;
SplashColor color;
SplashColorPtr p;
GfxGray gray;
GfxRGB rgb;
#ifdef S... | 0 | [
"CWE-369"
] | poppler | b224e2f5739fe61de9fa69955d016725b2a4b78d | 91,899,820,393,062,400,000,000,000,000,000,000,000 | 139 | SplashOutputDev::tilingPatternFill: Fix crash on broken file
Issue #802 |
TEST_P(ProxyProtocolTest, V2ShortAddrV6) {
// An ipv6/tcp connection that has insufficient header-length encoded
constexpr uint8_t buffer[] = {0x0d, 0x0a, 0x0d, 0x0a, 0x00, 0x0d, 0x0a, 0x51, 0x55, 0x49, 0x54,
0x0a, 0x21, 0x22, 0x00, 0x23, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03,
... | 0 | [
"CWE-400"
] | envoy | dfddb529e914d794ac552e906b13d71233609bf7 | 245,065,871,188,585,000,000,000,000,000,000,000,000 | 13 | listener: Add configurable accepted connection limits (#153)
Add support for per-listener limits on accepted connections.
Signed-off-by: Tony Allen <tony@allen.gg> |
nvmet_fc_queue_to_cpu(struct nvmet_fc_tgtport *tgtport, int qid)
{
int cpu, idx, cnt;
if (tgtport->ops->max_hw_queues == 1)
return WORK_CPU_UNBOUND;
/* Simple cpu selection based on qid modulo active cpu count */
idx = !qid ? 0 : (qid - 1) % num_active_cpus();
/* find the n'th active cpu */
for (cpu = 0, cnt... | 0 | [
"CWE-119",
"CWE-787"
] | linux | 0c319d3a144d4b8f1ea2047fd614d2149b68f889 | 326,722,697,603,985,100,000,000,000,000,000,000,000 | 22 | nvmet-fc: ensure target queue id within range.
When searching for queue id's ensure they are within the expected range.
Signed-off-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk> |
uint32_t readBinary(folly::fbstring& str) {
T_VIRTUAL_CALL();
std::string data;
uint32_t ret = readBinary_virt(data);
str = data;
return ret;
} | 0 | [
"CWE-20",
"CWE-755"
] | fbthrift | 01686e15ec77ccb4d49a77d5bce3a01601e54d64 | 294,271,635,774,732,600,000,000,000,000,000,000,000 | 7 | Throw on skipping an invalid type.
Summary:
Certain values (e.g.) T_STOP should not appear as a skip type. Allowing them to
can cause thrift to loop unboundedly.
Reviewed By: spalamarchuk
Differential Revision: D15102451
fbshipit-source-id: c08d52f44f37e9c212d3480233ac217105586c9f |
copy_acls(struct archive_write_disk *a, int tmpfd, int dffd)
{
#ifndef HAVE_SYS_ACL_H
return 0;
#else
acl_t acl, dfacl = NULL;
int acl_r, ret = ARCHIVE_OK;
acl = acl_get_fd(tmpfd);
if (acl == NULL) {
if (errno == ENOENT)
/* There are not any ACLs. */
return (ret);
archive_set_error(&a->archive, errno,
... | 0 | [
"CWE-59",
"CWE-269"
] | libarchive | b41daecb5ccb4c8e3b2c53fd6147109fc12c3043 | 170,936,630,676,514,200,000,000,000,000,000,000,000 | 34 | Do not follow symlinks when processing the fixup list
Use lchmod() instead of chmod() and tell the remaining functions that the
real file to be modified is a symbolic link.
Fixes #1566 |
response_request_quit (void)
{
printf ("REQUEST QUIT\n");
fflush (stdout);
return FALSE;
} | 0 | [
"CWE-362"
] | gnome-screensaver | ab08cc93f2dc6223c8c00bfa1ca4f2d89069dbe0 | 215,238,934,435,545,250,000,000,000,000,000,000,000 | 6 | Work around x errors by asking dialog to die on cancel
Basically, what is happening is that gnome-screensaver-dialog exits after the
5th failed attempt at unlocking the screen, but before the shake animation
finishes. If the timing is slightly unlucky, this results in gnome-screensaver
accessing X resources that have ... |
void audit_trim_trees(void)
{
struct list_head cursor;
mutex_lock(&audit_filter_mutex);
list_add(&cursor, &tree_list);
while (cursor.next != &tree_list) {
struct audit_tree *tree;
struct path path;
struct vfsmount *root_mnt;
struct node *node;
struct list_head list;
int err;
tree = container_of(curs... | 0 | [
"CWE-362"
] | linux-2.6 | 8f7b0ba1c853919b85b54774775f567f30006107 | 288,948,037,478,423,000,000,000,000,000,000,000,000 | 54 | Fix inotify watch removal/umount races
Inotify watch removals suck violently.
To kick the watch out we need (in this order) inode->inotify_mutex and
ih->mutex. That's fine if we have a hold on inode; however, for all
other cases we need to make damn sure we don't race with umount. We can
*NOT* just grab a reference... |
static int sieve_keep(void *ac,
void *ic __attribute__((unused)),
void *sc, void *mc, const char **errmsg)
{
sieve_keep_context_t *kc = (sieve_keep_context_t *) ac;
script_data_t *sd = (script_data_t *) sc;
deliver_data_t *mydata = (deliver_data_t *) mc;
struc... | 0 | [
"CWE-269"
] | cyrus-imapd | 673ebd96e2efbb8895d08648983377262f35b3f7 | 260,724,041,992,369,400,000,000,000,000,000,000,000 | 28 | lmtp_sieve: don't create mailbox with admin for sieve autocreate |
GF_Err tkhd_dump(GF_Box *a, FILE * trace)
{
GF_TrackHeaderBox *p;
p = (GF_TrackHeaderBox *)a;
gf_isom_box_dump_start(a, "TrackHeaderBox", trace);
fprintf(trace, "CreationTime=\""LLD"\" ModificationTime=\""LLD"\" TrackID=\"%u\" Duration=\""LLD"\"",
LLD_CAST p->creationTime, LLD_CAST p->modificationTime, p-... | 0 | [
"CWE-125"
] | gpac | bceb03fd2be95097a7b409ea59914f332fb6bc86 | 59,340,023,974,467,530,000,000,000,000,000,000,000 | 26 | fixed 2 possible heap overflows (inc. #1088) |
copy_job_attrs(cupsd_client_t *con, /* I - Client connection */
cupsd_job_t *job, /* I - Job */
cups_array_t *ra, /* I - Requested attributes array */
cups_array_t *exclude) /* I - Private attributes array */
{
char job_uri[HTTP_MAX_URI]; /* Job URI */
/*
* Send the requested attr... | 0 | [
"CWE-20"
] | cups | 49fa4983f25b64ec29d548ffa3b9782426007df3 | 332,148,986,667,376,870,000,000,000,000,000,000,000 | 122 | DBUS notifications could crash the scheduler (Issue #5143)
- scheduler/ipp.c: Make sure requesting-user-name string is valid UTF-8. |
HandleRFBServerMessage(rfbClient* client)
{
rfbServerToClientMsg msg;
if (client->serverPort==-1)
client->vncRec->readTimestamp = TRUE;
if (!ReadFromRFBServer(client, (char *)&msg, 1))
return FALSE;
switch (msg.type) {
case rfbSetColourMapEntries:
{
/* TODO:
int i;
uint16_t rgb[3];
... | 1 | [
"CWE-20"
] | libvncserver | 85a778c0e45e87e35ee7199f1f25020648e8b812 | 60,554,144,916,303,880,000,000,000,000,000,000,000 | 604 | Check for MallocFrameBuffer() return value
If MallocFrameBuffer() returns FALSE, frame buffer pointer is left to
NULL. Subsequent writes into that buffer could lead to memory
corruption, or even arbitrary code execution. |
duplicate_opt_detection(opts, iscompound)
const char *opts;
int iscompound; /* 0 == boolean option, 1 == compound */
{
int i, *optptr;
if (!iscompound && iflags.opt_booldup && initial && from_file) {
for (i = 0; boolopt[i].name; i++) {
if (match_optname(opts, boolopt[i].name, 3, FALSE)) {
optptr = iflags.op... | 0 | [
"CWE-269"
] | NetHack | 612755bfb5c412079795c68ba392df5d93874ed8 | 126,641,476,983,411,490,000,000,000,000,000,000,000 | 27 | escapes() revamp
Partial rewrite of escapes(), mostly changing its if-then-else
logic so that end-of-string can be checked once instead for each case.
The previous version had a bug if the input string ended with backslash
and one decimal digit (due to being lumped together with the handling
for trailing \X or \O... |
BaseType_t xStreamBufferIsFull( StreamBufferHandle_t xStreamBuffer )
{
BaseType_t xReturn;
size_t xBytesToStoreMessageLength;
const StreamBuffer_t * const pxStreamBuffer = xStreamBuffer;
configASSERT( pxStreamBuffer );
/* This generic version of the receive function is used by both message... | 0 | [
"CWE-190"
] | FreeRTOS-Kernel | d05b9c123f2bf9090bce386a244fc934ae44db5b | 217,613,630,795,139,100,000,000,000,000,000,000,000 | 33 | Add addition overflow check for stream buffer (#226) |
BPF_CALL_3(bpf_skb_under_cgroup, struct sk_buff *, skb, struct bpf_map *, map,
u32, idx)
{
struct bpf_array *array = container_of(map, struct bpf_array, map);
struct cgroup *cgrp;
struct sock *sk;
sk = skb_to_full_sk(skb);
if (!sk || !sk_fullsock(sk))
return -ENOENT;
if (unlikely(idx >= array->map.max_entr... | 0 | [
"CWE-120"
] | linux | 050fad7c4534c13c8eb1d9c2ba66012e014773cb | 69,733,234,330,715,600,000,000,000,000,000,000 | 19 | bpf: fix truncated jump targets on heavy expansions
Recently during testing, I ran into the following panic:
[ 207.892422] Internal error: Accessing user space memory outside uaccess.h routines: 96000004 [#1] SMP
[ 207.901637] Modules linked in: binfmt_misc [...]
[ 207.966530] CPU: 45 PID: 2256 Comm: test_ve... |
static void __munlock_pagevec(struct pagevec *pvec, struct zone *zone)
{
int i;
int nr = pagevec_count(pvec);
int delta_munlocked = -nr;
struct pagevec pvec_putback;
int pgrescued = 0;
pagevec_init(&pvec_putback, 0);
/* Phase 1: page isolation */
spin_lock_irq(zone_lru_lock(zone));
for (i = 0; i < nr; i++) {... | 0 | [
"CWE-20"
] | linux | 70feee0e1ef331b22cc51f383d532a0d043fbdcc | 113,268,054,393,162,120,000,000,000,000,000,000,000 | 70 | mlock: fix mlock count can not decrease in race condition
Kefeng reported that when running the follow test, the mlock count in
meminfo will increase permanently:
[1] testcase
linux:~ # cat test_mlockal
grep Mlocked /proc/meminfo
for j in `seq 0 10`
do
for i in `seq 4 15`
do
./p_mlockall >> log &
done... |
int ssh_scp_push_file(ssh_scp scp, const char *filename, size_t size, int mode)
{
return ssh_scp_push_file64(scp, filename, (uint64_t) size, mode);
} | 0 | [] | libssh | 4aea835974996b2deb011024c53f4ff4329a95b5 | 310,040,179,596,926,240,000,000,000,000,000,000,000 | 4 | CVE-2019-14889: scp: Reformat scp.c
Fixes T181
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 42c727d0c186a1e2fa84a31ab40e16e58b404ab3) |
static void extract_hid_props(struct input_device *idev,
const sdp_record_t *rec)
{
/* Extract HID connectability */
bool reconnect_initiate, normally_connectable;
sdp_data_t *pdlist;
/* HIDNormallyConnectable is optional and assumed FALSE
* if not present. */
pdlist = sdp_data_get(rec, SDP_ATTR_HID_RECONNE... | 0 | [] | bluez | 3cccdbab2324086588df4ccf5f892fb3ce1f1787 | 298,155,470,241,322,570,000,000,000,000,000,000,000 | 19 | HID accepts bonded device connections only.
This change adds a configuration for platforms to choose a more secure
posture for the HID profile. While some older mice are known to not
support pairing or encryption, some platform may choose a more secure
posture by requiring the device to be bonded and require the
con... |
static inline void *align_to_cache(void *const p)
{
return((void *) CACHE_ALIGNED((MagickAddressType) p));
} | 0 | [
"CWE-369"
] | ImageMagick | 70aa86f5d5d8aa605a918ed51f7574f433a18482 | 213,774,457,287,974,860,000,000,000,000,000,000,000 | 4 | possible divide by zero + clear buffers |
get_entries(struct net *net, struct ip6t_get_entries __user *uptr,
const int *len)
{
int ret;
struct ip6t_get_entries get;
struct xt_table *t;
if (*len < sizeof(get)) {
duprintf("get_entries: %u < %zu\n", *len, sizeof(get));
return -EINVAL;
}
if (copy_from_user(&get, uptr, sizeof(get)) != 0)
re... | 0 | [
"CWE-200"
] | linux-2.6 | 6a8ab060779779de8aea92ce3337ca348f973f54 | 195,363,404,206,593,000,000,000,000,000,000,000,000 | 38 | 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... |
j2ku_gray_l(
opj_image_t *in,
const JPEG2KTILEINFO *tileinfo,
const UINT8 *tiledata,
Imaging im) {
unsigned x0 = tileinfo->x0 - in->x0, y0 = tileinfo->y0 - in->y0;
unsigned w = tileinfo->x1 - tileinfo->x0;
unsigned h = tileinfo->y1 - tileinfo->y0;
int shift = 8 - in->comps[0].prec;
... | 0 | [
"CWE-125"
] | Pillow | 3bf5eddb89afdf690eceaa52bc4d3546ba9a5f87 | 109,198,244,070,060,500,000,000,000,000,000,000,000 | 54 | Fix OOB Read in Jpeg2KDecode CVE-2021-25287,CVE-2021-25288
* For J2k images with multiple bands, it's legal in to have different
widths for each band, e.g. 1 byte for L, 4 bytes for A
* This dates to Pillow 2.4.0 |
gst_date_time_get_month (const GstDateTime * datetime)
{
g_return_val_if_fail (datetime != NULL, 0);
g_return_val_if_fail (gst_date_time_has_month (datetime), 0);
return g_date_time_get_month (datetime->datetime);
} | 0 | [
"CWE-125"
] | gstreamer | 9398b7f1a75b38844ae7050b5a7967e4cdebe24f | 116,134,440,553,560,430,000,000,000,000,000,000,000 | 7 | datetime: fix potential out-of-bound read on malformed datetime string
https://bugzilla.gnome.org/show_bug.cgi?id=777263 |
qemuProcessNotifyNets(virDomainDefPtr def)
{
size_t i;
g_autoptr(virConnect) conn = NULL;
for (i = 0; i < def->nnets; i++) {
virDomainNetDefPtr net = def->nets[i];
/* keep others from trying to use the macvtap device name, but
* don't return error if this happens, since that causes... | 0 | [
"CWE-416"
] | libvirt | 1ac703a7d0789e46833f4013a3876c2e3af18ec7 | 141,916,158,589,107,820,000,000,000,000,000,000,000 | 40 | qemu: Add missing lock in qemuProcessHandleMonitorEOF
qemuMonitorUnregister will be called in multiple threads (e.g. threads
in rpc worker pool and the vm event thread). In some cases, it isn't
protected by the monitor lock, which may lead to call g_source_unref
more than one time and a use-after-free problem eventua... |
static int ext4_dio_get_block_unwritten_sync(struct inode *inode,
sector_t iblock, struct buffer_head *bh_result, int create)
{
int ret;
/* We don't expect handle for direct IO */
WARN_ON_ONCE(ext4_journal_current_handle());
ret = ext4_get_block_trans(inode, iblock, bh_result,
EXT4_GET_BLOCKS_IO_CREATE_E... | 0 | [] | linux | 8e4b5eae5decd9dfe5a4ee369c22028f90ab4c44 | 258,835,660,585,543,240,000,000,000,000,000,000,000 | 21 | ext4: fail ext4_iget for root directory if unallocated
If the root directory has an i_links_count of zero, then when the file
system is mounted, then when ext4_fill_super() notices the problem and
tries to call iput() the root directory in the error return path,
ext4_evict_inode() will try to free the inode on disk, b... |
static int ml_get_combo_effect(struct ml_device *ml,
unsigned long *effect_handled,
struct ff_effect *combo_effect)
{
struct ff_effect *effect;
struct ml_effect_state *state;
int effect_type;
int i;
memset(combo_effect, 0, sizeof(struct ff_effect));
for (i = 0; i < FF_MEMLESS_EFFECTS; i++) {... | 0 | [
"CWE-416"
] | linux | fa3a5a1880c91bb92594ad42dfe9eedad7996b86 | 302,870,944,546,187,400,000,000,000,000,000,000,000 | 63 | Input: ff-memless - kill timer in destroy()
No timer must be left running when the device goes away.
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Reported-and-tested-by: syzbot+b6c55daa701fc389e286@syzkaller.appspotmail.com
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/1573726121.17351.3.camel@suse.co... |
void vdagent_connection_destroy(gpointer p)
{
g_return_if_fail(VDAGENT_IS_CONNECTION(p));
VDAgentConnection *self = VDAGENT_CONNECTION(p);
VDAgentConnectionPrivate *priv = vdagent_connection_get_instance_private(self);
g_cancellable_cancel(priv->cancellable);
g_io_stream_close(priv->io_stream, NULL... | 0 | [
"CWE-362"
] | spice-vd_agent | 51c415df82a52e9ec033225783c77df95f387891 | 128,405,589,612,454,100,000,000,000,000,000,000,000 | 10 | Avoids user session hijacking
Avoids user hijacking sessions by reusing PID.
In theory an attacker could:
- open a connection to the daemon;
- fork and exit the process but keep the file descriptor open
(inheriting or duplicating it in forked process);
- force OS to recycle the initial PID, by creating many short li... |
static enum_func_status
php_mysqlnd_chg_user_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
{
/* There could be an error message */
size_t buf_len = conn->net->cmd_buffer.length;
zend_uchar *buf = (zend_uchar *) conn->net->cmd_buffer.buffer;
zend_uchar *p = buf;
zend_uchar *begin = buf;
MYSQLND_PACKET_C... | 0 | [
"CWE-119",
"CWE-787"
] | php-src | 28f80baf3c53e267c9ce46a2a0fadbb981585132 | 236,504,724,185,603,740,000,000,000,000,000,000,000 | 58 | Fix bug #72293 - Heap overflow in mysqlnd related to BIT fields |
static void __vt_event_wait(struct vt_event_wait *vw)
{
/* Wait for it to pass */
wait_event_interruptible(vt_event_waitqueue, vw->done);
} | 0 | [
"CWE-662"
] | linux | 90bfdeef83f1d6c696039b6a917190dcbbad3220 | 241,350,492,602,992,300,000,000,000,000,000,000,000 | 5 | tty: make FONTX ioctl use the tty pointer they were actually passed
Some of the font tty ioctl's always used the current foreground VC for
their operations. Don't do that then.
This fixes a data race on fg_console.
Side note: both Michael Ellerman and Jiri Slaby point out that all these
ioctls are deprecated, and s... |
e1000e_process_snap_option(E1000ECore *core, uint32_t cmd_and_length)
{
if (cmd_and_length & E1000_TXD_CMD_SNAP) {
trace_e1000e_wrn_no_snap_support();
}
} | 0 | [
"CWE-835"
] | qemu | 4154c7e03fa55b4cf52509a83d50d6c09d743b77 | 191,453,031,936,211,180,000,000,000,000,000,000,000 | 6 | net: e1000e: fix an infinite loop issue
This issue is like the issue in e1000 network card addressed in
this commit:
e1000: eliminate infinite loops on out-of-bounds transfer start.
Signed-off-by: Li Qiang <liqiang6-s@360.cn>
Reviewed-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.... |
bgp_rx_notification(struct bgp_conn *conn, byte *pkt, uint len)
{
struct bgp_proto *p = conn->bgp;
if (len < 21)
{
bgp_error(conn, 1, 2, pkt+16, 2);
return;
}
unsigned code = pkt[19];
unsigned subcode = pkt[20];
int err = (code != 6);
bgp_log_error(p, BE_BGP_RX, "Received", code, subco... | 0 | [
"CWE-787"
] | bird | 1657c41c96b3c07d9265b07dd4912033ead4124b | 6,612,008,651,264,101,000,000,000,000,000,000,000 | 55 | BGP: Fix bugs in handling of shutdown messages
There is an improper check for valid message size, which may lead to
stack overflow and buffer leaks to log when a large message is received.
Thanks to Daniel McCarney for bugreport and analysis. |
load_24 (FILE *fp,
gint width,
gint height,
guchar *buffer,
guint16 bytes)
{
gint x, y, c;
guchar *line = g_new (guchar, bytes);
for (y = 0; y < height; buffer += width * 3, ++y)
{
for (c = 0; c < 3; ++c)
{
readline (fp, line, bytes)... | 0 | [
"CWE-190"
] | gimp | a9671395f6573e90316a9d748588c5435216f6ce | 204,577,255,921,137,240,000,000,000,000,000,000,000 | 24 | PCX: Avoid allocation overflows.
Multiplying gint values may overflow unless cast into a larger type. |
static int parse_options(int argc, char **argv, struct swaylock_state *state,
enum line_mode *line_mode, char **config_path) {
enum long_option_codes {
LO_BS_HL_COLOR = 256,
LO_CAPS_LOCK_BS_HL_COLOR,
LO_CAPS_LOCK_KEY_HL_COLOR,
LO_FONT,
LO_FONT_SIZE,
LO_IND_IDLE_VISIBLE,
LO_IND_RADIUS,
LO_IND_X_POSITI... | 0 | [
"CWE-703"
] | swaylock | 1d1c75b6316d21933069a9d201f966d84099f6ca | 57,181,636,687,881,640,000,000,000,000,000,000,000 | 498 | Add support for ext-session-lock-v1
This is a new protocol to lock the session [1]. It should be more
reliable than layer-shell + input-inhibitor.
[1]: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/131 |
rect_param(gs_rect *prect, os_ptr op)
{
double coords[4];
int code = num_params(op, 4, coords);
if (code < 0)
return code;
prect->p.x = coords[0], prect->p.y = coords[1];
prect->q.x = coords[2], prect->q.y = coords[3];
return 0;
} | 0 | [
"CWE-704"
] | ghostpdl | 548bb434e81dadcc9f71adf891a3ef5bea8e2b4e | 28,840,227,923,239,360,000,000,000,000,000,000,000 | 11 | PS interpreter - add some type checking
These were 'probably' safe anyway, since they mostly treat the objects
as integers without checking, which at least can't result in a crash.
Nevertheless, we ought to check.
The return from comparedictkeys could be wrong if one of the keys had
a value which was not an array, i... |
static int type_cclass_hash(type_cclass_key* key)
{
int i, val;
UChar *p;
val = 0;
p = (UChar* )&(key->enc);
for (i = 0; i < (int )sizeof(key->enc); i++) {
val = val * 997 + (int )*p++;
}
p = (UChar* )(&key->type);
for (i = 0; i < (int )sizeof(key->type); i++) {
val = val * 997 + (int )*p++;
... | 0 | [
"CWE-125"
] | oniguruma | 65a9b1aa03c9bc2dc01b074295b9603232cb3b78 | 111,927,723,938,303,760,000,000,000,000,000,000,000 | 20 | onig-5.9.2 |
last_csearch(void)
{
return lastc_bytes;
} | 0 | [
"CWE-416"
] | vim | 409510c588b1eec1ae33511ae97a21eb8e110895 | 212,436,720,299,398,040,000,000,000,000,000,000,000 | 4 | patch 8.2.5050: using freed memory when searching for pattern in path
Problem: Using freed memory when searching for pattern in path.
Solution: Make a copy of the line. |
NamespaceString ns() const override {
return NamespaceString(_command->parseNs(_dbName, cmdObj()));
} | 0 | [
"CWE-20"
] | mongo | 722f06f3217c029ef9c50062c8cc775966fd7ead | 33,642,281,974,969,230,000,000,000,000,000,000,000 | 3 | SERVER-38275 ban find explain with UUID |
static int ntop_get_resolved_address(lua_State* vm) {
char *key, *tmp,rsp[256],value[64];
Redis *redis = ntop->getRedis();
u_int16_t vlan_id = 0;
char buf[64];
ntop->getTrace()->traceEvent(TRACE_INFO, "%s() called", __FUNCTION__);
if(ntop_lua_check(vm, __FUNCTION__, 1, LUA_TSTRING)) return(CONST_LUA_ERROR... | 0 | [
"CWE-254"
] | ntopng | 2e0620be3410f5e22c9aa47e261bc5a12be692c6 | 3,046,765,594,784,542,000,000,000,000,000,000,000 | 41 | Added security fix to avoid escalating privileges to non-privileged users
Many thanks to Dolev Farhi for reporting it |
qemuProcessHandleRTCChange(qemuMonitorPtr mon G_GNUC_UNUSED,
virDomainObjPtr vm,
long long offset,
void *opaque)
{
virQEMUDriverPtr driver = opaque;
virObjectEventPtr event = NULL;
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDr... | 0 | [
"CWE-416"
] | libvirt | 1ac703a7d0789e46833f4013a3876c2e3af18ec7 | 125,840,977,527,212,040,000,000,000,000,000,000,000 | 41 | qemu: Add missing lock in qemuProcessHandleMonitorEOF
qemuMonitorUnregister will be called in multiple threads (e.g. threads
in rpc worker pool and the vm event thread). In some cases, it isn't
protected by the monitor lock, which may lead to call g_source_unref
more than one time and a use-after-free problem eventua... |
match_subject(CERTCertificate *cert, void *cbdatap)
{
if (!cert->subjectName)
return 0;
if (!strcmp(cert->subjectName, (char *)cbdatap))
return 1;
return 0;
} | 0 | [
"CWE-787"
] | pesign | b879dda52f8122de697d145977c285fb0a022d76 | 284,916,381,779,183,100,000,000,000,000,000,000,000 | 10 | Handle NULL pwdata in cms_set_pw_data()
When 12f16710ee44ef64ddb044a3523c3c4c4d90039a rewrote this function, it
didn't handle the NULL pwdata invocation from daemon.c. This leads to a
explicit NULL dereference and crash on all attempts to daemonize pesign.
Signed-off-by: Robbie Harwood <rharwood@redhat.com> |
void imap_unquote_string(char *s)
{
char *d = s;
if (*s == '\"')
s++;
else
return;
while (*s)
{
if (*s == '\"')
{
*d = '\0';
return;
}
if (*s == '\\')
{
s++;
}
if (*s)
{
*d = *s;
d++;
s++;
}
}
*d = '\0';
} | 0 | [
"CWE-78",
"CWE-77"
] | neomutt | e52393740334443ae0206cab2d7caef381646725 | 296,650,087,329,224,330,000,000,000,000,000,000,000 | 29 | quote imap strings more carefully
Co-authored-by: JerikoOne <jeriko.one@gmx.us> |
static int selinux_ptrace_traceme(struct task_struct *parent)
{
return avc_has_perm(&selinux_state,
task_sid_subj(parent), task_sid_obj(current),
SECCLASS_PROCESS, PROCESS__PTRACE, NULL);
} | 1 | [
"CWE-416"
] | linux | a3727a8bac0a9e77c70820655fd8715523ba3db7 | 63,175,626,254,905,820,000,000,000,000,000,000,000 | 6 | selinux,smack: fix subjective/objective credential use mixups
Jann Horn reported a problem with commit eb1231f73c4d ("selinux:
clarify task subjective and objective credentials") where some LSM
hooks were attempting to access the subjective credentials of a task
other than the current task. Generally speaking, it is ... |
datamatcher_init(Datamatcher *ma, const char *match, int flags)
{
match = match ? solv_strdup(match) : 0;
ma->match = match;
ma->flags = flags;
ma->error = 0;
ma->matchdata = 0;
if ((flags & SEARCH_STRINGMASK) == SEARCH_REGEX)
{
ma->matchdata = solv_calloc(1, sizeof(regex_t));
ma->error = re... | 0 | [
"CWE-125"
] | libsolv | fdb9c9c03508990e4583046b590c30d958f272da | 129,335,075,261,119,100,000,000,000,000,000,000,000 | 36 | repodata_schema2id: fix heap-buffer-overflow in memcmp
When the length of last schema in data->schemadata is
less than length of input schema, we got a read overflow
in asan test.
Signed-off-by: Zhipeng Xie <xiezhipeng1@huawei.com> |
static GLuint vrend_make_view(struct vrend_resource *res, enum virgl_formats format)
{
GLuint view_id;
GLenum tex_ifmt = tex_conv_table[res->base.format].internalformat;
GLenum view_ifmt = tex_conv_table[format].internalformat;
if (tex_ifmt == view_ifmt)
return res->id;
/* If the format doesn't ... | 0 | [
"CWE-787"
] | virglrenderer | 95e581fd181b213c2ed7cdc63f2abc03eaaa77ec | 143,790,195,098,071,820,000,000,000,000,000,000,000 | 29 | vrend: Add test to resource OOB write and fix it
v2: Also check that no depth != 1 has been send when none is due
Closes: #250
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com> |
static int mb86a20s_read_status_and_stats(struct dvb_frontend *fe,
enum fe_status *status)
{
struct mb86a20s_state *state = fe->demodulator_priv;
int rc, status_nr;
dev_dbg(&state->i2c->dev, "%s called.\n", __func__);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
/* Get lock */
status_nr = ... | 0 | [
"CWE-119"
] | media_tree | eca2d34b9d2ce70165a50510659838e28ca22742 | 293,837,911,287,116,640,000,000,000,000,000,000,000 | 66 | [media] mb86a20s: apply mask to val after checking for read failure
Appling the mask 0x0f to the immediate return of the call to
mb86a20s_readreg will always result in a positive value, meaning that the
check of ret < 0 will never work. Instead, check for a -ve return value
first, and then mask val with 0x0f.
Kudos ... |
TfLiteStatus Subgraph::PreserveAllTensorsExperimental() {
if (memory_planner_) {
ReportError(
"PreserveAllTensorsExperimental called after memory was planned. ");
return kTfLiteError;
}
preserve_all_tensors_ = true;
return kTfLiteOk;
} | 0 | [
"CWE-476"
] | tensorflow | f8378920345f4f4604202d4ab15ef64b2aceaa16 | 64,868,306,117,493,925,000,000,000,000,000,000,000 | 9 | Prevent a null pointer dereference in TFLite.
PiperOrigin-RevId: 370800353
Change-Id: Ic9c9712ce5c6e384c954dcd640a5bd9ff05c9a05 |
static void xudc_eps_init(struct xusb_udc *udc)
{
u32 ep_number;
INIT_LIST_HEAD(&udc->gadget.ep_list);
for (ep_number = 0; ep_number < XUSB_MAX_ENDPOINTS; ep_number++) {
struct xusb_ep *ep = &udc->ep[ep_number];
if (ep_number) {
list_add_tail(&ep->ep_usb.ep_list,
&udc->gadget.ep_list);
usb_ep_... | 0 | [
"CWE-20",
"CWE-129"
] | linux | 7f14c7227f342d9932f9b918893c8814f86d2a0d | 260,754,184,166,206,620,000,000,000,000,000,000,000 | 49 | USB: gadget: validate endpoint index for xilinx udc
Assure that host may not manipulate the index to point
past endpoint array.
Signed-off-by: Szymon Heidrich <szymon.heidrich@gmail.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
MagickExport DrawInfo *DestroyDrawInfo(DrawInfo *draw_info)
{
if (draw_info->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
assert(draw_info != (DrawInfo *) NULL);
assert(draw_info->signature == MagickCoreSignature);
if (draw_info->primitive != (char *) NULL)
draw_info-... | 0 | [
"CWE-399",
"CWE-119"
] | ImageMagick | 726812fa2fa7ce16bcf58f6e115f65427a1c0950 | 325,574,998,201,870,600,000,000,000,000,000,000,000 | 41 | Prevent buffer overflow in magick/draw.c |
init_thr_arg(void)
{
pthread_cond_init(&arg_cond, NULL);
pthread_mutex_init(&arg_mut, NULL);
return;
} | 0 | [] | pound | a0c52c542ca9620a96750f9877b26bf4c84aef1b | 230,988,134,401,321,630,000,000,000,000,000,000,000 | 6 | SSL Compression Disable patch for 2.6f
This patch disables SSL/TLS compression entirely. There is no config option.
This prevents CRIME attacks against SSL. Note that HTTP compression is still
an option.
Test your server at https://www.ssllabs.com/ssldb/
Original patch by Hereward Cooper <coops@fawk.eu>
Openssl 0... |
template<typename tc>
CImg<T>& draw_arrow(const int x0, const int y0,
const int x1, const int y1,
const tc *const color, const float opacity=1,
const float angle=30, const float length=-10,
const unsigned int pattern... | 0 | [
"CWE-119",
"CWE-787"
] | CImg | ac8003393569aba51048c9d67e1491559877b1d1 | 329,516,406,484,968,860,000,000,000,000,000,000,000 | 21 | . |
static void rcs_submission_override(struct intel_engine_cs *engine)
{
switch (INTEL_GEN(engine->i915)) {
case 12:
engine->emit_flush = gen12_emit_flush_render;
engine->emit_fini_breadcrumb = gen12_emit_fini_breadcrumb_rcs;
break;
case 11:
engine->emit_flush = gen11_emit_flush_render;
engine->emit_fini_brea... | 0 | [] | linux | bc8a76a152c5f9ef3b48104154a65a68a8b76946 | 224,908,523,140,827,500,000,000,000,000,000,000,000 | 17 | drm/i915/gen9: Clear residual context state on context switch
Intel ID: PSIRT-TA-201910-001
CVEID: CVE-2019-14615
Intel GPU Hardware prior to Gen11 does not clear EU state
during a context switch. This can result in information
leakage between contexts.
For Gen8 and Gen9, hardware provides a mechanism for
fast clear... |
suggest_trie_walk(
suginfo_T *su,
langp_T *lp,
char_u *fword,
int soundfold)
{
char_u tword[MAXWLEN]; // good word collected so far
trystate_T stack[MAXWLEN];
char_u preword[MAXWLEN * 3]; // word found with proper case;
// concatenation of prefix compound
// words an... | 0 | [
"CWE-122",
"CWE-787"
] | vim | 5c68617d395f9d7b824f68475b24ce3e38d653a3 | 199,249,194,699,374,000,000,000,000,000,000,000,000 | 1,429 | patch 8.2.4563: "z=" in Visual mode may go beyond the end of the line
Problem: "z=" in Visual mode may go beyond the end of the line.
Solution: Adjust "badlen". |
GF_Err esds_box_dump(GF_Box *a, FILE * trace)
{
GF_ESDBox *p;
p = (GF_ESDBox *)a;
gf_isom_box_dump_start(a, "MPEG4ESDescriptorBox", trace);
gf_fprintf(trace, ">\n");
if (p->desc) {
#ifndef GPAC_DISABLE_OD_DUMP
gf_odf_dump_desc((GF_Descriptor *) p->desc, trace, 1, GF_TRUE);
#else
gf_fprintf(trace, "<!-- Objec... | 0 | [
"CWE-787"
] | gpac | ea1eca00fd92fa17f0e25ac25652622924a9a6a0 | 73,913,724,617,495,550,000,000,000,000,000,000,000 | 20 | fixed #2138 |
~RGWPutACLs() override {
free(data);
} | 0 | [
"CWE-770"
] | ceph | ab29bed2fc9f961fe895de1086a8208e21ddaddc | 264,403,880,126,254,540,000,000,000,000,000,000,000 | 3 | rgw: fix issues with 'enforce bounds' patch
The patch to enforce bounds on max-keys/max-uploads/max-parts had a few
issues that would prevent us from compiling it. Instead of changing the
code provided by the submitter, we're addressing them in a separate
commit to maintain the DCO.
Signed-off-by: Joao Eduardo Luis <... |
static int aio_migratepage(struct address_space *mapping, struct page *new,
struct page *old, enum migrate_mode mode)
{
struct kioctx *ctx;
unsigned long flags;
pgoff_t idx;
int rc;
/*
* We cannot support the _NO_COPY case here, because copy needs to
* happen under the ctx->completion_lock. That does not w... | 0 | [
"CWE-416"
] | linux | 84c4e1f89fefe70554da0ab33be72c9be7994379 | 315,288,151,387,147,930,000,000,000,000,000,000,000 | 75 | aio: simplify - and fix - fget/fput for io_submit()
Al Viro root-caused a race where the IOCB_CMD_POLL handling of
fget/fput() could cause us to access the file pointer after it had
already been freed:
"In more details - normally IOCB_CMD_POLL handling looks so:
1) io_submit(2) allocates aio_kiocb instance and p... |
static int ctnetlink_flush_conntrack(struct net *net,
const struct nlattr * const cda[],
u32 portid, int report, u8 family)
{
struct ctnetlink_filter *filter = NULL;
if (ctnetlink_needs_filter(family, cda)) {
if (cda[CTA_FILTER])
return -EOPNOTSUPP;
filter = ctnetlink_alloc_filter(cda, fami... | 0 | [
"CWE-120"
] | linux | 1cc5ef91d2ff94d2bf2de3b3585423e8a1051cb6 | 297,756,815,088,480,180,000,000,000,000,000,000,000 | 21 | netfilter: ctnetlink: add a range check for l3/l4 protonum
The indexes to the nf_nat_l[34]protos arrays come from userspace. So
check the tuple's family, e.g. l3num, when creating the conntrack in
order to prevent an OOB memory access during setup. Here is an example
kernel panic on 4.14.180 when userspace passes in ... |
xfs_iflush_abort(
xfs_inode_t *ip,
bool stale)
{
xfs_inode_log_item_t *iip = ip->i_itemp;
if (iip) {
if (iip->ili_item.li_flags & XFS_LI_IN_AIL) {
xfs_trans_ail_remove(&iip->ili_item,
stale ? SHUTDOWN_LOG_IO_ERROR :
SHUTDOWN_CORRUPT_INCORE);
}
iip->ili_logged = 0;
/*
* Clear t... | 1 | [
"CWE-19"
] | linux | fc0561cefc04e7803c0f6501ca4f310a502f65b8 | 297,554,221,750,659,550,000,000,000,000,000,000,000 | 29 | xfs: optimise away log forces on timestamp updates for fdatasync
xfs: timestamp updates cause excessive fdatasync log traffic
Sage Weil reported that a ceph test workload was writing to the
log on every fdatasync during an overwrite workload. Event tracing
showed that the only metadata modification being made was the... |
static bool __is_cp_guaranteed(struct page *page)
{
struct address_space *mapping = page->mapping;
struct inode *inode;
struct f2fs_sb_info *sbi;
if (!mapping)
return false;
inode = mapping->host;
sbi = F2FS_I_SB(inode);
if (inode->i_ino == F2FS_META_INO(sbi) ||
inode->i_ino == F2FS_NODE_INO(sbi) ||
... | 0 | [
"CWE-476"
] | linux | 4969c06a0d83c9c3dc50b8efcdc8eeedfce896f6 | 211,882,644,839,787,800,000,000,000,000,000,000,000 | 21 | f2fs: support swap file w/ DIO
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> |
CImg<Tfloat> get_CMYKtoCMY() const {
if (_spectrum!=4)
throw CImgInstanceException(_cimg_instance
"CMYKtoCMY(): Instance is not a CMYK image.",
cimg_instance);
CImg<Tfloat> res(_width,_height,_depth,3);
const T *ps1 =... | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 194,496,447,353,839,050,000,000,000,000,000,000,000 | 27 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
int bn_cmp_part_words(const BN_ULONG *a, const BN_ULONG *b,
int cl, int dl)
{
int n,i;
n = cl-1;
if (dl < 0)
{
for (i=dl; i<0; i++)
{
if (b[n-i] != 0)
return -1; /* a < b */
}
}
if (dl > 0)
{
for (i=dl; i>0; i--)
{
if (a[n+i] != 0)
return 1; /* a > b */
}
}
return bn_cmp_wo... | 0 | [
"CWE-310"
] | openssl | f9b6c0ba4c02497782f801e3c45688f3efaac55c | 192,516,624,698,464,520,000,000,000,000,000,000,000 | 24 | Fix for CVE-2014-0076
Fix for the attack described in the paper "Recovering OpenSSL
ECDSA Nonces Using the FLUSH+RELOAD Cache Side-channel Attack"
by Yuval Yarom and Naomi Benger. Details can be obtained from:
http://eprint.iacr.org/2014/140
Thanks to Yuval Yarom and Naomi Benger for discovering this
flaw and to Yuva... |
void security_inet_conn_established(struct sock *sk,
struct sk_buff *skb)
{
security_ops->inet_conn_established(sk, skb);
} | 0 | [] | linux-2.6 | ee18d64c1f632043a02e6f5ba5e045bb26a5465f | 103,364,502,404,846,460,000,000,000,000,000,000,000 | 5 | 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 int xname_cmp(const X509_NAME *a, const X509_NAME *b)
{
unsigned char *abuf = NULL, *bbuf = NULL;
int alen, blen, ret;
/* X509_NAME_cmp() itself casts away constness in this way, so
* assume it's safe:
*/
alen = i2d_X509_NAME((X509_NAME *)a, &abuf);
blen = i2d_X509_NAME((X509_NAME ... | 0 | [
"CWE-835"
] | openssl | 758754966791c537ea95241438454aa86f91f256 | 93,864,676,639,329,060,000,000,000,000,000,000,000 | 23 | Fix invalid handling of verify errors in libssl
In the event that X509_verify() returned an internal error result then
libssl would mishandle this and set rwstate to SSL_RETRY_VERIFY. This
subsequently causes SSL_get_error() to return SSL_ERROR_WANT_RETRY_VERIFY.
That return code is supposed to only ever be returned i... |
TEST(HttpStatusChecker, ExpectedBelow100) {
const std::string yaml = R"EOF(
timeout: 1s
interval: 1s
unhealthy_threshold: 2
healthy_threshold: 2
http_health_check:
service_name_matcher:
prefix: locations
path: /healthcheck
expected_statuses:
- start: 99
end: 100
)EOF";
... | 0 | [
"CWE-476"
] | envoy | 9b1c3962172a972bc0359398af6daa3790bb59db | 239,303,729,213,219,300,000,000,000,000,000,000,000 | 23 | healthcheck: fix grpc inline removal crashes (#749)
Signed-off-by: Matt Klein <mklein@lyft.com>
Signed-off-by: Pradeep Rao <pcrao@google.com> |
BigInt EC_Group::random_scalar(RandomNumberGenerator& rng) const
{
return BigInt::random_integer(rng, 1, get_order());
} | 0 | [
"CWE-200"
] | botan | 48fc8df51d99f9d8ba251219367b3d629cc848e3 | 223,101,565,014,959,480,000,000,000,000,000,000,000 | 4 | Address DSA/ECDSA side channel |
static int nfs4_proc_unlink_done(struct rpc_task *task, struct inode *dir)
{
struct nfs_removeres *res = task->tk_msg.rpc_resp;
if (nfs4_async_handle_error(task, res->server, NULL) == -EAGAIN)
return 0;
update_changeattr(dir, &res->cinfo);
nfs_post_op_update_inode(dir, &res->dir_attr);
return 1;
} | 0 | [
"CWE-703"
] | linux | dc0b027dfadfcb8a5504f7d8052754bf8d501ab9 | 333,594,088,933,044,870,000,000,000,000,000,000,000 | 10 | NFSv4: Convert the open and close ops to use fmode
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> |
void big_key_revoke(struct key *key)
{
struct path *path = (struct path *)&key->payload.data[big_key_path];
/* clear the quota */
key_payload_reserve(key, 0);
if (key_is_positive(key) &&
(size_t)key->payload.data[big_key_len] > BIG_KEY_FILE_THRESHOLD)
vfs_truncate(path, 0);
} | 0 | [
"CWE-20"
] | linux | 363b02dab09b3226f3bd1420dad9c72b79a42a76 | 207,283,780,078,715,850,000,000,000,000,000,000,000 | 10 | KEYS: Fix race between updating and finding a negative key
Consolidate KEY_FLAG_INSTANTIATED, KEY_FLAG_NEGATIVE and the rejection
error into one field such that:
(1) The instantiation state can be modified/read atomically.
(2) The error can be accessed atomically with the state.
(3) The error isn't stored unione... |
struct rt6_info *rt6_get_dflt_router(const struct in6_addr *addr, struct net_device *dev)
{
struct rt6_info *rt;
struct fib6_table *table;
table = fib6_get_table(dev_net(dev), RT6_TABLE_DFLT);
if (!table)
return NULL;
read_lock_bh(&table->tb6_lock);
for (rt = table->tb6_root.leaf; rt; rt = rt->dst.rt6_next) {... | 0 | [
"CWE-17"
] | linux-stable | 9d289715eb5c252ae15bd547cb252ca547a3c4f2 | 284,274,728,166,174,350,000,000,000,000,000,000,000 | 21 | ipv6: stop sending PTB packets for MTU < 1280
Reduce the attack vector and stop generating IPv6 Fragment Header for
paths with an MTU smaller than the minimum required IPv6 MTU
size (1280 byte) - called atomic fragments.
See IETF I-D "Deprecating the Generation of IPv6 Atomic Fragments" [1]
for more information and h... |
i915_gem_execbuffer_flush(struct drm_device *dev,
uint32_t invalidate_domains,
uint32_t flush_domains,
uint32_t flush_rings)
{
drm_i915_private_t *dev_priv = dev->dev_private;
int i, ret;
if (flush_domains & I915_GEM_DOMAIN_CPU)
intel_gtt_chipset_flush();
if (flush_domains & I915_GEM_DOMAIN_GTT)
... | 0 | [
"CWE-189"
] | linux-2.6 | ed8cd3b2cd61004cab85380c52b1817aca1ca49b | 61,791,417,862,032,040,000,000,000,000,000,000,000 | 27 | drm/i915: fix integer overflow in i915_gem_execbuffer2()
On 32-bit systems, a large args->buffer_count from userspace via ioctl
may overflow the allocation size, leading to out-of-bounds access.
This vulnerability was introduced in commit 8408c282 ("drm/i915:
First try a normal large kmalloc for the temporary exec bu... |
void stunnel_info(int level) {
s_log(level, "stunnel " STUNNEL_VERSION " on " HOST " platform");
if(strcmp(OPENSSL_VERSION_TEXT, OpenSSL_version(OPENSSL_VERSION))) {
s_log(level, "Compiled with " OPENSSL_VERSION_TEXT);
s_log(level, "Running with %s", OpenSSL_version(OPENSSL_VERSION));
#if OPENS... | 0 | [
"CWE-295"
] | stunnel | ebad9ddc4efb2635f37174c9d800d06206f1edf9 | 11,328,856,656,579,435,000,000,000,000,000,000,000 | 105 | stunnel-5.57 |
static inline unsigned int unmask_flags(unsigned long p)
{
return p & ~PAGE_MASK;
} | 0 | [
"CWE-20"
] | linux | 594cc251fdd0d231d342d88b2fdff4bc42fb0690 | 249,185,885,772,333,070,000,000,000,000,000,000,000 | 4 | make 'user_access_begin()' do 'access_ok()'
Originally, the rule used to be that you'd have to do access_ok()
separately, and then user_access_begin() before actually doing the
direct (optimized) user access.
But experience has shown that people then decide not to do access_ok()
at all, and instead rely on it being i... |
iter_stub_fwd_no_cache(struct module_qstate *qstate, struct query_info *qinf,
uint8_t** retdpname, size_t* retdpnamelen)
{
struct iter_hints_stub *stub;
struct delegpt *dp;
/* Check for stub. */
stub = hints_lookup_stub(qstate->env->hints, qinf->qname,
qinf->qclass, NULL);
dp = forwards_lookup(qstate->env->... | 0 | [
"CWE-613",
"CWE-703"
] | unbound | f6753a0f1018133df552347a199e0362fc1dac68 | 223,547,644,181,537,050,000,000,000,000,000,000,000 | 58 | - Fix the novel ghost domain issues CVE-2022-30698 and CVE-2022-30699. |
TEST_F(HttpConnectionManagerImplTest, PreserveUpstreamDateDisabledDateSet) {
TestScopedRuntime scoped_runtime;
Runtime::LoaderSingleton::getExisting()->mergeValues(
{{"envoy.reloadable_features.preserve_upstream_date", "false"}});
setup(false, "");
setUpEncoderAndDecoder(false, false);
sendRequestHeader... | 0 | [
"CWE-400"
] | envoy | 0e49a495826ea9e29134c1bd54fdeb31a034f40c | 316,304,473,985,817,200,000,000,000,000,000,000,000 | 15 | http/2: add stats and stream flush timeout (#139)
This commit adds a new stream flush timeout to guard against a
remote server that does not open window once an entire stream has
been buffered for flushing. Additional stats have also been added
to better understand the codecs view of active streams as well as
amount o... |
static av_always_inline void decode_line(FFV1Context *s, int w,
int16_t *sample[2],
int plane_index, int bits)
{
PlaneContext *const p = &s->plane[plane_index];
RangeCoder *const c = &s->c;
int x;
int run_count = 0;
... | 0 | [
"CWE-119",
"CWE-787"
] | FFmpeg | 547d690d676064069d44703a1917e0dab7e33445 | 216,612,764,221,832,300,000,000,000,000,000,000,000 | 70 | ffv1dec: check that global parameters dont change in version 0/1
Such changes are not allowed nor supported
Fixes Ticket2906
Found-by: ami_stuff
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> |
f_test_garbagecollect_soon(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
may_garbage_collect = TRUE;
} | 0 | [
"CWE-121",
"CWE-787"
] | vim | 34f8117dec685ace52cd9e578e2729db278163fc | 23,069,489,721,125,760,000,000,000,000,000,000,000 | 4 | 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(). |
Status InferenceContext::MergePrefix(ShapeHandle s, ShapeHandle prefix,
ShapeHandle* s_out,
ShapeHandle* prefix_out) {
*s_out = *prefix_out = nullptr;
if (!RankKnown(prefix) || !RankKnown(s)) {
*s_out = s;
*prefix_out = prefix;
re... | 0 | [
"CWE-190"
] | tensorflow | acd56b8bcb72b163c834ae4f18469047b001fadf | 295,762,471,740,325,400,000,000,000,000,000,000,000 | 25 | Fix security vulnerability with SpaceToBatchNDOp.
PiperOrigin-RevId: 445527615 |
static int parserange(char *str, uint32_t *uid, uint32_t *last,
char **msgid, struct backend **ret)
{
const char *p = NULL;
char *mboxname;
int r = 0;
*uid = 0;
if (last) *last = 0;
if (msgid) *msgid = NULL;
if (ret) *ret = NULL;
if (!str || !*str) {
/* no argument, use curren... | 0 | [
"CWE-119"
] | cyrus-imapd | 0f8f026699829b65733c3081657b24e2174f4f4d | 6,167,441,135,182,757,000,000,000,000,000,000,000 | 73 | CVE-2011-3208 - fix buffer overflow in nntpd |
static int __init cgroup_no_v1(char *str)
{
struct cgroup_subsys *ss;
char *token;
int i;
while ((token = strsep(&str, ",")) != NULL) {
if (!*token)
continue;
if (!strcmp(token, "all")) {
cgroup_no_v1_mask = U16_MAX;
continue;
}
if (!strcmp(token, "named")) {
cgroup_no_v1_named = true;
con... | 0 | [
"CWE-416"
] | linux | 3b0462726e7ef281c35a7a4ae33e93ee2bc9975b | 12,932,263,706,211,868,000,000,000,000,000,000,000 | 30 | cgroup: verify that source is a string
The following sequence can be used to trigger a UAF:
int fscontext_fd = fsopen("cgroup");
int fd_null = open("/dev/null, O_RDONLY);
int fsconfig(fscontext_fd, FSCONFIG_SET_FD, "source", fd_null);
close_range(3, ~0U, 0);
The cgroup v1 specific fs parser expects a... |
void DecimalQuantity::clear() {
lOptPos = INT32_MAX;
lReqPos = 0;
rReqPos = 0;
rOptPos = INT32_MIN;
flags = 0;
setBcdToZero(); // sets scale, precision, hasDouble, origDouble, origDelta, and BCD data
} | 0 | [
"CWE-190"
] | icu | 53d8c8f3d181d87a6aa925b449b51c4a2c922a51 | 39,450,770,013,075,860,000,000,000,000,000,000,000 | 8 | ICU-20246 Fixing another integer overflow in number parsing. |
release_parameter_list (struct para_data_s *r)
{
struct para_data_s *r2;
for (; r ; r = r2)
{
r2 = r->next;
if (r->key == pPASSPHRASE && *r->u.value)
wipememory (r->u.value, strlen (r->u.value));
xfree (r);
}
} | 0 | [
"CWE-20"
] | gnupg | 2183683bd633818dd031b090b5530951de76f392 | 203,871,205,932,091,740,000,000,000,000,000,000,000 | 12 | Use inline functions to convert buffer data to scalars.
* common/host2net.h (buf16_to_ulong, buf16_to_uint): New.
(buf16_to_ushort, buf16_to_u16): New.
(buf32_to_size_t, buf32_to_ulong, buf32_to_uint, buf32_to_u32): New.
--
Commit 91b826a38880fd8a989318585eb502582636ddd8 was not enough to
avoid all sign extension on ... |
GF_Err gf_filter_new_finalize(GF_Filter *filter, const char *args, GF_FilterArgType arg_type)
{
gf_filter_set_name(filter, NULL);
gf_filter_parse_args(filter, args, arg_type, GF_FALSE);
if (filter->freg->initialize) {
GF_Err e;
FSESS_CHECK_THREAD(filter)
if (((arg_type==GF_FILTER_ARG_EXPLICIT_SOURCE) || (arg... | 0 | [
"CWE-787"
] | gpac | da37ec8582266983d0ec4b7550ec907401ec441e | 90,409,503,810,110,800,000,000,000,000,000,000,000 | 41 | fixed crashes for very long path - cf #1908 |
static int tree_content_get(
struct tree_entry *root,
const char *p,
struct tree_entry *leaf,
int allow_root)
{
struct tree_content *t;
const char *slash1;
unsigned int i, n;
struct tree_entry *e;
slash1 = strchrnul(p, '/');
n = slash1 - p;
if (!n && !allow_root)
die("Empty path component found in input")... | 0 | [
"CWE-119",
"CWE-787"
] | git | 34fa79a6cde56d6d428ab0d3160cb094ebad3305 | 195,260,274,156,657,700,000,000,000,000,000,000,000 | 47 | prefer memcpy to strcpy
When we already know the length of a string (e.g., because
we just malloc'd to fit it), it's nicer to use memcpy than
strcpy, as it makes it more obvious that we are not going to
overflow the buffer (because the size we pass matches the
size in the allocation).
This also eliminates calls to st... |
AST::AST(const loc_t &l, type_t t)
: type(t), loc(l)
{
flist.insert(this);
} | 0 | [
"CWE-787"
] | re2c | 039c18949190c5de5397eba504d2c75dad2ea9ca | 239,804,459,340,759,270,000,000,000,000,000,000,000 | 5 | Emit an error when repetition lower bound exceeds upper bound.
Historically this was allowed and re2c swapped the bounds. However, it
most likely indicates an error in user code and there is only a single
occurrence in the tests (and the test in an artificial one), so although
the change is backwards incompatible ther... |
com_help(String *buffer __attribute__((unused)),
char *line __attribute__((unused)))
{
reg1 int i, j;
char * help_arg= strchr(line,' '), buff[32], *end;
if (help_arg)
{
while (my_isspace(charset_info,*help_arg))
help_arg++;
if (*help_arg)
return com_server_help(buffer,line,help_arg);
}
p... | 0 | [
"CWE-295"
] | mysql-server | b3e9211e48a3fb586e88b0270a175d2348935424 | 247,359,766,059,117,540,000,000,000,000,000,000,000 | 36 | WL#9072: Backport WL#8785 to 5.5 |
TORRENT_TEST(list_ints)
{
std::string buf;
buf += "l";
for (int i = 0; i < 1000; ++i)
{
char tmp[20];
snprintf(tmp, sizeof(tmp), "i%de", i);
buf += tmp;
}
buf += "e";
bdecode_node e;
error_code ec;
int ret = bdecode((char*)&buf[0], (char*)&buf[0] + buf.size(), e, ec);
TEST_EQUAL(ret, 0);
TEST_EQUAL(e.... | 0 | [
"CWE-125"
] | libtorrent | ec30a5e9ec703afb8abefba757c6d401303b53db | 21,524,251,479,422,390,000,000,000,000,000,000,000 | 23 | fix out-of-bounds read in bdecode
Fixes #2099 |
virDomainDefAddImplicitControllers(virDomainDefPtr def)
{
if (virDomainDefAddDiskControllersForType(def,
VIR_DOMAIN_CONTROLLER_TYPE_SCSI,
VIR_DOMAIN_DISK_BUS_SCSI) < 0)
return -1;
if (virDomainDefAddDiskControll... | 0 | [
"CWE-212"
] | libvirt | a5b064bf4b17a9884d7d361733737fb614ad8979 | 289,517,857,935,007,000,000,000,000,000,000,000,000 | 33 | conf: Don't format http cookies unless VIR_DOMAIN_DEF_FORMAT_SECURE is used
Starting with 3b076391befc3fe72deb0c244ac6c2b4c100b410
(v6.1.0-122-g3b076391be) we support http cookies. Since they may contain
somewhat sensitive information we should not format them into the XML
unless VIR_DOMAIN_DEF_FORMAT_SECURE is assert... |
size_t rand_pool_length(RAND_POOL *pool)
{
return pool->len;
} | 0 | [
"CWE-330"
] | openssl | 1b0fe00e2704b5e20334a16d3c9099d1ba2ef1be | 131,312,110,657,512,140,000,000,000,000,000,000,000 | 4 | drbg: ensure fork-safety without using a pthread_atfork handler
When the new OpenSSL CSPRNG was introduced in version 1.1.1,
it was announced in the release notes that it would be fork-safe,
which the old CSPRNG hadn't been.
The fork-safety was implemented using a fork count, which was
incremented by a pthread_atfork... |
static struct vxlan_fdb *__vxlan_find_mac(struct vxlan_dev *vxlan,
const u8 *mac, __be32 vni)
{
struct hlist_head *head = vxlan_fdb_head(vxlan, mac, vni);
struct vxlan_fdb *f;
hlist_for_each_entry_rcu(f, head, hlist) {
if (ether_addr_equal(mac, f->eth_addr)) {
if (vxlan->cfg.flags & VXLAN_F_COLLECT_META... | 0 | [] | net | 6c8991f41546c3c472503dff1ea9daaddf9331c2 | 137,646,297,866,024,790,000,000,000,000,000,000,000 | 19 | 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.