From c374807e9d73014ce57eacbbaa56e05460288368 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sat, 9 Feb 2019 00:19:58 +0100 Subject: Extend parsing to handle tree's of vcomponents. --- strbuf.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'strbuf.c') diff --git a/strbuf.c b/strbuf.c index 38aca4f4..8d1c7f15 100644 --- a/strbuf.c +++ b/strbuf.c @@ -82,6 +82,12 @@ int strbuf_copy(strbuf* dest, strbuf* src) { } int strbuf_cmp(strbuf* a, strbuf* b) { +#ifdef SAFE_STR + if (a->alloc == 0 || b->alloc == 0) { + ERR("a or b not alloced"); + return -1; + } +#endif return strcmp(a->mem, b->mem); } -- cgit v1.2.3