mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 10:16:41 +00:00
check_path_remap(): fix error checks
Naturally, checking strstr()+1 for NULL is useless. Reported by Coverity, CID 51594. Signed-off-by: Kir Kolyshkin <kir@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
e5654e586c
commit
faf07489f2
1 changed files with 3 additions and 3 deletions
|
|
@ -809,13 +809,13 @@ static int check_path_remap(struct fd_link *link, const struct fd_parms *parms,
|
|||
char *start, *end;
|
||||
|
||||
/* skip "./proc/" */
|
||||
start = strstr(rpath, "/") + 1;
|
||||
start = strstr(rpath, "/");
|
||||
if (!start)
|
||||
return -1;
|
||||
start = strstr(start, "/") + 1;
|
||||
start = strstr(start + 1, "/");
|
||||
if (!start)
|
||||
return -1;
|
||||
pid = strtol(start, &end, 10);
|
||||
pid = strtol(start + 1, &end, 10);
|
||||
|
||||
/* if we didn't find another /, this path something
|
||||
* like ./proc/kmsg, which we shouldn't mess with. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue