diff options
author | Roger Dingledine <arma@torproject.org> | 2007-10-16 03:26:39 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2007-10-16 03:26:39 +0000 |
commit | 5aa76cdaa81ac830a6133ca8aa8c23e1b671058d (patch) | |
tree | 4b6004878d952ab42e5fd073da0c222f26aab99f /src | |
parent | dbdaa610eeeb61ddd10068089efdfe0a97321b57 (diff) | |
download | tor-5aa76cdaa81ac830a6133ca8aa8c23e1b671058d.tar.gz tor-5aa76cdaa81ac830a6133ca8aa8c23e1b671058d.zip |
Correctly check for bad options to the "PublishServerDescriptor"
config option. Bugfix on 0.2.0.1-alpha; reported by Matt Edman.
svn:r11968
Diffstat (limited to 'src')
-rw-r--r-- | src/or/config.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/or/config.c b/src/or/config.c index 0bf88b2e44..f5a521e094 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -2391,9 +2391,8 @@ ensure_bandwidth_cap(uint64_t *value, const char *desc, char **msg) /** Parse an authority type from <b>list</b> and write it to *<b>auth</b>. If * <b>compatible</b> is non-zero, treat "1" as "v1,v2" and treat "0" as "". - * Return 0 on success or -(idx of first bad member) if not a recognized - * authority type. - */ + * Return 0 on success or -1 if not a recognized authority type (in which + * case the value of *<b>auth</b> is undefined). */ static int parse_authority_type_from_list(smartlist_t *list, authority_type_t *auth, int compatible) @@ -2418,7 +2417,7 @@ parse_authority_type_from_list(smartlist_t *list, authority_type_t *auth, else if (!strcasecmp(string, "") || (compatible && !strcmp(string, "0"))) /* no authority */; else - return - string_sl_idx; + return -1; }); return 0; } |