libgeom: Fix 32-bit gcc build
Some checks are pending
Cross-build Kernel / amd64 ubuntu-22.04 (clang-15) (push) Waiting to run
Cross-build Kernel / aarch64 ubuntu-22.04 (clang-15) (push) Waiting to run
Cross-build Kernel / amd64 ubuntu-24.04 (clang-18) (push) Waiting to run
Cross-build Kernel / aarch64 ubuntu-24.04 (clang-18) (push) Waiting to run
Cross-build Kernel / amd64 macos-latest (clang-18) (push) Waiting to run
Cross-build Kernel / aarch64 macos-latest (clang-18) (push) Waiting to run

MFC after:	1 week
Fixes:		27894e20f1 ("libgeom: Fix segfault in 32-on-64 case")
This commit is contained in:
Dag-Erling Smørgrav 2026-01-03 21:34:44 +01:00
parent 2a7c4685b7
commit 17355cf50f

View file

@ -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) {