libcli/security: Convert some strtol calls to strtoul
authorVolker Lendecke <vl@samba.org>
Sat, 23 Jan 2010 12:50:59 +0000 (13:50 +0100)
committerVolker Lendecke <vl@samba.org>
Sat, 23 Jan 2010 15:28:11 +0000 (16:28 +0100)
This tightens the dom_sid_parse syntax check a bit: "--" would have been
allowed in sid string

libcli/security/dom_sid.c

index 7cb50c926c4bdeef9a576ac4d308c8c74bd6c716..9952977fa9efb30c68d1c9a3ca20e04c7a4ac5d7 100644 (file)
@@ -96,13 +96,13 @@ bool dom_sid_parse(const char *sidstr, struct dom_sid *ret)
 
        sidstr += 2;
 
-       rev = strtol(sidstr, &p, 10);
+       rev = strtoul(sidstr, &p, 10);
        if (*p != '-') {
                return false;
        }
        sidstr = p+1;
 
-       ia = strtol(sidstr, &p, 10);
+       ia = strtoul(sidstr, &p, 10);
        if (p == sidstr) {
                return false;
        }