The copyString32to8counted() routine reads a possible next 32-bit character from its input buffer before checking the count of characters. When called with a non-NUL-terminated string, this character may be uninitialized, triggering tools such as Valgrind to report a problem.
The count is then checked and the character is ignored if the count indicates that the character is not part of the string to be read, so this is harmless except in edge cases (at page boundaries with the following page an unmapped virtual address).
The code should should check the count first.