[PATCH] lib/bch: fix possible stack overrun