Message-Id: <3.0.5.32.19980520183626.0085e480@mail.adelaide.on.net> Date: Wed, 20 May 1998 18:36:26 +0900 To: samba-technical@samba.anu.edu.au From: Richard Sharpe <sharpe@ns.aus.com> Subject: More problems with clitar.c
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, ...