textproc/raptor2: update to 2.0.16

Changelog:
 * Fixes CVE-2017-18926 and CVE-2020-25713
 * Multiple Appveyor Windows and CMake build fixes by 0u812. (Note: the
   resulting binaries and libraries were not tested on Windows)
 * Turtle parser now reads input in chunks so can handle huge files.
   Patch by Sebastian Freundt
 * Added a serializer for the mKR language. Patch by Richard H.
   McCullough.
 * Rapper utility now counts triples using longs
 * Several smaller portability fixes for OpenBSD and cross building

See the Raptor2 2.0.16 Release Notes [1] for the full details of the changes.

[1] https://librdf.org/raptor/RELEASE.html#rel2_0_16
This commit is contained in:
Tobias C. Berner 2023-03-04 07:15:22 +01:00
parent 405a905112
commit 1f33c291b4
7 changed files with 16 additions and 131 deletions

View file

@ -1,6 +1,5 @@
PORTNAME= raptor2
PORTVERSION= 2.0.15
PORTREVISION= 24
DISTVERSION= 2.0.16
CATEGORIES= textproc
MASTER_SITES= http://download.librdf.org/source/ \
SF/librdf/${PORTNAME}/${PORTVERSION}

View file

@ -1,2 +1,3 @@
SHA256 (raptor2-2.0.15.tar.gz) = ada7f0ba54787b33485d090d3d2680533520cd4426d2f7fb4782dd4a6a1480ed
SIZE (raptor2-2.0.15.tar.gz) = 1886657
TIMESTAMP = 1677909926
SHA256 (raptor2-2.0.16.tar.gz) = 089db78d7ac982354bdbf39d973baf09581e6904ac4c92a98c5caadb3de44680
SIZE (raptor2-2.0.16.tar.gz) = 1750726

View file

