Rename 'printf' field name in logger ops to 'print'.

Due the aggresive security checks in compiler 'printf' might be substituded with
'__printf_chk'. However it does not differentiate whether substituted string is
library function call whether field in structure.

By renaming field we prevent it to be unintentionally subustituted by the
preprocessor.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
Michal Mielewczyk
2019-04-17 07:48:25 -04:00
parent ff079aa5b4
commit 5e52ac4ef2
4 changed files with 11 additions and 11 deletions

View File

@@ -52,14 +52,14 @@ class LoggerOps(Structure):
CLOSE = CFUNCTYPE(None, c_void_p)
# PRINTF ommited - we cannot make variadic function call in ctypes
LOG = CFUNCTYPE(c_int, c_void_p, c_uint, c_char_p)
PRINTF_RL = CFUNCTYPE(c_int, c_void_p, c_char_p)
PRINT_RL = CFUNCTYPE(c_int, c_void_p, c_char_p)
DUMP_STACK = CFUNCTYPE(c_int, c_void_p)
_fields_ = [
("_open", OPEN),
("_close", CLOSE),
("_printf", c_void_p),
("_printf_rl", PRINTF_RL),
("_print", c_void_p),
("_print_rl", PRINT_RL),
("_dump_stack", DUMP_STACK),
]