checkpath: fix allocation size of path buffer
strlen's return value isn't enough to be used directly for (x)malloc; it doesn't include the null byte at the end of the string. X-Gentoo-Bug: 816900 X-Gentoo-Bug-URL: https://bugs.gentoo.org/816900 Fixes: #459 Fixes: #462
This commit is contained in:
		@@ -151,7 +151,7 @@ static char *clean_path(char *path)
 | 
				
			|||||||
	char *ch;
 | 
						char *ch;
 | 
				
			||||||
	char *ch2;
 | 
						char *ch2;
 | 
				
			||||||
	char *str;
 | 
						char *str;
 | 
				
			||||||
	str = xmalloc(strlen(path));
 | 
						str = xmalloc(strlen(path) + 1);
 | 
				
			||||||
	ch = path;
 | 
						ch = path;
 | 
				
			||||||
	ch2 = str;
 | 
						ch2 = str;
 | 
				
			||||||
	while (true) {
 | 
						while (true) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user