Project

General

Profile

Actions

Bug #9119

closed

PHP error from easyrule with no aliases in the config

Added by Jim Pingle about 6 years ago. Updated about 6 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Rules / NAT
Target version:
Start date:
11/14/2018
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
Release Notes:
Affected Version:
2.4.4
Affected Architecture:
All

Description

When the aliases section of config.xml is empty, easyrule fails with a PHP error:

Fatal error: Uncaught Error: Cannot create references to/from string offsets in /etc/inc/easyrule.inc:166
Stack trace:
#0 /etc/inc/easyrule.inc(248): easyrule_block_alias_add('1.2.3.4', 'wan')
#1 /etc/inc/easyrule.inc(365): easyrule_block_host_add('1.2.3.4', 'wan', 'inet')
#2 /usr/local/bin/easyrule(101): easyrule_parse_block('wan', '1.2.3.4')
#3 {main}
  thrown in /etc/inc/easyrule.inc on line 166
PHP ERROR: Type: 1, File: /etc/inc/easyrule.inc, Line: 166, Message: Uncaught Error: Cannot create references to/from string offsets in /etc/inc/easyrule.inc:166
Stack trace:
#0 /etc/inc/easyrule.inc(248): easyrule_block_alias_add('1.2.3.4', 'wan')
#1 /etc/inc/easyrule.inc(365): easyrule_block_host_add('1.2.3.4', 'wan', 'inet')
#2 /usr/local/bin/easyrule(101): easyrule_parse_block('wan', '1.2.3.4')
#3 {main}
  thrown
Actions #1

Updated by Jim Pingle about 6 years ago

  • Status changed from Assigned to Feedback
  • % Done changed from 0 to 100
Actions #2

Updated by Vladimir Lind about 6 years ago

Getting error on 2.4.5-DEVELOPMENT (amd64) built on Wed Nov 14 10:25:41 EST 2018 FreeBSD 11.2-RELEASE-p4:

[2.4.5-DEVELOPMENT][]/root: easyrule block wan 1.2.3.4

Warning: Illegal string offset 'alias' in /etc/inc/easyrule.inc on line 163

Warning: Illegal string offset 'alias' in /etc/inc/easyrule.inc on line 166

Fatal error: Uncaught Error: Cannot create references to/from string offsets in /etc/inc/easyrule.inc:166
Stack trace:
#0 /etc/inc/easyrule.inc(248): easyrule_block_alias_add('1.2.3.4', 'wan')
#1 /etc/inc/easyrule.inc(365): easyrule_block_host_add('1.2.3.4', 'wan', 'inet')
#2 /usr/local/bin/easyrule(101): easyrule_parse_block('wan', '1.2.3.4')
#3 {main}
thrown in /etc/inc/easyrule.inc on line 166
PHP ERROR: Type: 1, File: /etc/inc/easyrule.inc, Line: 166, Message: Uncaught Error: Cannot create references to/from string offsets in /etc/inc/easyrule.inc:166
Stack trace:
#0 /etc/inc/easyrule.inc(248): easyrule_block_alias_add('1.2.3.4', 'wan')
#1 /etc/inc/easyrule.inc(365): easyrule_block_host_add('1.2.3.4', 'wan', 'inet')
#2 /usr/local/bin/easyrule(101): easyrule_parse_block('wan', '1.2.3.4')
#3 {main}

Actions #3

Updated by Jim Pingle about 6 years ago

That snapshot is from before the fix was committed. Try again on the next snapshot, or gitsync.

Actions #4

Updated by Vladimir Lind about 6 years ago

2.4.5-DEVELOPMENT (amd64)
built on Wed Nov 14 23:01:04 EST 2018

On this snap - OK.

Actions #5

Updated by Jim Pingle about 6 years ago

  • Status changed from Feedback to Resolved
Actions

Also available in: Atom PDF