Ver código fonte

fix: string-bounds

Sam Jaffe 3 meses atrás
pai
commit
9ab9476d66
1 arquivos alterados com 1 adições e 1 exclusões
  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:")) {