I accidently built libssh.so with an undefined HAVE_STRDUP thus causing libssh to use its built-in version of strdup. The code looks as: #ifndef HAVE_STRDUP char * strdup(const char *str) { size_t len; char *cp; len = strlen(str) + 1; cp = malloc(len); if (cp != NULL) if (strlcpy(cp, str, len) != len) { free(cp); return NULL; } return cp; } #endif The above is a longer version of 'return NULL'. Fix: Change 'if (strlcpy(cp, str, len) != len)' -> 'if (strlcpy(cp, str, len) != (len-1))'. How-To-Repeat: #undef HAVE_STRDUP and build libssh.so
Hi Olavi, OpenSSH is contributed software and FreeBSD doesn't use this part of the code, so you probably want to report this problem to the OpenSSH team ( http://bugzilla.mindrot.org/ ) Cheers, Antoine
State Changed From-To: open->closed It sounds as though this needs to be taken up with the upstream authors.