command-nas: fix out-of-bounds read