From 1db88be4600befacab6adc2579291f8c0c000727 Mon Sep 17 00:00:00 2001 From: deraadt Date: Fri, 16 Jan 2015 06:39:28 +0000 Subject: Replace with and other less dirty headers where possible. Annotate 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) --- slowcgi.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/slowcgi.c b/slowcgi.c index fdf0cd9..44595bb 100644 --- a/slowcgi.c +++ b/slowcgi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: slowcgi.c,v 1.41 2014/12/08 12:12:46 blambert Exp $ */ +/* $OpenBSD: slowcgi.c,v 1.42 2015/01/16 06:40:20 deraadt Exp $ */ /* * Copyright (c) 2013 David Gwynne * Copyright (c) 2013 Florian Obser @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -118,7 +119,7 @@ struct request { struct fcgi_response_head response_head; struct fcgi_stdin_head stdin_head; uint16_t id; - char script_name[MAXPATHLEN]; + char script_name[PATH_MAX]; struct env_head env; int env_count; pid_t script_pid; @@ -745,11 +746,11 @@ parse_params(uint8_t *buf, uint16_t n, struct request *c, uint16_t id) n -= name_len; env_entry->val[name_len] = '\0'; - if (val_len < MAXPATHLEN && strcmp(env_entry->val, + if (val_len < PATH_MAX && strcmp(env_entry->val, "SCRIPT_NAME") == 0 && c->script_name[0] == '\0') { bcopy(buf, c->script_name, val_len); c->script_name[val_len] = '\0'; - } else if (val_len < MAXPATHLEN && strcmp(env_entry->val, + } else if (val_len < PATH_MAX && strcmp(env_entry->val, "SCRIPT_FILENAME") == 0) { bcopy(buf, c->script_name, val_len); c->script_name[val_len] = '\0'; -- cgit v1.2.3-2-gb3c3