Added safeguard to avoid copying too much data to filename

This commit is contained in:
Niclas Finne 2011-09-06 00:19:31 +02:00
parent 9ac676c7c8
commit c1b88afe48

View file

@ -130,7 +130,7 @@ PT_THREAD(handle_output(struct httpd_state *s))
s->script = NULL;
s->script = httpd_simple_get_script(&s->filename[1]);
if(s->script == NULL) {
strcpy(s->filename, "/notfound.html");
strncpy(s->filename, "/notfound.html", sizeof(s->filename));
PT_WAIT_THREAD(&s->outputpt,
send_headers(s, http_header_404));
PT_WAIT_THREAD(&s->outputpt,