Re: lftp-2.4.8 and current CVS off by one xmalloc bug

2002-01-03 Thread Alexander V. Lukyanov

On Thu, Jan 03, 2002 at 05:06:16PM +, jfaith wrote:
> Hi, just found a nasty little bug.
> 
> In the srv/resource.cc file.
> In the OrderValidate function, line 120 is currently:-
>char *fixed=(char*)xmalloc(strlen(s1));
> but this does not provide space for the null terminator it should be:-
>char *fixed=(char*)xmalloc(strlen(s1)+1);
> Without this on some systems(SCO OpenServer at least) lftp is unable to
> resolve host names.

Thanks, I have fixed it. I wonder why efence did not catch it.

> printf on OpenServer does not appear to handle %lld(i.e. long long)
> format specifiers properly either(next specifer gets last half of arg).
> Any ideas?

I have a test for broken printf/scanf in cvs version. I think it could be
used in stable branch too.

-- 
   Alexander.  | http://www.yars.free.net/~lav/  



lftp-2.4.8 and current CVS off by one xmalloc bug

2002-01-03 Thread jfaith

Hi, just found a nasty little bug.

In the srv/resource.cc file.
In the OrderValidate function, line 120 is currently:-
   char *fixed=(char*)xmalloc(strlen(s1));
but this does not provide space for the null terminator it should be:-
   char *fixed=(char*)xmalloc(strlen(s1)+1);
Without this on some systems(SCO OpenServer at least) lftp is unable to
resolve host names.

Also on OpenServer the 'mbsinit' function seems to be called 'sisinit'. 
Could a check for this could be added to configure?

printf on OpenServer does not appear to handle %lld(i.e. long long)
format specifiers properly either(next specifer gets last half of arg).
Any ideas?

Thanks 
Jeremy Faith



Re: moving to background when no current dir

2002-01-03 Thread Alexander V. Lukyanov

On Tue, Jan 01, 2002 at 08:08:21PM +0100, Piotr Krukowiecki wrote:
> Hi
> 
> lftp> jobs
> Warning: chdir(/home/piotr/fr) failed: No such file or directory
> No directory to execute commands in - terminating
> [19962] Moving to background to complete transfers...
> [piotr@pingu piotr]$
> 
> :(
> 
> Can't lftp just change dir to some existing dir?

I'll change it to fail all commands except lcd, maybe some others which
don't use local directory at all.

There is fchdir system call on some systems, it can help to return to
a removed directory. Maybe it is worth to be used.

-- 
   Alexander.