]> sjero.net Git - wget/blobdiff - src/utils.c
[svn] Fix crash when post-file is missing.
[wget] / src / utils.c
index fb180e8da5a2754a9e116ab732a41148a8020de0..99b317f7b44236032b5431747d614425406e60d6 100644 (file)
@@ -574,6 +574,8 @@ file_size (const char *filename)
      that way we can also verify whether the file is readable.
      Inspired by the POST patch by Arnaud Wylie.  */
   FILE *fp = fopen (filename, "rb");
+  if (!fp)
+    return -1;
   fseek (fp, 0, SEEK_END);
   size = ftell (fp);
   fclose (fp);