Skip to content

Commit be0cc30

Browse files
authored
Merge pull request #376 from ehmry/null-rpath
modifyRPath: return early if new and old rpath are empty
2 parents 309806c + 761b494 commit be0cc30

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/patchelf.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,8 +1350,8 @@ void ElfFile<ElfFileParamNames>::modifyRPath(RPathOp op,
13501350
debug("new rpath is '%s'\n", newRPath.c_str());
13511351

13521352

1353-
if (rpath && newRPath.size() <= rpathSize) {
1354-
memcpy(rpath, newRPath.c_str(), newRPath.size() + 1);
1353+
if (newRPath.size() <= rpathSize) {
1354+
if (rpath) memcpy(rpath, newRPath.c_str(), newRPath.size() + 1);
13551355
return;
13561356
}
13571357

0 commit comments

Comments
 (0)