patch-cf-upgrade_log_c 552 B

12345678910111213
  1. $OpenBSD: patch-cf-upgrade_log_c,v 1.1 2016/01/22 11:38:23 sthen Exp $
  2. --- cf-upgrade/log.c.orig Wed Jan 20 00:13:36 2016
  3. +++ cf-upgrade/log.c Wed Jan 20 00:14:34 2016
  4. @@ -54,7 +54,7 @@ static char *prepare_message(char *format, va_list arg
  5. strftime(timestamp, timestamp_size, "%Y/%m/%d %H:%M:%S", now_tm);
  6. /* '[' + ']' + ' ' + '\0' */
  7. message = xmalloc(message_size + timestamp_size + 4);
  8. - sprintf(message, "[%s] %s", timestamp, buffer);
  9. + snprintf(message, message_size, "[%s] %s", timestamp, buffer);
  10. return message;
  11. }