~sircmpwn/gmnisrv

fbef1d34a1abd2614f85afee415fe0f417038efe — Zach DeCook 3 years ago eac874b
autoindex: fix off-by-one buffer size
1 files changed, 1 insertions(+), 0 deletions(-)

M src/serve.c
M src/serve.c => src/serve.c +1 -0
@@ 96,6 96,7 @@ serve_autoindex(struct gmnisrv_client *client, const char *path)

	qsort(names, nameln, sizeof(names[0]), namecmp);

	bufsz++; // buffer needs to have room for the \0.
	FILE *buf = fmemopen(NULL, bufsz, "w+");
	if (!buf) {
		goto internal_error;