You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/04/28 10:50:51 UTC

[GitHub] [incubator-nuttx] realprocrastinator commented on a diff in pull request #6171: syslog: Fixed a potential buffer overflow issue

realprocrastinator commented on code in PR #6171:
URL: https://github.com/apache/incubator-nuttx/pull/6171#discussion_r860748241


##########
drivers/syslog/syslog_channel.c:
##########
@@ -129,6 +129,16 @@ static struct syslog_channel_s g_default_channel =
 };
 #endif
 
+/* This is a simply sanity check to avoid we have more elements than the
+ * `g_syslog_channel` array can hold
+ */
+
+#if (CONFIG_SYSLOG_DEFAULT + CONFIG_RAMLOG_SYSLOG + \
+     CONFIG_SYSLOG_RPMSG + CONFIG_SYSLOG_RTT) > \
+     CONFIG_SYSLOG_MAX_CHANNELS
+#  error "Max syslog channel number exceeds"

Review Comment:
   Sure, will have a look at changing to `static_assert` method.  :-)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org