[Samba] cli_pipe: return critical error. Error was Call returnedzerobyte(EOF), hilfe!

Dragan Krnic dkrnic at lycos.com
Fri May 16 11:55:24 GMT 2003


Hi Jerry,

|     I've discovered another little glitch in the 
|     function strlen_w of lib/util_unistr.c when it 
|     tries to count characters in an empty string. 

A correction: by empty string I really meant NULL
pointer. Sorry for the confusion.

|     That causes the rpcclient's "enumdrivers 3" 
|     command to segment. A simple correction of the 
|     loop line 644:
|
|        for(len = 0; *(src++); len++)
|
|     so that it should read like this:
|
|        for(len = 0; src && *(src++); len++)
|
|     removes that problem too. You can read a little 
|     more on this in 
|
|        https://bugzilla.samba.org/show_bug.cgi?id=82
|
|  This actually isn't the correct fix. strlen_w 
|  *should* core dump given a null pointer. Can yu
|  let me know the calling function and I'll fix that 
|  instead ?

Leaving code that dumps core as diagnostic could 
perhaps be substituted by a DEBUG macro like this:

   if ( src == NULL)
   DEBUG(0,("strlen_w almost dumped core, \
   'cause it got a null pointer.\n"));

and then the usual:

   for(len = 0; src && *(src++); len++);

A way to list the backtrace at this point without
the hassle of a real core dump might be helpful.
People are reverting back to 2.2.7a because the 
thought of a core-dump is simply too frightening.

My fix is ad-hoc. I'm glad that you'll fix the root
cause of it instead of just the symptom. You'll find
a backtrace of the fault at

   https://bugzilla.samba.org/show_bug.cgi?id=82

Cheers
Dragan


____________________________________________________________
Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail!
http://login.mail.lycos.com/r/referral?aid=27005



More information about the samba mailing list