fix a bug which passed wrong size to memset()