[klibc] strndup(): Fix out of bounds read access

The use of strlen to get the length of the source string can lead to
undetermined memory access if the source string is not finished with a
zero. Use strnlen to prevent this.

Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>
Reviewed-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: maximilian attems <max@stro.at>
1 file changed