Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package raptor for openSUSE:Factory checked 
in at 2026-11-17 17:16:03
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/raptor (Old)
 and      /work/SRC/openSUSE:Factory/.raptor.new.1251 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "raptor"

Tue Nov 17 17:16:03 2026 rev:47 rq:1386993 version:2.0.16

Changes:
--------
--- /work/SRC/openSUSE:Factory/raptor/raptor.changes    2025-07-09 
17:26:50.171622777 +0200
+++ /work/SRC/openSUSE:Factory/.raptor.new.1251/raptor.changes  2026-11-17 
17:16:21.785408569 +0100
@@ -1,0 +2,5 @@
+Wed Oct 21 21:17:09 UTC 2026 - Dirk Müller <[email protected]>
+
+- add CVE-2025-71436.patch (CVE-2025-71436, bsc#1286364)
+
+-------------------------------------------------------------------

New:
----
  CVE-2025-71436.patch

----------(New B)----------
  New:
- add CVE-2025-71436.patch (CVE-2025-71436, bsc#1286364)
----------(New E)----------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ raptor.spec ++++++
--- /var/tmp/diff_new_pack.76pXP8/_old  2026-11-17 17:16:22.900455484 +0100
+++ /var/tmp/diff_new_pack.76pXP8/_new  2026-11-17 17:16:22.901455526 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package raptor
 #
-# Copyright (c) 2025 SUSE LLC
+# Copyright (c) 2026 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -31,6 +31,7 @@
 Patch3:         raptor-libxml2-2.11-support.patch
 Patch4:         raptor-CVE-2024-57822.patch
 Patch5:         raptor-CVE-2024-57823.patch
+Patch6:         CVE-2025-71436.patch
 BuildRequires:  bison
 BuildRequires:  curl-devel
 BuildRequires:  libxslt-devel

++++++ CVE-2025-71436.patch ++++++
>From 361a803a72817ae771db2438277229e6541e1575 Mon Sep 17 00:00:00 2001
From: Dave Beckett <[email protected]>
Date: Fri, 10 Jul 2026 10:51:41 -0700
Subject: [PATCH] Fixed six low-severity memory and correctness defects

A codebase review flagged six low-severity issues across the escape
decoders, the stringbuffer copy contract, an N-Triples error message,
the counted-literal language-tag copy, and the raptor_www setters.

* The \u/\U escape decoders passed not-yet-validated bytes to isxdigit()
  through a signed char cast, undefined behavior for bytes >= 0x80; the
  bytes are now cast to unsigned char in turtle_common.c (two sites) and
  raptor_ntriples.c, matching the idiom already used in parsedate.c and
  raptor_rdfxml.c.
* (raptor_stringbuffer_append_turtle_string): Freed the decoded-output
  buffer when an illegal escape produced zero output length, because the
  zero-length append returns success without taking ownership and would
  otherwise leak the buffer.
* (raptor_ntriples_parse_term_internal): Printed (char*)*start instead of
  (char*)start in the illegal-escape error message, which had been
  reading the raw pointer bytes of the const unsigned char** parameter
  off the stack.
* (raptor_stringbuffer_copy_to_string): Enforced that @length is the full
  buffer size including the terminator and failed when the content would
  not fit, so the NUL terminator is no longer written one byte past a
  buffer sized exactly to the stated length. Updated the four in-tree
  callers in turtle_lexer.l (two long-literal sites), raptor_parse.c and
  raptor_grddl.c to pass length + 1.
* (raptor_new_term_from_counted_literal): Bounded the language-tag copy
  loop by language_len instead of running to a NUL terminator, which had
  over-read a length-delimited non-NUL-terminated buffer from an external
  caller.
* (raptor_new_term_from_literal): Rejected tags longer than 255 bytes
  instead of silently truncating the length mod 256 into its unsigned
  char parameter.
* (raptor_www_set_user_agent2, raptor_www_set_proxy2,
  raptor_www_set_http_accept2): Allocated the replacement first and freed
  the previous value only after success, and freed the user-agent pointer
  on the NULL/clear path, so stored values are no longer overwritten or
  dropped without freeing, matching raptor_www_set_http_cache_control.
* Added STANDALONE tests for the raptor_stringbuffer_copy_to_string
  boundary (an exact-size buffer fails, size+1 succeeds) and the
  language-tag copy (a counted non-NUL-terminated tag copies exactly
  language_len bytes; a tag over 255 bytes is rejected by the wrapper).
---
 src/raptor_grddl.c        |  2 +-
 src/raptor_ntriples.c     |  4 ++--
 src/raptor_parse.c        |  2 +-
 src/raptor_stringbuffer.c | 46 +++++++++++++++++++++++++++++----------
 src/raptor_term.c         | 35 ++++++++++++++++++++++++++++-
 src/raptor_www.c          | 27 ++++++++++++++++-------
 src/turtle_common.c       |  9 ++++++--
 src/turtle_lexer.l        |  4 ++--
 8 files changed, 101 insertions(+), 28 deletions(-)

Index: raptor2-2.0.16/src/raptor_grddl.c
===================================================================
--- raptor2-2.0.16.orig/src/raptor_grddl.c
+++ raptor2-2.0.16/src/raptor_grddl.c
@@ -1426,7 +1426,7 @@ raptor_grddl_parse_chunk(raptor_parser*
   buffer = RAPTOR_MALLOC(unsigned char*, buffer_len + 1);
   if(buffer)
     raptor_stringbuffer_copy_to_string(grddl_parser->sb, 
-                                       buffer, buffer_len);
+                                       buffer, buffer_len + 1);
   
 
   uri_string = raptor_uri_as_string(rdf_parser->base_uri);
Index: raptor2-2.0.16/src/raptor_ntriples.c
===================================================================
--- raptor2-2.0.16.orig/src/raptor_ntriples.c
+++ raptor2-2.0.16/src/raptor_ntriples.c
@@ -299,7 +299,7 @@ raptor_ntriples_parse_term_internal(rapt
 
           for(ii = 0; ii < ulen; ii++) {
             char cc = p[ii];
-            if(!isxdigit(RAPTOR_GOOD_CAST(char, cc))) {
+            if(!isxdigit(RAPTOR_GOOD_CAST(unsigned char, cc))) {
               raptor_log_error_formatted(world, RAPTOR_LOG_LEVEL_ERROR, 
locator, "N-Triples string error - illegal hex digit %c in Unicode escape 
'%c%s...'",
                             cc, c, p);
               n = 1;
@@ -351,7 +351,7 @@ raptor_ntriples_parse_term_internal(rapt
         break;
 
       default:
-        raptor_log_error_formatted(world, RAPTOR_LOG_LEVEL_ERROR, locator, 
"Illegal string escape \\%c in \"%s\"", c, (char*)start);
+        raptor_log_error_formatted(world, RAPTOR_LOG_LEVEL_ERROR, locator, 
"Illegal string escape \\%c in \"%s\"", c, (char*)*start);
         return 0;
     }
 
Index: raptor2-2.0.16/src/raptor_parse.c
===================================================================
--- raptor2-2.0.16.orig/src/raptor_parse.c
+++ raptor2-2.0.16/src/raptor_parse.c
@@ -1641,7 +1641,7 @@ raptor_parser_get_content(raptor_parser*
   if(!buffer)
     return NULL;
 
-  raptor_stringbuffer_copy_to_string(rdf_parser->sb, buffer, len);
+  raptor_stringbuffer_copy_to_string(rdf_parser->sb, buffer, len + 1);
 
   if(length_p)
     *length_p=len;
Index: raptor2-2.0.16/src/raptor_stringbuffer.c
===================================================================
--- raptor2-2.0.16.orig/src/raptor_stringbuffer.c
+++ raptor2-2.0.16/src/raptor_stringbuffer.c
@@ -506,14 +506,16 @@ raptor_stringbuffer_as_string(raptor_str
  * raptor_stringbuffer_copy_to_string:
  * @stringbuffer: raptor stringbuffer
  * @string: output string
- * @length: size of output string
+ * @length: full size of output string buffer, including the NUL terminator
  *
  * Copy the stringbuffer into a string.
  * 
- * Copies the underlying string to a pre-allocated buffer.  The
- * output string is always '\0' terminated.
+ * Copies the underlying string to a pre-allocated buffer.  @length
+ * includes space for the terminating '\0', and the output string is
+ * always '\0' terminated on success.
  *
- * Return value: non-0 on failure such as stringbuffer is empty, buffer is too 
small
+ * Return value: non-0 on failure such as a NULL or too-small buffer; an
+ * empty stringbuffer copies as the empty string
  **/
 int
 raptor_stringbuffer_copy_to_string(raptor_stringbuffer* stringbuffer,
@@ -525,18 +527,15 @@ raptor_stringbuffer_copy_to_string(rapto
   if(!string || length < 1)
     return 1;
 
-  if(!stringbuffer->length)
-    return 0;
+  if(stringbuffer->length >= length) {
+    *string = '\0';
+    return 1;
+  }
 
   p = string;
   for(node = stringbuffer->head; node; node = node->next) {
-    if(node->length > length) {
-      p[-1]='\0';
-      return 1;
-    }
     memcpy(p, node->string, node->length);
     p+= node->length;
-    length-= node->length;
   }
   *p='\0';
   return 0;
@@ -748,6 +747,31 @@ main(int argc, char *argv[])
     exit(1);
   }
 
+  copy_string = (unsigned char*)malloc(len);
+  if(!copy_string) {
+    fprintf(stderr, "%s: Failed to allocate exact-size copy buffer\n",
+            program);
+    exit(1);
+  }
+  if(!raptor_stringbuffer_copy_to_string(sb, copy_string, len)) {
+    fprintf(stderr, "%s: exact-size copy buffer did not fail\n", program);
+    exit(1);
+  }
+  free(copy_string);
+
+  copy_string = (unsigned char*)malloc(len + 1);
+  if(!copy_string) {
+    fprintf(stderr, "%s: Failed to allocate terminated copy buffer\n",
+            program);
+    exit(1);
+  }
+  if(raptor_stringbuffer_copy_to_string(sb, copy_string, len + 1) ||
+     strcmp((const char*)copy_string, items_string)) {
+    fprintf(stderr, "%s: size-plus-one copy buffer failed\n", program);
+    exit(1);
+  }
+  free(copy_string);
+
   str = raptor_stringbuffer_as_string(sb);
   if(strcmp((const char*)str, items_string)) {
     fprintf(stderr, "%s: string buffer contains '%s', expected '%s'\n",
Index: raptor2-2.0.16/src/raptor_term.c
===================================================================
--- raptor2-2.0.16.orig/src/raptor_term.c
+++ raptor2-2.0.16/src/raptor_term.c
@@ -201,6 +201,7 @@ raptor_new_term_from_counted_literal(rap
   if(language) {
     unsigned char c;
     unsigned char* l;
+    size_t i;
     
     new_language = RAPTOR_MALLOC(unsigned char*, language_len + 1);
     if(!new_language) {
@@ -209,12 +210,13 @@ raptor_new_term_from_counted_literal(rap
     }
 
     l = new_language;
-    while((c = *language++)) {
+    for(i = 0; i < language_len && (c = language[i]); i++) {
       if(c == '_')
         c = '-';
       *l++ = c;
     }
     *l = '\0';
+    language_len = RAPTOR_GOOD_CAST(unsigned char, l - new_language);
   } else
     language_len = 0;
 
@@ -281,6 +283,9 @@ raptor_new_term_from_literal(raptor_worl
   if(language)
     language_len = strlen(RAPTOR_GOOD_CAST(const char*, language));
 
+  if(language_len > 255)
+    return NULL;
+
   return raptor_new_term_from_counted_literal(world, literal, literal_len,
                                               datatype, language,
                                               RAPTOR_BAD_CAST(unsigned char, 
language_len));
@@ -794,6 +799,9 @@ main(int argc, char *argv[])
   raptor_uri* uri1;
   unsigned char* uri_str;
   size_t uri_len;
+  raptor_term* counted_language_term = NULL;
+  const unsigned char counted_language[2] = { 'e', 'n' };
+  unsigned char long_language[257];
   
   
   world = raptor_new_world();
@@ -934,6 +942,29 @@ main(int argc, char *argv[])
     goto tidy;
   }
 
+  counted_language_term = raptor_new_term_from_counted_literal(
+      world, (const unsigned char*)"x", 1, NULL, counted_language, 2);
+  if(!counted_language_term ||
+     counted_language_term->value.literal.language_len != 2 ||
+     memcmp(counted_language_term->value.literal.language, "en", 3)) {
+    fprintf(stderr,
+            "%s: counted non-NUL-terminated language tag was not copied 
exactly\n",
+            program);
+    rc = 1;
+    goto tidy;
+  }
+
+  memset(long_language, 'a', sizeof(long_language) - 1);
+  long_language[sizeof(long_language) - 1] = '\0';
+  term2 = raptor_new_term_from_literal(
+      world, (const unsigned char*)"x", NULL, long_language);
+  if(term2) {
+    fprintf(stderr, "%s: language tag longer than 255 bytes was accepted\n",
+            program);
+    rc = 1;
+    goto tidy;
+  }
+
 
   /* check a different URI term succeeds */
   term4 = raptor_new_term_from_counted_uri_string(world, uri_string2,
@@ -1030,6 +1061,8 @@ main(int argc, char *argv[])
     raptor_free_term(term4);
   if(term5)
     raptor_free_term(term5);
+  if(counted_language_term)
+    raptor_free_term(counted_language_term);
   
   raptor_free_world(world);
 
Index: raptor2-2.0.16/src/raptor_www.c
===================================================================
--- raptor2-2.0.16.orig/src/raptor_www.c
+++ raptor2-2.0.16/src/raptor_www.c
@@ -286,6 +286,8 @@ raptor_www_set_user_agent2(raptor_www* w
   char *ua_copy = NULL;
   
   if(!user_agent || !*user_agent) {
+    if(www->user_agent)
+      RAPTOR_FREE(char*, www->user_agent);
     www->user_agent = NULL;
     return 0;
   }
@@ -298,7 +300,9 @@ raptor_www_set_user_agent2(raptor_www* w
     return 1;
 
   memcpy(ua_copy, user_agent, user_agent_len + 1); /* copy NUL */
-  
+
+  if(www->user_agent)
+    RAPTOR_FREE(char*, www->user_agent);
   www->user_agent = ua_copy;
 
   return 0;
@@ -352,7 +356,9 @@ raptor_www_set_proxy2(raptor_www* www, c
     return 1;
 
   memcpy(proxy_copy, proxy, proxy_len + 1); /* copy NUL */
-  
+
+  if(www->proxy)
+    RAPTOR_FREE(char*, www->proxy);
   www->proxy = proxy_copy;
 
   return 0;
@@ -394,6 +400,7 @@ raptor_www_set_http_accept2(raptor_www*
                             size_t value_len)
 {
   char *value_copy;
+  char *p;
   size_t len = 8; /* strlen("Accept:")+1 */
   
   if(value) {
@@ -405,21 +412,25 @@ raptor_www_set_http_accept2(raptor_www*
   value_copy = RAPTOR_MALLOC(char*, len);
   if(!value_copy)
     return 1;
-  www->http_accept = value_copy;
+  p = value_copy;
 
   /* copy header name */
-  memcpy(value_copy, "Accept:", 7); /* Do not copy NUL */
-  value_copy += 7;
+  memcpy(p, "Accept:", 7); /* Do not copy NUL */
+  p += 7;
 
   /* copy header value */
   if(value) {
-    *value_copy++ = ' ';
-    memcpy(value_copy, value, value_len + 1); /* Copy NUL */
+    *p++ = ' ';
+    memcpy(p, value, value_len + 1); /* Copy NUL */
   } else {
     /* Ensure value is NUL terminated */
-    *value_copy = '\0';
+    *p = '\0';
   }
 
+  if(www->http_accept)
+    RAPTOR_FREE(char*, www->http_accept);
+  www->http_accept = value_copy;
+
 #if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1
   RAPTOR_DEBUG2("Using Accept header: '%s'\n", www->http_accept);
 #endif
Index: raptor2-2.0.16/src/turtle_common.c
===================================================================
--- raptor2-2.0.16.orig/src/turtle_common.c
+++ raptor2-2.0.16/src/turtle_common.c
@@ -140,7 +140,7 @@ raptor_stringbuffer_append_turtle_string
 
         for(ii = 0; ii < ulen; ii++) {
           char cc = s[ii];
-          if(!isxdigit(RAPTOR_GOOD_CAST(char, cc))) {
+          if(!isxdigit(RAPTOR_GOOD_CAST(unsigned char, cc))) {
             error_handler(error_data,
                           "Turtle %s error - illegal hex digit %c in Unicode 
escape '%c%s...'",
                           label, cc, c, s);
@@ -199,6 +199,11 @@ raptor_stringbuffer_append_turtle_string
 
   /* calculate output string size */
   len = d-string;
+
+  if(!len) {
+    RAPTOR_FREE(char*, string);
+    return 0;
+  }
   
 #ifdef __clang_analyzer__
   /* clang --analyze does not know about ownership of next call */
@@ -281,7 +286,7 @@ raptor_turtle_expand_qname_escapes(unsig
         
         for(ii = 0; ii < ulen; ii++) {
           char cc = s[ii];
-          if(!isxdigit(RAPTOR_GOOD_CAST(char, cc))) {
+          if(!isxdigit(RAPTOR_GOOD_CAST(unsigned char, cc))) {
             error_handler(error_data,
                           "Turtle name error - illegal hex digit %c in Unicode 
escape '%c%s...'",
                           cc, c, s);
Index: raptor2-2.0.16/src/turtle_lexer.l
===================================================================
--- raptor2-2.0.16.orig/src/turtle_lexer.l
+++ raptor2-2.0.16/src/turtle_lexer.l
@@ -272,7 +272,7 @@ EXPONENT [eE][+-]?[0-9]+
                   yylval->string = RAPTOR_MALLOC(unsigned char*, len + 1);
                   if(!yylval->string)
                     TURTLE_LEXER_OOM();
-                  raptor_stringbuffer_copy_to_string(turtle_parser->sb, 
(unsigned char*)yylval->string, len);
+                  raptor_stringbuffer_copy_to_string(turtle_parser->sb, 
(unsigned char*)yylval->string, len + 1);
                   yylval->string[len]='\0';
 
                   raptor_free_stringbuffer(turtle_parser->sb);
@@ -340,7 +340,7 @@ EXPONENT [eE][+-]?[0-9]+
                   yylval->string = RAPTOR_MALLOC(unsigned char*, len + 1);
                   if(!yylval->string)
                     TURTLE_LEXER_OOM();
-                  raptor_stringbuffer_copy_to_string(turtle_parser->sb, 
(unsigned char*)yylval->string, len);
+                  raptor_stringbuffer_copy_to_string(turtle_parser->sb, 
(unsigned char*)yylval->string, len + 1);
                   yylval->string[len]='\0';
 
                   raptor_free_stringbuffer(turtle_parser->sb);
@@ -465,7 +465,8 @@ EXPONENT [eE][+-]?[0-9]+
                   }
                   uri_string = raptor_stringbuffer_as_string(sb);
 
-                  if(!*uri_string)
+                  /* an empty stringbuffer from <> returns NULL */
+                  if(!uri_string || !*uri_string)
                     yylval->uri = raptor_uri_copy(rdf_parser->base_uri);
                   else
                     yylval->uri = 
raptor_new_uri_relative_to_base(rdf_parser->world, rdf_parser->base_uri, 
uri_string);
Index: raptor2-2.0.16/src/turtle_lexer.c
===================================================================
--- raptor2-2.0.16.orig/src/turtle_lexer.c
+++ raptor2-2.0.16/src/turtle_lexer.c
@@ -1485,7 +1485,7 @@ YY_RULE_SETUP
                   yylval->string = RAPTOR_MALLOC(unsigned char*, len + 1);
                   if(!yylval->string)
                     TURTLE_LEXER_OOM();
-                  raptor_stringbuffer_copy_to_string(turtle_parser->sb, 
(unsigned char*)yylval->string, len);
+                  raptor_stringbuffer_copy_to_string(turtle_parser->sb, 
(unsigned char*)yylval->string, len + 1);
                   yylval->string[len]='\0';
 
                   raptor_free_stringbuffer(turtle_parser->sb);
@@ -1568,7 +1568,7 @@ YY_RULE_SETUP
                   yylval->string = RAPTOR_MALLOC(unsigned char*, len + 1);
                   if(!yylval->string)
                     TURTLE_LEXER_OOM();
-                  raptor_stringbuffer_copy_to_string(turtle_parser->sb, 
(unsigned char*)yylval->string, len);
+                  raptor_stringbuffer_copy_to_string(turtle_parser->sb, 
(unsigned char*)yylval->string, len + 1);
                   yylval->string[len]='\0';
 
                   raptor_free_stringbuffer(turtle_parser->sb);
@@ -1735,7 +1735,8 @@ YY_RULE_SETUP
                   }
                   uri_string = raptor_stringbuffer_as_string(sb);
 
-                  if(!*uri_string)
+                  /* an empty stringbuffer from <> returns NULL */
+                  if(!uri_string || !*uri_string)
                     yylval->uri = raptor_uri_copy(rdf_parser->base_uri);
                   else
                     yylval->uri = 
raptor_new_uri_relative_to_base(rdf_parser->world, rdf_parser->base_uri, 
uri_string);

Reply via email to