From: Douglas Bagnall Date: Thu, 22 Mar 2018 03:49:29 +0000 (+1300) Subject: dsdb/util: use parse_guid_string, not sscanf() X-Git-Tag: tevent-0.9.37~464 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c2cac449c89d34f50da98c6eb59442bf63b67477;p=thirdparty%2Fsamba.git dsdb/util: use parse_guid_string, not sscanf() Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c index c227c836d04..36c98df24b3 100644 --- a/source4/dsdb/common/util.c +++ b/source4/dsdb/common/util.c @@ -47,6 +47,8 @@ #include "libds/common/flag_mapping.h" #include "../lib/util/util_runcmd.h" #include "lib/util/access.h" +#include "lib/util/util_str_hex.h" +#include "libcli/util/ntstatus.h" /* * This included to allow us to handle DSDB_FLAG_REPLICATED_UPDATE in @@ -5186,12 +5188,12 @@ _PUBLIC_ NTSTATUS NS_GUID_from_string(const char *s, struct GUID *guid) return NT_STATUS_INVALID_PARAMETER; } - if (11 == sscanf(s, "%08x-%04x%04x-%02x%02x%02x%02x-%02x%02x%02x%02x", - &time_low, &time_mid, &time_hi_and_version, - &clock_seq[0], &clock_seq[1], - &node[0], &node[1], &node[2], &node[3], &node[4], &node[5])) { - status = NT_STATUS_OK; - } + status = parse_guid_string(s, + &time_low, + &time_mid, + &time_hi_and_version, + clock_seq, + node); if (!NT_STATUS_IS_OK(status)) { return status;