func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
static int rpmVerifyScript(rpmts ts, Header h)
{
int rc = 0;
if (headerIsEntry(h, RPMTAG_VERIFYSCRIPT)) {
/* fake up a erasure transaction element */
rpmte p = rpmteNew(ts, h, TR_REMOVED, NULL, NULL);
if (p != NULL) {
rpmteSetHeader(p, h);
rc = (rpmpsmRun(ts, p, PKG_VERIFY) != RPMRC_OK);
/... | 0 | [
"CWE-59",
"CWE-61"
] | rpm | c815822c8bdb138066ff58c624ae83e3a12ebfa9 | 54,933,917,040,690,370,000,000,000,000,000,000,000 | 22 | Make verification match the new restricted directory symlink behavior
Only follow directory symlinks owned by target directory owner or root
during verification to match the behavior of fsmVerify() in the new
CVE-2017-7500 world order.
The code is klunkier than it should and the logic should use common code
with fsmV... |
qf_stack_empty(qf_info_T *qi)
{
return qi == NULL || qi->qf_listcount <= 0;
} | 0 | [
"CWE-416"
] | vim | 4f1b083be43f351bc107541e7b0c9655a5d2c0bb | 38,063,671,319,692,984,000,000,000,000,000,000,000 | 4 | patch 9.0.0322: crash when no errors and 'quickfixtextfunc' is set
Problem: Crash when no errors and 'quickfixtextfunc' is set.
Solution: Do not handle errors if there aren't any. |
XMLRPC_CASE_COMPARISON XMLRPC_GetDefaultIdCaseComparison() {
XMLRPC_OPTIONS options = XMLRPC_GetDefaultOptions();
return options->id_case_compare;
} | 0 | [
"CWE-119"
] | php-src | 88412772d295ebf7dd34409534507dc9bcac726e | 252,014,010,988,841,300,000,000,000,000,000,000,000 | 4 | Fix bug #68027 - fix date parsing in XMLRPC lib |
ArgParser::argVersion()
{
if (expected_version != QPDF::QPDFVersion())
{
std::cerr << "***\n"
<< "WARNING: qpdf CLI from version " << expected_version
<< " is using library version " << QPDF::QPDFVersion()
<< ".\n"
<< "This probably... | 0 | [
"CWE-787"
] | qpdf | d71f05ca07eb5c7cfa4d6d23e5c1f2a800f52e8e | 21,592,303,457,385,435,000,000,000,000,000,000,000 | 18 | Fix sign and conversion warnings (major)
This makes all integer type conversions that have potential data loss
explicit with calls that do range checks and raise an exception. After
this commit, qpdf builds with no warnings when -Wsign-conversion
-Wconversion is used with gcc or clang or when -W3 -Wd4800 is used
with ... |
static void print_config_hash(GF_List *xps_array, char *szName)
{
u32 i, j;
u8 hash[20];
for (i=0; i<gf_list_count(xps_array); i++) {
GF_NALUFFParam *slc = gf_list_get(xps_array, i);
gf_sha1_csum((u8 *) slc->data, slc->size, hash);
fprintf(stderr, "\t%s#%d hash: ", szName, i+1);
for (j=0; j<20; j++) fprint... | 0 | [
"CWE-476",
"CWE-401"
] | gpac | 289ffce3e0d224d314f5f92a744d5fe35999f20b | 177,956,667,452,481,580,000,000,000,000,000,000,000 | 12 | fixed #1767 (fuzz) |
PredictorDecodeTile(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
{
TIFFPredictorState *sp = PredictorState(tif);
assert(sp != NULL);
assert(sp->decodetile != NULL);
if ((*sp->decodetile)(tif, op0, occ0, s)) {
tmsize_t rowsize = sp->rowsize;
assert(rowsize > 0);
assert((occ0%rowsize)==0);
assert(sp->dec... | 1 | [
"CWE-119",
"CWE-787"
] | libtiff | 3ca657a8793dd011bf869695d72ad31c779c3cc1 | 224,411,327,423,924,550,000,000,000,000,000,000,000 | 21 | * libtiff/tif_predict.h, libtiff/tif_predict.c:
Replace assertions by runtime checks to avoid assertions in debug mode,
or buffer overflows in release mode. Can happen when dealing with
unusual tile size like YCbCr with subsampling. Reported as MSVR 35105
by Axel Souchet & Vishal Chauhan from the MSRC Vulnerabilities &... |
void HGraphBuilder::HandleCompoundAssignment(Assignment* expr) {
Expression* target = expr->target();
VariableProxy* proxy = target->AsVariableProxy();
Property* prop = target->AsProperty();
ASSERT(proxy == NULL || prop == NULL);
// We have a second position recorded in the FullCodeGenerator to have
// typ... | 0 | [] | node | fd80a31e0697d6317ce8c2d289575399f4e06d21 | 231,357,645,727,590,400,000,000,000,000,000,000,000 | 187 | deps: backport 5f836c from v8 upstream
Original commit message:
Fix Hydrogen bounds check elimination
When combining bounds checks, they must all be moved before the first load/store
that they are guarding.
BUG=chromium:344186
LOG=y
R=svenpanne@chromium.org
Review URL: https://coderevie... |
call_qftf_func(qf_list_T *qfl, int qf_winid, long start_idx, long end_idx)
{
callback_T *cb = &qftf_cb;
list_T *qftf_list = NULL;
static int recursive = FALSE;
if (recursive)
return NULL; // this doesn't work properly recursively
recursive = TRUE;
// If 'quickfixtextfunc' is set, then use th... | 0 | [
"CWE-416"
] | vim | 4f1b083be43f351bc107541e7b0c9655a5d2c0bb | 267,155,489,672,191,970,000,000,000,000,000,000,000 | 52 | patch 9.0.0322: crash when no errors and 'quickfixtextfunc' is set
Problem: Crash when no errors and 'quickfixtextfunc' is set.
Solution: Do not handle errors if there aren't any. |
PackLinuxElf32mipsel::buildLoader(Filter const *ft)
{
buildLinuxLoader(
stub_mipsel_r3000_linux_elf_entry, sizeof(stub_mipsel_r3000_linux_elf_entry),
stub_mipsel_r3000_linux_elf_fold, sizeof(stub_mipsel_r3000_linux_elf_fold), ft);
} | 0 | [
"CWE-476"
] | upx | ef336dbcc6dc8344482f8cf6c909ae96c3286317 | 8,918,571,201,217,535,000,000,000,000,000,000,000 | 6 | Protect against bad crafted input.
https://github.com/upx/upx/issues/128
modified: p_lx_elf.cpp |
externalParEntInitProcessor(XML_Parser parser,
const char *s,
const char *end,
const char **nextPtr)
{
enum XML_Error result = initializeEncoding(parser);
if (result != XML_ERROR_NONE)
return result;
/* we know now that XML_P... | 0 | [
"CWE-611"
] | libexpat | 11f8838bf99ea0a6f0b76f9760c43704d00c4ff6 | 308,090,337,666,982,100,000,000,000,000,000,000,000 | 22 | xmlparse.c: Fix extraction of namespace prefix from XML name (#186) |
reply_and_prefetch(struct worker* worker, struct query_info* qinfo,
uint16_t flags, struct comm_reply* repinfo, time_t leeway, int noreply,
int rpz_passthru, struct edns_option* opt_list)
{
(void)opt_list;
/* first send answer to client to keep its latency
* as small as a cachereply */
if(!noreply) {
if(repinf... | 0 | [
"CWE-613",
"CWE-703"
] | unbound | f6753a0f1018133df552347a199e0362fc1dac68 | 189,640,878,160,794,630,000,000,000,000,000,000,000 | 34 | - Fix the novel ghost domain issues CVE-2022-30698 and CVE-2022-30699. |
static struct wireless_dev *brcmf_cfg80211_add_iface(struct wiphy *wiphy,
const char *name,
unsigned char name_assign_type,
enum nl80211_iftype type,
struct vif_params *params)
{
struct wireless_dev *wdev;
int err;
brcmf_dbg(TRACE, "enter: %s type %d\n", name, type);
err... | 0 | [
"CWE-119",
"CWE-787"
] | linux | 8f44c9a41386729fea410e688959ddaa9d51be7c | 172,520,057,672,350,180,000,000,000,000,000,000,000 | 44 | brcmfmac: fix possible buffer overflow in brcmf_cfg80211_mgmt_tx()
The lower level nl80211 code in cfg80211 ensures that "len" is between
25 and NL80211_ATTR_FRAME (2304). We subtract DOT11_MGMT_HDR_LEN (24) from
"len" so thats's max of 2280. However, the action_frame->data[] buffer is
only BRCMF_FIL_ACTION_FRAME_SI... |
static GF_Err gf_sm_live_encode_scene_au(GF_SceneEngine *seng, gf_seng_callback callback, Bool from_start)
{
GF_Err e;
u32 i, j, size, count, nb_streams;
u8 *data;
GF_AUContext *au;
if (!callback) return GF_BAD_PARAM;
e = GF_OK;
nb_streams = gf_list_count(seng->ctx->streams);
for (i=0; i<nb_streams; i++) {
... | 0 | [
"CWE-787"
] | gpac | ea1eca00fd92fa17f0e25ac25652622924a9a6a0 | 99,289,869,899,235,100,000,000,000,000,000,000,000 | 56 | fixed #2138 |
int gdImageColorResolve (gdImagePtr im, int r, int g, int b)
{
return gdImageColorResolveAlpha(im, r, g, b, gdAlphaOpaque);
} | 0 | [
"CWE-119"
] | php-src | e7f2356665c2569191a946b6fc35b437f0ae1384 | 307,998,074,707,163,200,000,000,000,000,000,000,000 | 4 | Fix #66387: Stack overflow with imagefilltoborder
The stack overflow is caused by the recursive algorithm in combination with a
very large negative coordinate passed to gdImageFillToBorder(). As there is
already a clipping for large positive coordinates to the width and height of
the image, it seems to be consequent t... |
inline uint get_set_pack_length(int elements)
{
uint len= (elements + 7) / 8;
return len > 4 ? 8 : len;
} | 0 | [
"CWE-416",
"CWE-703"
] | server | 08c7ab404f69d9c4ca6ca7a9cf7eec74c804f917 | 313,533,574,624,038,400,000,000,000,000,000,000,000 | 5 | 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... |
static inline bool stage_session(__be16 sid)
{
return sid != 0;
} | 0 | [
"CWE-20",
"CWE-269"
] | linux | f3d3342602f8bcbf37d7c46641cb9bca7618eb1c | 213,754,127,103,194,830,000,000,000,000,000,000,000 | 4 | net: rework recvmsg handler msg_name and msg_namelen logic
This patch now always passes msg->msg_namelen as 0. recvmsg handlers must
set msg_namelen to the proper size <= sizeof(struct sockaddr_storage)
to return msg_name to the user.
This prevents numerous uninitialized memory leaks we had in the
recvmsg handlers an... |
int EC_GROUP_get_curve_GF2m(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx)
{
if (group->meth->group_get_curve == 0)
{
ECerr(EC_F_EC_GROUP_GET_CURVE_GF2M, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
return group->meth->group_get_curve(group, p, a, b, ctx);
} | 0 | [
"CWE-320"
] | openssl | 8aed2a7548362e88e84a7feb795a3a97e8395008 | 319,071,742,058,175,760,000,000,000,000,000,000,000 | 9 | Reserve option to use BN_mod_exp_mont_consttime in ECDSA.
Submitted by Shay Gueron, Intel Corp.
RT: 3149
Reviewed-by: Rich Salz <rsalz@openssl.org>
(cherry picked from commit f54be179aa4cbbd944728771d7d59ed588158a12) |
GF_Err hnti_box_read(GF_Box *s, GF_BitStream *bs)
{
return gf_isom_box_array_read_ex(s, bs, hnti_on_child_box, s->type);
} | 0 | [
"CWE-787"
] | gpac | 388ecce75d05e11fc8496aa4857b91245007d26e | 89,487,558,447,141,770,000,000,000,000,000,000,000 | 4 | fixed #1587 |
static void test_pure_coverage()
{
MYSQL_STMT *stmt;
MYSQL_BIND my_bind[2];
int rc;
ulong length;
myheader("test_pure_coverage");
rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_pure");
myquery(rc);
rc= mysql_query(mysql, "CREATE TABLE test_pure(c1 int, c2 varchar(20))");
myquery(rc);... | 0 | [
"CWE-416"
] | server | eef21014898d61e77890359d6546d4985d829ef6 | 276,639,364,391,557,700,000,000,000,000,000,000,000 | 79 | MDEV-11933 Wrong usage of linked list in mysql_prune_stmt_list
mysql_prune_stmt_list() was walking the list following
element->next pointers, but inside the loop it was invoking
list_add(element) that modified element->next. So, mysql_prune_stmt_list()
failed to visit and reset all elements, and some of them were left... |
static nio_t *create_unix_socket(const char *params)
{
nio_t *nio;
char *local;
char *remote;
printf("Creating UNIX domain socket %s\n", params);
local = strtok((char *)params, ":");
remote = strtok(NULL, ":");
if (local == NULL || remote == NULL) {
fprintf(stderr, "invalid UNIX domain socket syntax... | 0 | [
"CWE-200",
"CWE-269"
] | ubridge | 2eb0d1dab6a6de76cf3556130a2d52af101077db | 54,952,266,143,541,295,000,000,000,000,000,000,000 | 18 | Hide errored line content during parsing configuration INI file on default |
static void snd_pcm_oss_proc_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_pcm_str *pstr = entry->private_data;
struct snd_pcm_oss_setup *setup = pstr->oss.setup_list;
mutex_lock(&pstr->oss.setup_mutex);
while (setup) {
snd_iprintf(buffer, "%s %u %u%s%s%s%s%s%s\n",
s... | 0 | [
"CWE-362"
] | linux | 8423f0b6d513b259fdab9c9bf4aaa6188d054c2d | 97,069,607,108,597,550,000,000,000,000,000,000,000 | 21 | ALSA: pcm: oss: Fix race at SNDCTL_DSP_SYNC
There is a small race window at snd_pcm_oss_sync() that is called from
OSS PCM SNDCTL_DSP_SYNC ioctl; namely the function calls
snd_pcm_oss_make_ready() at first, then takes the params_lock mutex
for the rest. When the stream is set up again by another thread
between them, ... |
parse_snapshot(const char *str)
{
txid xmin;
txid xmax;
txid last_val = 0,
val;
const char *str_start = str;
const char *endp;
StringInfo buf;
xmin = str2txid(str, &endp);
if (*endp != ':')
goto bad_format;
str = endp + 1;
xmax = str2txid(str, &endp);
if (*endp != ':')
goto bad_format;
str = en... | 0 | [
"CWE-703",
"CWE-189"
] | postgres | 31400a673325147e1205326008e32135a78b4d8a | 35,591,349,596,556,450,000,000,000,000,000,000,000 | 53 | Predict integer overflow to avoid buffer overruns.
Several functions, mostly type input functions, calculated an allocation
size such that the calculation wrapped to a small positive value when
arguments implied a sufficiently-large requirement. Writes past the end
of the inadvertent small allocation followed shortly... |
static int context_struct_to_string(struct context *context, char **scontext, u32 *scontext_len)
{
char *scontextp;
if (scontext)
*scontext = NULL;
*scontext_len = 0;
if (context->len) {
*scontext_len = context->len;
if (scontext) {
*scontext = kstrdup(context->str, GFP_ATOMIC);
if (!(*scontext))
... | 0 | [
"CWE-20"
] | linux | 2172fa709ab32ca60e86179dc67d0857be8e2c98 | 325,616,572,836,690,140,000,000,000,000,000,000,000 | 50 | SELinux: Fix kernel BUG on empty security contexts.
Setting an empty security context (length=0) on a file will
lead to incorrectly dereferencing the type and other fields
of the security context structure, yielding a kernel BUG.
As a zero-length security context is never valid, just reject
all such security contexts... |
bool group() const { return m_group; } | 0 | [
"CWE-617"
] | server | 807945f2eb5fa22e6f233cc17b85a2e141efe2c8 | 241,872,456,252,022,560,000,000,000,000,000,000,000 | 1 | MDEV-26402: A SEGV in Item_field::used_tables/update_depend_map_for_order...
When doing condition pushdown from HAVING into WHERE,
Item_equal::create_pushable_equalities() calls
item->set_extraction_flag(IMMUTABLE_FL) for constant items.
Then, Item::cleanup_excluding_immutables_processor() checks for this flag
to see ... |
static int __send_discard(struct clone_info *ci)
{
return __send_changing_extent_only(ci, get_num_discard_bios,
is_split_required_for_discard);
} | 0 | [
"CWE-362"
] | linux | b9a41d21dceadf8104812626ef85dc56ee8a60ed | 159,665,054,678,700,730,000,000,000,000,000,000,000 | 5 | dm: fix race between dm_get_from_kobject() and __dm_destroy()
The following BUG_ON was hit when testing repeat creation and removal of
DM devices:
kernel BUG at drivers/md/dm.c:2919!
CPU: 7 PID: 750 Comm: systemd-udevd Not tainted 4.1.44
Call Trace:
[<ffffffff81649e8b>] dm_get_from_kobject+0x34/0x3a
... |
cnt_lookup(struct worker *wrk, struct req *req)
{
struct objcore *oc, *busy;
enum lookup_e lr;
int had_objhead = 0;
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
AZ(req->objcore);
AZ(req->stale_oc);
AN(req->vcl);
VRY_Prep(req);
AZ(req->objcore);
if (req->hash_objhead)
had_obj... | 0 | [
"CWE-212"
] | varnish-cache | bd7b3d6d47ccbb5e1747126f8e2a297f38e56b8c | 216,365,317,897,998,320,000,000,000,000,000,000,000 | 121 | Clear err_code and err_reason at start of request handling
req->err_code and req->err_reason are set when going to synthetic
handling. From there the resp.reason HTTP field is set from
req->err_reason if set, or the generic code based on req->err_code is used
if it was NULL. This patch clears these members so that a v... |
static Variant HHVM_METHOD(ZipArchive, getStatusString) {
auto zipDir = getResource<ZipDirectory>(this_, "zipDir");
FAIL_IF_INVALID_ZIPARCHIVE(getStatusString, zipDir);
int zep, sep, len;
zip_error_get(zipDir->getZip(), &zep, &sep);
char error_string[128];
len = zip_error_to_str(error_string, 128, zep, s... | 0 | [
"CWE-22"
] | hhvm | 65c95a01541dd2fbc9c978ac53bed235b5376686 | 39,130,717,129,427,195,000,000,000,000,000,000,000 | 13 | ZipArchive::extractTo bug 70350
Summary:Don't allow upward directory traversal when extracting zip archive files.
Files in zip files with `..` or starting at main root `/` should be normalized
to something where the file being extracted winds up within the directory or
a subdirectory where the actual extraction is ta... |
mark_desktop_file_executable (CommonJob *common,
GCancellable *cancellable,
GFile *file,
gboolean interactive)
{
GError *error;
guint32 current_perms, new_perms;
int response;
GFileInfo *info;
retry... | 0 | [
"CWE-20"
] | nautilus | 1630f53481f445ada0a455e9979236d31a8d3bb0 | 28,542,191,869,148,215,000,000,000,000,000,000,000 | 101 | mime-actions: use file metadata for trusting desktop files
Currently we only trust desktop files that have the executable bit
set, and don't replace the displayed icon or the displayed name until
it's trusted, which prevents for running random programs by a malicious
desktop file.
However, the executable permission i... |
static int rbd_dev_image_probe(struct rbd_device *rbd_dev, int depth)
{
bool need_watch = !rbd_is_ro(rbd_dev);
int ret;
/*
* Get the id from the image id object. Unless there's an
* error, rbd_dev->spec->image_id will be filled in with
* a dynamically-allocated string, and rbd_dev->image_format
* will be s... | 0 | [
"CWE-863"
] | linux | f44d04e696feaf13d192d942c4f14ad2e117065a | 211,797,451,920,687,960,000,000,000,000,000,000,000 | 91 | rbd: require global CAP_SYS_ADMIN for mapping and unmapping
It turns out that currently we rely only on sysfs attribute
permissions:
$ ll /sys/bus/rbd/{add*,remove*}
--w------- 1 root root 4096 Sep 3 20:37 /sys/bus/rbd/add
--w------- 1 root root 4096 Sep 3 20:37 /sys/bus/rbd/add_single_major
--w------- 1 ro... |
mysql_escape_string(char *to,const char *from, ulong length)
{
return (ulong)mysql_cset_escape_slashes(ma_default_charset_info, to, from, length);
} | 0 | [] | mariadb-connector-c | 27b2f3d1f1550dfaee0f63a331a406ab31c1b37e | 336,125,015,610,733,700,000,000,000,000,000,000,000 | 4 | various checks for corrupted packets in the protocol
also: check the return value of unpack_fields() |
static av_cold int h264_decode_end(AVCodecContext *avctx)
{
H264Context *h = avctx->priv_data;
ff_h264_remove_all_refs(h);
ff_h264_free_context(h);
unref_picture(h, &h->cur_pic);
return 0;
} | 0 | [
"CWE-703"
] | FFmpeg | 29ffeef5e73b8f41ff3a3f2242d356759c66f91f | 84,748,781,933,156,580,000,000,000,000,000,000,000 | 11 | avcodec/h264: do not trust last_pic_droppable when marking pictures as done
This simplifies the code and fixes a deadlock
Fixes Ticket2927
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> |
int sdma_init(struct hfi1_devdata *dd, u8 port)
{
unsigned this_idx;
struct sdma_engine *sde;
struct rhashtable *tmp_sdma_rht;
u16 descq_cnt;
void *curr_head;
struct hfi1_pportdata *ppd = dd->pport + port;
u32 per_sdma_credits;
uint idle_cnt = sdma_idle_cnt;
size_t num_engines = chip_sdma_engines(dd);
int ret... | 0 | [
"CWE-400",
"CWE-401"
] | linux | 34b3be18a04ecdc610aae4c48e5d1b799d8689f6 | 125,850,167,034,779,360,000,000,000,000,000,000,000 | 186 | RDMA/hfi1: Prevent memory leak in sdma_init
In sdma_init if rhashtable_init fails the allocated memory for
tmp_sdma_rht should be released.
Fixes: 5a52a7acf7e2 ("IB/hfi1: NULL pointer dereference when freeing rhashtable")
Link: https://lore.kernel.org/r/20190925144543.10141-1-navid.emamdoost@gmail.com
Signed-off-by: ... |
pdf14_decrement_smask_color(gs_gstate * pgs, gx_device * dev)
{
pdf14_device * pdev = (pdf14_device *) dev;
pdf14_smaskcolor_t *smaskcolor = pdev->smaskcolor;
gsicc_manager_t *icc_manager = pgs->icc_manager;
int k;
/* See comment in pdf14_increment_smask_color to understand this one */
if (pdev... | 0 | [] | ghostpdl | c432131c3fdb2143e148e8ba88555f7f7a63b25e | 320,659,723,879,265,250,000,000,000,000,000,000,000 | 80 | Bug 699661: Avoid sharing pointers between pdf14 compositors
If a copdevice is triggered when the pdf14 compositor is the device, we make
a copy of the device, then throw an error because, by default we're only allowed
to copy the device prototype - then freeing it calls the finalize, which frees
several pointers shar... |
fr_window_deactivate_filter (FrWindow *window)
{
GtkAction *action;
action = gtk_action_group_get_action (window->priv->actions, "Find");
g_object_set (action, "active", FALSE, NULL);
} | 0 | [
"CWE-22"
] | file-roller | b147281293a8307808475e102a14857055f81631 | 214,507,400,233,736,760,000,000,000,000,000,000,000 | 7 | libarchive: sanitize filenames before extracting |
CImg<Tfloat> get_laplacian() const {
if (is_empty()) return CImg<Tfloat>();
CImg<Tfloat> res(_width,_height,_depth,_spectrum);
if (_depth>1) { // 3D
cimg_pragma_openmp(parallel for cimg_openmp_if(_width*_height*_depth>=(cimg_openmp_sizefactor)*1048576 &&
... | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 134,585,044,981,837,420,000,000,000,000,000,000,000 | 30 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
static auth_result url_remove_listener (auth_client *auth_user)
{
client_t *client = auth_user->client;
auth_t *auth = client->auth;
auth_url *url = auth->state;
time_t duration = time(NULL) - client->con->con_time;
char *username, *password, *mount, *server;
const char *mountreq;
ice_config... | 0 | [
"CWE-119"
] | icecast-server | b21a7283bd1598c5af0bbb250a041ba8198f98f2 | 259,898,988,119,441,240,000,000,000,000,000,000,000 | 97 | Fix: Fixed buffer overflows in URL auth code.
See: #2342 |
void set_user_nice(struct task_struct *p, long nice)
{
int old_prio, delta, on_rq;
unsigned long flags;
struct rq *rq;
if (TASK_NICE(p) == nice || nice < -20 || nice > 19)
return;
/*
* We have to be careful, if called from sys_setpriority(),
* the task might be in the middle of scheduling on another CPU.
... | 0 | [
"CWE-703",
"CWE-835"
] | linux | f26f9aff6aaf67e9a430d16c266f91b13a5bff64 | 222,081,899,419,601,100,000,000,000,000,000,000,000 | 45 | Sched: fix skip_clock_update optimization
idle_balance() drops/retakes rq->lock, leaving the previous task
vulnerable to set_tsk_need_resched(). Clear it after we return
from balancing instead, and in setup_thread_stack() as well, so
no successfully descheduled or never scheduled task has it set.
Need resched confus... |
int ha_partition::del_ren_cre_table(const char *from,
const char *to,
TABLE *table_arg,
HA_CREATE_INFO *create_info)
{
int save_error= 0;
int error= HA_ERR_INTERNAL_ERROR;
char from_buff[FN_REFLEN], to_buff[FN_REFLEN], from_lc_buff[FN_REFLEN],
to_lc_buff[FN_REFLEN], buff[FN_REFLE... | 1 | [] | server | f305a7ce4bccbd56520d874e1d81a4f29bc17a96 | 89,399,250,967,536,700,000,000,000,000,000,000,000 | 129 | bugfix: long partition names |
static inline dma_addr_t __alloc_iova(struct dma_iommu_mapping *mapping,
size_t size)
{
unsigned int order = get_order(size);
unsigned int align = 0;
unsigned int count, start;
unsigned long flags;
if (order > CONFIG_ARM_DMA_IOMMU_ALIGNMENT)
order = CONFIG_ARM_DMA_IOMMU_ALIGNMENT;
count = ((PAGE_ALI... | 0 | [
"CWE-284",
"CWE-264"
] | linux | 0ea1ec713f04bdfac343c9702b21cd3a7c711826 | 280,253,669,249,275,860,000,000,000,000,000,000,000 | 30 | ARM: dma-mapping: don't allow DMA mappings to be marked executable
DMA mapping permissions were being derived from pgprot_kernel directly
without using PAGE_KERNEL. This causes them to be marked with executable
permission, which is not what we want. Fix this.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk... |
void qemu_ram_free(struct uc_struct *uc, RAMBlock *block)
{
if (!block) {
return;
}
//if (block->host) {
// ram_block_notify_remove(block->host, block->max_length);
//}
QLIST_REMOVE_RCU(block, next);
uc->ram_list.mru_block = NULL;
/* Write list before version */
//smp_wm... | 0 | [
"CWE-476"
] | unicorn | 3d3deac5e6d38602b689c4fef5dac004f07a2e63 | 53,361,243,137,067,660,000,000,000,000,000,000,000 | 17 | Fix crash when mapping a big memory and calling uc_close |
static void defer_request(struct i915_request *rq, struct list_head * const pl)
{
LIST_HEAD(list);
/*
* We want to move the interrupted request to the back of
* the round-robin list (i.e. its priority level), but
* in doing so, we must then move all requests that were in
* flight and were waiting for the int... | 0 | [] | linux | bc8a76a152c5f9ef3b48104154a65a68a8b76946 | 288,341,464,164,317,280,000,000,000,000,000,000,000 | 43 | 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... |
bool st_select_lex::add_cross_joined_table(TABLE_LIST *left_op,
TABLE_LIST *right_op,
bool straight_fl)
{
DBUG_ENTER("add_cross_joined_table");
THD *thd= parent_lex->thd;
if (!(right_op->nested_join &&
(right_op->nested_join->n... | 0 | [] | server | ba4927e520190bbad763bb5260ae154f29a61231 | 288,449,587,122,780,300,000,000,000,000,000,000,000 | 118 | MDEV-19398: Assertion `item1->type() == Item::FIELD_ITEM ...
Window Functions code tries to minimize the number of times it
needs to sort the select's resultset by finding "compatible"
OVER (PARTITION BY ... ORDER BY ...) clauses.
This employs compare_order_elements(). That function assumed that
the order expressions... |
evdev_scroll_config_natural_get(struct libinput_device *device)
{
struct evdev_device *dev = evdev_device(device);
return dev->scroll.natural_scrolling_enabled ? 1 : 0;
} | 0 | [
"CWE-134"
] | libinput | a423d7d3269dc32a87384f79e29bb5ac021c83d1 | 17,933,971,045,138,447,000,000,000,000,000,000,000 | 6 | evdev: strip the device name of format directives
This fixes a format string vulnerabilty.
evdev_log_message() composes a format string consisting of a fixed
prefix (including the rendered device name) and the passed-in format
buffer. This format string is then passed with the arguments to the
actual log handler, whi... |
DeepScanLineInputFile::Data::~Data ()
{
for (size_t i = 0; i < lineBuffers.size(); i++)
if (lineBuffers[i] != 0)
delete lineBuffers[i];
for (size_t i = 0; i < slices.size(); i++)
delete slices[i];
if (sampleCountTableComp != 0)
delete sampleCountTableComp;
if (... | 0 | [
"CWE-125"
] | openexr | e79d2296496a50826a15c667bf92bdc5a05518b4 | 74,171,081,117,807,750,000,000,000,000,000,000,000 | 15 | fix memory leaks and invalid memory accesses
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz> |
PHP_MINFO_FUNCTION(openssl)
{
php_info_print_table_start();
php_info_print_table_row(2, "OpenSSL support", "enabled");
php_info_print_table_row(2, "OpenSSL Library Version", SSLeay_version(SSLEAY_VERSION));
php_info_print_table_row(2, "OpenSSL Header Version", OPENSSL_VERSION_TEXT);
php_info_print_table_end();
} | 0 | [
"CWE-200"
] | php-src | 270a406ac94b5fc5cc9ef59fc61e3b4b95648a3e | 129,149,878,924,641,630,000,000,000,000,000,000,000 | 8 | Fix bug #61413 ext\openssl\tests\openssl_encrypt_crash.phpt fails 5.3 only |
struct sctp_transport *sctp_assoc_lookup_paddr(
const struct sctp_association *asoc,
const union sctp_addr *address)
{
struct sctp_transport *t;
struct list_head *pos;
/* Cycle through all transports searching for a peer address. */
list_for_each(pos, &asoc->peer.transport_addr_list) {
t = list_entry(... | 0 | [] | linux | bbd0d59809f923ea2b540cbd781b32110e249f6e | 72,075,195,862,369,590,000,000,000,000,000,000,000 | 17 | [SCTP]: Implement the receive and verification of AUTH chunk
This patch implements the receive path needed to process authenticated
chunks. Add ability to process the AUTH chunk and handle edge cases
for authenticated COOKIE-ECHO as well.
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David ... |
safe_atou_base(const char *str, unsigned int *val, int base)
{
char *endptr;
unsigned long v;
assert(base == 10 || base == 16 || base == 8);
errno = 0;
v = strtoul(str, &endptr, base);
if (errno > 0)
return false;
if (str == endptr)
return false;
if (*str != '\0' && *endptr != '\0')
return false;
if (... | 0 | [
"CWE-134"
] | libinput | a423d7d3269dc32a87384f79e29bb5ac021c83d1 | 186,443,277,786,299,860,000,000,000,000,000,000,000 | 22 | evdev: strip the device name of format directives
This fixes a format string vulnerabilty.
evdev_log_message() composes a format string consisting of a fixed
prefix (including the rendered device name) and the passed-in format
buffer. This format string is then passed with the arguments to the
actual log handler, whi... |
TEST_F(QueryPlannerTest, MaxWithoutIndex) {
runInvalidQueryHintMinMax(BSONObj(), BSONObj(), BSONObj(), fromjson("{a: 1}"));
} | 0 | [] | mongo | ee97c0699fd55b498310996ee002328e533681a3 | 48,415,666,750,022,820,000,000,000,000,000,000,000 | 3 | SERVER-36993 Fix crash due to incorrect $or pushdown for indexed $expr. |
mark_tls_slots (void *addr, MonoGCMarkFunc mark_func)
{
int i;
gpointer *static_data = addr;
for (i = 0; i < NUM_STATIC_DATA_IDX; ++i) {
int j, numwords;
void **ptr;
if (!static_data [i])
continue;
numwords = 1 + static_data_size [i] / sizeof (gpointer) / (sizeof(uintptr_t) * 8);
ptr = static_data [i];
... | 0 | [
"CWE-399",
"CWE-264"
] | mono | 722f9890f09aadfc37ae479e7d946d5fc5ef7b91 | 323,097,065,222,812,030,000,000,000,000,000,000,000 | 24 | Fix access to freed members of a dead thread
* threads.c: Fix access to freed members of a dead thread. Found
and fixed by Rodrigo Kumpera <rkumpera@novell.com>
Ref: CVE-2011-0992 |
static int __find_msr_index(struct vcpu_vmx *vmx, u32 msr)
{
int i;
for (i = 0; i < vmx->nmsrs; ++i)
if (vmx_msr_index[vmx->guest_msrs[i].index] == msr)
return i;
return -1;
} | 0 | [
"CWE-400"
] | linux-2.6 | 9581d442b9058d3699b4be568b6e5eae38a41493 | 101,395,082,681,169,740,000,000,000,000,000,000,000 | 9 | KVM: Fix fs/gs reload oops with invalid ldt
kvm reloads the host's fs and gs blindly, however the underlying segment
descriptors may be invalid due to the user modifying the ldt after loading
them.
Fix by using the safe accessors (loadsegment() and load_gs_index()) instead
of home grown unsafe versions.
This is CVE-... |
void bpf_map_init_from_attr(struct bpf_map *map, union bpf_attr *attr)
{
map->map_type = attr->map_type;
map->key_size = attr->key_size;
map->value_size = attr->value_size;
map->max_entries = attr->max_entries;
map->map_flags = bpf_map_flags_retain_permanent(attr->map_flags);
map->numa_node = bpf_map_attr_numa_no... | 0 | [
"CWE-307"
] | linux | 350a5c4dd2452ea999cc5e1d4a8dbf12de2f97ef | 138,763,697,781,444,500,000,000,000,000,000,000,000 | 9 | bpf: Dont allow vmlinux BTF to be used in map_create and prog_load.
The syzbot got FD of vmlinux BTF and passed it into map_create which caused
crash in btf_type_id_size() when it tried to access resolved_ids. The vmlinux
BTF doesn't have 'resolved_ids' and 'resolved_sizes' initialized to save
memory. To avoid such is... |
void CLASS parse_rollei()
{
char line[128], *val;
struct tm t;
fseek(ifp, 0, SEEK_SET);
memset(&t, 0, sizeof t);
do
{
fgets(line, 128, ifp);
if ((val = strchr(line, '=')))
*val++ = 0;
else
val = line + strbuflen(line);
if (!strcmp(line, "DAT"))
sscanf(val, "%d.%d.%d", &t.t... | 1 | [
"CWE-400"
] | LibRaw | e67a9862d10ebaa97712f532eca1eb5e2e410a22 | 272,817,190,411,095,350,000,000,000,000,000,000,000 | 38 | Fixed Secunia Advisory SA86384
- possible infinite loop in unpacked_load_raw()
- possible infinite loop in parse_rollei()
- possible infinite loop in parse_sinar_ia()
Credits: Laurent Delosieres, Secunia Research at Flexera |
char *env_get(const char *name, char **envp) {
size_t len = strlen(name);
char *p, *q;
while ((p = *envp++) != NULL) {
if (!(q = strchr(p, '=')))
continue;
if ((q - p) == len && !strncmp(p, name, len))
return (q + 1);
}
return (NULL);
} | 0 | [
"CWE-476"
] | cronie | a6576769f01325303b11edc3e0cfb05ef382ce56 | 334,078,818,838,752,570,000,000,000,000,000,000,000 | 12 | Fix CVE-2019-9704 and CVE-2019-9705
The users can cause DoS of the crond by loading huge crontab files.
We now allow maximum 1000 environment variables and 1000 crontab entries.
Also the comments and whitespace between the entries and variables
are now limited to 32768 characters. |
static unsigned char *AcquireCompactPixels(const Image *image,
ExceptionInfo *exception)
{
size_t
packet_size;
unsigned char
*compact_pixels;
packet_size=image->depth > 8UL ? 2UL : 1UL;
compact_pixels=(unsigned char *) AcquireQuantumMemory((9*
image->columns)+1,packet_size*sizeof(*compact_pixels... | 1 | [
"CWE-787"
] | ImageMagick | d4ec73f866a7c42a2e7f301fcd696e5cb7a7d3ab | 55,828,847,559,738,350,000,000,000,000,000,000,000 | 20 | https://github.com/ImageMagick/ImageMagick/issues/350 |
static int session_new(nghttp2_session **session_ptr,
const nghttp2_session_callbacks *callbacks,
void *user_data, int server,
const nghttp2_option *option, nghttp2_mem *mem) {
int rv;
size_t nbuffer;
size_t max_deflate_dynamic_table_size =
... | 1 | [
"CWE-707"
] | nghttp2 | 336a98feb0d56b9ac54e12736b18785c27f75090 | 250,576,554,405,796,100,000,000,000,000,000,000,000 | 191 | Implement max settings option |
int git_commit_list_parse(git_revwalk *walk, git_commit_list_node *commit)
{
git_odb_object *obj;
int error;
if (commit->parsed)
return 0;
if ((error = git_odb_read(&obj, walk->odb, &commit->oid)) < 0)
return error;
if (obj->cached.type != GIT_OBJECT_COMMIT) {
git_error_set(GIT_ERROR_INVALID, "object is n... | 0 | [] | libgit2 | 3316f666566f768eb8aa8de521a5262524dc3424 | 118,510,712,266,405,210,000,000,000,000,000,000,000 | 23 | commit_list: fix possible buffer overflow in `commit_quick_parse`
The function `commit_quick_parse` provides a way to quickly parse
parts of a commit without storing or verifying most of its
metadata. The first thing it does is calculating the number of
parents by skipping "parent " lines until it finds the first
non-... |
GF_DOMHandler *gf_dom_listener_build_ex(GF_Node *node, u32 event_type, u32 event_parameter, GF_Node *handler, GF_Node **out_listener)
{
SVG_Element *listener;
GF_FieldInfo info;
GF_ChildNodeItem *last = NULL;
if (!node || !node->sgprivate || !node->sgprivate->scenegraph) {
GF_LOG(GF_LOG_ERROR, GF_LOG_INTERACT, (... | 0 | [
"CWE-416"
] | gpac | 9723dd0955894f2cb7be13b94cf7a47f2754b893 | 273,512,408,052,048,070,000,000,000,000,000,000,000 | 47 | fixed #2109 |
int SSL_CTX_set_cipher_list(SSL_CTX *ctx, const char *str)
{
STACK_OF(SSL_CIPHER) *sk;
sk=ssl_create_cipher_list(ctx->method,&ctx->cipher_list,
&ctx->cipher_list_by_id,str, ctx->cert);
/* ssl_create_cipher_list may return an empty stack if it
* was unable to find a cipher matching the given rule string
* (f... | 0 | [
"CWE-310"
] | openssl | cf6da05304d554aaa885151451aa4ecaa977e601 | 161,189,498,275,144,440,000,000,000,000,000,000,000 | 22 | Support TLS_FALLBACK_SCSV.
Reviewed-by: Stephen Henson <steve@openssl.org> |
static void pdo_stmt_iter_move_forwards(zend_object_iterator *iter TSRMLS_DC)
{
struct php_pdo_iterator *I = (struct php_pdo_iterator*)iter->data;
if (I->fetch_ahead) {
zval_ptr_dtor(&I->fetch_ahead);
I->fetch_ahead = NULL;
}
MAKE_STD_ZVAL(I->fetch_ahead);
if (!do_fetch(I->stmt, TRUE, I->fetch_ahead, PDO_F... | 0 | [
"CWE-476"
] | php-src | 6045de69c7dedcba3eadf7c4bba424b19c81d00d | 133,956,885,433,479,490,000,000,000,000,000,000,000 | 25 | Fix bug #73331 - do not try to serialize/unserialize objects wddx can not handle
Proper soltion would be to call serialize/unserialize and deal with the result,
but this requires more work that should be done by wddx maintainer (not me). |
static int set_core_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
{
__u32 __user *uaddr = (__u32 __user *)(unsigned long)reg->addr;
struct kvm_regs *regs = vcpu_gp_regs(vcpu);
int nr_regs = sizeof(*regs) / sizeof(__u32);
__uint128_t tmp;
void *valp = &tmp;
u64 off;
int err = 0;
/* Our ID is an inde... | 1 | [
"CWE-20"
] | linux | 2a3f93459d689d990b3ecfbe782fec89b97d3279 | 80,635,323,573,876,550,000,000,000,000,000,000,000 | 50 | arm64: KVM: Sanitize PSTATE.M when being set from userspace
Not all execution modes are valid for a guest, and some of them
depend on what the HW actually supports. Let's verify that what
userspace provides is compatible with both the VM settings and
the HW capabilities.
Cc: <stable@vger.kernel.org>
Fixes: 0d854a60b1... |
static int __init cma_init(void)
{
int ret;
cma_wq = create_singlethread_workqueue("rdma_cm");
if (!cma_wq)
return -ENOMEM;
ib_sa_register_client(&sa_client);
rdma_addr_register_client(&addr_client);
register_netdevice_notifier(&cma_nb);
ret = ib_register_client(&cma_client);
if (ret)
goto err;
if (ibn... | 0 | [
"CWE-20"
] | linux | b2853fd6c2d0f383dbdf7427e263eb576a633867 | 173,575,746,015,263,000,000,000,000,000,000,000,000 | 28 | IB/core: Don't resolve passive side RoCE L2 address in CMA REQ handler
The code that resolves the passive side source MAC within the rdma_cm
connection request handler was both redundant and buggy, so remove it.
It was redundant since later, when an RC QP is modified to RTR state,
the resolution will take place in th... |
set_vertex_data(ImageRenderData *rd, const ImageRef *ref, const ImageRect *dest_rect) {
#define R(n, a, b) rd->vertices[n*4] = ref->src_rect.a; rd->vertices[n*4 + 1] = ref->src_rect.b; rd->vertices[n*4 + 2] = dest_rect->a; rd->vertices[n*4 + 3] = dest_rect->b;
R(0, right, top); R(1, right, bottom); R(2, left, b... | 0 | [
"CWE-787"
] | kitty | 82c137878c2b99100a3cdc1c0f0efea069313901 | 179,000,367,655,945,650,000,000,000,000,000,000,000 | 5 | Graphics protocol: Dont return filename in the error message when opening file fails, since filenames can contain control characters
Fixes #3128 |
gsf_infile_tar_constructor (GType type,
guint n_construct_properties,
GObjectConstructParam *construct_params)
{
GsfInfileTar *tar = (GsfInfileTar *)
(parent_class->constructor (type,
n_construct_properties,
construct_params));
if (tar->source)
tar... | 0 | [
"CWE-476"
] | libgsf | 95a8351a75758cf10b3bf6abae0b6b461f90d9e5 | 173,001,232,628,633,130,000,000,000,000,000,000,000 | 13 | tar: fix crash on broken tar file. |
static int uv__idna_toascii_label(const char* s, const char* se,
char** d, char* de) {
static const char alphabet[] = "abcdefghijklmnopqrstuvwxyz0123456789";
const char* ss;
unsigned c;
unsigned h;
unsigned k;
unsigned n;
unsigned m;
unsigned q;
unsigned t;
unsigned... | 0 | [
"CWE-125"
] | libuv | b7466e31e4bee160d82a68fca11b1f61d46debae | 310,982,531,914,031,360,000,000,000,000,000,000,000 | 164 | idna: fix OOB read in punycode decoder
libuv was vulnerable to out-of-bounds reads in the uv__idna_toascii()
function which is used to convert strings to ASCII. This is called by
the DNS resolution function and can lead to information disclosures or
crashes.
Reported by Eric Sesterhenn in collaboration with Cure53 an... |
process_header(struct msghdr *msg, unsigned int msg_length, int sock_fd, SCK_Message *message)
{
struct cmsghdr *cmsg;
if (msg->msg_iovlen != 1) {
DEBUG_LOG("Unexpected iovlen");
return 0;
}
if (msg->msg_namelen > sizeof (union sockaddr_all)) {
DEBUG_LOG("Truncated source address");
return 0;
... | 0 | [
"CWE-59"
] | chrony | e18903a6b56341481a2e08469c0602010bf7bfe3 | 314,090,597,104,448,400,000,000,000,000,000,000,000 | 142 | switch to new util file functions
Replace all fopen(), rename(), and unlink() calls with the new util
functions. |
void *auth_mellon_server_config(apr_pool_t *p, server_rec *s)
{
am_srv_cfg_rec *srv;
am_mod_cfg_rec *mod;
const char key[] = "auth_mellon_server_config";
srv = apr_palloc(p, sizeof(*srv));
/* we want to keeep our global configuration of shared memory and
* mutexes, so we try to find it in the... | 0 | [
"CWE-601"
] | mod_auth_mellon | 9d28908e28ef70a12196c215503fb0075e1fd7f3 | 71,480,131,705,951,630,000,000,000,000,000,000,000 | 41 | Add MellonRedirectDomains option.
Limit the domains that we will redirect to after login / logout to a
set of trusted domains. By default we only allow redirects to the
current domain.
This change breaks backwards compatibility with any site that relies on
redirects to separate domains.
Fixes #35 |
static void h264_close_context(PayloadContext *data)
{
#ifdef DEBUG
int ii;
for (ii = 0; ii < 32; ii++) {
if (data->packet_types_received[ii])
av_log(NULL, AV_LOG_DEBUG, "Received %d packets of type %d\n",
data->packet_types_received[ii], ii);
}
#endif
} | 0 | [
"CWE-119",
"CWE-787"
] | FFmpeg | c42a1388a6d1bfd8001bf6a4241d8ca27e49326d | 143,884,982,621,716,620,000,000,000,000,000,000,000 | 12 | avformat/rtpdec_h264: Fix heap-buffer-overflow
Fixes: rtp_sdp/poc.sdp
Found-by: Bingchang <l.bing.chang.bc@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> |
mrb_class_new_class(mrb_state *mrb, mrb_value cv)
{
mrb_int n;
mrb_value super, blk;
mrb_value new_class;
mrb_sym mid;
n = mrb_get_args(mrb, "|C&", &super, &blk);
if (n == 0) {
super = mrb_obj_value(mrb->object_class);
}
new_class = mrb_obj_value(mrb_class_new(mrb, mrb_class_ptr(super)));
mid = M... | 0 | [
"CWE-787"
] | mruby | b1d0296a937fe278239bdfac840a3fd0e93b3ee9 | 108,263,093,647,647,780,000,000,000,000,000,000,000 | 22 | class.c: clear method cache after `remove_method`. |
__releases(ptl)
{
struct page *old_page;
old_page = vm_normal_page(vma, address, orig_pte);
if (!old_page) {
/*
* VM_MIXEDMAP !pfn_valid() case, or VM_SOFTDIRTY clear on a
* VM_PFNMAP VMA.
*
* We should not cow pages in a shared writeable mapping.
* Just mark the pages writable and/or call ops->pf... | 0 | [
"CWE-20"
] | linux | 6b7339f4c31ad69c8e9c0b2859276e22cf72176d | 330,197,598,741,431,700,000,000,000,000,000,000,000 | 69 | mm: avoid setting up anonymous pages into file mapping
Reading page fault handler code I've noticed that under right
circumstances kernel would map anonymous pages into file mappings: if
the VMA doesn't have vm_ops->fault() and the VMA wasn't fully populated
on ->mmap(), kernel would handle page fault to not populated... |
parse_traffic(char *buf, int len, char *port, uint64_t *traffic)
{
char *data = get_data(buf, len);
char error_buf[512];
json_settings settings = { 0 };
if (data == NULL) {
LOGE("No data found");
return -1;
}
json_value *obj = json_parse_ex(&settings, data, strlen(data), error_... | 0 | [
"CWE-78",
"CWE-787"
] | shadowsocks-libev | c67d275803dc6ea22c558d06b1f7ba9f94cd8de3 | 82,451,554,269,236,230,000,000,000,000,000,000,000 | 32 | Fix #1734 |
int main(int argc, char *argv[])
{
#ifdef HAVE_GUSI_H
GUSISetup(GUSIwithSIOUXSockets);
GUSISetup(GUSIwithInternetSockets);
#endif
#ifdef WITH_TCPWRAPPER
// this code makes sure that the linker cannot optimize away
// the DUL part of the network module where the external flags
// for libwrap are de... | 0 | [
"CWE-264"
] | dcmtk | beaf5a5c24101daeeafa48c375120b16197c9e95 | 142,151,320,317,755,650,000,000,000,000,000,000,000 | 268 | Make sure to handle setuid() return code properly.
In some tools the return value of setuid() is not checked. In the worst
case this could lead to privilege escalation since the process does not
give up its root privileges and continue as root. |
static int acpi_map_cpu2node(acpi_handle handle, int cpu, int physid)
{
#ifdef CONFIG_ACPI_NUMA
int nid;
nid = acpi_get_node(handle);
if (nid != NUMA_NO_NODE) {
set_apicid_to_node(physid, nid);
numa_set_node(cpu, nid);
}
#endif
return 0;
} | 0 | [
"CWE-120"
] | linux | dad5ab0db8deac535d03e3fe3d8f2892173fa6a4 | 48,514,877,452,897,350,000,000,000,000,000,000,000 | 13 | x86/acpi: Prevent out of bound access caused by broken ACPI tables
The bus_irq argument of mp_override_legacy_irq() is used as the index into
the isa_irq_to_gsi[] array. The bus_irq argument originates from
ACPI_MADT_TYPE_IO_APIC and ACPI_MADT_TYPE_INTERRUPT items in the ACPI
tables, but is nowhere sanity checked.
Th... |
static int wcd9335_codec_enable_dec(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kc, int event)
{
struct snd_soc_component *comp = snd_soc_dapm_to_component(w->dapm);
unsigned int decimator;
char *dec_adc_mux_name = NULL;
char *widget_name = NULL;
char *wname;
int ret = 0, amic_n;
u16 tx_vol_ctl_reg, pwr... | 1 | [] | sound | a54988113985ca22e414e132054f234fc8a92604 | 104,019,208,781,868,600,000,000,000,000,000,000,000 | 132 | wcd9335: fix a incorrect use of kstrndup()
In wcd9335_codec_enable_dec(), 'widget_name' is allocated by kstrndup().
However, according to doc: "Note: Use kmemdup_nul() instead if the size
is known exactly." So we should use kmemdup_nul() here instead of
kstrndup().
Signed-off-by: Gen Zhang <blackgod016574@gmail.com>
... |
static void qxl_set_dirty(ram_addr_t addr, ram_addr_t end)
{
while (addr < end) {
cpu_physical_memory_set_dirty(addr);
addr += TARGET_PAGE_SIZE;
}
} | 0 | [] | qemu-kvm | 5ff4e36c804157bd84af43c139f8cd3a59722db9 | 239,277,309,572,218,000,000,000,000,000,000,000,000 | 7 | qxl: async io support using new spice api
Some of the QXL port i/o commands are waiting for the spice server to
complete certain actions. Add async versions for these commands, so we
don't block the vcpu while the spice server processses the command.
Instead the qxl device will raise an IRQ when done.
The async comm... |
static void pstr(const char *s)
{
static const char *HEX = "0123456789ABCDEF";
Rune c;
pc(minify ? '\'' : '"');
while (*s) {
s += chartorune(&c, s);
switch (c) {
case '\'': ps("\\'"); break;
case '"': ps("\\\""); break;
case '\\': ps("\\\\"); break;
case '\b': ps("\\b"); break;
case '\f': ps("\\f"); b... | 0 | [
"CWE-476"
] | mujs | f5b3c703e18725e380b83427004632e744f85a6f | 142,109,564,729,162,190,000,000,000,000,000,000,000 | 30 | Issue #161: Cope with empty programs in mujs-pp. |
static void interface_set_mm_time(QXLInstance *sin, uint32_t mm_time)
{
dprint(3, "%s:\n", __FUNCTION__);
/* nothing to do */
} | 0 | [] | qemu-kvm | 5ff4e36c804157bd84af43c139f8cd3a59722db9 | 12,088,855,090,025,685,000,000,000,000,000,000,000 | 5 | qxl: async io support using new spice api
Some of the QXL port i/o commands are waiting for the spice server to
complete certain actions. Add async versions for these commands, so we
don't block the vcpu while the spice server processses the command.
Instead the qxl device will raise an IRQ when done.
The async comm... |
add_footnote_ref(struct footnote_list *list, struct footnote_ref *ref)
{
struct footnote_item *item = calloc(1, sizeof(struct footnote_item));
if (!item)
return 0;
item->ref = ref;
if (list->head == NULL) {
list->head = list->tail = item;
} else {
list->tail->next = item;
list->tail = item;
}
list->coun... | 0 | [] | redcarpet | e5a10516d07114d582d13b9125b733008c61c242 | 264,065,765,023,863,300,000,000,000,000,000,000,000 | 17 | Avoid rewinding previous inline when auto-linking
When a bit like "_foo_1@bar.com" is processed, first the emphasis is
rendered, then the 1 is output verbatim. When the `@` is encountered,
Redcarpet tries to find the "local part" of the address and stops when
it encounters an invalid char (i.e. here the `!`).
The pro... |
static int emulate_ss(struct x86_emulate_ctxt *ctxt, int err)
{
return emulate_exception(ctxt, SS_VECTOR, err, true);
} | 0 | [] | kvm | e28ba7bb020f07193bc000453c8775e9d2c0dda7 | 115,931,026,446,784,120,000,000,000,000,000,000,000 | 4 | KVM: x86: fix missing checks in syscall emulation
On hosts without this patch, 32bit guests will crash (and 64bit guests
may behave in a wrong way) for example by simply executing following
nasm-demo-application:
[bits 32]
global _start
SECTION .text
_start: syscall
(I tested it with winxp and linux ... |
static int decode_write(struct xdr_stream *xdr, struct nfs_pgio_res *res)
{
__be32 *p;
int status;
status = decode_op_hdr(xdr, OP_WRITE);
if (status)
return status;
p = xdr_inline_decode(xdr, 8);
if (unlikely(!p))
return -EIO;
res->count = be32_to_cpup(p++);
res->verf->committed = be32_to_cpup(p++);
retu... | 0 | [
"CWE-787"
] | linux | b4487b93545214a9db8cbf32e86411677b0cca21 | 281,437,159,234,366,550,000,000,000,000,000,000,000 | 16 | nfs: Fix getxattr kernel panic and memory overflow
Move the buffer size check to decode_attr_security_label() before memcpy()
Only call memcpy() if the buffer is large enough
Fixes: aa9c2669626c ("NFS: Client implementation of Labeled-NFS")
Signed-off-by: Jeffrey Mitchell <jeffrey.mitchell@starlab.io>
[Trond: clean u... |
void swap_shmem_alloc(swp_entry_t entry)
{
__swap_duplicate(entry, SWAP_MAP_SHMEM);
} | 0 | [
"CWE-264"
] | linux-2.6 | 1a5a9906d4e8d1976b701f889d8f35d54b928f25 | 279,323,669,433,312,000,000,000,000,000,000,000,000 | 4 | 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(... |
static int add_dirent_to_buf(handle_t *handle, struct dentry *dentry,
struct inode *inode, struct ext4_dir_entry_2 *de,
struct buffer_head *bh)
{
struct inode *dir = dentry->d_parent->d_inode;
const char *name = dentry->d_name.name;
int namelen = dentry->d_name.len;
unsigned int offset = 0;
unsign... | 0 | [
"CWE-20"
] | linux-2.6 | e6b8bc09ba2075cd91fbffefcd2778b1a00bd76f | 188,918,806,862,490,780,000,000,000,000,000,000,000 | 83 | ext4: Add sanity check to make_indexed_dir
Make sure the rec_len field in the '..' entry is sane, lest we overrun
the directory block and cause a kernel oops on a purposefully
corrupted filesystem.
Thanks to Sami Liedes for reporting this bug.
http://bugzilla.kernel.org/show_bug.cgi?id=12430
Signed-off-by: "Theodor... |
static EXT2_QSORT_TYPE ino_cmp(const void *a, const void *b)
{
const struct hash_entry *he_a = (const struct hash_entry *) a;
const struct hash_entry *he_b = (const struct hash_entry *) b;
return (he_a->ino - he_b->ino);
} | 0 | [
"CWE-787"
] | e2fsprogs | 8dd73c149f418238f19791f9d666089ef9734dff | 95,963,018,202,971,800,000,000,000,000,000,000,000 | 7 | e2fsck: abort if there is a corrupted directory block when rehashing
In e2fsck pass 3a, when we are rehashing directories, at least in
theory, all of the directories should have had corruptions with
respect to directory entry structure fixed. However, it's possible
(for example, if the user declined a fix) that we ca... |
messageSetEncoding(message *m, const char *enctype)
{
const struct encoding_map *e;
int i;
char *type;
assert(m != NULL);
assert(enctype != NULL);
/*m->encodingType = EEXTENSION;*/
while(isblank(*enctype))
enctype++;
cli_dbgmsg("messageSetEncoding: '%s'\n", enctype);
if(strcasecmp(enctype, "8 bit") == 0... | 0 | [
"CWE-125"
] | clamav-devel | 586a5180287262070637c8943f2f7efd652e4a2c | 126,316,049,694,250,160,000,000,000,000,000,000,000 | 111 | bb11797 - fix invalid read in fuzzed mail file. |
CImg<Tfloat> get_normalize() const {
return CImg<Tfloat>(*this,false).normalize();
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 339,353,718,383,216,100,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. |
R_API char *r_str_between(const char *cmt, const char *prefix, const char *suffix) {
char *c0, *c1;
if (!cmt || !prefix || !suffix || !*cmt) {
return NULL;
}
c0 = strstr (cmt, prefix);
if (c0) {
c1 = strstr (c0 + strlen (prefix), suffix);
if (c1) {
return r_str_ndup (c0 + strlen (prefix), (c1 - c0 - strle... | 0 | [
"CWE-78"
] | radare2 | 04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9 | 29,950,144,270,905,344,000,000,000,000,000,000,000 | 14 | Fix command injection on PDB download (#16966)
* Fix r_sys_mkdirp with absolute path on Windows
* Fix build with --with-openssl
* Use RBuffer in r_socket_http_answer()
* r_socket_http_answer: Fix read for big responses
* Implement r_str_escape_sh()
* Cleanup r_socket_connect() on Windows
* Fix socket being creat... |
void rad_packet_free(struct rad_packet_t *pack)
{
struct rad_attr_t *attr;
if (pack->buf)
mempool_free(pack->buf);
//munmap(pack->buf, REQ_LENGTH_MAX);
while(!list_empty(&pack->attrs)) {
attr = list_entry(pack->attrs.next, typeof(*attr), entry);
list_del(&attr->entry);
if (attr->alloc)
_free(attr->val... | 0 | [
"CWE-191",
"CWE-787"
] | accel-ppp | e9d369aa0054312b7633e964e9f7eb323f1f3d69 | 38,309,963,782,744,644,000,000,000,000,000,000,000 | 18 | radius: sanity check for vendor attribute length |
format_defaults_paste_buffer(struct format_tree *ft, struct paste_buffer *pb)
{
struct timeval tv;
size_t size;
char *s;
timerclear(&tv);
tv.tv_sec = paste_buffer_created(pb);
paste_buffer_data(pb, &size);
format_add(ft, "buffer_size", "%zu", size);
format_add(ft, "buffer_name", "%s", paste_buffer_name(pb... | 0 | [] | src | b32e1d34e10a0da806823f57f02a4ae6e93d756e | 231,618,869,378,579,270,000,000,000,000,000,000,000 | 18 | evbuffer_new and bufferevent_new can both fail (when malloc fails) and
return NULL. GitHub issue 1547. |
static void MSLProcessingInstructions(void *context,const xmlChar *target,
const xmlChar *data)
{
MSLInfo
*msl_info;
/*
A processing instruction has been parsed.
*/
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" SAX.processingInstruction(%s, %s)",
target,data);
msl_info=(MSLInfo *) ... | 0 | [
"CWE-772",
"CWE-787"
] | ImageMagick | e793eb203e5e0f91f5037aed6585e81b1e27395b | 123,956,092,065,314,540,000,000,000,000,000,000,000 | 15 | https://github.com/ImageMagick/ImageMagick/issues/636 |
int nghttp2_session_on_altsvc_received(nghttp2_session *session,
nghttp2_frame *frame) {
nghttp2_ext_altsvc *altsvc;
nghttp2_stream *stream;
altsvc = frame->ext.payload;
/* session->server case has been excluded */
if (frame->hd.stream_id == 0) {
if (altsvc->origi... | 0 | [] | nghttp2 | 0a6ce87c22c69438ecbffe52a2859c3a32f1620f | 173,741,175,925,651,080,000,000,000,000,000,000,000 | 37 | Add nghttp2_option_set_max_outbound_ack |
Pl_PNGFilter::decodeSub()
{
QTC::TC("libtests", "Pl_PNGFilter decodeSub");
unsigned char* buffer = this->cur_row + 1;
unsigned int bpp = this->bytes_per_pixel;
for (unsigned int i = 0; i < this->bytes_per_row; ++i)
{
unsigned char left = 0;
if (i >= bpp)
{
left ... | 1 | [
"CWE-787"
] | qpdf | d71f05ca07eb5c7cfa4d6d23e5c1f2a800f52e8e | 125,538,785,245,867,750,000,000,000,000,000,000,000 | 18 | Fix sign and conversion warnings (major)
This makes all integer type conversions that have potential data loss
explicit with calls that do range checks and raise an exception. After
this commit, qpdf builds with no warnings when -Wsign-conversion
-Wconversion is used with gcc or clang or when -W3 -Wd4800 is used
with ... |
uint row_pack_length() const
{ return (bytes_in_rec + ((bit_len > 0) ? 1 : 0)); } | 0 | [
"CWE-416",
"CWE-703"
] | server | 08c7ab404f69d9c4ca6ca7a9cf7eec74c804f917 | 145,221,456,789,879,630,000,000,000,000,000,000,000 | 2 | 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... |
reply_info_sortref_cmp(const void* a, const void* b)
{
struct rrset_ref* x = (struct rrset_ref*)a;
struct rrset_ref* y = (struct rrset_ref*)b;
if(x->key < y->key) return -1;
if(x->key > y->key) return 1;
return 0;
} | 0 | [
"CWE-787"
] | unbound | 6c3a0b54ed8ace93d5b5ca7b8078dc87e75cd640 | 36,138,193,205,530,720,000,000,000,000,000,000,000 | 8 | - Fix Out of Bound Write Compressed Names in rdata_copy(),
reported by X41 D-Sec. |
static int inet_fill_link_af(struct sk_buff *skb, const struct net_device *dev,
u32 ext_filter_mask)
{
struct in_device *in_dev = rcu_dereference_rtnl(dev->ip_ptr);
struct nlattr *nla;
int i;
if (!in_dev)
return -ENODATA;
nla = nla_reserve(skb, IFLA_INET_CONF, IPV4_DEVCONF_MAX * 4);
if (!nla)
return... | 0 | [
"CWE-399"
] | net-next | fbd40ea0180a2d328c5adc61414dc8bab9335ce2 | 173,994,853,754,216,800,000,000,000,000,000,000,000 | 19 | ipv4: Don't do expensive useless work during inetdev destroy.
When an inetdev is destroyed, every address assigned to the interface
is removed. And in this scenerio we do two pointless things which can
be very expensive if the number of assigned interfaces is large:
1) Address promotion. We are deleting all address... |
*out_rep = rep;
return;
}
}
}
}
static Bool dasher_merge_rep(GF_DashStream *ds, GF_MPD_Representation *rep)
{
Bool transcode_detected = GF_FALSE;
Bool recompute_set = GF_FALSE;
GF_MPD_Representation *n_rep = ds->rep;
//TODO: copy other properties in case we transcode ?
#define CHECK_VAL(_name, _v) ... | 0 | [
"CWE-787"
] | gpac | ea1eca00fd92fa17f0e25ac25652622924a9a6a0 | 52,234,003,177,213,775,000,000,000,000,000,000,000 | 50 | fixed #2138 |
static void mount_version(void)
{
int pid = fork();
if (!pid) {
const char *argv[] = { FUSERMOUNT_PROG, "--version", NULL };
exec_fusermount(argv);
_exit(1);
} else if (pid != -1)
waitpid(pid, NULL, 0);
} | 0 | [
"CWE-200"
] | ntfs-3g | 7f81935f32e58e8fec22bc46683b1b067469405f | 96,768,300,730,519,700,000,000,000,000,000,000,000 | 10 | Returned an error code when the --help or --version options are used
Accepting --help or --version options may leave the ntfs-3g process in an
unclean state, so reject them while processing options. Also reject
them in libfuse-lite. |
static inline Quantum GetPixelYellow(const Image *magick_restrict image,
const Quantum *magick_restrict pixel)
{
return(pixel[image->channel_map[YellowPixelChannel].offset]);
} | 0 | [
"CWE-20",
"CWE-125"
] | ImageMagick | 8187d2d8fd010d2d6b1a3a8edd935beec404dddc | 248,213,242,187,339,580,000,000,000,000,000,000,000 | 5 | https://github.com/ImageMagick/ImageMagick/issues/1610 |
doPassSearch(const TranslationTableHeader *table, const InString *input,
const TranslationTableRule *transRule, int passCharDots, int pos,
const widechar *passInstructions, int passIC, int *searchIC, int *searchPos,
TranslationTableRule *groupingRule, widechar groupingOp) {
int level = 0;
int k, kk;
int not = ... | 0 | [
"CWE-125"
] | liblouis | 5e4089659bb49b3095fa541fa6387b4c40d7396e | 25,712,527,844,345,840,000,000,000,000,000,000,000 | 132 | Fix a buffer overflow
Fixes #635
Thanks to HongxuChen for reporting it |
resolve_must(struct lyd_node *node, int inout_parent, int ignore_fail, int multi_error)
{
uint8_t i, must_size;
struct lys_node *schema;
struct lys_restr *must;
struct lyxp_set set;
struct ly_ctx *ctx = node->schema->module->ctx;
int rc = EXIT_SUCCESS;
assert(node);
memset(&set, 0, size... | 0 | [
"CWE-617"
] | libyang | 5ce30801f9ccc372bbe9b7c98bb5324b15fb010a | 273,224,393,028,091,150,000,000,000,000,000,000,000 | 91 | schema tree BUGFIX freeing nodes with no module set
Context must be passed explicitly for these cases.
Fixes #1452 |
uint64_t cipher_mode() const { return cipher_mode_; } | 0 | [
"CWE-20"
] | libvpx | f00890eecdf8365ea125ac16769a83aa6b68792d | 319,228,308,055,030,000,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 INLINE void wc_ecc_free_mpint(ecc_key* key, mp_int** mp)
{
if (key && mp && *mp) {
mp_clear(*mp);
XFREE(*mp, key->heap, DYNAMIC_TYPE_BIGINT);
*mp = NULL;
}
} | 0 | [
"CWE-200"
] | wolfssl | 9b9568d500f31f964af26ba8d01e542e1f27e5ca | 78,838,036,359,939,540,000,000,000,000,000,000,000 | 8 | Change ECDSA signing to use blinding. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.