aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/bio/bss_file.c
diff options
context:
space:
mode:
authorBen Laurie <ben@openssl.org>2002-06-11 12:41:37 +0000
committerBen Laurie <ben@openssl.org>2002-06-11 12:41:37 +0000
commitd15711efc6c82d5483dcf73ac7fa3ec5deb2c24a (patch)
tree4684ef0ec0db6e352b36006f98b1682a13fab9d7 /crypto/bio/bss_file.c
parent25ace3ed252a468d4d2b914a54863b2d539bb0b9 (diff)
downloadopenssl-d15711efc6c82d5483dcf73ac7fa3ec5deb2c24a.tar.gz
Handle read errors.
Diffstat (limited to 'crypto/bio/bss_file.c')
-rw-r--r--crypto/bio/bss_file.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/crypto/bio/bss_file.c b/crypto/bio/bss_file.c
index 8b3ff278d9..826b361fa2 100644
--- a/crypto/bio/bss_file.c
+++ b/crypto/bio/bss_file.c
@@ -162,6 +162,12 @@ static int MS_CALLBACK file_read(BIO *b, char *out, int outl)
if (b->init && (out != NULL))
{
ret=fread(out,1,(int)outl,(FILE *)b->ptr);
+ if(ret == 0 && ferror((FILE *)b->ptr))
+ {
+ SYSerr(SYS_F_FREAD,get_last_sys_error());
+ BIOerr(BIO_F_FILE_READ,ERR_R_SYS_LIB);
+ ret=-1;
+ }
}
return(ret);
}