func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
static uint8_t arcmsr_hbaB_wait_msgint_ready(struct AdapterControlBlock *acb)
{
struct MessageUnit_B *reg = acb->pmuB;
int i;
for (i = 0; i < 2000; i++) {
if (readl(reg->iop2drv_doorbell)
& ARCMSR_IOP2DRV_MESSAGE_CMD_DONE) {
writel(ARCMSR_MESSAGE_INT_CLEAR_PATTERN,
reg->iop2drv_doorbell);
writel(ARC... | 0 | [
"CWE-119",
"CWE-787"
] | linux | 7bc2b55a5c030685b399bb65b6baa9ccc3d1f167 | 135,782,019,884,832,200,000,000,000,000,000,000,000 | 19 | scsi: arcmsr: Buffer overflow in arcmsr_iop_message_xfer()
We need to put an upper bound on "user_len" so the memcpy() doesn't
overflow.
Cc: <stable@vger.kernel.org>
Reported-by: Marco Grassi <marco.gra@gmail.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Sig... |
yaffsfs_fscheck(TSK_FS_INFO * /*fs*/, FILE * /*hFile*/)
{
tsk_error_reset();
tsk_error_set_errno(TSK_ERR_FS_UNSUPFUNC);
tsk_error_set_errstr("fscheck not implemented yet for YAFFS");
return 1;
} | 0 | [
"CWE-125",
"CWE-787"
] | sleuthkit | 459ae818fc8dae717549810150de4d191ce158f1 | 242,239,134,015,677,000,000,000,000,000,000,000,000 | 7 | Fix stack buffer overflow in yaffsfs_istat
Prevent a stack buffer overflow in yaffsfs_istat by increasing the buffer size to the size required by tsk_fs_time_to_str. |
size_t WireFormat::FieldDataOnlyByteSize(const FieldDescriptor* field,
const Message& message) {
const Reflection* message_reflection = message.GetReflection();
size_t data_size = 0;
if (field->is_map()) {
const MapFieldBase* map_field =
message_reflection->G... | 0 | [
"CWE-703"
] | protobuf | d1635e1496f51e0d5653d856211e8821bc47adc4 | 221,716,415,612,352,300,000,000,000,000,000,000,000 | 110 | Apply patch |
static void tg3_timer_start(struct tg3 *tp)
{
tp->asf_counter = tp->asf_multiplier;
tp->timer_counter = tp->timer_multiplier;
tp->timer.expires = jiffies + tp->timer_offset;
add_timer(&tp->timer);
} | 0 | [
"CWE-476",
"CWE-119"
] | linux | 715230a44310a8cf66fbfb5a46f9a62a9b2de424 | 289,284,703,567,798,540,000,000,000,000,000,000,000 | 8 | 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 ... |
dump_args (struct obstack *obs, int argc, token_data **argv,
const char *sep, bool quoted)
{
int i;
size_t len = strlen (sep);
for (i = 1; i < argc; i++)
{
if (i > 1)
obstack_grow (obs, sep, len);
if (quoted)
obstack_grow (obs, lquote.string, lquote.length);
obstack_grow (obs, TOKEN_D... | 0 | [] | m4 | 5345bb49077bfda9fabd048e563f9e7077fe335d | 137,376,063,114,673,300,000,000,000,000,000,000,000 | 18 | Minor security fix: Quote output of mkstemp.
* src/builtin.c (mkstemp_helper): Produce quoted output.
* doc/m4.texinfo (Mkstemp): Update the documentation and tests.
* NEWS: Document this change.
Signed-off-by: Eric Blake <ebb9@byu.net>
(cherry picked from commit bd9900d65eb9cd5add0f107e94b513fa267495ba) |
int ieee80211_if_change_type(struct ieee80211_sub_if_data *sdata,
enum nl80211_iftype type)
{
int ret;
ASSERT_RTNL();
if (type == ieee80211_vif_type_p2p(&sdata->vif))
return 0;
/* Setting ad-hoc mode on non-IBSS channel is not supported. */
if (sdata->local->oper_channel->flags & IEEE80211_CHAN_NO_IBS... | 0 | [
"CWE-703",
"CWE-264"
] | linux | 550fd08c2cebad61c548def135f67aba284c6162 | 195,318,322,371,440,570,000,000,000,000,000,000,000 | 35 | net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared
After the last patch, We are left in a state in which only drivers calling
ether_setup have IFF_TX_SKB_SHARING set (we assume that drivers touching real
hardware call ether_setup for their net_devices and don't hold any state in
their skbs. There... |
gdm_session_worker_handle_set_language_name (GdmDBusWorker *object,
GDBusMethodInvocation *invocation,
const char *language_name)
{
GdmSessionWorker *worker = GDM_SESSION_WORKER (object);
g_debug... | 0 | [
"CWE-362"
] | gdm | dcdbaaa04012541ad2813cf83559d91d52f208b9 | 250,105,187,356,661,600,000,000,000,000,000,000,000 | 11 | session-worker: Don't switch back VTs until session is fully exited
There's a race condition on shutdown where the session worker is
switching VTs back to the initial VT at the same time as the session
exit is being processed.
This means that manager may try to start a login screen (because of
the VT switch) when aut... |
static zval *to_zval_bool(encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
{
zval *ret;
MAKE_STD_ZVAL(ret);
FIND_XML_NULL(data, ret);
if (data && data->children) {
if (data->children->type == XML_TEXT_NODE && data->children->next == NULL) {
whiteSpace_collapse(data->children->content);
if (stricmp((char*)dat... | 0 | [
"CWE-19"
] | php-src | c8eaca013a3922e8383def6158ece2b63f6ec483 | 191,336,185,811,572,700,000,000,000,000,000,000,000 | 29 | Added type checks |
virtual enum precedence precedence() const { return DEFAULT_PRECEDENCE; } | 0 | [
"CWE-617"
] | server | 2e7891080667c59ac80f788eef4d59d447595772 | 221,872,269,110,108,000,000,000,000,000,000,000,000 | 1 | MDEV-25635 Assertion failure when pushing from HAVING into WHERE of view
This bug could manifest itself after pushing a where condition over a
mergeable derived table / view / CTE DT into a grouping view / derived
table / CTE V whose item list contained set functions with constant
arguments such as MIN(2), SUM(1) etc.... |
TEST_P(SslCertficateIntegrationTest, ServerRsaClientEcdsaOnly) {
server_rsa_cert_ = true;
server_ecdsa_cert_ = false;
client_ecdsa_cert_ = true;
initialize();
EXPECT_FALSE(
makeRawHttpConnection(makeSslClientConnection(ecdsaOnlyClientOptions()), absl::nullopt)
->connected());
const std::stri... | 0 | [
"CWE-400"
] | envoy | 0e49a495826ea9e29134c1bd54fdeb31a034f40c | 337,094,231,617,525,240,000,000,000,000,000,000,000 | 14 | http/2: add stats and stream flush timeout (#139)
This commit adds a new stream flush timeout to guard against a
remote server that does not open window once an entire stream has
been buffered for flushing. Additional stats have also been added
to better understand the codecs view of active streams as well as
amount o... |
DEFUN (clear_ip_bgp_external_ipv4_soft,
clear_ip_bgp_external_ipv4_soft_cmd,
"clear ip bgp external ipv4 (unicast|multicast) soft",
CLEAR_STR
IP_STR
BGP_STR
"Clear all external peers\n"
"Address family\n"
"Address Family modifier\n"
"Address Family modifier... | 0 | [
"CWE-125"
] | frr | 6d58272b4cf96f0daa846210dd2104877900f921 | 250,757,202,477,559,720,000,000,000,000,000,000,000 | 19 | [bgpd] cleanup, compact and consolidate capability parsing code
2007-07-26 Paul Jakma <paul.jakma@sun.com>
* (general) Clean up and compact capability parsing slightly.
Consolidate validation of length and logging of generic TLV, and
memcpy of capability data, thus removing such from cap specifc
code (not a... |
static size_t curl_read(char *data, size_t size, size_t nmemb, void *ctx)
{
php_curl *ch = (php_curl *) ctx;
php_curl_read *t = ch->handlers->read;
int length = 0;
switch (t->method) {
case PHP_CURL_DIRECT:
if (t->fp) {
length = fread(data, size, nmemb, t->fp);
}
break;
case PH... | 1 | [] | php-src | 0ea75af9be8a40836951fc89f723dd5390b8b46f | 227,533,401,729,489,300,000,000,000,000,000,000,000 | 71 | Fixed bug #69316 (Use-after-free in php_curl related to CURLOPT_FILE/_INFILE/_WRITEHEADER) |
static int php_curl_ssl_mutex_create(void **m)
{
if (*((MUTEX_T *) m) = tsrm_mutex_alloc()) {
return SUCCESS;
} else {
return FAILURE;
}
} | 0 | [] | php-src | 124fb22a13fafa3648e4e15b4f207c7096d8155e | 98,406,212,503,383,000,000,000,000,000,000,000,000 | 8 | Fixed bug #68739 #68740 #68741 |
parse_auth_header(struct mg_connection *conn, struct auth_s *auth)
{
if (!auth || !conn) {
return 0;
}
const char *auth_header = NULL;
if (((auth_header = mg_get_header(conn, "Authorization")) == NULL) ||
strncasecmp(auth_header, "Basic ", 6) != 0) {
return 0;
}
/* Parse authorization header */
const ch... | 0 | [
"CWE-787"
] | rsyslog | 89955b0bcb1ff105e1374aad7e0e993faa6a038f | 91,326,865,639,579,020,000,000,000,000,000,000,000 | 36 | net bugfix: potential buffer overrun |
ConnStateData::startDechunkingRequest()
{
Must(bodyPipe != NULL);
debugs(33, 5, HERE << "start dechunking" << bodyPipe->status());
assert(!bodyParser);
bodyParser = new Http1::TeChunkedParser;
} | 0 | [
"CWE-444"
] | squid | fd68382860633aca92065e6c343cfd1b12b126e7 | 68,119,335,934,654,070,000,000,000,000,000,000,000 | 7 | 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... |
static PHP_FUNCTION(session_set_save_handler)
{
zval ***args = NULL;
int i, num_args, argc = ZEND_NUM_ARGS();
char *name;
if (PS(session_status) != php_session_none) {
RETURN_FALSE;
}
if (argc > 0 && argc <= 2) {
zval *obj = NULL, *callback = NULL;
zend_uint func_name_len;
char *func_name;
HashPositio... | 0 | [
"CWE-264"
] | php-src | 25e8fcc88fa20dc9d4c47184471003f436927cde | 158,008,099,966,738,180,000,000,000,000,000,000,000 | 137 | Strict session |
bool AuthorizationManager::shouldValidateAuthSchemaOnStartup() {
return _startupAuthSchemaValidation;
} | 0 | [
"CWE-613"
] | mongo | db19e7ce84cfd702a4ba9983ee2ea5019f470f82 | 229,703,132,192,766,540,000,000,000,000,000,000,000 | 3 | SERVER-38984 Validate unique User ID on UserCache hit
(cherry picked from commit e55d6e2292e5dbe2f97153251d8193d1cc89f5d7) |
llsec_key_alloc(const struct ieee802154_llsec_key *template)
{
const int authsizes[3] = { 4, 8, 16 };
struct mac802154_llsec_key *key;
int i;
key = kzalloc(sizeof(*key), GFP_KERNEL);
if (!key)
return NULL;
kref_init(&key->ref);
key->key = *template;
BUILD_BUG_ON(ARRAY_SIZE(authsizes) != ARRAY_SIZE(key->tfm... | 0 | [
"CWE-416"
] | linux | 1165affd484889d4986cf3b724318935a0b120d8 | 269,434,376,195,721,160,000,000,000,000,000,000,000 | 47 | net: mac802154: Fix general protection fault
syzbot found general protection fault in crypto_destroy_tfm()[1].
It was caused by wrong clean up loop in llsec_key_alloc().
If one of the tfm array members is in IS_ERR() range it will
cause general protection fault in clean up function [1].
Call Trace:
crypto_free_aead ... |
fetch_fp_info(Oid func_id, struct fp_info * fip)
{
HeapTuple func_htp;
Form_pg_proc pp;
Assert(OidIsValid(func_id));
Assert(fip != NULL);
/*
* Since the validity of this structure is determined by whether the
* funcid is OK, we clear the funcid here. It must not be set to the
* correct value until we are ... | 0 | [
"CWE-89"
] | postgres | 2b3a8b20c2da9f39ffecae25ab7c66974fbc0d3b | 188,720,838,185,138,500,000,000,000,000,000,000,000 | 45 | Be more careful to not lose sync in the FE/BE protocol.
If any error occurred while we were in the middle of reading a protocol
message from the client, we could lose sync, and incorrectly try to
interpret a part of another message as a new protocol message. That will
usually lead to an "invalid frontend message" erro... |
static void *ocfs2_acl_to_xattr(const struct posix_acl *acl, size_t *size)
{
struct ocfs2_acl_entry *entry = NULL;
char *ocfs2_acl;
size_t n;
*size = acl->a_count * sizeof(struct posix_acl_entry);
ocfs2_acl = kmalloc(*size, GFP_NOFS);
if (!ocfs2_acl)
return ERR_PTR(-ENOMEM);
entry = (struct ocfs2_acl_entry ... | 0 | [
"CWE-862",
"CWE-285"
] | linux | 073931017b49d9458aa351605b43a7e34598caef | 178,668,802,860,168,830,000,000,000,000,000,000,000 | 34 | posix_acl: Clear SGID bit when setting file permissions
When file permissions are modified via chmod(2) and the user is not in
the owning group or capable of CAP_FSETID, the setgid bit is cleared in
inode_change_ok(). Setting a POSIX ACL via setxattr(2) sets the file
permissions as well as the new ACL, but doesn't cl... |
int main(int argc, char **argv) {
swaylock_log_init(LOG_ERROR);
initialize_pw_backend(argc, argv);
srand(time(NULL));
enum line_mode line_mode = LM_LINE;
state.failed_attempts = 0;
state.args = (struct swaylock_args){
.mode = BACKGROUND_MODE_FILL,
.font = strdup("sans-serif"),
.font_size = 0,
.radius = 5... | 0 | [
"CWE-703"
] | swaylock | 1d1c75b6316d21933069a9d201f966d84099f6ca | 132,123,284,634,053,700,000,000,000,000,000,000,000 | 163 | Add support for ext-session-lock-v1
This is a new protocol to lock the session [1]. It should be more
reliable than layer-shell + input-inhibitor.
[1]: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/131 |
void Temp2CHAD(cmsMAT3* Chad, cmsFloat64Number Temp)
{
cmsCIEXYZ White;
cmsCIExyY ChromaticityOfWhite;
cmsWhitePointFromTemp(&ChromaticityOfWhite, Temp);
cmsxyY2XYZ(&White, &ChromaticityOfWhite);
_cmsAdaptationMatrix(Chad, NULL, &White, cmsD50_XYZ());
} | 0 | [] | Little-CMS | 41d222df1bc6188131a8f46c32eab0a4d4cdf1b6 | 180,097,188,285,291,750,000,000,000,000,000,000,000 | 9 | Memory squeezing fix: lcms2 cmsPipeline construction
When creating a new pipeline, lcms would often try to allocate a stage
and pass it to cmsPipelineInsertStage without checking whether the
allocation succeeded. cmsPipelineInsertStage would then assert (or crash)
if it had not.
The fix here is to change cmsPipelineI... |
static int readlink_stat(const char *path, STRUCT_STAT *stp, char *linkbuf)
{
#ifdef SUPPORT_LINKS
if (link_stat(path, stp, copy_dirlinks) < 0)
return -1;
if (S_ISLNK(stp->st_mode)) {
int llen = do_readlink(path, linkbuf, MAXPATHLEN - 1);
if (llen < 0)
return -1;
linkbuf[llen] = '\0';
if (copy_unsafe_lin... | 0 | [
"CWE-59"
] | rsync | 962f8b90045ab331fc04c9e65f80f1a53e68243b | 40,456,385,672,220,050,000,000,000,000,000,000,000 | 28 | Complain if an inc-recursive path is not right for its dir.
This ensures that a malicious sender can't use a just-sent
symlink as a trasnfer path. |
void DequantizeSlice(const Device& d, OpKernelContext* ctx,
const ConstVec& input, float min_range, float max_range,
Vec output) {
// TODO(pauldonnelly): Factor out the similar calculations in quantize,
// dequantize and quantize_and_dequantize ops.
const fl... | 0 | [
"CWE-20",
"CWE-125"
] | tensorflow | 5899741d0421391ca878da47907b1452f06aaf1b | 5,218,915,848,930,661,000,000,000,000,000,000,000 | 32 | Fix heap OOB read in dequantize op.
Also fixes SEGV in same op
PiperOrigin-RevId: 372437896
Change-Id: I135e94d360c2a1ce374c10f7e0fed1af603dbc02 |
int ha_myisam::delete_table(const char *name)
{
return mi_delete_table(name);
} | 0 | [
"CWE-362"
] | mysql-server | 4e5473862e6852b0f3802b0cd0c6fa10b5253291 | 63,250,298,704,983,115,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 int rtw_get_sta_wpaie(struct net_device *dev, struct ieee_param *param)
{
int ret = 0;
struct sta_info *psta = NULL;
struct adapter *padapter = rtw_netdev_priv(dev);
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct sta_priv *pstapriv = &padapter->stapriv;
DBG_88E("%s, sta_addr: %pM\n", __func__, ... | 0 | [
"CWE-787"
] | linux | 74b6b20df8cfe90ada777d621b54c32e69e27cd7 | 100,538,111,657,894,530,000,000,000,000,000,000,000 | 36 | staging: rtl8188eu: prevent ->ssid overflow in rtw_wx_set_scan()
This code has a check to prevent read overflow but it needs another
check to prevent writing beyond the end of the ->ssid[] array.
Fixes: a2c60d42d97c ("staging: r8188eu: Add files for new driver - part 16")
Signed-off-by: Dan Carpenter <dan.carpenter@o... |
static int _server_handle_qTfV(libgdbr_t *g, int (*cmd_cb) (void*, const char*, char*, size_t), void *core_ptr) {
// TODO
if (send_ack (g) < 0) {
return -1;
}
return send_msg (g, "");
} | 0 | [
"CWE-703",
"CWE-787"
] | radare2 | 796dd28aaa6b9fa76d99c42c4d5ff8b257cc2191 | 182,149,404,888,827,230,000,000,000,000,000,000,000 | 7 | Fix ext2 buffer overflow in r2_sbu_grub_memmove |
evbuffer_deferred_callback(struct event_callback *cb, void *arg)
{
struct bufferevent *parent = NULL;
struct evbuffer *buffer = arg;
/* XXXX It would be better to run these callbacks without holding the
* lock */
EVBUFFER_LOCK(buffer);
parent = buffer->parent;
evbuffer_run_callbacks(buffer, 1);
evbuffer_decre... | 0 | [
"CWE-189"
] | libevent | 841ecbd96105c84ac2e7c9594aeadbcc6fb38bc4 | 227,224,176,700,445,460,000,000,000,000,000,000,000 | 14 | Fix CVE-2014-6272 in Libevent 2.1
For this fix, we need to make sure that passing too-large inputs to
the evbuffer functions can't make us do bad things with the heap.
Also, lower the maximum chunk size to the lower of off_t, size_t maximum.
This is necessary since otherwise we could get into an infinite loop
if we ... |
static ssize_t pm_qos_no_power_off_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t n)
{
int ret;
if (kstrtoint(buf, 0, &ret))
return -EINVAL;
if (ret != 0 && ret != 1)
return -EINVAL;
ret = dev_pm_qos_update_flags(dev, PM_QOS_FLAG_NO_POWER_OFF, ret);
return ret <... | 0 | [
"CWE-787"
] | linux | aa838896d87af561a33ecefea1caa4c15a68bc47 | 300,305,856,912,986,550,000,000,000,000,000,000,000 | 15 | drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions
Convert the various sprintf fmaily calls in sysfs device show functions
to sysfs_emit and sysfs_emit_at for PAGE_SIZE buffer safety.
Done with:
$ spatch -sp-file sysfs_emit_dev.cocci --in-place --max-width=80 .
And cocci script:
$ cat s... |
numLinesInBuffer (Compressor * compressor)
{
return compressor? compressor->numScanLines(): 1;
} | 0 | [
"CWE-125"
] | openexr | e79d2296496a50826a15c667bf92bdc5a05518b4 | 232,365,722,979,620,730,000,000,000,000,000,000,000 | 4 | fix memory leaks and invalid memory accesses
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz> |
static struct sk_buff *netlink_alloc_large_skb(unsigned int size,
int broadcast)
{
struct sk_buff *skb;
void *data;
if (size <= NLMSG_GOODSIZE || broadcast)
return alloc_skb(size, GFP_KERNEL);
size = SKB_DATA_ALIGN(size) +
SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
data = vmalloc(size... | 0 | [
"CWE-20",
"CWE-269"
] | linux | f3d3342602f8bcbf37d7c46641cb9bca7618eb1c | 155,812,317,339,730,730,000,000,000,000,000,000,000 | 26 | 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... |
global_notify_fifo(vector_t *strvec)
{
notify_fifo(strvec, "", &global_data->notify_fifo);
} | 0 | [
"CWE-200"
] | keepalived | c6247a9ef2c7b33244ab1d3aa5d629ec49f0a067 | 250,825,400,076,588,060,000,000,000,000,000,000,000 | 4 | Add command line and configuration option to set umask
Issue #1048 identified that files created by keepalived are created
with mode 0666. This commit changes the default to 0644, and also
allows the umask to be specified in the configuration or as a command
line option.
Signed-off-by: Quentin Armitage <quentin@armit... |
static int pool_can_expand_by(struct mempool *pool) {
size_t available_space = 0;
if (pool == NULL) {
return 0;
}
if (pool->mem_get_free_space_func) {
available_space = pool->mem_get_free_space_func();
} else {
const size_t allocated_space =
pool->total_bufs_allocated_by_pool * pool->mem... | 0 | [
"CWE-703"
] | cortx-s3server | dd6bfbc4b84f14f898598922ca9efd5aaa645c5d | 155,765,425,777,455,280,000,000,000,000,000,000,000 | 22 | avoid the unrelesed lock after the method returns (#1041)
Update s3_memory_pool.c. Avoid the unreleased lock pool->lock after the method returns.
Co-authored-by: nileshgovande <63101371+nileshgovande@users.noreply.github.com> |
static void __device_links_queue_sync_state(struct device *dev,
struct list_head *list)
{
struct device_link *link;
if (!dev_has_sync_state(dev))
return;
if (dev->state_synced)
return;
list_for_each_entry(link, &dev->links.consumers, s_node) {
if (!(link->flags & DL_FLAG_MANAGED))
continue;
if... | 0 | [
"CWE-787"
] | linux | aa838896d87af561a33ecefea1caa4c15a68bc47 | 59,183,834,508,779,470,000,000,000,000,000,000,000 | 30 | drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions
Convert the various sprintf fmaily calls in sysfs device show functions
to sysfs_emit and sysfs_emit_at for PAGE_SIZE buffer safety.
Done with:
$ spatch -sp-file sysfs_emit_dev.cocci --in-place --max-width=80 .
And cocci script:
$ cat s... |
static void get_contype_from_attrs(map<string, bufferlist>& attrs,
string& content_type)
{
map<string, bufferlist>::iterator iter = attrs.find(RGW_ATTR_CONTENT_TYPE);
if (iter != attrs.end()) {
content_type = rgw_bl_str(iter->second);
}
} | 0 | [
"CWE-617"
] | ceph | f44a8ae8aa27ecef69528db9aec220f12492810e | 80,707,342,663,950,650,000,000,000,000,000,000,000 | 8 | rgw: RGWSwiftWebsiteHandler::is_web_dir checks empty subdir_name
checking for empty name avoids later assertion in RGWObjectCtx::set_atomic
Fixes: CVE-2021-3531
Reviewed-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 7196a469b4470f3c8628489df9a41ec8b... |
int RGWPostObj_ObjStore::verify_params()
{
/* check that we have enough memory to store the object
note that this test isn't exact and may fail unintentionally
for large requests is */
if (!s->length) {
return -ERR_LENGTH_REQUIRED;
}
off_t len = atoll(s->length);
if (len > (off_t)(s->cct->_conf->rgw_... | 0 | [
"CWE-770"
] | ceph | ab29bed2fc9f961fe895de1086a8208e21ddaddc | 111,588,217,964,383,320,000,000,000,000,000,000,000 | 17 | rgw: fix issues with 'enforce bounds' patch
The patch to enforce bounds on max-keys/max-uploads/max-parts had a few
issues that would prevent us from compiling it. Instead of changing the
code provided by the submitter, we're addressing them in a separate
commit to maintain the DCO.
Signed-off-by: Joao Eduardo Luis <... |
futex_wake(u32 __user *uaddr, unsigned int flags, int nr_wake, u32 bitset)
{
struct futex_hash_bucket *hb;
struct futex_q *this, *next;
union futex_key key = FUTEX_KEY_INIT;
int ret;
if (!bitset)
return -EINVAL;
ret = get_futex_key(uaddr, flags & FLAGS_SHARED, &key, VERIFY_READ);
if (unlikely(ret != 0))
go... | 0 | [
"CWE-264",
"CWE-269"
] | linux | e9c243a5a6de0be8e584c604d353412584b592f8 | 7,294,689,688,030,056,000,000,000,000,000,000,000 | 45 | futex-prevent-requeue-pi-on-same-futex.patch futex: Forbid uaddr == uaddr2 in futex_requeue(..., requeue_pi=1)
If uaddr == uaddr2, then we have broken the rule of only requeueing from
a non-pi futex to a pi futex with this call. If we attempt this, then
dangling pointers may be left for rt_waiter resulting in an expl... |
static void show_parameter(int snum, struct parm_struct *parm)
{
int i;
void *ptr = parm->ptr;
char *utf8_s1, *utf8_s2;
size_t converted_size;
TALLOC_CTX *ctx = talloc_stackframe();
if (parm->p_class == P_LOCAL && snum >= 0) {
ptr = lp_local_ptr_by_snum(snum, ptr);
}
printf("<tr><td>%s</td><td>", get_parm_t... | 0 | [] | samba | 71225948a249f079120282740fcc39fd6faa880e | 126,696,294,548,376,740,000,000,000,000,000,000,000 | 123 | swat: Use X-Frame-Options header to avoid clickjacking
Jann Horn reported a potential clickjacking vulnerability in SWAT where
the SWAT page could be embedded into an attacker's page using a frame or
iframe and then used to trick the user to change Samba settings.
Avoid this by telling the browser to refuse the frame... |
void extcap_dlts() {
u_int dlts_number = DLT_EN10MB;
printf("dlt {number=%u}{name=%s}{display=%s}\n", dlts_number, "ndpi", "nDPI Interface");
exit(0);
} | 0 | [
"CWE-125"
] | nDPI | b7e666e465f138ae48ab81976726e67deed12701 | 306,024,440,350,973,400,000,000,000,000,000,000,000 | 5 | Added fix to avoid potential heap buffer overflow in H.323 dissector
Modified HTTP report information to make it closer to the HTTP field names |
RGWListBucketMultiparts() {
max_uploads = 0;
is_truncated = false;
default_max = 0;
} | 0 | [
"CWE-770"
] | ceph | ab29bed2fc9f961fe895de1086a8208e21ddaddc | 95,685,286,180,521,430,000,000,000,000,000,000,000 | 5 | rgw: fix issues with 'enforce bounds' patch
The patch to enforce bounds on max-keys/max-uploads/max-parts had a few
issues that would prevent us from compiling it. Instead of changing the
code provided by the submitter, we're addressing them in a separate
commit to maintain the DCO.
Signed-off-by: Joao Eduardo Luis <... |
ModuleExport void UnregisterUndefinedImage(void)
{
} | 0 | [
"CWE-200",
"CWE-362"
] | ImageMagick | 01faddbe2711a4156180c4a92837e2f23683cc68 | 96,708,663,326,456,770,000,000,000,000,000,000,000 | 3 | Use the correct rights. |
static int tls1_alpn_handle_client_hello(SSL *s, PACKET *pkt, int *al)
{
PACKET protocol_list, save_protocol_list, protocol;
*al = SSL_AD_DECODE_ERROR;
if (!PACKET_as_length_prefixed_2(pkt, &protocol_list)
|| PACKET_remaining(&protocol_list) < 2) {
return 0;
}
save_protocol_list =... | 0 | [
"CWE-20"
] | openssl | 4ad93618d26a3ea23d36ad5498ff4f59eff3a4d2 | 224,654,170,749,654,900,000,000,000,000,000,000,000 | 28 | Don't change the state of the ETM flags until CCS processing
Changing the ciphersuite during a renegotiation can result in a crash
leading to a DoS attack. ETM has not been implemented in 1.1.0 for DTLS
so this is TLS only.
The problem is caused by changing the flag indicating whether to use ETM
or not immediately on... |
static double mp_self_map_vector_v(_cimg_math_parser& mp) { // Vector += vector
unsigned int
ptrd = (unsigned int)mp.opcode[1] + 1,
siz = (unsigned int)mp.opcode[2],
ptrs = (unsigned int)mp.opcode[4] + 1;
mp_func op = (mp_func)mp.opcode[3];
CImg<ulongT> l_opc... | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 295,452,241,023,526,800,000,000,000,000,000,000,000 | 13 | Fix other issues in 'CImg<T>::load_bmp()'. |
static int fastrpc_dma_buf_attach(struct dma_buf *dmabuf,
struct dma_buf_attachment *attachment)
{
struct fastrpc_dma_buf_attachment *a;
struct fastrpc_buf *buffer = dmabuf->priv;
int ret;
a = kzalloc(sizeof(*a), GFP_KERNEL);
if (!a)
return -ENOMEM;
ret = dma_get_sgtable(buffer->dev, &a->sgt, buffer->vi... | 1 | [
"CWE-400",
"CWE-401"
] | linux | fc739a058d99c9297ef6bfd923b809d85855b9a9 | 144,310,532,328,839,810,000,000,000,000,000,000,000 | 28 | misc: fastrpc: prevent memory leak in fastrpc_dma_buf_attach
In fastrpc_dma_buf_attach if dma_get_sgtable fails the allocated memory
for a should be released.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Link: https://lore.kernel.org/r/20190925152742.16258-1-navid.emamdoost@gmail.com
Signed-off-by: Greg... |
::testing::AssertionResult operator()(const char *, const T &value) const {
::testing::AssertionResult result = check_write<char>(value, "char");
return result ? check_write<wchar_t>(value, "wchar_t") : result;
} | 0 | [
"CWE-134",
"CWE-119",
"CWE-787"
] | fmt | 8cf30aa2be256eba07bb1cefb998c52326e846e7 | 40,198,368,437,229,983,000,000,000,000,000,000,000 | 4 | Fix segfault on complex pointer formatting (#642) |
static int randstring(char *target, unsigned int min, unsigned int max) {
int p = 0;
int len = min+rand()%(max-min+1);
int minval, maxval;
switch(rand() % 3) {
case 0:
minval = 0;
maxval = 255;
break;
case 1:
minval = 48;
maxval = 122;
break;
case 2:
... | 0 | [
"CWE-190"
] | redis | f6a40570fa63d5afdd596c78083d754081d80ae3 | 138,102,221,595,365,540,000,000,000,000,000,000,000 | 25 | Fix ziplist and listpack overflows and truncations (CVE-2021-32627, CVE-2021-32628)
- fix possible heap corruption in ziplist and listpack resulting by trying to
allocate more than the maximum size of 4GB.
- prevent ziplist (hash and zset) from reaching size of above 1GB, will be
converted to HT encoding, that's n... |
OVS_REQUIRES(ct->ct_lock)
{
hmap_remove(&ct->zone_limits, &zl->node);
free(zl);
} | 0 | [
"CWE-400"
] | ovs | 79349cbab0b2a755140eedb91833ad2760520a83 | 242,921,071,591,816,570,000,000,000,000,000,000,000 | 5 | 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... |
GF_Err ssix_box_read(GF_Box *s, GF_BitStream *bs)
{
u32 i,j;
GF_SubsegmentIndexBox *ptr = (GF_SubsegmentIndexBox*)s;
ISOM_DECREASE_SIZE(ptr, 4)
ptr->subsegment_count = gf_bs_read_u32(bs);
//each subseg has at least one range_count (4 bytes), abort if not enough bytes (broken box)
if (ptr->size < ptr->subsegment... | 0 | [
"CWE-787"
] | gpac | 388ecce75d05e11fc8496aa4857b91245007d26e | 334,845,234,980,822,900,000,000,000,000,000,000,000 | 31 | fixed #1587 |
static int __dccp_feat_activate(struct sock *sk, const int idx,
const bool is_local, dccp_feat_val const *fval)
{
bool rx;
u64 val;
if (idx < 0 || idx >= DCCP_FEAT_SUPPORTED_MAX)
return -1;
if (dccp_feat_table[idx].activation_hdlr == NULL)
return 0;
if (fval == NULL) {
val = dccp_feat_table[idx].defaul... | 0 | [
"CWE-401"
] | linux | 1d3ff0950e2b40dc861b1739029649d03f591820 | 170,757,646,472,769,750,000,000,000,000,000,000,000 | 38 | dccp: Fix memleak in __feat_register_sp
If dccp_feat_push_change fails, we forget free the mem
which is alloced by kmemdup in dccp_feat_clone_sp_val.
Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: e8ef967a54f4 ("dccp: Registration routines for changing feature values")
Reviewed-by: Mukesh Ojha <mojha@codeaurora.o... |
z_check_file_permissions(gs_memory_t *mem, const char *fname, const int len, const char *permission)
{
i_ctx_t *i_ctx_p = get_minst_from_memory(mem)->i_ctx_p;
gs_parsed_file_name_t pname;
const char *permitgroup = permission[0] == 'r' ? "PermitFileReading" : "PermitFileWriting";
int code = gs_parse_file... | 1 | [
"CWE-200"
] | ghostpdl | b60d50b7567369ad856cebe1efb6cd7dd2284219 | 165,434,629,871,372,930,000,000,000,000,000,000,000 | 15 | Bug 697193: status operator honour SAFER option |
int main(int argc, char **argv)
{
BIO *bio_err;
bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
CRYPTO_malloc_debug_init();
CRYPTO_dbg_set_options(V_CRYPTO_MDEBUG_ALL);
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
ERR_load_crypto_strings();
/* "Negative" test, expect a mismatch */
if(run_srp("alice", "password1", "pass... | 0 | [] | openssl | edc032b5e3f3ebb1006a9c89e0ae00504f47966f | 334,602,765,464,397,700,000,000,000,000,000,000,000 | 32 | Add SRP support. |
uint32_t mobi_get_orth_entry_length(const MOBIIndexEntry *entry) {
uint32_t entry_textlen;
MOBI_RET ret = mobi_get_indxentry_tagvalue(&entry_textlen, entry, INDX_TAG_ORTH_LENGTH);
if (ret != MOBI_SUCCESS) {
return MOBI_NOTSET;
}
return entry_textlen;
} | 0 | [
"CWE-125",
"CWE-787"
] | libmobi | eafc415bc6067e72577f70d6dd5acbf057ce6e6f | 57,179,491,527,465,200,000,000,000,000,000,000,000 | 10 | Fix wrong boundary checks in inflections parser resulting in stack buffer over-read with corrupt input |
inline void perf_swevent_put_recursion_context(int rctx)
{
struct swevent_htable *swhash = this_cpu_ptr(&swevent_htable);
put_recursion_context(swhash->recursion, rctx);
} | 0 | [
"CWE-284",
"CWE-264"
] | linux | f63a8daa5812afef4f06c962351687e1ff9ccb2b | 33,818,836,664,796,826,000,000,000,000,000,000,000 | 6 | perf: Fix event->ctx locking
There have been a few reported issues wrt. the lack of locking around
changing event->ctx. This patch tries to address those.
It avoids the whole rwsem thing; and while it appears to work, please
give it some thought in review.
What I did fail at is sensible runtime checks on the use of
... |
static int unix_dgram_peer_wake_me(struct sock *sk, struct sock *other)
{
int connected;
connected = unix_dgram_peer_wake_connect(sk, other);
/* If other is SOCK_DEAD, we want to make sure we signal
* POLLOUT, such that a subsequent write() can get a
* -ECONNREFUSED. Otherwise, if we haven't queued any skbs
... | 0 | [
"CWE-362"
] | linux | cbcf01128d0a92e131bd09f1688fe032480b65ca | 263,061,593,178,650,180,000,000,000,000,000,000,000 | 19 | af_unix: fix garbage collect vs MSG_PEEK
unix_gc() assumes that candidate sockets can never gain an external
reference (i.e. be installed into an fd) while the unix_gc_lock is
held. Except for MSG_PEEK this is guaranteed by modifying inflight
count under the unix_gc_lock.
MSG_PEEK does not touch any variable protec... |
int gg_send_packet(struct gg_session *sess, int type, ...)
{
struct gg_header *h;
char *tmp;
unsigned int tmp_length;
void *payload;
unsigned int payload_length;
va_list ap;
int res;
gg_debug_session(sess, GG_DEBUG_FUNCTION, "** gg_send_packet(%p, 0x%.2x, ...);\n", sess, type);
tmp_length = sizeof(struct gg_... | 0 | [
"CWE-310"
] | libgadu | 23644f1fb8219031b3cac93289a588b05f90226b | 73,213,885,835,469,380,000,000,000,000,000,000,000 | 69 | Poprawka ograniczania długości opisu. |
int cmp_item_time::cmp(Item *arg)
{
const bool rc= value != arg->val_time_packed(current_thd);
return (m_null_value || arg->null_value) ? UNKNOWN : rc;
} | 0 | [
"CWE-617"
] | server | 807945f2eb5fa22e6f233cc17b85a2e141efe2c8 | 74,698,051,251,667,560,000,000,000,000,000,000,000 | 5 | 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 void __netdev_adjacent_dev_unlink_neighbour(struct net_device *dev,
struct net_device *upper_dev)
{
__netdev_adjacent_dev_unlink(dev, upper_dev);
__netdev_adjacent_dev_unlink_lists(dev, upper_dev,
&dev->adj_list.upper,
&upper_dev->adj_list.lower); | 0 | [
"CWE-400",
"CWE-703"
] | linux | fac8e0f579695a3ecbc4d3cac369139d7f819971 | 323,546,161,257,309,900,000,000,000,000,000,000,000 | 8 | tunnels: Don't apply GRO to multiple layers of encapsulation.
When drivers express support for TSO of encapsulated packets, they
only mean that they can do it for one layer of encapsulation.
Supporting additional levels would mean updating, at a minimum,
more IP length fields and they are unaware of this.
No encapsul... |
message_add_overwrite_header (SoupMessage *msg,
gboolean overwrite)
{
soup_message_headers_append (msg->request_headers,
"Overwrite",
overwrite ? "T" : "F");
} | 0 | [] | gvfs | f81ff2108ab3b6e370f20dcadd8708d23f499184 | 181,381,400,065,573,200,000,000,000,000,000,000,000 | 7 | dav: don't unescape the uri twice
path_equal tries to unescape path before comparing. Unfortunately
this function is used also for already unescaped paths. Therefore
unescaping can fail. This commit reverts changes which was done in
commit 50af53d and unescape just uris, which aren't unescaped yet.
https://bugzilla.g... |
static int nfs4_xdr_dec_remove(struct rpc_rqst *rqstp, __be32 *p, struct nfs_removeres *res)
{
struct xdr_stream xdr;
struct compound_hdr hdr;
int status;
xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p);
if ((status = decode_compound_hdr(&xdr, &hdr)) != 0)
goto out;
if ((status = decode_putfh(&xdr)) != 0)
goto... | 0 | [
"CWE-703"
] | linux | dc0b027dfadfcb8a5504f7d8052754bf8d501ab9 | 308,178,286,492,292,840,000,000,000,000,000,000,000 | 17 | NFSv4: Convert the open and close ops to use fmode
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> |
Document getSpec() {
return DOC("input" << DOC_ARRAY(DOC_ARRAY(1 << 2 << 2) << DOC_ARRAY(1)) << "expected"
<< DOC("$setIsSubset" << false << "$setEquals" << false
<< "$setIntersection"
... | 0 | [
"CWE-835"
] | mongo | 0a076417d1d7fba3632b73349a1fd29a83e68816 | 264,668,036,773,332,100,000,000,000,000,000,000,000 | 10 | SERVER-38070 fix infinite loop in agg expression |
kvm_calc_tdp_mmu_root_page_role(struct kvm_vcpu *vcpu,
struct kvm_mmu_role_regs *regs, bool base_only)
{
union kvm_mmu_role role = kvm_calc_mmu_role_common(vcpu, regs, base_only);
role.base.ad_disabled = (shadow_accessed_mask == 0);
role.base.level = kvm_mmu_get_tdp_level(vcpu);
role.base.direct = true;
role.... | 0 | [
"CWE-476"
] | linux | 9f46c187e2e680ecd9de7983e4d081c3391acc76 | 280,113,999,294,457,500,000,000,000,000,000,000,000 | 12 | KVM: x86/mmu: fix NULL pointer dereference on guest INVPCID
With shadow paging enabled, the INVPCID instruction results in a call
to kvm_mmu_invpcid_gva. If INVPCID is executed with CR0.PG=0, the
invlpg callback is not set and the result is a NULL pointer dereference.
Fix it trivially by checking for mmu->invlpg befo... |
static void incoming_probe(AvahiServer *s, AvahiRecord *record, AvahiInterface *i) {
AvahiEntry *e, *n;
int ours = 0, won = 0, lost = 0;
assert(s);
assert(record);
assert(i);
/* Handle incoming probes and check if they conflict our own probes */
for (e = avahi_hashmap_lookup(s->entries_by... | 0 | [
"CWE-399"
] | avahi | 3093047f1aa36bed8a37fa79004bf0ee287929f4 | 274,563,230,254,037,700,000,000,000,000,000,000,000 | 44 | Don't get confused by UDP packets with a source port that is zero
This is a fix for rhbz 475394.
Problem identified by Hugo Dias. |
GF_BitStream *gf_bs_new_cbk(GF_Err (*on_block_out)(void *cbk, u8 *data, u32 block_size), void *usr_data, u32 block_size)
{
return gf_bs_new_cbk_buffer(on_block_out, usr_data, NULL, block_size);
} | 0 | [
"CWE-617",
"CWE-703"
] | gpac | 9ea93a2ec8f555ceed1ee27294cf94822f14f10f | 52,733,131,115,282,970,000,000,000,000,000,000,000 | 5 | fixed #2165 |
void minf_del(GF_Box *s)
{
GF_MediaInformationBox *ptr = (GF_MediaInformationBox *)s;
if (ptr == NULL) return;
//if we have a Handler not self-contained, delete it (the self-contained belongs to the movie)
if (ptr->dataHandler) {
gf_isom_datamap_close(ptr);
}
if (ptr->InfoHeader) gf_isom_box_del((GF_Box *)ptr-... | 0 | [
"CWE-400",
"CWE-401"
] | gpac | d2371b4b204f0a3c0af51ad4e9b491144dd1225c | 256,674,550,784,849,060,000,000,000,000,000,000,000 | 14 | prevent dref memleak on invalid input (#1183) |
static bool checkreturn decode_extension(pb_istream_t *stream,
uint32_t tag, pb_wire_type_t wire_type, pb_extension_t *extension)
{
size_t pos = stream->bytes_left;
while (extension != NULL && pos == stream->bytes_left)
{
bool status;
if (extension->type->decode)
status ... | 0 | [
"CWE-763"
] | nanopb | e2f0ccf939d9f82931d085acb6df8e9a182a4261 | 225,116,914,994,178,660,000,000,000,000,000,000,000 | 21 | Fix invalid free() with oneof (#647)
Nanopb would call free() or realloc() on an invalid
(attacker controlled) pointer value when all the following
conditions are true:
- PB_ENABLE_MALLOC is defined at the compile time
- Message definition contains an oneof field, and the oneof
contains at least one pointer type fi... |
bool lftp_ssl_openssl::want_in()
{
return SSL_want_read(ssl);
} | 0 | [
"CWE-310"
] | lftp | 6357bed2583171b7515af6bb6585cf56d2117e3f | 77,576,719,367,272,140,000,000,000,000,000,000,000 | 4 | use hostmatch function from latest curl (addresses CVE-2014-0139) |
static void key_search_validate(struct extent_buffer *b,
struct btrfs_key *key,
int level)
{
#ifdef CONFIG_BTRFS_ASSERT
struct btrfs_disk_key disk_key;
btrfs_cpu_key_to_disk(&disk_key, key);
if (level == 0)
ASSERT(!memcmp_extent_buffer(b, &disk_key,
offsetof(struct btrfs_leaf, items[0].key),
... | 0 | [
"CWE-416",
"CWE-362"
] | linux | 5f5bc6b1e2d5a6f827bc860ef2dc5b6f365d1339 | 287,496,713,614,702,560,000,000,000,000,000,000,000 | 19 | Btrfs: make xattr replace operations atomic
Replacing a xattr consists of doing a lookup for its existing value, delete
the current value from the respective leaf, release the search path and then
finally insert the new value. This leaves a time window where readers (getxattr,
listxattrs) won't see any value for the x... |
parse_vlan(const void **datap, size_t *sizep, union flow_vlan_hdr *vlan_hdrs)
{
const ovs_be16 *eth_type;
data_pull(datap, sizep, ETH_ADDR_LEN * 2);
eth_type = *datap;
size_t n;
for (n = 0; eth_type_vlan(*eth_type) && n < flow_vlan_limit; n++) {
if (OVS_UNLIKELY(*sizep < sizeof(ovs_be32) ... | 0 | [
"CWE-400"
] | ovs | 79349cbab0b2a755140eedb91833ad2760520a83 | 318,933,919,578,963,540,000,000,000,000,000,000,000 | 22 | 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... |
GF_Err moov_box_read(GF_Box *s, GF_BitStream *bs)
{
return gf_isom_box_array_read(s, bs);
} | 0 | [
"CWE-476",
"CWE-787"
] | gpac | b8f8b202d4fc23eb0ab4ce71ae96536ca6f5d3f8 | 225,040,920,280,406,540,000,000,000,000,000,000,000 | 4 | fixed #1757 |
f_swapinfo(typval_T *argvars, typval_T *rettv)
{
if (rettv_dict_alloc(rettv) == OK)
get_b0_dict(tv_get_string(argvars), rettv->vval.v_dict);
} | 0 | [
"CWE-78"
] | vim | 8c62a08faf89663e5633dc5036cd8695c80f1075 | 247,802,271,589,428,150,000,000,000,000,000,000,000 | 5 | patch 8.1.0881: can execute shell commands in rvim through interfaces
Problem: Can execute shell commands in rvim through interfaces.
Solution: Disable using interfaces in restricted mode. Allow for writing
file with writefile(), histadd() and a few others. |
static void hci_cc_read_bd_addr(struct hci_dev *hdev, struct sk_buff *skb)
{
struct hci_rp_read_bd_addr *rp = (void *) skb->data;
BT_DBG("%s status 0x%2.2x", hdev->name, rp->status);
if (rp->status)
return;
if (test_bit(HCI_INIT, &hdev->flags))
bacpy(&hdev->bdaddr, &rp->bdaddr);
if (hci_dev_test_flag(hdev,... | 0 | [
"CWE-290"
] | linux | 3ca44c16b0dcc764b641ee4ac226909f5c421aa3 | 255,988,954,814,843,000,000,000,000,000,000,000,000 | 15 | Bluetooth: Consolidate encryption handling in hci_encrypt_cfm
This makes hci_encrypt_cfm calls hci_connect_cfm in case the connection
state is BT_CONFIG so callers don't have to check the state.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org> |
*/
static void
xmlXPathCompLiteral(xmlXPathParserContextPtr ctxt) {
const xmlChar *q;
xmlChar *ret = NULL;
if (CUR == '"') {
NEXT;
q = CUR_PTR;
while ((IS_CHAR_CH(CUR)) && (CUR != '"'))
NEXT;
if (!IS_CHAR_CH(CUR)) {
XP_ERROR(XPATH_UNFINISHED_LITERAL_ERROR);
} else {
ret = xmlStr... | 0 | [
"CWE-119"
] | libxml2 | 91d19754d46acd4a639a8b9e31f50f31c78f8c9c | 40,778,933,176,898,385,000,000,000,000,000,000,000 | 34 | Fix the semantic of XPath axis for namespace/attribute context nodes
The processing of namespace and attributes nodes was not compliant
to the XPath-1.0 specification |
connection_dir_process_inbuf(dir_connection_t *conn)
{
tor_assert(conn);
tor_assert(conn->_base.type == CONN_TYPE_DIR);
/* Directory clients write, then read data until they receive EOF;
* directory servers read data until they get an HTTP command, then
* write their response (when it's finished flushing, ... | 0 | [] | tor | 973c18bf0e84d14d8006a9ae97fde7f7fb97e404 | 12,513,859,402,908,774,000,000,000,000,000,000,000 | 31 | Fix assertion failure in tor_timegm.
Fixes bug 6811. |
z2grestoreall(i_ctx_t *i_ctx_p)
{
for (;;) {
int code = restore_page_device(i_ctx_p, igs, gs_gstate_saved(igs));
if (code < 0) return code;
if (code == 0) {
bool done = !gs_gstate_saved(gs_gstate_saved(igs));
gs_grestore(igs);
if (done)
br... | 0 | [] | ghostpdl | 643b24dbd002fb9c131313253c307cf3951b3d47 | 252,844,493,665,497,900,000,000,000,000,000,000,000 | 16 | Bug 699718(2): Improve/augment stack size checking
Improve the rebustness of the previous solution (previously it could trigger an
error when there *was* stack capacity available).
Remove redundant check: we don't need to check if the *current* stack size is
sufficient, before checking the maximum permitted stack siz... |
static int io_fadvise(struct io_kiocb *req, bool force_nonblock)
{
struct io_fadvise *fa = &req->fadvise;
int ret;
if (force_nonblock) {
switch (fa->advice) {
case POSIX_FADV_NORMAL:
case POSIX_FADV_RANDOM:
case POSIX_FADV_SEQUENTIAL:
break;
default:
return -EAGAIN;
}
}
ret = vfs_fadvise(req->f... | 0 | [] | linux | 0f2122045b946241a9e549c2a76cea54fa58a7ff | 33,431,111,258,213,020,000,000,000,000,000,000,000 | 22 | 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 const char *am_get_idp(request_rec *r)
{
LassoServer *server;
const char *idp_provider_id;
server = am_get_lasso_server(r);
if (server == NULL)
return NULL;
/*
* If we have a single IdP, return that one.
*/
if (g_hash_table_size(server->providers) == 1)
return ... | 0 | [] | mod_auth_mellon | 6bdda9170a8f1757dabc5b109958657417728018 | 196,713,826,236,277,240,000,000,000,000,000,000,000 | 50 | Fix segmentation fault when receiving badly formed logout message.
If the logout message is badly formed, we won't get the entityID in
`logout->parent.remote_providerID`. If we call `apr_hash_get()` with a
null pointer, it will cause a segmentation fault.
Add a check to validate that the entityID is correctly set. |
static void array_move(json_array_t *array, size_t dest,
size_t src, size_t count)
{
memmove(&array->table[dest], &array->table[src], count * sizeof(json_t *));
} | 0 | [
"CWE-310"
] | jansson | 8f80c2d83808150724d31793e6ade92749b1faa4 | 151,998,563,155,535,030,000,000,000,000,000,000,000 | 5 | CVE-2013-6401: Change hash function, randomize hashes
Thanks to Florian Weimer and Eric Sesterhenn for reporting, reviewing
and testing. |
display_epoch_time(gchar *buf, int buflen, const time_t sec, gint32 frac,
const to_str_time_res_t units)
{
double elapsed_secs;
elapsed_secs = difftime(sec,(time_t)0);
/* This code copied from display_signed_time; keep it in case anyone
is looking at captures from before 1970 (???).
If the fractional par... | 0 | [
"CWE-125"
] | wireshark | d5f2657825e63e4126ebd7d13a59f3c6e8a9e4e1 | 225,988,952,967,224,240,000,000,000,000,000,000,000 | 51 | epan: Limit our bits in decode_bits_in_field.
Limit the number of bits we process in decode_bits_in_field, otherwise
we'll overrun our buffer. Fixes #16958. |
static double mp_vector_map_sv(_cimg_math_parser& mp) { // Operator(scalar,vector)
unsigned int
siz = (unsigned int)mp.opcode[2],
ptrs = (unsigned int)mp.opcode[5] + 1;
double *ptrd = &_mp_arg(1) + 1;
mp_func op = (mp_func)mp.opcode[3];
CImg<ulongT> l_opcode(4)... | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 117,682,735,867,303,200,000,000,000,000,000,000,000 | 14 | Fix other issues in 'CImg<T>::load_bmp()'. |
static int xen_irq_info_virq_setup(unsigned cpu,
unsigned irq,
evtchn_port_t evtchn,
unsigned virq)
{
struct irq_info *info = info_for_irq(irq);
info->u.virq = virq;
per_cpu(virq_to_irq, cpu)[virq] = irq;
return xen_irq_info_common_setup(info, irq, IRQT_VIRQ, evtchn, 0);
} | 0 | [
"CWE-400",
"CWE-703"
] | linux | e99502f76271d6bc4e374fe368c50c67a1fd3070 | 42,666,548,010,312,700,000,000,000,000,000,000,000 | 13 | xen/events: defer eoi in case of excessive number of events
In case rogue guests are sending events at high frequency it might
happen that xen_evtchn_do_upcall() won't stop processing events in
dom0. As this is done in irq handling a crash might be the result.
In order to avoid that, delay further inter-domain events... |
static void add_softcursor(struct vc_data *vc)
{
int i = scr_readw((u16 *) vc->vc_pos);
u32 type = vc->vc_cursor_type;
if (! (type & 0x10)) return;
if (softcursor_original != -1) return;
softcursor_original = i;
i |= ((type >> 8) & 0xff00 );
i ^= ((type) & 0xff00 );
if ((type & 0x20) && ((softcursor_original &... | 0 | [
"CWE-416",
"CWE-362"
] | linux | ca4463bf8438b403596edd0ec961ca0d4fbe0220 | 16,873,524,303,530,494,000,000,000,000,000,000,000 | 16 | vt: vt_ioctl: fix VT_DISALLOCATE freeing in-use virtual console
The VT_DISALLOCATE ioctl can free a virtual console while tty_release()
is still running, causing a use-after-free in con_shutdown(). This
occurs because VT_DISALLOCATE considers a virtual console's
'struct vc_data' to be unused as soon as the correspond... |
static int zp_probe(struct hid_device *hdev, const struct hid_device_id *id)
{
int ret;
ret = hid_parse(hdev);
if (ret) {
hid_err(hdev, "parse failed\n");
goto err;
}
ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF);
if (ret) {
hid_err(hdev, "hw start failed\n");
goto err;
}
zpff_init(... | 0 | [
"CWE-787"
] | linux | d9d4b1e46d9543a82c23f6df03f4ad697dab361b | 199,248,549,767,136,860,000,000,000,000,000,000,000 | 22 | HID: Fix assumption that devices have inputs
The syzbot fuzzer found a slab-out-of-bounds write bug in the hid-gaff
driver. The problem is caused by the driver's assumption that the
device must have an input report. While this will be true for all
normal HID input devices, a suitably malicious device can violate the... |
void PSOutputDev::startPage(int pageNum, GfxState *state) {
int x1, y1, x2, y2, width, height;
int imgWidth, imgHeight, imgWidth2, imgHeight2;
GBool landscape;
if (mode == psModePS || mode == psModePSOrigPageSizes) {
GooString pageLabel;
const GBool gotLabel = m_catalog->indexToLabel(pageNum -1, &page... | 0 | [] | poppler | abf167af8b15e5f3b510275ce619e6fdb42edd40 | 102,867,622,997,733,500,000,000,000,000,000,000,000 | 213 | Implement tiling/patterns in SplashOutputDev
Fixes bug 13518 |
static int reencrypt_make_backup_segments(struct crypt_device *cd,
struct luks2_hdr *hdr,
int keyslot_new,
const char *cipher,
uint64_t data_offset,
const struct crypt_params_reencrypt *params)
{
int r, segment, moved_segment = -1, digest_old = -1, digest_new = -1;
json_object *jobj_segment_new = NULL, *job... | 0 | [
"CWE-345"
] | cryptsetup | 0113ac2d889c5322659ad0596d4cfc6da53e356c | 2,280,049,036,320,590,700,000,000,000,000,000,000 | 113 | Fix CVE-2021-4122 - LUKS2 reencryption crash recovery attack
Fix possible attacks against data confidentiality through LUKS2 online
reencryption extension crash recovery.
An attacker can modify on-disk metadata to simulate decryption in
progress with crashed (unfinished) reencryption step and persistently
decrypt par... |
bool Item_field::rename_fields_processor(void *arg)
{
Item::func_processor_rename *rename= (Item::func_processor_rename*) arg;
List_iterator<Create_field> def_it(rename->fields);
Create_field *def;
while ((def=def_it++))
{
if (def->change &&
(!db_name || !db_name[0] ||
!my_strcasecmp(tab... | 0 | [
"CWE-89"
] | server | b5e16a6e0381b28b598da80b414168ce9a5016e5 | 177,365,960,666,254,180,000,000,000,000,000,000,000 | 21 | MDEV-26061 MariaDB server crash at Field::set_default
* Item_default_value::fix_fields creates a copy of its argument's field.
* Field::default_value is changed when its expression is prepared in
unpack_vcol_info_from_frm()
This means we must unpack any vcol expression that includes DEFAULT(x)
strictly after unpack... |
regset_search_body_position_lead(OnigRegSet* set,
const UChar* str, const UChar* end,
const UChar* start, const UChar* range, /* match start range */
const UChar* orig_range, /* data range */
OnigOptionType option, MatchArg* msas, int* rmatch_pos)
{
int r, n, i;
UChar *s,... | 0 | [
"CWE-125"
] | oniguruma | 778a43dd56925ed58bbe26e3a7bb8202d72c3f3f | 23,821,324,843,431,746,000,000,000,000,000,000,000 | 162 | fix #164: Integer overflow related to reg->dmax in search_in_range() |
free_ldap_seqof_key_data(ldap_seqof_key_data *keysets, krb5_int16 n_keysets)
{
int i;
if (keysets == NULL)
return;
for (i = 0; i < n_keysets; i++)
k5_free_key_data(keysets[i].n_key_data, keysets[i].key_data);
free(keysets);
} | 0 | [
"CWE-703"
] | krb5 | 08c642c09c38a9c6454ab43a9b53b2a89b9eef99 | 81,573,998,750,165,290,000,000,000,000,000,000,000 | 11 | Fix LDAP null deref on empty arg [CVE-2016-3119]
In the LDAP KDB module's process_db_args(), strtok_r() may return NULL
if there is an empty string in the db_args array. Check for this case
and avoid dereferencing a null pointer.
CVE-2016-3119:
In MIT krb5 1.6 and later, an authenticated attacker with permission
to... |
create_code(struct archive_read *a, struct huffman_code *code,
unsigned char *lengths, int numsymbols, char maxlength)
{
int i, j, codebits = 0, symbolsleft = numsymbols;
code->numentries = 0;
code->numallocatedentries = 0;
if (new_node(code) < 0) {
archive_set_error(&a->archive, ENOMEM,
... | 0 | [
"CWE-119",
"CWE-787"
] | libarchive | 05caadc7eedbef471ac9610809ba683f0c698700 | 191,908,602,618,180,500,000,000,000,000,000,000,000 | 30 | Issue 719: Fix for TALOS-CAN-154
A RAR file with an invalid zero dictionary size was not being
rejected, leading to a zero-sized allocation for the dictionary
storage which was then overwritten during the dictionary initialization.
Thanks to the Open Source and Threat Intelligence project at Cisco for
reporting this... |
void CLASS leaf_hdr_load_raw()
{
ushort *pixel=0;
unsigned tile=0, r, c, row, col;
if (!filters) {
pixel = (ushort *) calloc (raw_width, sizeof *pixel);
merror (pixel, "leaf_hdr_load_raw()");
}
#ifdef LIBRAW_LIBRARY_BUILD
try {
#endif
FORC(tiff_samples)
for (r=0; r < raw_height; r++) {
#ifdef L... | 1 | [
"CWE-369",
"CWE-704"
] | LibRaw | 9f26ce37f5be86ea11bfc6831366558650b1f6ff | 64,223,732,535,727,770,000,000,000,000,000,000,000 | 40 | SA81000: LibRaw 0.18.8 |
static void auth_passdb_init(struct auth_passdb *passdb)
{
passdb_init(passdb->passdb);
i_assert(passdb->passdb->default_pass_scheme != NULL ||
passdb->cache_key == NULL);
} | 0 | [
"CWE-284"
] | core | 7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904 | 247,763,943,667,031,200,000,000,000,000,000,000,000 | 7 | auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter
The passdb was wrongly deduplicated in this situation, causing wrong
mechanisms or username_filter setting to be used. This would be a rather
unlikely configuration though.
Fixed by moving mechanisms and username_filter fro... |
int snd_usb_lock_shutdown(struct snd_usb_audio *chip)
{
int err;
atomic_inc(&chip->usage_count);
if (atomic_read(&chip->shutdown)) {
err = -EIO;
goto error;
}
err = snd_usb_autoresume(chip);
if (err < 0)
goto error;
return 0;
error:
if (atomic_dec_and_test(&chip->usage_count))
wake_up(&chip->shutdown... | 0 | [
"CWE-284",
"CWE-125"
] | linux | bfc81a8bc18e3c4ba0cbaa7666ff76be2f998991 | 79,771,414,752,410,470,000,000,000,000,000,000,000 | 19 | ALSA: usb-audio: Check out-of-bounds access by corrupted buffer descriptor
When a USB-audio device receives a maliciously adjusted or corrupted
buffer descriptor, the USB-audio driver may access an out-of-bounce
value at its parser. This was detected by syzkaller, something like:
BUG: KASAN: slab-out-of-bounds in ... |
dns_zone_getjournalsize(dns_zone_t *zone) {
REQUIRE(DNS_ZONE_VALID(zone));
return (zone->journalsize);
} | 0 | [
"CWE-327"
] | bind9 | f09352d20a9d360e50683cd1d2fc52ccedcd77a0 | 321,390,497,177,831,360,000,000,000,000,000,000,000 | 5 | Update keyfetch_done compute_tag check
If in keyfetch_done the compute_tag fails (because for example the
algorithm is not supported), don't crash, but instead ignore the
key. |
static int sas_recover_I_T(struct domain_device *dev)
{
int res = TMF_RESP_FUNC_FAILED;
struct sas_internal *i =
to_sas_internal(dev->port->ha->core.shost->transportt);
SAS_DPRINTK("I_T nexus reset for dev %016llx\n",
SAS_ADDR(dev->sas_addr));
if (i->dft->lldd_I_T_nexus_reset)
res = i->dft->lldd_I_T_nex... | 0 | [] | linux | 318aaf34f1179b39fa9c30fa0f3288b645beee39 | 281,529,313,678,885,400,000,000,000,000,000,000,000 | 14 | scsi: libsas: defer ata device eh commands to libata
When ata device doing EH, some commands still attached with tasks are
not passed to libata when abort failed or recover failed, so libata did
not handle these commands. After these commands done, sas task is freed,
but ata qc is not freed. This will cause ata qc lea... |
template<typename tc1, typename tc2, typename t>
CImg<T>& _draw_text(const int x0, const int y0,
const char *const text,
const tc1 *const foreground_color, const tc2 *const background_color,
const float opacity, const CImgList<t>& font,
... | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 300,557,687,005,963,300,000,000,000,000,000,000,000 | 60 | Fix other issues in 'CImg<T>::load_bmp()'. |
Item_string(const char *name_par, const char *str, uint length,
CHARSET_INFO *cs, Derivation dv= DERIVATION_COERCIBLE,
uint repertoire= MY_REPERTOIRE_UNICODE30)
: m_cs_specified(FALSE)
{
str_value.set_or_copy_aligned(str, length, cs);
collation.set(cs, dv, repertoire);
ma... | 0 | [] | mysql-server | f7316aa0c9a3909fc7498e7b95d5d3af044a7e21 | 205,849,913,366,367,560,000,000,000,000,000,000,000 | 13 | Bug#26361149 MYSQL SERVER CRASHES AT: COL IN(IFNULL(CONST,
COL), NAME_CONST('NAME', NULL))
Backport of Bug#19143243 fix.
NAME_CONST item can return NULL_ITEM type in case of incorrect arguments.
NULL_ITEM has special processing in Item_func_in function.
In Item_func_in::fix_length_and_dec an a... |
static int tipc_shutdown(struct socket *sock, int how)
{
struct sock *sk = sock->sk;
struct net *net = sock_net(sk);
struct tipc_sock *tsk = tipc_sk(sk);
struct sk_buff *skb;
u32 dnode = tsk_peer_node(tsk);
u32 dport = tsk_peer_port(tsk);
u32 onode = tipc_own_addr(net);
u32 oport = tsk->portid;
int res;
if (... | 0 | [
"CWE-703"
] | linux | 45e093ae2830cd1264677d47ff9a95a71f5d9f9c | 234,223,302,361,771,950,000,000,000,000,000,000,000 | 61 | tipc: check nl sock before parsing nested attributes
Make sure the socket for which the user is listing publication exists
before parsing the socket netlink attributes.
Prior to this patch a call without any socket caused a NULL pointer
dereference in tipc_nl_publ_dump().
Tested-and-reported-by: Baozeng Ding <splovi... |
BasicArrayWriter(Char *array, std::size_t size)
: BasicWriter<Char>(buffer_), buffer_(array, size) {} | 0 | [
"CWE-134",
"CWE-119",
"CWE-787"
] | fmt | 8cf30aa2be256eba07bb1cefb998c52326e846e7 | 108,315,919,303,561,820,000,000,000,000,000,000,000 | 2 | Fix segfault on complex pointer formatting (#642) |
static int hwsim_unicast_netgroup(struct mac80211_hwsim_data *data,
struct sk_buff *skb, int portid)
{
struct net *net;
bool found = false;
int res = -ENOENT;
rcu_read_lock();
for_each_net_rcu(net) {
if (data->netgroup == hwsim_net_get_netgroup(net)) {
res = genlmsg_unicast(net, skb, portid);
found ... | 0 | [
"CWE-703",
"CWE-772"
] | linux | 0ddcff49b672239dda94d70d0fcf50317a9f4b51 | 7,423,375,211,744,365,000,000,000,000,000,000,000 | 22 | mac80211_hwsim: fix possible memory leak in hwsim_new_radio_nl()
'hwname' is malloced in hwsim_new_radio_nl() and should be freed
before leaving from the error handling cases, otherwise it will cause
memory leak.
Fixes: ff4dd73dd2b4 ("mac80211_hwsim: check HWSIM_ATTR_RADIO_NAME length")
Signed-off-by: Wei Yongjun <we... |
int __init efi_memblock_x86_reserve_range(void)
{
struct efi_info *e = &boot_params.efi_info;
struct efi_memory_map_data data;
phys_addr_t pmap;
int rv;
if (efi_enabled(EFI_PARAVIRT))
return 0;
#ifdef CONFIG_X86_32
/* Can't handle data above 4GB at this time */
if (e->efi_memmap_hi) {
pr_err("Memory map is... | 0 | [
"CWE-388"
] | tip | 4e78921ba4dd0aca1cc89168f45039add4183f8e | 24,334,576,957,843,847,000,000,000,000,000,000,000 | 40 | efi/x86/Add missing error handling to old_memmap 1:1 mapping code
The old_memmap flow in efi_call_phys_prolog() performs numerous memory
allocations, and either does not check for failure at all, or it does
but fails to propagate it back to the caller, which may end up calling
into the firmware with an incomplete 1:1 ... |
networkstatus_parse_vote_from_string(const char *s, const char **eos_out,
networkstatus_type_t ns_type)
{
smartlist_t *tokens = smartlist_create();
smartlist_t *rs_tokens = NULL, *footer_tokens = NULL;
networkstatus_voter_info_t *voter = NULL;
networkstatus_t *ns = NULL;
d... | 0 | [
"CWE-399"
] | tor | 57e35ad3d91724882c345ac709666a551a977f0f | 182,402,160,074,870,680,000,000,000,000,000,000,000 | 536 | Avoid possible segfault when handling networkstatus vote with bad flavor
Fix for 6530; fix on 0.2.2.6-alpha. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.