Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package hplip for openSUSE:Factory checked 
in at 2023-03-30 22:50:47
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/hplip (Old)
 and      /work/SRC/openSUSE:Factory/.hplip.new.31432 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "hplip"

Thu Mar 30 22:50:47 2023 rev:148 rq:1075225 version:3.22.10

Changes:
--------
--- /work/SRC/openSUSE:Factory/hplip/hplip.changes      2023-01-04 
17:50:52.133568446 +0100
+++ /work/SRC/openSUSE:Factory/.hplip.new.31432/hplip.changes   2023-03-30 
22:50:51.748444894 +0200
@@ -1,0 +2,9 @@
+Wed Mar 29 04:59:28 UTC 2023 - Antonio Larrosa <alarr...@suse.com>
+
+- Add patch to fix hplip applying printf string format parsing to
+  printer attributes returned from CUPS (such as
+  "dnssd://foo%20series._ipp._tcp.local/?uuid=...") which results
+  in a segfault (boo#1209866, lp#2013185):
+  * fix-printer-attributes-parsing.patch
+
+-------------------------------------------------------------------

New:
----
  fix-printer-attributes-parsing.patch

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

Other differences:
------------------
++++++ hplip.spec ++++++
--- /var/tmp/diff_new_pack.YqtWNa/_old  2023-03-30 22:50:52.500448919 +0200
+++ /var/tmp/diff_new_pack.YqtWNa/_new  2023-03-30 22:50:52.504448940 +0200
@@ -86,6 +86,8 @@
 # PATCH-FIX-UPSTREAM: https://bugs.launchpad.net/hplip/+bug/1879445
 Patch404:       hplip-3.20.6-python-includes.patch
 Patch500:       hplip-missing-drivers.patch
+# PATCH-FIX-UPSTREAM boo#1209866 lp#2013185
+Patch501:       fix-printer-attributes-parsing.patch
 BuildRequires:  %{pymod devel}
 BuildRequires:  %{pymod qt5-devel}
 BuildRequires:  %{pymod xml}
@@ -331,6 +333,7 @@
 %patch403 -p1
 %patch404 -p1
 %patch500 -p1
+%patch501 -p1
 # replace "env" shebang and "/usr/bin/python" with real executable
 find . -name '*.py' -o -name pstotiff | \
     xargs -n 1 sed -i '1s,^#!\(%{_bindir}/env 
python\|%{_bindir}/python\),#!%{pyexe},'

++++++ fix-printer-attributes-parsing.patch ++++++
Index: hplip-3.22.10/protocol/hp_ipp.c
===================================================================
--- hplip-3.22.10.orig/protocol/hp_ipp.c
+++ hplip-3.22.10/protocol/hp_ipp.c
@@ -43,6 +43,12 @@ Boston, MA 02110-1301, USA.
 #define _STRINGIZE(x) #x
 #define STRINGIZE(x) _STRINGIZE(x)
 
+#define hplip_strlcpy(dst, src, size) \
+    do { \
+        if (!memccpy(dst, src, '\0', size)) \
+               dst[size - 1] = '\0'; \
+    } while (0)
+
 
 http_t* acquireCupsInstance()
 {
@@ -113,7 +119,7 @@ int addCupsPrinter(char *name, char *dev
      }
 
      if ( info == NULL )
-        snprintf( info,sizeof(info), name );
+        hplip_strlcpy( info, name, sizeof(info));
 
      sprintf( printer_uri, "ipp://localhost/printers/%s", name );
 
@@ -514,27 +520,27 @@ int __parsePrinterAttributes(ipp_t *resp
 
              if ( strcmp(attr_name, "printer-name") == 0 &&
                                         val_tag == IPP_TAG_NAME ) {
-                  snprintf(t_printer->name, 
sizeof(t_printer->name),ippGetString(attr, 0, NULL) );
+                  hplip_strlcpy(t_printer->name, ippGetString(attr, 0, NULL), 
sizeof(t_printer->name) );
              }
              else if ( strcmp(attr_name, "device-uri") == 0 &&
                                          val_tag == IPP_TAG_URI ) {
-                  
snprintf(t_printer->device_uri,sizeof(t_printer->device_uri), 
ippGetString(attr, 0, NULL) );
+                  hplip_strlcpy(t_printer->device_uri, ippGetString(attr, 0, 
NULL), sizeof(t_printer->device_uri) );
              }
              else if ( strcmp(attr_name, "printer-uri-supported") == 0 &&
                                                  val_tag == IPP_TAG_URI ) {
-                  
snprintf(t_printer->printer_uri,sizeof(t_printer->printer_uri), 
ippGetString(attr, 0, NULL) );
+                  hplip_strlcpy(t_printer->printer_uri, ippGetString(attr, 0, 
NULL), sizeof(t_printer->printer_uri) );
              }
              else if ( strcmp(attr_name, "printer-info") == 0 &&
                                         val_tag == IPP_TAG_TEXT ) {
-                  snprintf(t_printer->info,sizeof(t_printer->info), 
ippGetString(attr, 0, NULL) );
+                  hplip_strlcpy(t_printer->info, ippGetString(attr, 0, NULL), 
sizeof(t_printer->info) );
              }
              else if ( strcmp(attr_name, "printer-location") == 0 &&
                                            val_tag == IPP_TAG_TEXT ) {
-                  
snprintf(t_printer->location,sizeof(t_printer->location),ippGetString(attr, 0, 
NULL) );
+                  hplip_strlcpy(t_printer->location, ippGetString(attr, 0, 
NULL), sizeof(t_printer->location) );
              }
              else if ( strcmp(attr_name, "printer-make-and-model") == 0 &&
                                                   val_tag == IPP_TAG_TEXT ) {
-                  
snprintf(t_printer->make_model,sizeof(t_printer->make_model),ippGetString(attr, 
0, NULL) );
+                  hplip_strlcpy(t_printer->make_model, ippGetString(attr, 0, 
NULL), sizeof(t_printer->make_model));
              } 
              else if ( strcmp(attr_name, "printer-state") == 0 &&
                                              val_tag == IPP_TAG_ENUM ) {

Reply via email to