From de34a6489543e387bff8ef4fd615cbf069c57e93 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 8 Oct 2012 22:13:28 +0200 Subject: 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. --- src/poll.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/poll.c b/src/poll.c index 8dfeb14a..5a7d85d8 100644 --- a/src/poll.c +++ b/src/poll.c @@ -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; } -- cgit v1.2.3