diff --git a/amxmodx/amxmodx.cpp b/amxmodx/amxmodx.cpp index 3e9de4e6..ab3c858f 100755 --- a/amxmodx/amxmodx.cpp +++ b/amxmodx/amxmodx.cpp @@ -4460,6 +4460,11 @@ static cell AMX_NATIVE_CALL arraycompare(AMX *amx, cell *params) cell *with = get_amxaddr(amx, params[2]); int size = params[3]; + if(size < 1){ + LogError(amx, AMX_ERR_NATIVE, "Invalid size (%d).", size); + return 0; + } + while (size--) if (*with++ != *what++) return 0; diff --git a/plugins/include/amxmodx.inc b/plugins/include/amxmodx.inc index 306d338f..40d782ba 100755 --- a/plugins/include/amxmodx.inc +++ b/plugins/include/amxmodx.inc @@ -3316,7 +3316,8 @@ native arrayset(any:array[], any:value, size); * @param with Second array * @param size Size of array * - * @return Returns true if arrays are equaly, false otherwise. + * @return Returns true if arrays are equaly, false otherwise. + * @error If size < 1. */ native bool:arraycompare(const any:what[], const any:with[], const size);