web icon indicating copy to clipboard operation
web copied to clipboard

Division by 0 in header_authenticated.php

Open enginelesscc opened this issue 4 months ago • 2 comments

Info

I initially wanted to open a PR but the guidelines got me a bit unsure given this affects v5 only while v6 is lua now and doesnt have the affected code..

But I found it may still be useful to post for anyone currently affected until v6 is released.

The simple fix for this is here:

pi-hole/web/commit/bbcf9fa857002010d3c61c04f90a35ec6c31cea2

Versions

  • Pi-hole: v5.18.3
  • AdminLTE: v5.21
  • FTL: v5.25.2

Platform

  • OS and version: Debian Sid
  • Platform: LXD/Incus container

Expected behavior

Functional Webinterface / data validation

Actual behavior / bug

/proc/meminfo may return no data in a linux container (in my case: incus), causing the $data array to be incomplete. This resulted in a division by 0 error trying to divide by non-existant $meminfo['MemTotal']. This meant pihole-web was unusable (error 500).

Steps to reproduce

n/A

Debug Token

n/A

Screenshots

n/A

Additional context

n/A

enginelesscc avatar Oct 01 '24 21:10 enginelesscc