ssh: allow for space characters in the software version

Previously the software version would only contain up to the first
space.

E.g. in SSH-2.0-OpenSSH_4.7p1 Debian-8ubuntu3

It would contain "OpenSSH_4.7p1".

This patch changes the behavior to:

"OpenSSH_4.7p1 Debian-8ubuntu3"
pull/867/head
Victor Julien 11 years ago
parent b792234dd0
commit 294ff49f6d

@ -104,9 +104,9 @@ static int SSHParseBanner(SshState *state, SshHeader *header, const uint8_t *inp
SCReturnInt(0);
}
const uint8_t *sw_end = BasicSearch(line_ptr, line_len, (uint8_t*)" ", 1);
const uint8_t *sw_end = BasicSearch(line_ptr, line_len, (uint8_t*)"\r", 1);
if (sw_end == NULL) {
sw_end = BasicSearch(line_ptr, line_len, (uint8_t*)"\r", 1);
sw_end = BasicSearch(line_ptr, line_len, (uint8_t*)"\n", 1);
if (sw_end == NULL) {
sw_end = line_ptr + line_len;
}

Loading…
Cancel
Save