From 5339b431e4f47faaa380dc8f909d0de0efe4ee28 Mon Sep 17 00:00:00 2001 From: Mike Black W9MDB Date: Sat, 10 Dec 2022 11:49:45 -0600 Subject: [PATCH] Fix rigctld segfault when using -P RTS https://github.com/Hamlib/Hamlib/issues/1182 --- Segfault-award | 2 ++ tests/rigctld.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Segfault-award b/Segfault-award index 2d02ce1bc..e09c67497 100644 --- a/Segfault-award +++ b/Segfault-award @@ -7,6 +7,8 @@ A developer cannot apply for HSHR for segfaults on his/her own code. Here is the list of the brave fellows: +* Saku Nyland OH1KH v4.5.1, 10/2022, rigctld.c using ptt_type=RTS + * David Kjellquist WB5NHL, v1.1.3, 09/2002, kenwood/ts570.c caught on TS570D backend startup. diff --git a/tests/rigctld.c b/tests/rigctld.c index 470534c32..bd2915dd7 100644 --- a/tests/rigctld.c +++ b/tests/rigctld.c @@ -701,7 +701,9 @@ int main(int argc, char *argv[]) { my_rig->state.pttport.type.ptt = ptt_type; my_rig->state.pttport_deprecated.type.ptt = ptt_type; - my_rig->caps->ptt_type = ptt_type; + // This causes segfault since backend rig_caps are const + // rigctld will use the rig->state version of this for clients + //my_rig->caps->ptt_type = ptt_type; } if (dcd_type != RIG_DCD_NONE)