mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-10 13:04:23 +01:00
scd: fix parsing login-data DO.
* scd/app-openpgp.c (parse_login_data): Release RELPTR. Fix parsing. -- Signed-off-by: NIIBE Yutaka
This commit is contained in:
parent
6d8f36a045
commit
9158f58822
@ -629,7 +629,11 @@ parse_login_data (app_t app)
|
|||||||
if (*buffer == '\n')
|
if (*buffer == '\n')
|
||||||
break;
|
break;
|
||||||
if (buflen < 2 || buffer[1] != '\x14')
|
if (buflen < 2 || buffer[1] != '\x14')
|
||||||
return; /* No control sequences. */
|
{
|
||||||
|
xfree (relptr);
|
||||||
|
return; /* No control sequences. */
|
||||||
|
}
|
||||||
|
|
||||||
buflen--;
|
buflen--;
|
||||||
buffer++;
|
buffer++;
|
||||||
do
|
do
|
||||||
@ -676,14 +680,11 @@ parse_login_data (app_t app)
|
|||||||
m = strtol (q, &q, 10);
|
m = strtol (q, &q, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer = q;
|
|
||||||
if (buflen < ((unsigned char *)q - buffer))
|
if (buflen < ((unsigned char *)q - buffer))
|
||||||
{
|
break;
|
||||||
buflen = 0;
|
|
||||||
break;
|
buflen -= ((unsigned char *)q - buffer);
|
||||||
}
|
buffer = q;
|
||||||
else
|
|
||||||
buflen -= ((unsigned char *)q - buffer);
|
|
||||||
|
|
||||||
if (buflen && !(*buffer == '\n' || *buffer == '\x18'))
|
if (buflen && !(*buffer == '\n' || *buffer == '\x18'))
|
||||||
goto next;
|
goto next;
|
||||||
@ -694,11 +695,11 @@ parse_login_data (app_t app)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
next:
|
next:
|
||||||
for (; buflen && *buffer != '\x18'; buflen--, buffer++)
|
/* Skip to FS (0x18) or LF (\n). */
|
||||||
if (*buffer == '\n')
|
for (; buflen && *buffer != '\x18' && *buffer != '\n'; buflen--)
|
||||||
buflen = 1;
|
buffer++;
|
||||||
}
|
}
|
||||||
while (buflen);
|
while (buflen && *buffer != '\n');
|
||||||
|
|
||||||
xfree (relptr);
|
xfree (relptr);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user