Wireshark-commits: [Wireshark-commits] master-2.0 a353115: wslua: fix wslua file test failure

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Sun, 2 Oct 2016 16:50:04 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=a353115e35944ed8b2300f40cdc6030a50a994b7
Submitter: Peter Wu (peter@xxxxxxxxxxxxx)
Changed: branch: master-2.0
Repository: wireshark

Commits:

a353115 by Peter Wu (peter@xxxxxxxxxxxxx):

    wslua: fix wslua file test failure
    
    Lua 5.2.4 built with -DLUA_USE_APICHECK detected a stack issue:
    
        tshark: lapi.c:175: lua_settop: Assertion `(-(idx+1) <= (L->top - (func + 1))) && "invalid new top"' failed.
    
    Function File_read always assumes that File_read_line pushes a value on
    the stack (which clearly did not happen). On read failure, it would then
    pop the stack (tripping the assertion) to push nil.
    
    The other user (File_lines) is also affected by this change, but the Lua
    5.2.4 documentation says that it should also return nil on EOF, fitting
    this implementation.
    
    Change-Id: I9cc8a5319523b2b56f4ae4735bbdbc1196387386
    Reviewed-on: https://code.wireshark.org/review/18016
    Petri-Dish: Peter Wu <peter@xxxxxxxxxxxxx>
    Tested-by: Petri Dish Buildbot <buildbot-no-reply@xxxxxxxxxxxxx>
    Reviewed-by: Peter Wu <peter@xxxxxxxxxxxxx>
    (cherry picked from commit 9f55eb4e954dd125e229bc94892e1571abd2cd65)
    Reviewed-on: https://code.wireshark.org/review/18024
    

Actions performed:

    from  1b336d7   [Automatic update for 2016-10-02]
    adds  a353115   wslua: fix wslua file test failure


Summary of changes:
 epan/wslua/wslua_file.c |   10 ++++++++++
 1 file changed, 10 insertions(+)