]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
no option descriptor return null
authorBastian Dehn <hhaalo@arcor.de>
Tue, 9 Apr 2024 16:10:11 +0000 (18:10 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Tue, 9 Apr 2024 16:10:11 +0000 (18:10 +0200)
src/kds_s2000w_option_descriptors.c

index db3097be3dd913844ffc1ca49cc8b17bb10dad2b..69b00e65cf81802555ba6728c94de391c78d8c9c 100644 (file)
@@ -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