Fix crash bug in libqhtml

* fix crash on "https://support.apple.com/kb/HT208050"
* add missing initializer (stupid oversight)
* fix bogus overflow test (another nasty bug waiting to bite)
We desperately need warnings or idioms against such stupid errors.
Using constructors for all locally defined structures seems advidsable,
This commit is contained in:
Charlie Gordon 2025-02-09 11:49:09 +01:00
commit 6f8eb7577b
6 changed files with 28 additions and 27 deletions

View file

@ -2,6 +2,7 @@
* CSS2 parser for qemacs.
*
* Copyright (c) 2000-2002 Fabrice Bellard.
* Copyright (c) 2007-2025 Charlie Gordon.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@ -875,7 +876,8 @@ static void beat(CSSParseState *b, int *ch_ptr, const char *str)
*ch_ptr = ch;
}
static void parse_simple_selector(CSSSimpleSelector *ss, CSSParseState *b,
static void parse_simple_selector(CSSSimpleSelector *ss, // output only
CSSParseState *b,
int *ch_ptr)
{
char value[1024];