--- print-isakmp.c +++ print-isakmp.c @@ -30,7 +30,7 @@ #ifndef lint static const char rcsid[] _U_ = - "@(#) $Header$ (LBL)"; + "@(#) $Header$ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -327,9 +327,13 @@ static u_char *p; size_t i; + TCHECK2(*loc, len); + p = (u_char *)loc; for (i = 0; i < len; i++) printf("%02x", p[i] & 0xff); +trunc: + } struct attrmap { @@ -1111,6 +1115,8 @@ cp = (const u_char *)ext; while (np) { + TCHECK2(*ext, sizeof(e)); + safememcpy(&e, ext, sizeof(e)); if (ep < (u_char *)ext + ntohs(e.len)) { @@ -1136,6 +1142,8 @@ ext = (struct isakmp_gen *)cp; } return cp; +trunc: + return NULL; } static char *