php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72973 Test ip2long_variation2.phpt fails on AIX
Submitted: 2016-08-30 13:02 UTC Modified: 2017-01-09 05:27 UTC
From: matthieu dot sarter dot external at atos dot net Assigned: krakjoe (profile)
Status: Closed Package: Network related
PHP Version: 7.0.10 OS: AIX
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: matthieu dot sarter dot external at atos dot net
New email:
PHP Version: OS:

 

 [2016-08-30 13:02 UTC] matthieu dot sarter dot external at atos dot net
Description:
------------
AIX's built-in inet_pton function is less strict than Linux's inet_pton function : it accepts IP strings containing excedentary O before one of the fourth integers.

To ensure consistent behaviour on the two OS, I suggest to check for excendentary O when using PHP's inet_pton on AIX and return false if they exist. This can easily be done by converting back the integer IP returned by AIX's inet_pton to a string IP and check if it is the same as the initial string. This is implemented in the attached patch (tested with PHP 7.0.3, 7.0.7, 7.0.9 and 7.0.10 on AIX 6.1).

If consistency is not a priority, this test should be skipped when running on AIX.


Patches

php-7.0.3-aix-inet-pton.patch (last revision 2016-08-30 13:02 UTC by matthieu dot sarter dot external at atos dot net)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-01-09 05:27 UTC] krakjoe@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: krakjoe
 [2017-01-09 05:27 UTC] krakjoe@php.net
I have updated the test: It's not that we don't care about consistency, but that we do care about BC.

It may be sensible to apply your patch to a future version of PHP, but today the break doesn't seem worth it: however unlikely it seems, someone on AIX may be relying on it's current behaviour.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 08:01:28 2024 UTC