Ticket #49 (closed defect)
Opened 5 years ago
Last modified 4 years ago
Uninitialized variables in transport.c
| Reported by: | anonymous | Owned by: | bagder |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Version: | ||
| Keywords: | Cc: | bagder | |
| Blocked By: | Blocks: |
Description
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,
Rodrigo
royzrj at gmail dot com
Change History
comment:1 Changed 5 years ago by bagder
comment:2 Changed 4 years ago by sf-robot
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).

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)