Files
Liu ec5cd503fa fix(css): oversized selectors should not overflow parser buffers
- Cap the token buffer position across chunked input so a selector
  spanning 511-byte reads cannot write past css_parser_t::buffer.
- Reject selector names longer than MAX_NAME_LEN in
  css_selector_create() instead of writing past name[].
- Bound selector name composition in css_selector_collect_name()
  with explicit length checks.
- Fix trim-left in css_parser_commit() reading buffer[pos] instead
  of buffer[i] and moving the wrong number of bytes.

Fixes GHSA-v42w-m2h7-fm23.
2026-11-24 21:24:49 +08:00

28 lines
875 B
C

/*
* lib/css/tests/test.c
*
* Copyright (c) 2023-2026, Liu Chao <hello@lcui.dev> All rights reserved.
*
* SPDX-License-Identifier: MIT
*
* This file is part of LCUI, distributed under the MIT License found
* in the LICENSE.TXT file in the root directory of this source tree.
*/
#include <ctest.h>
#include <yutil.h>
#include "test.h"
int main()
{
logger_set_level(LOGGER_LEVEL_ALL);
ctest_describe("css keywords", test_css_keywords);
ctest_describe("css value", test_css_value);
ctest_describe("css computed", test_css_computed);
ctest_describe("css text decoration", test_css_text_decoration);
ctest_describe("css inheritance", test_css_inheritance);
ctest_describe("css cursor", test_css_cursor);
ctest_describe("css parser security", test_css_parser_security);
return ctest_finish();
}