mirror of
git://git.gnupg.org/gnupg.git
synced 2025-03-20 21:29:58 +01:00
scd: Fix receive buffer size.
* scd/apdu.c (send_le): Fix the size, adding two for status bytes to Le. -- Backport of master commit: 5c2db9dedfe9dbb14ffec24751ca23a69cead94e 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
3089c76a4a
commit
bb5a153f9d
@ -3648,8 +3648,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