← Back to team overview

maria-developers team mailing list archive

Re: Is it a bug?

 

Hi, Alexey!

On Jul 24, Alexey Botchkov wrote:
> Hi, SerG.
> 
> The code in sql/sql_plugin.cc function read_maria_plugin_info()
> 
>    sym= dlsym(plugin_dl->handle, maria_plugin_declarations_sym);
>    ...
>    if (plugin_dl->mariaversion != MARIA_PLUGIN_INTERFACE_VERSION)
>    {
>          ...
>          if ((sym= dlsym(plugin_dl->handle, maria_sizeof_st_plugin_sym)))
>             sizeof_st_plugin= *(int *)sym;
>          ...
>          if (sizeof_st_plugin != sizeof(st_mysql_plugin))
>          {
>              ...
>              sym= cur;
>          }
>     }
>     plugin_dl->plugins= (struct st_maria_plugin *)sym;
> 
> 
> So that when we enter the first 'if' but not the second 
> (sizeof_st_plugin == sizeof(st_mysql_plugin)
> the sym still points at the maria_sizeof_st_plugin_sym which makes a bad 
> st_maria_plugin pointer.
> 
> I think it's a bug, isn't it?

Agree, it's a bug.

Regards,
Sergei


References