Wireshark-commits: [Wireshark-commits] master-2.4 551d488: Fix crash when using the "matches" opera

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Mon, 11 Feb 2019 09:49:16 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=551d48826c4a5c14fd4f3efb20855e6d0f4b92ee
Submitter: "Peter Wu <peter@xxxxxxxxxxxxx>"
Changed: branch: master-2.4
Repository: wireshark

Commits:

551d488 by Peter Wu (peter@xxxxxxxxxxxxx):

    Fix crash when using the "matches" operator on non-UTF-8 data
    
    GRegex is a thin wrapper around PCRE. Inputs (patterns and subjects) are
    assumed to be UTF-8 by default (unless G_REGEX_RAW is set). If the
    subject is not valid UTF-8, normally pcre_exec will immediately return a
    failure. However, as GLib sets PCRE_NO_UTF8_CHECK when G_REGEX_RAW is
    given, pcre_exec() will skip the safety check and crash instead.
    
    Fix this by always assuming raw byte patterns. Regression risk: patterns
    such as `ö.ï` will no longer match `öñï` since `ñ` is a multi-byte
    sequence. Patterns such as `(GET|POST) /` remain functional though.
    
    Bug: 14905
    Change-Id: I6450bb83f565d377f82a5dbb01690c5f49acd96f
    Reviewed-on: https://code.wireshark.org/review/31935
    Petri-Dish: Peter Wu <peter@xxxxxxxxxxxxx>
    Tested-by: Petri Dish Buildbot
    Reviewed-by: Anders Broman <a.broman58@xxxxxxxxx>
    (cherry picked from commit 0ca65a66f425c8beaa1af3deb3b84c2b16cffb55)
    Reviewed-on: https://code.wireshark.org/review/31972
    Reviewed-by: Peter Wu <peter@xxxxxxxxxxxxx>
    

Actions performed:

    from  165e359   [Automatic update for 2019-02-10]
     add  551d488   Fix crash when using the "matches" operator on non-UTF-8 data


Summary of changes:
 epan/ftypes/ftype-bytes.c | 24 ------------------------
 epan/ftypes/ftype-pcre.c  | 38 ++++++++++----------------------------
 2 files changed, 10 insertions(+), 52 deletions(-)