Apply same fix (as last commit) to SMD5 as well

This commit is contained in:
Kurt Zeilenga 2004-06-02 20:29:21 +00:00
parent 8b5c9a764c
commit c15a31b673

View File

@ -547,8 +547,7 @@ static int chk_smd5(
unsigned char *orig_pass = NULL; unsigned char *orig_pass = NULL;
/* safety check */ /* safety check */
if (LUTIL_BASE64_DECODE_LEN(passwd->bv_len) < if (LUTIL_BASE64_DECODE_LEN(passwd->bv_len) <= sizeof(MD5digest)) {
sizeof(MD5digest)+SALT_SIZE) {
return LUTIL_PASSWD_ERR; return LUTIL_PASSWD_ERR;
} }
@ -560,7 +559,7 @@ static int chk_smd5(
rc = lutil_b64_pton(passwd->bv_val, orig_pass, passwd->bv_len); rc = lutil_b64_pton(passwd->bv_val, orig_pass, passwd->bv_len);
if (rc < (int)(sizeof(MD5digest)+SALT_SIZE)) { if (rc <= (int)(sizeof(MD5digest))) {
ber_memfree(orig_pass); ber_memfree(orig_pass);
return LUTIL_PASSWD_ERR; return LUTIL_PASSWD_ERR;
} }