Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package pspg for openSUSE:Factory checked in 
at 2026-11-23 15:08:31
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/pspg (Old)
 and      /work/SRC/openSUSE:Factory/.pspg.new.1340718 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "pspg"

Mon Nov 23 15:08:31 2026 rev:7 rq:1399721 version:5.9.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/pspg/pspg.changes        2026-10-23 
20:30:56.963252008 +0200
+++ /work/SRC/openSUSE:Factory/.pspg.new.1340718/pspg.changes   2026-11-23 
15:08:34.488942533 +0100
@@ -1,0 +2,6 @@
+Mon Nov  2 23:14:09 UTC 2026 - Marcus Rueckert <[email protected]>
+
+- Update to 5.9.1:
+  - fix possible crash on correct input data
+
+-------------------------------------------------------------------

Old:
----
  pspg-5.9.0.tar.gz

New:
----
  pspg-5.9.1.tar.gz

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

Other differences:
------------------
++++++ pspg.spec ++++++
--- /var/tmp/diff_new_pack.YZddUF/_old  2026-11-23 15:08:35.656991979 +0100
+++ /var/tmp/diff_new_pack.YZddUF/_new  2026-11-23 15:08:35.658992063 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           pspg
-Version:        5.9.0
+Version:        5.9.1
 Release:        0
 Summary:        Pager for PostgreSQL, MariaDB, Percona, and MySQL
 License:        BSD-2-Clause

++++++ pspg-5.9.0.tar.gz -> pspg-5.9.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pspg-5.9.0/meson.build new/pspg-5.9.1/meson.build
--- old/pspg-5.9.0/meson.build  2026-10-22 10:54:06.000000000 +0200
+++ new/pspg-5.9.1/meson.build  2026-11-02 19:09:15.000000000 +0100
@@ -1,4 +1,4 @@
-project('pspg', ['c'], version: '5.9.0')
+project('pspg', ['c'], version: '5.9.1')
 
 build_args = [
   '-DPROJECT_NAME=' + meson.project_name(),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pspg-5.9.0/pspg.spec new/pspg-5.9.1/pspg.spec
--- old/pspg-5.9.0/pspg.spec    2026-10-22 10:54:06.000000000 +0200
+++ new/pspg-5.9.1/pspg.spec    2026-11-02 19:09:15.000000000 +0100
@@ -3,7 +3,7 @@
 
 Summary:       pspg: a unix pager optimized for psql
 Name:          pspg
-Version:       5.9.0
+Version:       5.9.1
 Release:       0%{?dist}
 License:       BSD
 Group:                 Development/Tools
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pspg-5.9.0/src/infra.c new/pspg-5.9.1/src/infra.c
--- old/pspg-5.9.0/src/infra.c  2026-10-22 10:54:06.000000000 +0200
+++ new/pspg-5.9.1/src/infra.c  2026-11-02 19:09:15.000000000 +0100
@@ -608,6 +608,19 @@
 }
 
 /*
+ * Append one char
+ */
+void
+ExtStrAppendChar(ExtStr *estr, char c)
+{
+       if (estr->maxlen < 2)
+               estr->maxlen += 1024;
+
+       estr->data[estr->len++] = c;
+       estr->data[estr->len] = '\0';
+}
+
+/*
  * continuation_mark is related to new line symbol in text.
  * continuation_mark is related to line break created by
  * wrapped mode. continuation_mark2 is equal to previous
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pspg-5.9.0/src/pspg.h new/pspg-5.9.1/src/pspg.h
--- old/pspg-5.9.0/src/pspg.h   2026-10-22 10:54:06.000000000 +0200
+++ new/pspg-5.9.1/src/pspg.h   2026-11-02 19:09:15.000000000 +0100
@@ -35,7 +35,7 @@
 #define                        FILE_TSV                        2
 #define                        FILE_MATRIX                     3
 
-#define PSPG_VERSION "5.9.0"
+#define PSPG_VERSION "5.9.1"
 
 /* GNU Hurd does not define MAXPATHLEN */
 #ifndef MAXPATHLEN
