audit_logging: Use dom_sid_str_buf
authorVolker Lendecke <vl@samba.org>
Fri, 26 Oct 2018 06:25:14 +0000 (08:25 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 2 Nov 2018 20:21:16 +0000 (21:21 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/audit_logging/audit_logging.c

index c274e9719255ac5551d635416cce4212eb85b375..acccb9f7ab9611b90f388a66a6419c14c799d2df 100644 (file)
@@ -826,14 +826,14 @@ int json_add_sid(struct json_object *object,
                        return ret;
                }
        } else {
-               char sid_buf[DOM_SID_STR_BUFLEN];
+               struct dom_sid_buf sid_buf;
 
-               dom_sid_string_buf(sid, sid_buf, sizeof(sid_buf));
-               ret = json_add_string(object, name, sid_buf);
+               ret = json_add_string(
+                       object, name, dom_sid_str_buf(sid, &sid_buf));
                if (ret != 0) {
                        DBG_ERR("Unable to add SID [%s] value [%s]\n",
                                name,
-                               sid_buf);
+                               sid_buf.buf);
                        return ret;
                }
        }