Re: [Mesa-dev] [PATCH 06/12] ralloc: Use strnlen() inside of strncat()

2017-01-18 Thread Ian Romanick
On 01/07/2017 11:02 AM, Vladislav Egorov wrote: > If the str is long or isn't null-terminated, strlen() could take a lot > of time or even crash. I don't know why was it used in the first place, > maybe for platforms without strnlen(), but strnlen() is already used > inside of ralloc_strndup(), so

[Mesa-dev] [PATCH 06/12] ralloc: Use strnlen() inside of strncat()

2017-01-07 Thread Vladislav Egorov
If the str is long or isn't null-terminated, strlen() could take a lot of time or even crash. I don't know why was it used in the first place, maybe for platforms without strnlen(), but strnlen() is already used inside of ralloc_strndup(), so this change should not additionally break anything. ---