log-redirect: don't put enormous vars on the stack 00/289700/1
authorMichal Bloch <m.bloch@samsung.com>
Mon, 13 Mar 2023 14:25:32 +0000 (15:25 +0100)
committerMichal Bloch <m.bloch@samsung.com>
Mon, 13 Mar 2023 16:38:23 +0000 (17:38 +0100)
Change-Id: I3e6df1c687d7d379f13078dbca7450cda34a97d5

src/log-redirect-stdout/main.c

index d791e51..945398f 100644 (file)
 #include <dlog-redirect-stdout.h>
 #include <logcommon.h>
 
-/* Tag length is limited by maximum request size. */
-#define MAX_TAG_LENGTH (MAX_LOGGER_REQUEST_LEN - sizeof(struct dlog_control_msg) - sizeof(struct dlog_control_msg_stdout))
+/* Tag length limited arbitrarily: in theory it can be as long
+ * as LOG_MAX_PAYLOAD_SIZE, but in practice it tends to be up to
+ * about 20ish and it would be good to keep it that way. */
+#define MAX_TAG_LENGTH 128
 
 struct parse_redirect_info {
        bool enabled;