diff options
Diffstat (limited to 'src/lib/kadm5/logger.c')
-rw-r--r-- | src/lib/kadm5/logger.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/kadm5/logger.c b/src/lib/kadm5/logger.c index 4f2ad20..bf6bbfd 100644 --- a/src/lib/kadm5/logger.c +++ b/src/lib/kadm5/logger.c @@ -199,8 +199,9 @@ klog_com_err_proc(whoami, code, format, ap) /* If reporting an error message, separate it. */ if (code) { - strcat(outbuf, error_message(code)); - strcat(outbuf, " - "); + outbuf[sizeof(outbuf) - 1] = '\0'; + strncat(outbuf, error_message(code), sizeof(outbuf) - 1 - strlen(outbuf)); + strncat(outbuf, " - ", sizeof(outbuf) - 1 - strlen(outbuf)); } cp = &outbuf[strlen(outbuf)]; |