ui: Fix segfault in non-null terminated array