Fix missing end-of-string
authorColin Leroy <colin@colino.net>
Thu, 22 May 2014 09:55:38 +0000 (11:55 +0200)
committerColin Leroy <colin@colino.net>
Thu, 22 May 2014 09:55:38 +0000 (11:55 +0200)
src/html.c

index db0126246a73529fbf841c51d2864457c014c09b..f7b0ac42f1293781cc407f9204dac8454f2070ca 100644 (file)
@@ -449,7 +449,8 @@ static SC_HTMLState sc_html_read_line(SC_HTMLParser *parser)
        if (n == 0) {
                parser->state = SC_HTML_EOF;
                return SC_HTML_EOF;
-       }
+       } else
+               buf[n] = '\0';
 
        if (conv_convert(parser->conv, buf2, sizeof(buf2), buf) < 0) {
                index = parser->bufp - parser->buf->str;