Skip to content

Commit

Permalink
libxml violates the zlib interface and crashes
Browse files Browse the repository at this point in the history
* xmlIO.c: remove an abuse of zlib API and use a clean interface
  available in zlib >= 1.2.3
  • Loading branch information
madler authored and veillard committed Jan 19, 2010
1 parent 7304683 commit a7e79f2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions xmlIO.c
Original file line number Diff line number Diff line change
Expand Up @@ -2518,6 +2518,9 @@ __xmlParserInputBufferCreateFilename(const char *URI, xmlCharEncoding enc) {
#ifdef HAVE_ZLIB_H
if ((xmlInputCallbackTable[i].opencallback == xmlGzfileOpen) &&
(strcmp(URI, "-") != 0)) {
#if defined(ZLIB_VERNUM) && ZLIB_VERNUM >= 0x1230
ret->compressed = !gzdirect(context);
#else
if (((z_stream *)context)->avail_in > 4) {
char *cptr, buff4[4];
cptr = (char *) ((z_stream *)context)->next_in;
Expand All @@ -2529,6 +2532,7 @@ __xmlParserInputBufferCreateFilename(const char *URI, xmlCharEncoding enc) {
gzrewind(context);
}
}
#endif
}
#endif
}
Expand Down

0 comments on commit a7e79f2

Please sign in to comment.