Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
21fb9ca7
...
21fb9ca7326589a8ad8d0f2b5247e7a73ad62622
authored
2007-06-26 19:36:21 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(header_readline): Always nul-terminate the buffer.
1 parent
7aa6a66b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletions
mailbox/header.c
mailbox/header.c
View file @
21fb9ca
...
...
@@ -985,7 +985,7 @@ header_readline (mu_stream_t is, char *buffer, size_t buflen,
int
status
;
size_t
strsize
;
if
(
is
==
NULL
)
if
(
is
==
NULL
||
buflen
==
0
)
return
EINVAL
;
header
=
mu_stream_get_owner
(
is
);
...
...
@@ -1001,10 +1001,12 @@ header_readline (mu_stream_t is, char *buffer, size_t buflen,
}
strsize
=
MU_STR_SIZE
(
ent
->
nlen
,
ent
->
vlen
)
-
ent_off
;
buflen
--
;
/* Account for the terminating nul */
if
(
buflen
>
strsize
)
buflen
=
strsize
;
mu_hdrent_fixup
(
header
,
ent
);
memcpy
(
buffer
,
MU_HDRENT_NAME
(
header
,
ent
)
+
ent_off
,
buflen
);
buffer
[
buflen
]
=
0
;
mu_hdrent_unroll_fixup
(
header
,
ent
);
if
(
pnread
)
*
pnread
=
buflen
;
...
...
Please
register
or
sign in
to post a comment