• Meir Shpilraien (Spielrein)'s avatar
    Swap '\r\n' with spaces when returning a big number reply from Lua script. (#9870) · b8e82d20
    Meir Shpilraien (Spielrein) authored
    The issue can only happened with a bad Lua script that claims to return
    a big number while actually return data which is not a big number (contains
    chars that are not digits). Such thing will not cause an issue unless the big
    number value contains `\r\n` and then it messes the resp3 structure. The fix
    changes all the appearances of '\r\n' with spaces.
    
    Such an issue can also happened on simple string or error replies but those
    already handle it the same way this PR does (replace `\r\n` with spaces).
    
    Other replies type are not vulnerable to this issue because they are not
    counting on free text that is terminated with `\r\n` (either it contains the
    bulk length like string reply or they are typed reply that can not inject free
    text like boolean or number).
    
    The issue only exists on unstable branch, big number reply on Lua script
    was not yet added to any official release.
    b8e82d20
scripting.tcl 39.4 KB