diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-07-22 14:00:25 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-07 21:02:14 -0700 |
commit | 7601387b02d9798f54844858e932d2f3727811cd (patch) | |
tree | cc8683e706bccd888d40860e1e3e46e14a447340 /tokenize.c | |
parent | Don't allow string concatenation to overflow MAX_STRING. (diff) | |
download | sparse-7601387b02d9798f54844858e932d2f3727811cd.tar.gz sparse-7601387b02d9798f54844858e932d2f3727811cd.tar.bz2 sparse-7601387b02d9798f54844858e932d2f3727811cd.zip |
C99 says strings should be up to 4095 bytes.
Also, while we're here, be more careful about the
exact limits, and concatenation: we want to have
the ending NUL character even when we concatenate
too much.
Diffstat (limited to 'tokenize.c')
-rw-r--r-- | tokenize.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -550,7 +550,7 @@ static int get_string_token(int next, stream_t *stream) len++; } - if (len >= MAX_STRING) { + if (len > MAX_STRING) { warn(stream->pos, "string too long (%d bytes, %d bytes max)", len, MAX_STRING); len = MAX_STRING; } |