From de096a38ff571921f69e5a9dd2534945afa15b72 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 14 Jul 2015 18:14:52 +0200 Subject: that also belongs to the previous commit... --- Frameworks/SPMySQLFramework/Source/SPMySQLResult.m | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Frameworks/SPMySQLFramework') diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLResult.m b/Frameworks/SPMySQLFramework/Source/SPMySQLResult.m index 5b14dc20..5f54960c 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLResult.m +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLResult.m @@ -321,6 +321,8 @@ static id NSNullPointer; - (NSString *)_lossyStringWithBytes:(const void *)bytes length:(NSUInteger)length wasLossy:(BOOL *)outLossy { + if(!bytes || !length) return @""; //to match -[NSString initWithBytes:length:encoding:] + //mysql protocol limits column names to 256 bytes. //with inline columns and multibyte charsets this can result in a character //being split in half at which the method above will fail. -- cgit v1.2.3