瀏覽代碼

core: resolve - cast after pointer operations for RES_AR

Daniel-Constantin Mierla 1 年之前
父節點
當前提交
30c42aab76
共有 1 個文件被更改,包括 1 次插入1 次删除
  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 */
 			/* check if enough space is left for type, class, ttl & size */
 			if(unlikely((p + 2 + 2 + 4 + 2) > end))
 			if(unlikely((p + 2 + 2 + 4 + 2) > end))
 				goto error_boundary;
 				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);
 			p += 2 + 2 + 4 + 2 + ntohs(rdlength);
 		}
 		}
 		answers_no = ntohs((unsigned short)buff.hdr.arcount);
 		answers_no = ntohs((unsigned short)buff.hdr.arcount);