From 5eea2566bc6a6bb415735129446e200f978e6066 Mon Sep 17 00:00:00 2001 From: dataisland Date: Mon, 9 Sep 2024 14:25:58 -0500 Subject: [PATCH] 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. --- include/assimp/ParsingUtils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/assimp/ParsingUtils.h b/include/assimp/ParsingUtils.h index e0ee2d77c..ecd30a0e5 100644 --- a/include/assimp/ParsingUtils.h +++ b/include/assimp/ParsingUtils.h @@ -103,7 +103,7 @@ AI_FORCE_INLINE bool IsSpaceOrNewLine(char_t in) { // --------------------------------------------------------------------------------- template 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; } *out = in;