]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
hwclock: use snprintf() instead of sprintf()
authorKarel Zak <kzak@redhat.com>
Tue, 7 Oct 2025 11:00:37 +0000 (13:00 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 7 Oct 2025 11:46:15 +0000 (13:46 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/hwclock-parse-date.y

index 0d996cc87e0f1dcb540e2c9da409b98d4661ea46..5d6daf0e65d9896ddbdb8241bd9323f95c8a1390 100644 (file)
@@ -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);