Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/crypto/external/bsd/openssl/lib/libcrypto sizeof(array - 1) ...



details:   https://anonhg.NetBSD.org/src/rev/6f867f956636
branches:  trunk
changeset: 794872:6f867f956636
user:      apb <apb%NetBSD.org@localhost>
date:      Thu Mar 27 16:26:22 2014 +0000

description:
sizeof(array - 1) decays to sizeof(pointer), but (sizeof(array) - 1)
was actually wanted.

The effect of this bug is that only a few bytes of the hostname are mixed
into the random seed, instead of using the entire hostname.

diffstat:

 crypto/external/bsd/openssl/lib/libcrypto/rnd_keys.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r 548a4ee35927 -r 6f867f956636 crypto/external/bsd/openssl/lib/libcrypto/rnd_keys.c
--- a/crypto/external/bsd/openssl/lib/libcrypto/rnd_keys.c      Thu Mar 27 16:10:45 2014 +0000
+++ b/crypto/external/bsd/openssl/lib/libcrypto/rnd_keys.c      Thu Mar 27 16:26:22 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rnd_keys.c,v 1.1 2009/07/19 23:30:44 christos Exp $    */
+/*     $NetBSD: rnd_keys.c,v 1.2 2014/03/27 16:26:22 apb Exp $ */
 
 #include "des_locl.h"
 #include <sys/time.h>
@@ -72,7 +72,7 @@
 
        SHA1Init(&sha);
 
-       gethostname(hname, sizeof(hname - 1));
+       gethostname(hname, sizeof(hname) - 1);
        gettimeofday(&when, NULL);
 
        memcpy(&seed_q, seed, sizeof(seed_q));



Home | Main Index | Thread Index | Old Index