In examples/x11.c, Make sure sizeof passed to read operation is correct
sizeof(buf) expands to 8 or 4 (since its a pointer). This variable may have been static in the past, leading to this error. Signed-off-by: Steven Dake <sdake@redhat.com>
This commit is contained in:
parent
626f91da07
commit
a46ef85a56
@ -217,7 +217,7 @@ static int x11_send_receive(LIBSSH2_CHANNEL *channel, int sock)
|
||||
memset((void *)buf,0,bufsize);
|
||||
|
||||
/* Data in sock*/
|
||||
rc = read(sock, buf,sizeof(buf));
|
||||
rc = read(sock, buf, bufsize);
|
||||
if (rc > 0)
|
||||
rc = libssh2_channel_write(channel,buf, rc);
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user