Call for final changes for 2.2.3.

andreas moroder claudiamoroder at st-ulrich.suedtirol.net
Sat Jan 19 05:45:01 GMT 2002


Hello Jeremy,

I have no showstoppers, but a few little bugs that should be taken away 
before the new release.

As I posted a few days ago, in process.c in the function 

static void smb_dump(char *name, int type, char *data, ssize_t len

there is a write with no check. There sould be a check that prints out a 
debug line in case of failure.

there is also the asprintf question.  As I posted on Jan 14, there are many 
places where the return value of asprintf is not checked. 

client/client.c at lines 1309, 1317, 1331, 1337

libsmb/domain_client_validate.c at line  348 **

nsswitch/winbindd_cm.c at line 716

rpcclient/cmd_spoolss.c at lines 1232, 1235

In most cases if anything in asprintf fails( the malloc or others ), there 
will be a simple seg-fault. In libsmb/domain_client_validate.c the pointer 
passed to asprintf is not initialized to NULL. 

asprintf calls vasprintf 

 int vasprintf(char **ptr, const char *format, va_list ap)
{
        int ret;
 
        ret = vsnprintf(NULL, 0, format, ap);
        if (ret <= 0) return ret;   //### HERE IS THE PROBLEM
 
        (*ptr) = (char *)malloc(ret+1);
        if (!*ptr) return -1;
        ret = vsnprintf(*ptr, ret+1, format, ap);
 
        return ret;
}
#endif
 
 
If vsnprintf fails for any reason, the pointer **ptr is not set, so if the 
passed pointer was not initialized, after asprintf it will continue to point 
around in memory. 

There is also the "FreeBSD + samba 2.2.2 problems; semi-solution" problem
We have a CVS version of samba 2.2.3 running on suse linux 7.2 that gives us 
also oplock problems with a older clipper/dos application. The clients are 
all win98 and 98se

Bye

Andreas




More information about the samba-technical mailing list