From: Volker Lendecke Date: Fri, 26 Oct 2018 06:25:14 +0000 (+0200) Subject: winbindd: Use dom_sid_str_buf X-Git-Tag: tdb-1.3.17~956 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd1e43f7cb8a3a641f064259f7c2831b83262b5a;p=thirdparty%2Fsamba.git winbindd: Use dom_sid_str_buf Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/winbindd/winbindd_xids_to_sids.c b/source3/winbindd/winbindd_xids_to_sids.c index d1424cdb061..29caccd0468 100644 --- a/source3/winbindd/winbindd_xids_to_sids.c +++ b/source3/winbindd/winbindd_xids_to_sids.c @@ -113,17 +113,16 @@ NTSTATUS winbindd_xids_to_sids_recv(struct tevent_req *req, } for (i=0; inum_xids; i++) { - char sidbuf[DOM_SID_STR_BUFLEN]; + struct dom_sid_buf sid_buf; + const char *str = "-"; - if (is_null_sid(&state->sids[i])) { - strlcpy(sidbuf, "-", sizeof(sidbuf)); - } else { - dom_sid_string_buf(&state->sids[i], - sidbuf, sizeof(sidbuf)); + if (!is_null_sid(&state->sids[i])) { + dom_sid_str_buf(&state->sids[i], &sid_buf); + str = sid_buf.buf; } result = talloc_asprintf_append_buffer( - result, "%s\n", sidbuf); + result, "%s\n", str); if (result == NULL) { return NT_STATUS_NO_MEMORY; }