libcacard: fix soft=... parsing in vcard_emul_options
commita5aa842a0597ef9a24e80966b02ca01f287fb334
authorChristophe Fergeau <cfergeau@redhat.com>
Fri, 22 Jul 2011 11:42:18 +0000 (22 13:42 +0200)
committerAlon Levy <alevy@redhat.com>
Fri, 22 Jul 2011 15:05:36 +0000 (22 18:05 +0300)
treede7d608003b94e60827afec1db8687fb543b8a2a
parent009651675afc775fc77018273a47fb36c28a8100
libcacard: fix soft=... parsing in vcard_emul_options

The previous parser had copy and paste errors when computing
vname_length and type_params_length, "name" was used instead
of respectively vname and type_params. This led to length that could
be bigger than the input string, and to access out of the array
bounds when trying to copy these strings. valgrind rightfully
complained about this. It also didn't handle empty fields correctly,

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Reviewed-by: Alon Levy <alevy@redhat.com>
libcacard/vcard_emul_nss.c