The amount of time it took me to read the comment and figure out what is going 
on, and your time to write email explaining it, and Ted's time to chime in 
about the necessity of doing all this far outweighs the new code which is 
#ifdef VMS'd  Because now main() looks really simple and bog-standard with 
argc,argv.  The maintenance cost for *everyone* is reduced, at the expense of a 
few extra bytes on some platforms.

The only reason why I'm making a big deal of this (well any deal at all) is 
that I think this an important trend for OpenSSL moving forward.  We try to 
support as many platforms as we can, but this has a cost in making the code 
more complex and a sometimes-gnarly set of #ifdef's.  That imposes a burden on 
everyone who has to read and maintain the code.  If instead we can make things 
slightly less optimal in some cases while simplifying things, that's the kind 
of trade-off we want to make.  At the risk of being small-minded, I'll point 
out there's a big difference between suboptimal and broken :) 
(http://arstechnica.com/security/2014/07/only-a-few-days-old-openssl-fork-libressl-is-declared-unsafe-for-linux/
 )
 
char ** copy_argv(int *argc, char **argv) {
       int i;
        char **newargv = (char **)OPENSSL_malloc((*argc+1) * sizeof *newargv);

        for (i = 0; argv[i]; i++)
                newargv[i] = argv[i];
        newargv[i] = NULL;
        *argc = i; 
        return newargv;
}
--  
Principal Security Engineer
Akamai Technologies, Cambridge, MA
IM: rs...@jabber.me; Twitter: RichSalz
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to