]> git.proxmox.com Git - pve-cluster.git/commitdiff
pmxcfs: dcdb: fix returned pointer value:
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 2 Sep 2019 08:47:32 +0000 (10:47 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 2 Sep 2019 09:04:17 +0000 (11:04 +0200)
Commit 926f961f62f5 used a new temporary pointer variable
for type correctness, but the return value was still using
the previous variable which had not been moved forward
anymore.

Fixes: 926f961f62f5 ("pmxcfs dcdb: fix pointer void* aritmethic")
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
data/src/dcdb.c

index f6b0f862fc137398031b15f84104d18d4c45b78d..df7538954b815581665414a6051f094b3e90d900 100644 (file)
@@ -185,7 +185,7 @@ dcdb_parse_fuse_message(
                return FALSE;
        }
 
-       uint8_t *msg_ptr = (uint8_t *) msg;
+       const uint8_t *msg_ptr = msg;
 
        *size = *((guint32 *)msg_ptr);
        msg_ptr += 4; msg_len -= 4;
@@ -233,7 +233,7 @@ dcdb_parse_fuse_message(
                *to = NULL;
        }
 
-       *buf = (*size) ? msg : NULL;
+       *buf = (*size) ? (const char*)msg_ptr : NULL;
 
        return TRUE;
 }