bos_util: Fix buffer overflow