s4: Fix bad review I did in dom_sid_parse_length() code.
authorJeremy Allison <jra@samba.org>
Wed, 29 Apr 2015 00:20:42 +0000 (17:20 -0700)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 29 Apr 2015 06:20:23 +0000 (08:20 +0200)
Volker, apologies for the mistake.

Spotted by Andrew Bartlett <abartlet@samba.org>

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Apr 29 08:20:23 CEST 2015 on sn-devel-104

libcli/security/dom_sid.c

index 291043446b0add739d5168b48dc425417548de55..8b30ee67eea9e5a4854e3a56e35858a0236e8306 100644 (file)
@@ -244,7 +244,8 @@ struct dom_sid *dom_sid_parse_talloc(TALLOC_CTX *mem_ctx, const char *sidstr)
 struct dom_sid *dom_sid_parse_length(TALLOC_CTX *mem_ctx, const DATA_BLOB *sid)
 {
        char p[sid->length+1];
-       memcpy(p, sid->data, sizeof(p));
+       memcpy(p, sid->data, sid->length);
+       p[sid->length] = '\0';
        return dom_sid_parse_talloc(mem_ctx, p);
 }