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,
1457
1457
1458
1458
/* Zero out the previous rpath to prevent retained dependencies in
1459
1459
Nix. */
1460
- unsigned int rpathSize = 0 ;
1460
+ size_t rpathSize = 0 ;
1461
1461
if (rpath) {
1462
1462
rpathSize = strlen (rpath);
1463
1463
memset (rpath, ' X' , rpathSize);
@@ -1466,8 +1466,9 @@ void ElfFile<ElfFileParamNames>::modifyRPath(RPathOp op,
1466
1466
debug (" new rpath is '%s'\n " , newRPath.c_str ());
1467
1467
1468
1468
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 );
1471
1472
return ;
1472
1473
}
1473
1474
You can’t perform that action at this time.
0 commit comments