View | Details | Raw Unified | Return to bug 884 | Differences between
and this patch

Collapse All | Expand All

(-)authfile.c (-1 / +11 lines)
Lines 598-609 static int Link Here
598
key_try_load_public(Key *k, const char *filename, char **commentp)
598
key_try_load_public(Key *k, const char *filename, char **commentp)
599
{
599
{
600
	FILE *f;
600
	FILE *f;
601
	char line[4096];
601
	char line[8192];
602
	char *cp;
602
	char *cp;
603
	int c, lineno = 0;
603
604
604
	f = fopen(filename, "r");
605
	f = fopen(filename, "r");
605
	if (f != NULL) {
606
	if (f != NULL) {
606
		while (fgets(line, sizeof(line), f)) {
607
		while (fgets(line, sizeof(line), f)) {
608
			lineno++;
609
			if (line[strlen(line) - 1] != '\n') {
610
				error("Excessively long line in %s line %d",
611
				    filename, lineno);
612
				/* discard remainder of line */
613
				while ((c = fgetc(f) != EOF) && c != '\n')
614
					;	/* nothing */
615
				break;
616
			}
607
			line[sizeof(line)-1] = '\0';
617
			line[sizeof(line)-1] = '\0';
608
			cp = line;
618
			cp = line;
609
			switch (*cp) {
619
			switch (*cp) {

Return to bug 884