< Previous by Date Date Index Next by Date >
  Thread Index  

[reSIProcate] Problem with Security constructor


All,

I have compiled my reciprocate library with SSL support.  This means
that when you create an instance of the resip::SipStack, it also creates
a resip::Security object.  I am running RedHat ES 3.X, so clearly, the
code below on my system looks to get the environment variable "HOME".

Security::Security(const CipherList& cipherSuite) :
BaseSecurity(cipherSuite)
{
#ifdef WIN32
   mPath = "C:\\sipCerts\\";
#else
   mPath = getenv("HOME");
   mPath += "/.sipCerts/";
#endif
}

I was starting my application at run level 3, which does not yet define
the environment variable "HOME" and subsequently was segfaulting my
application.

sipdirector: Data.cxx:888: resip::Data& resip::Data::operator=(const
char*): Assertion `str' failed.

(gdb) bt
#0  0x05d0ccdf in raise () from /lib/tls/libc.so.6
#1  0x05d0e40d in abort () from /lib/tls/libc.so.6
#2  0x05d06609 in __assert_fail () from /lib/tls/libc.so.6
#3  0x00e49465 in resip::Data::operator= () from
/opt/resiprocate-6124/lib/librutil.so
#4  0x011d27eb in resip::Security::Security () from
/opt/resiprocate-6124/lib/libresip.so
#5  0x011faa18 in resip::SipStack::SipStack () from
/opt/resiprocate-6124/lib/libresip.so
#6  0x08053941 in main ()

My simple fix was to define "HOME" in my init.d script.  I was just
wondering if that is the intent or should the Security constructor
default mPath to some value if "HOME" returns NULL?

Thanks,
Mike