Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix integer overflows in btop_collect.cpp #546

Merged
merged 1 commit into from
May 26, 2023

Commits on May 26, 2023

  1. Fix integer overflows in btop_collect.cpp

    Correct data types in calls to std::accumulate(). The "bandwidth" deques
    have type "long long", so the initial value of the accumulator (0) must
    also be "long long" (i.e., "0ll") to prevent integer overflows. Also,
    since since the bandwidth deques are (signed) "long long", the avg_speed
    should presumably be a signed "long long" instead of an unsigned
    "uint64_t". The previous behavior was for large bandwidth values to
    overflow the accumulator, resulting in a negative total, which then was
    cast to be a huge "uint64_t" value. As a consequence, the network graph
    autoscaling was broken for large bandwidths.
    dorrellmw committed May 26, 2023
    Configuration menu
    Copy the full SHA
    3c6929b View commit details
    Browse the repository at this point in the history