NULL resistance: make more public functions survive NULL pointer input

Sending in NULL as the primary pointer is now dealt with by more
public functions. I also narrowed the userauth.c code somewhat to
stay within 80 columns better.
This commit is contained in:
Daniel Stenberg
2010-06-18 20:25:03 +02:00
parent 32bd0df992
commit 35cf08e130
4 changed files with 80 additions and 28 deletions

View File

@@ -1252,10 +1252,16 @@ libssh2_session_get_blocking(LIBSSH2_SESSION * session)
* non-0 if data is available
*/
LIBSSH2_API int
libssh2_poll_channel_read(LIBSSH2_CHANNEL * channel, int extended)
libssh2_poll_channel_read(LIBSSH2_CHANNEL *channel, int extended)
{
LIBSSH2_SESSION *session = channel->session;
LIBSSH2_PACKET *packet = _libssh2_list_first(&session->packets);
LIBSSH2_SESSION *session;
LIBSSH2_PACKET *packet;
if(!channel)
return LIBSSH2_ERROR_BAD_USE;
session = channel->session;
packet = _libssh2_list_first(&session->packets);
while (packet) {
if ( channel->local.id == _libssh2_ntohu32(packet->data + 1)) {