]> git.proxmox.com Git - mirror_edk2.git/commit - ShellPkg/Application/Shell/FileHandleWrappers.c
ShellPkg: Add FileSize member to shell memory file structure.
authorJim_Dailey@Dell.com <Jim_Dailey@Dell.com>
Thu, 18 Feb 2016 14:40:46 +0000 (22:40 +0800)
committerLiming Gao <liming.gao@intel.com>
Thu, 3 Mar 2016 04:45:18 +0000 (12:45 +0800)
commit7bcd3ff611821e9f3f05207ebf157e30d030795b
treed6534eb64128728fe0dddde941169c23411ba293
parentb9da8fe0e3a1353af0f5d698f449210908bab491
ShellPkg: Add FileSize member to shell memory file structure.

The shell uses the memory file structure to manage temporary files in
memory that support piping of output from one command into the the
input of another command.  The BufferSize member is the size of the
internal buffer, not the size of the data that was written to the
file. So, it was possible to read beyond the EOF of these files as
reads used BufferSize. Now FileSize tracks the actual size of these
files (the number of bytes written, not the number of bytes available
in the buffer), and the reads use this member.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jim Dailey <jim_dailey@dell.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
ShellPkg/Application/Shell/FileHandleWrappers.c