Skip to content

Commit

Permalink
upstream: don't screw up ssh-keygen -l output when the file
Browse files Browse the repository at this point in the history
contains CR characters; GHPR236 bz3385, fix from Dmitry Belyavskiy

OpenBSD-Commit-ID: e458cf6b0adcea5b69ef4c7ba38e590841d02ef4
  • Loading branch information
djmdjm committed Dec 4, 2024
1 parent c0b03c2 commit 6993d9f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ssh-keygen.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $OpenBSD: ssh-keygen.c,v 1.476 2024/10/18 05:37:24 djm Exp $ */
/* $OpenBSD: ssh-keygen.c,v 1.477 2024/12/04 14:24:20 djm Exp $ */
/*
* Author: Tatu Ylonen <[email protected]>
* Copyright (c) 1994 Tatu Ylonen <[email protected]>, Espoo, Finland
Expand Down Expand Up @@ -1008,7 +1008,7 @@ do_fingerprint(struct passwd *pw)
while (getline(&line, &linesize, f) != -1) {
lnum++;
cp = line;
cp[strcspn(cp, "\n")] = '\0';
cp[strcspn(cp, "\r\n")] = '\0';
/* Trim leading space and comments */
cp = line + strspn(line, " \t");
if (*cp == '#' || *cp == '\0')
Expand Down

0 comments on commit 6993d9f

Please sign in to comment.