Skip to content

Commit f2e6ccf

Browse files
committed
fixed #37 Error due to the 3rd argument of pnctl_exe
1 parent 66b0f79 commit f2e6ccf

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

package.xml.tmpl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
<license uri="http://www.php.net/license">PHP</license>
2525
<notes>
2626
- add a missing commit from #32 Build test error on 1.0.5
27+
- fixed #37 Error due to the 3rd argument of pnctl_exe
2728
</notes>
2829
<contents>
2930
<dir name="/">
@@ -81,7 +82,8 @@
8182
<version><release>1.0.7</release><api>1.0.0</api></version>
8283
<date>@curdate@</date>
8384
<notes>
84-
-
85+
- add a missing commit from #32 Build test error on 1.0.5
86+
- fixed #37 Error due to the 3rd argument of pnctl_exe
8587
</notes>
8688
</release>
8789
<release>

php_execdir.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -813,15 +813,14 @@ PHP_FUNCTION (pcntl_exec_re)
813813
convert_to_string_ex (element);
814814

815815
/* Length of element + equal sign + length of key + null */
816-
ZEND_ASSERT(Z_STRLEN_PP(element) < SIZE_MAX && key_length < SIZE_MAX);
817-
if ( Z_STRLEN_PP(element) < SIZE_MAX && key_length < SIZE_MAX ) {
816+
pair_length = Z_STRLEN_PP (element) + key_length + 2;
817+
if ( pair_length >= SIZE_MAX ) {
818818
#if PHP_VERSION_ID < 50200
819-
php_error_docref (NULL TSRMLS_CC, E_ERROR, "pcntl_exec(): The element length or key length is greater than %ld.", SIZE_MAX);
819+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "pcntl_exec(): The element lenth and ke length are greater than %ld", SIZE_MAX);
820820
#else
821-
php_error_docref (NULL TSRMLS_CC, E_ERROR, "The element length or key length is greater than %ld.", SIZE_MAX);
821+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The element lenth and ke length are greater than %ld", SIZE_MAX);
822822
#endif
823823
}
824-
pair_length = Z_STRLEN_PP (element) + key_length + 2;
825824
*pair = emalloc (pair_length);
826825
strlcpy (*pair, key, key_length);
827826
strlcat (*pair, "=", pair_length);

0 commit comments

Comments
 (0)