Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/lib/libc/rpc Pull up revision 1.6 (via patch, requested...



details:   https://anonhg.NetBSD.org/src/rev/88de36540bfd
branches:  netbsd-1-5
changeset: 493069:88de36540bfd
user:      he <he%NetBSD.org@localhost>
date:      Wed Apr 17 12:11:02 2002 +0000

description:
Pull up revision 1.6 (via patch, requested by groo):
  Make sure we do not look before the beginning of the string.

diffstat:

 lib/libc/rpc/getnetpath.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (21 lines):

diff -r 399634eff17a -r 88de36540bfd lib/libc/rpc/getnetpath.c
--- a/lib/libc/rpc/getnetpath.c Wed Apr 17 12:06:37 2002 +0000
+++ b/lib/libc/rpc/getnetpath.c Wed Apr 17 12:11:02 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getnetpath.c,v 1.2 2000/06/11 16:26:53 assar Exp $     */
+/*     $NetBSD: getnetpath.c,v 1.2.2.1 2002/04/17 12:11:02 he Exp $    */
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -251,9 +251,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 */
            /*



Home | Main Index | Thread Index | Old Index