fixes #4153

Signed-off-by: Mloc <colmohici@gmail.com>
Merge pull request #6625 from Mloc/bs12-overflow

fixes #4153