2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-24 18:41:55 +00:00

Fix overruning the urls buffer

Technically, MAX_URL_PATHS would be one past the
buffer allocated, so it needs to stay under
that value.
This commit is contained in:
Jarrod Johnson 2021-05-19 09:22:13 -04:00
parent 5e1c366e0b
commit 4ed9219704

View File

@ -181,7 +181,7 @@ int main(int argc, char* argv[]) {
memset(filename, 0, MAX_FILE_LEN);
for (i=0; i < argc; i++) {
if (strstr(argv[i], ":") > 0) {
if (j <= MAX_URL_PATHS) {
if (j < MAX_URL_PATHS) {
urls[j] = argv[i];
tmp = strrchr(urls[j++], '/');
strncpy(filename, tmp, MAX_FILE_LEN);