diff options
author | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2003-04-19 23:15:06 +0000 |
---|---|---|
committer | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2003-04-19 23:15:06 +0000 |
commit | fff98adb8a8e2b40acd9aeddb519d0df655c665e (patch) | |
tree | 7a831df25d9e5a83180c8ee913b7483050ecbbbe /networking | |
parent | 007ce3bfbdf8596617c16385534102497b3fb0e7 (diff) | |
download | busybox-w32-fff98adb8a8e2b40acd9aeddb519d0df655c665e.tar.gz busybox-w32-fff98adb8a8e2b40acd9aeddb519d0df655c665e.tar.bz2 busybox-w32-fff98adb8a8e2b40acd9aeddb519d0df655c665e.zip |
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.
git-svn-id: svn://busybox.net/trunk/busybox@6797 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'networking')
-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 fedae8dd6..6c79c2004 100644 --- a/networking/ifupdown.c +++ b/networking/ifupdown.c | |||
@@ -630,8 +630,11 @@ static char *next_word(char **buf) | |||
630 | return(NULL); | 630 | return(NULL); |
631 | } | 631 | } |
632 | *buf = word + length; | 632 | *buf = word + length; |
633 | **buf = '\0'; | 633 | /*DBU:[dave@cray.com] if we are already at EOL dont't increment beyond it */ |
634 | (*buf)++; | 634 | if (**buf) { |
635 | **buf = '\0'; | ||
636 | (*buf)++; | ||
637 | } | ||
635 | 638 | ||
636 | return word; | 639 | return word; |
637 | } | 640 | } |