diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c index ea8fdf2ef..e9bfa9de9 100644 --- a/libdm/libdm-stats.c +++ b/libdm/libdm-stats.c @@ -1009,7 +1009,7 @@ static int _stats_parse_list(struct dm_stats *dms, const char *resp) * dm_task_get_message_response() returns a 'const char *' but * since fmemopen also permits "w" it expects a 'char *'. */ - if (!(list_rows = fmemopen((char *)resp, strlen(resp) + 1, "r"))) + if (!(list_rows = fmemopen((char *)resp, strlen(resp), "r"))) return_0; /* begin region table */ @@ -1240,7 +1240,7 @@ static int _stats_parse_region(struct dm_stats *dms, const char *resp, * dm_task_get_message_response() returns a 'const char *' but * since fmemopen also permits "w" it expects a 'char *'. */ - stats_rows = fmemopen((char *)resp, strlen(resp) + 1, "r"); + stats_rows = fmemopen((char *)resp, strlen(resp), "r"); if (!stats_rows) goto_bad;