summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhenning <henning@openbsd.org>2003-04-09 11:23:58 +0000
committerhenning <henning@openbsd.org>2003-04-09 11:23:58 +0000
commit042db5a654000bf6c4e23de80726e7f68628a5c1 (patch)
tree10cc9d701e1b6bcd58d03e821bbcb83635eb6657
parentadd strl{cat,cpy} to unbreak "make build" on sparc64 (diff)
downloadwireguard-openbsd-042db5a654000bf6c4e23de80726e7f68628a5c1.tar.xz
wireguard-openbsd-042db5a654000bf6c4e23de80726e7f68628a5c1.zip
more string shit, ok bob and vincent
-rw-r--r--usr.sbin/httpd/src/ap/ap_snprintf.c7
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)