Fixed missing NULL checks in proxy logger macro

This commit is contained in:
Armin Novak 2021-09-07 13:53:24 +02:00 committed by akallabeth
parent 4463e5eda9
commit c9effaa6e8
1 changed files with 12 additions and 8 deletions

View File

@ -36,17 +36,21 @@
*/ */
/* log macros that prepends session id and function name tp the log message */ /* log macros that prepends session id and function name tp the log message */
#define PROXY_LOG_INFO(_tag, _context, _format, ...) \ #define PROXY_LOG_INFO(_tag, _context, _format, ...) \
WLog_INFO(TAG, "[SessionID=%s][%s]: " _format, _context->pdata->session_id, __FUNCTION__, \ WLog_INFO(TAG, "[SessionID=%s][%s]: " _format, \
(_context && _context->pdata) ? _context->pdata->session_id : "null", __FUNCTION__, \
##__VA_ARGS__) ##__VA_ARGS__)
#define PROXY_LOG_ERR(_tag, _context, _format, ...) \ #define PROXY_LOG_ERR(_tag, _context, _format, ...) \
WLog_ERR(TAG, "[SessionID=%s][%s]: " _format, _context->pdata->session_id, __FUNCTION__, \ WLog_ERR(TAG, "[SessionID=%s][%s]: " _format, \
(_context && _context->pdata) ? _context->pdata->session_id : "null", __FUNCTION__, \
##__VA_ARGS__) ##__VA_ARGS__)
#define PROXY_LOG_DBG(_tag, _context, _format, ...) \ #define PROXY_LOG_DBG(_tag, _context, _format, ...) \
WLog_DBG(TAG, "[SessionID=%s][%s]: " _format, _context->pdata->session_id, __FUNCTION__, \ WLog_DBG(TAG, "[SessionID=%s][%s]: " _format, \
(_context && _context->pdata) ? _context->pdata->session_id : "null", __FUNCTION__, \
##__VA_ARGS__) ##__VA_ARGS__)
#define PROXY_LOG_WARN(_tag, _context, _format, ...) \ #define PROXY_LOG_WARN(_tag, _context, _format, ...) \
WLog_WARN(TAG, "[SessionID=%s][%s]: " _format, _context->pdata->session_id, __FUNCTION__, \ WLog_WARN(TAG, "[SessionID=%s][%s]: " _format, \
(_context && _context->pdata) ? _context->pdata->session_id : "null", __FUNCTION__, \
##__VA_ARGS__) ##__VA_ARGS__)
#endif /* FREERDP_SERVER_PROXY_LOG_H */ #endif /* FREERDP_SERVER_PROXY_LOG_H */