Wireshark-commits: [Wireshark-commits] master-2.2 d6b74a7: wslua: fix wslua file test failure

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

Commits:

d6b74a7 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/18023
    

Actions performed:

    from  6997baa   [Automatic update for 2016-10-02]
    adds  d6b74a7   wslua: fix wslua file test failure


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