Re: configfile.c:63:14: warning: array subscript is above array [-Warray-bounds]

2013-06-04 Thread Jason A. Donenfeld
Here is the function in question: static int read_config_line(FILE *f, char *line, const char **value, int bufsize) { int i = 0, isname = 0; *value = NULL; while (i bufsize - 1) { int c = next_char(f); if (!isname (c == '#' || c == ';'))

[PATCH] Use strbuf for reading configuration files

2013-06-04 Thread Lukas Fleischer
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.

Re: [PATCH] Use strbuf for reading configuration files

2013-06-04 Thread Lukas Fleischer
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

Re: [PATCH] Use strbuf for reading configuration files

2013-06-04 Thread Jason A. Donenfeld
Looks mostly okay. While you're at it, what about fixing the BUG mentioned at the bottom of cgitrc.5.txt? ___ CGit mailing list CGit@lists.zx2c4.com http://lists.zx2c4.com/mailman/listinfo/cgit