Found by AddressSanitizer
Change-Id: I82e35aea60726053c79510ba8ed3eedfaf553eb7
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Matthieu Patou <mat@matws.net>
Autobuild-User(master): Matthieu Patou <mat@samba.org>
Autobuild-Date(master): Mon Oct 13 08:28:15 CEST 2014 on sn-devel-104
if (nt_pwd) {
unsigned int num_nt;
num_nt = samdb_result_hashes(mem_ctx, msg, "ntPwdHistory", &ntPwdHash);
- if (num_nt < idx) {
+ if (num_nt <= idx) {
*nt_pwd = NULL;
} else {
*nt_pwd = &ntPwdHash[idx];
if (lpcfg_lanman_auth(lp_ctx)) {
unsigned int num_lm;
num_lm = samdb_result_hashes(mem_ctx, msg, "lmPwdHistory", &lmPwdHash);
- if (num_lm < idx) {
+ if (num_lm <= idx) {
*lm_pwd = NULL;
} else {
*lm_pwd = &lmPwdHash[idx];