Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
GNOME
libxml2
Commits
69f04562
Commit
69f04562
authored
Aug 19, 2011
by
Daniel Veillard
Browse files
Fix an off by one error in encoding
this off by one error doesn't seems to reproduce on linux but the error is real.
parent
d7eb9b5d
Changes
1
Hide whitespace changes
Inline
Side-by-side
encoding.c
View file @
69f04562
...
...
@@ -1928,7 +1928,7 @@ xmlCharEncFirstLineInt(xmlCharEncodingHandler *handler, xmlBufferPtr out,
if
(
in
==
NULL
)
return
(
-
1
);
/* calculate space available */
written
=
out
->
size
-
out
->
use
;
written
=
out
->
size
-
out
->
use
-
1
;
/* count '\0' */
toconv
=
in
->
use
;
/*
* echo '<?xml version="1.0" encoding="UCS4"?>' | wc -c => 38
...
...
@@ -2059,7 +2059,7 @@ xmlCharEncInFunc(xmlCharEncodingHandler * handler, xmlBufferPtr out,
toconv
=
in
->
use
;
if
(
toconv
==
0
)
return
(
0
);
written
=
out
->
size
-
out
->
use
;
written
=
out
->
size
-
out
->
use
-
1
;
/* count '\0' */
if
(
toconv
*
2
>=
written
)
{
xmlBufferGrow
(
out
,
out
->
size
+
toconv
*
2
);
written
=
out
->
size
-
out
->
use
-
1
;
...
...
Write
Preview
Supports
Markdown
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