Date: Thu, 8 Oct 2015 18:02:43 +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-10@freebsd.org Subject: svn commit: r289047 - stable/10/contrib/libcxxrt Message-ID: <201510081802.t98I2hpm046579@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bdrewery Date: Thu Oct 8 18:02:43 2015 New Revision: 289047 URL: https://svnweb.freebsd.org/changeset/base/289047 Log: MFC r288238: MFV c3ccd112: Correct off-by-ones in free_exception of emergency buffer Modified: stable/10/contrib/libcxxrt/exception.cc Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/libcxxrt/exception.cc ============================================================================== --- stable/10/contrib/libcxxrt/exception.cc Thu Oct 8 18:01:56 2015 (r289046) +++ stable/10/contrib/libcxxrt/exception.cc Thu Oct 8 18:02:43 2015 (r289047) @@ -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.t98I2hpm046579>