Skip to content

Commit

Permalink
telnet: Fix comparison on returned rfc2217 command
Browse files Browse the repository at this point in the history
The comparison was wrong, an invalid command coming in could result in a
command respnse that was wrong.

Signed-off-by: Corey Minyard <[email protected]>
  • Loading branch information
cminyard committed Feb 2, 2024
1 parent 9c3daa2 commit 1c5b63b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/sergensio_telnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 1c5b63b

Please sign in to comment.