The call of strncpy can results in destination buffer without null as
terminator in the case of truncation. Compiler reports the risk as
warnings, like:
In function ‘strncpy’,
inlined from ‘alsaseq_get_queue_info_by_name’ at ../src/seq/query.c:670:5:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:95:10: warning: ‘strncpy’ specified bound 64 equals destination size [-Wstringop-truncation]
95 | return __builtin___strncpy_chk (__dest, __src, __len,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
96 | __glibc_objsize (__dest));
| ~~~~~~~~~~~~~~~~~~~~~~~~~
This commit uses safer way to copy strings, g_strlcpy(), to fix the bug.
Fixes: 4e8675f631ce ("seq: client_info: add properties and accessor methods") Fixes: f3457eaf706b ("seq: port_info: add properties") Fixes: 1eabdf6bc647 ("seq: add global method to get the information of queue") Fixes: f26342b3ab3d ("seq: queue_info: add properties and constructors") Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>