term/protos: Do not call callback if NULL
diff --git a/common/protos/stivale2.c b/common/protos/stivale2.c
index 45a617bd..1682150d 100644
--- a/common/protos/stivale2.c
+++ b/common/protos/stivale2.c
@@ -553,12 +553,14 @@ failed_to_load_header_section:
if (terminal_hdr_tag->flags & (1 << 0)) {
// We provide callback
tag->flags |= (1 << 2);
+ if (terminal_hdr_tag->callback != 0) {
#if defined (__i386__)
- term_callback = stivale2_term_callback;
- stivale2_term_callback_ptr = terminal_hdr_tag->callback;
+ term_callback = stivale2_term_callback;
+ stivale2_term_callback_ptr = terminal_hdr_tag->callback;
#elif defined (__x86_64__)
- term_callback = (void *)terminal_hdr_tag->callback;
+ term_callback = (void *)terminal_hdr_tag->callback;
#endif
+ }
}
// We provide max allowed string length
