]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#10533 liblber: more for ITS#10489
authorHoward Chu <hyc@openldap.org>
Mon, 13 Jul 2026 17:54:44 +0000 (18:54 +0100)
committerHoward Chu <hyc@openldap.org>
Mon, 13 Jul 2026 17:54:44 +0000 (18:54 +0100)
Another potential 1-byte overread

libraries/liblber/decode.c

index d8fca339fd033cf40835ad1068de3b69f949e8e6..9682c1e298e8c3d14603df4f73de7b0dabf37a61 100644 (file)
@@ -415,7 +415,9 @@ ber_get_stringbvl( BerElement *ber, bgbvr *b )
                }
 
                ber->ber_ptr = orig;
-               ber->ber_tag = *(unsigned char *) orig;
+               ber->ber_tag = ( orig < ber->ber_end ) ?
+                       *(unsigned char *)orig :
+                       LBER_DEFAULT;
        }
 
        b->siz = i;