Permalink
Browse files

avoid crash when TWIG_GET_ARRAY_ELEMENT returns NULL

fixes #807
  • Loading branch information...
1 parent 3694d4b commit 3ca665461749e7b1f52b0b09ab592ceb38ff9479 @arnaud-lb arnaud-lb committed Aug 20, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 ext/twig/twig.c
View
@@ -713,6 +713,9 @@ PHP_FUNCTION(twig_template_get_attributes)
}
ret = TWIG_GET_ARRAY_ELEMENT(object, item, item_len TSRMLS_CC);
+ if (!ret) {
+ ret = &EG(uninitialized_zval);
+ }
RETVAL_ZVAL(ret, 1, 0);
if (free_ret) {
zval_ptr_dtor(&ret);

0 comments on commit 3ca6654

Please sign in to comment.