]>
Commit | Line | Data |
---|---|---|
bf122080 | 1 | --- print-isakmp.c |
2 | +++ print-isakmp.c | |
3 | @@ -30,7 +30,7 @@ | |
4 | ||
5 | #ifndef lint | |
6 | static const char rcsid[] _U_ = | |
7 | - "@(#) $Header$ (LBL)"; | |
8 | + "@(#) $Header$ (LBL)"; | |
9 | #endif | |
10 | ||
11 | #ifdef HAVE_CONFIG_H | |
12 | @@ -327,9 +327,13 @@ | |
13 | static u_char *p; | |
14 | size_t i; | |
15 | ||
16 | + TCHECK2(*loc, len); | |
17 | + | |
18 | p = (u_char *)loc; | |
19 | for (i = 0; i < len; i++) | |
20 | printf("%02x", p[i] & 0xff); | |
21 | +trunc: | |
22 | + | |
23 | } | |
24 | ||
25 | struct attrmap { | |
26 | @@ -1111,6 +1115,8 @@ | |
27 | cp = (const u_char *)ext; | |
28 | ||
29 | while (np) { | |
30 | + TCHECK2(*ext, sizeof(e)); | |
31 | + | |
32 | safememcpy(&e, ext, sizeof(e)); | |
33 | ||
34 | if (ep < (u_char *)ext + ntohs(e.len)) { | |
35 | @@ -1136,6 +1142,8 @@ | |
36 | ext = (struct isakmp_gen *)cp; | |
37 | } | |
38 | return cp; | |
39 | +trunc: | |
40 | + return NULL; | |
41 | } | |
42 | ||
43 | static char * |