mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Fix potential buffer overflow in strsplit
This commit is contained in:
parent
b32fa703ba
commit
8c8e100e01
1 changed files with 1 additions and 1 deletions
|
|
@ -886,7 +886,7 @@ unsigned strsplit(char** split_map, unsigned split_max, char* str, const char* d
|
|||
/* skip initial delimiters */
|
||||
str += strspn(str, delimiters);
|
||||
|
||||
while (*str != 0 || mac == split_max) {
|
||||
while (*str != 0 && mac < split_max) {
|
||||
/* start of the token */
|
||||
split_map[mac] = str;
|
||||
++mac;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue