Bug 1108 - strdup from openbsd-compat/bsd-misc.c is broken
Summary: strdup from openbsd-compat/bsd-misc.c is broken
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Miscellaneous (show other bugs)
Version: 4.2p1
Hardware: All Other
: P2 normal
Assignee: Assigned to nobody
URL: http://www.freebsd.org/cgi/query-pr.c...
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-02 01:52 AEDT by Antoine Brodin
Modified: 2006-10-07 11:42 AEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Antoine Brodin 2005-11-02 01:52:22 AEDT
This bug has been reported to FreeBSD but the submitter didn't report it to OpenSSH : http://www.freebsd.org/cgi/query-pr.cgi?pr=87067

The check if (strlcpy(cp, str, len) != len) is bogus because strlcpy will return strlen(str) i.e. len-1 so strdup will always return NULL.

This affects OS that don't have strdup (I don't know who they are)
Comment 1 Darren Tucker 2005-11-02 09:09:03 AEDT
Fixed, thanks.  The only platform known to be affected is Ultrix, hence why it was not caught earlier :-)
Comment 2 Darren Tucker 2006-10-07 11:42:58 AEST
Change all RESOLVED bug to CLOSED with the exception of the ones fixed post-4.4.