소스 검색

fix: string-bounds

Sam Jaffe 3 달 전
부모
커밋
9ab9476d66
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      include/jvalidate/format.h

+ 1 - 1
include/jvalidate/format.h

@@ -272,7 +272,7 @@ template <typename CharT = char> inline bool email(std::basic_string_view<CharT>
   domain.remove_prefix(1);
   domain.remove_suffix(1);
 
-  std::string ip(domain.size() + 1, '\0'); // Re-acquiring the NULL terminator
+  std::string ip(domain.size(), '\0'); // Re-acquiring the NULL terminator
   std::ranges::copy(domain, ip.begin());
 
   if (ip.starts_with("IPv6:")) {