소스 검색

Fixed possible truncation

Piotr Czajkowski 5 년 전
부모
커밋
7d1ab5e703
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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;