From d507e815a32df03d81b2e4eaa445a7d55dfd496e Mon Sep 17 00:00:00 2001 From: Daniele Forsi IU5HKX Date: Sat, 6 Sep 2025 09:16:00 +0200 Subject: [PATCH] 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 ede84bfce41bf8da3dafea7c585666259a5e4b71 that made the same change to conf.c --- src/amp_conf.c | 2 +- src/rot_conf.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/amp_conf.c b/src/amp_conf.c index 481786b3f..d60496412 100644 --- a/src/amp_conf.c +++ b/src/amp_conf.c @@ -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; } diff --git a/src/rot_conf.c b/src/rot_conf.c index 5f204aed7..008a8f048 100644 --- a/src/rot_conf.c +++ b/src/rot_conf.c @@ -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; }