util: use strnlen() in strndup() implementations
authorSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Tue, 29 Sep 2015 14:10:02 +0000 (16:10 +0200)
committerSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Wed, 30 Sep 2015 06:13:07 +0000 (08:13 +0200)
commitf3afcbecc63ec565a0386cda554d145ca908367d
tree35071a2c95ba2c99e134b949fb870fa3bc367176
parent023165a734b3bae52a449ad01bc1ea5ba4384ec1
util: use strnlen() in strndup() implementations

If the string being copied is not NULL-terminated the result of
strlen() is undefined.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Neil Roberts <neil@linux.intel.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/util/ralloc.c
src/util/strndup.c