In random art visualization, make sure to use the end marker only at the
authorgrunk <grunk@openbsd.org>
Fri, 25 Jul 2008 07:05:16 +0000 (07:05 +0000)
committergrunk <grunk@openbsd.org>
Fri, 25 Jul 2008 07:05:16 +0000 (07:05 +0000)
end.  Initial diff by Dirk Loss, tweaks and ok djm@

usr.bin/ssh/key.c

index 5b0a584..31d5ce8 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: key.c,v 1.78 2008/07/07 23:32:51 stevesk Exp $ */
+/* $OpenBSD: key.c,v 1.79 2008/07/25 07:05:16 grunk Exp $ */
 /*
  * read_bignum():
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -365,7 +365,8 @@ key_fingerprint_randomart(u_char *dgst_raw, u_int dgst_raw_len, const Key *k)
                        y = MIN(y, FLDSIZE_Y - 1);
 
                        /* augment the field */
-                       field[x][y]++;
+                       if (field[x][y] < len - 2)
+                               field[x][y]++;
                        input = input >> 2;
                }
        }