openbsd-ports/net/ircII/patches/patch-source_log_c
sthen 4e0136afcb update to ircII-20210314, fixing a remote DoS connected with ctcp
ok tb@, similar diff mestre@

sent to maintainer yesterday, I'm just going to commit it now as it's a
pretty simple update and security fix
2021-03-25 22:05:09 +00:00

26 lines
532 B
Plaintext

$OpenBSD: patch-source_log_c,v 1.6 2021/03/25 22:05:09 sthen Exp $
--- source/log.c.orig Fri Nov 20 10:23:54 2015
+++ source/log.c Wed Dec 2 17:40:09 2015
@@ -155,12 +155,19 @@ set_log_file(u_char *filename)
void
add_to_log(FILE *fp, u_char *line)
{
+ time_t t;
+ struct tm *tm;
+ char buf[32];
+
if (fp == NULL)
fp = irclog_fp;
if (fp)
{
- fprintf(fp, "%s\n", line);
+ t = time(0);
+ tm = localtime(&t);
+ strftime(buf, sizeof buf, "%b %d %R", tm);
+ fprintf(fp, "[%s] %s\n", buf, line);
fflush(fp);
}
}