From: Sebastian Hahn Date: Tue, 27 Oct 2009 16:50:24 +0000 (+0100) Subject: Disallow command line keywords with more than two dashes as prefix. X-Git-Tag: tor-0.2.2.7-alpha~55^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f1b7295b27ba1f472304f2931bb23df6884b64e6;p=thirdparty%2Ftor.git Disallow command line keywords with more than two dashes as prefix. This might help fix cid 422, where coverity fails to notice that argv strings are null-escaped. --- diff --git a/src/or/config.c b/src/or/config.c index 5a0ced29d5..1b415ee7a2 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -1563,7 +1563,10 @@ config_get_commandlines(int argc, char **argv, config_line_t **result) *new = tor_malloc_zero(sizeof(config_line_t)); s = argv[i]; - while (*s == '-') + /* Each keyword may be prefixed with one or two dashes. */ + if (*s == '-') + s++; + if (*s == '-') s++; (*new)->key = tor_strdup(expand_abbrev(&options_format, s, 1, 1));