From: Alexandre Julliard Subject: Re: [PATCH 2/2] server: Strip terminating '\0' from the registry key name. (Resend) Message-Id: <877daoyrgf.fsf@wine> Date: Tue, 25 Jan 2022 12:39:44 +0100 In-Reply-To: <20220125141124.1284073c7ca000048266a0d7@baikal.ru> (Dmitry Timoshkov's message of "Tue, 25 Jan 2022 14:11:24 +0300") References: <20220125115646.e681d67765dfa016f203e9e3@baikal.ru> <87czkgytwo.fsf@wine> <20220125141124.1284073c7ca000048266a0d7@baikal.ru> Dmitry Timoshkov writes: > Alexandre Julliard wrote: > >> > @@ -477,6 +477,8 @@ static inline void get_req_path( struct unicode_str *str ) >> > { >> > str->str = get_req_data(); >> > str->len = (get_req_data_size() / sizeof(WCHAR)) * sizeof(WCHAR); >> > + >> > + while (str->len && !str->str[str->len / sizeof(WCHAR) - 1]) str->len -= sizeof(WCHAR); >> >> I don't see a test that would justify that while() loop. You should also >> test embedded nulls. > > Is that acceptable to test embedded nulls in a separate patch? I'm not sure I see why, you need the test to know how to implement it. -- Alexandre Julliard julliard@winehq.org