summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-05-14 13:37:35 +0200
committerThomas Haller <thaller@redhat.com>2019-05-17 21:08:34 +0200
commit138c187376cff1c14c66a3fdc502d260178081bb (patch)
treebc07104e148ba2749f2fb2f0612db184f76fb4d4
parent87f3c50f48029dac686c692d94a4daf87bec8fe7 (diff)
downloadNetworkManager-138c187376cff1c14c66a3fdc502d260178081bb.tar.gz
logging: fix stack overflow in logging for iov_data array
This overflow could only happen when we would try to log a message with "NM_DEVICE=", "NM_CONNECTION=", and more than 8 logging domains (_NUM_MAX_FIELDS_SYSLOG_FACILITY - 2). The latter is never the case. While we sometimes log messages with more than one logging domain, there are no logging statements that use most as 8 different logging domains. So, this overflow is not actually reachable from current code (I think). Fixes: ed552c732c76 ('logging: log device and connection along with the message'):
-rw-r--r--src/nm-logging.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nm-logging.c b/src/nm-logging.c
index 79e3658ab4..724fd004f2 100644
--- a/src/nm-logging.c
+++ b/src/nm-logging.c
@@ -747,7 +747,7 @@ _nm_log_impl (const char *file,
{
gint64 now, boottime;
#define _NUM_MAX_FIELDS_SYSLOG_FACILITY 10
- struct iovec iov_data[12 + _NUM_MAX_FIELDS_SYSLOG_FACILITY];
+ struct iovec iov_data[14 + _NUM_MAX_FIELDS_SYSLOG_FACILITY];
struct iovec *iov = iov_data;
gpointer iov_free_data[5];
gpointer *iov_free = iov_free_data;