@@ -426,6 +426,7 @@
 extern void ExtStrAppendBytes(ExtStr *estr, char *str, int size);
 extern void ExtStrAppendLine(ExtStr *estr, char *str, int size, char 
linestyle, bool continuation_mark, bool continuation_mark2);
 extern int ExtStrTrimEnd(ExtStr *estr, bool replace_nl);
+extern void ExtStrAppendChar(ExtStr *estr, char c);
 
 extern bool is_empty_str(char *str);
 extern int strnlen_limit(const char *str, int maxlen, int limit);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pspg-5.9.0/src/table.c new/pspg-5.9.1/src/table.c
--- old/pspg-5.9.0/src/table.c  2026-10-22 10:54:06.000000000 +0200
+++ new/pspg-5.9.1/src/table.c  2026-11-02 19:09:15.000000000 +0100
@@ -589,6 +589,85 @@
 }
 
 /*
+ * replace broken ending unicode by spaces
+ */
+static char *
+check_and_fix_utf8(char *line, ssize_t *bytes)
+{
+       ssize_t         _bytes = *bytes;
+       char       *endptr;
+       ExtStr     estr;
+
+       if (_bytes == 0)
+               return line;
+
+       endptr = memchr(line, '\0', _bytes);
+
+       if (!endptr)
+               return line;
+
+       if (endptr == line + _bytes - 1)
+               return line;
+
+       InitExtStr(&estr);
+
+       while (_bytes > 0)
+       {
+               char            c = *line;
+               int                     chl;
+
+               if (c & 0x80)
+               {
+                       if (c != '\0')
+                               ExtStrAppendChar(&estr, c);
+                       else
+                               log_row("skip zero inside string");
+
+                       _bytes--;
+                       line++;
+                       continue;
+               }
+
+               chl = utf8charlen(*line);
+               if (chl > _bytes)
+               {
+                       log_row("truncated utf8 sequnce found");
+                       ExtStrAppendBytes(&estr, "\342\215\260", 3);
+                       break;
+               }
+               else
+               {
+                       int             i;
+                       bool    is_broken = false;
+
+                       for (i = 1; i < chl; i++)
+                       {
+                               if (line[i] == '\0')
+                               {
+                                       is_broken = true;
+                                       break;
+                               }
+                       }
+
+                       if (is_broken)
+                       {
+                               log_row("broken utf8 sequnce found");
+                               ExtStrAppendBytes(&estr, "\342\215\260", 3);
+                       }
+                       else
+                               ExtStrAppendBytes(&estr, line, chl);
+
+                       line += chl;
+                       _bytes -= chl;
+               }
+       }
+
+       *bytes = estr.len;
+
+       return estr.data;
+}
+
+/*
  * Remove ANSI escape sequences from input line
  */
 static ssize_t
@@ -844,6 +923,19 @@
                }
 
                read = remove_ansi_escape_seq(line, read);
+
+               if (use_utf8)
+               {
+                       char       *fixedline;
+
+                       fixedline = check_and_fix_utf8(line, &read);
+                       if (fixedline != line)
+                       {
+                               free(line);
+                               line = fixedline;
+                       }
+               }
+
                if ((tabptr = memchr(line, '\t', read)))
                {
                        int             tabcount = 1;
@@ -1416,12 +1508,18 @@
        if (!broken_format)
        {
                char       *namesline = desc->namesline;
+               char       *namesline_end = NULL;
                char       *first_char = NULL;                          /* 
first non space char of column name */
                int                     offset;
                char       *ptr;
                char       *ptrend;
                int                     i;
 
+               if (namesline)
+               {
+                       namesline_end = namesline + strlen(namesline);
+               }
+
                /* Move right corner more right */
                if (desc->border_type == 0 && last_black_char)
                {
@@ -1486,8 +1584,8 @@
                                }
                                else
                                {
-                                       nextchar = namesline + 
charlen_range(namesline, ptrend);
-                                       display_width = dsplen_range(namesline, 
ptrend);
+                                       nextchar = namesline + 
charlen_range(namesline, namesline_end);
+                                       display_width = dsplen_range(namesline, 
namesline_end);
 
                                        /*
                                         * dsplen returns -1 for control and 
invalid characters.

Reply via email to