Project

General

Profile

Actions

Bug #15365

closed

pfBlockerNG PHP error when editing a list

Added by Steve Wheeler 9 months ago. Updated 8 months ago.

Status:
Resolved
Priority:
Normal
Category:
pfBlockerNG
Target version:
-
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
Affected Version:
Affected Plus Version:
24.03
Affected Architecture:

Description

When editing an IPv4 list item I hit:

PHP Errors:
[27-Mar-2024 15:22:03 Europe/London] PHP Fatal error:  Uncaught ValueError: range(): Argument #3 ($step) must be greater than 0 for increasing ranges in /usr/local/www/pfblockerng/pfblockerng_category_edit.php:391
Stack trace:
#0 /usr/local/www/pfblockerng/pfblockerng_category_edit.php(391): range(1, 17, -1)
#1 {main}
  thrown in /usr/local/www/pfblockerng/pfblockerng_category_edit.php on line 391

Looks like others have hit it editing other lists.

Tested:
pfSense-24.03.b.20240322.1708
pfSense-pkg-pfBlockerNG-3.2.0_9


Files

clipboard-202403280951-tqfxp.png (65.4 KB) clipboard-202403280951-tqfxp.png Danilo Zrenjanin, 03/28/2024 08:51 AM
pfblocker-range.patch (608 Bytes) pfblocker-range.patch Nizam Moidu, 04/25/2024 10:09 AM
393.diff (1.18 KB) 393.diff Christopher Cope, 04/25/2024 01:29 PM

Related issues

Related to Bug #15444: Since this update 24.03-RELEASE was installed, PFBlockerNG has not been functioning correctly.Duplicate

Actions
Actions #1

Updated by Danilo Zrenjanin 9 months ago

I can confirm this behavior.

Crash report begins.  Anonymous machine information:

amd64
15.0-CURRENT
FreeBSD 15.0-CURRENT #0 plus-devel-main-n256297-0a9899b0f3e: Fri Mar 22 17:45:50 UTC 2024     root@freebsd:/var/jenkins/workspace/pfSense-Plus-snapshots-master-main/obj/amd64/WamqD8YQ/var/jenkins/workspace/pfSense-Plus-snapshots-master-main/sources/FreeBS

Crash report details:

PHP Errors:
[28-Mar-2024 08:50:51 Etc/UTC] PHP Fatal error:  Uncaught ValueError: range(): Argument #3 ($step) must be greater than 0 for increasing ranges in /usr/local/www/pfblockerng/pfblockerng_category_edit.php:391
Stack trace:
#0 /usr/local/www/pfblockerng/pfblockerng_category_edit.php(391): range(1, 17, -1)
#1 {main}
  thrown in /usr/local/www/pfblockerng/pfblockerng_category_edit.php on line 391

No FreeBSD crash data found.
Actions #2

Updated by Glenn Hall 9 months ago

I can also confirm this behavior. I corrected it in my setup by editing line 391 of /usr/local/www/pfblockerng/pfblockerng_category_edit.php by changing the "range(1, 17, -1)" to "range(1, 17, 1)". This stopped the PHP error from occurring and allowed me to edit the DNSBL's again. I do not know if my change has other implications, although I have noticed no other issues since doing it.

Actions #3

Updated by Christopher Cope 8 months ago

This is due to a change in behavior with the range function as of PHP 8.3.0 https://www.php.net/manual/en/function.range.php

The correct solution is the edit to a positive 1, which would have the same output as the previous call on the older versions of PHP. I'll have a merge request together shortly.

Actions #4

Updated by Christopher Cope 8 months ago

  • Status changed from Confirmed to Pull Request Review
  • Assignee set to Christopher Cope
Actions #5

Updated by Jim Pingle 8 months ago

  • Target version deleted (2.8.0)
  • Plus Target Version deleted (24.03)
Actions #6

Updated by Mike Moore 8 months ago

Any luck getting the PR merged?
I cant update any of my feeds without it.

Actions #7

Updated by Nizam Moidu 8 months ago

you can try system patch

Actions #8

Updated by Danilo Zrenjanin 8 months ago

I've tested the patch against the:

24.03-RELEASE (amd64)
built on Wed Apr 24 17:38:00 UTC 2024
FreeBSD 15.0-CURRENT

After applying the patch, I was able to edit both the DNSBL Groups and IPv4 addresses.

It fixes what is reported here as well:
https://redmine.pfsense.org/issues/15419

Actions #9

Updated by Christopher Cope 8 months ago

There are actually 2 spots where this can cause an error. The pull request addresses both. The patch attached reflects the pull request.

Actions #10

Updated by Mike Moore 8 months ago

i dont know how to add the patch from the screen shot.
I am hoping it can be available through the package manager.

Actions #11

Updated by Jim Pingle 8 months ago

  • Related to Bug #15444: Since this update 24.03-RELEASE was installed, PFBlockerNG has not been functioning correctly. added
Actions #12

Updated by Mike Moore 8 months ago

ive added the fixes manually and confirmed all is well.

Any reason why this hasn't been pushed out via the repo?

Actions #13

Updated by Jim Pingle 8 months ago

  • Status changed from Pull Request Review to Resolved
  • % Done changed from 0 to 100

PR merged, updated package should be available now on 24.03.

Actions

Also available in: Atom PDF