phpipam
phpipam copied to clipboard
api crash when provisionning new ip in empty subnets.
Describe the bug Calling api to provision a new IP in an empty subnet yields an error an cancel the requests.
phpIPAM version phpIPam v1.7.3
Your Environment (please supply the following information):
- phpIPAM version: 1.7.3
- OS Rocky Linux 9.6
- PHP version 8.3.19
- Webserver apache 2.4.62
- Database mysql-community-8.4.5
Steps To Reproduce Please include steps to reproduce the issue:
- Create an empty subnet
- Try to provision an IP through the API
- See error in www-error.log [02-Dec-2025 16:05:08 Europe/Paris] PHP Fatal error: Uncaught TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, false given in /var/www/html/phpipam/api/controllers/Subnets.php:206 Stack trace: #0 /var/www/html/phpipam/api/index.php(288): Subnets_controller->GET() #1 /var/www/html/phpipam/index.php(10): require('/var/www/html/p...') #2 {main} thrown in /var/www/html/phpipam/api/controllers/Subnets.php on line 206
Check on $result==0 is throwing an exception.