Patch to solve SEGV when using -L
Christopher Faylor
me at cgf.cx
Thu Jun 30 06:08:41 WST 2005
I couldn't find a mention of this problem in the archives but I could
never get the -L option to work with dbclient without suffering a SEGV.
The reason for the SEGV was pretty obvious after some debugging. I've
included a (hopefully self-explanatory) patch below.
Apologies if this has already been discussed.
cgf
--- cli-tcpfwd.c.orig 2005-03-06 23:27:01.000000000 -0500
+++ cli-tcpfwd.c 2005-06-29 12:09:01.000000000 -0400
@@ -94,7 +94,7 @@ static int cli_localtcp(unsigned int lis
TRACE(("enter cli_localtcp: %d %s %d", listenport, remoteaddr,
remoteport));
- tcpinfo = (struct TCPListener*)m_malloc(sizeof(struct TCPListener*));
+ tcpinfo = (struct TCPListener*)m_malloc(sizeof(*tcpinfo));
tcpinfo->sendaddr = m_strdup(remoteaddr);
tcpinfo->sendport = remoteport;
tcpinfo->listenport = listenport;
More information about the Dropbear
mailing list