From 4630340150a2734a121305bcd5d0e433f38138e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Muhammed=20Tanr=C4=B1kulu?= Date: Fri, 15 Nov 2024 20:27:01 +0100 Subject: [PATCH] Update contracts/dnsregistrar/OffchainDNSResolver.sol Co-authored-by: Nick Johnson --- contracts/dnsregistrar/OffchainDNSResolver.sol | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/contracts/dnsregistrar/OffchainDNSResolver.sol b/contracts/dnsregistrar/OffchainDNSResolver.sol index 21875c35..98f8d51b 100644 --- a/contracts/dnsregistrar/OffchainDNSResolver.sol +++ b/contracts/dnsregistrar/OffchainDNSResolver.sol @@ -207,13 +207,11 @@ contract OffchainDNSResolver is IExtendedResolver, IERC165 { } bytes memory result = new bytes(totalLength); - idx = startIdx; uint256 resultIdx = 0; - while (idx < lastIdx) { + for (uint256 idx = startIdx; idx < lastIdx; idx += fieldLength + 1) { uint256 fieldLength = data.readUint8(idx); result.strcpy(resultIdx, data, idx + 1, fieldLength); resultIdx += fieldLength; - idx += fieldLength + 1; } return result; }