From a9ec1e41b19abd9da62f15ffbd94db3dbc4a3d9f Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Thu, 2 Mar 2017 18:54:26 -0800 Subject: [PATCH] Squelch a warning from VS Code Analysis. It warns that a 32-bit value is being shifted left and then converted to a 64-bit type; presumably it means "this might overflow and not give you the result you expect". That's unlikely to be the case here, as few UN*X file systems have a recommended I/O block size > 2^30, but we might as well throw in a cast so the convert-to-a-64-bit-type is done first. Change-Id: Id6ab11d750d5cf4cc03d060d63edc01b66cd179d Reviewed-on: https://code.wireshark.org/review/20352 Reviewed-by: Guy Harris --- wiretap/file_wrappers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wiretap/file_wrappers.c b/wiretap/file_wrappers.c index 85d619ac8e..3b1a6c7391 100644 --- a/wiretap/file_wrappers.c +++ b/wiretap/file_wrappers.c @@ -813,8 +813,8 @@ file_fdopen(int fd) #endif /* allocate buffers */ - state->in = (unsigned char *)g_try_malloc(want); - state->out = (unsigned char *)g_try_malloc(want << 1); + state->in = (unsigned char *)g_try_malloc((gsize)want); + state->out = (unsigned char *)g_try_malloc(((gsize)want) << 1); state->size = want; if (state->in == NULL || state->out == NULL) { g_free(state->out);