commit | 26479dd0c71119056c6a69e4e509571707ecebc0 | [log] [tgz] |
---|---|---|
author | natalie.chen <natalie.chen@mediatek.com> | Tue Dec 11 11:54:47 2018 +0800 |
committer | natalie.chen <natalie.chen@mediatek.com> | Tue Dec 11 11:54:47 2018 +0800 |
tree | aadf7a1ef0c0a2e8a2f1536210a62b3d07456779 | |
parent | 21014c4c7e6f07a91a5339ee715aa2316f6c9868 [diff] |
fix segmentation fault for urls containing '~' right after first depth of path, e.g. '/test~test'
diff --git a/src/backend.c b/src/backend.c index 0ab73b6..c219747 100644 --- a/src/backend.c +++ b/src/backend.c
@@ -283,9 +283,11 @@ } } else if (c == '~') { - memcpy(buf + buflen, p, end - p); - buflen += (end - p); - break; + if (orig_start != start) { + memcpy(buf + buflen, p, end - p); + buflen += (end - p); + break; + } } end++; }