From fe210692fd0699e91d0194b44dc5faf278d90093 Mon Sep 17 00:00:00 2001 From: Tim Kosse Date: Tue, 11 Aug 2015 13:45:26 +0200 Subject: [PATCH] Detect end of string in fingerprint alignment. This prevents writing past the end of the buffer should ssh2_fingerprint ever return a fingerprint not containing a colon. --- windows/winpgnt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windows/winpgnt.c b/windows/winpgnt.c index 58b5af70..e9d91e3d 100644 --- a/windows/winpgnt.c +++ b/windows/winpgnt.c @@ -304,7 +304,7 @@ void keylist_update(void) pos = 0; while (1) { pos += strcspn(listentry + pos, " :"); - if (listentry[pos] == ':') + if (listentry[pos] == ':' || !listentry[pos]) break; listentry[pos++] = '\t'; }