[epiphany/mcatanzaro/hostname-to-tld: 2/2] web-view: add protective assert
- From: Jan-Michael Brummer <jbrummer src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/mcatanzaro/hostname-to-tld: 2/2] web-view: add protective assert
- Date: Wed, 13 Nov 2019 09:34:00 +0000 (UTC)
commit a142c4079f8d37acefb2e90c0be89b144864d189
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Tue Nov 12 15:35:15 2019 -0600
web-view: add protective assert
This should never happen, but it's not a bad idea to be paranoid and
make sure of that. We would have a buffer overflow if length is ever 0
here (which should not be possible).
embed/ephy-web-view.c | 1 +
1 file changed, 1 insertion(+)
---
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index de394f104..86434df31 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -1879,6 +1879,7 @@ hostname_to_tld (const char *hostname)
parts = g_strsplit (hostname, ".", 0);
length = g_strv_length (parts);
+ g_assert (length >= 1);
return g_strdup (parts[length - 1]);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]