From: simon Date: Fri, 3 Oct 2003 21:21:23 +0000 (+0000) Subject: My ASN.1 decoder returned wrong IDs for anything above 0x1E! Good X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/commitdiff_plain/3a5a5a59e7da6cbc4dc26f160ad94eaf2b140612 My ASN.1 decoder returned wrong IDs for anything above 0x1E! Good job it's never had to yet. Ahem. git-svn-id: svn://svn.tartarus.org/sgt/putty@3479 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/import.c b/import.c index 1210cc51..01e2628a 100644 --- a/import.c +++ b/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;