Skip to content
Commit a9acd88a authored by Florian Weimer's avatar Florian Weimer
Browse files

gconv: Fix assertion failure in ISO-2022-JP-3 module (bug 27256)



The conversion loop to the internal encoding does not follow
the interface contract that __GCONV_FULL_OUTPUT is only returned
after the internal wchar_t buffer has been filled completely.  This
is enforced by the first of the two asserts in iconv/skeleton.c:

	      /* We must run out of output buffer space in this
		 rerun.  */
	      assert (outbuf == outerr);
	      assert (nstatus == __GCONV_FULL_OUTPUT);

This commit solves this issue by queuing a second wide character
which cannot be written immediately in the state variable, like
other converters already do (e.g., BIG5-HKSCS or TSCII).

Reported-by: default avatarTavis Ormandy <taviso@gmail.com>
(cherry picked from commit 7d88c614)
parent 1864775a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment