From: Günther Deschner Date: Tue, 12 Jun 2018 10:54:15 +0000 (+0200) Subject: s4-dsdb: fix the build of audit_util.c X-Git-Tag: tevent-0.9.37~322 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d4f2294c9eeec31f9d087e4fb70611d8d824db8;p=thirdparty%2Fsamba.git s4-dsdb: fix the build of audit_util.c Guenther Signed-off-by: Guenther Deschner Reviewed-by: Volker Lendecke Autobuild-User(master): Volker Lendecke Autobuild-Date(master): Sat Jun 16 11:56:53 CEST 2018 on sn-devel-144 --- diff --git a/source4/dsdb/samdb/ldb_modules/audit_util.c b/source4/dsdb/samdb/ldb_modules/audit_util.c index e36ddcb90eb..be2c522ace7 100644 --- a/source4/dsdb/samdb/ldb_modules/audit_util.c +++ b/source4/dsdb/samdb/ldb_modules/audit_util.c @@ -470,6 +470,9 @@ static void dsdb_audit_add_ldb_value( struct json_object *array, const struct ldb_val lv) { + bool base64; + int len; + struct json_object value; json_assert_is_array(array); if (json_is_invalid(array)) { @@ -481,9 +484,10 @@ static void dsdb_audit_add_ldb_value( return; } - bool base64 = ldb_should_b64_encode(NULL, &lv); - int len = min(lv.length, MAX_LENGTH); - struct json_object value = json_new_object(); + base64 = ldb_should_b64_encode(NULL, &lv); + len = min(lv.length, MAX_LENGTH); + value = json_new_object(); + if (lv.length > MAX_LENGTH) { json_add_bool(&value, "truncated", true); }