My ASN.1 decoder returned wrong IDs for anything above 0x1E! Good
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Fri, 3 Oct 2003 21:21:23 +0000 (21:21 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Fri, 3 Oct 2003 21:21:23 +0000 (21:21 +0000)
job it's never had to yet. Ahem.

git-svn-id: svn://svn.tartarus.org/sgt/putty@3479 cda61777-01e9-0310-a592-d414129be87e

import.c

index 1210cc5..01e2628 100644 (file)
--- 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;