https://bugzilla.tianocore.org/show_bug.cgi?id=255
Check CurrentFilePointer to make sure it not exceed the end of file.
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
// Increment the current file pointer (include the 0x0A)\r
//\r
InputFile->CurrentFilePointer += CharsToCopy + 1;\r
+ if (InputFile->CurrentFilePointer > InputFile->Eof) {\r
+ InputFile->CurrentFilePointer = InputFile->Eof;\r
+ }\r
CheckMemoryFileState (InputMemoryFile);\r
\r
//\r