From 38198e8f3e07351af88db4b931271977e23e13fd Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 26 Jul 2011 11:01:36 +1000 Subject: [PATCH] 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(-) diff --git a/nsswitch/libwbclient/wbc_idmap.c b/nsswitch/libwbclient/wbc_idmap.c index ad3cfe67709..5325dbe5ce5 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; -- 2.34.1