## Bug #16

### Issue an error if pme_order < fourier_nx/y/z

**Description**

I found by a random test that if pme_order is less than the number of cells in a

dimension of the Fourier grid Gromacs crashes. This is probably an invalid

configuration (I know almost nothing about PME), but it is much better to issue

an error in grompp than crashing.

Here is the code

in pme.c function make_bspline_moduli

650 for(i=0;i<nmax;i++)

651 bsp_data[i]=0;

652 for(i=1;i<=order;i++)

653 bsp_data[i]=data[i-1];

when order < nmax, the loop below access the array bsp_data beyond its bounds.

### History

#### #1 Updated by Erik Lindahl about 15 years ago

pme_order is always much smaller nx/ny/nz. Loop 1 zeros bsp_data[], and loop 2 copies the first order

elements from data[].