php-src/ext/simplexml/tests
Niels Dossche 40e667280b
Fix GH-18597: Heap-buffer-overflow in zend_alloc.c when assigning string with UTF-8 bytes
xmlSave() also can flush in some cases. When the encoding is not
available this can fail for short inputs, resulting in an empty string
which is interned but then wrongly tagged by RETURN_NEW_STR.
Fix this by checking the error condition and switching to RETURN_STR for
defense-in-depth.

This issue also exists on 8.3, but does not crash; however, due to the
different API usage internally I cannot easily fix it on 8.3. There it
gives a partial output.

Closes GH-18606.
2025-05-20 21:32:17 +02:00
..
000.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
000.xml Sync leading and final newlines in source code files 2018-10-14 12:56:38 +02:00
001-mb.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
001.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
002.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
003.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
004.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
005.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
006.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
007.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
008.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
009.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
009b.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
010.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
011.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
012.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
013.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
014.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
014a.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
014b.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
015.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
016.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
016a.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
017.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
018.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
019.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
020.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
021.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
022.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
023.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
024.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
025.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
026.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
027.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
028.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
029.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
030.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
031.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
032.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
033.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
034.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
035.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
036.phpt Declare tentative return types for ext/simplexml 2021-05-26 11:23:38 +02:00
037.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
038.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
book.xml
bug12170.phpt Fix GH-12170: Can't use xpath with comments in SimpleXML 2023-09-14 18:42:16 +02:00
bug24392.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug24392.xml Sync leading and final newlines in source code files 2018-10-14 12:56:38 +02:00
bug26976.phpt Fix 'can not' in test data and in code comments 2021-10-05 09:51:58 +01:00
bug27010.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug35785.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug36611.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug37076.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug37076_1.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug37386.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug38347.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug38354.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug38406.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug38424.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug39662.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug39760.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug40451.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug41175.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug41582.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug41861.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug41867.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug41947.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug42259.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug42369.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug43221.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug44478.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug45553.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug46003.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug46047.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug46048.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug48601.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug51615.phpt Fix tests for libxml2 2.14 2025-03-10 20:22:11 +01:00
bug52751.phpt Fix #52751: XPath processing-instruction() function is not supported. 2023-09-11 00:08:29 +02:00
bug53033.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug54973.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug55098.phpt Apply SimpleXML iterator fixes only on master 2023-09-30 17:48:05 +02:00
bug61335.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug62328.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug62639.phpt Apply SimpleXML iterator fixes only on master 2023-09-30 17:48:05 +02:00
bug63575.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug66084_0.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug66084_1.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug67116.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug67572.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug69169.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug69491.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug72588.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug72957.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug72971.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug72971_2.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug74950.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug75245.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug76712.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
bug79971_1.phpt Backport 4fe82131: Backport libxml2 2.13.2 fixes (#14816) 2024-10-12 15:12:40 +02:00
bug79971_1.xml Fix #79971: special character is breaking the path in xml function 2021-11-14 23:24:33 -08:00
bug81325.phpt SKIPIF to EXTENSIONS 2021-08-03 12:16:13 +02:00
count_return_type_will_change.phpt Revert 746b1cf4 "Access long value directly for call to count() in simplexml" 2024-12-29 14:37:25 +01:00
current_error.phpt Declare tentative return types for ext/simplexml 2021-05-26 11:23:38 +02:00
feature55218.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
foreach_by_reference.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
get_prop_address_not_initialized.phpt Fix getting the address of an uninitialized property of a SimpleXMLElement resulting in a crash 2023-12-17 11:47:11 +01:00
getDocNamespaces_no_internal_declaration.phpt Update ext/dom names after policy change (#14171) 2024-05-09 10:40:53 +02:00
gh10200.phpt Move test for GH-10200 to the simplexml extension test directory 2023-01-07 03:07:37 +00:00
gh10983.phpt Fix GH-10983: State-dependant segfault in ReflectionObject::getProperties 2023-04-01 20:19:14 +02:00
gh12167.phpt Fix GH-12167 and GH-12169: Unable to get comment or processing instruction contents in SimpleXML 2023-09-25 19:47:09 +02:00
gh12169.phpt Fix GH-12167 and GH-12169: Unable to get comment or processing instruction contents in SimpleXML 2023-09-25 19:47:09 +02:00
gh12192.phpt Apply SimpleXML iterator fixes only on master 2023-09-30 17:48:05 +02:00
gh12208.phpt Apply SimpleXML iterator fixes only on master 2023-09-30 17:48:05 +02:00
gh12223.phpt Fix GH-12223: Entity reference produces infinite loop in var_dump/print_r 2023-09-16 21:19:58 +02:00
gh12929.phpt Fix GH-12929: SimpleXMLElement with stream_wrapper_register can segfault 2023-12-17 11:51:42 +01:00
gh14638.phpt Fix GH-14638: null dereference after XML parsing failure. 2024-07-01 22:36:32 +01:00
gh15837.phpt Fix GH-15837: Segmentation fault in ext/simplexml/simplexml.c 2024-09-11 20:38:38 +02:00
gh16808.phpt Fix GH-16808: Segmentation fault in RecursiveIteratorIterator->current() with a xml element input 2024-11-16 13:39:46 +01:00
gh17040.phpt Fix GH-17040: SimpleXML's unset can break DOM objects 2024-12-06 20:06:51 +01:00
gh17153.phpt Fix GH-17153: SimpleXML crash when using autovivification on document 2024-12-15 11:31:32 +01:00
gh17409.phpt Fix GH-17409: Assertion failure Zend/zend_hash.c:1730 2025-01-09 19:53:54 +01:00
gh17736.phpt Fix GH-17736: Assertion failure zend_reference_destroy() 2025-03-02 22:33:32 +01:00
gh18304.phpt Fix sxe test 2025-04-11 23:56:57 +02:00
gh18597.phpt Fix GH-18597: Heap-buffer-overflow in zend_alloc.c when assigning string with UTF-8 bytes 2025-05-20 21:32:17 +02:00
iterator_interaction_empty_and_var_dump.phpt Add a test case for iterator and empty & var_dump interactions 2023-09-17 16:21:54 +02:00
key_error.phpt Declare tentative return types for ext/simplexml 2021-05-26 11:23:38 +02:00
libxml_global_state_entity_loader_bypass.phpt Use EXTENSIONS instead of SKIPIF sections in *.phpt 2024-01-31 11:18:21 +01:00
profile01.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
profile02.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
profile03.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
profile04.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
profile05.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
profile06.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
profile07.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
profile08.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
profile09.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
profile10.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
profile11.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
profile12.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
profile13.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
simplexml_import_new_dom.phpt Update ext/dom names after policy change (#14171) 2024-05-09 10:40:53 +02:00
simplexml_import_old_dom.phpt [RFC] Add a way to opt-in ext/dom spec compliance (#13031) 2024-03-09 16:56:00 +01:00
simplexml_load_file.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
simplexml_uninitialized.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
SimpleXMLElement_addAttribute_basic.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
SimpleXMLElement_addAttribute_required_attribute_name.phpt Use "must not" instead of "cannot" wording 2024-08-21 21:12:17 +01:00
SimpleXMLElement_asXML_fragment_filename.phpt Add test for SimpleXMLElement::asXML() with a fragment and a filename 2023-08-16 08:27:43 +02:00
SimpleXMLElement_getDocNamespaces.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
SimpleXMLElement_xpath.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
SimpleXMLElement_xpath_4.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
sxe.dtd Merge branch 'PHP-7.3' into PHP-7.4 2019-05-13 03:53:49 +02:00
sxe.ent Fix permissions 2018-09-21 14:12:25 +02:00
sxe.xml Sync leading and final newlines in source code files 2018-10-14 12:56:38 +02:00
sxe_001.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
sxe_002.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
sxe_003.phpt Migrate skip checks to --EXTENSIONS--, p4 2021-04-08 10:36:44 +02:00
sxe_004.phpt Declare tentative return types for ext/simplexml 2021-05-26 11:23:38 +02:00
sxe_005.phpt Declare tentative return types for ext/simplexml 2021-05-26 11:23:38 +02:00
sxe私はガラスを食べられます.xml Sync leading and final newlines in source code files 2018-10-14 12:56:38 +02:00
xml_parsing_LIBXML_NO_XXE.phpt Add LIBXML_NO_XXE constant (#14844) 2024-07-06 17:43:46 +02:00
xml_parsing_LIBXML_RECOVER.phpt Add LIBXML_RECOVER (#13504) 2024-02-25 21:03:37 +01:00