From 0caa00b34986ae44a083cc71df9612f0cd2156ac Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Tue, 18 Aug 2020 09:33:42 +0100 Subject: [PATCH] guri: Add an assertion to help static analysis MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This might eliminate some false positives being thrown by Coverity to do with the return value of `uri_decoder()` and whether it’s allocated anything. Signed-off-by: Philip Withnall --- glib/guri.c | 1 + 1 file changed, 1 insertion(+) diff --git a/glib/guri.c b/glib/guri.c index bead318e5..5fe29f29d 100644 --- a/glib/guri.c +++ b/glib/guri.c @@ -350,6 +350,7 @@ uri_decoder (gchar **out, *d = '\0'; len = d - decoded; + g_assert (len >= 0); if (!(flags & G_URI_FLAGS_ENCODED) && !g_utf8_validate (decoded, len, &invalid))