Fix buffer overflow in config parser