Browse Source

<tup> tor segfaults when reading a config value that contains a malformed
escape sequence; this patch fixes it


svn:r13086

Roger Dingledine 16 years ago
parent
commit
8ba1ba7d81
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/common/util.c

+ 2 - 1
src/common/util.c

@@ -2060,7 +2060,8 @@ parse_config_line_from_str(const char *line, char **key_out, char **value_out)
 
   /* Find the end of the line. */
   if (*line == '\"') {
-    line = unescape_string(line, value_out, NULL);
+    if (!(line = unescape_string(line, value_out, NULL)))
+       return NULL;
     while (*line == ' ' || *line == '\t')
       ++line;
     if (*line && *line != '#' && *line != '\n')