Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package protobuf-c for openSUSE:Factory 
checked in at 2022-07-07 12:56:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/protobuf-c (Old)
 and      /work/SRC/openSUSE:Factory/.protobuf-c.new.1523 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "protobuf-c"

Thu Jul  7 12:56:05 2022 rev:20 rq:986912 version:1.4.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/protobuf-c/protobuf-c.changes    2021-11-27 
00:50:58.086875870 +0100
+++ /work/SRC/openSUSE:Factory/.protobuf-c.new.1523/protobuf-c.changes  
2022-07-07 12:56:07.519212602 +0200
@@ -1,0 +2,9 @@
+Tue Jul  5 12:38:17 UTC 2022 - Adam Majer <adam.ma...@suse.de>
+
+- Do not build static libraries
+- Run unit tests
+- Explicit files and directories for includedir, so we can detect
+  what we actually install there
+- 508.patch: fixes invalid arithmetic shift (bsc#1200908, CVE-2022-33070)
+
+-------------------------------------------------------------------

New:
----
  508.patch

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

Other differences:
------------------
++++++ protobuf-c.spec ++++++
--- /var/tmp/diff_new_pack.JBhsrs/_old  2022-07-07 12:56:07.939213227 +0200
+++ /var/tmp/diff_new_pack.JBhsrs/_new  2022-07-07 12:56:07.943213233 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package protobuf-c
 #
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 # Copyright (c) 2011 Pascal Bleser
 #
 # All modifications and additions to the file contributed by third parties
@@ -26,6 +26,7 @@
 Group:          Development/Tools/Other
 URL:            https://github.com/protobuf-c/protobuf-c
 Source:         
https://github.com/protobuf-c/protobuf-c/releases/download/v%version/%name-%version.tar.gz
+Patch1:         508.patch
 BuildRequires:  autoconf
 BuildRequires:  automake
 BuildRequires:  gcc
@@ -54,7 +55,7 @@
 Group:          Development/Libraries/C and C++
 Requires:       libprotobuf-c%sover = %version
 Provides:       %name = %version
-Obsoletes:      %name <= %version
+Obsoletes:      %name <= 1.4.0
 
 %description -n libprotobuf-c-devel
 This package provides a code generator and runtime libraries to use Protocol
@@ -64,14 +65,20 @@
 %autosetup -p1
 
 %build
+%{!?make_build:%define make_build make -O %{?_smp_mflags} V=1 VERBOSE=1}
 %define _lto_cflags %nil
 autoreconf -fvi
-%configure
+%configure \
+    --enable-static=no
+
 %make_build
 
 %install
 %make_install
-rm "%buildroot/%_libdir"/*.a "%buildroot/%_libdir"/*.la
+rm %buildroot/%_libdir/*.la
+
+%check
+make check
 
 %post   -n libprotobuf-c%sover -p /sbin/ldconfig
 %postun -n libprotobuf-c%sover -p /sbin/ldconfig
@@ -83,9 +90,13 @@
 
 %files -n libprotobuf-c-devel
 %doc ChangeLog TODO
+%dir %_includedir/protobuf-c
+%dir %_includedir/google
+%dir %_includedir/google/protobuf-c
+%_includedir/protobuf-c/*
+%_includedir/google/protobuf-c/protobuf-c.h
 %_bindir/protoc-c
 %_bindir/protoc-gen-c
-%_includedir/*/
 %_libdir/libprotobuf-c.so
 %_libdir/pkgconfig/libprotobuf-c.pc
 

++++++ 508.patch ++++++
>From 6e389ce2c34355d36009a8fb1666bed29fa2d4f4 Mon Sep 17 00:00:00 2001
From: "Todd C. Miller" <todd.mil...@sudo.ws>
Date: Mon, 6 Jun 2022 13:57:38 -0600
Subject: [PATCH] Only shift unsigned values to avoid implementation-specific
 behavior. This converts the arithmetic shifts to logical shifts. It is based
 in part on a stackoverflow answer by John Schultz,
 
https://stackoverflow.com/questions/4533076/google-protocol-buffers-zigzag-encoding

---
 protobuf-c/protobuf-c.c | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/protobuf-c/protobuf-c.c b/protobuf-c/protobuf-c.c
index ad1bdb1..98052cd 100644
--- a/protobuf-c/protobuf-c.c
+++ b/protobuf-c/protobuf-c.c
@@ -316,9 +316,8 @@ int32_size(int32_t v)
 static inline uint32_t
 zigzag32(int32_t v)
 {
-       // Note:  the right-shift must be arithmetic
-       // Note:  left shift must be unsigned because of overflow
-       return ((uint32_t)(v) << 1) ^ (uint32_t)(v >> 31);
+       // Note:  Using unsigned types prevents undefined behavior
+       return ((uint32_t)v << 1) ^ -((uint32_t)v >> 31);
 }
 
 /**
@@ -380,9 +379,8 @@ uint64_size(uint64_t v)
 static inline uint64_t
 zigzag64(int64_t v)
 {
-       // Note:  the right-shift must be arithmetic
-       // Note:  left shift must be unsigned because of overflow
-       return ((uint64_t)(v) << 1) ^ (uint64_t)(v >> 63);
+       // Note:  Using unsigned types prevents undefined behavior
+       return ((uint64_t)v << 1) ^ -((uint64_t)v >> 63);
 }
 
 /**
@@ -802,7 +800,8 @@ uint32_pack(uint32_t value, uint8_t *out)
 }
 
 /**
- * Pack a signed 32-bit integer and return the number of bytes written.
+ * Pack a signed 32-bit integer and return the number of bytes written,
+ * passed as unsigned to avoid implementation-specific behavior.
  * Negative numbers are encoded as two's complement 64-bit integers.
  *
  * \param value
@@ -813,14 +812,14 @@ uint32_pack(uint32_t value, uint8_t *out)
  *      Number of bytes written to `out`.
  */
 static inline size_t
-int32_pack(int32_t value, uint8_t *out)
+int32_pack(uint32_t value, uint8_t *out)
 {
-       if (value < 0) {
+       if ((int32_t)value < 0) {
                out[0] = value | 0x80;
                out[1] = (value >> 7) | 0x80;
                out[2] = (value >> 14) | 0x80;
                out[3] = (value >> 21) | 0x80;
-               out[4] = (value >> 28) | 0x80;
+               out[4] = (value >> 28) | 0xf0;
                out[5] = out[6] = out[7] = out[8] = 0xff;
                out[9] = 0x01;
                return 10;
@@ -2425,7 +2424,7 @@ static inline int32_t
 unzigzag32(uint32_t v)
 {
        // Note:  Using unsigned types prevents undefined behavior
-       return (int32_t)((v >> 1) ^ (~(v & 1) + 1));
+       return (int32_t)((v >> 1) ^ -(v & 1));
 }
 
 static inline uint32_t
@@ -2467,7 +2466,7 @@ static inline int64_t
 unzigzag64(uint64_t v)
 {
        // Note:  Using unsigned types prevents undefined behavior
-       return (int64_t)((v >> 1) ^ (~(v & 1) + 1));
+       return (int64_t)((v >> 1) ^ -(v & 1));
 }
 
 static inline uint64_t

Reply via email to