diff options
author | Tom Joseph <tomjoseph@in.ibm.com> | 2017-02-28 19:56:33 +0530 |
---|---|---|
committer | Tom Joseph <tomjoseph@in.ibm.com> | 2017-02-28 19:58:26 +0530 |
commit | b9ac6a425beec03d2b65085cec6b5e6d5272b241 (patch) | |
tree | cd344024bafcc75d6cab0696298c861127f45500 /storageaddsel.cpp | |
parent | d33a4afaf58baaa985017864f2cf6a7fd767690d (diff) | |
download | phosphor-host-ipmid-b9ac6a425beec03d2b65085cec6b5e6d5272b241.tar.gz phosphor-host-ipmid-b9ac6a425beec03d2b65085cec6b5e6d5272b241.zip |
Add null termination for eSEL data
Change-Id: If55367f35cfcf35f0dff8da2d1e15865b702a5b2
Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
Diffstat (limited to 'storageaddsel.cpp')
-rw-r--r-- | storageaddsel.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/storageaddsel.cpp b/storageaddsel.cpp index dea892c..3bcbce3 100644 --- a/storageaddsel.cpp +++ b/storageaddsel.cpp @@ -182,12 +182,14 @@ int send_esel_to_dbus(const char *desc, const char *sev, const char *details, ui // Allocate enough space to represent the data in hex separated by spaces, // to mimic how IPMI would display the data. - unique_ptr<char[]> selData(new char[debuglen*3]()); + unique_ptr<char[]> selData(new char[(debuglen*3) + 1]()); uint32_t i = 0; for(i = 0; i < debuglen; i++) { sprintf(&selData[i*3], "%02x ", 0xFF & ((char*)debug)[i]); } + selData[debuglen*3] = '\0'; + log<level::INFO>("Received Host Event", entry("ESEL=%s", selData.get())); try |