diff options
author | geoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-12-19 05:22:53 +0000 |
---|---|---|
committer | geoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-12-19 05:22:53 +0000 |
commit | 49aaac6fd02a408936a0f45cf6d7e24033a8455e (patch) | |
tree | 4be85b1058de9879fa2ece0af7c873cde8cc482f /gcc/gcc.c | |
parent | 95315a36ab3e01a43aedfa506316c01569f3600e (diff) | |
download | gcc-49aaac6fd02a408936a0f45cf6d7e24033a8455e.tar.gz |
2002-12-18 Loren James Rittle <rittle@labs.mot.com>
* gcc.c (validate_switches): Robustify against skipping past '\0'.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@60283 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r-- | gcc/gcc.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c index dea12aac935..85f792b6786 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -6808,11 +6808,11 @@ next_member: switches[i].validated = 1; } - p++; - if (p[-1] == '|' || p[-1] == '&') + if (*p) p++; + if (*p && (p[-1] == '|' || p[-1] == '&')) goto next_member; - if (p[-1] == ':') + if (*p && p[-1] == ':') { while (*p && *p != ';' && *p != '}') { @@ -6824,11 +6824,11 @@ next_member: else if (p[0] == 'W' && p[1] == '{') p = validate_switches (p+2); } - p++; + if (*p) p++; } - p++; - if (p[-1] == ';') + if (*p) p++; + if (*p && p[-1] == ';') goto next_member; } |