From 0d6328fa981afad1b3a6ff0ccb54a951eecf0fc3 Mon Sep 17 00:00:00 2001 From: "me@ow.nekobit.net" Date: Tue, 5 Apr 2022 22:50:04 +0000 Subject: [PATCH] Fix path / crash FossilOrigin-Name: babf8b543e34d304310ef1444e435ffb524ed651b5ef5f917f0fd00488e284a7 --- src/path.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/path.c b/src/path.c index 63faba2..ee34cfe 100644 --- a/src/path.c +++ b/src/path.c @@ -62,11 +62,25 @@ int parse_path(struct session* ssn, tmp = NULL; str_size = 0; } + else if (state == PARSE_NEUTRAL) { + if (p[j] == p2[i]) + break; + else { + fail = 1; + goto breakpt; + } + } if (fin) goto breakpt; break; case ':': state = PARSE_READ; + /* Abort early */ + if (p2[j] == '\0') + { + fail = 1; + goto breakpt; + } // fall default: if (state == PARSE_NEUTRAL)