Skip to content

Commit

Permalink
Please note that you need to use 'int' as a length type when
Browse files Browse the repository at this point in the history
fetching strings.
  • Loading branch information
Sascha Schumann committed Jul 3, 2002
1 parent 9a743ee commit ad8b425
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.PARAMETER_PARSING_API
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,14 @@ if (zend_parse_parameters(3 TSRMLS_CC, "zbr!",
/* Get either a set of 3 longs or a string. */
long l1, l2, l3;
char *s;
long length;
/*
* The function expects a pointer to a integer in this case, not a long
* or any other type. If you specify a type which is larger
* than a 'int', the upper bits might not be initialized
* properly, leading to random crashes on platforms like
* Tru64 or Linux/Alpha.
*/
int length;

if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC,
"lll", &l1, &l2, &l3) == SUCCESS) {
Expand Down

0 comments on commit ad8b425

Please sign in to comment.