Fix IA32x64 pointer corruption, invalid generation on ARM.
diff --git a/sections/cper-section-arm.c b/sections/cper-section-arm.c
index c52da3e..73e63ed 100644
--- a/sections/cper-section-arm.c
+++ b/sections/cper-section-arm.c
@@ -61,7 +61,7 @@
 
     //Whether the processor is running, and the state of it if so.
     json_object_object_add(section_ir, "running", json_object_new_boolean(record->RunningState & 0b1));
-    if (record->RunningState >> 31)
+    if (!(record->RunningState >> 31))
     {
         //Bit 32 of running state is on, so PSCI state information is included.
         //This can't be made human readable, as it is unknown whether this will be the pre-PSCI 1.0 format
@@ -360,6 +360,7 @@
 void ir_section_arm_to_cper(json_object* section, FILE* out)
 {
     EFI_ARM_ERROR_RECORD* section_cper = (EFI_ARM_ERROR_RECORD*)calloc(1, sizeof(EFI_ARM_ERROR_RECORD));
+    long starting_stream_pos = ftell(out);
 
     //Validation bits.
     section_cper->ValidFields = ir_to_bitfield(json_object_object_get(section, "validationBits"), 
@@ -399,9 +400,13 @@
     json_object* vendor_specific_info = json_object_object_get(section, "vendorSpecificInfo");
     if (vendor_specific_info != NULL)
     {
-        int vendor_specific_len = json_object_get_string_len(vendor_specific_info);
-        UINT8* decoded = b64_decode(json_object_get_string(vendor_specific_info), vendor_specific_len);
-        fwrite(decoded, vendor_specific_len / 4 * 3, 1, out); //b64 length to byte length
+        json_object* vendor_info_string = json_object_object_get(vendor_specific_info, "data");
+        int vendor_specific_len = json_object_get_string_len(vendor_info_string);
+        UINT8* decoded = b64_decode(json_object_get_string(vendor_info_string), vendor_specific_len);
+
+        //Write out to file.
+        long cur_stream_pos = ftell(out);
+        fwrite(decoded, starting_stream_pos + section_cper->SectionLength - cur_stream_pos, 1, out);
         fflush(out);
         free(decoded);
     }
diff --git a/sections/cper-section-dmar-generic.h b/sections/cper-section-dmar-generic.h
index 14b65a9..634339a 100644
--- a/sections/cper-section-dmar-generic.h
+++ b/sections/cper-section-dmar-generic.h
@@ -10,7 +10,8 @@
     "Invalid Device Request", "ATT Access Error", "ATT Reserved Bit Invalid", "Illegal Command", "Command Buffer Access Error"}
 #define DMAR_GENERIC_ERROR_FAULT_REASON_TYPES_DESCRIPTIONS (const char*[]){ \
     "Domain mapping table entry is not present.", \
-    "DMAr unit's attempt to access the domain mapping table resulted in an error." \
+    "Invalid domain mapping table entry.", \
+    "DMAr unit's attempt to access the domain mapping table resulted in an error.", \
     "Reserved bit set to non-zero value in the domain mapping table.", \
     "DMA request to access an address beyond the device address width.", \
     "Invalid read or write access.", \
diff --git a/sections/cper-section-ia32x64.c b/sections/cper-section-ia32x64.c
index 9e79888..5102a33 100644
--- a/sections/cper-section-ia32x64.c
+++ b/sections/cper-section-ia32x64.c
@@ -72,10 +72,12 @@
 
     //Processor context information, of the amount described above.
     EFI_IA32_X64_PROCESSOR_CONTEXT_INFO* current_context_info = (EFI_IA32_X64_PROCESSOR_CONTEXT_INFO*)current_error_info;
+    void* cur_pos = (void*)current_context_info;
     json_object* context_info_array = json_object_new_array();
     for (int i=0; i<processor_context_info_num; i++) 
     {
-        json_object_array_add(context_info_array, cper_ia32x64_processor_context_info_to_ir(current_context_info, (void**)&current_context_info));
+        json_object_array_add(context_info_array, cper_ia32x64_processor_context_info_to_ir(current_context_info, &cur_pos));
+        current_context_info = (EFI_IA32_X64_PROCESSOR_CONTEXT_INFO*)cur_pos;
         //The context array is a non-fixed size, pointer is shifted within the above function.
     }
     json_object_object_add(record_ir, "processorContextInfo", context_info_array);