]> git.saurik.com Git - cycript.git/commitdiff
Throw (don't crash) on parsing invalid specific ids.
authorJay Freeman (saurik) <saurik@saurik.com>
Fri, 14 Sep 2012 14:15:30 +0000 (07:15 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Fri, 14 Sep 2012 14:18:33 +0000 (07:18 -0700)
sig/parse.cpp

index 51782d2f98f0175c6dffcb22a42e1a75093bc240..dfe7d73879cb3ab306acbfd1549d85313974da04 100644 (file)
@@ -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;
                     }