Parcourir la source

core: resolve - cast after pointer operations for RES_AR

Daniel-Constantin Mierla il y a 1 an
Parent
commit
30c42aab76
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      src/core/resolve.c

+ 1 - 1
src/core/resolve.c

@@ -1026,7 +1026,7 @@ again:
 			/* check if enough space is left for type, class, ttl & size */
 			if(unlikely((p + 2 + 2 + 4 + 2) > end))
 				goto error_boundary;
-			memcpy((void *)&rdlength, (void *)p + 2 + 2 + 4, 2);
+			memcpy((void *)&rdlength, (void *)(p + 2 + 2 + 4), 2);
 			p += 2 + 2 + 4 + 2 + ntohs(rdlength);
 		}
 		answers_no = ntohs((unsigned short)buff.hdr.arcount);