commit fd39115905268f01383ad19aee3aabb772854b68 from: Stefan Sperling date: Tue Mar 28 09:54:20 2023 UTC fix an off-by-one in got_serve_parse_command() canonpath allocation ok op@, tracey@ commit - fdd6701019b668502be2d00e042b3f9932a78f36 commit + fd39115905268f01383ad19aee3aabb772854b68 blob - 14220632c56b0614a6dab68fe22981fd134183c8 blob + 8ef2f8a5f604c4672e7ef11adbba4c6af455fd18 --- lib/serve.c +++ lib/serve.c @@ -130,12 +130,12 @@ got_serve_parse_command(char **command, char **repo_pa goto done; } pathlen = strlen(abspath); - canonpath = malloc(pathlen); + canonpath = malloc(pathlen + 1); if (canonpath == NULL) { err = got_error_from_errno("malloc"); goto done; } - err = got_canonpath(abspath, canonpath, pathlen); + err = got_canonpath(abspath, canonpath, pathlen + 1); if (err) goto done;