1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-09 01:18:39 +03:00

revert "cov: dm stats missed terminating null"

This reverts commit 20971f7034
as the parsing of 'dmstatus' started to fail on present \0 char.

(cherry picked from commit 6179cab877)
This commit is contained in:
Zdenek Kabelac 2018-10-16 19:13:34 +02:00 committed by Marian Csontos
parent d1ae1455b4
commit b39c26ddc3

View File

@ -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;