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.
This commit is contained in:
Sebastian Hahn 2009-10-27 17:50:24 +01:00
parent b0e8c33617
commit f1b7295b27

View File

@ -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));