fix overflow in memset

Signed-off-by: leo-ma <begeekmyfriend@gmail.com>