@@ -1,7 +1,7 @@ /* - * Copyright (c) 2008-2022 Jonathan Schleifer + * Copyright (c) 2008-2024 Jonathan Schleifer * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE.QPL included in @@ -151,12 +151,15 @@ - (void)sendQueries { OFString *domainName; if (!_isFQDN) { - OFString *searchDomain = [_settings->_searchDomains - objectAtIndex: _searchDomainIndex]; + OFString *searchDomain = @""; + + if (_searchDomainIndex < _settings->_searchDomains.count) + searchDomain = [_settings->_searchDomains + objectAtIndex: _searchDomainIndex]; domainName = [OFString stringWithFormat: @"%@.%@", _host, searchDomain]; } else domainName = _host; @@ -286,11 +289,12 @@ objc_autoreleasePoolPop(pool); return; } @catch (OFInvalidFormatException *e) { } - if ((aliases = [_settings->_staticHosts objectForKey: _host]) != nil) { + if ((aliases = [_settings->_staticHosts objectForKey: + _host.lowercaseString]) != nil) { OFMutableData *addresses = [OFMutableData dataWithItemSize: sizeof(OFSocketAddress)]; id exception = nil; for (OFString *alias in aliases) {