merge cm-10.1 changes: recovery.c: Fix the potential segmentation fault: Extral newline can trigger recovery segmentation fault