Handle tags without values
Otherwise a tag with no value would cause a segfault trying to unescape the NULL tag pointer. This shouldn't happen for the server tags we parse, but clients could send @+draft/reply with no value.weechat-hashes
parent
3f3585d0f3
commit
df1e561378
8
irc.c
8
irc.c
|
@ -250,8 +250,12 @@ static struct Message parse(char *line) {
|
|||
char *key = strsep(&tag, "=");
|
||||
for (uint i = 0; i < TagCap; ++i) {
|
||||
if (strcmp(key, TagNames[i])) continue;
|
||||
unescape(tag);
|
||||
msg.tags[i] = tag;
|
||||
if (tag) {
|
||||
unescape(tag);
|
||||
msg.tags[i] = tag;
|
||||
} else {
|
||||
msg.tags[i] = "";
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue