diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2012-10-08 22:13:28 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2012-10-12 14:45:54 +0200 |
commit | de34a6489543e387bff8ef4fd615cbf069c57e93 (patch) | |
tree | 52725574572d4c274b21774d23dbbfad31a7100d /src/poll.c | |
parent | 46f22576b0f3e076ae20e6981c01bb1f0f4ae9c9 (diff) | |
download | libssh-de34a6489543e387bff8ef4fd615cbf069c57e93.tar.gz libssh-de34a6489543e387bff8ef4fd615cbf069c57e93.tar.xz libssh-de34a6489543e387bff8ef4fd615cbf069c57e93.zip |
poll: Fix sizeof in ssh_poll_ctx_resize().
sizeof(ssh_poll_handle *) is to be equal to sizeof(ssh_poll_handle), but
this is not a portable assumption.
Found by Coverity.
Diffstat (limited to 'src/poll.c')
-rw-r--r-- | src/poll.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -460,14 +460,14 @@ static int ssh_poll_ctx_resize(ssh_poll_ctx ctx, size_t new_size) { ssh_poll_handle *pollptrs; ssh_pollfd_t *pollfds; - pollptrs = realloc(ctx->pollptrs, sizeof(ssh_poll_handle *) * new_size); + pollptrs = realloc(ctx->pollptrs, sizeof(ssh_poll_handle) * new_size); if (pollptrs == NULL) { return -1; } pollfds = realloc(ctx->pollfds, sizeof(ssh_pollfd_t) * new_size); if (pollfds == NULL) { - ctx->pollptrs = realloc(pollptrs, sizeof(ssh_poll_handle *) * ctx->polls_allocated); + ctx->pollptrs = realloc(pollptrs, sizeof(ssh_poll_handle) * ctx->polls_allocated); return -1; } |