aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-02-04 20:04:12 +0000
committerOmar Polo <op@omarpolo.com>2021-02-04 20:04:12 +0000
commit709f4c94471b5b910557420ab9bddb677c229100 (patch)
treec4a9dceffc8e98acea506b0a938ee4d89f2fe40a
parent102d2e9cce03e15fa001f4ee80862803c430b81a (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.y6
1 files changed, 3 insertions, 3 deletions
diff --git a/parse.y b/parse.y
index 35742c8..4e1bc4b 100644
--- a/parse.y
+++ b/parse.y
@@ -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
;