ctcm: avoid wraparound in length of incoming data