PEL: Fix hexdump output in peltool

Hexdump output of UserData section has 8 extra bytes that are not part
of the section data. This fix truncates the extra data to show the true
hexdump output.

Signed-off-by: Harisuddin Mohamed Isa <harisuddin@gmail.com>
Change-Id: I7c0b46fb85b94265ae4f960eb4ef36eaf293db3b
diff --git a/extensions/openpower-pels/json_utils.cpp b/extensions/openpower-pels/json_utils.cpp
index dfb6698..d45b542 100644
--- a/extensions/openpower-pels/json_utils.cpp
+++ b/extensions/openpower-pels/json_utils.cpp
@@ -72,7 +72,7 @@
     const int symbolSize = 100;
     std::string jsonIndent(indentLevel * indentCount, 0x20);
     jsonIndent.append("\"");
-    char* buffer = (char*)calloc(10 * size, sizeof(char));
+    char* buffer = (char*)calloc(std::max(70, 10 * (int)size), sizeof(char));
     char* symbol = (char*)calloc(symbolSize, sizeof(char));
     char ascii[17];
     size_t i, j;