git: e25aedb85e9d - stable/15 - libgeom: Fix 32-bit gcc build
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 12 Jan 2026 17:18:47 UTC
The branch stable/15 has been updated by des:
URL: https://cgit.FreeBSD.org/src/commit/?id=e25aedb85e9d0d2da73e9efd4fbe3adbaa7812dd
commit e25aedb85e9d0d2da73e9efd4fbe3adbaa7812dd
Author: Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2026-01-03 20:34:44 +0000
Commit: Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2026-01-12 17:18:22 +0000
libgeom: Fix 32-bit gcc build
MFC after: 1 week
Fixes: 27894e20f140 ("libgeom: Fix segfault in 32-on-64 case")
(cherry picked from commit 17355cf50fcbd0d8ddb638e1f2fd5861b526edbe)
---
lib/libgeom/geom_xml2tree.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/lib/libgeom/geom_xml2tree.c b/lib/libgeom/geom_xml2tree.c
index 03210947d431..a66938671845 100644
--- a/lib/libgeom/geom_xml2tree.c
+++ b/lib/libgeom/geom_xml2tree.c
@@ -71,6 +71,7 @@ StartElement(void *userData, const char *name, const char **attr)
struct mystate *mt;
void *id;
void *ref;
+ uintmax_t umax;
int i;
mt = userData;
@@ -80,10 +81,12 @@ StartElement(void *userData, const char *name, const char **attr)
ref = NULL;
for (i = 0; attr[i] != NULL; i += 2) {
if (strcmp(attr[i], "id") == 0) {
- id = (void *)strtoumax(attr[i + 1], NULL, 0);
+ umax = strtoumax(attr[i + 1], NULL, 0);
+ id = (void *)(uintptr_t)umax;
mt->nident++;
} else if (strcmp(attr[i], "ref") == 0) {
- ref = (void *)strtoumax(attr[i + 1], NULL, 0);
+ umax = strtoumax(attr[i + 1], NULL, 0);
+ ref = (void *)(uintptr_t)umax;
}
}
if (strcmp(name, "class") == 0 && mt->class == NULL) {