]> sourceware.org Git - lvm2.git/commitdiff
libdm: fix invalid conversion 1282874709
authorZdenek Kabelac <zkabelac@redhat.com>
Wed, 8 May 2024 07:54:30 +0000 (09:54 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Wed, 8 May 2024 08:16:01 +0000 (10:16 +0200)
Previous commit missed to also add one to added 'len'.

device_mapper/libdm-common.c
libdm/libdm-common.c

index ef5d72e530f2c713eede10b5a55fb2dcd075f23d..9856e6ebef74ba7cf726b02fb17c443085ecb082 100644 (file)
@@ -1451,8 +1451,8 @@ struct node_op_parms {
 
 static void _store_str(char **pos, char **ptr, const char *str)
 {
-       size_t len = strlen(str);
-       memcpy(*pos, str, len + 1);
+       size_t len = strlen(str) + 1;
+       memcpy(*pos, str, len);
        *ptr = *pos;
        *pos += len;
 }
index ab080a9116fe54b3c9f4a8da67a9a5c864104e96..48724b38f3dda1241cedb3d6b2bb4b21d08a85c6 100644 (file)
@@ -1449,8 +1449,8 @@ struct node_op_parms {
 
 static void _store_str(char **pos, char **ptr, const char *str)
 {
-       size_t len = strlen(str);
-       memcpy(*pos, str, len + 1);
+       size_t len = strlen(str) + 1;
+       memcpy(*pos, str, len);
        *ptr = *pos;
        *pos += len;
 }
This page took 0.044877 seconds and 5 git commands to generate.