[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Older Lua versions no longer compile under current gcc
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Tue, 9 Jan 2018 15:11:14 -0200
> cd lua-2.1 && make all
> ./lua test.lua
> *** buffer overflow detected ***: ./lua terminated
The relevant code is
*node = (TreeNode *) luaI_malloc(sizeof(TreeNode)+strlen(str));
strcpy((*node)->ts.str, str);
strcpy becomes __builtin___strcpy_chk. It seems that the "buffer
overflow" is due to the compiler thinking no space has been allocated
to (*node)->ts.str.