mirror of
https://github.com/corda/corda.git
synced 2025-01-22 12:28:11 +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() {
|
bool hasMore() {
|
||||||
while (*s == delimiter and s != limit) ++s;
|
while (s != limit and *s == delimiter) ++s;
|
||||||
return *s != 0 and s != limit;
|
return s != limit and *s != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Token next() {
|
Token next() {
|
||||||
const char* p = s;
|
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);
|
return Token(p, s - p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user