Code refine. Check the original length of array to avoid buffer over flow.
Code refine. Check the original length of array to avoid buffer over flow.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>


git-svn-id: 3158a46dfd52e07d1fda3e32e1ab2e353a00b20f@16539 6f19259b-4bc3-4df7-8a09-765794883524

MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2