Fix buffer_overflow issue detected by svace 2.5 (WGID: 321663)