Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Oct 2015 18:02:51 +0000 (UTC)
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r289048 - stable/9/contrib/libcxxrt
Message-ID:  <201510081802.t98I2pI9046626@repo.freebsd.org>

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



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