bazilxp / shellinabox

Automatically exported from code.google.com/p/shellinabox
Other
1 stars 0 forks source link

Crash when ssl is enabled #150

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Install shellinabox on Gentoo
2. Start it
3. Look at dmesg

What is the expected output? What do you see instead?
I see a crash

What version of the product are you using? On what operating system?
2.10

Please provide any additional information below.
The crash occurs because gethostbyname() is returning an error and shellinaboxd 
is unable to handle it. The problem line is ssl.c:629. Here is a snippet of the 
source code:

struct hostent *he = gethostbyname(name);
*ret = *he;

I don't understand why gethostbyname_r() is being reimplemented, but commenting 
out the custom gethostbyname_r() implementation does not fix the crash. It is 
being called by sslSetCertificate(). I don't have time to debug this further.

Original issue reported on code.google.com by shiningarcanine on 22 Nov 2011 at 5:11