aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-03-02 18:54:26 -0800
committerGuy Harris <guy@alum.mit.edu>2017-03-03 02:54:57 +0000
commita9ec1e41b19abd9da62f15ffbd94db3dbc4a3d9f (patch)
tree607901d1e7d7df096d5ca8e04e4cc185f7ba71cd /wiretap
parent300f474737108e3cd9340d2d1eb1cdc7b9f21fa4 (diff)
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 <guy@alum.mit.edu>
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/file_wrappers.c4
1 files 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);