diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2018-10-16 19:13:34 +0200 |
---|---|---|
committer | Marian Csontos <mcsontos@redhat.com> | 2019-03-05 12:15:16 +0100 |
commit | b39c26ddc335e308c10777ea423f341cb9e783b8 (patch) | |
tree | a883c23ebbe1dfdd9fc03674d53f4492b0e8ffaf | |
parent | d1ae1455b48fb09c4530b3b823bf02df50450b18 (diff) | |
download | lvm2-b39c26ddc335e308c10777ea423f341cb9e783b8.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.
(cherry picked from commit 6179cab877442aac884a0bfcd5c5541396980cdf)
-rw-r--r-- | libdm/libdm-stats.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c index 479861ea2..6b4e3d81e 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; |