1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-04-10 15:48:06 -05:00

My ASN.1 decoder returned wrong IDs for anything above 0x1E! Good

job it's never had to yet. Ahem.

[originally from svn r3479]
This commit is contained in:
Simon Tatham 2003-10-03 21:21:23 +00:00
parent 150b6e0a87
commit 72c53fcb75

View File

@ -160,12 +160,11 @@ static int ber_read_id_len(void *source, int sourcelen,
if ((*p & 0x1F) == 0x1F) {
*id = 0;
while (*p & 0x80) {
*id = (*id << 7) | (*p & 0x7F);
p++, sourcelen--;
if (sourcelen == 0)
return -1;
*id = (*id << 7) | (*p & 0x7F);
}
*id = (*id << 7) | (*p & 0x7F);
p++, sourcelen--;
} else {
*id = *p & 0x1F;