summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2018-10-16 19:13:34 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2018-10-16 21:34:23 +0200
commit6179cab877442aac884a0bfcd5c5541396980cdf (patch)
tree98c8e19df3c0cfcc518cb4db0a1537b2ba9cd54e
parent2217d6396aa6f6b8bc6421487ed6686d94668c2e (diff)
downloadlvm2-6179cab877442aac884a0bfcd5c5541396980cdf.tar.gz
revert "cov: dm stats missed terminating null"
This reverts commit 20971f7034cbd329f873e08869bfb7acf3f1ac0e as the parsing of 'dmstatus' started to fail on present \0 char.
-rw-r--r--libdm/libdm-stats.c4
1 files changed, 2 insertions, 2 deletions
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;