Change in libosmocore[master]: logging: Introduce MAX_LOG_SIZE for the magic number 4096

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Wed Sep 30 07:37:31 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/20304 )

Change subject: logging: Introduce MAX_LOG_SIZE for the magic number 4096
......................................................................

logging: Introduce MAX_LOG_SIZE for the magic number 4096

Change-Id: Ia9645098dffecd29242857de8f1aea6b9aca5918
---
M src/logging.c
1 file changed, 4 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved
  fixeria: Looks good to me, but someone else must approve



diff --git a/src/logging.c b/src/logging.c
index 212b0b9..d60d6e4 100644
--- a/src/logging.c
+++ b/src/logging.c
@@ -56,6 +56,9 @@
 
 #include <osmocom/vty/logging.h>	/* for LOGGING_STR. */
 
+/* maximum length of the log string of a single log event (typically  line) */
+#define MAX_LOG_SIZE	4096
+
 osmo_static_assert(_LOG_CTX_COUNT <= ARRAY_SIZE(((struct log_context*)NULL)->ctx),
 		   enum_logging_ctx_items_fit_in_struct_log_context);
 osmo_static_assert(_LOG_FLT_COUNT <= ARRAY_SIZE(((struct log_target*)NULL)->filter_data),
@@ -390,7 +393,7 @@
 		    unsigned int level, const char *file, int line, int cont,
 		    const char *format, va_list ap)
 {
-	char buf[4096];
+	char buf[MAX_LOG_SIZE];
 	int ret, len = 0, offset = 0, rem = sizeof(buf);
 	const char *c_subsys = NULL;
 

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/20304
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ia9645098dffecd29242857de8f1aea6b9aca5918
Gerrit-Change-Number: 20304
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-CC: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200930/d7ef26ce/attachment.htm>


More information about the gerrit-log mailing list