diff options
author | Bodo Möller <bodo@openssl.org> | 2001-03-31 07:47:32 +0000 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 2001-03-31 07:47:32 +0000 |
commit | e32578847c9ff357b186172f698e45ac8e6f38b8 (patch) | |
tree | ba8e42ae6b0b4aa4f6b930558aa86340ca5de035 | |
parent | 323fd27435e692da97d67fe6f1984f383cc1c6bd (diff) |
avoid buffer overflow
-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 97e477bde2..624dfb5e41 100644 --- a/apps/s_server.c +++ b/apps/s_server.c @@ -1398,9 +1398,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) @@ -1412,7 +1414,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) |