Also check the "val" parameter in amp_set_conf() and rot_set_conf()

Avoids a segfault in lower level functions that can more easily
happen when using the bindings.
Simmetric with amp_get_conf() via amp_get_conf2() and rot_get_conf()
via rot_get_conf2().

This is a followup of commit ede84bfce4
that made the same change to conf.c
pull/1902/head
Daniele Forsi IU5HKX 2025-09-06 09:16:00 +02:00
rodzic d74581f6fe
commit d507e815a3
2 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -683,7 +683,7 @@ int HAMLIB_API amp_set_conf(AMP *amp, hamlib_token_t token, const char *val)
{
amp_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
if (!amp || !amp->caps)
if (!amp || !amp->caps || !val)
{
return -RIG_EINVAL;
}

Wyświetl plik

@ -748,7 +748,7 @@ int HAMLIB_API rot_set_conf(ROT *rot, hamlib_token_t token, const char *val)
{
rot_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
if (!rot || !rot->caps)
if (!rot || !rot->caps || !val)
{
return -RIG_EINVAL;
}