Correct strncmp() checks in download code.

Reported by @m-x-d, closes #1167.
This commit is contained in:
Yamagi 2024-12-20 15:24:27 +01:00
parent 9522e9e490
commit cdf1cba106

View file

@ -314,13 +314,13 @@ SV_BeginDownload_f(void)
/* leading slash bad as well, must be in subdir */
|| (*name == '/')
/* next up, skin check */
|| ((strncmp(name, "players/", 6) == 0) && !allow_download_players->value)
|| ((strncmp(name, "players/", 8) == 0) && !allow_download_players->value)
/* now models */
|| ((strncmp(name, "models/", 6) == 0) && !allow_download_models->value)
|| ((strncmp(name, "models/", 7) == 0) && !allow_download_models->value)
/* now sounds */
|| ((strncmp(name, "sound/", 6) == 0) && !allow_download_sounds->value)
/* now maps (note special case for maps, must not be in pak) */
|| ((strncmp(name, "maps/", 6) == 0) && !allow_download_maps->value)
|| ((strncmp(name, "maps/", 5) == 0) && !allow_download_maps->value)
/* MUST be in a subdirectory */
|| !strstr(name, "/"))
{