From d5a6fa6dd7866fba203beaea750d179e439bfce6 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Thu, 28 Dec 2023 02:01:39 +0300 Subject: [PATCH] Fix possible crash on print_slow when bs_op is NULL --- src/osd.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osd.cpp b/src/osd.cpp index 3889420a..4593af7d 100644 --- a/src/osd.cpp +++ b/src/osd.cpp @@ -597,8 +597,8 @@ void osd_t::print_slow() op->req.hdr.opcode == OSD_OP_SEC_STABILIZE || op->req.hdr.opcode == OSD_OP_SEC_ROLLBACK || op->req.hdr.opcode == OSD_OP_SEC_READ_BMP) { - bufprintf(" state=%d", PRIV(op->bs_op)->op_state); - int wait_for = PRIV(op->bs_op)->wait_for; + bufprintf(" state=%d", op->bs_op ? PRIV(op->bs_op)->op_state : -1); + int wait_for = op->bs_op ? PRIV(op->bs_op)->wait_for : 0; if (wait_for) { bufprintf(" wait=%d (detail=%lu)", wait_for, PRIV(op->bs_op)->wait_detail);