Wireshark-commits: [Wireshark-commits] master f18bd4b: Fix the test for a NetScaler trace file.

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Thu, 14 Mar 2019 10:48:35 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=f18bd4bd68e950a22baa9d7d4f1ed9236b410f68
Submitter: "Guy Harris <guy@xxxxxxxxxxxx>"
Changed: branch: master
Repository: wireshark

Commits:

f18bd4b by Guy Harris (guy@xxxxxxxxxxxx):

    Fix the test for a NetScaler trace file.
    
    When testing the signature field against a given version's signature:
    
    	we require that the signature field's size (size, not C
    	null-terminated string length) be at least the size of the
    	signature string (otherwise, it can't possibly match);
    
    	we check to make sure that the first N bytes of the signature
    	field, where N is the size of the version's signature string
    	(not including any terminating '\0' in that string), match the
    	version's signature string.
    
    I.e., we require that the version's signature string is a prefix of the
    signature string in the file.
    
    This does not require that the signature string in the file be
    null-terminated.
    
    It also doesn't allow the file's signature string to be a substring of
    the version's signature string, as that's *NOT* sufficient to identify
    the file as a NetScaler trace file, especially if we forcibly
    null-terminate the file's signature string and we trucate it to be
    zero-length, as, in that case, it's *always* a prefix of the version's
    signature string, and the file is incorrectly identified as a NetScaler
    trace file.
    
    (While we're at it, we make the nspm_signature_isvXXX() routines return
    true if it *is* and false if it *isn't*, rather than the reverse; having
    a routine with a name containing "is", and not "isnt", return true if it
    *isn't* is confusing.)
    
    Change-Id: I3694773a71b8b63d280e42f146698c82a0f0c332
    Ping-Bug: 15601
    Reviewed-on: https://code.wireshark.org/review/32403
    Reviewed-by: Guy Harris <guy@xxxxxxxxxxxx>
    

Actions performed:

    from  3b2b1d5   GBCS: Add define for use case GCS24a
     add  f18bd4b   Fix the test for a NetScaler trace file.


Summary of changes:
 wiretap/netscaler.c | 28 +++++++++++++++++++++-------
 1 file changed, 21 insertions(+), 7 deletions(-)