diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2015-06-26 05:13:21 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2015-06-26 05:13:21 +0000 |
commit | a6ea56aa958d5bd2ed1548c9bd7b313f8a41cd42 (patch) | |
tree | 3bfbb9f7fd4e63f34d2c3019e1b1aa7fea534a5f /usr.bin | |
parent | 8eb406b322b86ea1e484be87981b7a237552d131 (diff) |
Fix \-escaping bug that caused forward path parsing to skip two
characters and skip past the end of the string.
Based on patch by Salvador Fandino; ok dtucker@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ssh/readconf.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/ssh/readconf.c b/usr.bin/ssh/readconf.c index 0d41d78e6f0..b7c3f8e27ec 100644 --- a/usr.bin/ssh/readconf.c +++ b/usr.bin/ssh/readconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: readconf.c,v 1.236 2015/05/22 04:45:52 djm Exp $ */ +/* $OpenBSD: readconf.c,v 1.237 2015/06/26 05:13:20 djm Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -1913,7 +1913,8 @@ parse_fwd_field(char **p, struct fwdarg *fwd) switch (*cp) { case '\\': memmove(cp, cp + 1, strlen(cp + 1) + 1); - cp++; + if (*cp == '\0') + return -1; break; case '/': ispath = 1; |