Make sure we don't look before the beginning of the string. NetBSD Rev 1.5 --- lib/libc/rpc/getnetpath.c.orig Mon Jan 6 17:10:55 2003 +++ lib/libc/rpc/getnetpath.c Mon Jan 6 17:17:30 2003 @@ -249,9 +249,9 @@ /* * did find a token, but it might be escaped. */ - if (cp[-1] == '\\') { + if ((cp > npp) && (cp[-1] == '\\')) { /* if slash was also escaped, carry on, otherwise find next token */ - if (cp[-2] != '\\') { + if ((cp > npp + 1) && (cp[-2] != '\\')) { /* shift r-o-s onto the escaped token */ strcpy(&cp[-1], cp); /* XXX: overlapping string copy */ /*