Re: luaO_pushvfstring reads past end of format string on trailing %
Roberto Ierusalimschy <[email protected]>
| Newsgroups | gmane.comp.lang.lua.general |
|---|---|
| Message-ID | <[email protected]> |
> Thanks, but I was not referring to that. I meant, since "%#", as "%$"
> and all other invalid sequences just "keep unknown format in the
> result", do the same for "%\0". Null inserting is not common enough
> for the ( perceived by my ) target of this function to even suggest
> "%0" for it, the %c combo is fine.
The manual says this:
Every occurrence of % in the string fmt must form a valid conversion
specifier.
So, this 'just "keep unknown format in the result"' is undocumented
behavior. As you said, in C there are endless ways to shoot your own
foot, for instance by calling 'lua_pushfstring(L, "%s", 42l)'.
A '%' in the end of the format string is just one more way.
-- Roberto
--
You received this message because you are subscribed to the Google Groups "lua-l" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/lua-l/20260812144813.GC27407%40arraial.inf.puc-rio.br.