From 1c5b63b526f5d75ca4be6e2abe78adc9bf341b60 Mon Sep 17 00:00:00 2001 From: Corey Minyard Date: Fri, 2 Feb 2024 11:54:02 -0600 Subject: [PATCH] telnet: Fix comparison on returned rfc2217 command The comparison was wrong, an invalid command coming in could result in a command respnse that was wrong. Signed-off-by: Corey Minyard --- lib/sergensio_telnet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/sergensio_telnet.c b/lib/sergensio_telnet.c index cda2fcfe..c19d47a5 100644 --- a/lib/sergensio_telnet.c +++ b/lib/sergensio_telnet.c @@ -852,8 +852,8 @@ stelc_com_port_cmd(void *handler_data, const unsigned char *option, stel_lock(sdata); curr = sdata->reqs; - while (curr && curr->option != cmd && - val >= curr->minval && val <= curr->maxval) { + while (curr && !(curr->option == cmd && + val >= curr->minval && val <= curr->maxval)) { prev = curr; curr = curr->next; }