lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


If a user runs initialization code via LUA_USERINIT, and that code
leaves a boolean value on the stack, then the call to lua_concat on line
221 of lua.c will choke and die.

For example, add these two lines after line 14 in lua.c (after the
include for lua.h).

  static const char B1[]=" print'just press Enter' return true ";
  #define LUA_USERINIT(L) openstdlibs(L);
lua_dobuffer(L,B1,sizeof(B1)-1,"death.h")

Run lua without any arguments, then press Enter and it will die.  If you
remove the "return true" from B1, the problem goes away.

I noticed this after I used etc/bin2c to add some initialization scripts
to lua.

- Peter