瀏覽代碼

src/common/util.c:expand_filename() - Perhaps use GetFullPathName() as a form of input validation on the filename argument.

Jeremy 8 年之前
父節點
當前提交
4e19133dcc
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/common/util.c

+ 3 - 0
src/common/util.c

@@ -2873,6 +2873,9 @@ expand_filename(const char *filename)
 {
   tor_assert(filename);
 #ifdef _WIN32
+  /* Might consider using GetFullPathName() as described here:
+   * http://etutorials.org/Programming/secure+programming/Chapter+3.+Input+Validation/3.7+Validating+Filenames+and+Paths/
+   */
   return tor_strdup(filename);
 #else
   if (*filename == '~') {