aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>2018-10-19 10:21:21 +1300
committerMartin Schwenke <martins@samba.org>2018-10-19 03:43:58 +0200
commita0bad1364a9403afc5f457bf71a1eae48ab7b54e (patch)
treec4b326fbe2e891c9f9ea17084bbbf3b2eda596b5
parentce518f387f9f6742f642ce33901cd778375bb4fd (diff)
downloadsamba-a0bad1364a9403afc5f457bf71a1eae48ab7b54e.tar.gz
samba-a0bad1364a9403afc5f457bf71a1eae48ab7b54e.tar.xz
samba-a0bad1364a9403afc5f457bf71a1eae48ab7b54e.zip
ldb_ldif: avoid strlen(NULL)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Fri Oct 19 03:43:58 CEST 2018 on sn-devel-144
-rw-r--r--lib/ldb/common/ldb_ldif.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ldb/common/ldb_ldif.c b/lib/ldb/common/ldb_ldif.c
index ec1859b5c0d..e69467891c9 100644
--- a/lib/ldb/common/ldb_ldif.c
+++ b/lib/ldb/common/ldb_ldif.c
@@ -313,7 +313,7 @@ static int ldb_ldif_write_trace(struct ldb_context *ldb,
for (i=0;i<msg->num_elements;i++) {
const struct ldb_schema_attribute *a;
- size_t namelen = strlen(msg->elements[i].name);
+ size_t namelen;
if (msg->elements[i].name == NULL) {
ldb_debug(ldb, LDB_DEBUG_ERROR,
@@ -322,6 +322,7 @@ static int ldb_ldif_write_trace(struct ldb_context *ldb,
return -1;
}
+ namelen = strlen(msg->elements[i].name);
a = ldb_schema_attribute_by_name(ldb, msg->elements[i].name);
if (ldif->changetype == LDB_CHANGETYPE_MODIFY) {