]> Zhao Yanbai Git Server - minix.git/commitdiff
Prevent the use of an unitialized variable for block size in CRC calculation.
authorKees van Reeuwijk <reeuwijk@few.vu.nl>
Tue, 9 Mar 2010 16:21:41 +0000 (16:21 +0000)
committerKees van Reeuwijk <reeuwijk@few.vu.nl>
Tue, 9 Mar 2010 16:21:41 +0000 (16:21 +0000)
commands/pax/file_subs.c

index 89e4a6d3944034b9cef13e135f2647fabbe0c785..9157df72aa1a35d1acb97880bb37048176e67229 100644 (file)
@@ -938,7 +938,7 @@ set_crc(ARCHD *arcn, int fd)
        int i;
        int res;
        off_t cpcnt = 0L;
-       u_long size;
+       u_long size = FILEBLK;
        unsigned long crc = 0L;
        char tbuf[FILEBLK];
        struct stat sb;
@@ -951,12 +951,6 @@ set_crc(ARCHD *arcn, int fd)
                return(0);
        }
 
-#if 0
-       /* not in minix */
-       if ((size = (u_long)arcn->sb.st_blksize) > (u_long)sizeof(tbuf))
-               size = (u_long)sizeof(tbuf);
-#endif
-
        /*
         * read all the bytes we think that there are in the file. If the user
         * is trying to archive an active file, forget this file.