user140053
user140053

Reputation:

Avoid PHP engine crashes with ZVAL_STRING

In an extension, what can I do to avoid the crash of the php engine when zval string is allocated by myself ?

..
// will do implicitly ZVAL_STRING("tmp", "/tmp", 0); 
// 
SET_VAR_STRING("tmp", "/tmp");
..

php_embed_shutdown(TSRMLS_C);   // GPF !!

Any ideas?

Upvotes: 0

Views: 451

Answers (1)

strkol
strkol

Reputation: 2029

Change it to:

SET_VAR_STRING("tmp", estrdup("/tmp"));

Upvotes: 2

Related Questions