openhpi2 / Open-HPI

Open HPI is an open source implementation of the SA Forum's Hardware Platform Interface (HPI). HPI provides an abstracted interface to managing computer hardware, typically for chassis and rack based servers
Other
3 stars 1 forks source link

undefined behavior in snmp_bc_utils.c #2546

Closed openhpi2 closed 8 years ago

openhpi2 commented 10 years ago

our compiler checks found a very weird code in snmp_bc.c my patch for this is:

Index: plugins/snmp_bc/snmp_bc_utils.c
===================================================================
--- plugins/snmp_bc/snmp_bc_utils.c.orig        2007-10-04 00:40:10.000000000 +0200
+++ plugins/snmp_bc/snmp_bc_utils.c     2014-07-21 17:36:43.971386421 +0200
@@ -314,7 +314,6 @@ SaErrorT snmp_bc_set_resource_add_oh_eve
        if (e->resource.ResourceCapabilities & SAHPI_CAPABILITY_FRU) {
                e->event.EventType = SAHPI_ET_HOTSWAP;
                e->event.EventDataUnion.HotSwapEvent.HotSwapState = 
-                       e->event.EventDataUnion.HotSwapEvent.HotSwapState = 
                                                res_info_ptr->cur_state;

        } else {
```~~

Reported by: darix
openhpi2 commented 10 years ago

Original comment by: dr_mohan

openhpi2 commented 10 years ago

Fixed in checkin #7584

Original comment by: dr_mohan

openhpi2 commented 9 years ago

Original comment by: dr_mohan