Commit 91ea0df
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 7412e88 commit 91ea0df
1 file changed
+9
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
1920 | 1922 | | |
1921 | 1923 | | |
1922 | 1924 | | |
1923 | | - | |
| 1925 | + | |
1924 | 1926 | | |
1925 | 1927 | | |
1926 | 1928 | | |
1927 | 1929 | | |
1928 | 1930 | | |
1929 | 1931 | | |
1930 | | - | |
| 1932 | + | |
1931 | 1933 | | |
1932 | 1934 | | |
1933 | 1935 | | |
| |||
1983 | 1985 | | |
1984 | 1986 | | |
1985 | 1987 | | |
1986 | | - | |
| 1988 | + | |
1987 | 1989 | | |
1988 | 1990 | | |
1989 | 1991 | | |
| |||
1995 | 1997 | | |
1996 | 1998 | | |
1997 | 1999 | | |
1998 | | - | |
| 2000 | + | |
1999 | 2001 | | |
2000 | 2002 | | |
2001 | 2003 | | |
| |||
2010 | 2012 | | |
2011 | 2013 | | |
2012 | 2014 | | |
2013 | | - | |
| 2015 | + | |
2014 | 2016 | | |
2015 | | - | |
| 2017 | + | |
2016 | 2018 | | |
2017 | 2019 | | |
2018 | 2020 | | |
2019 | | - | |
| 2021 | + | |
2020 | 2022 | | |
2021 | 2023 | | |
2022 | 2024 | | |
| |||
0 commit comments