func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
static int expand_cu(RzBinDwarfCompUnit *cu) {
RzBinDwarfDie *tmp;
if (!cu || cu->capacity == 0 || cu->capacity != cu->count) {
return -EINVAL;
}
tmp = (RzBinDwarfDie *)realloc(cu->dies,
cu->capacity * 2 * sizeof(RzBinDwarfDie));
if (!tmp) {
return -ENOMEM;
}
memset((ut8 *)tmp + cu->capacity * sizeof(Rz... | 0 | [
"CWE-787"
] | rizin | aa6917772d2f32e5a7daab25a46c72df0b5ea406 | 181,824,662,200,540,000,000,000,000,000,000,000,000 | 20 | Fix oob write for dwarf with abbrev with count 0 (Fix #2083) (#2086) |
GF_Err akey_box_size(GF_Box *s)
{
u32 pos=0;
GF_AdobeKeyInfoBox *ptr = (GF_AdobeKeyInfoBox *)s;
gf_isom_check_position(s, (GF_Box *)ptr->params, &pos);
return GF_OK;
} | 0 | [
"CWE-703"
] | gpac | f19668964bf422cf5a63e4dbe1d3c6c75edadcbb | 190,363,477,383,399,500,000,000,000,000,000,000,000 | 7 | fixed #1879 |
print_option_list(opt, printer, arg)
option_t *opt;
printer_func printer;
void *arg;
{
while (opt->name != NULL) {
if (opt->priority != OPRIO_DEFAULT
&& opt->winner != (short int) -1)
print_option(opt + opt->winner, opt, printer, arg);
do {
++opt;
} while (opt->flags & OPT_PRIOSUB);
}
} | 0 | [
"CWE-415",
"CWE-119"
] | ppp | 7658e8257183f062dc01f87969c140707c7e52cb | 172,331,196,265,188,460,000,000,000,000,000,000,000 | 14 | pppd: Eliminate potential integer overflow in option parsing
When we are reading in a word from an options file, we maintain a count
of the length we have seen so far in 'len', which is an int. When len
exceeds MAXWORDLEN - 1 (i.e. 1023) we cease storing characters in the
buffer but we continue to increment len. Sin... |
ZEND_VM_HANDLER(162, ZEND_FAST_CALL, JMP_ADDR, ANY)
{
USE_OPLINE
zval *fast_call = EX_VAR(opline->result.var);
Z_OBJ_P(fast_call) = NULL;
/* set return address */
Z_OPLINE_NUM_P(fast_call) = opline - EX(func)->op_array.opcodes;
ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op1), 0);
} | 0 | [
"CWE-787"
] | php-src | f1ce8d5f5839cb2069ea37ff424fb96b8cd6932d | 141,379,407,857,242,400,000,000,000,000,000,000,000 | 10 | Fix #73122: Integer Overflow when concatenating strings
We must avoid integer overflows in memory allocations, so we introduce
an additional check in the VM, and bail out in the rare case of an
overflow. Since the recent fix for bug #74960 still doesn't catch all
possible overflows, we fix that right away. |
mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec)
{
const uint16_t cqe_n = 1 << rxq->cqe_n;
const uint16_t cqe_mask = cqe_n - 1;
const uint16_t wqe_n = 1 << rxq->elts_n;
const uint16_t strd_n = RTE_BIT32(rxq->log_strd_num);
struct mlx5_rxq_ctrl *rxq_ctrl =
container_of(rxq, struct mlx5_rxq_ctrl, rxq);
... | 0 | [] | dpdk-stable | ef311075d21b4f68c8ccfc46a00cda7c2a0bf4cc | 266,766,662,824,757,580,000,000,000,000,000,000,000 | 117 | net/mlx5: fix Rx queue recovery mechanism
The local variables are getting inconsistent in data receiving routines
after queue error recovery.
Receive queue consumer index is getting wrong, need to reset one to the
size of the queue (as RQ was fully replenished in recovery procedure).
In MPRQ case, also the local cons... |
inline void clear_temporary()
{
uchar *tmp= get_ptr();
if (likely(value.ptr() == (char*) tmp))
bzero((uchar*) &value, sizeof(value));
else
{
/*
Currently read_value should never point to tmp, the following code
is mainly here to make things future proof.
*/
if... | 0 | [
"CWE-416",
"CWE-703"
] | server | 08c7ab404f69d9c4ca6ca7a9cf7eec74c804f917 | 161,356,792,990,348,450,000,000,000,000,000,000,000 | 15 | 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... |
ClrToEOL(NCURSES_SP_DCLx NCURSES_CH_T blank, int needclear)
{
if (CurScreen(SP_PARM) != 0
&& SP_PARM->_cursrow >= 0) {
int j;
for (j = SP_PARM->_curscol; j < screen_columns(SP_PARM); j++) {
if (j >= 0) {
NCURSES_CH_T *cp =
&(CurScreen(SP_PARM)->_line[SP_PARM->_cursrow].text[j]);
if (!CharEq(*cp, bla... | 0 | [] | ncurses | 790a85dbd4a81d5f5d8dd02a44d84f01512ef443 | 220,062,428,067,382,400,000,000,000,000,000,000,000 | 30 | ncurses 6.2 - patch 20200531
+ correct configure version-check/warnng for g++ to allow for 10.x
+ re-enable "bel" in konsole-base (report by Nia Huang)
+ add linux-s entry (patch by Alexandre Montaron).
+ drop long-obsolete convert_configure.pl
+ add test/test_parm.c, for checking tparm changes.
+ improve parameter-ch... |
StringVal StringVal::copy_from(FunctionContext* ctx, const uint8_t* buf, int64_t len) {
StringVal result(ctx, len);
if (!result.is_null) {
memcpy(result.ptr, buf, len);
}
return result;
} | 0 | [
"CWE-200"
] | incubator-doris | 246ac4e37aa4da6836b7850cb990f02d1c3725a3 | 299,407,997,266,009,340,000,000,000,000,000,000,000 | 7 | [fix] fix a bug of encryption function with iv may return wrong result (#8277) |
int inode_change_ok(const struct inode *inode, struct iattr *attr)
{
unsigned int ia_valid = attr->ia_valid;
/*
* First check size constraints. These can't be overriden using
* ATTR_FORCE.
*/
if (ia_valid & ATTR_SIZE) {
int error = inode_newsize_ok(inode, attr->ia_size);
if (error)
return error;
}
... | 1 | [
"CWE-284",
"CWE-264"
] | linux | 23adbe12ef7d3d4195e80800ab36b37bee28cd03 | 116,374,234,911,803,710,000,000,000,000,000,000,000 | 51 | fs,userns: Change inode_capable to capable_wrt_inode_uidgid
The kernel has no concept of capabilities with respect to inodes; inodes
exist independently of namespaces. For example, inode_capable(inode,
CAP_LINUX_IMMUTABLE) would be nonsense.
This patch changes inode_capable to check for uid and gid mappings and
rena... |
static void tg3_write32(struct tg3 *tp, u32 off, u32 val)
{
writel(val, tp->regs + off);
} | 0 | [
"CWE-476",
"CWE-119"
] | linux | 715230a44310a8cf66fbfb5a46f9a62a9b2de424 | 131,977,774,742,310,180,000,000,000,000,000,000,000 | 4 | tg3: fix length overflow in VPD firmware parsing
Commit 184b89044fb6e2a74611dafa69b1dce0d98612c6 ("tg3: Use VPD fw version
when present") introduced VPD parsing that contained a potential length
overflow.
Limit the hardware's reported firmware string length (max 255 bytes) to
stay inside the driver's firmware string ... |
SDB_API bool sdb_disk_unlink (Sdb *s) {
return (s->dir && *(s->dir) && unlink (s->dir) != -1);
} | 0 | [
"CWE-78"
] | radare2 | 04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9 | 180,246,972,832,050,600,000,000,000,000,000,000,000 | 3 | 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... |
static int inside_section(cmd_parms *cmd, const char *section) {
ap_directive_t *d;
for (d = cmd->directive->parent; d; d = d->parent) {
if (!ap_cstr_casecmp(d->directive, section)) {
return 1;
}
}
return 0;
} | 0 | [
"CWE-476"
] | mod_md | e71001955809247b3aa4d269e1e0741b4fe0fc3d | 233,117,401,822,616,600,000,000,000,000,000,000,000 | 9 | v1.1.12, notifycmd improvements |
virtual void annotateAppSpawnException(SpawnException &e, NegotiationDetails &details) {
if (details.debugDir != NULL) {
e.addAnnotations(details.debugDir->readAll());
}
} | 0 | [
"CWE-200",
"CWE-61"
] | passenger | 4043718264095cde6623c2cbe8c644541036d7bf | 266,554,007,271,702,100,000,000,000,000,000,000,000 | 5 | Disable unused feature. |
static Image *ExtractPostscript(Image *image,const ImageInfo *image_info,
MagickOffsetType PS_Offset,ssize_t PS_Size,ExceptionInfo *exception)
{
char
postscript_file[MagickPathExtent];
const MagicInfo
*magic_info;
FILE
*ps_file;
ImageInfo
*clone_info;
Image
*image2;
un... | 1 | [
"CWE-400"
] | ImageMagick | 06c8dd4de59e48d282d4f224faa64ab9012a711a | 167,754,056,890,425,800,000,000,000,000,000,000,000 | 83 | https://github.com/ImageMagick/ImageMagick/issues/870 |
static CURLcode parseurlandfillconn(struct SessionHandle *data,
struct connectdata *conn,
bool *prot_missing,
char **userp, char **passwdp,
char **optionsp)
{
char *at;
cha... | 0 | [
"CWE-264"
] | curl | 31be461c6b659312100c47be6ddd5f0f569290f6 | 1,100,598,538,380,934,500,000,000,000,000,000,000 | 340 | ConnectionExists: for NTLM re-use, require credentials to match
CVE-2015-3143
Bug: http://curl.haxx.se/docs/adv_20150422A.html
Reported-by: Paras Sethia |
static inline void add_frag_mem_limit(struct inet_frag_queue *q, int i)
{
__percpu_counter_add(&q->net->mem, i, frag_percpu_counter_batch);
} | 0 | [] | linux | 3ef0eb0db4bf92c6d2510fe5c4dc51852746f206 | 228,885,133,636,653,400,000,000,000,000,000,000,000 | 4 | net: frag, move LRU list maintenance outside of rwlock
Updating the fragmentation queues LRU (Least-Recently-Used) list,
required taking the hash writer lock. However, the LRU list isn't
tied to the hash at all, so we can use a separate lock for it.
Original-idea-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Je... |
virtual GBool deviceHasTextClip(GfxState *state) { return textClipPath && haveCSPattern; } | 0 | [] | poppler | abf167af8b15e5f3b510275ce619e6fdb42edd40 | 280,402,571,248,945,760,000,000,000,000,000,000,000 | 1 | Implement tiling/patterns in SplashOutputDev
Fixes bug 13518 |
void DxfData::fixup_path_direction()
{
for (size_t i = 0; i < this->paths.size(); ++i) {
if (!this->paths[i].is_closed) break;
this->paths[i].is_inner = true;
double min_x = this->points[this->paths[i].indices[0]][0];
size_t min_x_point = 0;
for (size_t j = 1; j < this->paths[i].indices.size(); ++j) {
if ... | 0 | [
"CWE-703"
] | openscad | 770e3234cbfe66edbc0333f796b46d36a74aa652 | 114,002,803,332,946,500,000,000,000,000,000,000,000 | 33 | add safety to line lookups in DXF import, fixes #4037
Add safety (test for, and continue past, bad indices).
Report warnings about bad indices
Add variables just to make the array indices easier to read and debug. |
DnsServer *manager_get_first_dns_server(Manager *m, DnsServerType t) {
assert(m);
switch (t) {
case DNS_SERVER_SYSTEM:
return m->dns_servers;
case DNS_SERVER_FALLBACK:
return m->fallback_dns_servers;
default:
return NULL;
... | 0 | [
"CWE-416"
] | systemd | 904dcaf9d4933499f8334859f52ea8497f2d24ff | 83,460,033,263,827,080,000,000,000,000,000,000,000 | 15 | resolved: take particular care when detaching DnsServer from its default stream
DnsStream and DnsServer have a symbiotic relationship: one DnsStream is
the current "default" stream of the server (and thus reffed by it), but
each stream also refs the server it is connected to. This cyclic
dependency can result in weird... |
sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg)
{
void __user *p = (void __user *)arg;
int __user *ip = p;
int result, val, read_only;
Sg_device *sdp;
Sg_fd *sfp;
Sg_request *srp;
unsigned long iflags;
if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp)))
return -ENXIO;... | 1 | [
"CWE-119"
] | linux | bf33f87dd04c371ea33feb821b60d63d754e3124 | 203,387,778,729,957,660,000,000,000,000,000,000,000 | 283 | scsi: sg: check length passed to SG_NEXT_CMD_LEN
The user can control the size of the next command passed along, but the
value passed to the ioctl isn't checked against the usable max command
size.
Cc: <stable@vger.kernel.org>
Signed-off-by: Peter Chang <dpf@google.com>
Acked-by: Douglas Gilbert <dgilbert@interlog.co... |
int phar_zip_flush(phar_archive_data *phar, char *user_stub, long len, int defaultstub, char **error TSRMLS_DC) /* {{{ */
{
char *pos;
smart_str main_metadata_str = {0};
static const char newstub[] = "<?php // zip-based phar archive stub file\n__HALT_COMPILER();";
char halt_stub[] = "__HALT_COMPILER();";
char *tmp... | 1 | [
"CWE-119"
] | php-src | a6fdc5bb27b20d889de0cd29318b3968aabb57bd | 245,782,915,511,373,150,000,000,000,000,000,000,000 | 359 | Fix bug #71498: Out-of-Bound Read in phar_parse_zipfile() |
virDomainDefOSValidate(const virDomainDef *def,
virDomainXMLOptionPtr xmlopt)
{
if (!def->os.loader)
return 0;
if (def->os.firmware &&
!(xmlopt->config.features & VIR_DOMAIN_DEF_FEATURE_FW_AUTOSELECT)) {
virReportError(VIR_ERR_XML_DETAIL, "%s",
... | 0 | [
"CWE-212"
] | libvirt | a5b064bf4b17a9884d7d361733737fb614ad8979 | 206,361,374,516,083,440,000,000,000,000,000,000,000 | 22 | conf: Don't format http cookies unless VIR_DOMAIN_DEF_FORMAT_SECURE is used
Starting with 3b076391befc3fe72deb0c244ac6c2b4c100b410
(v6.1.0-122-g3b076391be) we support http cookies. Since they may contain
somewhat sensitive information we should not format them into the XML
unless VIR_DOMAIN_DEF_FORMAT_SECURE is assert... |
static NTSTATUS grant_fsp_oplock_type(struct smb_request *req,
struct files_struct *fsp,
struct share_mode_lock *lck,
int oplock_request,
struct smb2_lease *lease)
{
struct share_mode_data *d = lck->data;
bool got_handle_lease = false;
bool got_oplock = false;
uint32_t i;
ui... | 0 | [
"CWE-835"
] | samba | 10c3e3923022485c720f322ca4f0aca5d7501310 | 47,038,183,890,525,690,000,000,000,000,000,000,000 | 159 | s3: smbd: Don't loop infinitely on bad-symlink resolution.
In the FILE_OPEN_IF case we have O_CREAT, but not
O_EXCL. Previously we went into a loop trying first
~(O_CREAT|O_EXCL), and if that returned ENOENT
try (O_CREAT|O_EXCL). We kept looping indefinately
until we got an error, or the file was created or
opened.
T... |
static struct linux_binprm *alloc_bprm(int fd, struct filename *filename)
{
struct linux_binprm *bprm = kzalloc(sizeof(*bprm), GFP_KERNEL);
int retval = -ENOMEM;
if (!bprm)
goto out;
if (fd == AT_FDCWD || filename->name[0] == '/') {
bprm->filename = filename->name;
} else {
if (filename->name[0] == '\0')
... | 0 | [] | linux | 0f2122045b946241a9e549c2a76cea54fa58a7ff | 100,156,404,978,153,350,000,000,000,000,000,000,000 | 32 | io_uring: don't rely on weak ->files references
Grab actual references to the files_struct. To avoid circular references
issues due to this, we add a per-task note that keeps track of what
io_uring contexts a task has used. When the tasks execs or exits its
assigned files, we cancel requests based on this tracking.
W... |
static void HandleRadioRxErrorTimeout( LoRaMacEventInfoStatus_t rx1EventInfoStatus, LoRaMacEventInfoStatus_t rx2EventInfoStatus )
{
bool classBRx = false;
if( MacCtx.NvmCtx->DeviceClass != CLASS_C )
{
Radio.Sleep( );
}
if( LoRaMacClassBIsBeaconExpected( ) == true )
{
... | 0 | [
"CWE-120",
"CWE-787"
] | LoRaMac-node | e3063a91daa7ad8a687223efa63079f0c24568e4 | 77,001,771,610,672,900,000,000,000,000,000,000,000 | 64 | Added received buffer size checks. |
getinfo_helper_policies(control_connection_t *conn,
const char *question, char **answer)
{
(void) conn;
if (!strcmp(question, "exit-policy/default")) {
*answer = tor_strdup(DEFAULT_EXIT_POLICY);
}
return 0;
} | 0 | [
"CWE-119"
] | tor | 43414eb98821d3b5c6c65181d7545ce938f82c8e | 27,250,913,653,274,806,000,000,000,000,000,000,000 | 9 | Fix bounds-checking in policy_summarize
Found by piebeer. |
static int __rbd_notify_op_lock(struct rbd_device *rbd_dev,
enum rbd_notify_op notify_op,
struct page ***preply_pages,
size_t *preply_len)
{
struct ceph_osd_client *osdc = &rbd_dev->rbd_client->client->osdc;
struct rbd_client_id cid = rbd_get_cid(rbd_dev);
char buf[4 + 8 + 8 + CEPH_ENCODING_START_BLK_LEN... | 0 | [
"CWE-863"
] | linux | f44d04e696feaf13d192d942c4f14ad2e117065a | 120,783,415,705,073,360,000,000,000,000,000,000,000 | 23 | 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... |
static void compactxref(fz_context *ctx, pdf_document *doc, pdf_write_state *opts)
{
int num, newnum;
int xref_len = pdf_xref_len(ctx, doc);
/*
* Update renumber_map in-place, clustering all used
* objects together at low object ids. Objects that
* already should be renumbered will have their new
* object i... | 1 | [
"CWE-119"
] | mupdf | 520cc26d18c9ee245b56e9e91f9d4fcae02be5f0 | 46,945,603,614,533,610,000,000,000,000,000,000,000 | 35 | Bug 689699: Avoid buffer overrun.
When cleaning a pdf file, various lists (of pdf_xref_len length) are
defined early on.
If we trigger a repair during the clean, this can cause pdf_xref_len
to increase causing an overrun.
Fix this by watching for changes in the length, and checking accesses
to the list for validity.... |
static void test_logs()
{
MYSQL_STMT *stmt;
MYSQL_BIND my_bind[2];
char data[255];
ulong length;
int rc;
short id;
myheader("test_logs");
rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_logs");
myquery(rc);
rc= mysql_query(mysql, "CREATE TABLE test_logs(id smallint, name... | 0 | [
"CWE-416"
] | server | eef21014898d61e77890359d6546d4985d829ef6 | 129,566,187,292,623,890,000,000,000,000,000,000,000 | 150 | 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... |
void CoreNetwork::writeToSocket(const QByteArray &data)
{
socket.write(data);
socket.write("\r\n");
_tokenBucket--;
} | 0 | [
"CWE-399"
] | quassel | b5e38970ffd55e2dd9f706ce75af9a8d7730b1b8 | 203,331,547,573,010,760,000,000,000,000,000,000,000 | 6 | Improve the message-splitting algorithm for PRIVMSG and CTCP
This introduces a new message splitting algorithm based on
QTextBoundaryFinder. It works by first starting with the entire
message to be sent, encoding it, and checking to see if it is over
the maximum message length. If it is, it uses QTBF to find the
wor... |
void SplashOutputDev::updateOverprintMode(GfxState *state) {
splash->setOverprintMode(state->getOverprintMode());
} | 0 | [
"CWE-369"
] | poppler | b224e2f5739fe61de9fa69955d016725b2a4b78d | 78,130,215,204,489,370,000,000,000,000,000,000,000 | 3 | SplashOutputDev::tilingPatternFill: Fix crash on broken file
Issue #802 |
void CLASS ahd_interpolate()
{
int i, j, k, top, left, row, col, tr, tc, c, d, val, hm[2];
ushort (*pix)[4], (*rix)[3];
static const int dir[4] = { -1, 1, -TS, TS };
unsigned ldiff[2][4], abdiff[2][4], leps, abeps;
float r, cbrt[0x10000], xyz[3], xyz_cam[3][4];
ushort (*rgb)[TS][TS][3];
short (*lab)[TS][... | 0 | [
"CWE-703"
] | LibRaw | 11909cc59e712e09b508dda729b99aeaac2b29ad | 153,209,593,284,322,980,000,000,000,000,000,000,000 | 125 | cumulated data checks patch |
/* {{{ proto int idate(string format [, int timestamp])
Format a local time/date as integer */
PHP_FUNCTION(idate)
{
char *format;
int format_len;
long ts = 0;
int ret;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &format, &format_len, &ts) == FAILURE) {
RETURN_FALSE;
}
if (format_... | 0 | [] | php-src | bb057498f7457e8b2eba98332a3bad434de4cf12 | 138,623,371,290,685,550,000,000,000,000,000,000,000 | 27 | Fix #70277: new DateTimeZone($foo) is ignoring text after null byte
The DateTimeZone constructors are not binary safe. They're parsing the timezone
as string, but discard the length when calling timezone_initialize(). This
patch adds a tz_len parameter and a respective check to timezone_initialize(). |
static char *__resource_type_str(int type) {
char *typeName;
switch (type) {
case 1:
typeName = "CURSOR";
break;
case 2:
typeName = "BITMAP";
break;
case 3:
typeName = "ICON";
break;
case 4:
typeName = "MENU";
break;
case 5:
typeName = "DIALOG";
break;
case 6:
typeName = "STRING";
break;... | 0 | [
"CWE-476"
] | radare2 | 18d1d064bf599a255d55f09fca3104776fc34a67 | 93,340,875,117,418,910,000,000,000,000,000,000,000 | 74 | Fix null deref in the ne parser ##crash
* Reported by @hmsec via huntr.dev
* Reproducer: nepoc00
* BountyID: bfeb8fb8-644d-4587-80d4-cb704c404013 |
int skb_copy_ubufs(struct sk_buff *skb, gfp_t gfp_mask)
{
int i;
int num_frags = skb_shinfo(skb)->nr_frags;
struct page *page, *head = NULL;
struct ubuf_info *uarg = skb_shinfo(skb)->destructor_arg;
for (i = 0; i < num_frags; i++) {
u8 *vaddr;
skb_frag_t *f = &skb_shinfo(skb)->frags[i];
page = alloc_page(g... | 0 | [
"CWE-416"
] | net | 36d5fe6a000790f56039afe26834265db0a3ad4c | 57,319,304,169,051,550,000,000,000,000,000,000,000 | 44 | core, nfqueue, openvswitch: Orphan frags in skb_zerocopy and handle errors
skb_zerocopy can copy elements of the frags array between skbs, but it doesn't
orphan them. Also, it doesn't handle errors, so this patch takes care of that
as well, and modify the callers accordingly. skb_tx_error() is also added to
the caller... |
static void *alloc_event_data(int cpu)
{
int size;
cpumask_t *mask;
struct etm_event_data *event_data;
/* First get memory for the session's data */
event_data = kzalloc(sizeof(struct etm_event_data), GFP_KERNEL);
if (!event_data)
return NULL;
/* Make sure nothing disappears under us */
get_online_cpus();
... | 0 | [
"CWE-20",
"CWE-476"
] | linux | f09444639099584bc4784dfcd85ada67c6f33e0f | 188,132,254,320,794,700,000,000,000,000,000,000,000 | 39 | coresight: fix kernel panic caused by invalid CPU
Commit d52c9750f150 ("coresight: reset "enable_sink" flag when need be")
caused a kernel panic because of the using of an invalid value: after
'for_each_cpu(cpu, mask)', value of local variable 'cpu' become invalid,
causes following 'cpu_to_node' access invalid memory ... |
mail_sendheader (int argc, char **argv)
{
if (argc == 1)
mu_list_foreach (add_header_list, list_headers, NULL);
else if (argc == 2)
{
if (strchr (argv[1], ':'))
send_append_header (argv[1]);
else
mu_list_foreach (add_header_list, list_headers, argv[1]);
}
else
{
size_t len = st... | 0 | [] | mailutils | 4befcfd015256c568121653038accbd84820198f | 231,330,789,723,678,400,000,000,000,000,000,000,000 | 20 | mail: disable compose escapes in non-interctive mode.
* NEWS: Document changes.
* doc/texinfo/programs/mail.texi: Document changes.
* mail/send.c (mail_compose_send): Recognize escapes only in
interactive mode. |
mount_args_check(int argc, char **argv, const char *action)
{
Eina_Bool opts = EINA_FALSE;
const char *node;
char buf[PATH_MAX];
struct stat st;
if (!strcmp(action, "mount"))
{
/* will ALWAYS be:
/path/to/mount -o nosuid,uid=XYZ,[utf8,] UUID=XXXX-XXXX[-XXXX-XXXX] /media/$devnode
... | 0 | [] | enlightenment | cc7faeccf77fef8b0ae70e312a21e4cde087e141 | 102,847,299,774,098,380,000,000,000,000,000,000,000 | 71 | enlightenment_sys - fix security hole CVE-2022-37706
https://github.com/MaherAzzouzi/CVE-2022-37706-LPE-exploit
fixes that.
@fix |
static void request_gathered_write(h2o_http2_conn_t *conn)
{
assert(conn->state < H2O_HTTP2_CONN_STATE_IS_CLOSING);
if (conn->_write.buf_in_flight == NULL) {
if (!h2o_timeout_is_linked(&conn->_write.timeout_entry))
h2o_timeout_link(conn->super.ctx->loop, &conn->super.ctx->zero_timeout, &conn... | 0 | [
"CWE-703"
] | h2o | 1c0808d580da09fdec5a9a74ff09e103ea058dd4 | 314,143,836,099,829,020,000,000,000,000,000,000,000 | 8 | h2: use after free on premature connection close #920
lib/http2/connection.c:on_read() calls parse_input(), which might free
`conn`. It does so in particular if the connection preface isn't
the expected one in expect_preface(). `conn` is then used after the free
in `if (h2o_timeout_is_linked(&conn->_write.timeout_entr... |
int dns_hostname_validation(const char *string, char **err)
{
const char *c, *d;
int i;
if (strlen(string) > DNS_MAX_NAME_SIZE) {
if (err)
*err = DNS_TOO_LONG_FQDN;
return 0;
}
c = string;
while (*c) {
d = c;
i = 0;
while (*d != '.' && *d && i <= DNS_MAX_LABEL_SIZE) {
i++;
if (!((*d == '-') ... | 0 | [
"CWE-125"
] | haproxy | efbbdf72992cd20458259962346044cafd9331c0 | 262,190,817,100,987,280,000,000,000,000,000,000,000 | 43 | BUG: dns: Prevent out-of-bounds read in dns_validate_dns_response()
We need to make sure that the record length is not making us read
past the end of the data we received.
Before this patch we could for example read the 16 bytes
corresponding to an AAAA record from the non-initialized part of
the buffer, possibly acce... |
bool _enqueue(Message *m) override {
messages.push_back(m);
return true;
} | 0 | [
"CWE-287",
"CWE-284"
] | ceph | 5ead97120e07054d80623dada90a5cc764c28468 | 106,980,796,002,333,250,000,000,000,000,000,000,000 | 4 | auth/cephx: add authorizer challenge
Allow the accepting side of a connection to reject an initial authorizer
with a random challenge. The connecting side then has to respond with an
updated authorizer proving they are able to decrypt the service's challenge
and that the new authorizer was produced for this specific ... |
static char *read_from_handle_all(JSContext *cx, HandleType handle, size_t *nwritten,
bool read_until_zero) {
// TODO(performance): investigate passing a size hint in situations where we might know
// the final size, e.g. via the `content-length` header.
// https://github.com/fas... | 0 | [
"CWE-94"
] | js-compute-runtime | 65524ffc962644e9fc39f4b368a326b6253912a9 | 198,204,172,591,522,680,000,000,000,000,000,000,000 | 58 | use rangom_get instead of arc4random as arc4random does not work correctly with wizer
wizer causes the seed in arc4random to be the same between executions which is not random |
static int help(void) {
fputs("PNG2WebP " VERSION "\n\
\n\
Usage:\n\
png2webp [-refv-] INFILE ...\n\
png2webp -p[refv-] [{INFILE|-} [OUTFILE|-]]\n\
\n\
-p: Work with a single file, allowing Piping from stdin or to stdout,\n\
or using a different output filename to the input.\n\
`INFILE` and `OUTFILE` default ... | 0 | [
"CWE-415",
"CWE-787"
] | png2webp | 8f21ad79b0cd98fc22d5b49734543101946abbff | 222,909,525,008,529,240,000,000,000,000,000,000,000 | 20 | v1.0.5: fix buffer overrun when reading bad WebPs |
static double mp_neq(_cimg_math_parser& mp) {
return (double)(_mp_arg(2)!=_mp_arg(3));
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 113,705,119,171,165,310,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. |
void dns_server_packet_bad_opt(DnsServer *s, DnsServerFeatureLevel level) {
assert(s);
if (level < DNS_SERVER_FEATURE_LEVEL_EDNS0)
return;
/* If the OPT RR got lost, we have to downgrade what we previously verified */
if (s->verified_feature_level >= DNS_SERVER_FEATURE_... | 0 | [
"CWE-416"
] | systemd | 904dcaf9d4933499f8334859f52ea8497f2d24ff | 263,166,440,797,595,300,000,000,000,000,000,000,000 | 12 | resolved: take particular care when detaching DnsServer from its default stream
DnsStream and DnsServer have a symbiotic relationship: one DnsStream is
the current "default" stream of the server (and thus reffed by it), but
each stream also refs the server it is connected to. This cyclic
dependency can result in weird... |
get_field_on_inst_generic_type (MonoClassField *field)
{
MonoClass *class, *gtd;
MonoDynamicGenericClass *dgclass;
int field_index;
g_assert (is_field_on_inst (field));
dgclass = (MonoDynamicGenericClass*)field->parent->generic_class;
if (field >= dgclass->fields && field - dgclass->fields < dgclass->count_fie... | 0 | [
"CWE-20"
] | mono | 65292a69c837b8a5f7a392d34db63de592153358 | 56,922,638,993,721,390,000,000,000,000,000,000,000 | 26 | Handle invalid instantiation of generic methods.
* verify.c: Add new function to internal verifier API to check
method instantiations.
* reflection.c (mono_reflection_bind_generic_method_parameters):
Check the instantiation before returning it.
Fixes #655847 |
httpMaybeRemovePublic(StoreEntry * e, Http::StatusCode status)
{
int remove = 0;
int forbidden = 0;
// If the incoming response already goes into a public entry, then there is
// nothing to remove. This protects ready-for-collapsing entries as well.
if (!EBIT_TEST(e->flags, KEY_PRIVATE))
re... | 0 | [
"CWE-444"
] | squid | fd68382860633aca92065e6c343cfd1b12b126e7 | 80,586,079,574,726,960,000,000,000,000,000,000,000 | 97 | Improve Transfer-Encoding handling (#702)
Reject messages containing Transfer-Encoding header with coding other
than chunked or identity. Squid does not support other codings.
For simplicity and security sake, also reject messages where
Transfer-Encoding contains unnecessary complex values that are
technically equiva... |
*/
int re_yyget_lineno (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if (! YY_CURRENT_BUFFER)
return 0;
return yylineno; | 1 | [
"CWE-476",
"CWE-703",
"CWE-125"
] | yara | 3119b232c9c453c98d8fa8b6ae4e37ba18117cd4 | 204,633,618,169,762,180,000,000,000,000,000,000,000 | 9 | re_lexer: Make reading escape sequences more robust (#586)
* Add test for issue #503
* re_lexer: Make reading escape sequences more robust
This commit fixes parsing incomplete escape sequences at the end of a
regular expression and parsing things like \xxy (invalid hex digits)
which before were silently turned... |
set_options_default(
int opt_flags) // OPT_FREE, OPT_LOCAL and/or OPT_GLOBAL
{
int i;
win_T *wp;
tabpage_T *tp;
for (i = 0; !istermoption_idx(i); i++)
if (!(options[i].flags & P_NODEFAULT)
&& (opt_flags == 0
|| (options[i].var != (char_u *)&p_enc
# if defined(FEAT_CRYPT)
&& options[i]... | 0 | [
"CWE-122"
] | vim | b7081e135a16091c93f6f5f7525a5c58fb7ca9f9 | 214,281,646,271,564,630,000,000,000,000,000,000,000 | 25 | patch 8.2.3402: invalid memory access when using :retab with large value
Problem: Invalid memory access when using :retab with large value.
Solution: Check the number is positive. |
ip_get_encoding_table(interp)
VALUE interp;
{
volatile VALUE table = Qnil;
table = rb_ivar_get(interp, ID_encoding_table);
if (NIL_P(table)) {
/* initialize encoding_table */
table = create_encoding_table(interp);
rb_define_singleton_method(table, "get_name", encoding_table_get_name, 1);
rb... | 0 | [] | tk | ebd0fc80d62eeb7b8556522256f8d035e013eb65 | 94,889,050,004,206,970,000,000,000,000,000,000,000 | 16 | tcltklib.c: check argument
* ext/tk/tcltklib.c (ip_cancel_eval_core): check argument type and
length.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
static unsigned addChunk_PLTE(ucvector* out, const LodePNGColorMode* info)
{
unsigned error = 0;
size_t i;
ucvector PLTE;
ucvector_init(&PLTE);
for(i = 0; i < info->palettesize * 4; i++)
{
/*add all channels except alpha channel*/
if(i % 4 != 3) ucvector_push_back(&PLTE, info->palette[i]);
}
err... | 0 | [
"CWE-401"
] | FreeRDP | 9fee4ae076b1ec97b97efb79ece08d1dab4df29a | 318,507,093,447,747,970,000,000,000,000,000,000,000 | 16 | Fixed #5645: realloc return handling |
uint64_t skipped_mig_pages_transferred(void)
{
return acct_info.skipped_pages;
} | 0 | [
"CWE-20"
] | qemu | 0be839a2701369f669532ea5884c15bead1c6e08 | 123,399,744,248,070,170,000,000,000,000,000,000,000 | 4 | migration: fix parameter validation on ram load
During migration, the values read from migration stream during ram load
are not validated. Especially offset in host_from_stream_offset() and
also the length of the writes in the callers of said function.
To fix this, we need to make sure that the [offset, offset + leng... |
xmlFreeEnumeration(xmlEnumerationPtr cur) {
if (cur == NULL) return;
if (cur->next != NULL) xmlFreeEnumeration(cur->next);
if (cur->name != NULL) xmlFree((xmlChar *) cur->name);
xmlFree(cur);
} | 0 | [] | libxml2 | 932cc9896ab41475d4aa429c27d9afd175959d74 | 275,016,660,884,688,200,000,000,000,000,000,000,000 | 8 | Fix buffer size checks in xmlSnprintfElementContent
xmlSnprintfElementContent failed to correctly check the available
buffer space in two locations.
Fixes bug 781333 (CVE-2017-9047) and bug 781701 (CVE-2017-9048).
Thanks to Marcel Böhme and Thuan Pham for the report. |
xfs_dinode_verify(
struct xfs_mount *mp,
xfs_ino_t ino,
struct xfs_dinode *dip)
{
uint16_t mode;
uint16_t flags;
uint64_t flags2;
uint64_t di_size;
if (dip->di_magic != cpu_to_be16(XFS_DINODE_MAGIC))
return __this_address;
/* Verify v3 integrity information first */
if (dip->di_version >= 3) {
if (... | 1 | [] | linux | b42db0860e13067fcc7cbfba3966c9e652668bbc | 101,398,170,972,394,780,000,000,000,000,000,000,000 | 125 | xfs: enhance dinode verifier
Add several more validations to xfs_dinode_verify:
- For LOCAL data fork formats, di_nextents must be 0.
- For LOCAL attr fork formats, di_anextents must be 0.
- For inodes with no attr fork offset,
- format must be XFS_DINODE_FMT_EXTENTS if set at all
- di_anextents must be 0.
Thank... |
static int vhost_scsi_port_link(struct se_portal_group *se_tpg,
struct se_lun *lun)
{
struct vhost_scsi_tpg *tpg = container_of(se_tpg,
struct vhost_scsi_tpg, se_tpg);
mutex_lock(&vhost_scsi_mutex);
mutex_lock(&tpg->tv_tpg_mutex);
tpg->tv_tpg_port_count++;
mutex_unlock(&tpg->tv_tpg_mutex);
vhost_... | 0 | [
"CWE-200",
"CWE-119"
] | linux | 59c816c1f24df0204e01851431d3bab3eb76719c | 280,482,155,967,928,760,000,000,000,000,000,000,000 | 18 | vhost/scsi: potential memory corruption
This code in vhost_scsi_make_tpg() is confusing because we limit "tpgt"
to UINT_MAX but the data type of "tpg->tport_tpgt" and that is a u16.
I looked at the context and it turns out that in
vhost_scsi_set_endpoint(), "tpg->tport_tpgt" is used as an offset into
the vs_tpg[] arr... |
static int ep_poll_callback(wait_queue_t *wait, unsigned mode, int sync, void *key)
{
int pwake = 0;
unsigned long flags;
struct epitem *epi = ep_item_from_wait(wait);
struct eventpoll *ep = epi->ep;
if ((unsigned long)key & POLLFREE) {
ep_pwq_from_wait(wait)->whead = NULL;
/*
* whead = NULL above can race... | 0 | [] | linux-2.6 | 13d518074a952d33d47c428419693f63389547e9 | 29,470,090,045,513,270,000,000,000,000,000,000,000 | 74 | epoll: clear the tfile_check_list on -ELOOP
An epoll_ctl(,EPOLL_CTL_ADD,,) operation can return '-ELOOP' to prevent
circular epoll dependencies from being created. However, in that case we
do not properly clear the 'tfile_check_list'. Thus, add a call to
clear_tfile_check_list() for the -ELOOP case.
Signed-off-by: ... |
HandleKeyboardStartExtend(Widget w,
XEvent *event, /* must be XButtonEvent* */
String *params, /* unused */
Cardinal *num_params) /* unused */
{
XtermWidget xw;
if ((xw = getXtermWidget(w)) != 0) {
TRACE_EVENT("HandleKeyboardStartExtend", event, params, num_params);
do_start_extend(xw, event,... | 0 | [
"CWE-399"
] | xterm-snapshots | 82ba55b8f994ab30ff561a347b82ea340ba7075c | 101,391,396,794,551,980,000,000,000,000,000,000,000 | 12 | snapshot of project "xterm", label xterm-365d |
read_eocd(struct zip *zip, const char *p, int64_t current_offset)
{
uint16_t disk_num;
uint32_t cd_size, cd_offset;
disk_num = archive_le16dec(p + 4);
cd_size = archive_le32dec(p + 12);
cd_offset = archive_le32dec(p + 16);
/* Sanity-check the EOCD we've found. */
/* This must be the first volume. */
if (dis... | 0 | [
"CWE-703",
"CWE-125"
] | libarchive | cfaa28168a07ea4a53276b63068f94fce37d6aff | 73,365,007,613,943,855,000,000,000,000,000,000,000 | 34 | ZIP reader: fix possible out-of-bounds read in zipx_lzma_alone_init()
Fixes #1672 |
bool CModules::OnChanAction(CNick& Nick, CChan& Channel, CString& sMessage) {
MODHALTCHK(OnChanAction(Nick, Channel, sMessage));
} | 0 | [
"CWE-20",
"CWE-264"
] | znc | 8de9e376ce531fe7f3c8b0aa4876d15b479b7311 | 325,851,806,343,619,150,000,000,000,000,000,000,000 | 3 | Fix remote code execution and privilege escalation vulnerability.
To trigger this, need to have a user already.
Thanks for Jeriko One <jeriko.one@gmx.us> for finding and reporting this.
CVE-2019-12816 |
void http_txn_reset_req(struct http_txn *txn)
{
txn->req.flags = 0;
txn->req.msg_state = HTTP_MSG_RQBEFORE; /* at the very beginning of the request */
} | 0 | [
"CWE-703",
"CWE-835"
] | haproxy | bfb15ab34ead85f64cd6da0e9fb418c9cd14cee8 | 295,236,406,880,050,700,000,000,000,000,000,000,000 | 5 | BUG/MAJOR: http/htx: prevent unbounded loop in http_manage_server_side_cookies
Ensure calls to http_find_header() terminate. If a "Set-Cookie2"
header is found then the while(1) loop in
http_manage_server_side_cookies() will never terminate, resulting in
the watchdog firing and the process terminating via SIGABRT.
Th... |
static int timerfd_setup(struct timerfd_ctx *ctx, int flags,
const struct itimerspec *ktmr)
{
enum hrtimer_mode htmode;
ktime_t texp;
int clockid = ctx->clockid;
htmode = (flags & TFD_TIMER_ABSTIME) ?
HRTIMER_MODE_ABS: HRTIMER_MODE_REL;
texp = timespec_to_ktime(ktmr->it_value);
ctx->expired = 0;
ctx->tic... | 0 | [
"CWE-416"
] | linux | 1e38da300e1e395a15048b0af1e5305bd91402f6 | 157,078,035,118,724,850,000,000,000,000,000,000,000 | 43 | timerfd: Protect the might cancel mechanism proper
The handling of the might_cancel queueing is not properly protected, so
parallel operations on the file descriptor can race with each other and
lead to list corruptions or use after free.
Protect the context for these operations with a seperate lock.
The wait queue ... |
bool vrend_format_is_bgra(enum virgl_formats format) {
return (format == VIRGL_FORMAT_B8G8R8X8_UNORM ||
format == VIRGL_FORMAT_B8G8R8A8_UNORM ||
format == VIRGL_FORMAT_B8G8R8X8_SRGB ||
format == VIRGL_FORMAT_B8G8R8A8_SRGB);
} | 0 | [
"CWE-787"
] | virglrenderer | 95e581fd181b213c2ed7cdc63f2abc03eaaa77ec | 233,043,223,552,579,420,000,000,000,000,000,000,000 | 6 | 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> |
xxxx_do_check( PKT_secret_key *sk, const char *tryagain_text, int mode,
int *canceled )
{
gpg_error_t err;
byte *buffer;
u16 csum=0;
int i, res;
size_t nbytes;
if( sk->is_protected ) { /* remove the protection */
DEK *dek = NULL;
u32 keyid[4]; /* 4! because we need two of them ... | 1 | [
"CWE-20"
] | gnupg | 2183683bd633818dd031b090b5530951de76f392 | 287,696,336,022,405,840,000,000,000,000,000,000,000 | 216 | 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 ... |
//! Resize image to become a scalar square matrix \newinstance.
CImg<T> get_matrix() const {
return (+*this).matrix(); | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 254,501,002,230,968,900,000,000,000,000,000,000,000 | 3 | Fix other issues in 'CImg<T>::load_bmp()'. |
node_new_str_raw(UChar* s, UChar* end)
{
Node* node = node_new_str(s, end);
NODE_STRING_SET_RAW(node);
return node;
} | 0 | [
"CWE-476"
] | oniguruma | 850bd9b0d8186eb1637722b46b12656814ab4ad2 | 162,167,378,394,048,400,000,000,000,000,000,000,000 | 6 | fix #87: Read unknown address in onig_error_code_to_str() |
un_nat_packet(struct dp_packet *pkt, const struct conn *conn,
bool related)
{
if (conn->nat_info->nat_action & NAT_ACTION_SRC) {
pkt->md.ct_state |= CS_DST_NAT;
if (conn->key.dl_type == htons(ETH_TYPE_IP)) {
struct ip_header *nh = dp_packet_l3(pkt);
packet_set_i... | 0 | [
"CWE-400"
] | ovs | 79349cbab0b2a755140eedb91833ad2760520a83 | 89,492,792,051,343,370,000,000,000,000,000,000,000 | 41 | flow: Support extra padding length.
Although not required, padding can be optionally added until
the packet length is MTU bytes. A packet with extra padding
currently fails sanity checks.
Vulnerability: CVE-2020-35498
Fixes: fa8d9001a624 ("miniflow_extract: Properly handle small IP packets.")
Reported-by: Joakim Hind... |
static int key_notify_policy_flush(const struct km_event *c)
{
struct sk_buff *skb_out;
struct sadb_msg *hdr;
skb_out = alloc_skb(sizeof(struct sadb_msg) + 16, GFP_ATOMIC);
if (!skb_out)
return -ENOBUFS;
hdr = skb_put(skb_out, sizeof(struct sadb_msg));
hdr->sadb_msg_type = SADB_X_SPDFLUSH;
hdr->sadb_msg_seq =... | 0 | [
"CWE-416"
] | linux | dbb2483b2a46fbaf833cfb5deb5ed9cace9c7399 | 185,389,402,090,747,160,000,000,000,000,000,000,000 | 21 | xfrm: clean up xfrm protocol checks
In commit 6a53b7593233 ("xfrm: check id proto in validate_tmpl()")
I introduced a check for xfrm protocol, but according to Herbert
IPSEC_PROTO_ANY should only be used as a wildcard for lookup, so
it should be removed from validate_tmpl().
And, IPSEC_PROTO_ANY is expected to only m... |
psutil_proc_threads(PyObject *self, PyObject *args) {
long pid;
PyObject *py_retlist = PyList_New(0);
PyObject *py_tuple = NULL;
perfstat_thread_t *threadt = NULL;
perfstat_id_t id;
int i, rc, thread_count;
if (py_retlist == NULL)
return NULL;
if (! PyArg_ParseTuple(args, "l", &... | 0 | [
"CWE-415"
] | psutil | 7d512c8e4442a896d56505be3e78f1156f443465 | 129,932,680,868,696,830,000,000,000,000,000,000,000 | 60 | Use Py_CLEAR instead of Py_DECREF to also set the variable to NULL (#1616)
These files contain loops that convert system data into python objects
and during the process they create objects and dereference their
refcounts after they have been added to the resulting list.
However, in case of errors during the creat... |
static void ssl_disconnect(struct tunnel *tunnel)
{
if (!tunnel->ssl_handle)
return;
SSL_shutdown(tunnel->ssl_handle);
SSL_free(tunnel->ssl_handle);
SSL_CTX_free(tunnel->ssl_context);
close(tunnel->ssl_socket);
tunnel->ssl_handle = NULL;
tunnel->ssl_context = NULL;
} | 0 | [
"CWE-295"
] | openfortivpn | 60660e00b80bad0fadcf39aee86f6f8756c94f91 | 52,797,867,477,005,750,000,000,000,000,000,000,000 | 13 | correctly check return value of X509_check_host
CVE-2020-7041 incorrect use of X509_check_host (regarding return value)
is fixed with this commit.
The flaw came in with #242 and prevented proper host name verification
when openssl >= 1.0.2 was in use since openfortivpn 1.7.0. |
struct razer_report razer_chroma_extended_matrix_effect_breathing_single(unsigned char variable_storage, unsigned char led_id, struct razer_rgb *rgb1)
{
struct razer_report report = razer_chroma_extended_matrix_effect_base(0x09, variable_storage, led_id, 0x02);
report.arguments[3] = 0x01;
report.arguments[... | 0 | [
"CWE-787"
] | openrazer | 7e8a04feb378a679f1bcdcae079a5100cc45663b | 127,954,752,754,649,020,000,000,000,000,000,000,000 | 13 | Fix oob memcpy in matrix_custom_frame methods
Adjust row_length if it exeeds the arguments array |
onig_new_deluxe(regex_t** reg, const UChar* pattern, const UChar* pattern_end,
OnigCompileInfo* ci, OnigErrorInfo* einfo)
{
int r;
UChar *cpat, *cpat_end;
if (IS_NOT_NULL(einfo)) einfo->par = (UChar* )NULL;
if (ci->pattern_enc != ci->target_enc) {
r = conv_encoding(ci->pattern_enc, ci->tar... | 1 | [
"CWE-416",
"CWE-200"
] | oniguruma | 0f7f61ed1b7b697e283e37bd2d731d0bd57adb55 | 210,918,294,419,895,800,000,000,000,000,000,000,000 | 40 | Fix CVE-2019-13224: don't allow different encodings for onig_new_deluxe() |
static int fixup_bpf_calls(struct bpf_verifier_env *env)
{
struct bpf_prog *prog = env->prog;
struct bpf_insn *insn = prog->insnsi;
const struct bpf_func_proto *fn;
const int insn_cnt = prog->len;
struct bpf_insn insn_buf[16];
struct bpf_prog *new_prog;
struct bpf_map *map_ptr;
int i, cnt, delta = 0;
for (i =... | 0 | [
"CWE-200"
] | linux | 0d0e57697f162da4aa218b5feafe614fb666db07 | 275,459,863,816,357,240,000,000,000,000,000,000,000 | 77 | bpf: don't let ldimm64 leak map addresses on unprivileged
The patch fixes two things at once:
1) It checks the env->allow_ptr_leaks and only prints the map address to
the log if we have the privileges to do so, otherwise it just dumps 0
as we would when kptr_restrict is enabled on %pK. Given the latter is
of... |
xmlBufGetInputBase(xmlBufPtr buf, xmlParserInputPtr input) {
size_t base;
if ((input == NULL) || (buf == NULL) || (buf->error))
return(-1);
CHECK_COMPAT(buf)
base = input->base - buf->content;
/*
* We could do some pointer arythmetic checks but that's probably
* sufficient.
*... | 0 | [
"CWE-399"
] | libxml2 | 213f1fe0d76d30eaed6e5853057defc43e6df2c9 | 89,957,427,532,746,480,000,000,000,000,000,000,000 | 17 | CVE-2015-1819 Enforce the reader to run in constant memory
One of the operation on the reader could resolve entities
leading to the classic expansion issue. Make sure the
buffer used for xmlreader operation is bounded.
Introduce a new allocation type for the buffers for this effect. |
static inline void io_req_complete(struct io_kiocb *req, s32 res)
{
__io_req_complete(req, 0, res, 0);
} | 0 | [
"CWE-416"
] | linux | e677edbcabee849bfdd43f1602bccbecf736a646 | 203,920,225,379,904,630,000,000,000,000,000,000,000 | 4 | io_uring: fix race between timeout flush and removal
io_flush_timeouts() assumes the timeout isn't in progress of triggering
or being removed/canceled, so it unconditionally removes it from the
timeout list and attempts to cancel it.
Leave it on the list and let the normal timeout cancelation take care
of it.
Cc: st... |
process_pointer_pdu(STREAM s)
{
uint16 message_type;
uint16 x, y;
in_uint16_le(s, message_type);
in_uint8s(s, 2); /* pad */
switch (message_type)
{
case RDP_POINTER_MOVE:
in_uint16_le(s, x);
in_uint16_le(s, y);
if (s_check(s))
ui_move_pointer(x, y);
break;
case RDP_POINTER_COLOR:
process... | 0 | [
"CWE-787"
] | rdesktop | 766ebcf6f23ccfe8323ac10242ae6e127d4505d2 | 2,854,487,302,393,393,700,000,000,000,000,000,000 | 37 | Malicious RDP server security fixes
This commit includes fixes for a set of 21 vulnerabilities in
rdesktop when a malicious RDP server is used.
All vulnerabilities was identified and reported by Eyal Itkin.
* Add rdp_protocol_error function that is used in several fixes
* Refactor of process_bitmap_updates
* Fix pos... |
void set_task_comm(struct task_struct *tsk, char *buf)
{
task_lock(tsk);
trace_task_rename(tsk, buf);
/*
* Threads may access current->comm without holding
* the task lock, so write the string carefully.
* Readers without a lock may see incomplete new
* names but are safe from non-terminating string reads.... | 0 | [
"CWE-200"
] | linux-2.6 | b66c5984017533316fd1951770302649baf1aa33 | 57,609,137,138,285,760,000,000,000,000,000,000,000 | 18 | exec: do not leave bprm->interp on stack
If a series of scripts are executed, each triggering module loading via
unprintable bytes in the script header, kernel stack contents can leak
into the command line.
Normally execution of binfmt_script and binfmt_misc happens recursively.
However, when modules are enabled, and... |
int mbedtls_x509_crt_is_revoked( const mbedtls_x509_crt *crt, const mbedtls_x509_crl *crl )
{
const mbedtls_x509_crl_entry *cur = &crl->entry;
while( cur != NULL && cur->serial.len != 0 )
{
if( crt->serial.len == cur->serial.len &&
memcmp( crt->serial.p, cur->serial.p, crt->serial.len )... | 0 | [
"CWE-287",
"CWE-284"
] | mbedtls | d15795acd5074e0b44e71f7ede8bdfe1b48591fc | 292,805,507,446,167,540,000,000,000,000,000,000,000 | 18 | Improve behaviour on fatal errors
If we didn't walk the whole chain, then there may be any kind of errors in the
part of the chain we didn't check, so setting all flags looks like the safe
thing to do. |
inline char * qs_scanvalue(const char * key, const char * qs, char * val, size_t val_len)
{
size_t i, key_len;
const char * tmp;
// find the beginning of the k/v substrings
if ( (tmp = strchr(qs, '?')) != NULL )
qs = tmp + 1;
key_len = strlen(key);
while(qs[0] != '#' && qs[0] != '\0')
... | 0 | [
"CWE-703"
] | Crow | 79eec91f00b5fb7df890d4e84b2f048b0841e044 | 207,185,385,444,461,730,000,000,000,000,000,000,000 | 39 | Fixed issue where an index in qs_parse is incorrectly incremented beyond the maximum possible value |
int bprm_mm_init(struct linux_binprm *bprm)
{
int err;
struct mm_struct *mm = NULL;
bprm->mm = mm = mm_alloc();
err = -ENOMEM;
if (!mm)
goto err;
err = init_new_context(current, mm);
if (err)
goto err;
err = __bprm_mm_init(bprm);
if (err)
goto err;
return 0;
err:
if (mm) {
bprm->mm = NULL;
mmd... | 0 | [
"CWE-200"
] | linux-2.6 | b66c5984017533316fd1951770302649baf1aa33 | 163,643,538,102,934,800,000,000,000,000,000,000,000 | 28 | exec: do not leave bprm->interp on stack
If a series of scripts are executed, each triggering module loading via
unprintable bytes in the script header, kernel stack contents can leak
into the command line.
Normally execution of binfmt_script and binfmt_misc happens recursively.
However, when modules are enabled, and... |
static int ext4_da_writepages(struct address_space *mapping,
struct writeback_control *wbc)
{
pgoff_t index;
int range_whole = 0;
handle_t *handle = NULL;
struct mpage_da_data mpd;
struct inode *inode = mapping->host;
int no_nrwrite_index_update;
int pages_written = 0;
long pages_skipped;
int needed_b... | 0 | [
"CWE-399"
] | linux-2.6 | 06a279d636734da32bb62dd2f7b0ade666f65d7c | 319,624,319,792,502,500,000,000,000,000,000,000,000 | 156 | ext4: only use i_size_high for regular files
Directories are not allowed to be bigger than 2GB, so don't use
i_size_high for anything other than regular files. E2fsck should
complain about these inodes, but the simplest thing to do for the
kernel is to only use i_size_high for regular files.
This prevents an intenti... |
static void fm10k_qv_enable(struct fm10k_q_vector *q_vector)
{
/* Enable auto-mask and clear the current mask */
u32 itr = FM10K_ITR_ENABLE;
/* Update Tx ITR */
fm10k_update_itr(&q_vector->tx);
/* Update Rx ITR */
fm10k_update_itr(&q_vector->rx);
/* Store Tx itr in timer slot 0 */
itr |= (q_vector->tx.itr & ... | 0 | [
"CWE-476"
] | linux | 01ca667133d019edc9f0a1f70a272447c84ec41f | 58,769,560,378,015,630,000,000,000,000,000,000,000 | 20 | fm10k: Fix a potential NULL pointer dereference
Syzkaller report this:
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] SMP KASAN PTI
CPU: 0 PID: 4378 Comm: syz-executor.0 Tainted: G C 5.0.0+ #5
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),... |
string_to_gvalue (const char *str)
{
GValue *val;
val = g_slice_new0 (GValue);
g_value_init (val, G_TYPE_STRING);
g_value_set_string (val, str);
return val;
} | 0 | [
"CWE-310"
] | network-manager-applet | 4020594dfbf566f1852f0acb36ad631a9e73a82b | 148,732,867,882,340,370,000,000,000,000,000,000,000 | 10 | core: fix CA cert mishandling after cert file deletion (deb #560067) (rh #546793)
If a connection was created with a CA certificate, but the user later
moved or deleted that CA certificate, the applet would simply provide the
connection to NetworkManager without any CA certificate. This could cause
NM to connect to t... |
static void gadgets_drop(struct config_group *group, struct config_item *item)
{
config_item_put(item);
} | 0 | [
"CWE-125"
] | linux | 15753588bcd4bbffae1cca33c8ced5722477fe1f | 163,675,032,669,536,180,000,000,000,000,000,000,000 | 4 | USB: gadget: fix illegal array access in binding with UDC
FuzzUSB (a variant of syzkaller) found an illegal array access
using an incorrect index while binding a gadget with UDC.
Reference: https://www.spinics.net/lists/linux-usb/msg194331.html
This bug occurs when a size variable used for a buffer
is misused to acc... |
int ha_myisam::restart_rnd_next(uchar *buf, uchar *pos)
{
return rnd_pos(buf,pos);
} | 0 | [
"CWE-362"
] | mysql-server | 4e5473862e6852b0f3802b0cd0c6fa10b5253291 | 260,663,163,413,177,170,000,000,000,000,000,000,000 | 4 | Bug#24388746: PRIVILEGE ESCALATION AND RACE CONDITION USING CREATE TABLE
During REPAIR TABLE of a MyISAM table, a temporary data file (.TMD)
is created. When repair finishes, this file is renamed to the original
.MYD file. The problem was that during this rename, we copied the
stats from the old file to the new file w... |
static const char *am_set_module_config_int_slot(cmd_parms *cmd,
void *struct_ptr,
const char *arg)
{
return ap_set_int_slot(cmd, am_get_mod_cfg(cmd->server), arg);
} | 0 | [
"CWE-601"
] | mod_auth_mellon | 9d28908e28ef70a12196c215503fb0075e1fd7f3 | 51,077,974,480,776,520,000,000,000,000,000,000,000 | 6 | 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 |
TEST_F(SingleAllowMissingInOrListTest, OneGoodJwt) {
EXPECT_CALL(mock_cb_, onComplete(Status::Ok));
auto headers = Http::TestRequestHeaderMapImpl{{kExampleHeader, GoodToken}};
context_ = Verifier::createContext(headers, parent_span_, &mock_cb_);
verifier_->verify(context_);
EXPECT_THAT(headers, JwtOutputSucce... | 0 | [
"CWE-303",
"CWE-703"
] | envoy | ea39e3cba652bcc4b11bb0d5c62b017e584d2e5a | 279,070,457,259,572,500,000,000,000,000,000,000,000 | 7 | jwt_authn: fix a bug where JWT with wrong issuer is allowed in allow_missing case (#15194)
[jwt] When allow_missing is used inside RequiresAny, the requests with JWT with wrong issuer are accepted. This is a bug, allow_missing should only allow requests without any JWT. This change fixed the above issue by preserving ... |
TABLE_LIST *st_select_lex::convert_right_join()
{
TABLE_LIST *tab2= join_list->pop();
TABLE_LIST *tab1= join_list->pop();
DBUG_ENTER("convert_right_join");
join_list->push_front(tab2, parent_lex->thd->mem_root);
join_list->push_front(tab1, parent_lex->thd->mem_root);
tab1->outer_join|= JOIN_TYPE_RIGHT;
... | 0 | [] | server | ba4927e520190bbad763bb5260ae154f29a61231 | 251,304,401,230,149,700,000,000,000,000,000,000,000 | 12 | 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... |
static int update_clone_task_finished(int result,
struct strbuf *err,
void *suc_cb,
void *idx_task_cb)
{
const struct cache_entry *ce;
struct submodule_update_clone *suc = suc_cb;
int *idxP = idx_task_cb;
int idx = *idxP;
free(idxP);
if (!result)
return 0;
if (idx < suc->list.n... | 0 | [
"CWE-88"
] | git | 98afac7a7cefdca0d2c4917dd8066a59f7088265 | 23,019,613,724,199,230,000,000,000,000,000,000,000 | 37 | submodule--helper: use "--" to signal end of clone options
When we clone a submodule, we call "git clone $url $path".
But there's nothing to say that those components can't begin
with a dash themselves, confusing git-clone into thinking
they're options. Let's pass "--" to make it clear what we
expect.
There's no test... |
void ftoa_bounded(JsVarFloat val,char *str, size_t len) {
ftoa_bounded_extra(val, str, len, 10, -1);
} | 0 | [
"CWE-119",
"CWE-787"
] | Espruino | 0a7619875bf79877907205f6bee08465b89ff10b | 290,211,179,639,348,300,000,000,000,000,000,000,000 | 3 | Fix strncat/cpy bounding issues (fix #1425) |
static void f_midi_in_tasklet(unsigned long data)
{
struct f_midi *midi = (struct f_midi *) data;
f_midi_transmit(midi);
} | 0 | [
"CWE-415"
] | linux | 7fafcfdf6377b18b2a726ea554d6e593ba44349f | 89,081,467,649,175,640,000,000,000,000,000,000,000 | 5 | USB: gadget: f_midi: fixing a possible double-free in f_midi
It looks like there is a possibility of a double-free vulnerability on an
error path of the f_midi_set_alt function in the f_midi driver. If the
path is feasible then free_ep_req gets called twice:
req->complete = f_midi_complete;
err = us... |
static int sctp_getsockopt_primary_addr(struct sock *sk, int len,
char __user *optval, int __user *optlen)
{
struct sctp_prim prim;
struct sctp_association *asoc;
struct sctp_sock *sp = sctp_sk(sk);
if (len < sizeof(struct sctp_prim))
return -EINVAL;
len = sizeof(struct sctp_prim);
if (copy_from_user(&p... | 0 | [
"CWE-617",
"CWE-362"
] | linux | 2dcab598484185dea7ec22219c76dcdd59e3cb90 | 335,375,532,341,679,000,000,000,000,000,000,000,000 | 35 | sctp: avoid BUG_ON on sctp_wait_for_sndbuf
Alexander Popov reported that an application may trigger a BUG_ON in
sctp_wait_for_sndbuf if the socket tx buffer is full, a thread is
waiting on it to queue more data and meanwhile another thread peels off
the association being used by the first thread.
This patch replaces ... |
tty_cmd_reverseindex(struct tty *tty, const struct tty_ctx *ctx)
{
struct window_pane *wp = ctx->wp;
if (ctx->ocy != ctx->orupper)
return;
if (ctx->bigger ||
!tty_pane_full_width(tty, ctx) ||
tty_fake_bce(tty, wp, 8) ||
!tty_term_has(tty->term, TTYC_CSR) ||
!tty_term_has(tty->term, TTYC_RI) |... | 0 | [] | src | b32e1d34e10a0da806823f57f02a4ae6e93d756e | 200,852,642,165,309,080,000,000,000,000,000,000,000 | 26 | evbuffer_new and bufferevent_new can both fail (when malloc fails) and
return NULL. GitHub issue 1547. |
static int ext4_alloc_file_blocks(struct file *file, ext4_lblk_t offset,
ext4_lblk_t len, loff_t new_size,
int flags)
{
struct inode *inode = file_inode(file);
handle_t *handle;
int ret = 0;
int ret2 = 0, ret3 = 0;
int retries = 0;
int depth = 0;
struct ext4_map_blocks map;
unsigned int credits;
lo... | 0 | [
"CWE-703"
] | linux | ce9f24cccdc019229b70a5c15e2b09ad9c0ab5d1 | 261,451,373,904,999,640,000,000,000,000,000,000,000 | 82 | ext4: check journal inode extents more carefully
Currently, system zones just track ranges of block, that are "important"
fs metadata (bitmaps, group descriptors, journal blocks, etc.). This
however complicates how extent tree (or indirect blocks) can be checked
for inodes that actually track such metadata - currently... |
static void thp_pmd_to_pagemap_entry(pagemap_entry_t *pme, struct pagemapread *pm,
pmd_t pmd, int offset, int pmd_flags2)
{
/*
* Currently pmd for thp is always present because thp can not be
* swapped-out, migrated, or HWPOISONed (split in such cases instead.)
* This if-check is just to prepare for future imp... | 0 | [
"CWE-200"
] | linux | ab676b7d6fbf4b294bf198fb27ade5b0e865c7ce | 209,368,822,723,468,240,000,000,000,000,000,000,000 | 14 | pagemap: do not leak physical addresses to non-privileged userspace
As pointed by recent post[1] on exploiting DRAM physical imperfection,
/proc/PID/pagemap exposes sensitive information which can be used to do
attacks.
This disallows anybody without CAP_SYS_ADMIN to read the pagemap.
[1] http://googleprojectzero.bl... |
static INLINE OPJ_BOOL opj_tcd_init_tile(opj_tcd_t *p_tcd, OPJ_UINT32 p_tile_no, OPJ_BOOL isEncoder, OPJ_FLOAT32 fraction, OPJ_SIZE_T sizeof_block, opj_event_mgr_t* manager)
{
OPJ_UINT32 (*l_gain_ptr)(OPJ_UINT32) = 00;
OPJ_UINT32 compno, resno, bandno, precno, cblkno;
opj_tcp_t * l_tcp = 00;
opj_cp_t * l_cp = 00;
... | 1 | [
"CWE-119",
"CWE-310"
] | openjpeg | e078172b1c3f98d2219c37076b238fb759c751ea | 52,167,443,669,143,530,000,000,000,000,000,000,000 | 392 | Add sanity check for tile coordinates (#823)
Coordinates are casted from OPJ_UINT32 to OPJ_INT32
Add sanity check for negative values and upper bound becoming lower
than lower bound.
See also
https://pdfium.googlesource.com/pdfium/+/b6befb2ed2485a3805cddea86dc7574510178ea9 |
uint32_t getMiss() const {
return miss_;
} | 0 | [
"CWE-125"
] | folly | c321eb588909646c15aefde035fd3133ba32cdee | 56,652,116,210,784,570,000,000,000,000,000,000,000 | 3 | Handle close_notify as standard writeErr in AsyncSSLSocket.
Summary: Fixes CVE-2019-11934
Reviewed By: mingtaoy
Differential Revision: D18020613
fbshipit-source-id: db82bb250e53f0d225f1280bd67bc74abd417836 |
static pgprot_t vm_pgprot_modify(pgprot_t oldprot, unsigned long vm_flags)
{
return pgprot_modify(oldprot, vm_get_page_prot(vm_flags));
} | 0 | [
"CWE-119"
] | linux | 1be7107fbe18eed3e319a6c3e83c78254b693acb | 182,459,034,221,064,100,000,000,000,000,000,000,000 | 4 | mm: larger stack guard gap, between vmas
Stack guard page is a useful feature to reduce a risk of stack smashing
into a different mapping. We have been using a single page gap which
is sufficient to prevent having stack adjacent to a different mapping.
But this seems to be insufficient in the light of the stack usage ... |
evdev_left_handed_get(struct libinput_device *device)
{
struct evdev_device *evdev = evdev_device(device);
/* return the wanted configuration, even if it hasn't taken
* effect yet! */
return evdev->left_handed.want_enabled;
} | 0 | [
"CWE-134"
] | libinput | a423d7d3269dc32a87384f79e29bb5ac021c83d1 | 18,210,705,073,472,977,000,000,000,000,000,000,000 | 8 | 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... |
int __init wireless_proc_init(void)
{
if (!proc_net_fops_create("wireless", S_IRUGO, &wireless_seq_fops))
return -ENOMEM;
return 0;
} | 0 | [
"CWE-200"
] | linux-2.6 | 9ef1d4c7c7aca1cd436612b6ca785b726ffb8ed8 | 2,746,523,374,311,602,000,000,000,000,000,000,000 | 7 | [NETLINK]: Missing initializations in dumped data
Mostly missing initialization of padding fields of 1 or 2 bytes length,
two instances of uninitialized nlmsgerr->msg of 16 bytes length.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net> |
RateLimit *ClientHandler::get_wlimit() { return &conn_.wlimit; } | 0 | [] | nghttp2 | 95efb3e19d174354ca50c65d5d7227d92bcd60e1 | 150,179,674,316,682,060,000,000,000,000,000,000,000 | 1 | Don't read too greedily |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.