Commit 0486952
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>
(cherry picked from commit 30d6099)
Conflicts:
opal/mca/hwloc/base/hwloc_base_util.c1 parent db1239a commit 0486952
1 file changed
+11
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
| |||
1891 | 1895 | | |
1892 | 1896 | | |
1893 | 1897 | | |
1894 | | - | |
| 1898 | + | |
1895 | 1899 | | |
1896 | 1900 | | |
1897 | 1901 | | |
1898 | 1902 | | |
1899 | 1903 | | |
1900 | 1904 | | |
1901 | | - | |
| 1905 | + | |
1902 | 1906 | | |
1903 | 1907 | | |
1904 | 1908 | | |
| |||
1956 | 1960 | | |
1957 | 1961 | | |
1958 | 1962 | | |
1959 | | - | |
| 1963 | + | |
1960 | 1964 | | |
1961 | 1965 | | |
1962 | 1966 | | |
| |||
1968 | 1972 | | |
1969 | 1973 | | |
1970 | 1974 | | |
1971 | | - | |
| 1975 | + | |
1972 | 1976 | | |
1973 | 1977 | | |
1974 | 1978 | | |
| |||
1983 | 1987 | | |
1984 | 1988 | | |
1985 | 1989 | | |
1986 | | - | |
| 1990 | + | |
1987 | 1991 | | |
1988 | | - | |
| 1992 | + | |
1989 | 1993 | | |
1990 | 1994 | | |
1991 | 1995 | | |
1992 | | - | |
| 1996 | + | |
1993 | 1997 | | |
1994 | 1998 | | |
1995 | 1999 | | |
| |||
0 commit comments