Skip to content

Commit

Permalink
Fix sampgdk bug that led to crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander committed Dec 28, 2021
1 parent ed02036 commit 6716439
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions deps/sampgdk/sampgdk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand All @@ -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], &params[needs_size + 1]);
} else {
sampgdk_log_warning("Invalid buffer size");
}
break;
}
needs_size = -1;
state = ST_READ_SPEC;
Expand Down

0 comments on commit 6716439

Please sign in to comment.