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 2010/03/25 12:32:13 UTC

svn commit: r927350 - /subversion/trunk/subversion/libsvn_subr/stream.c

Author: stsp
Date: Thu Mar 25 11:32:13 2010
New Revision: 927350

URL: http://svn.apache.org/viewvc?rev=927350&view=rev
Log:
* subversion/libsvn_subr/stream.c
  (read_range_handler_apr): Always verify that the reader won't read behind
   the end of the range. We wrongly skipped this check if the reader was
   positioned before the start of the range.

Found by: julianfoad

Modified:
    subversion/trunk/subversion/libsvn_subr/stream.c

Modified: subversion/trunk/subversion/libsvn_subr/stream.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/stream.c?rev=927350&r1=927349&r2=927350&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/stream.c (original)
+++ subversion/trunk/subversion/libsvn_subr/stream.c Thu Mar 25 11:32:13 2010
@@ -848,12 +848,10 @@ read_range_handler_apr(void *baton, char
           *len = 0;
           return SVN_NO_ERROR;
         }
-      else
-        {
-          /* We're in range, but don't read over the end of the range. */
-          if (pos + *len > btn->end)
-              *len = btn->end - pos;
-        }
+
+      /* We're in range, but don't read over the end of the range. */
+      if (pos + *len > btn->end)
+        *len = btn->end - pos;
     }
 
   return read_handler_apr(baton, buffer, len);