FYI dsa_lib.c and dh_lib.c in openssl-0.9.6b and latest snapshot

Michael Tokarev mjt at tls.msk.ru
Tue Nov 6 11:40:38 EST 2001


> Scott Burch wrote:
[]
> The source changes I made are below for openssl (suggested by several here):
> 
> Please change line 69 in openssl-0.9.6b/crypto/dsa/dsa_lib.c from
>   static DSA_METHOD *default_DSA_method;
> to
>   static DSA_METHOD *default_DSA_method = NULL;

Hmmm...
Such variables should be initialized by a compiler/linker/whatether.
Interesting to see if this is in some C specs or not.  Gcc with
GNU ld will definitely initialize the variable in question to
zero (NULL = 0, isn't it?).  Note for example numerous flame wars
on linux-kernel when Linus rejected a patch that contains
initializations like this -- due to resulting executable growth.
That is, without initializer, code works just like with it, but
an initializer makes resulting executable bigger.  I almost shure
this is a bug in compiler or linker and NOT in the code, but I
don't know specs that says so.  Well, those static variables can
be initialized explicitly as a work around buggy compiling
environment...

Regards,
 Michael.



More information about the openssh-unix-dev mailing list