sac: fixed incorrect handling of null-terminated header values