]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Make sure s is set when we get to tail:.
authorGuy Harris <[email protected]>
Tue, 16 Jan 2018 08:23:45 +0000 (00:23 -0800)
committerGuy Harris <[email protected]>
Tue, 16 Jan 2018 08:23:57 +0000 (00:23 -0800)
Should fix Coverity CID 1427598.

print-lwres.c

index e9d3e83fc6605807b01b5943bcd6f08cf01c5be7..f2a485dbf49a49993363d5ed0d3d06cd2ca1e532 100644 (file)
@@ -362,6 +362,7 @@ lwres_print(netdissect_options *ndo,
                p = (const u_char *)(np + 1);
                switch (EXTRACT_BE_U_4(np->opcode)) {
                case LWRES_OPCODE_NOOP:
+                       s = p;
                        break;
                case LWRES_OPCODE_GETADDRSBYNAME:
                        gabn = (const lwres_gabnrequest_t *)p;
@@ -437,6 +438,7 @@ lwres_print(netdissect_options *ndo,
                        s += advance;
                        break;
                default:
+                       s = p;
                        unsupported++;
                        break;
                }
@@ -457,6 +459,7 @@ lwres_print(netdissect_options *ndo,
                p = (const u_char *)(np + 1);
                switch (EXTRACT_BE_U_4(np->opcode)) {
                case LWRES_OPCODE_NOOP:
+                       s = p;
                        break;
                case LWRES_OPCODE_GETADDRSBYNAME:
                        gabn = (const lwres_gabnresponse_t *)p;
@@ -574,6 +577,7 @@ lwres_print(netdissect_options *ndo,
                        }
                        break;
                default:
+                       s = p;
                        unsupported++;
                        break;
                }