public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: TEST only: Add a buffer underrun assertion to symlink_info::check
@ 2018-05-29 16:23 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2018-05-29 16:23 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=7d00a5e320db60b462be5b330fc1358f706add76

commit 7d00a5e320db60b462be5b330fc1358f706add76
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Tue May 29 18:04:14 2018 +0200

    Cygwin: TEST only: Add a buffer underrun assertion to symlink_info::check
    
    Thanks to Ken Harris <Ken.Harris@mathworks.com> for the diagnosis
    which led to a buffer underrun in this loop.
    
    Revert before release.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 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 a132a0a..94f4e88 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -57,6 +57,7 @@
 #include <sys/param.h>
 #include <sys/cygwin.h>
 #include <wctype.h>
+#include <assert.h>
 #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;
 		}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-05-29 16:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-29 16:23 [newlib-cygwin] Cygwin: TEST only: Add a buffer underrun assertion to symlink_info::check Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).