fix signed/unsigned and possible buffer overflow
fix signed/unsigned and possible buffer overflow

dengert/libp11,mouse07410/libp11,mtrojnar/libp11,OpenSC/libp11,mouse07410/libp11,OpenSC/libp11,mtrojnar/libp11,dengert/libp11