From: Eric Andersen Date: Sat, 19 Apr 2003 23:15:06 +0000 (-0000) Subject: Patch from David Updegraff to avoid corrupting memory while parsing the X-Git-Tag: 1_00_pre1~114 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=2894266f12e699570d223d9f19ca79979196060b;p=oweals%2Fbusybox.git Patch from David Updegraff to avoid corrupting memory while parsing the networks/iterfaces file with next_word routine. Without this, next_word increments one beyond the end of the string. --- diff --git a/networking/ifupdown.c b/networking/ifupdown.c index fedae8dd6..6c79c2004 100644 --- a/networking/ifupdown.c +++ b/networking/ifupdown.c @@ -630,8 +630,11 @@ static char *next_word(char **buf) return(NULL); } *buf = word + length; - **buf = '\0'; - (*buf)++; + /*DBU:[dave@cray.com] if we are already at EOL dont't increment beyond it */ + if (**buf) { + **buf = '\0'; + (*buf)++; + } return word; }