diff options
author | Volker Lendecke <vl@samba.org> | 2008-06-27 11:19:26 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2008-06-27 11:23:20 +0200 |
commit | 2a5dee28928d412216bfbcbba0f6bc8352ca6674 (patch) | |
tree | e29368deec13828fca7492edb3a181f17506dbd6 /source3/nsswitch | |
parent | f287cdb1f046ccd5868c0553b6a79643f9782b01 (diff) | |
download | samba-2a5dee28928d412216bfbcbba0f6bc8352ca6674.tar.gz samba-2a5dee28928d412216bfbcbba0f6bc8352ca6674.tar.bz2 samba-2a5dee28928d412216bfbcbba0f6bc8352ca6674.zip |
Fix an "invalid operation involving NULL pointer" found by the IBM checker
Jerry, please check!
Volker
(This used to be commit eb6096a2d488d64cfa86e01be2a97e14e5773fe3)
Diffstat (limited to 'source3/nsswitch')
-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; } |