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
fd884c6b
Commit
fd884c6b
authored
May 28, 2022
by
David Kilzer
Browse files
Fix integer overflow in xmlBufferDump()
* tree.c: (xmlBufferDump): - Cap the return value to INT_MAX.
parent
fe9f76eb
Pipeline
#402483
passed with stage
in 4 minutes and 51 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
tree.c
View file @
fd884c6b
...
...
@@ -7413,7 +7413,7 @@ xmlBufferGrow(xmlBufferPtr buf, unsigned int len) {
*/
int
xmlBufferDump
(
FILE
*
file
,
xmlBufferPtr
buf
)
{
in
t
ret
;
size_
t
ret
;
if
(
buf
==
NULL
)
{
#ifdef DEBUG_BUFFER
...
...
@@ -7432,7 +7432,7 @@ xmlBufferDump(FILE *file, xmlBufferPtr buf) {
if
(
file
==
NULL
)
file
=
stdout
;
ret
=
fwrite
(
buf
->
content
,
sizeof
(
xmlChar
),
buf
->
use
,
file
);
return
(
ret
);
return
(
ret
>
INT_MAX
?
INT_MAX
:
(
int
)
ret
);
}
/**
...
...
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