From 46c5d019e2adfa1639bcb193bf4fe35860d9707b Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Tue, 11 Sep 2012 00:20:34 -0400 Subject: [PATCH] Fix a somewhat serious bug in the WriteString loop. memmove was being performed on |string|, which is an NSString. The proper variable to operate on is |cString|. But even then, that's not correct because the destination buffer is not owned. Use pointer arithmetic instead. --- Source/NetworkCallbackController.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/NetworkCallbackController.mm b/Source/NetworkCallbackController.mm index dfb350c..93b191c 100644 --- a/Source/NetworkCallbackController.mm +++ b/Source/NetworkCallbackController.mm @@ -115,7 +115,7 @@ BOOL NetworkCallbackController::WriteString(NSString* string) else if (bytesWritten < static_cast(strlen(cString))) { // Adjust the buffer and wait for another chance to write. stringLength -= bytesWritten; - memmove(string, string + bytesWritten, stringLength); + cString += bytesWritten; } else { done = YES; -- 2.22.5