X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=hivex%2Fhivex.c;h=ac463465c487b13bd2184314e954a6311bf8efd7;hb=a25d175cf6e8283288fd6d209b37b09ffee0dcf3;hp=4fa3b301608e8ddbfe6e13fa90b445329827336e;hpb=f95c697a44c321dd1d370620515aa71a71a4ad5b;p=libguestfs.git diff --git a/hivex/hivex.c b/hivex/hivex.c index 4fa3b30..ac46346 100644 --- a/hivex/hivex.c +++ b/hivex/hivex.c @@ -1033,9 +1033,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 {