Skip to content

Commit 1650b60

Browse files
committed
change counter variable type and add exception description comment
1 parent c20c82b commit 1650b60

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

include/tins/exceptions.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ class malformed_packet : public exception_base {
6666
malformed_packet() : exception_base("Malformed packet") { }
6767
};
6868

69+
/**
70+
* \brief Exception thrown when a DNS decompression pointer is out of bounds.
71+
*/
6972
class DNS_decompression_pointer_out_of_bounds : public exception_base {
7073
public:
7174
DNS_decompression_pointer_out_of_bounds() : exception_base("DNS decompression pointer out of bounds") { }

src/dns.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ uint32_t DNS::compose_name(const uint8_t* ptr, char* out_ptr) const {
336336
const uint8_t* end = &records_data_[0] + records_data_.size();
337337
const uint8_t* end_ptr = 0;
338338
char* current_out_ptr = out_ptr;
339-
int pointer_counter = 0;
339+
uint8_t pointer_counter = 0;
340340
while (*ptr) {
341341
if (pointer_counter++ > 30){
342342
throw DNS_decompression_pointer_loops();

0 commit comments

Comments
 (0)