[Bug 1380] incorrect check for strlen(fwd->connect_host) in parse_forward()

bugzilla-daemon at bugzilla.mindrot.org bugzilla-daemon at bugzilla.mindrot.org
Sun Nov 4 05:13:18 EST 2007


https://bugzilla.mindrot.org/show_bug.cgi?id=1380


Jan Pechanec <jp at devnull.cz> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jp at devnull.cz




--- Comment #3 from Jan Pechanec <jp at devnull.cz>  2007-11-04 05:13:12 ---
a good point. It might be worth to do more changes then.

parse_forward() doesn't know whether it processes a local or remote
spec so it doesn't know which one of the two address strings is going
to be sent over. However, it doesn't matter because maximum domain name
length is 255 octets (RFC 2181) and the macro SSH_CHANNEL_PATH_LEN is
already defined as 256. Maybe, channels.h could define:

#define MAX_DOMAIN_NAME_LEN     255
#define SSH_CHANNEL_PATH_LEN    MAX_DOMAIN_NAME_LEN

and then use MAX_DOMAIN_NAME_LEN in parse_forward() on both strings
because it's not about setting a channel path there yet but use
SSH_CHANNEL_PATH_LEN in both forward functions where the string is
actually sent over; in theory the channel path length could be shorter
than MAX_DOMAIN_NAME_LEN.

and use +1 for '\0' rather than -1 were it defined as 256.

-- 
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.


More information about the openssh-bugs mailing list