diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-10-25 10:01:20 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-10-25 10:01:20 -0200 |
commit | 5a568a3b01d4a816d6cb15a0c48ca6096c837ef1 (patch) | |
tree | c5e17a00a8cc7ace5daab40d3b14820f9d4fb465 | |
parent | 475e6c5352c3daecdd54fe2346b3c3b07f17a791 (diff) | |
download | lua-5a568a3b01d4a816d6cb15a0c48ca6096c837ef1.tar.gz lua-5a568a3b01d4a816d6cb15a0c48ca6096c837ef1.tar.bz2 lua-5a568a3b01d4a816d6cb15a0c48ca6096c837ef1.zip |
detail (comment)
-rw-r--r-- | lstrlib.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstrlib.c,v 1.170 2011/06/28 17:13:52 roberto Exp roberto $ | 2 | ** $Id: lstrlib.c,v 1.171 2011/08/09 20:58:29 roberto Exp roberto $ |
3 | ** Standard library for string operations and pattern-matching | 3 | ** Standard library for string operations and pattern-matching |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -138,7 +138,7 @@ static int str_byte (lua_State *L) { | |||
138 | if (pose > l) pose = l; | 138 | if (pose > l) pose = l; |
139 | if (posi > pose) return 0; /* empty interval; return no values */ | 139 | if (posi > pose) return 0; /* empty interval; return no values */ |
140 | n = (int)(pose - posi + 1); | 140 | n = (int)(pose - posi + 1); |
141 | if (posi + n <= pose) /* overflow? */ | 141 | if (posi + n <= pose) /* (size_t -> int) overflow? */ |
142 | return luaL_error(L, "string slice too long"); | 142 | return luaL_error(L, "string slice too long"); |
143 | luaL_checkstack(L, n, "string slice too long"); | 143 | luaL_checkstack(L, n, "string slice too long"); |
144 | for (i=0; i<n; i++) | 144 | for (i=0; i<n; i++) |