fix byte buffer overflow caused by wrong size info

Do I need to send double pull requests to both master and branch?