diff --git a/modules/m_presence.c b/modules/m_presence.c index 70eca96..a9a16b1 100644 --- a/modules/m_presence.c +++ b/modules/m_presence.c @@ -79,6 +79,12 @@ m_presence(struct Client *client_p, struct Client *source_p, int parc, const cha return 0; } + if (strlen(parv[1]) >= METADATAKEYLEN) + { + sendto_one_notice(source_p, ":Metadata key too long"); + return 0; + } + if ((val = get_metadata(source_p, parv[1])) != NULL) { if (!strcmp(parv[2], val)) @@ -114,6 +120,9 @@ me_presence(struct Client *client_p, struct Client *source_p, int parc, const ch return 0; } + if (strlen(parv[1]) >= METADATAKEYLEN) + return 0; + if ((val = get_metadata(source_p, parv[1])) != NULL) { if (!strcmp(parv[2], val))