diff options
author | Bodo Möller <bodo@openssl.org> | 2001-03-31 07:48:07 +0000 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 2001-03-31 07:48:07 +0000 |
commit | 50b8ba02012df1e06f479339e3207efa1adc95c7 (patch) | |
tree | 4cedea6e47d95b91277fed6601fea1bdb8c65b49 /apps | |
parent | c9fd9152bd35ff48f1858eb1a4195ca02866ca9c (diff) |
avoid buffer overflow
Diffstat (limited to 'apps')
-rw-r--r-- | apps/s_server.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/s_server.c b/apps/s_server.c index 4223d2db1e..cd1aa17b26 100644 --- a/apps/s_server.c +++ b/apps/s_server.c @@ -1473,9 +1473,11 @@ static int www_body(char *hostname, int s, unsigned char *context) break; } +#if 0 /* append if a directory lookup */ if (e[-1] == '/') strcat(p,"index.html"); +#endif /* if a directory, do the index thang */ if (stat(p,&st_buf) < 0) @@ -1487,7 +1489,13 @@ static int www_body(char *hostname, int s, unsigned char *context) } if (S_ISDIR(st_buf.st_mode)) { +#if 0 /* must check buffer size */ strcat(p,"/index.html"); +#else + BIO_puts(io,text); + BIO_printf(io,"'%s' is a directory\r\n",p); + break; +#endif } if ((file=BIO_new_file(p,"r")) == NULL) |