INSIST rdata.length < 65536 before using it in a call to isc_buffer_putuint16.
I was not entirely sure that all paths to the places where the INSISTS are would have guaranteed that the unsigned int rdata.length was in the range of an unsigned short. Cast bitshifts to isc_uint8_t in encode_win32(); yes, dear compiler, we know there is a loss of precision. That's exactly what we want to happen here.
Showing with 6 additions and 6 deletions