From ac19531ad7822a885dcfa3b35aadb64168773299 Mon Sep 17 00:00:00 2001 From: Eduardo Chappa Date: Mon, 6 Jul 2020 03:04:58 -0600 Subject: * Alpine might offer more than one client-id when trying to use XOAUTH2 with a server for which it is configured with only one client-id. --- alpine/xoauth2conf.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/alpine/xoauth2conf.c b/alpine/xoauth2conf.c index 1322777..0058a3e 100644 --- a/alpine/xoauth2conf.c +++ b/alpine/xoauth2conf.c @@ -300,10 +300,9 @@ oauth2_get_client_info(unsigned char *name, char *user) } free_xoauth2_info(&x); } - for(i = 0; xoauth_default[i].name != NULL && strcmp(xoauth_default[i].name, name); i++){ - for(j = 0; xinfo && xinfo[j] && !same_xoauth2_info(xoauth_default[i], *xinfo[j]); j++); - if(xoauth_default[i].name && !xinfo[j]) xinfo[matches++] = copy_xoauth2_info(&xoauth_default[i]); - } + for(i = 0; xoauth_default[i].name != NULL && strcmp(xoauth_default[i].name, name); i++); + for(j = 0; xinfo && xinfo[j] && !same_xoauth2_info(xoauth_default[i], *xinfo[j]); j++); + if(!xinfo[j]) xinfo[matches++] = copy_xoauth2_info(&xoauth_default[i]); /* if after removing the duplicate entries, we only have one, use it */ if(matches == 1){ -- cgit v1.2.3-54-g00ecf