diff options
author | gkm <gkm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-09-15 21:25:02 +0000 |
---|---|---|
committer | gkm <gkm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-09-15 21:25:02 +0000 |
commit | 7e1181549fa8835f68e411d0bf39bfd49bf10c10 (patch) | |
tree | ef564e7fbae03288e99c3b241a19bc54a606ff40 /gcc | |
parent | c7ca8f1143ae5f45c7ac84076ecd49342edfd612 (diff) | |
download | ppe42-gcc-7e1181549fa8835f68e411d0bf39bfd49bf10c10.tar.gz ppe42-gcc-7e1181549fa8835f68e411d0bf39bfd49bf10c10.zip |
* cppmacro.c (check_trad_stringification): Check token
text pointers against limit before dereferencing.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@36447 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cppmacro.c | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bda64dca09a..1810deb2ac1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2000-09-15 Greg McGary <greg@mcgary.org> + + * cppmacro.c (check_trad_stringification): Check token + text pointers against limit before dereferencing. + 2000-09-15 Joseph S. Myers <jsm28@cam.ac.uk> * c-common.c (format_wanted_type): New structure. diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c index 2b16fd4757c..82dfd7f0d0f 100644 --- a/gcc/cppmacro.c +++ b/gcc/cppmacro.c @@ -645,11 +645,13 @@ check_trad_stringification (pfile, info, string) const cpp_token *token; /* Find the start of an identifier. */ - while (!is_idstart (*p) && p < limit) p++; + while (p < limit && !is_idstart (*p)) + p++; /* Find the end of the identifier. */ q = p; - while (is_idchar (*q) && q < limit) q++; + while (q < limit && is_idchar (*q)) + q++; /* Loop over the function macro arguments to see if the identifier inside the string matches one of them. */ |