merge r3076, r3080: fix segfault when a header starts with "\rX" and logging is set to info or debug level