From ef3959992e3c7b5226da66505881fe2f73479c28 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Thu, 14 May 2015 09:16:26 +0100 Subject: [PATCH] Add a check for NULL in pageant_forget_passphrases(). I've no reason to believe it will _currently_ be called with the 'passphrases' tree not even set up yet, but I managed to get that to happen while playing about with experimental code just now, and it seemed like a good safety check to keep in general. --- pageant.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pageant.c b/pageant.c index 2bb1c8f5..da320681 100644 --- a/pageant.c +++ b/pageant.c @@ -1172,6 +1172,9 @@ static tree234 *passphrases = NULL; */ void pageant_forget_passphrases(void) { + if (!passphrases) /* in case we never set it up at all */ + return; + while (count234(passphrases) > 0) { char *pp = index234(passphrases, 0); smemclr(pp, strlen(pp)); -- 2.45.2