Skip to content

Commit 761b494

Browse files
author
Emery Hemingway
committed
modifyRPath: return early if new and old rpath are empty
1 parent 309806c commit 761b494

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)