Explorar el Código

Fixed possible truncation

Piotr Czajkowski hace 5 años
padre
commit
7d1ab5e703
Se han modificado 1 ficheros con 1 adiciones y 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;