This commit backports an upstream commit that fixes CVE-2021-3981. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>