Skip to content

Commit 73d104f

Browse files
ggouaillardetjsquyres
authored andcommitted
hwloc/base: fix some off-by-one errors
Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
1 parent f22b7d4 commit 73d104f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

opal/mca/hwloc/base/hwloc_base_dt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ int opal_hwloc_unpack(opal_buffer_t *buffer, void *dest,
9898
free(xmlbuffer);
9999
goto cleanup;
100100
}
101-
if (0 != hwloc_topology_set_xmlbuffer(t, xmlbuffer, strlen(xmlbuffer))) {
101+
if (0 != hwloc_topology_set_xmlbuffer(t, xmlbuffer, strlen(xmlbuffer)+1)) {
102102
rc = OPAL_ERROR;
103103
free(xmlbuffer);
104104
hwloc_topology_destroy(t);

opal/mca/hwloc/base/hwloc_base_util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ int opal_hwloc_base_get_topology(void)
371371
free(val);
372372
return OPAL_ERROR;
373373
}
374-
if (0 != hwloc_topology_set_xmlbuffer(opal_hwloc_topology, val, strlen(val))) {
374+
if (0 != hwloc_topology_set_xmlbuffer(opal_hwloc_topology, val, strlen(val)+1)) {
375375
free(val);
376376
hwloc_topology_destroy(opal_hwloc_topology);
377377
return OPAL_ERROR;

0 commit comments

Comments
 (0)