cmd: Use strl* rather than strn* to avoid overrun
authorSimon Wilkinson <sxw@your-file-system.com>
Sat, 31 Mar 2012 10:58:01 +0000 (06:58 -0400)
committerDerrick Brashear <shadow@dementix.org>
Mon, 9 Apr 2012 01:18:48 +0000 (18:18 -0700)
commit9a007a9df43645b63a8b642029b4931928f9268b
tree7a474e632836c7c4a7d8f00b92f08fdcdd42f3b5
parentb5ebfec329ef428e242c7458ccbfc807b25f1d63
cmd: Use strl* rather than strn* to avoid overrun

The NName function was using strncat(a, b, sizeof(a)), which doesn't
work as you would expect if 'a' already contains data. To avoid the
potential buffer overflow, switch to just using strlcat.

Caught by clang-analyzer

Change-Id: Idd2c630c07a93b27e8d629339589aa6686290eae
Reviewed-on: http://gerrit.openafs.org/7092
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
src/cmd/cmd.c