func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
message_add_argument(
message_t *message,
char *key,
char *value)
{
int i = 0;
while (message->arg_array[i].key != NULL) {
if (strcmp(key, message->arg_array[i].key) == 0) {
assert(message->arg_array[i].value.type == MESSAGE_STRING);
g_free(message->arg_array[i].value.string);
messa... | 0 | [
"CWE-77"
] | amanda | 29bae2e271093cd8d06ea98f73a474c685c5a314 | 122,953,945,073,270,450,000,000,000,000,000,000,000 | 27 | * application-src/ambsdtar.c, application-src/amgtar.c,
application-src/amstar.c: Filter option from COMMAND-OPTIONS
* common-src/ammessage.c: Add message.
git-svn-id: https://svn.code.sf.net/p/amanda/code/amanda/trunk@6483 a8d146d6-cc15-0410-8900-af154a0219e0 |
void HGraphBuilder::VisitCompareOperation(CompareOperation* expr) {
ASSERT(!HasStackOverflow());
ASSERT(current_block() != NULL);
ASSERT(current_block()->HasPredecessor());
if (IsClassOfTest(expr)) {
CallRuntime* call = expr->left()->AsCallRuntime();
ASSERT(call->arguments()->length() == 1);
CHECK_A... | 0 | [] | node | fd80a31e0697d6317ce8c2d289575399f4e06d21 | 126,302,455,299,181,230,000,000,000,000,000,000,000 | 150 | deps: backport 5f836c from v8 upstream
Original commit message:
Fix Hydrogen bounds check elimination
When combining bounds checks, they must all be moved before the first load/store
that they are guarding.
BUG=chromium:344186
LOG=y
R=svenpanne@chromium.org
Review URL: https://coderevie... |
TORRENT_TEST(clear)
{
char b1[] = "d1:ai1e1:b3:foo1:cli1ei2ee1:dd1:xi1eee";
char b2[] = "li1ei2ee";
bdecode_node e;
error_code ec;
int ret = bdecode(b1, b1 + sizeof(b1)-1, e, ec);
printf("%s\n", print_entry(e).c_str());
TEST_EQUAL(ret, 0);
TEST_EQUAL(e.type(), bdecode_node::dict_t);
TEST_EQUAL(e.dict_size(), ... | 0 | [
"CWE-125"
] | libtorrent | ec30a5e9ec703afb8abefba757c6d401303b53db | 188,215,166,089,514,040,000,000,000,000,000,000,000 | 21 | fix out-of-bounds read in bdecode
Fixes #2099 |
save_config(
struct recvbuf *rbufp,
int restrict_mask
)
{
#ifdef SAVECONFIG
static const char savedconfig_eq[] = "savedconfig=";
/* Build a safe open mode from the available mode flags. We want
* to create a new file and write it in text mode (when
* applicable -- only Windows does this...)
*/
static const... | 0 | [
"CWE-254"
] | ntp | 3680c2e4d5f88905ce062c7b43305d610a2c9796 | 214,231,633,639,293,200,000,000,000,000,000,000,000 | 178 | [Bug 2938] ntpq saveconfig command allows dangerous characters in filenames.
- make sure the file does not exist (no overwrite allowed)
- ensure text mode where applicable (windows) |
std::string help() const override {
return "Returns information about roles.";
} | 0 | [
"CWE-613"
] | mongo | e55d6e2292e5dbe2f97153251d8193d1cc89f5d7 | 232,378,444,845,597,140,000,000,000,000,000,000,000 | 3 | SERVER-38984 Validate unique User ID on UserCache hit |
static void __init xen_hvm_init_mem_mapping(void)
{
early_memunmap(HYPERVISOR_shared_info, PAGE_SIZE);
HYPERVISOR_shared_info = __va(PFN_PHYS(shared_info_pfn));
/*
* The virtual address of the shared_info page has changed, so
* the vcpu_info pointer for VCPU 0 is now stale.
*
* The prepare_boot_cpu callback... | 0 | [] | linux | fa1f57421e0b1c57843902c89728f823abc32f02 | 114,760,246,957,238,110,000,000,000,000,000,000,000 | 18 | xen/virtio: Enable restricted memory access using Xen grant mappings
In order to support virtio in Xen guests add a config option XEN_VIRTIO
enabling the user to specify whether in all Xen guests virtio should
be able to access memory via Xen grant mappings only on the host side.
Also set PLATFORM_VIRTIO_RESTRICTED_M... |
unsigned int arpt_do_table(struct sk_buff *skb,
const struct nf_hook_state *state,
struct xt_table *table)
{
unsigned int hook = state->hook;
static const char nulldevname[IFNAMSIZ] __attribute__((aligned(sizeof(long))));
unsigned int verdict = NF_DROP;
const struct arphdr *arp;
struct arpt_entry *e, *... | 0 | [
"CWE-119"
] | nf-next | d7591f0c41ce3e67600a982bab6989ef0f07b3ce | 330,777,305,789,051,370,000,000,000,000,000,000,000 | 111 | netfilter: x_tables: introduce and use xt_copy_counters_from_user
The three variants use same copy&pasted code, condense this into a
helper and use that.
Make sure info.name is 0-terminated.
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> |
dissect_NOTIFY_INFO(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, dcerpc_info *di, guint8 *drep)
{
guint32 count;
offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep,
hf_notify_info_version, NULL);
offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep,
h... | 0 | [
"CWE-399"
] | wireshark | b4d16b4495b732888e12baf5b8a7e9bf2665e22b | 334,928,523,720,276,900,000,000,000,000,000,000,000 | 24 | SPOOLSS: Try to avoid an infinite loop.
Use tvb_reported_length_remaining in dissect_spoolss_uint16uni. Make
sure our offset always increments in dissect_spoolss_keybuffer.
Change-Id: I7017c9685bb2fa27161d80a03b8fca4ef630e793
Reviewed-on: https://code.wireshark.org/review/14687
Reviewed-by: Gerald Combs <gerald@wires... |
int MqttClient_Disconnect_ex(MqttClient *client, MqttDisconnect *disconnect)
{
int rc, len;
/* Validate required arguments */
if (client == NULL) {
return MQTT_CODE_ERROR_BAD_ARG;
}
#ifdef WOLFMQTT_V5
if (disconnect != NULL) {
/* Use specified protocol version if set */
dis... | 0 | [
"CWE-787"
] | wolfMQTT | 84d4b53122e0fa0280c7872350b89d5777dabbb2 | 272,833,391,788,824,500,000,000,000,000,000,000,000 | 52 | Fix wolfmqtt-fuzzer: Null-dereference WRITE in MqttProps_Free |
rl_get_keymap_by_name (name)
const char *name;
{
register int i;
for (i = 0; keymap_names[i].name; i++)
if (_rl_stricmp (name, keymap_names[i].name) == 0)
return (keymap_names[i].map);
return ((Keymap) NULL);
} | 0 | [] | bash | 955543877583837c85470f7fb8a97b7aa8d45e6c | 170,265,107,986,587,040,000,000,000,000,000,000,000 | 10 | bash-4.4-rc2 release |
int module_unload(
YR_OBJECT* module_object)
{
return ERROR_SUCCESS;
} | 0 | [
"CWE-416"
] | yara | 053e67e3ec81cc9268ce30eaf0d6663d8639ed1e | 260,761,590,134,713,870,000,000,000,000,000,000,000 | 5 | Fix issue #658 |
static __init int vdso_setup(void)
{
struct lib32_elfinfo v32;
struct lib64_elfinfo v64;
v32.hdr = vdso32_kbase;
#ifdef CONFIG_PPC64
v64.hdr = vdso64_kbase;
#endif
if (vdso_do_find_sections(&v32, &v64))
return -1;
if (vdso_fixup_datapage(&v32, &v64))
return -1;
if (vdso_fixup_features(&v32, &v64))
retur... | 0 | [
"CWE-20"
] | linux-2.6 | 89f5b7da2a6bad2e84670422ab8192382a5aeb9f | 12,079,784,168,080,658,000,000,000,000,000,000,000 | 25 | Reinstate ZERO_PAGE optimization in 'get_user_pages()' and fix XIP
KAMEZAWA Hiroyuki and Oleg Nesterov point out that since the commit
557ed1fa2620dc119adb86b34c614e152a629a80 ("remove ZERO_PAGE") removed
the ZERO_PAGE from the VM mappings, any users of get_user_pages() will
generally now populate the VM with real emp... |
static int snd_usbmidi_input_close(struct snd_rawmidi_substream *substream)
{
return substream_open(substream, 1, 0);
} | 0 | [
"CWE-703"
] | linux | 07d86ca93db7e5cdf4743564d98292042ec21af7 | 291,231,142,032,909,150,000,000,000,000,000,000,000 | 4 | ALSA: usb-audio: avoid freeing umidi object twice
The 'umidi' object will be free'd on the error path by snd_usbmidi_free()
when tearing down the rawmidi interface. So we shouldn't try to free it
in snd_usbmidi_create() after having registered the rawmidi interface.
Found by KASAN.
Signed-off-by: Andrey Konovalov <a... |
reAnchor(Buffer *buf, char *re)
{
return reAnchorAny(buf, re, _put_anchor_all);
} | 0 | [
"CWE-119"
] | w3m | 4e464819dd360ffd3d58fa2a89216fe413cfcc74 | 197,595,415,785,206,400,000,000,000,000,000,000,000 | 4 | Prevent segfault due to buffer overflows in addMultirowsForm
Bug-Debian: https://github.com/tats/w3m/issues/21
Bug-Debian: https://github.com/tats/w3m/issues/26 |
isdn_wildmat(char *s, char *p)
{
register int last;
register int matched;
register int reverse;
register int nostar = 1;
if (!(*s) && !(*p))
return (1);
for (; *p; s++, p++)
switch (*p) {
case '\\':
/*
* Literal match with following character,
* fall through.
*/
p++;
default:
if (*s ... | 0 | [
"CWE-119"
] | linux | 9f5af546e6acc30f075828cb58c7f09665033967 | 206,530,384,214,071,300,000,000,000,000,000,000,000 | 44 | isdn/i4l: fix buffer overflow
This fixes a potential buffer overflow in isdn_net.c caused by an
unbounded strcpy.
[ ISDN seems to be effectively unmaintained, and the I4L driver in
particular is long deprecated, but in case somebody uses this..
- Linus ]
Signed-off-by: Jiten Thakkar <jitenmt@gmail.com>
Signed-... |
char * fstostr(
time_t ntp_stamp
)
{
char * buf;
struct tm * tm;
time_t unix_stamp;
LIB_GETBUF(buf);
unix_stamp = ntp_stamp - JAN_1970;
tm = gmtime(&unix_stamp);
if (NULL == tm)
#ifdef WAIT_FOR_NTP_CRYPTO_C_CALLERS_ABLE_TO_HANDLE_MORE_THAN_20_CHARS
msnprintf(buf, LIB_BUFLENGTH, "gmtime: %m");
#else
strnc... | 0 | [
"CWE-20"
] | ntp | 52e977d79a0c4ace997e5c74af429844da2f27be | 317,755,885,234,709,600,000,000,000,000,000,000,000 | 24 | [Bug 1773] openssl not detected during ./configure.
[Bug 1774] Segfaults if cryptostats enabled and built without OpenSSL. |
seamless_line_handler(const char *line, void *data)
{
if (!seamless_process_line(line, data))
{
logger(Core, Warning, "seamless_line_handler(), invalid request '%s'", line);
}
return True;
} | 0 | [
"CWE-119",
"CWE-125",
"CWE-703",
"CWE-787"
] | rdesktop | 4dca546d04321a610c1835010b5dad85163b65e1 | 135,174,561,279,633,180,000,000,000,000,000,000,000 | 8 | 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 ... |
Convert a mime-encoded text to UTF-8 */
PHP_FUNCTION(imap_utf8)
{
zend_string *str;
SIZEDTEXT src, dest;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &str) == FAILURE) {
return;
}
src.data = NULL;
src.size = 0;
dest.data = NULL;
dest.size = 0;
cpytxt(&src, ZSTR_VAL(str), ZSTR_LEN(str));
#ifndef H... | 0 | [
"CWE-88"
] | php-src | 336d2086a9189006909ae06c7e95902d7d5ff77e | 320,095,756,136,916,880,000,000,000,000,000,000,000 | 29 | Disable rsh/ssh functionality in imap by default (bug #77153) |
static inline struct kvm_memslots *kvm_vcpu_memslots(struct kvm_vcpu *vcpu)
{
int as_id = kvm_arch_vcpu_memslots_id(vcpu);
return __kvm_memslots(vcpu->kvm, as_id);
} | 0 | [
"CWE-416"
] | linux | 0774a964ef561b7170d8d1b1bfe6f88002b6d219 | 30,121,393,938,396,300,000,000,000,000,000,000,000 | 6 | KVM: Fix out of range accesses to memslots
Reset the LRU slot if it becomes invalid when deleting a memslot to fix
an out-of-bounds/use-after-free access when searching through memslots.
Explicitly check for there being no used slots in search_memslots(), and
in the caller of s390's approximation variant.
Fixes: 369... |
PHP_FUNCTION(openssl_pkey_get_private)
{
zval *cert;
EVP_PKEY *pkey;
char * passphrase = "";
size_t passphrase_len = sizeof("")-1;
zend_resource *res;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|s", &cert, &passphrase, &passphrase_len) == FAILURE) {
return;
}
PHP_OPENSSL_CHECK_SIZE_T_TO_INT(passphrase_len... | 0 | [
"CWE-326"
] | php-src | 0216630ea2815a5789a24279a1211ac398d4de79 | 266,437,614,544,431,200,000,000,000,000,000,000,000 | 21 | Fix bug #79601 (Wrong ciphertext/tag in AES-CCM encryption for a 12 bytes IV) |
lineBufferMaxY (int y, int minY, int linesInLineBuffer)
{
return lineBufferMinY (y, minY, linesInLineBuffer) + linesInLineBuffer - 1;
} | 0 | [
"CWE-125"
] | openexr | e79d2296496a50826a15c667bf92bdc5a05518b4 | 109,449,747,077,706,340,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 int mounts_open_common(struct inode *inode, struct file *file,
const struct seq_operations *op)
{
struct task_struct *task = get_proc_task(inode);
struct nsproxy *nsp;
struct mnt_namespace *ns = NULL;
struct path root;
struct proc_mounts *p;
int ret = -EINVAL;
if (task) {
rcu_read_lock();
ns... | 0 | [
"CWE-20",
"CWE-362",
"CWE-416"
] | linux | 86acdca1b63e6890540fa19495cfc708beff3d8b | 282,785,981,026,639,000,000,000,000,000,000,000,000 | 55 | fix autofs/afs/etc. magic mountpoint breakage
We end up trying to kfree() nd.last.name on open("/mnt/tmp", O_CREAT)
if /mnt/tmp is an autofs direct mount. The reason is that nd.last_type
is bogus here; we want LAST_BIND for everything of that kind and we
get LAST_NORM left over from finding parent directory.
So make... |
TfLiteStatus CalculateOpData(TfLiteContext* context, TfLiteNode* node) {
auto* params =
reinterpret_cast<TfLiteDepthToSpaceParams*>(node->builtin_data);
TF_LITE_ENSURE_EQ(context, NumInputs(node), 1);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
const TfLiteTensor* input;
TF_LITE_ENSURE_OK(context... | 1 | [
"CWE-369"
] | tensorflow | 106d8f4fb89335a2c52d7c895b7a7485465ca8d9 | 216,460,474,948,037,200,000,000,000,000,000,000,000 | 51 | Prevent division by 0 in TFLite
PiperOrigin-RevId: 370800311
Change-Id: I21ccdbd31c30118acc67df8751807ee2e0b12f91 |
static MagickBooleanType load_tile(Image *image,Image *tile_image,
XCFDocInfo *inDocInfo,XCFLayerInfo *inLayerInfo,size_t data_length,
ExceptionInfo *exception)
{
ssize_t
y;
register ssize_t
x;
register Quantum
*q;
size_t
extent;
ssize_t
count;
unsigned char
*graydata;
XC... | 0 | [
"CWE-770"
] | ImageMagick | 19dbe11c5060f66abb393d1945107c5f54894fa8 | 73,372,050,219,339,550,000,000,000,000,000,000,000 | 85 | https://github.com/ImageMagick/ImageMagick/issues/679 |
plugin_can_trim (struct backend *b, struct connection *conn)
{
struct backend_plugin *p = container_of (b, struct backend_plugin, backend);
assert (connection_get_handle (conn, 0));
if (p->plugin.can_trim)
return p->plugin.can_trim (connection_get_handle (conn, 0));
else
return p->plugin.trim || p->pl... | 0 | [
"CWE-406"
] | nbdkit | a6b88b195a959b17524d1c8353fd425d4891dc5f | 298,365,241,949,099,920,000,000,000,000,000,000,000 | 11 | server: Fix regression for NBD_OPT_INFO before NBD_OPT_GO
Most known NBD clients do not bother with NBD_OPT_INFO (except for
clients like 'qemu-nbd --list' that don't ever intend to connect), but
go straight to NBD_OPT_GO. However, it's not too hard to hack up qemu
to add in an extra client step (whether info on the ... |
term_push_cmd(char c)
{
uint new_size;
/* Need 1 more for null byte */
if (term.cmd_len + 1 < term.cmd_buf_cap) {
term.cmd_buf[term.cmd_len++] = c;
term.cmd_buf[term.cmd_len] = 0;
return true;
}
if (term.cmd_buf_cap >= TERM_CMD_BUF_MAX_SIZE) {
/* Server sends too many cmd characters */
r... | 0 | [
"CWE-703",
"CWE-770"
] | mintty | bd52109993440b6996760aaccb66e68e782762b9 | 18,974,588,239,600,753,000,000,000,000,000,000,000 | 26 | tame some window operations, just in case |
const char* ExpressionConcatArrays::getOpName() const {
return "$concatArrays";
} | 0 | [
"CWE-835"
] | mongo | 0a076417d1d7fba3632b73349a1fd29a83e68816 | 99,870,958,343,605,230,000,000,000,000,000,000,000 | 3 | SERVER-38070 fix infinite loop in agg expression |
static Register parseReg(RAsm *a, const char *str, size_t *pos, ut32 *type) {
int i;
// Must be the same order as in enum register_t
const char *regs[] = { "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi", "eip", NULL };
const char *regsext[] = { "r8d", "r9d", "r10d", "r11d", "r12d", "r13d", "r14d", "r15d", N... | 0 | [
"CWE-119",
"CWE-125",
"CWE-787"
] | radare2 | 9b46d38dd3c4de6048a488b655c7319f845af185 | 88,952,055,943,497,730,000,000,000,000,000,000,000 | 130 | Fix #12372 and #12373 - Crash in x86 assembler (#12380)
0 ,0,[bP-bL-bP-bL-bL-r-bL-bP-bL-bL-
mov ,0,[ax+Bx-ax+Bx-ax+ax+Bx-ax+Bx--
leA ,0,[bP-bL-bL-bP-bL-bP-bL-60@bL-
leA ,0,[bP-bL-r-bP-bL-bP-bL-60@bL-
mov ,0,[ax+Bx-ax+Bx-ax+ax+Bx-ax+Bx-- |
xdr_chpass3_arg(XDR *xdrs, chpass3_arg *objp)
{
if (!xdr_ui_4(xdrs, &objp->api_version)) {
return (FALSE);
}
if (!xdr_krb5_principal(xdrs, &objp->princ)) {
return (FALSE);
}
if (!xdr_krb5_boolean(xdrs, &objp->keepold)) {
return (FALSE);
}
if (!xdr_array(xdrs, (caddr_t *)&objp->ks_tuple,
(unsigned ... | 0 | [
"CWE-703"
] | krb5 | a197e92349a4aa2141b5dff12e9dd44c2a2166e3 | 272,619,175,519,179,750,000,000,000,000,000,000,000 | 22 | Fix kadm5/gssrpc XDR double free [CVE-2014-9421]
[MITKRB5-SA-2015-001] In auth_gssapi_unwrap_data(), do not free
partial deserialization results upon failure to deserialize. This
responsibility belongs to the callers, svctcp_getargs() and
svcudp_getargs(); doing it in the unwrap function results in freeing
the result... |
static int calcstepsizes(uint_fast16_t refstepsize, int numrlvls,
uint_fast16_t *stepsizes)
{
int bandno;
int numbands;
uint_fast16_t expn;
uint_fast16_t mant;
expn = JPC_QCX_GETEXPN(refstepsize);
mant = JPC_QCX_GETMANT(refstepsize);
numbands = 3 * numrlvls - 2;
for (bandno = 0; bandno < numbands; ++bandno) {... | 0 | [
"CWE-617"
] | jasper | 84d00fb29a22e360c2ff91bdc2cd81c288826bfc | 84,465,102,469,265,810,000,000,000,000,000,000,000 | 19 | jpc_dec: check for JPC_QCX_EXPN() parameter overflow
Avoid the assertion failure in the JPC_QCX_EXPN() function. While the
"expn" variable cannot be bigger than 0x1f, adding something to it may
exceed that limit.
This condition could be exploited with a malicious JP2 file, allowing
a denial of service attack on proc... |
mtab_head() {
if (!got_mtab)
read_mounttable();
return &mounttable;
} | 0 | [
"CWE-399"
] | util-linux | 4b39b6aefd5dd8ac68a92adc650dc13d5d54d704 | 334,603,814,694,525,320,000,000,000,000,000,000,000 | 5 | mount: use fflush() and temporary file for mtab updates (CVE-2011-1089)
http://thread.gmane.org/gmane.comp.security.oss.general/4374
Changes:
- force mount(8) to use /etc/mtab.tmp file every time. The original
code used the tmp file for remount/move operations only.
- call and check fflush() return code for... |
redraw_later_clear(void)
{
redraw_all_later(CLEAR);
reset_screen_attr();
} | 0 | [
"CWE-122"
] | vim | 826bfe4bbd7594188e3d74d2539d9707b1c6a14b | 122,666,282,587,668,520,000,000,000,000,000,000,000 | 5 | patch 8.2.3487: illegal memory access if buffer name is very long
Problem: Illegal memory access if buffer name is very long.
Solution: Make sure not to go over the end of the buffer. |
gchar* tcp_follow_index_filter(int stream)
{
return g_strdup_printf("tcp.stream eq %d", stream);
} | 0 | [
"CWE-354"
] | wireshark | 7f3fe6164a68b76d9988c4253b24d43f498f1753 | 75,536,849,908,396,590,000,000,000,000,000,000,000 | 4 | TCP: do not use an unknown status when the checksum is 0xffff
Otherwise it triggers an assert when adding the column as the field is
defined as BASE_NONE and not BASE_DEC or BASE_HEX. Thus an unknown value
(not in proto_checksum_vals[)array) cannot be represented.
Mark the checksum as bad even if we process the packet... |
bool check_global_access(THD *thd, ulong want_access, bool no_errors)
{
#ifndef NO_EMBEDDED_ACCESS_CHECKS
char command[128];
if ((thd->security_ctx->master_access & want_access))
return 0;
if (unlikely(!no_errors))
{
get_privilege_desc(command, sizeof(command), want_access);
my_error(ER_SPECIFIC_ACC... | 0 | [
"CWE-703"
] | server | 39feab3cd31b5414aa9b428eaba915c251ac34a2 | 149,890,143,591,257,090,000,000,000,000,000,000,000 | 17 | MDEV-26412 Server crash in Item_field::fix_outer_field for INSERT SELECT
IF an INSERT/REPLACE SELECT statement contained an ON expression in the top
level select and this expression used a subquery with a column reference
that could not be resolved then an attempt to resolve this reference as
an outer reference caused... |
static int chip_write_masked(struct CHIPSTATE *chip, int subaddr, int val, int mask)
{
if (mask != 0) {
if (-1 == subaddr) {
val = (chip->shadow.bytes[1] & ~mask) | (val & mask);
} else {
val = (chip->shadow.bytes[subaddr+1] & ~mask) | (val & mask);
}
}
return chip_write(chip, subaddr, val);
} | 1 | [] | linux-2.6 | 494264379d186bf806613d27aafb7d88d42f4212 | 17,523,845,146,844,268,000,000,000,000,000,000,000 | 11 | V4L/DVB (9621): Avoid writing outside shadow.bytes[] array
There were no check about the limits of shadow.bytes array. This offers
a risk of writing values outside the limits, overriding other data
areas.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> |
static INLINE INT32 planar_skip_plane_rle(const BYTE* pSrcData, UINT32 SrcSize, UINT32 nWidth,
UINT32 nHeight)
{
UINT32 x, y;
BYTE controlByte;
const BYTE* pRLE = pSrcData;
const BYTE* pEnd = &pSrcData[SrcSize];
for (y = 0; y < nHeight; y++)
{
for (x = 0; x < nWidth;)
... | 1 | [
"CWE-125"
] | FreeRDP | 17f547ae11835bb11baa3d045245dc1694866845 | 68,410,235,112,205,440,000,000,000,000,000,000,000 | 47 | Fixed CVE-2020-11521: Out of bounds write in planar codec.
Thanks to Sunglin and HuanGMz from Knownsec 404 |
template<typename tf, typename t>
static CImg<floatT> ellipsoid3d(CImgList<tf>& primitives,
const CImg<t>& tensor, const unsigned int subdivisions=3) {
primitives.assign();
if (!subdivisions) return CImg<floatT>();
CImg<floatT> S, V;
tensor.symmetric_e... | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 40,342,077,330,890,130,000,000,000,000,000,000,000 | 18 | Fix other issues in 'CImg<T>::load_bmp()'. |
static inline void set_feature(enum features_id feature_id)
{
int slot = feature_id / 64;
uint64_t mask = 1ull << (feature_id & 63);
vrend_state.features[slot] |= mask;
} | 0 | [
"CWE-787"
] | virglrenderer | 95e581fd181b213c2ed7cdc63f2abc03eaaa77ec | 170,557,457,730,770,300,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> |
QualifyIpPacket(IPHeader *pIpHeader, ULONG len, BOOLEAN verifyLength)
{
tTcpIpPacketParsingResult res;
res.value = 0;
if (len < 4)
{
res.ipStatus = ppresNotIP;
return res;
}
UCHAR ver_len = pIpHeader->v4.ip_verlen;
UCHAR ip_version = (ver_len & 0xF0) >> 4;
USHORT ipHe... | 0 | [
"CWE-20"
] | kvm-guest-drivers-windows | 723416fa4210b7464b28eab89cc76252e6193ac1 | 9,285,784,233,219,095,000,000,000,000,000,000,000 | 152 | NetKVM: BZ#1169718: Checking the length only on read
Signed-off-by: Joseph Hindin <yhindin@rehat.com> |
QString proxyToStr(const Proxy & p) {
QString res="";
if (p.type == QNetworkProxy::HttpProxy)
res += "http://";
else if (p.type == QNetworkProxy::Socks5Proxy)
res += "socks5://";
if (!p.user.isEmpty()) {
res += "@" + p.user;
if (!p.password.isEmpty()) res += ":" + p.password;
}
res += p.host;
if (!p.hos... | 0 | [
"CWE-22"
] | wkhtmltopdf | 2a5f25077895fb075812c0f599326f079a59d6cf | 154,901,187,151,215,100,000,000,000,000,000,000,000 | 15 | BREAKING CHANGE: block local filesystem access by default
fixes #4536 |
irc_server_set_prefix_modes_chars (struct t_irc_server *server,
const char *prefix)
{
char *pos;
int i, old_length_chars, length_modes, length_chars;
if (!server || !prefix)
return;
old_length_chars = (server->prefix_chars) ?
strlen (server->prefix_ch... | 0 | [
"CWE-120",
"CWE-787"
] | weechat | 40ccacb4330a64802b1f1e28ed9a6b6d3ca9197f | 315,315,748,392,032,900,000,000,000,000,000,000,000 | 56 | irc: fix crash when a new message 005 is received with longer nick prefixes
Thanks to Stuart Nevans Locke for reporting the issue. |
bool testSingleInterval(IndexBounds bounds) {
BSONObj startKey;
bool startKeyIn;
BSONObj endKey;
bool endKeyIn;
return IndexBoundsBuilder::isSingleInterval(bounds, &startKey, &startKeyIn, &endKey, &endKeyIn);
} | 0 | [
"CWE-754"
] | mongo | f8f55e1825ee5c7bdb3208fc7c5b54321d172732 | 116,219,776,271,496,400,000,000,000,000,000,000,000 | 7 | SERVER-44377 generate correct plan for indexed inequalities to null |
double bson_iterator_double_raw( const bson_iterator *i ) {
double out;
bson_little_endian64( &out, bson_iterator_value( i ) );
return out;
} | 0 | [
"CWE-190"
] | mongo-c-driver-legacy | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | 239,353,860,516,770,750,000,000,000,000,000,000,000 | 5 | don't mix up int and size_t (first pass to fix that) |
void smtp_server_connection_set_proxy_data(
struct smtp_server_connection *conn,
const struct smtp_proxy_data *proxy_data)
{
if (proxy_data->source_ip.family != 0)
conn->conn.remote_ip = proxy_data->source_ip;
if (proxy_data->source_port != 0)
conn->conn.remote_port = proxy_data->source_port;
if (proxy_data->h... | 0 | [
"CWE-77"
] | core | 321c339756f9b2b98fb7326359d1333adebb5295 | 118,731,360,157,125,880,000,000,000,000,000,000,000 | 43 | lib-smtp: smtp-server-connection - Fix STARTTLS command injection vulnerability.
The input handler kept reading more commands even though the input was locked by
the STARTTLS command, thereby causing it to read the command pipelined beyond
STARTTLS. This causes a STARTTLS command injection vulerability. |
static void hub_usb3_port_prepare_disable(struct usb_hub *hub,
struct usb_port *port_dev)
{
struct usb_device *udev = port_dev->child;
int ret;
if (udev && udev->port_is_suspended && udev->do_remote_wakeup) {
ret = hub_set_port_link_state(hub, port_dev->portnum,
USB_SS_PORT_LS_U0);
if (!ret) {... | 0 | [
"CWE-400",
"CWE-703"
] | linux | 704620afc70cf47abb9d6a1a57f3825d2bca49cf | 287,113,243,575,934,940,000,000,000,000,000,000,000 | 19 | USB: check usb_get_extra_descriptor for proper size
When reading an extra descriptor, we need to properly check the minimum
and maximum size allowed, to prevent from invalid data being sent by a
device.
Reported-by: Hui Peng <benquike@gmail.com>
Reported-by: Mathias Payer <mathias.payer@nebelwelt.net>
Co-developed-by... |
dns_zone_setstatistics(dns_zone_t *zone, bool on) {
/*
* This function is obsoleted.
*/
UNUSED(zone);
UNUSED(on);
return (ISC_R_NOTIMPLEMENTED);
} | 0 | [
"CWE-327"
] | bind9 | f09352d20a9d360e50683cd1d2fc52ccedcd77a0 | 50,251,077,408,978,395,000,000,000,000,000,000,000 | 8 | 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 btrfs_check_chunk_valid(struct btrfs_fs_info *fs_info,
struct extent_buffer *leaf,
struct btrfs_chunk *chunk, u64 logical)
{
u64 length;
u64 stripe_len;
u16 num_stripes;
u16 sub_stripes;
u64 type;
u64 features;
bool mixed = false;
length = btrfs_chunk_length(leaf, chunk);
stripe_len =... | 0 | [
"CWE-476",
"CWE-284"
] | linux | 09ba3bc9dd150457c506e4661380a6183af651c1 | 41,097,486,704,489,240,000,000,000,000,000,000,000 | 91 | btrfs: merge btrfs_find_device and find_device
Both btrfs_find_device() and find_device() does the same thing except
that the latter does not take the seed device onto account in the device
scanning context. We can merge them.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.c... |
OFCondition DcmSCP::processAssociationRQ()
{
DcmSCPActionType desiredAction = DCMSCP_ACTION_UNDEFINED;
if ( (m_assoc == NULL) || (m_assoc->params == NULL) )
return ASC_NULLKEY;
// call notifier function
notifyAssociationRequest(*m_assoc->params, desiredAction);
if (desiredAction != DCMSCP_ACTION_UNDEFINE... | 0 | [
"CWE-264"
] | dcmtk | beaf5a5c24101daeeafa48c375120b16197c9e95 | 99,474,505,736,081,460,000,000,000,000,000,000,000 | 111 | Make sure to handle setuid() return code properly.
In some tools the return value of setuid() is not checked. In the worst
case this could lead to privilege escalation since the process does not
give up its root privileges and continue as root. |
searchObjectForKeyRec(const char *searchKey, CtxJson *ctx,
ParseCtx *parseCtx, size_t *resultIndex, UA_UInt16 depth) {
UA_StatusCode ret = UA_STATUSCODE_BADNOTFOUND;
CHECK_TOKEN_BOUNDS;
if(parseCtx->tokenArray[parseCtx->index].type == JSMN_OBJECT) {
size_t objectCoun... | 0 | [
"CWE-703",
"CWE-787"
] | open62541 | c800e2987b10bb3af6ef644b515b5d6392f8861d | 284,081,130,141,865,740,000,000,000,000,000,000,000 | 58 | fix(json): Check max recursion depth in more places |
static int atomic_open(struct nameidata *nd, struct dentry *dentry,
struct path *path, struct file *file,
const struct open_flags *op,
bool got_write, bool need_lookup,
int *opened)
{
struct inode *dir = nd->path.dentry->d_inode;
unsigned open_flag = open_to_namei_flags(op->open_flag);
umode_t mode;
in... | 0 | [
"CWE-284",
"CWE-264"
] | linux | 23adbe12ef7d3d4195e80800ab36b37bee28cd03 | 59,933,578,640,933,080,000,000,000,000,000,000,000 | 153 | 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... |
zip_read_data_zipx_ppmd(struct archive_read *a, const void **buff,
size_t *size, int64_t *offset)
{
struct zip* zip = (struct zip *)(a->format->data);
int ret;
size_t consumed_bytes = 0;
ssize_t bytes_avail = 0;
(void) offset; /* UNUSED */
/* If we're here for the first time, initialize Ppmd8 decompression
... | 0 | [
"CWE-399",
"CWE-401"
] | libarchive | ba641f73f3d758d9032b3f0e5597a9c6e593a505 | 70,009,463,417,781,365,000,000,000,000,000,000,000 | 73 | Fix typo in preprocessor macro in archive_read_format_zip_cleanup()
Frees lzma_stream on cleanup()
Fixes #1165 |
static bool add_value_to_attrib(TALLOC_CTX *mem_ctx, struct ldb_val *value,
struct ldb_message_element *attrib)
{
attrib->values = talloc_realloc(mem_ctx,
attrib->values,
DATA_BLOB,
attrib->num_values+1);
if (attrib->values == NULL)
return false;
attrib->values[attrib->num_values].data = talloc... | 0 | [
"CWE-399"
] | samba | 530d50a1abdcdf4d1775652d4c456c1274d83d8d | 124,322,705,354,239,300,000,000,000,000,000,000,000 | 16 | CVE-2015-7540: s4: libcli: ldap message - Ensure all asn1_XX returns are checked.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=9187
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): F... |
xmlSAXParseFileWithData(xmlSAXHandlerPtr sax, const char *filename,
int recovery, void *data) {
xmlDocPtr ret;
xmlParserCtxtPtr ctxt;
xmlInitParser();
ctxt = xmlCreateFileParserCtxt(filename);
if (ctxt == NULL) {
return(NULL);
}
if (sax != NULL) {
if (ctxt->sax !=... | 0 | [
"CWE-119"
] | libxml2 | 6a36fbe3b3e001a8a840b5c1fdd81cefc9947f0d | 49,986,219,021,808,400,000,000,000,000,000,000,000 | 48 | Fix potential out of bound access |
int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d, int n, int *al)
{
unsigned short type;
unsigned short size;
unsigned short len;
unsigned char *data = *p;
int renegotiate_seen = 0;
s->servername_done = 0;
s->tlsext_status_type = -1;
if (data >= (d+n-2))
goto ri_check;
n2s(data... | 1 | [] | openssl | ee2ffc279417f15fef3b1073c7dc81a908991516 | 250,510,687,265,667,030,000,000,000,000,000,000,000 | 355 | Add Next Protocol Negotiation. |
static void ExportBGROQuantum(const Image *image,QuantumInfo *quantum_info,
const MagickSizeType number_pixels,const Quantum *magick_restrict p,
unsigned char *magick_restrict q,ExceptionInfo *exception)
{
QuantumAny
range;
ssize_t
x;
assert(exception != (ExceptionInfo *) NULL);
assert(exception->... | 0 | [
"CWE-190"
] | ImageMagick | 5af1dffa4b6ab984b5f13d1e91c95760d75f12a6 | 197,232,712,694,246,830,000,000,000,000,000,000,000 | 243 | outside the range of representable values of type 'unsigned char' (#3083)
Co-authored-by: Zhang Xiaohui <ruc_zhangxiaohui@163.com> |
CImg<Tfloat> get_blur_guided(const CImg<t>& guide, const float radius, const float regularization) const {
if (!is_sameXYZ(guide))
throw CImgArgumentException(_cimg_instance
"blur_guided(): Invalid size for specified guide image (%u,%u,%u,%u,%p).",
... | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 245,589,363,981,706,330,000,000,000,000,000,000,000 | 27 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
R_API bool r_sys_tts(const char *txt, bool bg) {
int i;
r_return_val_if_fail (txt, false);
const char *says[] = {
"say", "termux-tts-speak", NULL
};
for (i = 0; says[i]; i++) {
char *sayPath = r_file_path (says[i]);
if (sayPath) {
char *line = r_str_replace (strdup (txt), "'", "\"", 1);
r_sys_cmdf ("\"... | 0 | [
"CWE-78"
] | radare2 | 04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9 | 212,809,080,512,070,000,000,000,000,000,000,000,000 | 18 | 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... |
TIFFRGBAImageOK(TIFF* tif, char emsg[1024])
{
TIFFDirectory* td = &tif->tif_dir;
uint16 photometric;
int colorchannels;
if (!tif->tif_decodestatus) {
sprintf(emsg, "Sorry, requested compression method is not configured");
return (0);
}
switch (td->td_bitspersample) {
case 1:
case 2:
case 4:
case 8:
... | 0 | [
"CWE-20"
] | libtiff | 48780b4fcc425cddc4ef8ffdf536f96a0d1b313b | 132,556,542,486,698,310,000,000,000,000,000,000,000 | 138 | * libtiff/tif_getimage.c: add explicit uint32 cast in putagreytile to
avoid UndefinedBehaviorSanitizer warning.
Patch by Nicolás Peña.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2658 |
static struct extent_map *defrag_lookup_extent(struct inode *inode, u64 start)
{
struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree;
struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree;
struct extent_map *em;
u64 len = PAGE_CACHE_SIZE;
/*
* hopefully we have this extent in the tree already, tr... | 0 | [
"CWE-310"
] | linux-2.6 | 9c52057c698fb96f8f07e7a4bcf4801a092bda89 | 225,286,477,771,727,750,000,000,000,000,000,000,000 | 27 | Btrfs: fix hash overflow handling
The handling for directory crc hash overflows was fairly obscure,
split_leaf returns EOVERFLOW when we try to extend the item and that is
supposed to bubble up to userland. For a while it did so, but along the
way we added better handling of errors and forced the FS readonly if we
hi... |
CtPtr ProtocolV2::handle_auth_signature(ceph::bufferlist &payload)
{
ldout(cct, 20) << __func__
<< " payload.length()=" << payload.length() << dendl;
if (state != AUTH_ACCEPTING_SIGN && state != AUTH_CONNECTING_SIGN) {
lderr(cct) << __func__
<< " pre-auth verification signature seen in wrong ... | 0 | [
"CWE-323"
] | ceph | 47c7e623546a7a33bd6bbddfb899fa9c9a40f40a | 119,019,157,302,476,100,000,000,000,000,000,000,000 | 41 | msg/async/ProtocolV2: avoid AES-GCM nonce reuse vulnerabilities
The secure mode uses AES-128-GCM with 96-bit nonces consisting of a
32-bit counter followed by a 64-bit salt. The counter is incremented
after processing each frame, the salt is fixed for the duration of
the session. Both are initialized from the sessio... |
ipp_get_code(const char *value, /* I - Locale/charset string */
char *buffer, /* I - String buffer */
size_t bufsize) /* I - Size of string buffer */
{
char *bufptr, /* Pointer into buffer */
*bufend; /* End of buffer */
/*
* Convert values to lowercase and change _ to -... | 0 | [
"CWE-120"
] | cups | f24e6cf6a39300ad0c3726a41a4aab51ad54c109 | 192,127,867,907,374,800,000,000,000,000,000,000,000 | 28 | Fix multiple security/disclosure issues:
- CVE-2019-8696 and CVE-2019-8675: Fixed SNMP buffer overflows (rdar://51685251)
- Fixed IPP buffer overflow (rdar://50035411)
- Fixed memory disclosure issue in the scheduler (rdar://51373853)
- Fixed DoS issues in the scheduler (rdar://51373929) |
CAMLexport double caml_deserialize_float_8(void)
{
double f;
caml_deserialize_block_float_8(&f, 1);
return f;
} | 0 | [
"CWE-200"
] | ocaml | 659615c7b100a89eafe6253e7a5b9d84d0e8df74 | 163,712,281,246,871,190,000,000,000,000,000,000,000 | 6 | fix PR#7003 and a few other bugs caused by misuse of Int_val
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16525 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 |
void CCrypto::GenerateHMAC256( const uint8 *pubData, uint32 cubData, const uint8 *pubKey, uint32 cubKey, SHA256Digest_t *pOutputDigest )
{
VPROF_BUDGET( "CCrypto::GenerateHMAC256", VPROF_BUDGETGROUP_ENCRYPTION );
Assert( pubData );
Assert( cubData > 0 );
Assert( pubKey );
Assert( cubKey > 0 );
Assert( pOutputD... | 0 | [
"CWE-787"
] | GameNetworkingSockets | bea84e2844b647532a9b7fbc3a6a8989d66e49e3 | 87,019,270,122,276,600,000,000,000,000,000,000,000 | 14 | Check if output buffer is too small.
It really seems like libsodium (whose entire purpose is to make crypto
idiot-proof) making me mess with these details is a flaw in the API design.
Also, correct Hungarian. |
const T& min_max(t& max_val) const {
if (is_empty())
throw CImgInstanceException(_cimg_instance
"min_max(): Empty instance.",
cimg_instance);
const T *ptr_min = _data;
T min_value = *ptr_min, max_value = min_value;
... | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 291,622,749,673,720,460,000,000,000,000,000,000,000 | 15 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
static int caif_seqpkt_recvmsg(struct kiocb *iocb, struct socket *sock,
struct msghdr *m, size_t len, int flags)
{
struct sock *sk = sock->sk;
struct sk_buff *skb;
int ret;
int copylen;
ret = -EOPNOTSUPP;
if (m->msg_flags&MSG_OOB)
goto read_error;
m->msg_namelen = 0;
skb = skb_recv_datagram(sk, flags,... | 0 | [
"CWE-200"
] | linux | 2d6fbfe733f35c6b355c216644e08e149c61b271 | 146,252,661,450,457,840,000,000,000,000,000,000,000 | 37 | caif: Fix missing msg_namelen update in caif_seqpkt_recvmsg()
The current code does not fill the msg_name member in case it is set.
It also does not set the msg_namelen member to 0 and therefore makes
net/socket.c leak the local, uninitialized sockaddr_storage variable
to userland -- 128 bytes of kernel stack memory.
... |
static void shadow_walk_next(struct kvm_shadow_walk_iterator *iterator)
{
__shadow_walk_next(iterator, *iterator->sptep);
} | 0 | [
"CWE-476"
] | linux | 9f46c187e2e680ecd9de7983e4d081c3391acc76 | 234,292,231,774,891,240,000,000,000,000,000,000,000 | 4 | 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... |
int main(int argc, char** argv)
{
/* Kernel starts us with all fd's closed.
* But it's dangerous:
* fprintf(stderr) can dump messages into random fds, etc.
* Ensure that if any of fd 0,1,2 is closed, we open it to /dev/null.
*/
int fd = xopen("/dev/null", O_RDWR);
while (fd < 2)
fd = xd... | 1 | [
"CWE-59"
] | abrt | 80408e9e24a1c10f85fd969e1853e0f192157f92 | 273,047,294,329,773,340,000,000,000,000,000,000,000 | 424 | ccpp: fix symlink race conditions
Fix copy & chown race conditions
Related: #1211835
Signed-off-by: Jakub Filak <jfilak@redhat.com> |
static inline Quantum ScaleCharToQuantum(const unsigned char value)
{
return((Quantum) (72340172838076673.0*value));
} | 0 | [
"CWE-190"
] | ImageMagick | f60d59cc3a7e3402d403361e0985ffa56f746a82 | 91,145,712,137,706,170,000,000,000,000,000,000,000 | 4 | https://github.com/ImageMagick/ImageMagick/issues/1727 |
ldns_rr_set_pop_rr(ldns_rr_list *rr_list)
{
return ldns_rr_list_pop_rr(rr_list);
} | 0 | [
"CWE-415"
] | ldns | 070b4595981f48a21cc6b4f5047fdc2d09d3da91 | 213,255,606,641,436,660,000,000,000,000,000,000,000 | 4 | CAA and URI |
folder_uncompressed_size(struct _7z_folder *f)
{
int n = (int)f->numOutStreams;
unsigned pairs = (unsigned)f->numBindPairs;
while (--n >= 0) {
unsigned i;
for (i = 0; i < pairs; i++) {
if (f->bindPairs[i].outIndex == (uint64_t)n)
break;
}
if (i >= pairs)
return (f->unPackSize[n]);
}
return (0);
... | 0 | [
"CWE-190",
"CWE-125"
] | libarchive | e79ef306afe332faf22e9b442a2c6b59cb175573 | 74,952,978,807,657,220,000,000,000,000,000,000,000 | 16 | Issue #718: Fix TALOS-CAN-152
If a 7-Zip archive declares a rediculously large number of substreams,
it can overflow an internal counter, leading a subsequent memory
allocation to be too small for the substream data.
Thanks to the Open Source and Threat Intelligence project at Cisco
for reporting this issue. |
static int inet6_rtm_delroute(struct sk_buff *skb, struct nlmsghdr* nlh)
{
struct fib6_config cfg;
int err;
err = rtm_to_fib6_config(skb, nlh, &cfg);
if (err < 0)
return err;
if (cfg.fc_mp)
return ip6_route_multipath(&cfg, 0);
else
return ip6_route_del(&cfg);
} | 0 | [
"CWE-119"
] | net | c88507fbad8055297c1d1e21e599f46960cbee39 | 115,885,752,946,761,890,000,000,000,000,000,000,000 | 14 | ipv6: don't set DST_NOCOUNT for remotely added routes
DST_NOCOUNT should only be used if an authorized user adds routes
locally. In case of routes which are added on behalf of router
advertisments this flag must not get used as it allows an unlimited
number of routes getting added remotely.
Signed-off-by: Sabrina Dub... |
int __legitimize_mnt(struct vfsmount *bastard, unsigned seq)
{
struct mount *mnt;
if (read_seqretry(&mount_lock, seq))
return 1;
if (bastard == NULL)
return 0;
mnt = real_mount(bastard);
mnt_add_count(mnt, 1);
if (likely(!read_seqretry(&mount_lock, seq)))
return 0;
if (bastard->mnt_flags & MNT_SYNC_UMOUNT)... | 0 | [
"CWE-400",
"CWE-703"
] | linux | d29216842a85c7970c536108e093963f02714498 | 100,057,202,523,669,970,000,000,000,000,000,000,000 | 17 | mnt: Add a per mount namespace limit on the number of mounts
CAI Qian <caiqian@redhat.com> pointed out that the semantics
of shared subtrees make it possible to create an exponentially
increasing number of mounts in a mount namespace.
mkdir /tmp/1 /tmp/2
mount --make-rshared /
for i in $(seq 1 20) ; do mo... |
mb_strnicmp(char_u *s1, char_u *s2, size_t nn)
{
int i, l;
int cdiff;
int n = (int)nn;
if (enc_utf8)
{
return utf_strnicmp(s1, s2, nn, nn);
}
else
{
for (i = 0; i < n; i += l)
{
if (s1[i] == NUL && s2[i] == NUL) // both strings end
return 0;
l = (*mb_ptr2len)(s1 + i);... | 0 | [
"CWE-122",
"CWE-787"
] | vim | f6d39c31d2177549a986d170e192d8351bd571e2 | 211,409,191,766,864,160,000,000,000,000,000,000,000 | 41 | patch 9.0.0220: invalid memory access with for loop over NULL string
Problem: Invalid memory access with for loop over NULL string.
Solution: Make sure mb_ptr2len() consistently returns zero for NUL. |
static int userfaultfd_register(struct userfaultfd_ctx *ctx,
unsigned long arg)
{
struct mm_struct *mm = ctx->mm;
struct vm_area_struct *vma, *prev, *cur;
int ret;
struct uffdio_register uffdio_register;
struct uffdio_register __user *user_uffdio_register;
unsigned long vm_flags, new_flags;
bool found;
bool... | 1 | [
"CWE-862",
"CWE-863"
] | linux | 29ec90660d68bbdd69507c1c8b4e33aa299278b1 | 111,017,886,332,702,120,000,000,000,000,000,000,000 | 195 | userfaultfd: shmem/hugetlbfs: only allow to register VM_MAYWRITE vmas
After the VMA to register the uffd onto is found, check that it has
VM_MAYWRITE set before allowing registration. This way we inherit all
common code checks before allowing to fill file holes in shmem and
hugetlbfs with UFFDIO_COPY.
The userfaultf... |
client_send_params(gnutls_session_t session,
gnutls_buffer_t extdata,
const gnutls_psk_client_credentials_t cred)
{
int ret, ext_offset = 0;
uint8_t binder_value[MAX_HASH_SIZE];
size_t spos;
gnutls_datum_t username = {NULL, 0};
gnutls_datum_t user_key = {NULL, 0}, rkey = {NULL, 0};
unsigned client_hello... | 0 | [
"CWE-416"
] | gnutls | 75a937d97f4fefc6f9b08e3791f151445f551cb3 | 305,570,908,249,782,030,000,000,000,000,000,000,000 | 267 | pre_shared_key: avoid use-after-free around realloc
Signed-off-by: Daiki Ueno <ueno@gnu.org> |
_load_job_limits(void)
{
List steps;
ListIterator step_iter;
step_loc_t *stepd;
int fd;
job_mem_limits_t *job_limits_ptr;
slurmstepd_mem_info_t stepd_mem_info;
if (!job_limits_list)
job_limits_list = list_create(_job_limits_free);
job_limits_loaded = true;
steps = stepd_available(conf->spooldir, conf->node... | 0 | [
"CWE-284"
] | slurm | 92362a92fffe60187df61f99ab11c249d44120ee | 63,237,771,374,834,540,000,000,000,000,000,000,000 | 59 | Fix security issue in _prolog_error().
Fix security issue caused by insecure file path handling triggered by
the failure of a Prolog script. To exploit this a user needs to
anticipate or cause the Prolog to fail for their job.
(This commit is slightly different from the fix to the 15.08 branch.)
CVE-2016-10030. |
Word grpcSendHandler(void* raw_context, Word token, Word message_ptr, Word message_size,
Word end_stream) {
auto context = WASM_CONTEXT(raw_context)->root_context();
auto message = context->wasmVm()->getMemory(message_ptr.u64_, message_size.u64_);
if (!message) {
return wasmResultToWord(W... | 0 | [
"CWE-476"
] | envoy | 8788a3cf255b647fd14e6b5e2585abaaedb28153 | 301,696,247,688,465,640,000,000,000,000,000,000,000 | 9 | 1.4 - Do not call into the VM unless the VM Context has been created. (#24)
* Ensure that the in VM Context is created before onDone is called.
Signed-off-by: John Plevyak <jplevyak@gmail.com>
* Update as per offline discussion.
Signed-off-by: John Plevyak <jplevyak@gmail.com>
* Set in_vm_context_created_ in onNet... |
static int get_iovec_page_array(const struct iovec __user *iov,
unsigned int nr_vecs, struct page **pages,
struct partial_page *partial, bool aligned,
unsigned int pipe_buffers)
{
int buffers = 0, error = 0;
while (nr_vecs) {
unsigned long off, npages;
struct iovec entry;
void __user *base;
size_... | 0 | [
"CWE-284",
"CWE-264"
] | linux | 8d0207652cbe27d1f962050737848e5ad4671958 | 219,663,804,884,769,600,000,000,000,000,000,000,000 | 94 | ->splice_write() via ->write_iter()
iter_file_splice_write() - a ->splice_write() instance that gathers the
pipe buffers, builds a bio_vec-based iov_iter covering those and feeds
it to ->write_iter(). A bunch of simple cases coverted to that...
[AV: fixed the braino spotted by Cyrill]
Signed-off-by: Al Viro <viro@z... |
check_entry_size_and_hooks(struct ipt_entry *e,
struct xt_table_info *newinfo,
const unsigned char *base,
const unsigned char *limit,
const unsigned int *hook_entries,
const unsigned int *underflows,
unsigned int valid_hooks)
{
unsigned int h;
int err;
if ((unsigned long)e % __al... | 1 | [
"CWE-284",
"CWE-264"
] | linux | ce683e5f9d045e5d67d1312a42b359cb2ab2a13c | 243,817,632,459,644,700,000,000,000,000,000,000,000 | 54 | netfilter: x_tables: check for bogus target offset
We're currently asserting that targetoff + targetsize <= nextoff.
Extend it to also check that targetoff is >= sizeof(xt_entry).
Since this is generic code, add an argument pointing to the start of the
match/target, we can then derive the base structure size from the... |
static void SFS_IncIndent(ScriptParser *pars) {
pars->indent++;
} | 0 | [
"CWE-476"
] | gpac | 4e7736d7ec7bf64026daa611da951993bb42fdaf | 128,589,872,282,308,170,000,000,000,000,000,000,000 | 3 | fixed #2238 |
void Messageheader::Parser::checkHeaderspace(unsigned chars) const
{
if (headerdataPtr + chars >= header.rawdata + sizeof(header.rawdata))
{
header.rawdata[sizeof(header.rawdata) - 1] = '\0';
throw HttpError(HTTP_REQUEST_ENTITY_TOO_LARGE, "header too large");
}
} | 0 | [
"CWE-200"
] | tntnet | 9bd3b14042e12d84f39ea9f55731705ba516f525 | 254,906,335,396,570,700,000,000,000,000,000,000,000 | 8 | fix possible information leak |
Bool Media_IsSampleSyncShadow(GF_ShadowSyncBox *stsh, u32 sampleNumber)
{
u32 i;
GF_StshEntry *ent;
if (!stsh) return 0;
i=0;
while ((ent = (GF_StshEntry*)gf_list_enum(stsh->entries, &i))) {
if ((u32) ent->syncSampleNumber == sampleNumber) return 1;
else if ((u32) ent->syncSampleNumber > sampleNumber) return 0... | 0 | [
"CWE-787"
] | gpac | 328def7d3b93847d64ecb6e9e0399684e57c3eca | 35,253,940,332,987,660,000,000,000,000,000,000,000 | 12 | fixed #1766 (fuzz) |
static void virtio_gpu_ctrl_bh(void *opaque)
{
VirtIOGPU *g = opaque;
virtio_gpu_handle_ctrl(&g->parent_obj, g->ctrl_vq);
} | 0 | [] | qemu | acfc4846508a02cc4c83aa27799fd74ac280bdb2 | 276,802,279,001,281,800,000,000,000,000,000,000,000 | 5 | virtio-gpu: use VIRTIO_GPU_MAX_SCANOUTS
The value is defined in virtio_gpu.h already (changing from 4 to 16).
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 1463653560-26958-6-git-send-email-marcandre.lureau@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> |
static void sched_migrate_task(struct task_struct *p, int dest_cpu)
{
struct migration_req req;
unsigned long flags;
struct rq *rq;
rq = task_rq_lock(p, &flags);
if (!cpu_isset(dest_cpu, p->cpus_allowed)
|| unlikely(cpu_is_offline(dest_cpu)))
goto out;
/* force the process onto the specified CPU */
if (... | 0 | [] | linux-2.6 | 8f1bc385cfbab474db6c27b5af1e439614f3025c | 170,034,660,277,541,020,000,000,000,000,000,000,000 | 27 | sched: fair: weight calculations
In order to level the hierarchy, we need to calculate load based on the
root view. That is, each task's load is in the same unit.
A
/ \
B 1
/ \
2 3
To compute 1's load we do:
weight(1)
--------------
rq_weight(A)
To ... |
static struct binder_node *binder_get_node_from_ref(
struct binder_proc *proc,
u32 desc, bool need_strong_ref,
struct binder_ref_data *rdata)
{
struct binder_node *node;
struct binder_ref *ref;
binder_proc_lock(proc);
ref = binder_get_ref_olocked(proc, desc, need_strong_ref);
if (!ref)
goto err_no_ref;
n... | 0 | [
"CWE-416"
] | linux | 7bada55ab50697861eee6bb7d60b41e68a961a9c | 83,630,927,647,432,950,000,000,000,000,000,000,000 | 28 | binder: fix race that allows malicious free of live buffer
Malicious code can attempt to free buffers using the BC_FREE_BUFFER
ioctl to binder. There are protections against a user freeing a buffer
while in use by the kernel, however there was a window where
BC_FREE_BUFFER could be used to free a recently allocated bu... |
entry_guards_update_filtered_sets(guard_selection_t *gs)
{
const or_options_t *options = get_options();
SMARTLIST_FOREACH_BEGIN(gs->sampled_entry_guards, entry_guard_t *, guard) {
entry_guard_set_filtered_flags(options, gs, guard);
} SMARTLIST_FOREACH_END(guard);
} | 0 | [
"CWE-200"
] | tor | 665baf5ed5c6186d973c46cdea165c0548027350 | 257,368,871,847,301,800,000,000,000,000,000,000,000 | 8 | Consider the exit family when applying guard restrictions.
When the new path selection logic went into place, I accidentally
dropped the code that considered the _family_ of the exit node when
deciding if the guard was usable, and we didn't catch that during
code review.
This patch makes the guard_restriction_t code ... |
virtual void updateRender(GfxState * /*state*/) {} | 0 | [] | poppler | abf167af8b15e5f3b510275ce619e6fdb42edd40 | 10,709,898,443,401,400,000,000,000,000,000,000,000 | 1 | Implement tiling/patterns in SplashOutputDev
Fixes bug 13518 |
**/
CImg<T>& sequence(const T& a0, const T& a1) {
if (is_empty()) return *this;
const ulongT siz = size() - 1;
T* ptr = _data;
if (siz) {
const double delta = (double)a1 - (double)a0;
cimg_foroff(*this,l) *(ptr++) = (T)(a0 + delta*l/siz);
} else *ptr = a0;
ret... | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 164,881,460,635,386,870,000,000,000,000,000,000,000 | 10 | Fix other issues in 'CImg<T>::load_bmp()'. |
ipf_addr_hash_add(uint32_t hash, const union ipf_addr *addr)
{
BUILD_ASSERT_DECL(sizeof *addr % 4 == 0);
return hash_add_bytes32(hash, (const uint32_t *) addr, sizeof *addr);
} | 0 | [
"CWE-401"
] | ovs | 803ed12e31b0377c37d7aa8c94b3b92f2081e349 | 264,921,076,802,352,380,000,000,000,000,000,000,000 | 5 | ipf: release unhandled packets from the batch
Since 640d4db788ed ("ipf: Fix a use-after-free error, ...") the ipf
framework unconditionally allocates a new dp_packet to track
individual fragments. This prevents a use-after-free. However, an
additional issue was present - even when the packet buffer is cloned,
if the... |
isinsets(g, c)
register struct re_guts *g;
int c;
{
register uch *col;
register int i;
register int ncols = (g->ncsets+(CHAR_BIT-1)) / CHAR_BIT;
register unsigned uc = (unsigned char)c;
if (!g->setbits) {
return(0);
}
for (i = 0, col = g->setbits; i < ncols; i++, col += g->csetsize)
if (col[uc] != 0)
re... | 0 | [] | php-src | 124fb22a13fafa3648e4e15b4f207c7096d8155e | 281,741,711,461,974,830,000,000,000,000,000,000,000 | 18 | Fixed bug #68739 #68740 #68741 |
static u32 xfrm_pol_bin_obj(const void *data, u32 len, u32 seed)
{
const struct xfrm_pol_inexact_bin *b = data;
return xfrm_pol_bin_key(&b->k, 0, seed);
} | 0 | [
"CWE-703"
] | linux | f85daf0e725358be78dfd208dea5fd665d8cb901 | 275,538,204,614,153,300,000,000,000,000,000,000,000 | 6 | xfrm: xfrm_policy: fix a possible double xfrm_pols_put() in xfrm_bundle_lookup()
xfrm_policy_lookup() will call xfrm_pol_hold_rcu() to get a refcount of
pols[0]. This refcount can be dropped in xfrm_expand_policies() when
xfrm_expand_policies() return error. pols[0]'s refcount is balanced in
here. But xfrm_bundle_look... |
RList *r_bin_wasm_get_elements (RBinWasmObj *bin) {
RBinWasmSection *element = NULL;
RList *elements = NULL;
if (!bin || !bin->g_sections) {
return NULL;
}
if (bin->g_elements) {
return bin->g_elements;
}
if (!(elements = r_bin_wasm_get_sections_by_id (bin->g_sections,
R_BIN_WASM_SECTION_ELEMENT))) ... | 0 | [
"CWE-125",
"CWE-787"
] | radare2 | d2632f6483a3ceb5d8e0a5fb11142c51c43978b4 | 145,820,319,470,149,450,000,000,000,000,000,000,000 | 26 | Fix crash in fuzzed wasm r2_hoobr_consume_init_expr |
ephy_embed_single_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
EphyEmbedSingle *single = EPHY_EMBED_SINGLE (object);
switch (prop_id) {
case PROP_NETWORK_STATUS:
ephy_emb... | 0 | [] | epiphany | 3e0f7dea754381c5ad11a06ccc62eb153382b498 | 22,160,573,184,599,390,000,000,000,000,000,000,000 | 16 | Report broken certs through the padlock icon
This uses a new feature in libsoup that reports through a
SoupMessageFlag whether the message is talking to a server that has a
trusted server.
Bug #600663 |
static void v4l_print_exportbuffer(const void *arg, bool write_only)
{
const struct v4l2_exportbuffer *p = arg;
pr_cont("fd=%d, type=%s, index=%u, plane=%u, flags=0x%08x\n",
p->fd, prt_names(p->type, v4l2_type_names),
p->index, p->plane, p->flags);
} | 0 | [
"CWE-401"
] | linux | fb18802a338b36f675a388fc03d2aa504a0d0899 | 150,165,961,958,496,250,000,000,000,000,000,000,000 | 8 | media: v4l: ioctl: Fix memory leak in video_usercopy
When an IOCTL with argument size larger than 128 that also used array
arguments were handled, two memory allocations were made but alas, only
the latter one of them was released. This happened because there was only
a single local variable to hold such a temporary a... |
acquire_buffer (gboolean *free_buffer)
{
HB_Buffer buffer;
if (G_LIKELY (G_TRYLOCK (cached_buffer)))
{
if (G_UNLIKELY (!cached_buffer))
hb_buffer_new (&cached_buffer);
buffer = cached_buffer;
*free_buffer = FALSE;
}
else
{
hb_buffer_new (&buffer);
*free_buffer = TRUE;
... | 1 | [] | pango | 336bb3201096bdd0494d29926dd44e8cca8bed26 | 136,535,772,702,542,390,000,000,000,000,000,000,000 | 20 | [HB] Remove all references to the old code! |
static int DecodeAltNames(const byte* input, int sz, DecodedCert* cert)
{
word32 idx = 0;
int length = 0;
WOLFSSL_ENTER("DecodeAltNames");
if (GetSequence(input, &idx, &length, sz) < 0) {
WOLFSSL_MSG("\tBad Sequence");
return ASN_PARSE_E;
}
if (length == 0) {
/* RFC 52... | 0 | [
"CWE-125",
"CWE-345"
] | wolfssl | f93083be72a3b3d956b52a7ec13f307a27b6e093 | 131,896,888,506,020,260,000,000,000,000,000,000,000 | 359 | OCSP: improve handling of OCSP no check extension |
static void php_cli_server_client_dtor_wrapper(php_cli_server_client **p) /* {{{ */
{
closesocket((*p)->sock);
php_cli_server_poller_remove(&(*p)->server->poller, POLLIN | POLLOUT, (*p)->sock);
php_cli_server_client_dtor(*p);
pefree(*p, 1);
} /* }}} */ | 0 | [] | php-src | 2438490addfbfba51e12246a74588b2382caa08a | 176,809,483,976,706,800,000,000,000,000,000,000,000 | 7 | slim post data |
static int vp7_decode_mb_row_sliced(AVCodecContext *avctx, void *tdata,
int jobnr, int threadnr)
{
return vp78_decode_mb_row_sliced(avctx, tdata, jobnr, threadnr, IS_VP7);
} | 0 | [
"CWE-119",
"CWE-787"
] | FFmpeg | 6b5d3fb26fb4be48e4966e4b1d97c2165538d4ef | 233,097,365,336,387,400,000,000,000,000,000,000,000 | 5 | avcodec/webp: Always set pix_fmt
Fixes: out of array access
Fixes: 1434/clusterfuzz-testcase-minimized-6314998085189632
Fixes: 1435/clusterfuzz-testcase-minimized-6483783723253760
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Reviewed-by: "Ronald S. Bultje" <rsbult... |
__nfs4_find_lock_state(struct nfs4_state *state, fl_owner_t fl_owner)
{
struct nfs4_lock_state *pos;
list_for_each_entry(pos, &state->lock_states, ls_locks) {
if (pos->ls_owner != fl_owner)
continue;
atomic_inc(&pos->ls_count);
return pos;
}
return NULL;
} | 0 | [
"CWE-703"
] | linux | dc0b027dfadfcb8a5504f7d8052754bf8d501ab9 | 43,050,783,884,383,060,000,000,000,000,000,000,000 | 11 | NFSv4: Convert the open and close ops to use fmode
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> |
static int interface_req_cursor_notification(QXLInstance *sin)
{
dprint(1, "%s:\n", __FUNCTION__);
return 1;
} | 0 | [] | qemu-kvm | 5ff4e36c804157bd84af43c139f8cd3a59722db9 | 80,897,287,824,765,610,000,000,000,000,000,000,000 | 5 | qxl: async io support using new spice api
Some of the QXL port i/o commands are waiting for the spice server to
complete certain actions. Add async versions for these commands, so we
don't block the vcpu while the spice server processses the command.
Instead the qxl device will raise an IRQ when done.
The async comm... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.