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

Collapse All | Expand All

(-)ssh-keygen.c (-2 / +10 lines)
Lines 308-314 do_convert_from_ssh2(struct passwd *pw) Link Here
308
	Key *k;
308
	Key *k;
309
	int blen;
309
	int blen;
310
	u_int len;
310
	u_int len;
311
	char line[1024], *p;
311
	char line[1024], *p, *q;
312
	u_char blob[8096];
312
	u_char blob[8096];
313
	char encoded[8096];
313
	char encoded[8096];
314
	struct stat st;
314
	struct stat st;
Lines 328-336 do_convert_from_ssh2(struct passwd *pw) Link Here
328
	}
328
	}
329
	encoded[0] = '\0';
329
	encoded[0] = '\0';
330
	while (fgets(line, sizeof(line), fp)) {
330
	while (fgets(line, sizeof(line), fp)) {
331
		if (!(p = strchr(line, '\n'))) {
331
		p = strchr(line, '\n');
332
		q = strchr(line, '\r');
333
		if (p == NULL && q == NULL) {
332
			fprintf(stderr, "input line too long.\n");
334
			fprintf(stderr, "input line too long.\n");
333
			exit(1);
335
			exit(1);
336
		} else {
337
			/* select earliest non-null line terminator */
338
			if (p == NULL)
339
				p = q;
340
			else if (q != NULL)
341
				p = MIN(p, q);
334
		}
342
		}
335
		if (p > line && p[-1] == '\\')
343
		if (p > line && p[-1] == '\\')
336
			escaped++;
344
			escaped++;

Return to bug 1157