Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Dec 2017 23:16:47 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r326886 - head/stand/libsa
Message-ID:  <201712152316.vBFNGlwu041262@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201712152316.vBFNGlwu041262>