INN commit: trunk (CONTRIBUTORS storage/timecaf/caf.c)

INN Commit rra at isc.org
Tue Jun 25 17:13:31 UTC 2013


    Date: Tuesday, June 25, 2013 @ 10:13:31
  Author: iulius
Revision: 9492

fix segfault during dereferencing

Remove a useless unlink().

Thanks to David Binderman for having reported the issue.

Modified:
  trunk/CONTRIBUTORS
  trunk/storage/timecaf/caf.c

-----------------------+
 CONTRIBUTORS          |    2 +-
 storage/timecaf/caf.c |   21 +++++++++++----------
 2 files changed, 12 insertions(+), 11 deletions(-)

Modified: CONTRIBUTORS
===================================================================
--- CONTRIBUTORS	2013-06-24 18:36:24 UTC (rev 9491)
+++ CONTRIBUTORS	2013-06-25 17:13:31 UTC (rev 9492)
@@ -275,4 +275,4 @@
 Lars Magne Ingebrigtsen, Sam Varshavchik, Matthew Vernon, Ian Jackson,
 Edmund H. Ramm, Raphael Barrois, Bo Lindbergh, Matthias Meyser,
 Dennis Preiser, Paolo Amoroso, Dennis Davis, River Tarnell, Jochen Schmitt,
-Tim Fardell, Remco Rijnders
+Tim Fardell, Remco Rijnders, David Binderman

Modified: storage/timecaf/caf.c
===================================================================
--- storage/timecaf/caf.c	2013-06-24 18:36:24 UTC (rev 9491)
+++ storage/timecaf/caf.c	2013-06-25 17:13:31 UTC (rev 9492)
@@ -1559,15 +1559,14 @@
 	    ** this next fseeko might actually fail, because we have buffered
 	    ** stuff that might fail on write.
 	    */
-	    if (fseeko(infile, sizeof(CAFHEADER) + head.FreeZoneTabSize,
-		       SEEK_SET) < 0) {
-		perror(path);
-		free(tocarray);
-		free(newpath);
-		fclose(infile);
-		unlink(newpath);
-		return -1;
-	    }
+            if (fseeko(infile, sizeof(CAFHEADER) + head.FreeZoneTabSize,
+                       SEEK_SET) < 0) {
+                perror(path);
+                free(tocarray);
+                free(newpath);
+                fclose(infile);
+                return -1;
+            }
 	    if (fwrite(tocarray, sizeof(CAFTOCENT), head.High - newlow + 1, infile) < head.High - newlow + 1
 		|| fflush(infile) < 0) {
 		CAFError(CAF_ERR_IO);
@@ -1682,7 +1681,9 @@
 
     /* initialize blocksize, zeroes buffer. */
     blocksize = newhead.BlockSize;
-    if (blocksize == 0) blocksize=CAF_DEFAULT_BLOCKSIZE;
+    if (blocksize == 0) {
+        blocksize=CAF_DEFAULT_BLOCKSIZE;
+    }
 
     zerobuff = xcalloc(blocksize, 1);
 



More information about the inn-committers mailing list