check range before dereferencing pointer - webdump - HTML to plain-text converter for webpages
HTML git clone git://git.codemadness.org/webdump
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit 7b9965a4903fd5857f38d78ad99f1b2ca02c9a5d
DIR parent e3a9fb8fda6062125133e47297de377d7bae7d79
HTML Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Wed, 9 Sep 2026 22:58:07 +0200
check range before dereferencing pointer
Diffstat:
M webdump.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
DIR diff --git a/webdump.c b/webdump.c
@@ -493,7 +493,7 @@ getnext_literal(void)
*(pushend++) = *p;
pushtagend = pushend; /* offset where the tag ended */
} else { /* partial match */
- for (p = endtagmatch; *p && p < ignorestate; p++) {
+ for (p = endtagmatch; p < ignorestate && *p; p++) {
if (*p == '<') {
memcpy(pushend, "<", 4);
pushend += 4;