Issues

ZF-7029: Zend_Service_Amazon_S3 - Incorrect IP address matching in createBucket method

Issue Type: Bug Created: 2009-06-16T12:47:50.000+0000 Last Updated: 2009-06-17T14:05:33.000+0000 Status: Resolved Fix version(s): - 1.8.4 (23/Jun/09)

Reporter: Christopher Verwymeren (cverwymeren) Assignee: Stanislav Malyshev (stas) Tags: - Zend_Service_Amazon

Related issues: Attachments:

Description

The regular expression used by the createBucket method to detect an IP address is incorrect. The period characters in the regular expression are not escaped causing detection of one or more numeric digits followed by any character.

Example:

createBucket detects a match and throws an exception when passed the bucket name bf6a1588-48ce-4900-9a62-7d08eab1a02f

Possible Solutions:

The current regular expression should have period characters escaped like so: (\d+).(\d+).(\d+).(\d+)

Use a much more complex regular expression to detect all 4 numbers in the IP address are in the range 0..255: (25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)

Comments

Posted by Matthew Weier O'Phinney (matthew) on 2009-06-16T14:49:02.000+0000

Assigning to Stas.

Posted by Stanislav Malyshev (stas) on 2009-06-17T14:05:33.000+0000

Fixed, thanks.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts