add EVP_CIPH_FLAG_LENGTH_BITS from 0.9.8-stable
[openssl.git] / apps / enc.c
index 53de51ad72189a0aecb16e3d96c02079a22896a7..3c2c91e920df82dc342559562b8175f922275349 100644 (file)
@@ -243,7 +243,12 @@ int MAIN(int argc, char **argv)
                                goto bad;
                                }
                        buf[0]='\0';
-                       fgets(buf,sizeof buf,infile);
+                       if (!fgets(buf,sizeof buf,infile))
+                               {
+                               BIO_printf(bio_err,"unable to read key from '%s'\n",
+                                       file);
+                               goto bad;
+                               }
                        fclose(infile);
                        i=strlen(buf);
                        if ((i > 0) &&