From 4ed9219704816e5f530511b6c0c28e57a39d67fc Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 19 May 2021 09:22:13 -0400 Subject: [PATCH] Fix overruning the urls buffer Technically, MAX_URL_PATHS would be one past the buffer allocated, so it needs to stay under that value. --- misc/urlmount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/urlmount.c b/misc/urlmount.c index 3fe75065..80293dbf 100644 --- a/misc/urlmount.c +++ b/misc/urlmount.c @@ -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);