You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2014/02/13 20:55:35 UTC
svn commit: r1568020 -
/subversion/branches/1.8.x-r1567985/subversion/libsvn_subr/cache-membuffer.c
Author: stefan2
Date: Thu Feb 13 19:55:34 2014
New Revision: 1568020
URL: http://svn.apache.org/r1568020
Log:
Follow-up to r1568018: actually commit the source change.
Modified:
subversion/branches/1.8.x-r1567985/subversion/libsvn_subr/cache-membuffer.c
Modified: subversion/branches/1.8.x-r1567985/subversion/libsvn_subr/cache-membuffer.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1567985/subversion/libsvn_subr/cache-membuffer.c?rev=1568020&r1=1568019&r2=1568020&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1567985/subversion/libsvn_subr/cache-membuffer.c (original)
+++ subversion/branches/1.8.x-r1567985/subversion/libsvn_subr/cache-membuffer.c Thu Feb 13 19:55:34 2014
@@ -422,7 +422,7 @@ struct svn_membuffer_t
*/
apr_uint64_t current_data;
- /* Total number of data buffer bytes in use. This is for statistics only.
+ /* Total number of data buffer bytes in use.
*/
apr_uint64_t data_used;
@@ -1374,7 +1374,11 @@ membuffer_cache_set_internal(svn_membuff
* the old spot, just re-use that space. */
if (entry && ALIGN_VALUE(entry->size) >= size && buffer)
{
- cache->data_used += size - entry->size;
+ /* Careful! We need to cast SIZE to the full width of CACHE->DATA_USED
+ * lest we run into trouble with 32 bit underflow *not* treated as a
+ * negative value.
+ */
+ cache->data_used += (apr_uint64_t)size - entry->size;
entry->size = size;
#ifdef SVN_DEBUG_CACHE_MEMBUFFER