From 3029dde7ec96a33769d420f6b1f5c58086795931 Mon Sep 17 00:00:00 2001 From: Patrick Gartung Date: Mon, 16 Mar 2020 14:49:55 -0500 Subject: When replacing path text in ELF binaries do not include null byte padding in search string (#15508) --- lib/spack/spack/relocate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/spack/spack/relocate.py b/lib/spack/spack/relocate.py index 7a36434736..e7c85fa4d9 100644 --- a/lib/spack/spack/relocate.py +++ b/lib/spack/spack/relocate.py @@ -447,7 +447,7 @@ def replace_prefix_bin(path_name, old_dir, new_dir): data = f.read() f.seek(0) original_data_len = len(data) - pat = re.compile(old_dir.encode('utf-8') + b'([^\0]*?)\0') + pat = re.compile(old_dir.encode('utf-8')) if not pat.search(data): return ndata = pat.sub(replace, data) -- cgit v1.2.3-70-g09d2