Module Name: src
Committed By: ad
Date: Sun Dec 22 15:00:42 UTC 2019
Modified Files:
src/sys/kern: init_main.c
Log Message:
Fix integer overflow when printing available memory size (resulting from
a cast lost during merges).
Reported-by: [email protected]
To generate a diff of this commit:
cvs rdiff -u -r1.511 -r1.512 src/sys/kern/init_main.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/kern/init_main.c
diff -u src/sys/kern/init_main.c:1.511 src/sys/kern/init_main.c:1.512
--- src/sys/kern/init_main.c:1.511 Sat Dec 21 13:00:24 2019
+++ src/sys/kern/init_main.c Sun Dec 22 15:00:42 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: init_main.c,v 1.511 2019/12/21 13:00:24 ad Exp $ */
+/* $NetBSD: init_main.c,v 1.512 2019/12/22 15:00:42 ad Exp $ */
/*-
* Copyright (c) 2008, 2009, 2019 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.511 2019/12/21 13:00:24 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.512 2019/12/22 15:00:42 ad Exp $");
#include "opt_ddb.h"
#include "opt_inet.h"
@@ -1174,6 +1174,6 @@ banner(void)
(*pr)("%s%s", copyright, version);
format_bytes(pbuf, MEM_PBUFSIZE, ctob((uint64_t)physmem));
(*pr)("total memory = %s\n", pbuf);
- format_bytes(pbuf, MEM_PBUFSIZE, ctob(uvm_free()));
+ format_bytes(pbuf, MEM_PBUFSIZE, ctob((uint64_t)uvm_free()));
(*pr)("avail memory = %s\n", pbuf);
}