summaryrefslogtreecommitdiffstats
path: root/apps/ca.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2009-10-04 16:43:21 +0000
committerDr. Stephen Henson <steve@openssl.org>2009-10-04 16:43:21 +0000
commit2280f82fc6718b8cc07775f7083c0dd663c3ff47 (patch)
tree83dfb457eace074172e10048c3e5fc33591f590a /apps/ca.c
parente6714faffbdfc551ab8b2a50954519dff4bc7b15 (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");