[applied] RHBZ1944102 - self comparing ABI of protobuf-3.14.0-2.el9 failed

Message ID 87tuitelhp.fsf@redhat.com
State New
Headers
Series [applied] RHBZ1944102 - self comparing ABI of protobuf-3.14.0-2.el9 failed |

Commit Message

Dodji Seketeli Sept. 9, 2021, 4:56 p.m. UTC
  Hello,

Reading size and alignment from abixml can lead to loss of precision
that surfaced when self comparing the protobuf package as described in
bug https://bugzilla.redhat.com/show_bug.cgi?id=1944102.

Fixed thus.

	* src/abg-reader.cc (read_size_and_alignment): Use atoll to read
	long long values, not atoi.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applied to master.
---
 src/abg-reader.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Patch

diff --git a/src/abg-reader.cc b/src/abg-reader.cc
index 2331815e..7ee95c70 100644
--- a/src/abg-reader.cc
+++ b/src/abg-reader.cc
@@ -2481,13 +2481,13 @@  read_size_and_alignment(xmlNodePtr node,
   bool got_something = false;
   if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "size-in-bits"))
     {
-      size_in_bits = atoi(CHAR_STR(s));
+      size_in_bits = atoll(CHAR_STR(s));
       got_something = true;
     }
 
   if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "alignment-in-bits"))
     {
-      align_in_bits = atoi(CHAR_STR(s));
+      align_in_bits = atoll(CHAR_STR(s));
       got_something = true;
     }
   return got_something;