Prevent out of bounds (2)

This commit is contained in:
M66B 2019-12-19 12:46:38 +01:00
parent 2b7c929a5a
commit 5978352b2d
1 changed files with 3 additions and 0 deletions

View File

@ -22,6 +22,9 @@
int32_t get_qname(const uint8_t *data, const size_t datalen, uint16_t off, char *qname) {
*qname = 0;
if (off >= datalen)
return -1;
uint16_t c = 0;
uint8_t noff = 0;
uint16_t ptr = off;