Project

General

Profile

Actions

Bug #11117

closed

Net/ipv6.php: str_repeat(): Second argument has to be greater than or equal to 0 in /usr/local/share/pear/Net/IPv6.php on line 614

Added by Andrew Appel almost 5 years ago. Updated almost 5 years ago.

Status:
Not a Bug
Priority:
Normal
Assignee:
-
Category:
PHP Interpreter
Target version:
-
Start date:
11/30/2020
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Release Notes:
Affected Version:
2.5.x
Affected Architecture:
amd64

Description

PHP Warning: str_repeat(): Second argument has to be greater than or equal to 0 in /usr/local/share/pear/Net/IPv6.php on line 614

This repeats infinitely in my log file, when looking at the PHP file I don't know enough about programming to fix the second argument on line 614, top line below, and included 615, 616 & 617:

$fill = str_repeat(':0:', 6-$c2-$c1);

$uip = str_replace('::', $fill, $uip);

$uip = str_replace('::', ':', $uip);

I have included the crash report as well as the original file in question, and a .save variant I discovered today in same directory. Thanks all


Files

PHP_errors (1).log (382 KB) PHP_errors (1).log Error log in question Andrew Appel, 11/30/2020 11:34 AM
IPv6.php (26.1 KB) IPv6.php Current problematic referenced file Andrew Appel, 11/30/2020 11:39 AM
IPv6.php.save (26.1 KB) IPv6.php.save I found this in directory also, untested and unsure if any different Andrew Appel, 11/30/2020 11:39 AM
Actions #1

Updated by Andrew Appel almost 5 years ago

Correction: included lines 614-616 (not 617), but PHP file in question is of course attached. Requested to submit here from subreddit by developer of pfBlocker-NG.

Actions #2

Updated by Jim Pingle almost 5 years ago

  • Status changed from New to Feedback

The code itself is likely fine in the base OS (unless you edited it before the error appeared) but whatever it's being fed is wrong somehow. Check the IPv6 addresses and prefixes in your configuration and make sure they are all valid/sane. Perhaps something slipped past validation.

That nobody else is hitting it would imply it's specific to your environment somehow.

Actions #3

Updated by Andrew Appel almost 5 years ago

Jim Pingle wrote:

The code itself is likely fine in the base OS (unless you edited it before the error appeared) but whatever it's being fed is wrong somehow. Check the IPv6 addresses and prefixes in your configuration and make sure they are all valid/sane. Perhaps something slipped past validation.

That nobody else is hitting it would imply it's specific to your environment somehow.

AH. My issue was I was forcing WAN to ignore DHCP from my ISP to use my own DNS choice (only for router, not used in Unbound) - this disallowed DHCPv6 on WAN from getting any IPv6 DNS entries for the router. As I had only used 2 IPv4 entries and unchecked "Allow DCHP override" for WAN. Thank you for your assistance, and apologies that this was a non-issue, this can be closed / deleted / archived or however it may (or may not) be useful to anyone.

Actions #4

Updated by Jim Pingle almost 5 years ago

  • Status changed from Feedback to Not a Bug
Actions

Also available in: Atom PDF