Skip to content
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

[BUG] phalcon_fetch_params() restores too many stack frames #918

Merged
merged 1 commit into from Jul 25, 2013
Merged

[BUG] phalcon_fetch_params() restores too many stack frames #918

merged 1 commit into from Jul 25, 2013

Conversation

ghost
Copy link

@ghost ghost commented Jul 25, 2013

If a method is called with too many or too few arguments, phalcon_fetch_parameters() throws an exception, restores the topmost memory frame and returns FAILURE. phalcon_fetch_params() notices FAILURE and attempts to restore someone else's stack frame. Which, of course, may lead to very interesting crashes :-)

Dev version will show smth like this:

WARNING: calling phalcon_memory_restore_stack() without an active memory frame!
#0  0x7fefcaee98db [/home/vladimir/.phpenv/versions/5.3.26/lib/php/extensions/debug-zts-20090626/phalcon.so(phalcon_print_backtrace+0x2f) [0x7fefcaee98db]]
#1  0x7fefcaf04473 [/home/vladimir/.phpenv/versions/5.3.26/lib/php/extensions/debug-zts-20090626/phalcon.so(phalcon_memory_restore_stack+0x74) [0x7fefcaf04473]]
#2  0x7fefcb0f27a4 [/home/vladimir/.phpenv/versions/5.3.26/lib/php/extensions/debug-zts-20090626/phalcon.so(zim_Phalcon_Escaper_escapeJs+0x66) [0x7fefcb0f27a4]]
#3  0xb0069f [php() [0xb0069f]]
#4  0xb01112 [php() [0xb01112]]
#5  0xaff5b0 [php(execute+0x54f) [0xaff5b0]]
#6  0xac232d [php(zend_execute_scripts+0x2ff) [0xac232d]]
#7  0xa1af98 [php(php_execute_script+0x5c9) [0xa1af98]]
#8  0xbce139 [php() [0xbce139]]
#9  0x7fefd5cf1ea5 [/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7fefd5cf1ea5]]
#10  0x432429 [php() [0x432429]]

@ghost
Copy link
Author

ghost commented Jul 25, 2013

Rebased against current HEAD

niden added a commit that referenced this pull request Jul 25, 2013
[BUG] phalcon_fetch_params() restores too many stack frames
@niden niden merged commit 6661097 into phalcon:1.3.0 Jul 25, 2013
@ghost ghost deleted the phalcon_fetch_params branch July 25, 2013 19:41
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