summaryrefslogtreecommitdiffstats
path: root/freebsd/crypto/openssl/crypto/srp/srp_vfy.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--freebsd/crypto/openssl/crypto/srp/srp_vfy.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/freebsd/crypto/openssl/crypto/srp/srp_vfy.c b/freebsd/crypto/openssl/crypto/srp/srp_vfy.c
index a9a08180..77ad2b6d 100644
--- a/freebsd/crypto/openssl/crypto/srp/srp_vfy.c
+++ b/freebsd/crypto/openssl/crypto/srp/srp_vfy.c
@@ -88,10 +88,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;
@@ -129,7 +132,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)