Wireshark-commits: [Wireshark-commits] master ba50c5a: Check the validator in ExtArgText::isValid()

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Fri, 24 Apr 2020 11:27:48 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=ba50c5a5f6b0edb6b06496de9c3f9d5b18f6cd1e
Submitter: "Roland Knall <rknall@xxxxxxxxx>"
Changed: branch: master
Repository: wireshark

Commits:

ba50c5a by Guy Harris (guy@xxxxxxxxxxxx):

    Check the validator in ExtArgText::isValid().
    
    The validator doesn't prevent the input focus from being transferred out
    of the QLineEdit, and it merely prevents the user from entering a value
    that's considered "invalid" rather than "not valid but "intermediate"".
    
    For QIntValidator(), values that have more digits than the maximum value
    are "invalid", but values that have the same number of digits but that
    are larger are just "intermediate".
    
    This means the user will be able to send such a value to the extcap
    module.
    
    So we explicitly check the validator in ExtArgText::isValid(), so that
    1) we provide visual feedback (at least to people who can detect a red
    background) for out-of-range values that don't have too many digits and
    2) prevent them from being treated as valid and passed to the extcap
    module.
    
    Bug: 16510
    Change-Id: Ie5b90cf5dbb57c91744f6a28a71674b65ef21bb6
    Reviewed-on: https://code.wireshark.org/review/36914
    Petri-Dish: Guy Harris <gharris@xxxxxxxxx>
    Tested-by: Petri Dish Buildbot
    Reviewed-by: Guy Harris <gharris@xxxxxxxxx>
    Reviewed-by: Roland Knall <rknall@xxxxxxxxx>
    

Actions performed:

    from  48f87bc   unit_strings.c: Prepend space before dB related unit strings
     add  ba50c5a   Check the validator in ExtArgText::isValid().


Summary of changes:
 ui/qt/extcap_argument.cpp | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)