1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

libdm: fix invalid conversion

Previous commit missed to also add one to added 'len'.
This commit is contained in:
Zdenek Kabelac 2024-05-08 09:54:30 +02:00
parent 4dda6d1555
commit 2f3fcbd245
2 changed files with 4 additions and 4 deletions

View File

@ -1451,8 +1451,8 @@ struct node_op_parms {
static void _store_str(char **pos, char **ptr, const char *str) static void _store_str(char **pos, char **ptr, const char *str)
{ {
size_t len = strlen(str); size_t len = strlen(str) + 1;
memcpy(*pos, str, len + 1); memcpy(*pos, str, len);
*ptr = *pos; *ptr = *pos;
*pos += len; *pos += len;
} }

View File

@ -1449,8 +1449,8 @@ struct node_op_parms {
static void _store_str(char **pos, char **ptr, const char *str) static void _store_str(char **pos, char **ptr, const char *str)
{ {
size_t len = strlen(str); size_t len = strlen(str) + 1;
memcpy(*pos, str, len + 1); memcpy(*pos, str, len);
*ptr = *pos; *ptr = *pos;
*pos += len; *pos += len;
} }