sim: fixed buffer overflow

Change-Id: Icd3c6e534d7ff69c4689e79801937258e4573fa0