MdeModulePkg/BDS: Fix a buffer overflow bug