File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -371,12 +371,17 @@ PHP_FUNCTION(msg_send)
371
371
php_var_serialize (& msg_var , message , & var_hash );
372
372
PHP_VAR_SERIALIZE_DESTROY (var_hash );
373
373
374
- message_len = smart_str_get_len (& msg_var );
374
+ if (UNEXPECTED (EG (exception ))) {
375
+ smart_str_free (& msg_var );
376
+ RETURN_FALSE ;
377
+ }
378
+
375
379
380
+ zend_string * str = smart_str_extract (& msg_var );
381
+ message_len = ZSTR_LEN (str );
376
382
/* NB: php_msgbuf is 1 char bigger than a long, so there is no need to
377
383
* allocate the extra byte. */
378
384
messagebuffer = safe_emalloc (message_len , 1 , sizeof (struct php_msgbuf ));
379
- zend_string * str = smart_str_extract (& msg_var );
380
385
memcpy (messagebuffer -> mtext , ZSTR_VAL (str ), message_len + 1 );
381
386
zend_string_release (str );
382
387
smart_str_free (& msg_var );
You can’t perform that action at this time.
0 commit comments