Skip to content

Fixed bug #62500 (Segfault in DateInterval class when extended) #123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

reeze
Copy link
Contributor

@reeze reeze commented Jul 8, 2012

https://bugs.php.net/bug.php?id=62500

When accessing properties before DateIntervl initialized will cause segfault.
other functions checked this situation but left property getter and setter function.

@reeze
Copy link
Contributor Author

reeze commented Jul 8, 2012

@derick will you take a look at this bug? thanks:)

@php-pulls
Copy link

Hi:
I am sorry to say, your fix is wrong.

  1. thinking of:

class Crasher extends DateInterval {
public $y = "xxx";

  public function __construct($time_spec) {
              var_dump($this->y);
  }

}

your fix will trigger a warning and output a NULL, it's totally wrong.

the same issue also exists in the write context.

  1. there will be a memleak of your fix when the key is not a string.

I will make another fix , thanks

On Sun, Jul 8, 2012 at 4:16 PM, Reeze Xia
[email protected]
wrote:

https://bugs.php.net/bug.php?id=62500

When accessing properties before DateIntervl initialized will cause segfault.
other functions checked this situation but left property getter and setter function.

You can merge this Pull Request by running:

git pull https://github.com/reeze/php-src fix-62500-DateInterval-segfault

Or you can view, comment on it, or merge it online at:

#123

-- Commit Summary --

  • Fixed bug #62500 (Segfault in DateInterval class when extended)

-- File Changes --

M ext/date/php_date.c (11)
A ext/date/tests/bug62500.phpt (44)

-- Patch Links --

https://github.com/php/php-src/pull/123.patch
https://github.com/php/php-src/pull/123.diff


Reply to this email directly or view it on GitHub:
#123

Git Pull Requests Mailing List (https://github.com/php)
To unsubscribe, visit: http://www.php.net/unsub.php

Laruence Xinchen Hui
http://www.laruence.com/

@php-pulls
Copy link

Comment on behalf of laruence at php.net:

closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants