]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream commit
authordjm@openbsd.org <djm@openbsd.org>
Fri, 26 Jun 2015 05:13:20 +0000 (05:13 +0000)
committerDamien Miller <djm@mindrot.org>
Fri, 26 Jun 2015 23:24:04 +0000 (09:24 +1000)
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@

Upstream-ID: 7b879dc446335677cbe4cb549495636a0535f3bd

readconf.c

index 47125aea679b6e307a8db3d97c3a5107031663cb..db7d0bbbfabfb6adf731e9e623fec657bb7eb888 100644 (file)
@@ -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
@@ -1927,7 +1927,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;