0003-XML-Writer-compare-namespace-declarations-correctly.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. From 4f5dbbffcc1c6cf0398bd03450453289a0979dea Mon Sep 17 00:00:00 2001
  2. From: Dave Beckett <dave@dajobe.org>
  3. Date: Sat, 18 Sep 2021 17:40:00 -0700
  4. Subject: [PATCH] XML Writer : compare namespace declarations correctly
  5. Apply patch from
  6. 0001-CVE-2020-25713-raptor2-malformed-input-file-can-lead.patch.1
  7. that fixes Issue#0000650 https://bugs.librdf.org/mantis/view.php?id=650
  8. which overwrote heap during XML writing in parse type literal
  9. content. This was detected with clang asan.
  10. Thanks to Michael Stahl / mst2 for the fix.
  11. [Retrieved from:
  12. https://github.com/dajobe/raptor/commit/4f5dbbffcc1c6cf0398bd03450453289a0979dea]
  13. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  14. ---
  15. src/raptor_xml_writer.c | 2 +-
  16. 1 file changed, 1 insertion(+), 1 deletion(-)
  17. diff --git a/src/raptor_xml_writer.c b/src/raptor_xml_writer.c
  18. index 56993dc3..4426d38c 100644
  19. --- a/src/raptor_xml_writer.c
  20. +++ b/src/raptor_xml_writer.c
  21. @@ -227,7 +227,7 @@ raptor_xml_writer_start_element_common(raptor_xml_writer* xml_writer,
  22. /* check it wasn't an earlier declaration too */
  23. for(j = 0; j < nspace_declarations_count; j++)
  24. - if(nspace_declarations[j].nspace == element->attributes[j]->nspace) {
  25. + if(nspace_declarations[j].nspace == element->attributes[i]->nspace) {
  26. declare_me = 0;
  27. break;
  28. }