Explorar o código

Fixed possible truncation

Piotr Czajkowski %!s(int64=5) %!d(string=hai) anos
pai
achega
7d1ab5e703
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      pwned.c

+ 1 - 1
pwned.c

@@ -11,7 +11,7 @@
 char *getURL(const char* hash) {
 	const char *baseURL = "https://api.pwnedpasswords.com/range/";
 	char *url = calloc(URL_SIZE, 1);
-	strncpy(url, baseURL, strlen(baseURL));
+	strncpy(url, baseURL, strlen(baseURL)+1);
 	strncat(url, hash, HASH_PREFIX_SIZE);
 
 	return url;