On Tue, Jun 04, 2013 at 04:47:53PM +0200, Lukas Fleischer wrote: > Use struct strbuf from Git instead of fixed-size buffers to remove the > limit on the length of configuration file lines and refactor > read_config_line() to improve readability. > > Note that this also fixes a buffer overflow that existed with the > original fixed-size buffer implementation. > > Signed-off-by: Lukas Fleischer <[email protected]> > --- > configfile.c | 65 > ++++++++++++++++++++++++++++++------------------------------ > configfile.h | 2 ++ > 2 files changed, 35 insertions(+), 32 deletions(-) > > diff --git a/configfile.c b/configfile.c > index d98989c..e6ad1d6 100644 > --- a/configfile.c > +++ b/configfile.c > @@ -31,45 +31,44 @@ static void skip_line(FILE *f) > [...] > + /* Skip comments and preceding spaces. */ > + while (c == '#' || c == ';') { > + skip_line(f); > + c = next_char(f); > + } > + while (isspace(c)) > + c = next_char(f);
Just noticed that this no longer detects indented comments. Not sure if it makes sense to accept these (since we already only allow full fill-line comments) but given that no longer allowing them is probably considered a regression I will amend the patch and resubmit as far and as soon as there aren't any other comments. > + > + /* Read variable name. */ > [...] _______________________________________________ CGit mailing list [email protected] http://lists.zx2c4.com/mailman/listinfo/cgit
