From dcf5cbbf6a45785d54af998f3d0489132d07891d Mon Sep 17 00:00:00 2001 From: Chris Allegretta Date: Fri, 27 Nov 2009 05:09:56 +0000 Subject: [PATCH] * rcfile.c (parse_rcfile), initialize size argument to getline(), fixes crash on FreeBSD reported by Eitan Adler . git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4445 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 2 ++ src/rcfile.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 863c1fbf..968de818 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2009-11-26 Chris Allegretta * winio.c (edit_scroll): Adjust for long lines when scrolling. + * rcfile.c (parse_rcfile), initialize size argument to getline(), fixes crash on FreeBSD + reported by Eitan Adler . 2009-11-26 Jordi Mallach * doc/man/*: Update all man pages to escape unescapred hyphens. diff --git a/src/rcfile.c b/src/rcfile.c index 2bd67a67..4aa5894f 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -892,7 +892,7 @@ void parse_rcfile(FILE *rcstream { char *buf = NULL; ssize_t len; - size_t n; + size_t n = 0; while ((len = getline(&buf, &n, rcstream)) > 0) { char *ptr, *keyword, *option; -- 2.39.5