bug-libunistring
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-libunistring] possible memory issue with u8_strconv_to_encoding


From: Patrice Dumas
Subject: Re: [bug-libunistring] possible memory issue with u8_strconv_to_encoding after u8_toupper
Date: Tue, 5 Sep 2023 17:35:40 +0200

On Tue, Sep 05, 2023 at 05:20:11PM +0200, Bruno Haible wrote:
> Patrice Dumas wrote:
> > Maybe finish by
> >     If you want to include a NUL terminator in the string you should
> >     include it explicitely, in general by setting the length to strlen_un + 
> > 1.
> 
> This would be too specific. And it is, btw, not the only way to solve
> the problem. Another one would have been to do the conversion like you
> did, but add a memory allocation afterwards that adds a trailing NUL.
> 
> I've added the cited reminder about NULs; this should be sufficient to
> draw the programmer's attention to this point.

Ok.

-- 
Pat



reply via email to

[Prev in Thread] Current Thread [Next in Thread]