ircd_parser.y SID bug

Michael Wobst michael at elite-web.de
Sun Jan 2 00:40:54 EST 2005


That's currently not a problem, because ServerInfo.sid is used only in 
s_user.c:init_uid (where we copy its value to me.id), so ServerInfo.sid 
can be changed without any side effects.

-Michael



Rachel Llorenna wrote:
> 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.



More information about the hybrid mailing list