mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-23 18:19:39 +00:00
sockets: Add nr_icons member to track number of icons instead of zero ended array
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Acked-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
ff83500f5c
commit
b0e4a2edcd
1 changed files with 3 additions and 2 deletions
|
|
@ -51,6 +51,7 @@ struct unix_sk_desc {
|
|||
unsigned int wqlen;
|
||||
unsigned int namelen;
|
||||
char *name;
|
||||
unsigned int nr_icons;
|
||||
unsigned int *icons;
|
||||
};
|
||||
|
||||
|
|
@ -428,12 +429,12 @@ static int unix_collect_one(struct unix_diag_msg *m, struct rtattr **tb)
|
|||
if (tb[UNIX_DIAG_ICONS]) {
|
||||
int len = RTA_PAYLOAD(tb[UNIX_DIAG_ICONS]);
|
||||
|
||||
d->icons = xmalloc(len + sizeof(u32));
|
||||
d->icons = xmalloc(len);
|
||||
if (!d->icons)
|
||||
goto err;
|
||||
|
||||
memcpy(d->icons, RTA_DATA(tb[UNIX_DIAG_ICONS]), len);
|
||||
d->icons[len / sizeof(u32)] = 0;
|
||||
d->nr_icons = len / sizeof(u32);
|
||||
}
|
||||
|
||||
if (tb[UNIX_DIAG_RQLEN]) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue