summaryrefslogtreecommitdiffstats
path: root/apps/dgst.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dgst.c')
-rw-r--r--apps/dgst.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/dgst.c b/apps/dgst.c
index 2abb3e0b21..83b79c328a 100644
--- a/apps/dgst.c
+++ b/apps/dgst.c
@@ -551,7 +551,7 @@ int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
const char *sig_name, const char *md_name,
const char *file,BIO *bmd)
{
- size_t len;
+ ssize_t len;
int i;
for (;;)
@@ -598,7 +598,14 @@ int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
}
}
else
+ {
len=BIO_gets(bp,(char *)buf,BUFSIZE);
+ if (len <0)
+ {
+ ERR_print_errors(bio_err);
+ return 1;
+ }
+ }
if(binout) BIO_write(out, buf, len);
else