Skip to content

Commit 1f72410

Browse files
committed
Merge branch 'PHP-8.5'
* PHP-8.5: NEWS: Fix section order lexbor: Cherry pick "Core: Reset length in lexbor_str_destroy()"
2 parents 294a080 + c997212 commit 1f72410

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

ext/lexbor/lexbor/core/str.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ lexbor_str_destroy(lexbor_str_t *str, lexbor_mraw_t *mraw, bool destroy_obj)
8080
}
8181

8282
if (str->data != NULL) {
83+
lexbor_str_clean(str);
8384
str->data = lexbor_mraw_free(mraw, str->data);
8485
}
8586

ext/uri/tests/gh19979.phpt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
--TEST--
2+
GH-19979: Zend/zend_string.h:191:24: runtime error: null pointer passed as argument 2, which is declared to never be null
3+
--FILE--
4+
<?php
5+
6+
$baseUrl = \Uri\WhatWg\Url::parse('https://example.com/path?query');
7+
var_dump(\Uri\WhatWg\Url::parse('relative', $baseUrl));
8+
9+
?>
10+
--EXPECTF--
11+
object(Uri\WhatWg\Url)#%d (8) {
12+
["scheme"]=>
13+
string(5) "https"
14+
["username"]=>
15+
NULL
16+
["password"]=>
17+
NULL
18+
["host"]=>
19+
string(11) "example.com"
20+
["port"]=>
21+
NULL
22+
["path"]=>
23+
string(9) "/relative"
24+
["query"]=>
25+
NULL
26+
["fragment"]=>
27+
NULL
28+
}

0 commit comments

Comments
 (0)