Commit 3fde612 1 parent 19846e1 commit 3fde612 Copy full SHA for 3fde612
File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -628,6 +628,9 @@ sc_pkcs15emu_openpgp_init(sc_pkcs15_card_t *p15card)
628
628
LOG_FUNC_RETURN (ctx , r );
629
629
}
630
630
631
+ // see https://stackoverflow.com/a/10536254 for explanation
632
+ #define LEN_MAX_INT_AS_STR (3 * sizeof(int) + 2)
633
+
631
634
static int
632
635
sc_pkcs15emu_openpgp_add_data (sc_pkcs15_card_t * p15card )
633
636
{
@@ -639,8 +642,8 @@ sc_pkcs15emu_openpgp_add_data(sc_pkcs15_card_t *p15card)
639
642
for (i = 1 ; i <= PGP_NUM_PRIVDO ; i ++ ) {
640
643
sc_pkcs15_data_info_t dat_info ;
641
644
sc_pkcs15_object_t dat_obj ;
642
- char name [8 ];
643
- char path [9 ];
645
+ char name [6 + LEN_MAX_INT_AS_STR ];
646
+ char path [7 + LEN_MAX_INT_AS_STR ];
644
647
u8 content [254 ];
645
648
memset (& dat_info , 0 , sizeof (dat_info ));
646
649
memset (& dat_obj , 0 , sizeof (dat_obj ));
You can’t perform that action at this time.
0 commit comments