diff options
author | djm <djm> | 2007-01-05 05:24:47 +0000 |
---|---|---|
committer | djm <djm> | 2007-01-05 05:24:47 +0000 |
commit | e2e863e3f47830a6a51c064f77cf2ed5feaa0d8e (patch) | |
tree | 90d3be7fb2ef686c93287a952145686c5162f141 /misc.c | |
parent | e805e7c040578acd4286c763eea90e0aacdcc711 (diff) | |
download | openssh-e2e863e3f47830a6a51c064f77cf2ed5feaa0d8e.tar.gz |
- ray@cvs.openbsd.org 2006/11/23 01:35:11
[misc.c sftp.c]
Don't access buf[strlen(buf) - 1] for zero-length strings.
``ok by me'' djm@.
Diffstat (limited to 'misc.c')
-rw-r--r-- | misc.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.64 2006/08/03 03:34:42 deraadt Exp $ */ +/* $OpenBSD: misc.c,v 1.65 2006/11/23 01:35:11 ray Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * Copyright (c) 2005,2006 Damien Miller. All rights reserved. @@ -616,6 +616,8 @@ read_keyfile_line(FILE *f, const char *filename, char *buf, size_t bufsz, u_long *lineno) { while (fgets(buf, bufsz, f) != NULL) { + if (buf[0] == '\0') + continue; (*lineno)++; if (buf[strlen(buf) - 1] == '\n' || feof(f)) { return 0; |