Subject: [libssh2] [ libssh2-Bugs-1826815 ] Uninitialized variables in transport.c

[libssh2] [ libssh2-Bugs-1826815 ] Uninitialized variables in transport.c

From: <>
Date: Mon, 03 Dec 2007 03:07:26 -0800

Bugs item #1826815, was opened at 2007-11-06 13:50
Message generated for change (Settings changed) made by bagder
You can respond by visiting:

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
>Status: Pending
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Daniel Stenberg (bagder)
Summary: Uninitialized variables in transport.c

Initial Comment:
I have a question about libssh2, especifically about transport.c code.

I'm running valgrind within my program and sometimes it warns me about using uninitialized variables in transport.c. I checked it and I think it really is doing that, but I wanted to confirm that with you.

At line 304 of transport.c, there's: "remainbuf = p->writeidx - p->readidx;". But 'p->readidx' and 'p->writeidx' are not initialized. They are initialized after this line.

Can you confirm this? Is there a reason for this? If there is, could you explain it to me, please?

Thank you for your support and attention.

Best regards,

royzrj at gmail dot com


Comment By: Daniel Stenberg (bagder)
Date: 2007-11-07 16:55

Logged In: YES
Originator: NO

When are they not initialized? The LIBSSH2_SESSION struct is memset to
zero in libssh2_session_init_ex()
(and no, they aren't "initialized after this line", they're just read
there not assigned)


You can respond by visiting:

SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
libssh2-devel mailing list
Received on 2007-12-03