From 2fe27584ff869142bb1e69000a7190fc62c5530b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Tue, 10 Mar 2020 19:15:59 +0100 Subject: [PATCH] irc: return 0 in function irc_protocol_is_numeric_command if the command is NULL or empty --- src/plugins/irc/irc-protocol.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 9238e8802..2c2cd6b66 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -69,12 +69,16 @@ int irc_protocol_is_numeric_command (const char *str) { + if (!str || !str[0]) + return 0; + while (str && str[0]) { if (!isdigit ((unsigned char)str[0])) return 0; str++; } + return 1; }