From ef28f42a0db7dffc7f790ca8be3642c59d723d53 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 22 Jun 2021 11:56:03 +0200 Subject: Fix crash when FIG0/7 doesn't have enough space --- src/fig/FIG0_7.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/fig/FIG0_7.cpp b/src/fig/FIG0_7.cpp index 50a12cf..363fa65 100644 --- a/src/fig/FIG0_7.cpp +++ b/src/fig/FIG0_7.cpp @@ -49,6 +49,12 @@ FillStatus FIG0_7::fill(uint8_t *buf, size_t max_size) { FillStatus fs; + if (max_size < 4) { + fs.complete_fig_transmitted = false; + fs.num_bytes_written = 0; + return fs; + } + auto ensemble = m_rti->ensemble; if (ensemble->reconfig_counter < 0) { -- cgit v1.2.3