Debian Codegraph @

debian/patches/format-security

raw
1 From: gregor herrmann <[email protected]>
2 Date: Wed, 18 Jun 2025 20:42:50 +0200
3 Subject: Use proper format strings in snprintf
4
5 Bug-Debian: https://bugs.debian.org/643408
6 Forwarded: no
7 Last-Update: 2021-12-23
8 ---
9 Source/log.c | 4 ++--
10 1 file changed, 2 insertions(+), 2 deletions(-)
11
12 diff --git a/Source/log.c b/Source/log.c
13 index 5e95be2..5d26180 100644
14 --- a/Source/log.c
15 +++ b/Source/log.c
16 @@ -147,7 +147,7 @@ void log_entry(int fd, char *entry) {
17 }
18
19 if (repeats > 0) {
20 - snprintf(date, 27, asctime(localtime(&last_repeat)));
21 + snprintf(date, 27, "%s", asctime(localtime(&last_repeat)));
22 snprintf(repeat_message, 40, "last message repeated %d time(s)\n", repeats);
23 write(fd, date+4, strlen(date)-10);
24 write(fd, " ", 1);
25 @@ -155,7 +155,7 @@ void log_entry(int fd, char *entry) {
26 repeats = 0;
27 }
28
29 - snprintf(date, 27, asctime(localtime(&current)));
30 + snprintf(date, 27, "%s", asctime(localtime(&current)));
31 write(fd, date+4, strlen(date)-10);
32 write(fd, " ", 1);
33 write(fd, entry, (strlen(entry) < 1023) ? strlen(entry) : 1023 );