From 506aad766e1ceb92a52895632248c67d4f388c4b Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Fri, 14 Sep 2012 07:15:30 -0700 Subject: [PATCH] Throw (don't crash) on parsing invalid specific ids. --- sig/parse.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sig/parse.cpp b/sig/parse.cpp index 51782d2..dfe7d73 100644 --- a/sig/parse.cpp +++ b/sig/parse.cpp @@ -117,7 +117,10 @@ struct Type *Parse_(apr_pool_t *pool, const char **name, char eos, bool named, C if (next == '"') { const char *quote = strchr(*name + 1, '"'); - if (!named || quote[1] == eos || quote[1] == '"') { + if (quote == NULL) { + printf("unterminated specific id type {%s}\n", *name - 10); + _assert(false); + } else if (!named || quote[1] == eos || quote[1] == '"') { type->name = apr_pstrmemdup(pool, *name + 1, quote - *name - 1); *name = quote + 1; } -- 2.47.2