Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [day] [month] [year] [list]
Date: Wed, 7 Aug 2019 12:42:09 -0400
From: Rich Felker <dalias@...c.org>
To: jiahao jia <jhsduguge@...il.com>
Cc: musl@...ts.openwall.com
Subject: Re: Some problems with the Strxfrm() function and the Wcsxfrm()
 function in the MUSL Lic

On Wed, Aug 07, 2019 at 11:57:36PM +0800, jiahao jia wrote:
> Dear Rich Felker:
> 
>     When I was referring to your code, I found that there were some
> problems with the Strxfrm() function and the Wcsxfrm() function in the MUSL
> Lic library. The two functions are located in the
> “musl-1.1.23\src\locale”  directory. The original codes are as follows:
> 
> 
> 
>     As for the Strxfrm() function, when n = l or n < l, the copy string
> function is not executed.
>     As for the Wcsxfrm() function, when n = 1, l = 2, a character of the
> source string is not copied, but only one ‘\0’.
> 
>     In response to the above questions, I made the following changes:
> 
> 
> I am looking forward to your reply as soon as possible!

It looks like you intended to include or attach a patch but there
doesn't seem to be any. Note that, per the specification:

    "If the value returned is n or more, the contents of the array
    pointed to by s1 are unspecified."

So unless I'm missing something by not seeing your patch, I think both
functions are currently correct, but the inconsistency might not make
sense to keep. If we want to change it we should think about what
behavior would be help catch errors and reduce danger of incorrect
programs that expect a meaningful result.

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.