Wireshark-commits: [Wireshark-commits] master 35418a7: Add format_text_string(), which gets the len
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Thu, 20 Aug 2020 07:24:45 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=35418a73f7c9cefebe392b1ea0f012fccaf89801
Submitter: "Guy Harris <gharris@xxxxxxxxx>"
Changed: branch: master
Repository: wireshark

Commits:

35418a7 by Guy Harris (gharris@xxxxxxxxx):

    Add format_text_string(), which gets the length with strlen().
    
    format_text(alloc, string, strlen(string)) is a common idiom; provide
    format_text_string(), which does the strlen(string) for you.  (Any
    string used in a %s to set the text of a protocol tree item, if it was
    directly extracted from the packet, should be run through a format_text
    routine, to ensure that it's valid UTF-8 and that control characters are
    handled correctly.)
    
    Update comments while we're at it.
    
    Change-Id: Ia8549efa1c96510ffce97178ed4ff7be4b02eb6e
    Reviewed-on: https://code.wireshark.org/review/38202
    Petri-Dish: Guy Harris <gharris@xxxxxxxxx>
    Tested-by: Petri Dish Buildbot
    Reviewed-by: Guy Harris <gharris@xxxxxxxxx>
    

Actions performed:

    from  06ff18f   EPL: adaptations of SDO dissector
     add  35418a7   Add format_text_string(), which gets the length with strlen().


Summary of changes:
 debian/libwireshark0.symbols |  1 +
 epan/strutil.c               | 33 ++++++++++++++++++++++++----
 epan/strutil.h               | 51 ++++++++++++++++++++++++++++++++++++++++----
 3 files changed, 77 insertions(+), 8 deletions(-)