expand: Fix buffer overread caused by passing array of chars as string in pmatch
strpbrk() accepts two null-terminated string arguments. stop[] is char
array that is not null-terminated but is still passed as a second
argument to strpbrk. This causes buffer overread, which is detected by
AddressSanitizer.
This commit adds an explicit null-terminated to the end of the array.
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 file changed