From 20ae64596401b481c79d66731bd3322ecfa71bb5 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Fri, 11 Sep 2020 01:36:52 -0700 Subject: ncp: add a comment about possibly null-truncated strings. In File Search Continue requests, the path is a single byte giving the string length, followed by that many bytes containing the string value. However, in at least some File Search Continue requests, the string length value is longer than the string, and there's a NUL, followed by other non-zero cruft, in the string. --- tools/ncp2222.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/ncp2222.py b/tools/ncp2222.py index 7acddac4ef..898375dbbf 100755 --- a/tools/ncp2222.py +++ b/tools/ncp2222.py @@ -3351,6 +3351,13 @@ PathCookieFlags = val_string16("path_cookie_flags", "Path Cookie [ 0x0001, "Last component is a File Name" ], ]) PathCount = uint8("path_count", "Path Count") +# +# XXX - in at least some File Search Continue requests, the string +# length value is longer than the string, and there's a NUL, followed +# by other non-zero cruft, in the string. Should this be an +# "nstringz8", with FT_UINT_STRINGZPAD added to support it? And +# does that apply to any other values? +# Path = nstring8("path", "Path") Path16 = nstring16("path16", "Path") PathAndName = stringz("path_and_name", "Path and Name") -- cgit v1.2.3