fix out-of-bounds write in sm2_crypt.c