On Wed, Apr 20, 2011 at 7:46 AM, Bernhard Thalmayr
<bernhard.thalm...@painstakingminds.com> wrote:
> Thanks for the pointer Wan-Teh
>
> meanwhile I already used dbx and got this ...

You're right.  I haven't used Solaris for a long time.  If
you compile the code with Sun Studio compilers, you
should use dbx.

> Current function is SSL_OptionGet
>  809       *pOn = on;
> current thread: t@1
> =>[1] SSL_OptionGet(fd = 0x135d48, which = 1, pOn = 0xffbfe7df), line 809 in
> "sslsock.c"
>  [2] smi::Connection::secureSocket(0xffbff09c, 0x201ec4, 0x201ec8,
> 0xfe75c9e9, 0x135d48, 0xfe7807b0), at 0xfe6a2844
>
>
> The related agent-code looks like this ... I think it's not correct...
>
> "if (SECSuccess == secStatus) {
>                sslMethodName = "SSL_OptionSet";
>                {
>                    bool state;
>                    secStatus = SSL_OptionGet(sslSocket,SSL_SECURITY,
> (PRBool*)&state);"

Yes, that code is wrong.

The third-argument of SSL_OptionGet is "PRBool *pOn", so
the local variable 'state' should be declared as 'PRBool' instead
of 'bool'.

PRBool is the same as 'int', which is 4 bytes.
'bool' is apparently one byte because the address of 'bool state'
is 0xffbfe7df.  Note the 'f' (= decimal 15) at the end, which is
not a multiple of 4.

If you change the last two lines to:

                   PRBool state;
                   secStatus = SSL_OptionGet(sslSocket,SSL_SECURITY, &state);

that should fix the crash.  Note that the compiler may have warned
about the wrong argument type, which could be why the (PRBool*)
was added (incorrectly).

Wan-Teh
-- 
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto

Reply via email to