Fix conditional check in SkipSpaces function to prevent out-of-bound access.
The `SkipSpaces` function's condition was updated to ensure that the pointer check `in != end` is evaluated before dereferencing the pointer. This change prevents potential out-of-bound access when the input pointer reaches the end.pull/5770/head
parent
4024726eca
commit
5eea2566bc
|
@ -103,7 +103,7 @@ AI_FORCE_INLINE bool IsSpaceOrNewLine(char_t in) {
|
||||||
// ---------------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------------
|
||||||
template <class char_t>
|
template <class char_t>
|
||||||
AI_FORCE_INLINE bool SkipSpaces(const char_t *in, const char_t **out, const char_t *end) {
|
AI_FORCE_INLINE bool SkipSpaces(const char_t *in, const char_t **out, const char_t *end) {
|
||||||
while ((*in == (char_t)' ' || *in == (char_t)'\t') && in != end) {
|
while (in != end && (*in == (char_t)' ' || *in == (char_t)'\t')) {
|
||||||
++in;
|
++in;
|
||||||
}
|
}
|
||||||
*out = in;
|
*out = in;
|
||||||
|
|
Loading…
Reference in New Issue