Commit 69f97e3c by Tycho Andersen Committed by Stéphane Graber

don't compare unsigned values as negative ones

Instead, check that the result is larger than its parts. Signed-off-by: 's avatarTycho Andersen <tycho.andersen@canonical.com> Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
parent e97aa817
......@@ -1645,12 +1645,13 @@ int setproctitle(char *title)
env_start = env_end;
}
arg_end = arg_start + len;
/* check overflow */
if (arg_start + len < 0) {
if (arg_end < len || arg_end < arg_start) {
return -1;
}
arg_end = arg_start + len;
}
strcpy((char*)arg_start, title);
......
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