svn commit: r289048 - stable/9/contrib/libcxxrt

Bryan Drewery bdrewery at FreeBSD.org
Thu Oct 8 18:02:52 UTC 2015


Author: bdrewery
Date: Thu Oct  8 18:02:50 2015
New Revision: 289048
URL: https://svnweb.freebsd.org/changeset/base/289048

Log:
  MFC r288238:
  
    MFV c3ccd112: Correct off-by-ones in free_exception of emergency buffer

Modified:
  stable/9/contrib/libcxxrt/exception.cc
Directory Properties:
  stable/9/contrib/libcxxrt/   (props changed)

Modified: stable/9/contrib/libcxxrt/exception.cc
==============================================================================
--- stable/9/contrib/libcxxrt/exception.cc	Thu Oct  8 18:02:43 2015	(r289047)
+++ stable/9/contrib/libcxxrt/exception.cc	Thu Oct  8 18:02:50 2015	(r289048)
@@ -516,7 +516,7 @@ static void emergency_malloc_free(char *
 			break;
 		}
 	}
-	assert(buffer > 0 &&
+	assert(buffer >= 0 &&
 	       "Trying to free something that is not an emergency buffer!");
 	// emergency_malloc() is expected to return 0-initialized data.  We don't
 	// zero the buffer when allocating it, because the static buffers will
@@ -556,7 +556,7 @@ static void free_exception(char *e)
 {
 	// If this allocation is within the address range of the emergency buffer,
 	// don't call free() because it was not allocated with malloc()
-	if ((e > emergency_buffer) &&
+	if ((e >= emergency_buffer) &&
 	    (e < (emergency_buffer + sizeof(emergency_buffer))))
 	{
 		emergency_malloc_free(e);


More information about the svn-src-stable-9 mailing list