]> git.proxmox.com Git - pve-cluster.git/commitdiff
pmxcfs server: fix pointer void* aritmethic
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 29 Aug 2019 14:50:32 +0000 (16:50 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 29 Aug 2019 14:58:04 +0000 (16:58 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
data/src/server.c

index 900047fdc90483850502a709bab512f5c4ec9d79..6371edbfdf45309e9e8ecd6a0565c50ee7736080 100644 (file)
@@ -156,7 +156,7 @@ static int32_t s1_connection_closed_fn(
 
 static int32_t s1_msg_process_fn(
        qb_ipcs_connection_t *c,
-       void *data, 
+       void *data,
        size_t size)
 {
        struct qb_ipc_request_header *req_pt = 
@@ -217,7 +217,7 @@ static int32_t s1_msg_process_fn(
                        /* make sure name is 0 terminated */
                        rh->name[sizeof(rh->name) - 1] = 0;
 
-                       char *dataptr = data + sizeof(cfs_status_update_request_header_t);
+                       char *dataptr = (char*) data + sizeof(cfs_status_update_request_header_t);
 
                        result = cfs_status_set(rh->name, dataptr, datasize);
                }
@@ -246,7 +246,7 @@ static int32_t s1_msg_process_fn(
                } else {
                        /* make sure path is 0 terminated */
                        ((char *)data)[request_size] = 0;
-                       char *path = data + sizeof(struct qb_ipc_request_header);
+                       char *path = (char*) data + sizeof(struct qb_ipc_request_header);
 
                        if (ctx->read_only &&  path_is_private(path)) {
                                result = -EPERM;
@@ -306,7 +306,7 @@ static int32_t s1_msg_process_fn(
                } else {
                        /* make sure user string is 0 terminated */
                        ((char *)data)[request_size] = 0;
-                       char *user = data + sizeof(cfs_log_get_request_header_t);
+                       char *user = (char*) data + sizeof(cfs_log_get_request_header_t);
 
                        uint32_t max = rh->max_entries ?  rh->max_entries : 50;
                        cfs_cluster_log_dump(outbuf, user, max);