diff options
| author | Donald Sharp <donaldsharp72@gmail.com> | 2023-09-21 06:31:58 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-21 06:31:58 -0400 |
| commit | cd3bd19314ac86c25a7831f995947fae67c6706d (patch) | |
| tree | c5b67cd6b3b62a8bea736777a026024b3805e561 /lib/vty.c | |
| parent | d81e492368b8b78ab1f4fbaba3e72d93c3958608 (diff) | |
| parent | 448d690a354c3ea481aba6254a285937d843cf81 (diff) | |
Merge pull request #14454 from opensourcerouting/coverity-20230920
lib: fix a bunch of coverity nits
Diffstat (limited to 'lib/vty.c')
| -rw-r--r-- | lib/vty.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -2368,8 +2368,7 @@ static void vtysh_read(struct event *thread) printf("result: %d\n", ret); printf("vtysh node: %d\n", vty->node); #endif /* VTYSH_DEBUG */ - - if (vty->pass_fd != -1) { + if (vty->pass_fd >= 0) { memset(vty->pass_fd_status, 0, 4); vty->pass_fd_status[3] = ret; vty->status = VTY_PASSFD; @@ -2387,7 +2386,9 @@ static void vtysh_read(struct event *thread) * => skip vty_event(VTYSH_READ, vty)! */ return; - } + } else + /* normalize other invalid values */ + vty->pass_fd = -1; /* hack for asynchronous "write integrated" * - other commands in "buf" will be ditched |
