[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Maybe a bug in lundump.c
- From: 云风 <cloudwu@...>
- Date: Wed, 19 Mar 2014 17:23:57 +0800
In function : void LoadConstants(LoadState* S, Proto* f)
If the constant is string, it will be call setsvalue2n .
case LUA_TSTRING:
setsvalue2n(S->L,o,LoadString(S));
and setsvalue2n crashes if LoadString(S) return NULL.
I think if we check the return value of LoadString here would be better :
case LUA_TSTRING: {
TString * s = LoadString(S);
if (s) {
setsvalue2n(S->L,o,s);
} else {
setnilvalue(o);
}
break;
}
--
http://blog.codingnow.com