Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/rpc Make sure we don't look before the beginning of...



details:   https://anonhg.NetBSD.org/src/rev/16a8f89a869b
branches:  trunk
changeset: 525746:16a8f89a869b
user:      groo <groo%NetBSD.org@localhost>
date:      Tue Apr 16 19:19:33 2002 +0000

description:
Make sure we don't look before the beginning of the string.
from xs%kittenz.org@localhost

diffstat:

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

diffs (24 lines):

diff -r 66f52c0d3f2b -r 16a8f89a869b lib/libc/rpc/getnetpath.c
--- a/lib/libc/rpc/getnetpath.c Tue Apr 16 19:17:17 2002 +0000
+++ b/lib/libc/rpc/getnetpath.c Tue Apr 16 19:19:33 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getnetpath.c,v 1.5 2001/01/04 14:57:17 lukem Exp $     */
+/*     $NetBSD: getnetpath.c,v 1.6 2002/04/16 19:19:33 groo Exp $      */
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -252,12 +252,12 @@
        /*
         * 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