summaryrefslogtreecommitdiff
path: root/src/callable.h
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-17 18:52:31 +0100
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-17 18:52:31 +0100
commit342d57ee250e976c51b970584e6286ad489e6594 (patch)
treea3a3296acc0296ecd65e78b27822f9df78dd22b2 /src/callable.h
parentda370694802b426190e1f071f2d3c12ea24253c2 (diff)
in php 5.3 environments, not all code was correctly initialized which resulted in access to uninitialized data
Diffstat (limited to 'src/callable.h')
-rw-r--r--src/callable.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/callable.h b/src/callable.h
index 9b5cdcd..f123c8b 100644
--- a/src/callable.h
+++ b/src/callable.h
@@ -12,7 +12,7 @@
* Forward definitions
*/
struct _zend_function_entry;
-struct _zend_internal_function_info;
+struct _zend_arg_info;
/**
* Set up namespace
@@ -36,18 +36,19 @@ public:
_argc = arguments.size();
_argv = new zend_arg_info[_argc+1];
- // counter
+ // the first record is initialized with information about the function,
+ // so we skip that here
int i=1;
// loop through the arguments
for (auto it = arguments.begin(); it != arguments.end(); it++)
{
+ // increment required
+ if (it->required()) _required++;
+
// fill the arg info
it->fill(&_argv[i++]);
}
-
- // @todo find out number of required arguments
- _required = _argc;
}
/**
@@ -106,7 +107,7 @@ public:
* @param ns Active namespace
* @param classname Optional class name
*/
- void initialize(struct _zend_internal_function_info *info, const char *classname = nullptr) const;
+ void initialize(struct _zend_arg_info *info, const char *classname = nullptr) const;
protected: