logging: Add option to detect missed transient string duplication

Added CONFIG_LOG_DETECT_MISSED_STRDUP (by default on) which enables
scanning of log message strings in search for %s and reports if
string address is not from strdup buffer pool and outside read only
memory section which indicates that log_strdup() wrapping is missing

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruscinski 2019-05-21 13:03:13 +02:00 committed by Carles Cufí
commit a211afb041
4 changed files with 139 additions and 2 deletions

View file

@ -535,7 +535,7 @@ void log_generic(struct log_msg_ids src_level, const char *fmt, va_list ap);
*
* @return True if address within the pool, false otherwise.
*/
bool log_is_strdup(void *buf);
bool log_is_strdup(const void *buf);
/** @brief Free allocated buffer.
*