From 7d00a5e320db60b462be5b330fc1358f706add76 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 29 May 2018 18:04:14 +0200 Subject: [PATCH] Cygwin: TEST only: Add a buffer underrun assertion to symlink_info::check Thanks to Ken Harris for the diagnosis which led to a buffer underrun in this loop. Revert before release. Signed-off-by: Corinna Vinschen --- winsup/cygwin/path.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index a132a0a7e..94f4e887c 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -57,6 +57,7 @@ #include #include #include +#include #include "cygerrno.h" #include "path.h" #include "fhandler.h" @@ -2800,7 +2801,7 @@ restart: if (*p != '.' && *p != ' ') { while (*--p != '\\') - ; + assert(p >= path); if (*++p != ' ') p = NULL; }