diff --git a/TechnitiumLibrary.Net/IPAddressExtensions.cs b/TechnitiumLibrary.Net/IPAddressExtensions.cs index 38524522..c335fb58 100644 --- a/TechnitiumLibrary.Net/IPAddressExtensions.cs +++ b/TechnitiumLibrary.Net/IPAddressExtensions.cs @@ -1,6 +1,7 @@ /* Technitium Library Copyright (C) 2025 Shreyas Zare (shreyas@technitium.com) +Copyright (C) 2026 Zafer Balkan (zafer@zaferbalkan.com) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -444,6 +445,14 @@ public static bool TryParseReverseDomain(string ptrDomain, out IPAddress address //192.168.10.1 string[] parts = ptrDomain.Split('.'); + + // Expecting 6 parts: 4 octets + in-addr + arpa + if (parts.Length != 6) + { + address = null; + return false; + } + Span buffer = stackalloc byte[4]; for (int i = 0, j = parts.Length - 3; (i < 4) && (j > -1); i++, j--)