From c76272a5af06fe7aecfe2300420f3dcdf32d655d Mon Sep 17 00:00:00 2001 From: ritt Date: Thu, 16 Apr 2020 11:01:58 +0200 Subject: [PATCH] Fixed two potential memory leaks --- src/elogd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/elogd.c b/src/elogd.c index eb5c410d..abb67805 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -17643,9 +17643,9 @@ void display_line(LOGBOOK *lbs, int message_id, int number, char *mode, int expa /* check attributes for row style */ for (i = 0; i < n_attr; i++) { if (attrib[i][0] == 0) - sprintf(str, "Style %s \"\"", attr_list[i]); + snprintf(str, sizeof(str), "Style %s \"\"", attr_list[i]); else - sprintf(str, "Style %s %s", attr_list[i], attrib[i]); + snprintf(str, sizeof(str), "Style %s %s", attr_list[i], attrib[i]); if (getcfg(lbs->name, str, display, sizeof(display))) { sprintf(str, "%s\" style=\"%s", rowstyle, display); strlcpy(rowstyle, str, sizeof(rowstyle)); @@ -17879,7 +17879,7 @@ void display_line(LOGBOOK *lbs, int message_id, int number, char *mode, int expa /* check attributes for cell style */ strlcpy(tdstyle, rowstyle, sizeof(tdstyle)); - sprintf(str, "Cell Style %s %s", attr_list[i], attrib[i]); + snprintf(str, sizeof(str), "Cell Style %s %s", attr_list[i], attrib[i]); if (getcfg(lbs->name, str, display, sizeof(display))) { sprintf(str, "%s\" style=\"%s", rowstyle, display); strlcpy(tdstyle, str, sizeof(rowstyle)); @@ -23446,7 +23446,7 @@ void submit_elog(LOGBOOK *lbs) { write_logfile(lbs, str); } - + /* evaluate propagation of attributes */ if (getcfg(lbs->name, "Propagate attributes", str, sizeof(str))) propagate_attrib(lbs, find_thread_head(lbs, message_id), attrib);