More range checks

This is a second patch adding more range checks where appropriate.

Change-Id: Ie169efe8924153c9cc11e4472a1b07b8d04efb3b
Signed-off-by: Ed Tanous <ed@tanous.net>
diff --git a/sections/cper-section-generic.c b/sections/cper-section-generic.c
index ec70b85..0937de4 100644
--- a/sections/cper-section-generic.c
+++ b/sections/cper-section-generic.c
@@ -94,9 +94,9 @@
 
 	if (isvalid_prop_to_ir(&ui64Type, 7)) {
 		//CPU brand string. May not exist if on ARM.
-		json_object_object_add(
-			section_ir, "cpuBrandString",
-			json_object_new_string(section_generic->BrandString));
+		add_untrusted_string(section_ir, "cpuBrandString",
+				     section_generic->BrandString,
+				     sizeof(section_generic->BrandString));
 	}
 
 	if (isvalid_prop_to_ir(&ui64Type, 8)) {