From 9994a763d67f2d7c34bb79888263f9a40140d6a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Fri, 25 Jun 2021 19:20:33 +0200 Subject: [PATCH] pulse-server: module-zeroconf-publish: remove `static` `sysname` need not be static since `avahi_string_list_add_pair()` creates a copy, and no other parts of the code have reference to `sysname` that would require static lifetime. Furthermore, do not hardcode the size of the array. --- .../module-protocol-pulse/modules/module-zeroconf-publish.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/module-protocol-pulse/modules/module-zeroconf-publish.c b/src/modules/module-protocol-pulse/modules/module-zeroconf-publish.c index 39ed2a833..bb91aee05 100644 --- a/src/modules/module-protocol-pulse/modules/module-zeroconf-publish.c +++ b/src/modules/module-protocol-pulse/modules/module-zeroconf-publish.c @@ -315,7 +315,7 @@ static AvahiStringList* txt_record_server_data(struct pw_core_info *info, AvahiS { const char *t; struct utsname u; - static char sysname[256]; + char sysname[sizeof(u.sysname) + sizeof(u.machine) + sizeof(u.release)]; spa_assert(info); spa_assert(uname(&u) >= 0);