Hi,

Writing to get your input on a problem I just ran into.

I am in the process of porting all the apps/*.c to target
in order to get the whole 'openssl' program running
on OSE RTOS on a powerpc.

The problem is that the programs use global variables
and does not bother to clear them and the simple
shell I am using on the RTOS does NOT clear
the data before a program runs. Hence after one
run of an openssl program, the variables have
the same value as the last time the program ran... ack :(

Pick 'req' as an example:

    static LHASH *req_conf=NULL;        /* global */

    now in the 'req' function context:
    <<<snip>>
    req_conf=CONF_load(NULL,template,&errline);
    <<<snip>>>
    if ((req_conf != NULL) && (req_conf != config)) CONF_free(req_conf);

Now lets say I run req to create a new key. The req_conf first gets
loaded
(hence non-NULL) and then in the end of the function it gets free'd. Now

imagine the next time I type: 'openssl req ?' to see the params. This
time
req_conf does not get loaded but in the end of the function it gets
free'd
a second time since still non-NULL. Ouch :(

So my question is. Do you want a huge patch for all the apps that
properly
restores statically initialized global data and clears global bss data
after
a run and/or will you enter that patch if you get it?

Or alternatively, maybe I can play with the linker and see what I can
do to cook up a function that clears only the openssl BSS. Will be
trickier to restore the initializes openssl data though, mm.

Any comments? And no, I can't make the rtos shell reinit programs
when restarted :( It is a big lump of statically linked code that
never exits...

/Lennart Bang
business: [EMAIL PROTECTED]
private: [EMAIL PROTECTED]



begin:vcard 
n:Bang;Lennart
tel;cell:+46 70 733 14 70
tel;fax:+46 8 446 34 64
tel;work:+46 8 446 34 67
x-mozilla-html:TRUE
url:www.netstream.se
org:NetStream AB;Networking department
version:2.1
email;internet:[EMAIL PROTECTED]
title:CEO   |   http://www.netstream.se
adr;quoted-printable:;;Enhagsbacken 9=0D=0A;S-187 40 Taby;;;Sweden
fn:Lennart Bang
end:vcard

Reply via email to