|
From: tom f. <tf...@al...> - 2009-02-13 16:54:26
|
Micah N Gorrell <val...@mi...> writes:
> On Thu, 12 Feb 2009, val...@li... wrote:
>
> > On Thu, 12 Feb 2009, val...@li... wrote:
> >
> > > > So, if SocketReceive returned an uninitialised value then
> > > > it can cause this? So that tells me that I should review
> > > > SockReceive in more detail to try and determine how that could
> > > > happen.
> > >
> > > Do you have the source code of SockReceive and the functions it
> > > calls? Can you show it?
> > >
> > In the case that is reporting the error it is just a wrapper around
> > SSL_Read(). I am going to try a few things first. If I don't
> > figure anything out soon I'll send more info.
>
> It is now warning me about SocketSSLReceive() which was called
> SocketReceive() from the previous warning.
>
> int bytes = SSL_read( socket->ssl.conn, (void *)buffer, length);
> if ( bytes > 0 ) {
> ...
>
> It warns about the if line above.
Doesn't `definedness' propagate in valgrind? Further, as I remember
you would only see an issue when the uninitialized value directed a
computation, or was output.
For example:
1 int m(int x) {
2 return x + 42;
3 }
4 int main() {
5 int y;
6 int z = 19;
7 z = m(y);
8 if(z > 50) {
9 puts("big z!");
10 }
11 return 0;
12 }
As I remember, valgrind would complain about line 8 here, *not* line 7.
(Please somebody correct me if I'm wrong! :)
That said, is it possible that one of your arguments to SSL_read is
uninitialized? If you throw a printf on those args on the line before
the call, does valgrind complain at the printf?
-tom
|