d09b8fa161
The currrent code in libcacard/vcard_emul_nss.c:vcard_emul_options() has a weird bug in variable usage around expanding opts->vreader array. There's a helper variable, vreaderOpt, which is first needlessly initialized to NULL, next, conditionally, only we have to expand opts->vreader, receives array expansion from g_renew(), and next, even if we don't actually perform expansion, the value of this variable is assigned to the actual array, opts->vreader, which was supposed to be expanded. So, since we expand the array by READER_STEP increments, only once in READER_STEP (=4) the code will work, in other 3/4 times it will fail badly. Fix this by not using this temp variable when expanding the array, and by dropping the useless =NULL initializer too - if it wasn't in place initially, compiler would have warned us about this problem at the beginning. Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Reviewed-by: Markus Armbruster <armbru@redhat.com> |
||
---|---|---|
.. | ||
cac.c | ||
cac.h | ||
card_7816.c | ||
card_7816.h | ||
card_7816t.h | ||
event.c | ||
eventt.h | ||
libcacard.pc.in | ||
libcacard.syms | ||
link_test.c | ||
Makefile | ||
vcard_emul_nss.c | ||
vcard_emul_type.c | ||
vcard_emul_type.h | ||
vcard_emul.h | ||
vcard.c | ||
vcard.h | ||
vcardt_internal.h | ||
vcardt.c | ||
vcardt.h | ||
vevent.h | ||
vreader.c | ||
vreader.h | ||
vreadert.h | ||
vscard_common.h | ||
vscclient.c |