Commit 88e8caf3 authored by Pierangelo Masarati's avatar Pierangelo Masarati
Browse files

fix tricky signed/unsigned comparison (ITS#2835)

parent aba062ee
...@@ -485,7 +485,7 @@ static int chk_ssha1( ...@@ -485,7 +485,7 @@ static int chk_ssha1(
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 <= sizeof(SHA1digest)) { if (rc < 0 || (unsigned)rc <= sizeof(SHA1digest)) {
ber_memfree(orig_pass); ber_memfree(orig_pass);
return -1; return -1;
} }
...@@ -566,7 +566,7 @@ static int chk_smd5( ...@@ -566,7 +566,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 <= sizeof(MD5digest)) { if (rc < 0 || (unsigned)rc <= sizeof(MD5digest)) {
ber_memfree(orig_pass); ber_memfree(orig_pass);
return -1; return -1;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment