X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=hivex%2Fhivex.c;h=b20fe732d2117940495a9a26610e712688a51c2e;hp=4fa3b301608e8ddbfe6e13fa90b445329827336e;hb=9299f25cd277d5481cae2ed8dcd8789417df9f53;hpb=f95c697a44c321dd1d370620515aa71a71a4ad5b diff --git a/hivex/hivex.c b/hivex/hivex.c index 4fa3b30..b20fe73 100644 --- a/hivex/hivex.c +++ b/hivex/hivex.c @@ -30,7 +30,6 @@ #include #include #include -#include #ifdef HAVE_ENDIAN_H #include #endif @@ -1033,9 +1032,12 @@ windows_utf16_to_utf8 (/* const */ char *input, size_t len) size_t r = iconv (ic, &inp, &inlen, &outp, &outlen); if (r == (size_t) -1) { if (errno == E2BIG) { + size_t prev = outalloc; /* Try again with a larger output buffer. */ free (out); outalloc *= 2; + if (outalloc < prev) + return NULL; goto again; } else {