]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Fix a malloc problem caused by the space for a UUID being one byte too small -- not...
authorMike Brady <4265913+mikebrady@users.noreply.github.com>
Sat, 8 Oct 2022 15:56:50 +0000 (16:56 +0100)
committerMike Brady <4265913+mikebrady@users.noreply.github.com>
Sat, 8 Oct 2022 15:56:50 +0000 (16:56 +0100)
shairport.c

index 86bf0691e99e92e5d5e43d12fce1f7b524597d85..4cb9e9756676ba8526aa5f4c5657093ab8a1a8cc 100644 (file)
@@ -571,7 +571,7 @@ int parse_options(int argc, char **argv) {
   uuid_t binuuid;
   uuid_generate_random(binuuid);
 
-  char *uuid = malloc(UUID_STR_LEN);
+  char *uuid = malloc(UUID_STR_LEN + 1); // leave space for the NUL at the end
   // Produces a UUID string at uuid consisting of lower-case letters
   uuid_unparse_lower(binuuid, uuid);
   config.airplay_pi = uuid;