[Samba] Segmentation fault in smbclient v2.2.9.

Igor Yu. Zhbanov bsg at uniyar.ac.ru
Tue Jun 22 21:24:07 GMT 2004


Hello!
I have found a bug in smbclient v2.2.9.

----- source/client/client.c -----
static void readline_callback(void)
{
        fd_set fds;
        struct timeval timeout;
        static time_t last_t;
        time_t t;

        t = time(NULL);

        if (t - last_t < 5) return;

        last_t = t;

 again:
        FD_ZERO(&fds);
        FD_SET(cli->fd,&fds);
               ^^^^^^^
Segmentation fault was here since cli->fs == -1              
This was happen when smbd crashes (bug in my VFS module) and return READ_EOF.
And cli->fd became -1.

So, the probable solution is:
        if (t - last_t < 5 || cli->fd == -1) return;

Thanks.



More information about the samba mailing list