]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Detect end of string in fingerprint alignment.
authorTim Kosse <tim.kosse@filezilla-project.org>
Tue, 11 Aug 2015 11:45:26 +0000 (13:45 +0200)
committerSimon Tatham <anakin@pobox.com>
Sat, 15 Aug 2015 12:54:41 +0000 (13:54 +0100)
This prevents writing past the end of the buffer should
ssh2_fingerprint ever return a fingerprint not containing a colon.

windows/winpgnt.c

index 58b5af70cd81013bc21febbc509d5c5a2bda0cc3..e9d91e3db237d9d88b758806f04db44fbd9ec50a 100644 (file)
@@ -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';
             }