From cf50dd70ca1656bad5840e9a7fb7ec8955732226 Mon Sep 17 00:00:00 2001 From: Friedrich Beckmann Date: Fri, 22 Nov 2024 14:21:27 +0100 Subject: [PATCH] message: check if location is present before accessing it The message location is accessed without checking if the location is actually present. I added a check if the message location is there. Thanks to Simon Jacobs for reporting the bug! Closes: https://savannah.gnu.org/bugs/?66239 --- src/libpspp/message.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libpspp/message.c b/src/libpspp/message.c index 9b20a2350d..7bc44f6908 100644 --- a/src/libpspp/message.c +++ b/src/libpspp/message.c @@ -399,7 +399,7 @@ msg_to_string (const struct msg *m) ds_put_cstr (&s, m->text); const struct msg_location *loc = m->location; - if (m->category != MSG_C_GENERAL + if (m->category != MSG_C_GENERAL && !msg_location_is_empty(loc) && loc->src && loc->start.line && loc->start.column && msg_handler.lex_source_get_line) { -- 2.30.2