From 57dbf7ed53a6f71eb6ff5f3fa7d7828a7cbcd4d4 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Fri, 27 Sep 2024 18:52:53 +0200 Subject: [PATCH] fixed NULL ptr deref in sigma fp config handling (afl) --- camlibs/ptp2/config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/camlibs/ptp2/config.c b/camlibs/ptp2/config.c index 522426506..53ec6c318 100644 --- a/camlibs/ptp2/config.c +++ b/camlibs/ptp2/config.c @@ -5098,7 +5098,7 @@ _get_SigmaFP_Aperture(CONFIG_GET_ARGS) { * byte[last] checksum */ - if (!(xdata[1] & (1<<1))) { + if ((xsize < 2) || (!(xdata[1] & (1<<1)))) { free (xdata); return GP_ERROR; } @@ -5244,7 +5244,7 @@ _get_SigmaFP_ShutterSpeed(CONFIG_GET_ARGS) { * byte[last] checksum */ - if (!(xdata[1] & (1<<0))) { + if ((xsize < 2) || (!(xdata[1] & (1<<0)))) { free (xdata); return GP_ERROR; }