aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/srp/srp_vfy.c
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2017-05-25 19:38:38 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2017-05-25 19:38:38 +0000
commit12df5ad9af4981f5d3c31a9819d31618c0f1af51 (patch)
tree97e3336a3054b8d8a0150b9d414934f73c99cb30 /crypto/srp/srp_vfy.c
parent5315173646e65b5025be33013edc33eb9658e683 (diff)
downloadsrc-12df5ad9af4981f5d3c31a9819d31618c0f1af51.tar.gz
src-12df5ad9af4981f5d3c31a9819d31618c0f1af51.zip
Import OpenSSL 1.0.2l.vendor/openssl/1.0.2l
Notes
Notes: svn path=/vendor-crypto/openssl/dist/; revision=318897 svn path=/vendor-crypto/openssl/1.0.2l/; revision=318898; tag=vendor/openssl/1.0.2l
Diffstat (limited to 'crypto/srp/srp_vfy.c')
-rw-r--r--crypto/srp/srp_vfy.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/crypto/srp/srp_vfy.c b/crypto/srp/srp_vfy.c
index a8ec52a4dadc..c8bc7a94b26c 100644
--- a/crypto/srp/srp_vfy.c
+++ b/crypto/srp/srp_vfy.c
@@ -86,10 +86,13 @@ static int t_fromb64(unsigned char *a, size_t alen, const char *src)
int i, j;
int size;
+ if (alen == 0 || alen > INT_MAX)
+ return -1;
+
while (*src && (*src == ' ' || *src == '\t' || *src == '\n'))
++src;
size = strlen(src);
- if (alen > INT_MAX || size > (int)alen)
+ if (size < 0 || size >= (int)alen)
return -1;
i = 0;
@@ -127,7 +130,7 @@ static int t_fromb64(unsigned char *a, size_t alen, const char *src)
if (--i < 0)
break;
}
- while (a[j] == 0 && j <= size)
+ while (j <= size && a[j] == 0)
++j;
i = 0;
while (j <= size)