Re: Undefined behavior in utf8_decode()

Roberto Ierusalimschy <[email protected]>
Newsgroups gmane.comp.lang.lua.general
Message-ID <[email protected]>
> there is an issue with undefined behavior in lutf8lib.c because shift 
> exponent may be too large for 32-bit type 'l_uint32':
> 
> lutf8lib.c:67:34: runtime error: shift exponent 35 is too large for 32-bit 
> type 'l_uint32' (aka 'unsigned int')
>     #0 0x56308fd6face in utf8_decode 
> [...]
> 
> Steps to reproduce:
> 
> make MYCFLAGS=-fsanitize=undefined MYLDFLAGS=-fsanitize=undefined
> echo "dXRmOC5sZW4n2b0B/4+Pj4+Pj48AACc=" | base64 --decode | ./lua -

Many thanks for the feedback.

-- 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/20260217180720.GC188102%40arraial.inf.puc-rio.br.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.