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 2012/09/08 00:34:45 UTC

svn commit: r1382196 - /subversion/trunk/subversion/libsvn_subr/io.c

Author: stefan2
Date: Fri Sep  7 22:34:44 2012
New Revision: 1382196

URL: http://svn.apache.org/viewvc?rev=1382196&view=rev
Log:
Follow-up to r1381800: there's a nasty 32 / 64 bit signed / unsigned mixup
causing the file pointer to be set to invalid offsets.

Found by: pburba

* subversion/libsvn_subr/io.c:
  (svn_io_read_length_line): convert to the wider, signed type before 
   subtracting

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

Modified: subversion/trunk/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/io.c?rev=1382196&r1=1382195&r2=1382196&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/io.c (original)
+++ subversion/trunk/subversion/libsvn_subr/io.c Fri Sep  7 22:34:44 2012
@@ -3453,7 +3453,7 @@ svn_io_read_length_line(apr_file_t *file
       eol = strchr(buf, '\n');
       if (eol)
         {
-          apr_off_t offset = (eol + 1 - buf) - bytes_read;
+          apr_off_t offset = (eol + 1 - buf) - (apr_off_t)bytes_read;
           
           *eol = 0;
           *limit = total_read + (eol - buf);