Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
criu
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhul
criu
Commits
935c8e75
Commit
935c8e75
authored
Dec 27, 2011
by
Cyrill Gorcunov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
net: sockets -- Use read_ptr_safe for magic number test
Signed-off-by:
Cyrill Gorcunov
<
gorcunov@openvz.org
>
parent
4432c644
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
sockets.c
sockets.c
+4
-3
No files found.
sockets.c
View file @
935c8e75
...
...
@@ -588,7 +588,7 @@ err:
static
int
prepare_unix_sockets
(
int
pid
)
{
int
usk_fd
,
ret
;
int
usk_fd
,
ret
=
-
1
;
u32
type
;
usk_fd
=
open_image_ro
(
FMT_FNAME_UNIXSK
,
pid
);
...
...
@@ -597,9 +597,9 @@ static int prepare_unix_sockets(int pid)
return
-
1
;
}
read
(
usk_fd
,
&
type
,
sizeof
(
type
)
);
read
_ptr_safe
(
usk_fd
,
&
type
,
err
);
if
(
type
!=
UNIXSK_MAGIC
)
{
pr_
perro
r
(
"%d: Bad unix sk file
\n
"
,
pid
);
pr_
er
r
(
"%d: Bad unix sk file
\n
"
,
pid
);
return
-
1
;
}
...
...
@@ -628,6 +628,7 @@ static int prepare_unix_sockets(int pid)
if
(
!
ret
)
ret
=
run_accept_jobs
();
err:
return
ret
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment