ruyo / VRM4U

Runtime VRM loader for UnrealEngine5
Other
1.41k stars 184 forks source link

Bugfix. Insufficient pattern matching can lead to crash. #446

Open MattiasOhmanSony opened 1 week ago

MattiasOhmanSony commented 1 week ago

by using continue the loop does not restart the pattern matching and it can lead to that we get faulty indexes that in turn can lead to crashing. The correct code here is to break in the inner loop so we return to the outer loop.

MattiasOhmanSony commented 1 week ago

The current pattern matching will give false positives if only one character matches and it can lead to crashes. using break will exit the inner loop and advance the c_start index to the next character in the pData pointer and start the pattern matching again (i.e look for JSON) this is correct. Continue will not advance or restart the inner loop.