read_resolv_conf(): fix potential buffer overflow
strncat() expects size to contain the remainder of dest buffer,
so we way it was coded was prone to buffer overflow. Compiler even
hints about it:
> In file included from /usr/include/string.h:642,
> from vps_configure.c:23:
> In function 'strncat',
> inlined from 'read_resolv_conf' at vps_configure.c:191:
> /usr/include/bits/string3.h:152: warning: call to
> __builtin___strncat_chk might overflow destination buffer
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
1 file changed