summaryrefslogtreecommitdiff
path: root/authfile.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2008-05-26 09:39:18 +0000
committerColin Watson <cjwatson@debian.org>2008-05-26 09:39:18 +0000
commit086170cb0ab5c16d8bc17aff3f7abb7556794757 (patch)
tree0a41f5448096b46c0ae9cf684f2f6888d818e0e0 /authfile.c
parent9c33daab1ef2cdfc5b1a100e0a2b2a27005397af (diff)
Fix some buffer handling inconsistencies in ssh-vulnkey (thanks, Solar
Designer).
Diffstat (limited to 'authfile.c')
-rw-r--r--authfile.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/authfile.c b/authfile.c
index 9ab90e3c8..cffea2a6c 100644
--- a/authfile.c
+++ b/authfile.c
@@ -719,13 +719,13 @@ blacklisted_key_in_file(const Key *key, const char *blacklist_file)
719 ssize_t r; 719 ssize_t r;
720 char *newline; 720 char *newline;
721 721
722 r = atomicio(read, fd, buf, 256); 722 r = atomicio(read, fd, buf, sizeof(buf));
723 if (r <= 0) 723 if (r <= 0)
724 goto out; 724 goto out;
725 if (buf[0] != '#') 725 if (buf[0] != '#')
726 break; 726 break;
727 727
728 newline = memchr(buf, '\n', 256); 728 newline = memchr(buf, '\n', sizeof(buf));
729 if (!newline) 729 if (!newline)
730 goto out; 730 goto out;
731 start += newline + 1 - buf; 731 start += newline + 1 - buf;
@@ -741,7 +741,6 @@ blacklisted_key_in_file(const Key *key, const char *blacklist_file)
741 741
742 while (lower != upper) { 742 while (lower != upper) {
743 off_t cur; 743 off_t cur;
744 char buf[32];
745 int cmp; 744 int cmp;
746 745
747 cur = lower + (upper - lower) / 2; 746 cur = lower + (upper - lower) / 2;