]> git.ipfire.org Git - thirdparty/grub.git/commit
libtasn1: Fix the potential buffer overrun
authorGary Lin <glin@suse.com>
Fri, 15 Nov 2024 07:34:36 +0000 (15:34 +0800)
committerDaniel Kiper <daniel.kiper@oracle.com>
Thu, 28 Nov 2024 20:50:54 +0000 (21:50 +0100)
commit0ad1d4ba861d28401e9dfb53624024aa747c171d
treeb4efd9d80317355ec49296bc03404a26e1528072
parent4160ca9839f5d4c86df75ed2ee24ba0bf43bc9f4
libtasn1: Fix the potential buffer overrun

In _asn1_tag_der(), the first while loop for the long form may end up
with a "k" value with "ASN1_MAX_TAG_SIZE" and cause the buffer overrun
in the second while loop. This commit tweaks the conditional check to
avoid producing a too large "k".

This is a quick fix and may differ from the official upstream fix.

libtasn1 issue: https://gitlab.com/gnutls/libtasn1/-/issues/49

Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Tested-by: Stefan Berger <stefanb@linux.ibm.com>
grub-core/lib/libtasn1-patches/0006-libtasn1-fix-the-potential-buffer-overrun.patch [new file with mode: 0644]