From 38198e8f3e07351af88db4b931271977e23e13fd Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 26 Jul 2011 11:01:36 +1000 Subject: nsswitch: make the wbcSidsToUnixIds() parser more robust this allows it to handle new types of responses Pair-Programmed-With: Andrew Bartlett --- nsswitch/libwbclient/wbc_idmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nsswitch/libwbclient') diff --git a/nsswitch/libwbclient/wbc_idmap.c b/nsswitch/libwbclient/wbc_idmap.c index ad3cfe6770..5325dbe5ce 100644 --- a/nsswitch/libwbclient/wbc_idmap.c +++ b/nsswitch/libwbclient/wbc_idmap.c @@ -372,10 +372,10 @@ wbcErr wbcSidsToUnixIds(const struct wbcDomainSid *sids, uint32_t num_sids, break; default: id->type = WBC_ID_TYPE_NOT_SPECIFIED; - q = p; + q = strchr(p, '\n'); break; }; - if (q[0] != '\n') { + if (q == NULL || q[0] != '\n') { goto wbc_err_invalid; } p = q+1; -- cgit