forked from aniani/gmnisrv
autoindex: fix off-by-one buffer size
This commit is contained in:
parent
eac874b925
commit
fbef1d34a1
@ -96,6 +96,7 @@ serve_autoindex(struct gmnisrv_client *client, const char *path)
|
|||||||
|
|
||||||
qsort(names, nameln, sizeof(names[0]), namecmp);
|
qsort(names, nameln, sizeof(names[0]), namecmp);
|
||||||
|
|
||||||
|
bufsz++; // buffer needs to have room for the \0.
|
||||||
FILE *buf = fmemopen(NULL, bufsz, "w+");
|
FILE *buf = fmemopen(NULL, bufsz, "w+");
|
||||||
if (!buf) {
|
if (!buf) {
|
||||||
goto internal_error;
|
goto internal_error;
|
||||||
|
Loading…
Reference in New Issue
Block a user