From 0f45824c0140730757bf6f290c5409bedb93b029 Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Tue, 9 Apr 2024 18:10:11 +0200 Subject: [PATCH] no option descriptor return null --- src/kds_s2000w_option_descriptors.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/kds_s2000w_option_descriptors.c b/src/kds_s2000w_option_descriptors.c index db3097b..69b00e6 100644 --- a/src/kds_s2000w_option_descriptors.c +++ b/src/kds_s2000w_option_descriptors.c @@ -558,5 +558,8 @@ void kds_s2000w_option_descriptor_free_option_descriptors() SANE_Option_Descriptor* kds_s2000w_option_get_descriptor(int option) { debug_printf(ALL, "kds_s2000w_option_get_descriptor"); + if (option >= MAX_OPTION_COUNT) + return NULL; + return &descriptor_array[option]; } \ No newline at end of file -- 2.39.5