rpms/libsmbios/devel 0001-fix-pointer-aliasing-issue-in-c-id-byte-code.patch, NONE, 1.1 libsmbios.spec, 1.22, 1.23

Michael E Brown mebrown at fedoraproject.org
Tue Mar 24 07:12:52 UTC 2009


Author: mebrown

Update of /cvs/extras/rpms/libsmbios/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv764

Modified Files:
	libsmbios.spec 
Added Files:
	0001-fix-pointer-aliasing-issue-in-c-id-byte-code.patch 
Log Message:
* Mon Mar 24 2009 Michael E Brown <michael_e_brown at dell.com> - 2.2.16-3
- add gcc 4.4 support
- fix pointer aliasing issue


0001-fix-pointer-aliasing-issue-in-c-id-byte-code.patch:

--- NEW FILE 0001-fix-pointer-aliasing-issue-in-c-id-byte-code.patch ---
>From b3b25e94ffaa2136f66938884557eb3103ea90ef Mon Sep 17 00:00:00 2001
From: Michael E Brown <mebrown at michaels-house.net>
Date: Tue, 24 Mar 2009 02:10:34 -0500
Subject: [PATCH] fix pointer aliasing issue in c++ id byte code.

---
 src/libsmbios_c++/systeminfo/IdByte.cpp |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/libsmbios_c++/systeminfo/IdByte.cpp b/src/libsmbios_c++/systeminfo/IdByte.cpp
index 28f5cbc..5f42336 100644
--- a/src/libsmbios_c++/systeminfo/IdByte.cpp
+++ b/src/libsmbios_c++/systeminfo/IdByte.cpp
@@ -53,9 +53,6 @@ static u16 getIdByteFromMem ()
     memory::IMemory *mem = 0;
 
     struct two_byte_structure tbs;
-    struct two_byte_structure *ptbs = &tbs;
-    struct one_byte_structure *pobs =
-                    reinterpret_cast<one_byte_structure*>(&(tbs.bios_version));
 
     mem = memory::MemoryFactory::getFactory()->getSingleton();
 
@@ -69,13 +66,13 @@ static u16 getIdByteFromMem ()
         goto out;
 
     // Step 2: fill the id structs
-    mem->fillBuffer( reinterpret_cast<u8 *>(ptbs), TWO_BYTE_STRUCT_LOC, sizeof(two_byte_structure) );
+    mem->fillBuffer( reinterpret_cast<u8 *>(&tbs), TWO_BYTE_STRUCT_LOC, sizeof(two_byte_structure) );
 
     // Step 3: check the checksum of one-byte struct
     //    update: checksum is not reliable, so don't use it...
 
     // Step 4: Check one byte ID
-    tempWord = pobs->system_id;
+    tempWord = tbs.system_id;
 
     // Step 5: if 0xFE, then it is a double byte (word) ID.
     // *  -- byte at 0xFE845 is 0xFE
@@ -86,7 +83,7 @@ static u16 getIdByteFromMem ()
         //*  -- extension checksum is 0
 
         // Step 7: get ID.
-        tempWord = ptbs->two_byte_id;
+        tempWord = tbs.two_byte_id;
     }
 
     idWord = tempWord;
-- 
1.6.0.6



Index: libsmbios.spec
===================================================================
RCS file: /cvs/extras/rpms/libsmbios/devel/libsmbios.spec,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- libsmbios.spec	24 Mar 2009 06:54:42 -0000	1.22
+++ libsmbios.spec	24 Mar 2009 07:12:21 -0000	1.23
@@ -88,12 +88,13 @@
 
 Name: %{release_name}
 Version: %{release_version}
-Release: 2%{?dist}
+Release: 3%{?dist}
 License: GPLv2+ or OSL 2.1
 Summary: Libsmbios C/C++ shared libraries
 Group: System Environment/Libraries
 Source: http://linux.dell.com/libsmbios/download/libsmbios/libsmbios-%{version}/libsmbios-%{version}.tar.bz2
 Patch0: 0003-upgrade-known-version-of-gcc-to-4.5.patch
+Patch1: 0001-fix-pointer-aliasing-issue-in-c-id-byte-code.patch
 URL: http://linux.dell.com/libsmbios/main
 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: strace libxml2-devel gcc-c++ gettext doxygen %{valgrind_BR} %{cppunit_BR} %{fdupes_BR} %{pkgconfig_BR} %{python_devel_BR}
@@ -182,6 +183,7 @@
 %prep
 %setup -q -n libsmbios-%{version}
 %patch0 -p1
+%patch1 -p1
 find . -type d -exec chmod -f 755 {} \;
 find doc src -type f -exec chmod -f 644 {} \;
 chmod 755 src/cppunit/*.sh
@@ -365,8 +367,9 @@
 %endif
 
 %changelog
-* Mon Mar 24 2009 Michael E Brown <michael_e_brown at dell.com> - 2.2.16-1
+* Mon Mar 24 2009 Michael E Brown <michael_e_brown at dell.com> - 2.2.16-3
 - add gcc 4.4 support
+- fix pointer aliasing issue
 
 * Mon Mar 24 2009 Michael E Brown <michael_e_brown at dell.com> - 2.2.15-2
 - update to lastest upstream.




More information about the fedora-extras-commits mailing list