[prev in list] [next in list] [prev in thread] [next in thread] 

List:       samba-technical
Subject:    More problems with clitar.c
From:       Richard Sharpe <sharpe () ns ! aus ! com>
Date:       1998-05-20 9:09:04
[Download RAW message or body]

Hi,

I have just noticed the following egregious code :-(

>  name = (char *)malloc(strlen(fname) + 1 + 1);
>  if (name == NULL) {
>
>     DEBUG(0, ("Failed to allocate space while setting time on file: %s", 
>fname));
>     return False;
>
>  }

This bit I introduced to allow for strings longer than pstring

>  pstrcpy(name, fname);
>  pstrcpy(fname, "\\");
>  pstrcat(fname, name);

This was in the original. It overwrites the passed in string. Shudder! 

I have also just realized that there are a bunch of places where pstrings
are used which should be dynamically allocated.

Oh well. Next week I am in Sydney and in my copious free time, I will be
fixing these problems :-(



Regards
-------
Richard Sharpe, sharpe@ns.aus.com, NIC-Handle:RJS96
NS Computer Software and Services P/L, 
Ph: +61-8-8281-0063, FAX: +61-8-8250-2080, 
Samba, Linux, Apache, Digital UNIX, AIX, Netscape, Stronghold, C, ...

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic