summaryrefslogtreecommitdiffstats
path: root/honeypot.c
diff options
context:
space:
mode:
Diffstat (limited to 'honeypot.c')
-rw-r--r--honeypot.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/honeypot.c b/honeypot.c
index f170ef2..6e5d0af 100644
--- a/honeypot.c
+++ b/honeypot.c
@@ -324,6 +324,8 @@ void negotiate_telnet()
case WONT:
/* Will / Won't Negotiation */
opt = getc(input);
+ if (opt < 0 || opt >= sizeof(telnet_willack))
+ _exit(EXIT_FAILURE);
if (!telnet_willack[opt])
/* We default to WONT */
telnet_willack[opt] = WONT;
@@ -339,6 +341,8 @@ void negotiate_telnet()
case DONT:
/* Do / Don't Negotiation */
opt = getc(input);
+ if (opt < 0 || opt >= sizeof(telnet_options))
+ _exit(EXIT_FAILURE);
if (!telnet_options[opt])
/* We default to DONT */
telnet_options[opt] = DONT;