Wireshark-commits: [Wireshark-commits] master a409987: Fix format_uri().

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Tue, 21 May 2019 08:30:18 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=a409987eeaded5d7f6c7379530fbe856e9a97c7b
Submitter: "Guy Harris <guy@xxxxxxxxxxxx>"
Changed: branch: master
Repository: wireshark

Commits:

a409987 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>
    

Actions performed:

    from  707f464   mqtt: Add a preference to show message as text
     add  a409987   Fix format_uri().


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