- Timestamp:
- 01/15/19 09:53:33 (2 years ago)
- Branches:
- develop
- Children:
- cbd77bd
- Parents:
- e7132d6
- Location:
- lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/format_erf.c
r977e0db r7aa03d9 923 923 uint16_t curr_sec; 924 924 925 hdr = (dag_record_t *)packet->header; 925 if (packet->buffer == NULL) { return NULL; } 926 927 hdr = (dag_record_t *)packet->buffer; 926 928 bodyptr = (char *)packet->payload; 929 /* 24 is size of the ERF header */ 927 930 remaining = ntohs(hdr->rlen) - 24; 928 931 -
lib/format_pcapng.c
re7132d6 r7aa03d9 2107 2107 uint32_t blocktype; 2108 2108 uint16_t optcode; 2109 int remaining; 2110 2111 if (packet->buffer == NULL) { return NULL; } 2109 2112 2110 2113 hdr = (struct pcapng_peeker *)packet->buffer; … … 2113 2116 if (DATA(packet->trace)->byteswapped) { 2114 2117 blocktype = byteswap32(hdr->blocktype); 2118 remaining = byteswap32(hdr->blocklen); 2115 2119 } else { 2116 2120 blocktype = hdr->blocktype; 2121 remaining = hdr->blocklen; 2117 2122 } 2118 2123 … … 2160 2165 else { return NULL; } 2161 2166 2167 /* update remaining to account for header and any payload */ 2168 remaining -= ptr - packet->buffer; 2169 2162 2170 /* Skip over the options till a match is found or they run out */ 2163 2171 struct pcapng_optheader *opthdr = ptr; … … 2167 2175 optcode = opthdr->optcode; 2168 2176 } 2169 while ((optcode != section) && (optcode != PCAPNG_OPTION_END)) { 2177 while ((optcode != section) && (optcode != PCAPNG_OPTION_END) && 2178 (remaining > 0)) { 2179 2170 2180 uint16_t len; 2171 2181 … … 2190 2200 optcode = opthdr->optcode; 2191 2201 } 2202 2203 /* update remaining */ 2204 remaining -= (ptr-packet->buffer); 2205 2192 2206 } 2193 2207
Note: See TracChangeset
for help on using the changeset viewer.