Fixed crashes on invalid report hooks
This commit is contained in:
parent
d052330c21
commit
a6a6c4c79f
1 changed files with 3 additions and 1 deletions
|
@ -33,13 +33,15 @@
|
|||
#include "config.h"
|
||||
#include "posix-compat.h"
|
||||
|
||||
static inline void nothing() {}
|
||||
|
||||
#define IMPL_CALL_REPORT_HOOKS(Kind) \
|
||||
IMPL_SECTION_LIMITS(f_report_hook, HOOK_SECTION(Kind)); \
|
||||
void call_report_hooks_##Kind(void *data) { \
|
||||
for (f_report_hook *hook = GET_SECTION_START(HOOK_SECTION(Kind)); \
|
||||
hook < (f_report_hook*) GET_SECTION_END(HOOK_SECTION(Kind)); \
|
||||
++hook) { \
|
||||
(*hook)(data); \
|
||||
(*hook ?: nothing)(data); \
|
||||
} \
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue