소스 검색

Fix buffer overlow when checking hashed passwords

svn:r4308
Nick Mathewson 20 년 전
부모
커밋
9f24078452
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/or/control.c

+ 1 - 1
src/or/control.c

@@ -481,7 +481,7 @@ decode_hashed_password(char *buf, const char *hashed)
       }
       }
   }
   }
   if (buf)
   if (buf)
-    memcpy(buf, decoded, sizeof(decoded));
+    memcpy(buf, decoded, S2K_SPECIFIER_LEN+DIGEST_LEN);
   return 0;
   return 0;
 }
 }