prevent out of bounds write
prevent out of bounds write

fixes https://oss-fuzz.com/testcase-detail/5226571123392512

hongquan/OpenSC-main,philipWendland/OpenSC,frankmorgner/OpenSC,LudovicRousseau/OpenSC,philipWendland/OpenSC,hongquan/OpenSC-main,AktivCo/OpenSC,hongquan/OpenSC-main,metsma/OpenSC,OpenSC/OpenSC,AktivCo/OpenSC,metsma/OpenSC,dengert/OpenSC,mouse07410/OpenSC,Jakuje/OpenSC,Jakuje/OpenSC,LudovicRousseau/OpenSC,fabled/OpenSC,LudovicRousseau/OpenSC,metsma/OpenSC,AktivCo/OpenSC,fabled/OpenSC,mouse07410/OpenSC,frankmorgner/OpenSC,frankmorgner/OpenSC,frankmorgner/OpenSC,OpenSC/OpenSC,mouse07410/OpenSC,Jakuje/OpenSC,philipWendland/OpenSC,fabled/OpenSC,OpenSC/OpenSC,dengert/OpenSC,Jakuje/OpenSC,fabled/OpenSC,dengert/OpenSC