aboutsummaryrefslogtreecommitdiff
path: root/apps/enc.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/enc.c')
-rw-r--r--apps/enc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/enc.c b/apps/enc.c
index f4f9a4c4a4e5..8f5e5b89359f 100644
--- a/apps/enc.c
+++ b/apps/enc.c
@@ -226,7 +226,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) &&