mirror of
https://github.com/corda/corda.git
synced 2025-01-06 05:04:20 +00:00
fix reads of out-of-bounds values in tokenizer.h
This commit is contained in:
parent
c918cbced1
commit
2190d0e99a
@ -32,13 +32,13 @@ class Tokenizer {
|
||||
{ }
|
||||
|
||||
bool hasMore() {
|
||||
while (*s == delimiter and s != limit) ++s;
|
||||
return *s != 0 and s != limit;
|
||||
while (s != limit and *s == delimiter) ++s;
|
||||
return s != limit and *s != 0;
|
||||
}
|
||||
|
||||
Token next() {
|
||||
const char* p = s;
|
||||
while (*s and *s != delimiter and s != limit) ++s;
|
||||
while (s != limit and *s and *s != delimiter) ++s;
|
||||
return Token(p, s - p);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user