Tracker: Bugs

5 wrong usage of memcmp in oh_compare_sensorreading - ID: 2737502
Last Update: Settings changed ( shuah )

oh_compare_sensorreading() should return +1/0/-1 depending whether first parameter is greater than, equal to or less than the second parameter. In case of SAHPI_SENSOR_READING_TYPE_BUFFER the memcmp() function is used. The standard for memcmp() says that the result is "an integer less than, equal to, or greater than zero" and it really can take other values than +1/0/-1, an example is the System z from IBM (s390/s390x) that can do the memcmp operation using one machine code instruction.

related glibc "bug" - https://bugzilla.redhat.com/show_bug.cgi?id=494317


Dan Horak ( horakdan ) - 2009-04-06 06:37:06 PDT

5

Closed

Fixed

Shuah Khan

OpenHPI base library

2.14.0

Public


Comment ( 1 )

Date: 2009-04-06 11:58:01 PDT
Sender: shuahProject Admin

Applied patches attched to the defect.
Fixed in trunk revision 6995
Fixed in 2.14.x revision 6996


Attached File ( 1 )

Filename Description Download
0001-fix-wrong-usage-memcmp.patch fix wrong memcmp usage Download

Changes ( 6 )

Field Old Value Date By
status_id Open 2009-04-06 11:58:02 PDT shuah
resolution_id None 2009-04-06 11:58:02 PDT shuah
assigned_to nobody 2009-04-06 11:58:02 PDT shuah
allow_comments 1 2009-04-06 11:58:02 PDT shuah
close_date - 2009-04-06 11:58:02 PDT shuah
File Added 321500: 0001-fix-wrong-usage-memcmp.patch 2009-04-06 06:37:06 PDT horakdan