apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r279649 - /apr/apr/branches/1.2.x/file_io/win32/seek.c
Date Thu, 08 Sep 2005 21:47:15 GMT
Author: wrowe
Date: Thu Sep  8 14:47:13 2005
New Revision: 279649

URL: http://svn.apache.org/viewcvs?rev=279649&view=rev
Log:

  Backport rev 265757

  Fix an extranious emit, the file is huge (off_t) but the
  newbufpos is an offset in memory (size_t).


Modified:
    apr/apr/branches/1.2.x/file_io/win32/seek.c

Modified: apr/apr/branches/1.2.x/file_io/win32/seek.c
URL: http://svn.apache.org/viewcvs/apr/apr/branches/1.2.x/file_io/win32/seek.c?rev=279649&r1=279648&r2=279649&view=diff
==============================================================================
--- apr/apr/branches/1.2.x/file_io/win32/seek.c (original)
+++ apr/apr/branches/1.2.x/file_io/win32/seek.c Thu Sep  8 14:47:13 2005
@@ -30,7 +30,11 @@
         thefile->direction = 0;
     }
 
-    newbufpos = pos - (thefile->filePtr - thefile->dataRead);
+    /* We may be truncating to size here. 
+     * XXX: testing an 'unsigned' as >= 0 below indicates a bug
+     */
+    newbufpos = (apr_size_t)(pos - (thefile->filePtr 
+                                  - thefile->dataRead));
 
     if (newbufpos >= 0 && newbufpos <= thefile->dataRead) {
         thefile->bufpos = (apr_size_t)newbufpos;



Mime
View raw message