blob: 077e26cbff56f48da8249ea4bc0fe7433b844852 [file] [log] [blame]
Brad Bishop6e60e8b2018-02-01 10:27:11 -05001Fix alignment issue in ipmi_inventory.c
2
3Upstream-Status: Pending
4
5Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
6
7diff --git a/plugins/ipmi/ipmi_inventory.c b/plugins/ipmi/ipmi_inventory.c
8index 5382186..01655c6 100644
9--- a/plugins/ipmi/ipmi_inventory.c
10+++ b/plugins/ipmi/ipmi_inventory.c
11@@ -2546,8 +2546,11 @@ static SaErrorT modify_inventory(SaHpiIdrFieldT *field,
12 if (tb->DataLength == 0) {
13 rv = ipmi_fru_set_board_info_mfg_time(fru, 0);
14 } else {
15+ time_t the_time;
16+ /* tb->Data is not aligned -- copy to temp */
17+ memcpy(&the_time, tb->Data, sizeof(the_time));
18 rv = ipmi_fru_set_board_info_mfg_time(fru,
19- *(time_t *)tb->Data);
20+ the_time);
21 }
22 break;
23 case SAHPI_IDR_FIELDTYPE_MANUFACTURER: