rtos: Don't crash on qSymbol GDB packet when no RTOS is configured
[fw/openocd] / src / rtos / rtos.c
index 9002f1a8cfe64960785063465453d90f4eb12630..ed559c391b2f86b65e82913b72713dae8fd1bff2 100644 (file)
@@ -194,6 +194,9 @@ int rtos_qsymbol(struct connection *connection, char *packet, int packet_size)
 
        reply_len = sprintf(reply, "OK");
 
+       if (!os)
+               goto done;
+
        if (sscanf(packet, "qSymbol:%" SCNx64 ":", &addr))
                hex_to_str(cur_sym, strchr(packet + 8, ':') + 1);
        else if (target->rtos_auto_detect && !rtos_try_next(target))