phpipam icon indicating copy to clipboard operation
phpipam copied to clipboard

api crash when provisionning new ip in empty subnets.

Open sbskas opened this issue 1 month ago • 0 comments

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:

  1. Create an empty subnet
  2. Try to provision an IP through the API
  3. 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.

sbskas avatar Dec 04 '25 20:12 sbskas