[polari/gnome-3-24] room: Fix infinite loop with unset nickname
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari/gnome-3-24] room: Fix infinite loop with unset nickname
- Date: Mon, 24 Apr 2017 23:52:06 +0000 (UTC)
commit 8b0acb04a72719530044f7786f4cfc5d84231e74
Author: Florian Müllner <fmuellner gnome org>
Date: Mon Apr 24 21:50:06 2017 +0200
room: Fix infinite loop with unset nickname
While an empty (self) nick is unexpected, it's apparently possible
under some circumstances. Handle that case explicitly to avoid
entering an infinite loop.
https://bugzilla.gnome.org/show_bug.cgi?id=781686
src/lib/polari-room.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/lib/polari-room.c b/src/lib/polari-room.c
index aded5a1..d741e83 100644
--- a/src/lib/polari-room.c
+++ b/src/lib/polari-room.c
@@ -142,8 +142,11 @@ match_self_nick (PolariRoom *room,
gboolean result = FALSE;
int len;
- folded_text = FOLDFUNC (text);
len = strlen (priv->self_nick);
+ if (len == 0)
+ return FALSE;
+
+ folded_text = FOLDFUNC (text);
match = MATCHFUNC (folded_text, priv->self_nick);
while (match != NULL)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]