summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authormrg <mrg@NetBSD.org>2021-04-13 06:25:48 +0000
committermrg <mrg@NetBSD.org>2021-04-13 06:25:48 +0000
commit9940c1958fb790d5810b95a08724530f97a36fc8 (patch)
treefaf44fe79fafbfa387f30e303f46c5fe336ab00a /sys
parent11d72a937db9cf97a5415017a7aaca306eec69ec (diff)
more GCC 10 fixes.
mDNSResponder: another wrong return local address dhcp: ignore a seemingly impossible stringop overflow hpacel: avoid maybe uninitialised error that is wrong. rsh: avoid impossible malloc(0) udf: cast pointers through (uintptr_t) to fool invalid boundary checks
Diffstat (limited to 'sys')
-rw-r--r--sys/fs/udf/udf_subr.c11
-rw-r--r--sys/modules/hpacel/Makefile4
2 files changed, 9 insertions, 6 deletions
diff --git a/sys/fs/udf/udf_subr.c b/sys/fs/udf/udf_subr.c
index 19ad2d7d4e0..0bf206081e1 100644
--- a/sys/fs/udf/udf_subr.c
+++ b/sys/fs/udf/udf_subr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: udf_subr.c,v 1.152 2021/01/11 22:02:28 skrll Exp $ */
+/* $NetBSD: udf_subr.c,v 1.153 2021/04/13 06:25:49 mrg Exp $ */
/*
* Copyright (c) 2006, 2008 Reinoud Zandijk
@@ -29,7 +29,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__KERNEL_RCSID(0, "$NetBSD: udf_subr.c,v 1.152 2021/01/11 22:02:28 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udf_subr.c,v 1.153 2021/04/13 06:25:49 mrg Exp $");
#endif /* not lint */
@@ -2664,7 +2664,8 @@ udf_update_vat_extattr_from_lvid(struct udf_node *vat_node)
const char *extstr = "*UDF VAT LVExtension";
uint64_t vat_uniqueid;
uint32_t offset, a_l;
- uint8_t *ea_start, *lvextpos;
+ uint8_t *ea_start;
+ uintptr_t lvextpos;
int error;
/* get mountpoint and lvinfo */
@@ -2700,14 +2701,14 @@ udf_update_vat_extattr_from_lvid(struct udf_node *vat_node)
* copy first to avoid panics on some machines (!!)
*/
DPRINTF(VOLUMES, ("Updating VAT LVExtension attr\n"));
- lvextpos = implext->data + udf_rw32(implext->iu_l);
+ lvextpos = (uintptr_t)implext->data + udf_rw32(implext->iu_l);
lvext.unique_id_chk = vat_uniqueid;
lvext.num_files = lvinfo->num_files;
lvext.num_directories = lvinfo->num_directories;
memmove(lvext.logvol_id, ump->logical_vol->logvol_id, 128);
- memcpy(lvextpos, &lvext, sizeof(lvext));
+ memcpy((void *)lvextpos, &lvext, sizeof(lvext));
return 0;
}
diff --git a/sys/modules/hpacel/Makefile b/sys/modules/hpacel/Makefile
index 78a0128e4a3..b898871083c 100644
--- a/sys/modules/hpacel/Makefile
+++ b/sys/modules/hpacel/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2019/02/17 04:05:50 rin Exp $
+# $NetBSD: Makefile,v 1.3 2021/04/13 06:25:49 mrg Exp $
.include "../Makefile.inc"
@@ -8,4 +8,6 @@ KMOD= hpacel
IOCONF= hpacel.ioconf
SRCS= hpacel_acpi.c
+COPTS.hpacel_acpi.c+= ${GCC_NO_MAYBE_UNINITIALIZED}
+
.include <bsd.kmodule.mk>