summaryrefslogtreecommitdiff
path: root/server_http.c
diff options
context:
space:
mode:
authorReyk Floeter <reyk@esdenera.com>2015-01-18 15:07:18 +0100
committerReyk Floeter <reyk@esdenera.com>2015-01-18 15:07:18 +0100
commit56cddace6a66b505f8e47b7117290ab1214aa84a (patch)
tree4ac8affa66b5811f8791c3c371dc05c8d3c8cbc9 /server_http.c
parentfaa9e65a23cdb2e3971b36d7a22fb9d04dabb52c (diff)
downloadhttpd-56cddace6a66b505f8e47b7117290ab1214aa84a.tar.gz
httpd-56cddace6a66b505f8e47b7117290ab1214aa84a.zip
sync with -current:
Replace <sys/param.h> with <limits.h> and other less dirty headers where possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
Diffstat (limited to 'server_http.c')
-rw-r--r--server_http.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/server_http.c b/server_http.c
index b0ae73d..c5dd4ab 100644
--- a/server_http.c
+++ b/server_http.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: server_http.c,v 1.62 2015/01/06 17:48:04 reyk Exp $ */
+/* $OpenBSD: server_http.c,v 1.64 2015/01/16 06:40:17 deraadt Exp $ */
/*
- * Copyright (c) 2006 - 2014 Reyk Floeter <reyk@openbsd.org>
+ * Copyright (c) 2006 - 2015 Reyk Floeter <reyk@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -34,6 +34,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
#include <stdio.h>
#include <err.h>
#include <pwd.h>
@@ -571,7 +572,7 @@ server_http_time(time_t t, char *tmbuf, size_t len)
const char *
server_http_host(struct sockaddr_storage *ss, char *buf, size_t len)
{
- char hbuf[MAXHOSTNAMELEN];
+ char hbuf[HOST_NAME_MAX+1];
in_port_t port;
if (print_host(ss, buf, len) == NULL)
@@ -768,8 +769,8 @@ server_close_http(struct client *clt)
int
server_response(struct httpd *httpd, struct client *clt)
{
- char path[MAXPATHLEN];
- char hostname[MAXHOSTNAMELEN];
+ char path[PATH_MAX];
+ char hostname[HOST_NAME_MAX+1];
struct http_descriptor *desc = clt->clt_descreq;
struct http_descriptor *resp = clt->clt_descresp;
struct server *srv = clt->clt_srv;