diff options
author | Eric Andersen | 2003-04-19 23:15:06 +0000 |
---|---|---|
committer | Eric Andersen | 2003-04-19 23:15:06 +0000 |
commit | 2894266f12e699570d223d9f19ca79979196060b (patch) | |
tree | 7a831df25d9e5a83180c8ee913b7483050ecbbbe /networking/ifupdown.c | |
parent | 343658582bb13bc7cb7b7c2333465f0a090c4942 (diff) | |
download | busybox-2894266f12e699570d223d9f19ca79979196060b.zip busybox-2894266f12e699570d223d9f19ca79979196060b.tar.gz |
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.
Diffstat (limited to 'networking/ifupdown.c')
-rw-r--r-- | networking/ifupdown.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/networking/ifupdown.c b/networking/ifupdown.c index fedae8d..6c79c20 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; } |