platform: msm_shared: added checks for integer overflow
platform: msm_shared: added checks for integer overflow

checks to verify the fdt header structure values parsed
from the appended device tree in the bootimage. And also added
checks for the integer overflow.

CRs-Fixed: 684766
Change-Id: I73285ea3ef111cf5bd474e218694586c9d2130a8

CanarySolutions/little-kernel,efidroid/lk,Foxda-Tech/polaris-bootable-bootloader-lk,Foxda-Tech/polaris-bootable-bootloader-lk,Foxda-Tech/polaris-bootable-bootloader-lk,efidroid/lk,Foxda-Tech/polaris-bootable-bootloader-lk,CanarySolutions/little-kernel,efidroid/lk,efidroid/lk,Foxda-Tech/polaris-bootable-bootloader-lk,CanarySolutions/little-kernel,CanarySolutions/little-kernel,CanarySolutions/little-kernel,efidroid/lk