File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -1457,7 +1457,7 @@ void ElfFile<ElfFileParamNames>::modifyRPath(RPathOp op,
14571457
14581458 /* Zero out the previous rpath to prevent retained dependencies in
14591459 Nix. */
1460- unsigned int rpathSize = 0 ;
1460+ size_t rpathSize = 0 ;
14611461 if (rpath) {
14621462 rpathSize = strlen (rpath);
14631463 memset (rpath, ' X' , rpathSize);
@@ -1466,8 +1466,9 @@ void ElfFile<ElfFileParamNames>::modifyRPath(RPathOp op,
14661466 debug (" new rpath is '%s'\n " , newRPath.c_str ());
14671467
14681468
1469- if (newRPath.size () <= rpathSize) {
1470- strcpy (rpath, newRPath.c_str ());
1469+ size_t newSize = newRPath.size ();
1470+ if (newSize <= rpathSize) {
1471+ memcpy (rpath, newRPath.c_str (), newSize + 1 );
14711472 return ;
14721473 }
14731474
You can’t perform that action at this time.
0 commit comments