]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-resp.c
Use more the EXTRACT_U_1() macro (40/n)
[tcpdump] / print-resp.c
index bec8b6da237ee9c856c64ab7d99acc427d9be56f..d946c64945cc68f818d63ae0000a981c4cb31842 100644 (file)
@@ -90,7 +90,7 @@ static int resp_get_length(netdissect_options *, register const u_char *, int, c
 #define FIND_CRLF(_ptr, _len)                   \
     for (;;) {                                  \
         LCHECK2(_len, 2);                       \
-        ND_TCHECK2(*_ptr, 2);                   \
+        ND_TCHECK_2(_ptr);                   \
         if (*_ptr == '\r' && *(_ptr+1) == '\n') \
             break;                              \
         _ptr++;                                 \
@@ -493,7 +493,7 @@ resp_get_length(netdissect_options *ndo, register const u_char *bp, int len, con
             too_large = 1;
         } else {
             result *= 10;
-            if (result == INT_MAX && c > (INT_MAX % 10)) {
+            if (result == ((INT_MAX / 10) * 10) && c > (INT_MAX % 10)) {
                 /* This will overflow an int when we add c */
                 too_large = 1;
             } else