hackers-painters / katana-parser

A CSS parsing library in pure C99
http://hackers-painters.github.io/katana-parser
MIT License
180 stars 40 forks source link

Crash in 'katana_stringify_value_list'. #22

Open vs-savchenko opened 5 years ago

vs-savchenko commented 5 years ago

Here (parser.c:1635):

        const char* value_str = katana_stringify_value(parser, value);
        katana_string_append_characters(parser, value_str, buffer);
        katana_parser_deallocate(parser, (void*) value_str);
        value_str = NULL;

'katana_stringify_value' can actually return NULL, if value is empty KATANA_VALUE_PARSER_LIST. After that katana_string_append_characters will call strlen(NULL).