@ -1,40 +0,0 @@
From 590681e546cd9aa18d57dc2ea1858cb734a3863f Mon Sep 17 00:00:00 2001
From: Dave Beckett <dave@dajobe.org>
Date: Sun, 16 Apr 2017 23:15:12 +0100
Subject: [PATCH] Calcualte max nspace declarations correctly for XML writer
(raptor_xml_writer_start_element_common): Calculate max including for
each attribute a potential name and value.
Fixes Issues #0000617 http://bugs.librdf.org/mantis/view.php?id=617
and #0000618 http://bugs.librdf.org/mantis/view.php?id=618
---
src/raptor_xml_writer.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git src/raptor_xml_writer.c.orig src/raptor_xml_writer.c
index 693b9468..0d3a36a5 100644
--- src/raptor_xml_writer.c.orig
+++ src/raptor_xml_writer.c
@@ -181,9 +181,10 @@ raptor_xml_writer_start_element_common(raptor_xml_writer* xml_writer,
size_t nspace_declarations_count = 0;
unsigned int i;
- /* max is 1 per element and 1 for each attribute + size of declared */
if(nstack) {
- int nspace_max_count = element->attribute_count+1;
+ int nspace_max_count = element->attribute_count * 2; /* attr and value */
+ if(element->name->nspace)
+ nspace_max_count++;
if(element->declared_nspaces)
nspace_max_count += raptor_sequence_size(element->declared_nspaces);
if(element->xml_language)
@@ -237,7 +238,7 @@ raptor_xml_writer_start_element_common(raptor_xml_writer* xml_writer,
}
}
- /* Add the attribute + value */
+ /* Add the attribute's value */
nspace_declarations[nspace_declarations_count].declaration=
raptor_qname_format_as_xml(element->attributes[i],
&nspace_declarations[nspace_declarations_count].length);

View file

@ -1,33 +0,0 @@
From a549457461874157c8c8e8e8a6e0eec06da4fbd0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Tue, 24 Nov 2020 10:30:20 +0000
Subject: [PATCH] CVE-2020-25713 raptor2: malformed input file can lead to a
segfault
due to an out of bounds array access in
raptor_xml_writer_start_element_common
See:
https://bugs.mageia.org/show_bug.cgi?id=27605
https://www.openwall.com/lists/oss-security/2020/11/13/1
https://gerrit.libreoffice.org/c/core/+/106249
---
src/raptor_xml_writer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/raptor_xml_writer.c b/src/raptor_xml_writer.c
index 56993dc3..4426d38c 100644
--- src/raptor_xml_writer.c
+++ src/raptor_xml_writer.c
@@ -227,7 +227,7 @@ raptor_xml_writer_start_element_common(raptor_xml_writer* xml_writer,
/* check it wasn't an earlier declaration too */
for(j = 0; j < nspace_declarations_count; j++)
- if(nspace_declarations[j].nspace == element->attributes[j]->nspace) {
+ if(nspace_declarations[j].nspace == element->attributes[i]->nspace) {
declare_me = 0;
break;
}
--
2.28.0

View file

@ -1,47 +0,0 @@
commit 567d4d1ab639d924e8d5af459476f331b9af0ce5
Author: Dave Beckett <dave@dajobe.org>
Date: Tue Nov 4 15:25:20 2014 -0800
Fix error returns in new world methods
(raptor_world_get_parser_factory,
raptor_world_get_serializers_count): Fix return value in assertions
diff --git src/raptor_parse.c src/raptor_parse.c
index 26911f47..6caa7f1c 100644
--- src/raptor_parse.c
+++ src/raptor_parse.c
@@ -252,12 +252,12 @@ raptor_world_get_parser_factory(raptor_world *world, const char *name)
*
* Get number of parsers
*
- * Return value: number of parsers
+ * Return value: number of parsers or <0 on failure
**/
int
raptor_world_get_parsers_count(raptor_world* world)
{
- RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, raptor_world, NULL);
+ RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, raptor_world, -1);
raptor_world_open(world);
diff --git src/raptor_serialize.c src/raptor_serialize.c
index a1f29d78..a0344418 100644
--- src/raptor_serialize.c
+++ src/raptor_serialize.c
@@ -235,12 +235,12 @@ raptor_get_serializer_factory(raptor_world* world, const char *name)
*
* Get number of serializers
*
- * Return value: number of serializers
+ * Return value: number of serializers or <0 on failure
**/
int
raptor_world_get_serializers_count(raptor_world* world)
{
- RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, raptor_world, NULL);
+ RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, raptor_world, -1);
raptor_world_open(world);

View file

@ -1,6 +1,6 @@
--- src/sort_r.h.orig 2014-10-09 23:00:44 UTC
--- src/sort_r.h.orig 2023-03-04 06:08:43 UTC
+++ src/sort_r.h
@@ -24,10 +24,11 @@ void sort_r(void *base, size_t nel, size_t width,
@@ -24,11 +24,12 @@ void sort_r(void *base, size_t nel, size_t width,
defined OpenBSD3_1 || defined OpenBSD3_9 || defined __OpenBSD__ || \
defined __NetBSD__ || \
defined __DragonFly__ || \
@ -8,13 +8,14 @@
+ defined AMIGA) && !defined(qsort_r)
# define _SORT_R_BSD
#elif (defined _GNU_SOURCE || defined __gnu_hurd__ || defined __GNU__ || \
- defined __linux__ || defined __MINGW32__ || defined __GLIBC__)
+ defined __linux__ || defined __MINGW32__ || defined __GLIBC__) || \
defined __linux__ || defined __MINGW32__ || defined __GLIBC__ || \
- defined __CYGWIN__)
+ defined __CYGWIN__) || \
+ defined(qsort_r)
# define _SORT_R_LINUX
#elif (defined _WIN32 || defined _WIN64 || defined __WINDOWS__)
# define _SORT_R_WINDOWS
@@ -64,7 +65,7 @@ void sort_r(void *base, size_t nel, size_t width,
@@ -65,7 +66,7 @@ void sort_r(void *base, size_t nel, size_t width,
#if defined _SORT_R_BSD
/* BSD requires argument swap */
@ -23,7 +24,7 @@
int (*compar)(void *_thunk, const void *_a, const void *_b));
struct sort_r_data
@@ -82,7 +83,7 @@ void sort_r(void *base, size_t nel, size_t width,
@@ -83,7 +84,7 @@ void sort_r(void *base, size_t nel, size_t width,
#elif defined _SORT_R_LINUX
typedef int(* __compar_d_fn_t)(const void *, const void *, void *);

View file

@ -11,9 +11,9 @@ man/man1/rapper.1.gz
man/man3/libraptor2.3.gz
share/gtk-doc/html/raptor2/home.png
share/gtk-doc/html/raptor2/index.html
share/gtk-doc/html/raptor2/index.sgml
share/gtk-doc/html/raptor2/introduction.html
share/gtk-doc/html/raptor2/ix01.html
share/gtk-doc/html/raptor2/left-insensitive.png
share/gtk-doc/html/raptor2/left.png
share/gtk-doc/html/raptor2/parser-grddl.html
share/gtk-doc/html/raptor2/parser-guess.html
@ -35,6 +35,7 @@ share/gtk-doc/html/raptor2/raptor2-changes-2-0-10-to-2-0-11.html
share/gtk-doc/html/raptor2/raptor2-changes-2-0-11-to-2-0-12.html
share/gtk-doc/html/raptor2/raptor2-changes-2-0-13-to-2-0-14.html
share/gtk-doc/html/raptor2/raptor2-changes-2-0-14-to-2-0-15.html
share/gtk-doc/html/raptor2/raptor2-changes-2-0-15-to-2-0-16.html
share/gtk-doc/html/raptor2/raptor2-changes-2-0-3-to-2-0-4.html
share/gtk-doc/html/raptor2/raptor2-changes-2-0-4-to-2-0-5.html
share/gtk-doc/html/raptor2/raptor2-changes-2-0-5-to-2-0-6.html
@ -65,10 +66,12 @@ share/gtk-doc/html/raptor2/raptor2-section-xml.html
share/gtk-doc/html/raptor2/raptor2.devhelp2
share/gtk-doc/html/raptor2/reference-manual.html
share/gtk-doc/html/raptor2/restrict-parser-network-access.html
share/gtk-doc/html/raptor2/right-insensitive.png
share/gtk-doc/html/raptor2/right.png
share/gtk-doc/html/raptor2/serializer-atom.html
share/gtk-doc/html/raptor2/serializer-dot.html
share/gtk-doc/html/raptor2/serializer-json.html
share/gtk-doc/html/raptor2/serializer-mkr.html
share/gtk-doc/html/raptor2/serializer-nquads.html
share/gtk-doc/html/raptor2/serializer-ntriples.html
share/gtk-doc/html/raptor2/serializer-rdfxml-abbrev.html
@ -105,4 +108,5 @@ share/gtk-doc/html/raptor2/tutorial-serializer-set-error-warning-handlers.html
share/gtk-doc/html/raptor2/tutorial-serializer-to-destination.html
share/gtk-doc/html/raptor2/tutorial-serializing.html
share/gtk-doc/html/raptor2/tutorial.html
share/gtk-doc/html/raptor2/up-insensitive.png
share/gtk-doc/html/raptor2/up.png