summaryrefslogtreecommitdiff
path: root/libcli/security/dom_sid.c
diff options
context:
space:
mode:
Diffstat (limited to 'libcli/security/dom_sid.c')
-rw-r--r--libcli/security/dom_sid.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libcli/security/dom_sid.c b/libcli/security/dom_sid.c
index 6a046cd806..8a2ed1fccc 100644
--- a/libcli/security/dom_sid.c
+++ b/libcli/security/dom_sid.c
@@ -96,12 +96,20 @@ bool dom_sid_parse(const char *sidstr, struct dom_sid *ret)
sidstr += 2;
+ if (!isdigit(sidstr[0])) {
+ return false;
+ }
+
rev = strtoul(sidstr, &p, 10);
if (*p != '-') {
return false;
}
sidstr = p+1;
+ if (!isdigit(sidstr[0])) {
+ return false;
+ }
+
ia = strtoul(sidstr, &p, 10);
if (p == sidstr) {
return false;
@@ -131,6 +139,11 @@ bool dom_sid_parse(const char *sidstr, struct dom_sid *ret)
return false;
}
sidstr++;
+
+ if (!isdigit(sidstr[0])) {
+ return false;
+ }
+
ret->sub_auths[i] = strtoul(sidstr, &p, 10);
if (p == sidstr) {
return false;