зеркало из https://github.com/github/putty.git
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:
Родитель
150b6e0a87
Коммит
72c53fcb75
3
import.c
3
import.c
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче