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

slurp_battery_info: Fix reading uninitialised memory #531

Merged
merged 1 commit into from
Sep 9, 2024

Commits on Sep 9, 2024

  1. slurp_battery_info: Fix reading uninitialised memory

    Fixes valgrind-found bug of the `for (walk = buf, ...` loop
    reading all of `buf` even though `buf` is null-terminated string
    (an only partly initialised char array).
    
        valgrind ./i3status -c ../etc/i3status.conf --run-once
    
        Conditional jump or move depends on uninitialised value(s)
          at 0x40F15A: slurp_battery_info (print_battery_info.c:164)
          by 0x40FA07: slurp_all_batteries (print_battery_info.c:558)
          by 0x40FCA6: print_battery_info (print_battery_info.c:612)
          by 0x409CA2: main (i3status.c:753)
    nh2 committed Sep 9, 2024
    Configuration menu
    Copy the full SHA
    8ee4244 View commit details
    Browse the repository at this point in the history