Hello community,

here is the log from the commit of package libcmpiutil for openSUSE:Factory 
checked in at 2014-02-25 07:32:42
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libcmpiutil (Old)
 and      /work/SRC/openSUSE:Factory/.libcmpiutil.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libcmpiutil"

Changes:
--------
--- /work/SRC/openSUSE:Factory/libcmpiutil/libcmpiutil.changes  2013-04-23 
11:32:26.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.libcmpiutil.new/libcmpiutil.changes     
2014-02-25 07:32:43.000000000 +0100
@@ -1,0 +2,6 @@
+Mon Feb 17 12:54:08 UTC 2014 - kkae...@suse.com
+
+- add upstream patch
+  0001-libcmpiutil-Fix-endianness-issues-in-embedded-object.patch
+
+-------------------------------------------------------------------

New:
----
  0001-libcmpiutil-Fix-endianness-issues-in-embedded-object.patch

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

Other differences:
------------------
++++++ libcmpiutil.spec ++++++
--- /var/tmp/diff_new_pack.akM9z3/_old  2014-02-25 07:32:43.000000000 +0100
+++ /var/tmp/diff_new_pack.akM9z3/_new  2014-02-25 07:32:43.000000000 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package libcmpiutil
 #
-# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -38,6 +38,7 @@
 Group:          Development/Libraries/C and C++
 Source:         %{name}-%{version}.tar.bz2
 Patch1:         fix-arm.patch
+Patch2:         0001-libcmpiutil-Fix-endianness-issues-in-embedded-object.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 
 %description
@@ -76,16 +77,12 @@
 standardizing method dispatch and argument checking.
 
 
-
-Authors:
---------
-    Dan Smith <da...@us.ibm.com>
-
 %prep
 %setup -q
 %ifarch %arm
 %patch1 -p1
 %endif
+%patch2 -p1
 chmod -x *.c *.y *.h *.l
 
 %build

++++++ 0001-libcmpiutil-Fix-endianness-issues-in-embedded-object.patch ++++++
>From 8c25b49b05065ce90c83b2102bd8462a7bb18d69 Mon Sep 17 00:00:00 2001
From: Thilo Boehm <tbo...@linux.vnet.ibm.com>
Date: Thu, 8 Aug 2013 15:27:53 +0200
Subject: [PATCH] libcmpiutil: Fix endianness issues in embedded object parsing

The auxiliary functions _set_int_prop/parse_int_property only
worked on little-endian archs as they performed an incorrect
reinterpretation of 64bit integers. Fixed by using the proper
CMPIValue union fields.

Signed-off-by: Thilo Boehm <tbo...@linux.vnet.ibm.com>
Signed-off-by: Viktor Mihajlovski <mihaj...@linux.vnet.ibm.com>
---
 eo_parser.c     | 35 ++++++++++++++++++++++-------------
 eo_parser_xml.c | 49 +++++++++++++++++++++++++++++++++++++++----------
 2 files changed, 61 insertions(+), 23 deletions(-)

diff --git a/eo_parser.c b/eo_parser.c
index 36106fddc99d..4c5b0ee229dd 100644
--- a/eo_parser.c
+++ b/eo_parser.c
@@ -113,31 +113,40 @@ static int _set_int_prop(CMPISint64 value,
                          CMPIInstance *inst)
 {
         CMPIStatus s;
-        uint64_t unsigned_val = 0;
-        int64_t signed_val = 0;
+        CMPIValue val;
 
-        switch(type) {
+        switch (type) {
         case CMPI_uint64:
+                val.uint64 = (uint64_t) value;
+                break;
         case CMPI_uint32:
+                val.uint32 = (uint32_t) value;
+                break;
         case CMPI_uint16:
+                val.uint16 = (uint16_t) value;
+                break;
         case CMPI_uint8:
-                unsigned_val = (uint64_t) value;
-                s = CMSetProperty(inst,
-                                  prop,
-                                  (CMPIValue *) &(unsigned_val),
-                                  type);
+                val.uint8 = (uint8_t) value;
                 break;
         case CMPI_sint64:
+                val.sint64 = (int64_t) value;
+                break;
         case CMPI_sint32:
+                val.sint32 = (int32_t) value;
+                break;
         case CMPI_sint16:
+                val.sint16 = (int16_t) value;
+                break;
         case CMPI_sint8:
+                val.sint8 = (int8_t) value;
+                break;
         default:
-                signed_val = (int64_t) value;
-                s = CMSetProperty(inst,
-                                  prop,
-                                  (CMPIValue *) &(signed_val),
-                                  type);
+                return 0;
         }
+        s = CMSetProperty(inst,
+                          prop,
+                          &val,
+                          type);
 
         if (s.rc == CMPI_RC_OK)
                return 1;
diff --git a/eo_parser_xml.c b/eo_parser_xml.c
index c8b28cc63289..551a87be8a8d 100644
--- a/eo_parser_xml.c
+++ b/eo_parser_xml.c
@@ -90,11 +90,48 @@ static CMPIType parse_int_property(const char *string,
         if (sign) {
                 int64_t _val;
                 ret = sscanf(string, "%" SCNi64, &_val);
-                val->sint64 = _val;
+                switch (size) {
+                case 8:
+                        t = CMPI_sint8;
+                        val->sint8 = (int8_t) _val;
+                        break;
+                case 16:
+                        t = CMPI_sint16;
+                        val->sint16 = (int16_t) _val;
+                        break;
+                case 32:
+                        t = CMPI_sint32;
+                        val->sint32 = (int32_t) _val;
+                        break;
+                default:
+                case 64:
+                        t = CMPI_sint64;
+                        val->sint64 = (int64_t) _val;
+                        break;
+                };
         } else {
                 uint64_t _val;
                 ret = sscanf(string, "%" SCNu64, &_val);
-                val->uint64 = _val;
+                switch (size) {
+                case 8:
+                        t = CMPI_uint8;
+                        val->uint8 = (uint8_t) _val;
+                        break;
+                case 16:
+                        t = CMPI_uint16;
+                        val->uint16 = (uint16_t) _val;
+                        break;
+                case 32:
+                        t = CMPI_uint32;
+                        val->uint32 = (uint32_t) _val;
+                        break;
+                default:
+                case 64:
+                        t = CMPI_uint64;
+                        val->uint64 = (uint64_t) _val;
+                        break;
+
+                };
         }
 
         if (ret != 1) {
@@ -102,14 +139,6 @@ static CMPIType parse_int_property(const char *string,
                 return CMPI_null;
         }
 
-        switch (size) {
-        case 8:  t = sign ? CMPI_sint8  : CMPI_uint8;  break;
-        case 16: t = sign ? CMPI_sint16 : CMPI_uint16; break;
-        case 32: t = sign ? CMPI_sint32 : CMPI_uint32; break;
-        default:
-        case 64: t = sign ? CMPI_sint64 : CMPI_uint64; break;
-        };
-
         return t;
 }
 
-- 
1.8.4.5

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to