Author: rfm Date: Mon Sep 26 10:33:07 2016 New Revision: 40106 URL: http://svn.gna.org/viewcvs/gnustep?rev=40106&view=rev Log: Fix bug if a string with unicode escapes (\u....) also contains invalid unicode characters. Would deallocate the string but return a pointer to the deallocated object.
Modified: libs/webservices/trunk/GWSJSONCoder.m Modified: libs/webservices/trunk/GWSJSONCoder.m URL: http://svn.gna.org/viewcvs/gnustep/libs/webservices/trunk/GWSJSONCoder.m?rev=40106&r1=40105&r2=40106&view=diff ============================================================================== --- libs/webservices/trunk/GWSJSONCoder.m (original) +++ libs/webservices/trunk/GWSJSONCoder.m Mon Sep 26 10:33:07 2016 @@ -272,10 +272,10 @@ NSMutableString *m; NSRange r; - s = m = [NSMutableString alloc]; - m = [m initWithBytes: ctxt->buffer + start - length: ctxt->index - start - 1 - encoding: NSUTF8StringEncoding]; + m = [NSMutableString alloc]; + s = m = [m initWithBytes: ctxt->buffer + start + length: ctxt->index - start - 1 + encoding: NSUTF8StringEncoding]; r = NSMakeRange(0, [m length]); r = [m rangeOfString: @"\\" options: NSLiteralSearch range: r]; while (r.length > 0) _______________________________________________ Gnustep-cvs mailing list Gnustep-cvs@gna.org https://mail.gna.org/listinfo/gnustep-cvs