summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2016-07-12 15:52:38 +0200
committerHao Wu <hao.a.wu@intel.com>2016-07-26 14:38:46 +0800
commit2796476e9e49a5d8eb12fda1973c2c7d11c6ca8f (patch)
treea658154c18fadc4f6fb9d189042f70b96d19eca4
parent94eab2608168c203abb1173ada20c2f527212295 (diff)
downloadedk2-platforms-2796476e9e49a5d8eb12fda1973c2c7d11c6ca8f.tar.xz
BaseTools/GenFds: unbreak Region.PadBuffer
In its current form, Region.PadBuffer() fills every second byte with 0x20, the default separator string of Python's string.join(): https://docs.python.org/2/library/string.html#string.join This corrupts some firmware because (a) 0x20 never corresponds to any ErasePolarity, (b) the PadData produced are actually longer than Size. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Reported-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Fixes: bd907fb6386560e621112beca7b7d381d0003967 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> (cherry picked from commit a78b518b6eddef545fa440822bec315b31e4e987)
-rw-r--r--BaseTools/Source/Python/GenFds/Region.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/BaseTools/Source/Python/GenFds/Region.py b/BaseTools/Source/Python/GenFds/Region.py
index 7548a4f014..e393286a16 100644
--- a/BaseTools/Source/Python/GenFds/Region.py
+++ b/BaseTools/Source/Python/GenFds/Region.py
@@ -56,7 +56,7 @@ class Region(RegionClassObject):
PadByte = pack('B', 0xFF)
else:
PadByte = pack('B', 0)
- PadData = string.join(PadByte for i in xrange(0, Size))
+ PadData = ''.join(PadByte for i in xrange(0, Size))
Buffer.write(PadData)
## AddToBuffer()