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
1e755594
...
1e75559474e8d8a062a4f869f6421e6dee181cd3
authored
2004-06-27 15:05:04 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(internal_icvt_read,copy_octal): Fixed memory allocation errors.
1 parent
fc577d5c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
mailbox/filter_iconv.c
mailbox/filter_iconv.c
View file @
1e75559
...
...
@@ -204,6 +204,7 @@ internal_icvt_read (stream_t stream, char *optr, size_t osize, size_t *pnbytes)
char
*
p
=
realloc
(
s
->
buf
,
s
->
bufsize
+
128
);
if
(
!
p
)
return
ENOMEM
;
s
->
buf
=
p
;
s
->
bufsize
+=
128
;
}
continue
;
...
...
@@ -255,7 +256,10 @@ copy_octal (struct icvt_stream *s, char *optr, size_t osize, size_t *pnbytes)
/* Try to reallocate temp buffer */
char
*
p
=
realloc
(
s
->
buf
,
rdcount
);
if
(
p
)
s
->
bufsize
=
rdcount
;
{
s
->
bufsize
=
rdcount
;
s
->
buf
=
p
;
}
else
rdcount
=
s
->
bufsize
;
}
...
...
@@ -279,7 +283,7 @@ copy_octal (struct icvt_stream *s, char *optr, size_t osize, size_t *pnbytes)
{
if
(
ISPRINT
(
*
(
unsigned
char
*
)(
s
->
buf
+
i
)))
optr
[
j
++
]
=
s
->
buf
[
i
];
else
if
(
j
+
4
>=
s
->
bufpos
)
else
if
(
j
+
4
>=
osize
)
break
;
else
{
...
...
Please
register
or
sign in
to post a comment