1
0
Fork 1

autoindex: fix off-by-one buffer size

This commit is contained in:
Zach DeCook 2020-12-27 08:00:15 -05:00 committed by Drew DeVault
parent eac874b925
commit fbef1d34a1
1 changed files with 1 additions and 0 deletions

View File

@ -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;