summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2003-04-09 12:00:37 +0000
committerdjm <djm@openbsd.org>2003-04-09 12:00:37 +0000
commite93cd0dc40f03be2ac06bdd77b4bb08744fc6c6b (patch)
tree4e829d7f0d7d1d11be977dec9330ebbdf71601a1
parentmore string shit, ok bob and vincent (diff)
downloadwireguard-openbsd-e93cd0dc40f03be2ac06bdd77b4bb08744fc6c6b.tar.xz
wireguard-openbsd-e93cd0dc40f03be2ac06bdd77b4bb08744fc6c6b.zip
strip trailing whitespace from config lines before parsing. Fixes bz 528;
ok markus@
-rw-r--r--usr.bin/ssh/readconf.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.bin/ssh/readconf.c b/usr.bin/ssh/readconf.c
index 8311dc17976..871415952f3 100644
--- a/usr.bin/ssh/readconf.c
+++ b/usr.bin/ssh/readconf.c
@@ -12,7 +12,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: readconf.c,v 1.105 2003/04/02 09:48:07 markus Exp $");
+RCSID("$OpenBSD: readconf.c,v 1.106 2003/04/09 12:00:37 djm Exp $");
#include "ssh.h"
#include "xmalloc.h"
@@ -280,6 +280,13 @@ process_config_line(Options *options, const char *host,
u_short fwd_port, fwd_host_port;
char sfwd_host_port[6];
+ /* Strip trailing whitespace */
+ for(len = strlen(line) - 1; len > 0; len--) {
+ if (strchr(WHITESPACE, line[len]) == NULL)
+ break;
+ line[len] = '\0';
+ }
+
s = line;
/* Get the keyword. (Each line is supposed to begin with a keyword). */
keyword = strdelim(&s);