Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Cambra <claudio.cambra@gmail.com>2022-05-18 17:08:12 +0300
committerClaudio Cambra <claudio.cambra@gmail.com>2022-05-22 19:02:10 +0300
commit834cd9737765e01c16a36520fee24f3c061af1a2 (patch)
tree310f168bf25f2a38b93f21be715fadffbbb692a1
parent78322b53eaf4b63705ef63120983c3213b2de2a9 (diff)
Fix possible overflow on lineWrittenbackport/4562/stable-3.5
Signed-off-by: Claudio Cambra <claudio.cambra@gmail.com>
-rw-r--r--shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/LocalSocketClient.m4
1 files changed, 2 insertions, 2 deletions
diff --git a/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/LocalSocketClient.m b/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/LocalSocketClient.m
index fb3c37638..37c39cc7b 100644
--- a/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/LocalSocketClient.m
+++ b/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/LocalSocketClient.m
@@ -207,9 +207,9 @@
NSLog(@"About to write %li bytes from outbuffer to socket.", [self.outBuffer length]);
long bytesWritten = write(self.sock, [self.outBuffer bytes], [self.outBuffer length]);
- char lineWritten[4096];
+ char lineWritten[[self.outBuffer length]];
memcpy(lineWritten, [self.outBuffer bytes], [self.outBuffer length]);
- NSLog(@"Wrote %li bytes to socket. Line was: '%@'", bytesWritten, [NSString stringWithUTF8String:lineWritten]);
+ NSLog(@"Wrote %li bytes to socket. Line written was: '%@'", bytesWritten, [NSString stringWithUTF8String:lineWritten]);
if(bytesWritten == 0) {
// 0 means we reached "end of file" and thus the socket was closed. So let's restart it