Wireshark-commits: [Wireshark-commits] master-3.0 61284f2: Fix format_uri().
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Tue, 21 May 2019 08:30:29 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=61284f27e492ce3ce36abef10fc145067c9b3344
Submitter: "Guy Harris <guy@xxxxxxxxxxxx>"
Changed: branch: master-3.0
Repository: wireshark

Commits:

61284f2 by Guy Harris (guy@xxxxxxxxxxxx):

    Fix format_uri().
    
    It was using the same index into the input and output strings, which
    means that if it escaped any character, it would skip the next two
    characters in the input sring.
    
    It was also not clearing is_reserved before testing whether a character
    was reserved, so once it saw a character that neede dto be escaped, it
    would escape all subsequent characters.
    
    It was only used in get_key_string(), which was never used, so it was
    dead code, but let's at least fix it, even if we end up removing that
    code, so that if we bring it back, we bring back a non-broken version,
    and so that if anybody *else* uses it, it's not broken.
    
    Change-Id: I36588efad36908e012023bcfbd813c749a6a254f
    Reviewed-on: https://code.wireshark.org/review/33287
    Petri-Dish: Guy Harris <guy@xxxxxxxxxxxx>
    Tested-by: Petri Dish Buildbot
    Reviewed-by: Guy Harris <guy@xxxxxxxxxxxx>
    (cherry picked from commit b2ede5d9970a8ecf65de6fb09d12d4c2547b9ba2)
    Reviewed-on: https://code.wireshark.org/review/33292
    

Actions performed:

    from  b46bd20   mqtt: Add a preference to show message as text
     add  61284f2   Fix format_uri().


Summary of changes:
 epan/strutil.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)