diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2003-04-09 11:23:59 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2003-04-09 11:23:59 +0000 |
commit | ccf0be927849eb537ca282b2979027ec408513d5 (patch) | |
tree | ee80c20155da69569064d71df70914697898d3eb /usr.sbin | |
parent | 1992a8c590c3a14dc3ea142116a5a893aecb0432 (diff) |
more string shit, ok bob and vincent
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/httpd/src/ap/ap_snprintf.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/httpd/src/ap/ap_snprintf.c b/usr.sbin/httpd/src/ap/ap_snprintf.c index 3009e5237d8..880dab19388 100644 --- a/usr.sbin/httpd/src/ap/ap_snprintf.c +++ b/usr.sbin/httpd/src/ap/ap_snprintf.c @@ -513,7 +513,7 @@ static char *conv_sockaddr_in(struct sockaddr_in *si, char *buf_end, int *len) */ static char *conv_fp(register char format, register double num, boolean_e add_dp, int precision, bool_int *is_negative, - char *buf, int *len) + char *buf, int *len, int buflen) { register char *s = buf; register char *p; @@ -529,7 +529,7 @@ static char *conv_fp(register char format, register double num, * Check for Infinity and NaN */ if (ap_isalpha(*p)) { - *len = strlen(strcpy(buf, p)); + *len = strlcpy(buf, p, buflen); /* we really need the wanted len here */ *is_negative = FALSE; return (buf); } @@ -952,7 +952,8 @@ API_EXPORT(int) ap_vformatter(int (*flush_func)(ap_vformatter_buff *), { s = conv_fp(*fmt, fp_num, alternate_form, (adjust_precision == NO) ? FLOAT_DIGITS : precision, - &is_negative, &num_buf[1], &s_len); + &is_negative, &num_buf[1], &s_len, + sizeof(num_buf) - 1); if (is_negative) prefix_char = '-'; else if (print_sign) |