From fac432cdb48c0f03d24b5be12ba4607777fab929 Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Sun, 12 Jul 2015 02:18:08 -0500 Subject: [PATCH] At least detect unexpected escape transposition characters --- src/kiss.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/kiss.c b/src/kiss.c index 40052cd..d2d158a 100644 --- a/src/kiss.c +++ b/src/kiss.c @@ -28,6 +28,8 @@ int patty_kiss_read(int fd, void *buf, size_t *len, int *channel) { ((char *)buf)[b++] = PATTY_KISS_FEND; } else if (c == PATTY_KISS_TFESC) { ((char *)buf)[b++] = PATTY_KISS_FESC; + } else { + goto error_io; } flags &= ~KISS_ESCAPE; @@ -53,4 +55,7 @@ int patty_kiss_read(int fd, void *buf, size_t *len, int *channel) { *len = b + 1; return 0; + +error_io: + return -1; }