Project

General

Profile

Actions

Bug #15365

closed
SW CC

pfBlockerNG PHP error when editing a list

Bug #15365: pfBlockerNG PHP error when editing a list

Added by Steve Wheeler over 2 years ago. Updated over 2 years 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 1 (0 open1 closed)

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

Actions

DZ Updated by Danilo Zrenjanin over 2 years ago Actions #1

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.

GH Updated by Glenn Hall over 2 years ago Actions #2

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.

CC Updated by Christopher Cope over 2 years ago Actions #3

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.

CC Updated by Christopher Cope over 2 years ago Actions #4

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

JP Updated by Jim Pingle over 2 years ago Actions #5

  • Target version deleted (2.8.0)
  • Plus Target Version deleted (24.03)

MM Updated by Mike Moore over 2 years ago Actions #6

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

NM Updated by Nizam Moidu over 2 years ago Actions #7

you can try system patch

DZ Updated by Danilo Zrenjanin over 2 years ago Actions #8

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

CC Updated by Christopher Cope over 2 years ago Actions #9

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

MM Updated by Mike Moore over 2 years ago Actions #10

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

JP Updated by Jim Pingle over 2 years ago Actions #11

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

MM Updated by Mike Moore over 2 years ago Actions #12

ive added the fixes manually and confirmed all is well.

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

JP Updated by Jim Pingle over 2 years ago Actions #13

  • 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