If the symbol-table passed to `ct_label2str` is `NULL`, return `NULL`. Signed-off-by: Jeremy Sowden <jeremy@xxxxxxxxxx> --- src/ct.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ct.c b/src/ct.c index e246d3039240..8c9ae7b0e04a 100644 --- a/src/ct.c +++ b/src/ct.c @@ -148,10 +148,11 @@ const char *ct_label2str(const struct symbol_table *ct_label_tbl, { const struct symbolic_constant *s; - for (s = ct_label_tbl->symbols; s->identifier; s++) { - if (value == s->value) - return s->identifier; - } + if (ct_label_tbl != NULL) + for (s = ct_label_tbl->symbols; s->identifier; s++) { + if (value == s->value) + return s->identifier; + } return NULL; } -- 2.35.1