autofs-5.1.9 - fix crash in make_options_string()

glibc reports a memory overflow when make_options_string() in snprintf()
As described by Andreas Hasenack on the autofs mailing list this is due
to my incorrect use of max_len in snprintf(), it should in fact be
max_len - <length of buffer already used>.

Anyway looking at the calculated maximum options string length there's
no actual overflow possible.

To fix this use strcat(3) instead of snprintf(), in this case there's
probably less overhead anyway. While we are at it drop the useless error
checks because we know it won't overflow.

Signed-off-by: Ian Kent <raven@themaw.net>
1 file changed