ircd_parser.y SID bug

Rachel Llorenna rachies at gmail.com
Sun Jan 2 00:20:01 EST 2005


According to ircd_parser.y, the parser generator does not have any
code to check the existence of a server id, despite the "this is
rehashable" comment...

serverinfo_sid: SID '=' QSTRING ';' 
{
  /* this isn't rehashable */
  if (ypass == 2)
  {
    MyFree(ServerInfo.sid);
    DupString(ServerInfo.sid, yylval.string);
  }
};

Looking at the NAME parameter,
serverinfo_name: NAME '=' QSTRING ';' 
{
  /* this isn't rehashable */
  if (ypass == 2)
  {
    if (ServerInfo.name == NULL)
    {
      /* the ircd will exit() in main() if we dont set one */
      if (strlen(yylval.string) <= HOSTLEN)
        DupString(ServerInfo.name, yylval.string);
    }
  }
};

Perhaps ServerInfo.sid needs a:
    if (ServerInfo.sid == NULL)
before freeing the memory field and setting it to a new value.
-- 
Regards,

Rachel Llorenna (frequency)



More information about the hybrid mailing list