Fix crash issue due to non-print char

When smbios table file is broken, the parsed string
type propery like version may contain non-print char,
which causes smbios service crash as below:

Nov 18 17:11:53 intel-obmc dbus-broker[180]: Peer :1.175 is being disconnected as it sent a message with an invalid body.
Nov 18 17:11:53 intel-obmc phosphor-mapper[298]: Introspect call failed with error: generic:113, No route to host on process: xyz.openbmc_project.Smbios.MDR_V2 path: /
Nov 18 17:11:53 intel-obmc smbiosmdrv2app[644]: terminate called after throwing an instance of 'sdbusplus::exception::SdBusError'
Nov 18 17:11:53 intel-obmc smbiosmdrv2app[644]:   what():  sd_bus_process discard: org.freedesktop.DBus.Error.Disconnected: Connection reset by peer
Nov 18 17:11:53 intel-obmc systemd[1]: Created slice system-systemd\x2dcoredump.slice.
Nov 18 17:11:54 intel-obmc systemd[1]: Started Process Core Dump (PID 645/UID 0).
Nov 18 17:11:57 intel-obmc systemd[1]: smbios-mdrv2.service: Main process exited, code=dumped, status=6/ABRT
Nov 18 17:11:57 intel-obmc systemd[1]: smbios-mdrv2.service: Failed with result 'core-dump'.

Tested:
When version string contain non-print char that means
smbios table file is broken, smbios bios service will
print error and clear the broken.
The smbios table file will be re-generated again at the
next DC cycle.

Change-Id: I001c829b22fc3afba4e863d595f943d0954824e3
Signed-off-by: Kuiying Wang <kuiying.wang@intel.com>
1 file changed