Browse Source

jack common: ensure null termination of char arrays

Signed-off-by: Adam Miartus <amiartus@de.adit-jv.com>
(cherry picked from commit 733c147c23)
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>

Change-Id: I63a7330408d75f21e25426e42260133669a0db0e
(cherry picked from commit 41b58edf09)
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
tags/v1.9.15
Adam Miartus Filipe Coelho <falktx@falktx.com> 4 years ago
parent
commit
af5cf14689
3 changed files with 3 additions and 0 deletions
  1. +1
    -0
      common/JackEngineControl.h
  2. +1
    -0
      common/JackInternalClient.cpp
  3. +1
    -0
      common/JackLibClient.cpp

+ 1
- 0
common/JackEngineControl.h View File

@@ -118,6 +118,7 @@ struct SERVER_EXPORT JackEngineControl : public JackShmMem
fMaxUsecs = 0;
ResetRollingUsecs();
strncpy(fServerName, server_name, sizeof(fServerName));
fServerName[sizeof(fServerName) - 1] = 0;
fCPULoad = 0.f;
fPeriod = 0;
fComputation = 0;


+ 1
- 0
common/JackInternalClient.cpp View File

@@ -77,6 +77,7 @@ int JackInternalClient::Open(const char* server_name, const char* name, jack_uui
}

strncpy(fServerName, server_name, sizeof(fServerName));
fServerName[sizeof(fServerName) - 1] = 0;

// Open server/client direct channel
char name_res[JACK_CLIENT_NAME_SIZE + 1];


+ 1
- 0
common/JackLibClient.cpp View File

@@ -106,6 +106,7 @@ int JackLibClient::Open(const char* server_name, const char* name, jack_uuid_t u
}
strncpy(fServerName, server_name, sizeof(fServerName));
fServerName[sizeof(fServerName) - 1] = 0;

// Open server/client channel
char name_res[JACK_CLIENT_NAME_SIZE+1];


Loading…
Cancel
Save