diff options
| author | Igor Zlatkovic <igor@src.gnome.org> | 2003-03-08 13:29:24 +0000 |
|---|---|---|
| committer | Igor Zlatkovic <igor@src.gnome.org> | 2003-03-08 13:29:24 +0000 |
| commit | 73267db52dc7917dbed341d874c7f45255e5b9ab (patch) | |
| tree | 622e88782a529dfde0ae1345dacaaeef0b0a8ef0 /encoding.c | |
| parent | 42f12e99d17a2979d26b6b2237b21a096c0e98b6 (diff) | |
| download | android_external_libxml2-73267db52dc7917dbed341d874c7f45255e5b9ab.tar.gz android_external_libxml2-73267db52dc7917dbed341d874c7f45255e5b9ab.tar.bz2 android_external_libxml2-73267db52dc7917dbed341d874c7f45255e5b9ab.zip | |
applied Gennady's patch against buffer overrun
Diffstat (limited to 'encoding.c')
| -rw-r--r-- | encoding.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -2194,6 +2194,9 @@ retry: written = out->size - out->use; + if (written > 0) + written--; /* Gennady: count '/0' */ + /* * First specific handling of in = NULL, i.e. the initialization call */ @@ -2202,8 +2205,10 @@ retry: if (handler->output != NULL) { ret = handler->output(&out->content[out->use], &written, NULL, &toconv); - out->use += written; - out->content[out->use] = 0; + if (ret == 0) { /* Gennady: check return value */ + out->use += written; + out->content[out->use] = 0; + } } #ifdef LIBXML_ICONV_ENABLED else if (handler->iconv_out != NULL) { |
