Commit 30d6099
committed
opal_hwloc_base_cset2str() off-by-1 in its strncat()
I think the strncat() calls here need to be of the form
strncat(str, new_str_to_add, len - strlen(new_str_to_addstr) - 1);
since in the OMPI calls len is being used as total number of bytes
in str.
strncat(dest,src,n) on the other hand is documented as writing up to
n chars from the incoming string plus 1 for the null, for n+1 total
bytes it can write.
Signed-off-by: Mark Allen <markalle@us.ibm.com>1 parent 804a517 commit 30d6099
1 file changed
+8
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
1728 | 1729 | | |
1729 | 1730 | | |
1730 | 1731 | | |
1731 | | - | |
| 1732 | + | |
1732 | 1733 | | |
1733 | 1734 | | |
1734 | 1735 | | |
1735 | 1736 | | |
1736 | 1737 | | |
1737 | 1738 | | |
1738 | | - | |
| 1739 | + | |
1739 | 1740 | | |
1740 | 1741 | | |
1741 | 1742 | | |
| |||
1791 | 1792 | | |
1792 | 1793 | | |
1793 | 1794 | | |
1794 | | - | |
| 1795 | + | |
1795 | 1796 | | |
1796 | 1797 | | |
1797 | 1798 | | |
| |||
1803 | 1804 | | |
1804 | 1805 | | |
1805 | 1806 | | |
1806 | | - | |
| 1807 | + | |
1807 | 1808 | | |
1808 | 1809 | | |
1809 | 1810 | | |
| |||
1818 | 1819 | | |
1819 | 1820 | | |
1820 | 1821 | | |
1821 | | - | |
| 1822 | + | |
1822 | 1823 | | |
1823 | | - | |
| 1824 | + | |
1824 | 1825 | | |
1825 | 1826 | | |
1826 | 1827 | | |
1827 | | - | |
| 1828 | + | |
1828 | 1829 | | |
1829 | 1830 | | |
1830 | 1831 | | |
| |||
0 commit comments