From b1b51307c053723f9b8258d085fbb877a01e3f6a Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 21 Jan 2025 22:41:41 -0500 Subject: [PATCH] silence CodeQL warnings about potential overflows --- src/MISC/fix_imd.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/MISC/fix_imd.cpp b/src/MISC/fix_imd.cpp index 04adcabd34..cca2025a61 100644 --- a/src/MISC/fix_imd.cpp +++ b/src/MISC/fix_imd.cpp @@ -1654,7 +1654,7 @@ void FixIMD::handle_output_v3() { if (imdsinfo->coords) { commdata *recvcoord = nullptr; memory->destroy(coord_data); - coord_data = memory->smalloc(nme*size_one, "imd:coord_data"); + coord_data = memory->smalloc((bigint)nme * size_one, "imd:coord_data"); buf = static_cast(coord_data); int idx = 0; if (imdsinfo->unwrap) { @@ -1720,7 +1720,7 @@ void FixIMD::handle_output_v3() { if (imdsinfo->velocities) { commdata *recvvel = nullptr; memory->destroy(vel_data); - vel_data = memory->smalloc(nme*size_one, "imd:vel_data"); + vel_data = memory->smalloc((bigint)nme * size_one, "imd:vel_data"); buf = static_cast(vel_data); int idx = 0; for (int i = 0; i < nlocal; ++i) { @@ -1755,7 +1755,7 @@ void FixIMD::handle_output_v3() { if (imdsinfo->forces) { commdata *recvforce = nullptr; memory->destroy(force_data); - force_data = memory->smalloc(nme*size_one, "imd:force_data"); + force_data = memory->smalloc((bigint)nme * size_one, "imd:force_data"); buf = static_cast(force_data); int idx = 0; for (int i = 0; i < nlocal; ++i) {