commit 68d45b297520cb9596befa948b864b43e6542efd
parent e9942a13027771bde428c773cc713420fd3abbfa
Author: Claudio Alessi <smoppy@gmail.com>
Date: Tue, 17 Apr 2018 22:12:18 +0200
Fix a segfault when receiving malformed JOIN messages.
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/circo.c b/circo.c
@@ -818,8 +818,11 @@ recv_join(char *who, char *chan, char *txt) {
chan = txt;
if(!strcmp(who, nick))
b = sel = newbuf(chan);
- else
+ else {
b = getbuf(chan);
+ if(!b) /* malformed message */
+ return;
+ }
bprintf(b, "JOIN %s\n", who);
if(b == sel)
sel->need_redraw |= REDRAW_ALL;