summaryrefslogtreecommitdiff
path: root/ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c
AgeCommit message (Collapse)Author
2015-04-07ShellPkg: UefiShellDebug1CommandsLib: fix hex string parsing in SETVARLaszlo Ersek
The ShellCommandRunSetVar() function calls the ShellIsHexOrDecimalNumber() UefiShellLib function to determine if the data string in the SETVAR command is a string of hexadecimal bytes. However, ShellIsHexOrDecimalNumber() calls ShellConvertStringToUint64() for validation. Therefore SETVAR rejects hex strings that cannot be interpreted as UINT64 values due to range errors, despite the fact that the hexadecimal data string of the SETVAR command is supposed to describe an arbitrary array of bytes, rather than UINT64 values. The internal library function InternalShellIsHexOrDecimalNumber() comes close, as the first idea for the fix, however it is not quite right either; it removes a leading minus sign, plus it allows 0x / 0X prefixes. This would not be correct for the SETVAR command. Instead, add a trivial utility function that is specific to the SETVAR implementation. IsStringOfHexNibbles() accepts empty strings for simplicity, but where we call it we have already ensured that the data string is not empty (because that is handled earlier by the "delete variable" branch of SETVAR). An even number of nibbles is also enforced near the call site. Cc: Jaben Carsey <jaben.carsey@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17128 6f19259b-4bc3-4df7-8a09-765794883524
2015-02-04ShellPkg: Standardized HP Copyright Message StringTapan Shah
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Tapan Shah <tapandshah@hp.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16759 6f19259b-4bc3-4df7-8a09-765794883524
2015-02-03ShellPkg: Update Debug1 profile commands response outputTapan Shah
Updates to Debug1 profile commands response output. Updating Debug1 profile commands source code to include command name as a prefix in error message. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Tapan Shah <tapandshah@hp.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16729 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-02ShellPkg: Update SetVar to use existing attributes for updating existing ↵Jaben Carsey
variables. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com> Reviewed-by: Tapan Shah <tapandshah@hp.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16194 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-10ShellPkg: ShellCommands/SetVar: Make '-rt' imply '-bs'Brendan Jackman
It's invalid to set a variable that's available from runtime services but not from boot services. Currently if you pass '-rt' without '-bs' you get a generic 'Invalid Parameter' message. We should either print a more useful message in this case, or make '-rt' imply '-bs' (as this patch does). The Shell Spec is ambiguous on the matter. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Brendan Jackman <Brendan.Jackman@arm.com> Reviewed-By: Olivier Martin <olivier.martin@arm.com> Reviewed-By: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15323 6f19259b-4bc3-4df7-8a09-765794883524
2013-09-19ShellPkg: Handle pool allocation failureSergei Antonov
If AllocateZeroPool() returns NULL, GetVariable() will return EFI_BUFFER_TOO_SMALL, FreePool() will receive NULL. So check for NULL before FreePool(). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Sergei Antonov <saproj@gmail.com> Reviewed-by: Jaben Carsey <Jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14688 6f19259b-4bc3-4df7-8a09-765794883524
2013-07-26Update all the code to consume the ConvertDevicePathToText, ↵Ruiyu Ni
ConvertDevicePathNodeToText, ConvertTextToDevicePath and ConvertTextToDeviceNode APIs in DevicePathLib. Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Elvin Li <elvin.li@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14505 6f19259b-4bc3-4df7-8a09-765794883524
2011-04-04check memory allocations for success.jcarsey
check pointer before access. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11503 6f19259b-4bc3-4df7-8a09-765794883524
2011-03-30pointer verification (not NULL) and buffer overrun fixes.jcarsey
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11459 6f19259b-4bc3-4df7-8a09-765794883524
2011-03-25comp - add comments and add input verification jcarsey
bcfg - updated for bugs. compress - rename for coding standards. add comments. dblk - add comments, input verification, and a header line dmem - add comments, add input verification, add system table info dmpstore - add comments eficompress - add comments and add input verification efidecompress - add comments and add input verification loadpcirom - add comments and more output messages memmap - add more output to exceed the spec. mm - move functions, add comments, add input verification. mode - add comment pci - add input verification. SerMode - add comments and add input verification setsize - add comments and add input verification setvar - add comments and add input verification smbiosview - add input verification. clarify error messages. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11438 6f19259b-4bc3-4df7-8a09-765794883524
2010-11-16Add "Debug1" profile (all but Edit and HexEdit commands)jcarsey
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11068 6f19259b-4bc3-4df7-8a09-765794883524