Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
911c78b4
Commit
911c78b4
authored
Jan 28, 2004
by
Steven Tamm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unexecmacos.x (unexec_copy): Do not copy more than was requested (count)
to prevent overwriting during unexec.
parent
92c7831b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
src/ChangeLog
src/ChangeLog
+5
-0
src/unexmacosx.c
src/unexmacosx.c
+3
-1
No files found.
src/ChangeLog
View file @
911c78b4
2004-01-27 Steven Tamm <steventamm@mac.com>
* unexmacosx.c (unexec_copy): Do not copy more than was
requested to prevent overwriting during unexec.
2004-01-27 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
* process.c (sigchld_handler): Add comment about not calling malloc.
...
...
src/unexmacosx.c
View file @
911c78b4
...
...
@@ -192,6 +192,7 @@ static int
unexec_copy
(
off_t
dest
,
off_t
src
,
ssize_t
count
)
{
ssize_t
bytes_read
;
ssize_t
bytes_to_read
;
char
buf
[
UNEXEC_COPY_BUFSZ
];
...
...
@@ -203,7 +204,8 @@ unexec_copy (off_t dest, off_t src, ssize_t count)
while
(
count
>
0
)
{
bytes_read
=
read
(
infd
,
buf
,
UNEXEC_COPY_BUFSZ
);
bytes_to_read
=
count
>
UNEXEC_COPY_BUFSZ
?
UNEXEC_COPY_BUFSZ
:
count
;
bytes_read
=
read
(
infd
,
buf
,
bytes_to_read
);
if
(
bytes_read
<=
0
)
return
0
;
if
(
write
(
outfd
,
buf
,
bytes_read
)
!=
bytes_read
)
...
...
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