]> andersk Git - openssh.git/commitdiff
- avsm@cvs.openbsd.org 2003/07/09 13:58:19
authordtucker <dtucker>
Mon, 14 Jul 2003 07:28:34 +0000 (07:28 +0000)
committerdtucker <dtucker>
Mon, 14 Jul 2003 07:28:34 +0000 (07:28 +0000)
     [key.c]
     minor tweak: when generating the hex fingerprint, give strlcat the full
     bound to the buffer, and add a comment below explaining why the
     zero-termination is one less than the bound.  markus@ ok

ChangeLog
key.c

index 1915d44ff637502fd122fc4b5e17df35a3d10391..0f413d52fc9f3ba0b53f6ab0899ada7f177dc584 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,12 @@
    Call setauthdb() before loginfailed(), which may load password registry-
    specific functions.  Based on patch by cawlfiel@us.ibm.com.
  - (dtucker) [port-aix.h] Fix prototypes.
+ - (dtucker) OpenBSD CVS Sync
+   - avsm@cvs.openbsd.org 2003/07/09 13:58:19
+     [key.c]
+     minor tweak: when generating the hex fingerprint, give strlcat the full
+     bound to the buffer, and add a comment below explaining why the
+     zero-termination is one less than the bound.  markus@ ok
 
 20030708
  - (dtucker) [acconfig.h auth-passwd.c configure.ac session.c port-aix.[ch]]
diff --git a/key.c b/key.c
index b101e1b271c763b2467bc3bad5d5b04027e677d4..54318cbbfa438f42f2081c4abcdf1f84ed645314 100644 (file)
--- a/key.c
+++ b/key.c
@@ -32,7 +32,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include "includes.h"
-RCSID("$OpenBSD: key.c,v 1.53 2003/06/24 08:23:46 markus Exp $");
+RCSID("$OpenBSD: key.c,v 1.54 2003/07/09 13:58:19 avsm Exp $");
 
 #include <openssl/evp.h>
 
@@ -236,8 +236,10 @@ key_fingerprint_hex(u_char *dgst_raw, u_int dgst_raw_len)
        for (i = 0; i < dgst_raw_len; i++) {
                char hex[4];
                snprintf(hex, sizeof(hex), "%02x:", dgst_raw[i]);
-               strlcat(retval, hex, dgst_raw_len * 3);
+               strlcat(retval, hex, dgst_raw_len * 3 + 1);
        }
+
+       /* Remove the trailing ':' character */
        retval[(dgst_raw_len * 3) - 1] = '\0';
        return retval;
 }
This page took 0.059761 seconds and 5 git commands to generate.