public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] Nt32Pkg/WinNtSimpleFileSystemDxe: Fix ASSERT() parsing '\'
@ 2017-01-07 19:19 Michael Kinney
  2017-01-09 15:42 ` Carsey, Jaben
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Kinney @ 2017-01-07 19:19 UTC (permalink / raw)
  To: edk2-devel; +Cc: Ruiyu Ni, Jaben Carsey, Michael D Kinney

https://bugzilla.tianocore.org/show_bug.cgi?id=331

If Nt32 is built using UEFI Shell from the ShellPkg sources,
an ASSERT() is generated when a single '\' character is
entered at the shell prompt.

The WinNtSimpleFileSystemDxe module GetNextFileNameToken()
function breaks a file path up into tokens, but it does not
handle the case where a FileName ends in a '\' character.
It returns an empty string instead of NULL.  The fix is
to set *FileName to NULL if the remaining file path is an
empty string.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.c b/Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.c
index 6cff2df..5bb5832 100644
--- a/Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.c
+++ b/Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.c
@@ -748,6 +748,12 @@ GetNextFileNameToken (
     // Point *FileName to the next character after L'\'.
     //
     *FileName = *FileName + Offset + 1;
+    //
+    // If *FileName is an empty string, then set *FileName to NULL
+    //
+    if (**FileName == L'\0') {
+      *FileName = NULL;
+    }
   }
 
   return Token;
-- 
2.6.3.windows.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-01-10  1:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-07 19:19 [Patch] Nt32Pkg/WinNtSimpleFileSystemDxe: Fix ASSERT() parsing '\' Michael Kinney
2017-01-09 15:42 ` Carsey, Jaben
2017-01-10  1:55   ` Ni, Ruiyu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox