Browse Source

Fixed possible truncation

Piotr Czajkowski 4 years ago
parent
commit
7d1ab5e703
1 changed files with 1 additions and 1 deletions
  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;