diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2007-03-02 11:23:24 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2007-03-02 11:23:24 +0000 |
commit | bf48456242c54e46dc639b2de4c771a42c253a7d (patch) | |
tree | df01cdf725c20b15d3269acea94e1c3e93b9ca24 /sbin | |
parent | d6931dd72406e85bf2d7968d8c555b97e4c532a3 (diff) |
If a syntax error is found past 80 columns, parse_warn accessed memory
outside of the `spaces' array when trying to print the caret marker
found by "Matthew R. Dempsky" <mrd@alkemio.org>, fix inspired by
a.velichinsky@gmail.com. discussed with krw
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/dhclient/errwarn.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sbin/dhclient/errwarn.c b/sbin/dhclient/errwarn.c index 6c0fbefc380..d9aea61a9e4 100644 --- a/sbin/dhclient/errwarn.c +++ b/sbin/dhclient/errwarn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: errwarn.c,v 1.12 2005/07/09 14:36:15 krw Exp $ */ +/* $OpenBSD: errwarn.c,v 1.13 2007/03/02 11:23:23 henning Exp $ */ /* Errors and warnings... */ @@ -220,9 +220,8 @@ parse_warn(char *fmt, ...) #ifndef DEBUG syslog(LOG_ERR, "%s", mbuf); syslog(LOG_ERR, "%s", token_line); - if (lexline < 81) - syslog(LOG_ERR, - "%s^", &spaces[sizeof(spaces) - lexchar]); + if (lexchar < 81) + syslog(LOG_ERR, "%*c", lexchar, '^'); #endif if (log_perror) { |