Add fixes based on test fuzzing.
diff --git a/common-utils.c b/common-utils.c
new file mode 100644
index 0000000..9b0780b
--- /dev/null
+++ b/common-utils.c
@@ -0,0 +1,28 @@
+/**
+ * Describes common utility functions shared between CPER projects within this repository.
+ * No functions here depend on json-c or b64.c.
+ * 
+ * Author: Lawrence.Tang@arm.com
+ **/
+
+#include "edk/BaseTypes.h"
+#include "common-utils.h"
+
+//Converts the given BCD byte to a standard integer.
+int bcd_to_int(UINT8 bcd)
+{
+    return ((bcd & 0xF0) >> 4) * 10 + (bcd & 0x0F);
+}
+
+//Converts the given integer to a single byte BCD.
+UINT8 int_to_bcd(int value)
+{
+    UINT8 result = 0;
+    int shift = 0;
+    while (value > 0) {
+        result |= (value % 10) << (shift++ << 2);
+        value /= 10;
+    }
+
+    return result;
+}
\ No newline at end of file