diff options
author | djm@openbsd.org <djm@openbsd.org> | 2017-02-03 06:05:56 +0100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2017-02-03 06:07:27 +0100 |
commit | c924b2ef941028a1f31e6e94f54dfeeeef462a4e (patch) | |
tree | e7d4f32f985b799b2a591460e80b69020f5108fb /servconf.c | |
parent | prefer to use ldns-config to find libldns (diff) | |
download | openssh-c924b2ef941028a1f31e6e94f54dfeeeef462a4e.tar.xz openssh-c924b2ef941028a1f31e6e94f54dfeeeef462a4e.zip |
upstream commit
allow form-feed characters at EOL; bz#2431 ok dtucker@
Upstream-ID: 1f453afaba6da2ae69d6afdf1ae79a917552f1a2
Diffstat (limited to 'servconf.c')
-rw-r--r-- | servconf.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/servconf.c b/servconf.c index c9105a592..1880b8cfd 100644 --- a/servconf.c +++ b/servconf.c @@ -1,5 +1,5 @@ -/* $OpenBSD: servconf.c,v 1.302 2017/01/06 03:45:41 djm Exp $ */ +/* $OpenBSD: servconf.c,v 1.303 2017/02/03 05:05:56 djm Exp $ */ /* * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland * All rights reserved @@ -966,6 +966,15 @@ process_server_config_line(ServerOptions *options, char *line, long long val64; const struct multistate *multistate_ptr; + /* Strip trailing whitespace. Allow \f (form feed) at EOL only */ + if ((len = strlen(line)) == 0) + return 0; + for (len--; len > 0; len--) { + if (strchr(WHITESPACE "\f", line[len]) == NULL) + break; + line[len] = '\0'; + } + cp = line; if ((arg = strdelim(&cp)) == NULL) return 0; |