[BACK]Return to apprentice.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / file

Diff for /src/usr.bin/file/Attic/apprentice.c between version 1.29 and 1.30

version 1.29, 2009/11/11 16:21:51 version 1.30, 2014/01/16 21:45:33
Line 41 
Line 41 
 #ifdef HAVE_UNISTD_H  #ifdef HAVE_UNISTD_H
 #include <unistd.h>  #include <unistd.h>
 #endif  #endif
   #include <limits.h>
 #include <string.h>  #include <string.h>
 #include <assert.h>  #include <assert.h>
 #include <ctype.h>  #include <ctype.h>
Line 1897 
Line 1898 
                 file_error(ms, errno, "cannot stat `%s'", dbname);                  file_error(ms, errno, "cannot stat `%s'", dbname);
                 goto error1;                  goto error1;
         }          }
         if (st.st_size < 8) {          if (st.st_size < 8 || st.st_size > SIZE_MAX) {
                 file_error(ms, 0, "file `%s' is too small", dbname);                  file_error(ms, 0, "file `%s' is too %s", dbname,
                       st.st_size > SIZE_MAX ? "large" : "small");
                 goto error1;                  goto error1;
         }          }
   

Legend:
Removed from v.1.29  
changed lines
  Added in v.1.30