fix: array proxy_string_port may out of bound

when proxy_count=64, array proxy_string_port , proxy_string_ip, etc. may out of bound.
This commit is contained in:
neo-one0873 2023-06-27 10:41:16 +08:00 committed by GitHub
parent 28f073fd79
commit 58256c8b4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2045,7 +2045,7 @@ void process_proxy_line(int32_t type, char *string) {
string[strlen(string) - 1] = 0;
if (string[strlen(string) - 1] == '\r')
string[strlen(string) - 1] = 0;
if (proxy_count > MAX_PROXY_COUNT) {
if (proxy_count >= MAX_PROXY_COUNT) {
fprintf(stderr, "[WARNING] maximum amount of proxies loaded, ignoring this entry: %s\n", string);
return;
}