]> git.proxmox.com Git - mirror_edk2.git/commit
MdePkg/BaseLib: rewrite Base64Decode()
authorLaszlo Ersek <lersek@redhat.com>
Mon, 1 Jul 2019 22:35:18 +0000 (00:35 +0200)
committerLaszlo Ersek <lersek@redhat.com>
Tue, 16 Jul 2019 21:24:38 +0000 (23:24 +0200)
commit35e242b698cdc6205e99a6d6a188bf27fecf9fb4
tree5b631e60bd2f4c0c85f21ccf33244752c5ffc7ab
parent5d68fc6781f0fa0887715784db5bafc34d5c766f
MdePkg/BaseLib: rewrite Base64Decode()

Rewrite Base64Decode() from scratch, due to reasons listed in the second
reference below.

Implement Base64Decode() according to the specification added in the
previous patch. The decoder scans the input buffer once, it has no inner
loop(s), and it spills each output byte as soon as the output byte is
complete.

The intent is to only strengthen the checks (sanity and input) relative to
the previous implementation, hence the MAX_ADDRESS checks are reinstated.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Marvin Häuser <mhaeuser@outlook.de>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1891
Ref: http://mid.mail-archive.com/c495bd0b-ea4d-7206-8a4f-a7149760d19a@redhat.com
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Tested-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
[lersek@redhat.com: add last para to commit msg per talks w/ Marvin & Phil]
MdePkg/Library/BaseLib/String.c