From fb108816368cf3f4c625ca1777eb90eac7e303f6 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 18 Mar 2024 10:27:38 -0400 Subject: [PATCH] fix bug in f2c string conversion detected by bound checking --- fortran/lammps.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fortran/lammps.f90 b/fortran/lammps.f90 index 28e40bca44..5883134982 100644 --- a/fortran/lammps.f90 +++ b/fortran/lammps.f90 @@ -3633,7 +3633,7 @@ CONTAINS n = LEN_TRIM(f_string) ptr = lammps_malloc(n+1) - CALL C_F_POINTER(ptr, c_string, [1]) + CALL C_F_POINTER(ptr, c_string, [n+1]) DO i=1, n c_string(i) = f_string(i:i) END DO