#include <stdio.h>
#include "netdissect.h"
+#include "extract.h"
static const char tstr[] = " [|telnet]";
/* IAC SB .... IAC SE */
p = sp;
while (length > (u_int)(p + 1 - sp)) {
- ND_TCHECK2(*p, 2);
+ ND_TCHECK_2(p);
if (p[0] == IAC && p[1] == SE)
break;
p++;
}
+ ND_TCHECK(*p);
if (*p != IAC)
goto pktend;
osp = sp;
ND_TCHECK(*sp);
- while (length > 0 && *sp == IAC) {
+ while (length > 0 && EXTRACT_U_1(sp) == IAC) {
/*
* Parse the Telnet command without printing it,
* to determine its length.