nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 90b959a6777c01c52d76203fb4e95bc8c5c0af01
parent 116d9e6f01546c53b545e2efb900bf1f51cc67a0
Author: Benno Schulenberg <bensberg@justemail.net>
Date:   Wed, 21 Dec 2016 17:26:12 +0100

history: avoid crashing when the positionlog file is malformed

Diffstat:
Msrc/files.c | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/files.c b/src/files.c @@ -3192,7 +3192,11 @@ void load_poshistory(void) /* Find where the x index and line number are in the line. */ xptr = revstrstr(line, " ", line + read - 3); + if (xptr == NULL) + continue; lineptr = revstrstr(line, " ", xptr - 2); + if (lineptr == NULL) + continue; /* Now separate the three elements of the line. */ *(xptr++) = '\0';