Re: Usin ClangStatic Analyzer for zend_parse_parameters
| From: | Johannes Schlüter | Date: | Tue, 18 Feb 2014 17:14:00 +0000 |
| Subject: | Re: Usin ClangStatic Analyzer for zend_parse_parameters | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-72687@lists.php.net to get a copy of this message | ||
On Tue, 2014-02-18 at 16:00 +0000, Terry Ellison wrote:
> > <snip> Running this over one of my PHP builds I got those error reports:
> > http://schlueters.de/zppcheck/ maybe somebody wants to go
> > through them
> > and fix at least the trivial ones.
> By the way, your report seems to be listing entries twice -- at least
> as the four PHPdbg SAPI ones.
Interesting catch, have to investigate.
> In this case these are all a case of the "s" parameter taking a
> char**, int* but phpdbg.c is passing in a char**, uint*. I'll issue a
> patch for Joe or Bob to review and push into PHP-5.6.
Thanks.
> Note that http://www.php.net/manual/en/internals2.funcs.php
> states
> that the "s" parameter takes the addresses of char*, uint that is
> char** uint* which is wrong.
Indeed a bug, will fix that right after sending this mail. Thanks for
noticing.
> Though why the length field should be signed seems odd to me as a
> negative length makes no sense at all.
- since it was defined that way
- since int is a simple choice
- since signed int has enough space for all expected strings
- since it can quite certainly passed to any library, it is
unlikely a library will choose int4_t or such as length
for strings and maxlength handling can now be in one place
- since it is supposed to be fixed (see recent looong discussion)
;-)
johannes