<div dir="ltr">The code assumed that when strol is successful, that it will set errno to zero. This is not the case, at least<br>under uClinux. The man page does not indicate this either. What can happen is that errno is already set to non-zero<br>
before strol is called, then strol is successful but since strol doesn't reset errno to zero, the next line thinks that strol failed.<br><br>This patch also gets rid of 2 compiler warnings.<br><br>diff -up ../../dropbear-vanilla/dropbear-0.51/cli-runopts.c ../../dropbear-errno/dropbear-0.51/cli-runopts.c<br>
--- ../../dropbear-vanilla/dropbear-0.51/cli-runopts.c 2008-03-27 09:17:14.000000000 -0400<br>+++ ../../dropbear-errno/dropbear-0.51/cli-runopts.c 2008-09-19 16:26:36.000000000 -0400<br>@@ -428,12 +428,14 @@ static void addforward(char* origstr, st<br>
<br> /* Now we check the ports - note that the port ints are unsigned,<br> * the check later only checks for >= MAX_PORT */<br>+ errno = 0; <br> newfwd->listenport = strtol(listenport, NULL, 10);<br>
if (errno != 0) {<br> TRACE(("bad listenport strtol"))<br> goto fail;<br> }<br> <br>+ errno = 0;<br> newfwd->connectport = strtol(connectport, NULL, 10);<br> if (errno != 0) {<br>
TRACE(("bad connectport strtol"))<br>Common subdirectories: ../../dropbear-vanilla/dropbear-0.51/debian and ../../dropbear-errno/dropbear-0.51/debian<br>diff -up ../../dropbear-vanilla/dropbear-0.51/keyimport.c ../../dropbear-errno/dropbear-0.51/keyimport.c<br>
--- ../../dropbear-vanilla/dropbear-0.51/keyimport.c 2008-03-27 09:17:14.000000000 -0400<br>+++ ../../dropbear-errno/dropbear-0.51/keyimport.c 2008-09-19 16:39:08.000000000 -0400<br>@@ -701,7 +701,6 @@ static int openssh_write(const char *fil<br>
int nnumbers = -1, pos, len, seqlen, i;<br> char *header = NULL, *footer = NULL;<br> char zero[1];<br>- unsigned char iv[8];<br> int ret = 0;<br> FILE *fp;<br> int keytype = -1;<br>Common subdirectories: ../../dropbear-vanilla/dropbear-0.51/libtomcrypt and ../../dropbear-errno/dropbear-0.51/libtomcrypt<br>
Common subdirectories: ../../dropbear-vanilla/dropbear-0.51/libtommath and ../../dropbear-errno/dropbear-0.51/libtommath<br>Common subdirectories: ../../dropbear-vanilla/dropbear-0.51/_MTN and ../../dropbear-errno/dropbear-0.51/_MTN<br>
Only in ../../dropbear-errno/dropbear-0.51: patch051.errno<br>diff -up ../../dropbear-vanilla/dropbear-0.51/svr-auth.c ../../dropbear-errno/dropbear-0.51/svr-auth.c<br>--- ../../dropbear-vanilla/dropbear-0.51/svr-auth.c 2008-03-27 09:17:16.000000000 -0400<br>
+++ ../../dropbear-errno/dropbear-0.51/svr-auth.c 2008-09-19 16:38:58.000000000 -0400<br>@@ -203,7 +203,7 @@ out:<br> m_free(methodname);<br> }<br> <br>-static int fill_passwd(const char* username) {<br>+static void fill_passwd(const char* username) {<br>
struct passwd *pw = NULL;<br> if (ses.authstate.pw_name)<br> m_free(ses.authstate.pw_name);<br></div>