Subject: Re: [libssh2] All Your Mem Belongs to Us

Re: [libssh2] All Your Mem Belongs to Us

From: Satish Mittal <>
Date: Fri, 10 Nov 2006 18:48:14 +0530

On 11/10/06, Daniel Stenberg <> wrote:
> On Fri, 10 Nov 2006, Satish Mittal wrote:
> > I think for sanity, apart from your fix we also need to initialize the
> > buf[24] array created on stack to all fields zero (in line 874).
> > In my case, the problem was because libssh2_blocking_read was failing
> and
> > returning -1, which was assigned to an unsigned long. James seems to fix
> > that, but to me it looks to be more of an implementation problem at SSH
> > transport layer protocol itself!
> I think first we should make sure we check all calls to
> libssh2_blocking_read() for a -1 returned and then bail out if so. The way
> the
> 0.14 code just adds the return code to the current number is outright...
> weird.
> With that fixed, I don't see why we would need to zero the array?

Ya, once we catch all the blocking_read failure status, then hopefully we
shouldn't need to care about zeroing the array.

"The happiest of people donĀ“t necessarily have the best of everything, they
just make the most of everything that comes along their way."
Received on 2006-11-10