From: Aron Podrigal Date: Wed, 15 Jan 2025 20:03:07 +0000 (-0600) Subject: [mod_curl] Fix off-by-one error in argument limit checks. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2729%2Fhead;p=thirdparty%2Ffreeswitch.git [mod_curl] Fix off-by-one error in argument limit checks. refs: #2727 --- diff --git a/src/mod/applications/mod_curl/mod_curl.c b/src/mod/applications/mod_curl/mod_curl.c index 82b38d42a9..cae06bdb30 100644 --- a/src/mod/applications/mod_curl/mod_curl.c +++ b/src/mod/applications/mod_curl/mod_curl.c @@ -898,7 +898,7 @@ SWITCH_STANDARD_APP(curl_app_function) if ((argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) { if (argc == 0) { switch_goto_status(SWITCH_STATUS_SUCCESS, usage); - } else if (argc >= MOD_CURL_MAX_ARGS) { + } else if (argc > MOD_CURL_MAX_ARGS) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Max args exceeded: %d\n", MOD_CURL_MAX_ARGS); switch_goto_status(SWITCH_STATUS_FALSE, done); } @@ -1021,7 +1021,7 @@ SWITCH_STANDARD_API(curl_function) if ((argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) { if (argc < 1) { switch_goto_status(SWITCH_STATUS_SUCCESS, usage); - } else if (argc >= MOD_CURL_MAX_ARGS) { + } else if (argc > MOD_CURL_MAX_ARGS) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Max args exceeded: %d\n", MOD_CURL_MAX_ARGS); switch_goto_status(SWITCH_STATUS_FALSE, done); }