| Summary: | Bug in crypto/openssh/openbsd-compat/bsd-misc.c::strdup() | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Olavi <olavi> |
| Component: | kern | Assignee: | freebsd-bugs (Nobody) <bugs> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 6.0-BETA5 | ||
| Hardware: | Any | ||
| OS: | Any | ||
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. |
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