diff options
author | Omar Polo <op@omarpolo.com> | 2021-02-04 20:04:12 +0000 |
---|---|---|
committer | Omar Polo <op@omarpolo.com> | 2021-02-04 20:04:12 +0000 |
commit | 709f4c94471b5b910557420ab9bddb677c229100 (patch) | |
tree | c4a9dceffc8e98acea506b0a938ee4d89f2fe40a | |
parent | 102d2e9cce03e15fa001f4ee80862803c430b81a (diff) |
alter the string, don't advance pointer
if we advance the pointer, we crash during reload due to an invalid
address given to free. altering the string is the way.
-rw-r--r-- | parse.y | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -115,10 +115,10 @@ servopt : TCERT TSTRING { host->cert = ensure_absolute_path($2); } | TKEY TSTRING { host->key = ensure_absolute_path($2); } | TROOT TSTRING { host->dir = ensure_absolute_path($2); } | TCGI TSTRING { - host->cgi = $2; /* drop the starting '/', if any */ - if (*host->cgi == '/') - host->cgi++; + if (*$2 == '/') + memmove($2, $2+1, strlen($2)); + host->cgi = $2; } | locopt ; |