mirror of
https://github.com/apache/httpd.git
synced 2026-01-06 09:01:14 +03:00
Fortify complains about an overflow of pad[], which would
require a mongo argv[0]. Get the vprintf formatter to handle the padding and avoid creating the padding altogether. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@987339 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -331,37 +331,32 @@ static process_rec *init_process(int *argc, const char * const * *argv)
|
||||
static void usage(process_rec *process)
|
||||
{
|
||||
const char *bin = process->argv[0];
|
||||
char pad[MAX_STRING_LEN];
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < strlen(bin); i++) {
|
||||
pad[i] = ' ';
|
||||
}
|
||||
|
||||
pad[i] = '\0';
|
||||
int pad_len = strlen(bin);
|
||||
|
||||
ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
|
||||
"Usage: %s [-D name] [-d directory] [-f file]", bin);
|
||||
|
||||
ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
|
||||
" %s [-C \"directive\"] [-c \"directive\"]", pad);
|
||||
" %*s [-C \"directive\"] [-c \"directive\"]", pad_len, " ");
|
||||
|
||||
#ifdef WIN32
|
||||
ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
|
||||
" %s [-w] [-k start|restart|stop|shutdown] [-n service_name]", pad);
|
||||
" %*s [-w] [-k start|restart|stop|shutdown] [-n service_name]",
|
||||
pad_len, " ");
|
||||
ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
|
||||
" %s [-k install|config|uninstall] [-n service_name]",
|
||||
pad);
|
||||
" %*s [-k install|config|uninstall] [-n service_name]",
|
||||
pad_len, " ");
|
||||
#else
|
||||
/* XXX not all MPMs support signalling the server in general or graceful-stop
|
||||
* in particular
|
||||
*/
|
||||
ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
|
||||
" %s [-k start|restart|graceful|graceful-stop|stop]",
|
||||
pad);
|
||||
" %*s [-k start|restart|graceful|graceful-stop|stop]",
|
||||
pad_len, " ");
|
||||
#endif
|
||||
ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
|
||||
" %s [-v] [-V] [-h] [-l] [-L] [-t] [-T] [-S] [-X]", pad);
|
||||
" %*s [-v] [-V] [-h] [-l] [-L] [-t] [-T] [-S] [-X]",
|
||||
pad_len, " ");
|
||||
ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
|
||||
"Options:");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user