summaryrefslogtreecommitdiffstats
path: root/apps/ca.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2009-10-04 16:42:56 +0000
committerDr. Stephen Henson <steve@openssl.org>2009-10-04 16:42:56 +0000
commit0e039aa7976eb2278339441125473d7219bee413 (patch)
treecbdc049f9c280a52366b89d62b03a363e02f9e46 /apps/ca.c
parentc21869fb07ea02ffd46e817caeb47d85a85ee8ef (diff)
Fix warnings about ignoring fgets return value
Diffstat (limited to 'apps/ca.c')
-rw-r--r--apps/ca.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/apps/ca.c b/apps/ca.c
index 007b501d00..e92ad57d92 100644
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -1263,7 +1263,12 @@ bad:
BIO_printf(bio_err,"\n%d out of %d certificate requests certified, commit? [y/n]",total_done,total);
(void)BIO_flush(bio_err);
buf[0][0]='\0';
- fgets(buf[0],10,stdin);
+ if (!fgets(buf[0],10,stdin))
+ {
+ BIO_printf(bio_err,"CERTIFICATION CANCELED: I/O error\n");
+ ret=0;
+ goto err;
+ }
if ((buf[0][0] != 'y') && (buf[0][0] != 'Y'))
{
BIO_printf(bio_err,"CERTIFICATION CANCELED\n");
@@ -2122,7 +2127,12 @@ again2:
BIO_printf(bio_err,"Sign the certificate? [y/n]:");
(void)BIO_flush(bio_err);
buf[0]='\0';
- fgets(buf,sizeof(buf)-1,stdin);
+ if (!fgets(buf,sizeof(buf)-1,stdin))
+ {
+ BIO_printf(bio_err,"CERTIFICATE WILL NOT BE CERTIFIED: I/O error\n");
+ ok=0;
+ goto err;
+ }
if (!((buf[0] == 'y') || (buf[0] == 'Y')))
{
BIO_printf(bio_err,"CERTIFICATE WILL NOT BE CERTIFIED\n");