summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwkoszek <wkoszek@FreeBSD.org>2007-05-01 10:47:09 +0000
committerwkoszek <wkoszek@FreeBSD.org>2007-05-01 10:47:09 +0000
commit0e767958a5567ff14e8778c60c52bdd44d912adb (patch)
tree54f3a1f1be423e24c618b1618c71e033d84744a4
parent76816978f201bd5240faa4c975107afb55693002 (diff)
downloadFreeBSD-src-0e767958a5567ff14e8778c60c52bdd44d912adb.zip
FreeBSD-src-0e767958a5567ff14e8778c60c52bdd44d912adb.tar.gz
Second call of sysctl() is used to gather a proper size of a memory chunk
needed to hold the GEOM tree. At this point, pointer 'p' has an improper value (as it was used previously), and we're getting EFAULT. Fix this functionality by passing NULL instead of 'p'. This fixes mdconfig(8) -l output with high number of md(4) devices. Found by: kris Reviewed by: phk
-rw-r--r--lib/libgeom/geom_getxml.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libgeom/geom_getxml.c b/lib/libgeom/geom_getxml.c
index fbc9cb8..68ff91b 100644
--- a/lib/libgeom/geom_getxml.c
+++ b/lib/libgeom/geom_getxml.c
@@ -53,7 +53,7 @@ geom_getxml()
free(p);
}
l = 0;
- i = sysctlbyname("kern.geom.confxml", p, &l, NULL, 0);
+ i = sysctlbyname("kern.geom.confxml", NULL, &l, NULL, 0);
if (i != 0)
return (NULL);
p = malloc(l + 4096);
OpenPOWER on IntegriCloud