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

Fix Phalcon\Mvc\Micro\LazyLoader segfault #14238

Merged
merged 4 commits into from
Jul 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG-3.4.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# [3.4.5](https://github.com/phalcon/cphalcon/releases/tag/v3.4.5) (2019-XX-XX)
- Fixed segfault in `Phalcon\Mvc\Micro\LazyLoader::__call()` when the handler has a syntax error. [#12396](https://github.com/phalcon/cphalcon/issues/12396)

# [3.4.4](https://github.com/phalcon/cphalcon/releases/tag/v3.4.4) (2019-06-30)
- Generated Dialect Class referring to a PHP class can't be found [#13867](https://github.com/phalcon/cphalcon/pull/13867)
- Changed default gcc's CFLAGS so that, the extension should be properly generated for most hosts, including Docker [#13143](https://github.com/phalcon/cphalcon/issues/13143)
Expand Down
6 changes: 5 additions & 1 deletion phalcon/mvc/micro/lazyloader.zep
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ class LazyLoader
let definition = this->_definition;

if typeof handler != "object" {
let handler = new {definition}();
if !class_exists(definition) {
throw new Exception("Handler '" . definition . "' doesn't exist");
}

let handler = create_instance(definition);
let this->_handler = handler;
}

Expand Down