Did you run sudo apt-get update first?
I'm running WSL 2 here with Ubuntu 20.04 LTS and this is what worked for me, without having to install anything from source.
Without doing anything (vulnerable):
nick:~ $ sudoedit -s '\' `perl -e 'print "A" x 65536'`
malloc(): corrupted top size
Aborted
Then I ran this to patch it:
sudo apt-get update && sudo apt-get --only-upgrade install sudo
And now this is the output (I guess not vulnerable anymore):
nick:~ $ sudoedit -s '\' `perl -e 'print "A" x 65536'`
usage: sudoedit [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt] [-T timeout] [-u user] file ...
After patching it `dpkg -l | grep sudo` reports 1.8.31-1ubuntu1.2. I didn't think to run that before patching it but I'd guess it's going to be different.