Project

General

Profile

Bug #9119

PHP error from easyrule with no aliases in the config

Added by Jim Pingle 2 months ago. Updated 2 months ago.

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

100%

Estimated time:
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

Associated revisions

Revision b55d94e8 (diff)
Added by Jim Pingle 2 months ago

Init various arrays in easyrule before use with references. Fixes #9119

Revision 5e0665da (diff)
Added by Jim Pingle 2 months ago

Init various arrays in easyrule before use with references. Fixes #9119

(cherry picked from commit b55d94e80eeed57e39d33c643bf00be6565c1938)

History

#1 Updated by Jim Pingle 2 months ago

  • Status changed from Assigned to Feedback
  • % Done changed from 0 to 100

#2 Updated by Vladimir Lind 2 months 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}

#3 Updated by Jim Pingle 2 months ago

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

#4 Updated by Vladimir Lind 2 months ago

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

On this snap - OK.

#5 Updated by Jim Pingle 2 months ago

  • Status changed from Feedback to Resolved

Also available in: Atom PDF