Wireshark-commits: [Wireshark-commits] master-2.2 8f2e7b2: Fix the calculation of the number of lev
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Sat, 4 Mar 2017 04:37:24 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=8f2e7b24457295083b0b097679978567136f5eb7
Submitter: Guy Harris (guy@xxxxxxxxxxxx)
Changed: branch: master-2.2
Repository: wireshark

Commits:

8f2e7b2 by Guy Harris (guy@xxxxxxxxxxxx):

    Fix the calculation of the number of levels in the radix tree.
    
    The algorithm being used calculated the number of levels in a
    1024-leaf-node tree as being 2, but it's 1 - 0 elements means 0 levels,
    1 through 1024 elements means 1 level, 1025 through 1024^2 elements
    means 2 levels, etc..  With a count of 1024, the loop would bump the
    level count from 0 to 1, and divide the element count by 1024, yielding
    1, so the loop would not terminate, and the level count would them go
    from 1 to 2 and the element count would go to 0.
    
    This could cause problems if exactly 1024 packets were seen.
    
    Just use an if chain, similar to the one used when adding elements to
    the tree.
    
    Bug: 13433
    Change-Id: I3eaeaf374bb65b37b38a59e95f77cac6690614ed
    Reviewed-on: https://code.wireshark.org/review/20379
    Reviewed-by: Guy Harris <guy@xxxxxxxxxxxx>
    (cherry picked from commit b7e9582fd72d85373d5223394d55f405edd0eca8)
    Reviewed-on: https://code.wireshark.org/review/20380
    

Actions performed:

    from  78a80db   Update documentation with reference to $XDG_CONFIG_HOME
    adds  8f2e7b2   Fix the calculation of the number of levels in the radix tree.


Summary of changes:
 epan/frame_data_sequence.c |   24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)