[sr-dev] git:master:e241f7b8: kex: add additional safety checks for printing, based on PR #3250 from bensly-shanmugam