sr: fix non-NULL terminated string overflow