From: Chris Allegretta Date: Fri, 27 Nov 2009 05:09:56 +0000 (+0000) Subject: * rcfile.c (parse_rcfile), initialize size argument to getline(), fixes crash on... X-Git-Tag: v2.2.0~5 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=dcf5cbbf6a45785d54af998f3d0489132d07891d;p=nano.git * 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 --- 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;