hwloc/base: fix some off-by-one errors
Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
(cherry picked from commit 73d104f695
)
Этот коммит содержится в:
родитель
788c92b1ce
Коммит
f79f14ad93
@ -96,7 +96,7 @@ int opal_hwloc_unpack(opal_buffer_t *buffer, void *dest,
|
||||
free(xmlbuffer);
|
||||
goto cleanup;
|
||||
}
|
||||
if (0 != hwloc_topology_set_xmlbuffer(t, xmlbuffer, strlen(xmlbuffer))) {
|
||||
if (0 != hwloc_topology_set_xmlbuffer(t, xmlbuffer, strlen(xmlbuffer)+1)) {
|
||||
rc = OPAL_ERROR;
|
||||
free(xmlbuffer);
|
||||
hwloc_topology_destroy(t);
|
||||
|
@ -364,7 +364,7 @@ int opal_hwloc_base_get_topology(void)
|
||||
free(val);
|
||||
return OPAL_ERROR;
|
||||
}
|
||||
if (0 != hwloc_topology_set_xmlbuffer(opal_hwloc_topology, val, strlen(val))) {
|
||||
if (0 != hwloc_topology_set_xmlbuffer(opal_hwloc_topology, val, strlen(val)+1)) {
|
||||
free(val);
|
||||
hwloc_topology_destroy(opal_hwloc_topology);
|
||||
return OPAL_ERROR;
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user