mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-25 14:25:38 +03:00
Compiler: Fix memory corruption when parsing natives.
Imported from SM: https://bugs.alliedmods.net/show_bug.cgi?id=5840
This commit is contained in:
parent
325a746d90
commit
4f525b9150
@ -2734,8 +2734,7 @@ SC_FUNC symbol *fetchfunc(char *name,int tag)
|
|||||||
sym=addsym(name,code_idx,iFUNCTN,sGLOBAL,tag,0);
|
sym=addsym(name,code_idx,iFUNCTN,sGLOBAL,tag,0);
|
||||||
assert(sym!=NULL); /* fatal error 103 must be given on error */
|
assert(sym!=NULL); /* fatal error 103 must be given on error */
|
||||||
/* assume no arguments */
|
/* assume no arguments */
|
||||||
sym->dim.arglist=(arginfo*)malloc(1*sizeof(arginfo));
|
sym->dim.arglist=(arginfo*)calloc(1, sizeof(arginfo));
|
||||||
sym->dim.arglist[0].ident=0;
|
|
||||||
/* set library ID to NULL (only for native functions) */
|
/* set library ID to NULL (only for native functions) */
|
||||||
sym->x.lib=NULL;
|
sym->x.lib=NULL;
|
||||||
/* set the required stack size to zero (only for non-native functions) */
|
/* set the required stack size to zero (only for non-native functions) */
|
||||||
|
Loading…
Reference in New Issue
Block a user