From 671643925c824c4be1d84f722ce4a0fcc4551814 Mon Sep 17 00:00:00 2001 From: Alexander Date: Tue, 28 Dec 2021 11:33:25 +0300 Subject: [PATCH] Fix sampgdk bug that led to crashes --- deps/sampgdk/sampgdk.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/deps/sampgdk/sampgdk.c b/deps/sampgdk/sampgdk.c index 4590f24..1b31c7b 100644 --- a/deps/sampgdk/sampgdk.c +++ b/deps/sampgdk/sampgdk.c @@ -1660,8 +1660,6 @@ cell sampgdk_native_invoke_array(AMX_NATIVE native, const char *format, if (*format_ptr == ']') { switch (type[needs_size]) { case 'a': - case 'A': - case 'S': if (size[needs_size] > 0) { sampgdk_fakeamx_push_array((const cell *)args[needs_size], size[needs_size], @@ -1670,6 +1668,14 @@ cell sampgdk_native_invoke_array(AMX_NATIVE native, const char *format, sampgdk_log_warning("Invalid buffer size"); } break; + case 'A': + case 'S': + if (size[needs_size] > 0) { + sampgdk_fakeamx_push(size[needs_size], ¶ms[needs_size + 1]); + } else { + sampgdk_log_warning("Invalid buffer size"); + } + break; } needs_size = -1; state = ST_READ_SPEC;