Index: src/OFHTTPClient.m ================================================================== --- src/OFHTTPClient.m +++ src/OFHTTPClient.m @@ -489,11 +489,12 @@ } @catch (OFInvalidEncodingException *e) { @throw [OFInvalidServerReplyException exception]; } } - if (![line hasPrefix: @"HTTP/"] || [line characterAtIndex: 8] != ' ') + if (![line hasPrefix: @"HTTP/"] || [line length] < 9 || + [line characterAtIndex: 8] != ' ') @throw [OFInvalidServerReplyException exception]; version = [line substringWithRange: of_range(5, 3)]; if (![version isEqual: @"1.0"] && ![version isEqual: @"1.1"]) @throw [OFUnsupportedVersionException