Dear list!

Author: vishnu <vis...@yubi.in>
Number of patches: 1

This is an automated relay of the Github pull request:
   BUG/MEDIUM: lua: fix invalid return types in hlua_http_msg_get_body

Patch title(s): 
   BUG/MEDIUM: lua: fix invalid return types in hlua_http_msg_get_body

Link:
   https://github.com/haproxy/haproxy/pull/1427

Edit locally:
   wget https://github.com/haproxy/haproxy/pull/1427.patch && vi 1427.patch

Apply locally:
   curl https://github.com/haproxy/haproxy/pull/1427.patch | git am -

Description:
   hlua_http_msg_get_body must return either a Lua string or nil.
   For
   some HTTPMessage objects, HTX_BLK_EOT blocks are also present in the
   HTX buffer along with HTX_BLK_DATA blocks. In such cases,
   _hlua_http_msg_dup will start copying data into a luaL_Buffer until it
   encounters an HTX_BLK_EOT. But then instead of pushing neither the
   luaL_Buffer nor `nil` to the Lua stack, the function will return
   immediately. The end result will be that the caller of the
   HTTPMessage.get_body() method from a Lua filter will see whatever
   object was on top of the stack as return value. It may be either a
   userdata object if HTTPMessage.get_body was called with only two
   arguments, or the third argument itself if called with three
   arguments. Hence HTTPMessage.get_body would return either nil, or
   HTTPMessage body as Lua string, or a userdata objects, or number.
   This fix ensure that HTTPMessage.get_body() will always return either
   a string or nil.
   
   Fixes #1426 .

Instructions:
   This github pull request will be closed automatically; patch should be
   reviewed on the haproxy mailing list (haproxy@formilux.org). Everyone is
   invited to comment, even the patch's author. Please keep the author and
   list CCed in replies. Please note that in absence of any response this
   pull request will be lost.

Reply via email to