diff options
-rw-r--r-- | source3/nsswitch/libwbclient/wbc_sid.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source3/nsswitch/libwbclient/wbc_sid.c b/source3/nsswitch/libwbclient/wbc_sid.c index eb115e1297..f3d58960f2 100644 --- a/source3/nsswitch/libwbclient/wbc_sid.c +++ b/source3/nsswitch/libwbclient/wbc_sid.c @@ -141,9 +141,13 @@ wbcErr wbcStringToSid(const char *str, while (sid->num_auths < WBC_MAXSUBAUTHS) { if ((x=(uint32_t)strtoul(p, &q, 10)) == 0) break; + if (q == NULL) { + wbc_status = WBC_ERR_INVALID_SID; + BAIL_ON_WBC_ERROR(wbc_status); + } sid->sub_auths[sid->num_auths++] = x; - if (q && ((*q!='-') || (*q=='\0'))) + if ((*q!='-') || (*q=='\0')) break; p = q + 1; } |