diff options
author | Nick Wellnhofer <wellnhofer@aevum.de> | 2023-04-30 19:40:43 +0200 |
---|---|---|
committer | Nick Wellnhofer <wellnhofer@aevum.de> | 2023-04-30 21:45:39 +0200 |
commit | 550eaac605dc4029bc9eaa49ebfa8963545efee4 (patch) | |
tree | 6081182d922efe2a414c5700b037d26b03205c60 | |
parent | 2f12e3a938b0d8d38ddd56684f88940bfd6d7d30 (diff) | |
download | libxml2-550eaac605dc4029bc9eaa49ebfa8963545efee4.tar.gz |
writer: Add error check in xmlTextWriterEndDocument
-rw-r--r-- | xmlwriter.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/xmlwriter.c b/xmlwriter.c index 0de56e7c..569830cf 100644 --- a/xmlwriter.c +++ b/xmlwriter.c @@ -709,7 +709,11 @@ xmlTextWriterEndDocument(xmlTextWriterPtr writer) sum += count; } - sum += xmlTextWriterFlush(writer); + count = xmlTextWriterFlush(writer); + if (count < 0) + return -1; + sum += count; + return sum; } |