Fix two Clang static analyzer issues
Overflowing memory allocations should crash or exit anyway.
This commit is contained in:
parent
027333e56a
commit
a87be6dfd2
@ -1072,6 +1072,8 @@ poller_ensure_space (struct poller *self)
|
||||
return;
|
||||
|
||||
self->alloc <<= 1;
|
||||
hard_assert (self->alloc != 0);
|
||||
|
||||
self->revents = xreallocarray
|
||||
(self->revents, sizeof *self->revents, self->alloc);
|
||||
self->info = xreallocarray
|
||||
|
@ -773,7 +773,7 @@ plugin_process_message (const struct irc_message *msg,
|
||||
return;
|
||||
|
||||
const char *command = msg->params.vector[0];
|
||||
if (!strcasecmp (command, "register"))
|
||||
if (!plugin->initialized && !strcasecmp (command, "register"))
|
||||
{
|
||||
// Register for relaying of IRC traffic
|
||||
plugin->initialized = true;
|
||||
|
Loading…
Reference in New Issue
Block a user