ralloc: Use strnlen() inside of strncat()
authorVladislav Egorov <vegorov180@gmail.com>
Sun, 21 May 2017 20:49:19 +0000 (22:49 +0200)
committerTimothy Arceri <tarceri@itsqueeze.com>
Mon, 22 May 2017 02:34:28 +0000 (12:34 +1000)
commitcf164d9e975e2aa677b041c012cf843bd44e370a
treeebf09be8d72dc6df9d8dbc12532b6f752e3c4b23
parent4a47247523e678a3a9d3939e8a3c217188b99452
ralloc: Use strnlen() inside of strncat()

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.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/util/ralloc.c