mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-07-26 22:11:46 +00:00
don't compare unsigned values as negative ones
Instead, check that the result is larger than its parts. Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com> Acked-by: Stéphane Graber <stgraber@ubuntu.com>
This commit is contained in:
parent
e97aa8176f
commit
69f97e3c12
@ -1645,12 +1645,13 @@ int setproctitle(char *title)
|
|||||||
env_start = env_end;
|
env_start = env_end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
arg_end = arg_start + len;
|
||||||
|
|
||||||
/* check overflow */
|
/* check overflow */
|
||||||
if (arg_start + len < 0) {
|
if (arg_end < len || arg_end < arg_start) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
arg_end = arg_start + len;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy((char*)arg_start, title);
|
strcpy((char*)arg_start, title);
|
||||||
|
Loading…
Reference in New Issue
Block a user