summaryrefslogtreecommitdiff
path: root/source4/dsdb
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-05-10 20:02:21 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-05-10 20:02:21 +0200
commitfa87027592f71179c22f132e375038217bc9d36a (patch)
treec39b03a8212444c88869eb5d9c3a85bce7d098d9 /source4/dsdb
parent6276343ce1b7dd7d217e5a419c09f209f5f87379 (diff)
downloadsamba-fa87027592f71179c22f132e375038217bc9d36a.tar.gz
samba-fa87027592f71179c22f132e375038217bc9d36a.tar.bz2
samba-fa87027592f71179c22f132e375038217bc9d36a.zip
s4:password hash LDB module - check that password hashes are != NULL before copying them
Diffstat (limited to 'source4/dsdb')
-rw-r--r--source4/dsdb/samdb/ldb_modules/password_hash.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/password_hash.c b/source4/dsdb/samdb/ldb_modules/password_hash.c
index 2fcb6aed6d..7717b03621 100644
--- a/source4/dsdb/samdb/ldb_modules/password_hash.c
+++ b/source4/dsdb/samdb/ldb_modules/password_hash.c
@@ -1778,9 +1778,11 @@ static int setup_io(struct ph_context *ac,
return LDB_ERR_CONSTRAINT_VIOLATION;
}
- io->n.nt_hash = talloc(io->ac, struct samr_Password);
- memcpy(io->n.nt_hash->hash, quoted_utf16->data,
- MIN(quoted_utf16->length, sizeof(io->n.nt_hash->hash)));
+ if (quoted_utf16 != NULL) {
+ io->n.nt_hash = talloc(io->ac, struct samr_Password);
+ memcpy(io->n.nt_hash->hash, quoted_utf16->data,
+ MIN(quoted_utf16->length, sizeof(io->n.nt_hash->hash)));
+ }
}
/* Checks and converts the previous "unicodePwd" attribute */
@@ -1827,9 +1829,11 @@ static int setup_io(struct ph_context *ac,
return LDB_ERR_UNWILLING_TO_PERFORM;
}
- io->og.nt_hash = talloc(io->ac, struct samr_Password);
- memcpy(io->og.nt_hash->hash, old_quoted_utf16->data,
- MIN(old_quoted_utf16->length, sizeof(io->og.nt_hash->hash)));
+ if (old_quoted_utf16 != NULL) {
+ io->og.nt_hash = talloc(io->ac, struct samr_Password);
+ memcpy(io->og.nt_hash->hash, old_quoted_utf16->data,
+ MIN(old_quoted_utf16->length, sizeof(io->og.nt_hash->hash)));
+ }
}
/* Handles the "dBCSPwd" attribute (LM hash) */