corstone1000: fwu: Fix missing destination offset of parse_fmp_header

parse_fmp_header() overwrites the beginning of fmp_hdr on every FWU write.
Fix it by appending incoming partial header bytes.

Also:
 - use local variables to improve readability
 - add an overflow check for the incoming size before memcpy

Signed-off-by: Nicola Mazzucato <nicola.mazzucato@arm.com>
Change-Id: Iefcfe1c9c2479ea4346a56ecb0475483a56ee695
1 file changed