From 6c9fdb369129b22b9212e4d82f3fadb15df45eca Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Sat, 12 May 2001 00:20:32 +0000 Subject: 2001-05-12 Marcus Brinkmann * host.c (initialize_version_info): Clear last byte of KV to make sure that the string is null-terminated. --- proc/host.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'proc/host.c') diff --git a/proc/host.c b/proc/host.c index e34b33af..30353a05 100644 --- a/proc/host.c +++ b/proc/host.c @@ -352,13 +352,16 @@ initialize_version_info (void) mach_cpu_subtypes[info.cpu_type][info.cpu_subtype]); /* Notice Mach's and our own version and initialize server version - varables. */ + variables. */ server_versions = malloc (sizeof (struct server_version) * 10); assert (server_versions); server_versions_nalloc = 10; err = host_kernel_version (mach_host_self (), kv); assert (! err); + /* Make sure the result is null-terminated, as the kernel doesn't + guarantee it. */ + kv[sizeof (kv) - 1] = '\0'; p = index (kv, ':'); if (p) *p = '\0'; -- cgit v1.2.3