lipp / lua-websockets

Websockets for Lua.
http://lipp.github.com/lua-websockets/
MIT License
396 stars 113 forks source link

tools.lua:114: bad argument #2 to 'pack' (integer overflow) #75

Closed duzc2 closed 9 years ago

duzc2 commented 9 years ago

For lua 5.3 I make a change to tools.lua and frame.lua local struct = string.pack and string or require'struct'

and when I use a websocket client connect to the server , the server throws errors , like : ./pc/lualib/websocket\tools.lua:114: bad argument #2 to 'pack' (integer overflow) thread: 00A2F5AC tcp{client}: 23E6C860 ./pc/lualib/websocket\tools.lua:114: bad argument #2 to 'pack' (integer overflow) thread: 00A2DB2C tcp{client}: 11A68DA8 ./pc/lualib/websocket\tools.lua:114: bad argument #2 to 'pack' (integer overflow) thread: 00A2DB2C tcp{client}: 11A55D30 ./pc/lualib/websocket\tools.lua:114: bad argument #2 to 'pack' (integer overflow) thread: 00A2E32C tcp{client}: 11A43CB8 ./pc/lualib/websocket\tools.lua:114: bad argument #2 to 'pack' (integer overflow) thread: 00A2DB2C tcp{client}: 11A68DA8 ./pc/lualib/websocket\tools.lua:114: bad argument #3 to 'pack' (integer overflow) thread: 00A2E32C tcp{client}: 11A7FF18 ./pc/lualib/websocket\tools.lua:114: bad argument #2 to 'pack' (integer overflow) thread: 00A2E2AC tcp{client}: 23E6C860 ./pc/lualib/websocket\tools.lua:114: bad argument #4 to 'pack' (integer overflow) thread: 00A2DB2C tcp{client}: 11A43CB8 ./pc/lualib/websocket\tools.lua:114: bad argument #2 to 'pack' (integer overflow) thread: 00A2E32C tcp{client}: 11A55D30 ./pc/lualib/websocket\tools.lua:114: bad argument #2 to 'pack' (integer overflow) thread: 00A2E2AC tcp{client}: 11A360C8 ./pc/lualib/websocket\tools.lua:114: bad argument #2 to 'pack' (integer overflow) thread: 00A2DB2C tcp{client}: 26DDD060 ./pc/lualib/websocket\tools.lua:114: bad argument #2 to 'pack' (integer overflow) thread: 00A2E32C tcp{client}: 23E6C860 ./pc/lualib/websocket\tools.lua:114: bad argument #3 to 'pack' (integer overflow) thread: 00A2E2AC tcp{client}: 11A68DA8 ./pc/lualib/websocket\tools.lua:114: bad argument #4 to 'pack' (integer overflow) thread: 00A2E4AC tcp{client}: 11A7FF18

what's the mistake I took ??

lipp commented 9 years ago

@duzc2 what change did you make?

duzc2 commented 9 years ago

@lipp local struct = string.pack and string or require'struct'

lipp commented 9 years ago

This is not going to work, as struct and lpack have slighlty different interfaces

duzc2 commented 9 years ago

@lipp thank you.