diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2009-10-04 16:43:21 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2009-10-04 16:43:21 +0000 |
commit | 2280f82fc6718b8cc07775f7083c0dd663c3ff47 (patch) | |
tree | 83dfb457eace074172e10048c3e5fc33591f590a /apps/ca.c | |
parent | e6714faffbdfc551ab8b2a50954519dff4bc7b15 (diff) |
Fix warnings about ignoring fgets return value
Diffstat (limited to 'apps/ca.c')
-rw-r--r-- | apps/ca.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -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"); |