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')
|
||||
break;
|
||||
if (buflen < 2 || buffer[1] != '\x14')
|
||||
return; /* No control sequences. */
|
||||
{
|
||||
xfree (relptr);
|
||||
return; /* No control sequences. */
|
||||
}
|
||||
|
||||
buflen--;
|
||||
buffer++;
|
||||
do
|
||||
@ -676,14 +680,11 @@ parse_login_data (app_t app)
|
||||
m = strtol (q, &q, 10);
|
||||
}
|
||||
|
||||
buffer = q;
|
||||
if (buflen < ((unsigned char *)q - buffer))
|
||||
{
|
||||
buflen = 0;
|
||||
break;
|
||||
}
|
||||
else
|
||||
buflen -= ((unsigned char *)q - buffer);
|
||||
break;
|
||||
|
||||
buflen -= ((unsigned char *)q - buffer);
|
||||
buffer = q;
|
||||
|
||||
if (buflen && !(*buffer == '\n' || *buffer == '\x18'))
|
||||
goto next;
|
||||
@ -694,11 +695,11 @@ parse_login_data (app_t app)
|
||||
}
|
||||
}
|
||||
next:
|
||||
for (; buflen && *buffer != '\x18'; buflen--, buffer++)
|
||||
if (*buffer == '\n')
|
||||
buflen = 1;
|
||||
/* Skip to FS (0x18) or LF (\n). */
|
||||
for (; buflen && *buffer != '\x18' && *buffer != '\n'; buflen--)
|
||||
buffer++;
|
||||
}
|
||||
while (buflen);
|
||||
while (buflen && *buffer != '\n');
|
||||
|
||||
xfree (relptr);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user