Thanks very much for Niels and Alon's information!
After double check, I found the strdup triggers Segmentation fault when -std=c99 included in compiler flags while compile nettle.
On 2019年04月12日 15:10, Alon Bar-Lev wrote:
On Fri, Apr 12, 2019 at 10:07 AM Niels Möller nisse@lysator.liu.se wrote:
However, looking at the code, I believe the allocation of memory is not required... it can be:
The if (hex_salt) {...} block overwrites the salt storage, for in-place hex decoding. I don't quite like overwriting the strings passed in via argv, even if it might be possible. So when I wrote this tool, always allocating a writable copy, and calling free unconditionally, seemed nice and easy,
Fair enough :)