Commit f0e0ee7a authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

unix: fix calculation of pointers

CID 1141016 (#1 of 1): Extra sizeof expression (SIZEOF_MISMATCH)
suspicious_pointer_arithmetic: Adding "40UL /* sizeof (FilePermsEntry)
*/" to pointer "(FownEntry *)perms" of type "FownEntry *" is suspicious
because adding an integral value to this pointer automatically scales
that value by the size, 48 bytes, of the pointed-to type, "FownEntry".
Most likely, "sizeof (FilePermsEntry)" is extraneous and should be
replaced with 1.
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent a5bb3341
......@@ -158,9 +158,9 @@ static int dump_one_unix_fd(int lfd, u32 id, const struct fd_parms *p)
if (ue == NULL)
return -1;
skopts = (SkOptsEntry *) ue + sizeof(UnixSkEntry);
perms = (FilePermsEntry *) skopts + sizeof(SkOptsEntry);
fown = (FownEntry *) perms + sizeof(FilePermsEntry);
skopts = (void *) ue + sizeof(UnixSkEntry);
perms = (void *) skopts + sizeof(SkOptsEntry);
fown = (void *) perms + sizeof(FilePermsEntry);
unix_sk_entry__init(ue);
sk_opts_entry__init(skopts);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment