diff options
author | Tobias Stoeckmann <tobias@cvs.openbsd.org> | 2008-08-11 17:17:54 +0000 |
---|---|---|
committer | Tobias Stoeckmann <tobias@cvs.openbsd.org> | 2008-08-11 17:17:54 +0000 |
commit | 95c7ff1f7e64cbcb098dadbad83784624dc4b5e3 (patch) | |
tree | cfe41e5dd2c4e9720688fe2c30b8d388f1efeda0 /libexec/fingerd | |
parent | 171bacba8597637933eae4f43391a09c1aa8c53c (diff) |
Prevent a buffer underrun if a line is received which only contains
(multiple) @.
ok millert, otto
Diffstat (limited to 'libexec/fingerd')
-rw-r--r-- | libexec/fingerd/fingerd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libexec/fingerd/fingerd.c b/libexec/fingerd/fingerd.c index 4848b158f5c..cecbbdd386c 100644 --- a/libexec/fingerd/fingerd.c +++ b/libexec/fingerd/fingerd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fingerd.c,v 1.33 2006/08/19 06:01:00 ray Exp $ */ +/* $OpenBSD: fingerd.c,v 1.34 2008/08/11 17:17:53 tobias Exp $ */ /* * Copyright (c) 1983, 1993 @@ -39,7 +39,7 @@ static char copyright[] = #if 0 static char sccsid[] = "from: @(#)fingerd.c 8.1 (Berkeley) 6/4/93"; #else -static char rcsid[] = "$OpenBSD: fingerd.c,v 1.33 2006/08/19 06:01:00 ray Exp $"; +static char rcsid[] = "$OpenBSD: fingerd.c,v 1.34 2008/08/11 17:17:53 tobias Exp $"; #endif #endif /* not lint */ @@ -167,7 +167,7 @@ main(int argc, char *argv[]) } len = strlen(*ap); - while ((*ap)[len - 1] == '@') + while (len > 0 && (*ap)[len - 1] == '@') (*ap)[--len] = '\0'; if (**ap == '\0') continue; |