fix tricky signed/unsigned comparison (ITS#2835)

This commit is contained in:
Pierangelo Masarati 2003-11-22 16:06:38 +00:00
parent aba062ee36
commit 88e8caf3e1

View file

@ -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;
}