mirror of
git://git.gnupg.org/gnupg.git
synced 2025-02-01 16:33:02 +01:00
scd: Fix receive buffer size.
* scd/apdu.c (send_le): Fix the size, adding two for status bytes to Le. -- This is long standing bug. So far, Le was not exact value. Since forthcoming change will introduce exact value of expected length of response data, this change is needed. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
a3b258d1d1
commit
5c2db9dedf
@ -3757,8 +3757,9 @@ send_le (int slot, int class, int ins, int p0, int p1,
|
||||
|
||||
if (use_extended_length && (le > 256 || le < 0))
|
||||
{
|
||||
result_buffer_size = le < 0? 4096 : le;
|
||||
result_buffer = xtrymalloc (result_buffer_size + 10);
|
||||
/* Two more bytes are needed for status bytes. */
|
||||
result_buffer_size = le < 0? 4096 : (le + 2);
|
||||
result_buffer = xtrymalloc (result_buffer_size);
|
||||
if (!result_buffer)
|
||||
{
|
||||
xfree (apdu_buffer);
|
||||
|
Loading…
x
Reference in New Issue
Block a user