mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-15 19:34:10 -05:00
fix tricky signed/unsigned comparison (ITS#2835)
This commit is contained in:
parent
aba062ee36
commit
88e8caf3e1
1 changed files with 2 additions and 2 deletions
|
|
@ -485,7 +485,7 @@ static int chk_ssha1(
|
|||
|
||||
rc = lutil_b64_pton(passwd->bv_val, orig_pass, passwd->bv_len);
|
||||
|
||||
if (rc <= sizeof(SHA1digest)) {
|
||||
if (rc < 0 || (unsigned)rc <= sizeof(SHA1digest)) {
|
||||
ber_memfree(orig_pass);
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -566,7 +566,7 @@ static int chk_smd5(
|
|||
|
||||
rc = lutil_b64_pton(passwd->bv_val, orig_pass, passwd->bv_len);
|
||||
|
||||
if (rc <= sizeof(MD5digest)) {
|
||||
if (rc < 0 || (unsigned)rc <= sizeof(MD5digest)) {
|
||||
ber_memfree(orig_pass);
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue