diff options
author | James E. King III <jking@apache.org> | 2019-02-14 16:46:38 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-14 16:46:38 -0500 |
commit | dbc1f8def5018ce5d85d38b9875c6c6b6b424478 (patch) | |
tree | 0011127f2edd9221f973eb157438bbd11c0b74d2 /lib/lua | |
parent | 3ca88065dfdb24c5bad6fbd1e3a7e01812628d3b (diff) | |
download | thrift-dbc1f8def5018ce5d85d38b9875c6c6b6b424478.tar.gz |
THRIFT-4024, THRIFT-4783: throw when skipping invalid type (#1742)
* THRIFT-4024: make c_glib throw on unsupported type when skipping
* THRIFT-4783: throw on invalid skip (py)
* THRIFT-4024: make cpp throw on unsupported type when skipping
* THRIFT-4024: uniform skip behavior on unsupported type
Diffstat (limited to 'lib/lua')
-rw-r--r-- | lib/lua/TProtocol.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/lua/TProtocol.lua b/lib/lua/TProtocol.lua index 616e167a9..1306fb3d8 100644 --- a/lib/lua/TProtocol.lua +++ b/lib/lua/TProtocol.lua @@ -107,9 +107,7 @@ function TProtocolBase:readDouble() end function TProtocolBase:readString() end function TProtocolBase:skip(ttype) - if type == TType.STOP then - return - elseif ttype == TType.BOOL then + if ttype == TType.BOOL then self:readBool() elseif ttype == TType.BYTE then self:readByte() @@ -153,6 +151,10 @@ function TProtocolBase:skip(ttype) self:skip(ettype) end self:readListEnd() + else + terror(TProtocolException:new{ + message = 'Invalid data' + }) end end |