From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Sat, 8 Oct 2022 15:56:50 +0000 (+0100) Subject: Fix a malloc problem caused by the space for a UUID being one byte too small -- not... X-Git-Tag: 4.1-rc2~1^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3828ec1a66827ead06586808bee25dc8638e7844;p=thirdparty%2Fshairport-sync.git Fix a malloc problem caused by the space for a UUID being one byte too small -- not enough room for the trailing NUL. --- diff --git a/shairport.c b/shairport.c index 86bf0691..4cb9e975 100644 --- a/shairport.c +++ b/shairport.c @@ -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;