Browse Source

Fix off-by-one NULL termination in array

Note: the client name length test still fails, this is a different issue.
tags/v1.9.13
Thomas Brand 4 years ago
parent
commit
667e06890e
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      tests/test.cpp

+ 2
- 2
tests/test.cpp View File

@@ -753,7 +753,7 @@ int main (int argc, char *argv[])
client_name3[i] = 'A';
}
// And last one is the terminating '0'
client_name3[jack_client_name_size()] = 0;
client_name3[jack_client_name_size()-1] = 0;
Log("trying to register a new jackd client with maximum possible client name size...\n", client_name3);
client2 = jack_client_open(client_name3, jack_options, &status, server_name);
if (client2 != NULL) {
@@ -944,7 +944,7 @@ int main (int argc, char *argv[])
port_name3[i] = 'A';
}
// And last one is the terminating '0'
port_name3[short_port_size_max] = 0;
port_name3[short_port_size_max-1] = 0;
jack_port_t * test_max_port = jack_port_register(client1, port_name3,
JACK_DEFAULT_AUDIO_TYPE,
JackPortIsOutput, 0);


Loading…
Cancel
Save