From 243fbfc19a0ebfde591e439696d2283875635e37 Mon Sep 17 00:00:00 2001 From: SkorP Date: Mon, 10 Apr 2023 20:39:33 +0400 Subject: [PATCH] AVR_ISP: fix NULL pointer dereference --- applications/external/avr_isp_programmer/helpers/avr_isp.c | 1 + .../external/avr_isp_programmer/lib/driver/avr_isp_prog.c | 1 + 2 files changed, 2 insertions(+) diff --git a/applications/external/avr_isp_programmer/helpers/avr_isp.c b/applications/external/avr_isp_programmer/helpers/avr_isp.c index 51b4f8846..ab7c6f496 100644 --- a/applications/external/avr_isp_programmer/helpers/avr_isp.c +++ b/applications/external/avr_isp_programmer/helpers/avr_isp.c @@ -153,6 +153,7 @@ bool avr_isp_auto_set_spi_speed_start_pmode(AvrIsp* instance) { } } if(instance->spi) avr_isp_spi_sw_free(instance->spi); + instance->spi = NULL; return false; } diff --git a/applications/external/avr_isp_programmer/lib/driver/avr_isp_prog.c b/applications/external/avr_isp_programmer/lib/driver/avr_isp_prog.c index b3c81f3b1..ad6489cf0 100644 --- a/applications/external/avr_isp_programmer/lib/driver/avr_isp_prog.c +++ b/applications/external/avr_isp_programmer/lib/driver/avr_isp_prog.c @@ -318,6 +318,7 @@ static bool avr_isp_prog_auto_set_spi_speed_start_pmode(AvrIspProg* instance) { } } if(instance->spi) avr_isp_spi_sw_free(instance->spi); + instance->spi = NULL; return false; }