StringLiteral->getBytes().bytes() looses leading \x00 (if non null character is in the string)

Unfortunately I dont know a good way to provide a minimal working example so I describe my problem.

If I run a clang::ast_matchers::MatchFinder::MatchCallback on StringLiterals the matching StringLiteral somehow looses leading \x00 but only if there are non-null chars within that string.

E.g.:

“\x00\x00\x00” will be correctly iterated with 3 times null (the getByteLength() also correctly gives the length of 3)

“\x001\x00” will iterated as “1\x00” (also the getByteLength is 2)

How can I iterate over the leading \x00 as well?