svn commit: r326886 - head/stand/libsa

Warner Losh imp at FreeBSD.org
Fri Dec 15 23:16:50 UTC 2017


Author: imp
Date: Fri Dec 15 23:16:47 2017
New Revision: 326886
URL: https://svnweb.freebsd.org/changeset/base/326886

Log:
  Panic in sbrk if setheap hasn't been called yet. This is preferable to
  a mysterious crash.
  
  Sponsored by: Netflix

Modified:
  head/stand/libsa/sbrk.c

Modified: head/stand/libsa/sbrk.c
==============================================================================
--- head/stand/libsa/sbrk.c	Fri Dec 15 23:16:42 2017	(r326885)
+++ head/stand/libsa/sbrk.c	Fri Dec 15 23:16:47 2017	(r326886)
@@ -52,6 +52,9 @@ sbrk(int incr)
 {
     char	*ret;
     
+    if (heapbase == 0)
+	    panic("No heap setup\n");
+
     if ((heapsize + incr) <= maxheap) {
 	ret = (char *)heapbase + heapsize;
 	bzero(ret, incr);


More information about the svn-src-all mailing list