From: Karel Zak Date: Tue, 7 Oct 2025 11:00:37 +0000 (+0200) Subject: hwclock: use snprintf() instead of sprintf() X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cfc572a53614d91183787c6daf2a1a879368444b;p=thirdparty%2Futil-linux.git hwclock: use snprintf() instead of sprintf() Signed-off-by: Karel Zak --- diff --git a/sys-utils/hwclock-parse-date.y b/sys-utils/hwclock-parse-date.y index 0d996cc87..5d6daf0e6 100644 --- a/sys-utils/hwclock-parse-date.y +++ b/sys-utils/hwclock-parse-date.y @@ -1513,7 +1513,7 @@ int parse_date(struct timespec *result, char const *p, if (!tz_was_altered) tz0 = get_tz (tz0buf); - sprintf (tz1buf, "XXX%s%jd:%02d", + snprintf (tz1buf, sizeof(tz1buf), "XXX%s%jd:%02d", &"-"[time_zone < 0], abs_time_zone_hour, abs_time_zone_min);