From c24fca61f37aa7abfa1c907fd51a1da7478a18a3 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer <akohlmey@gmail.com> Date: Wed, 12 Jul 2017 18:14:11 -0400 Subject: [PATCH] fix possible uninitialized data access with pppm and pppm/disp --- src/KSPACE/pppm.cpp | 5 +++++ src/KSPACE/pppm_disp.cpp | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/src/KSPACE/pppm.cpp b/src/KSPACE/pppm.cpp index 05169fca1c..6add8b58b7 100644 --- a/src/KSPACE/pppm.cpp +++ b/src/KSPACE/pppm.cpp @@ -95,6 +95,11 @@ PPPM::PPPM(LAMMPS *lmp, int narg, char **arg) : KSpace(lmp, narg, arg), MPI_Comm_rank(world,&me); MPI_Comm_size(world,&nprocs); + nfft_both = 0; + nxhi_in = nxlo_in = nxhi_out = nxlo_out = 0; + nyhi_in = nylo_in = nyhi_out = nylo_out = 0; + nzhi_in = nzlo_in = nzhi_out = nzlo_out = 0; + density_brick = vdx_brick = vdy_brick = vdz_brick = NULL; density_fft = NULL; u_brick = NULL; diff --git a/src/KSPACE/pppm_disp.cpp b/src/KSPACE/pppm_disp.cpp index b31d42a815..43b2c8236a 100644 --- a/src/KSPACE/pppm_disp.cpp +++ b/src/KSPACE/pppm_disp.cpp @@ -121,6 +121,13 @@ PPPMDisp::PPPMDisp(LAMMPS *lmp, int narg, char **arg) : KSpace(lmp, narg, arg), MPI_Comm_rank(world,&me); MPI_Comm_size(world,&nprocs); + nfft_both = nfft_both_6 = 0; + nxhi_in = nxlo_in = nxhi_out = nxlo_out = 0; + nyhi_in = nylo_in = nyhi_out = nylo_out = 0; + nzhi_in = nzlo_in = nzhi_out = nzlo_out = 0; + nxhi_in_6 = nxlo_in_6 = nxhi_out_6 = nxlo_out_6 = 0; + nyhi_in_6 = nylo_in_6 = nyhi_out_6 = nylo_out_6 = 0; + nzhi_in_6 = nzlo_in_6 = nzhi_out_6 = nzlo_out_6 = 0; csumflag = 0; B = NULL; -- GitLab