Describe the bug
Here,
missvalue gets FP value of default real kind.
missvalue has a constrain on type which can be only
integer(8) or
real(4). So, once one uses default real kind as
real(8), the data with wrong length (8 bytes) is copied into
missvalue which is 4 bytes long (once it is real), and, then, extra 4 bytes are written out of bounds.
Such errors can be easily detected with AddressSanitizer (ASan) and, actually, detected in this way.
To Reproduce
Enable ASan in CI.
Expected behavior
No ASan error
System Environment
CI of libFMS; FFLAGS="-fsanitize=address", LDFLAGS="-fsanitize=address"
Describe the bug
Here,
FMS/test_fms/diag_manager/test_diag_update_buffer.F90
Line 186 in f13435f
missvaluegets FP value of default real kind.missvaluehas a constrain on type which can be onlyinteger(8)orreal(4). So, once one uses default real kind asreal(8), the data with wrong length (8 bytes) is copied intomissvaluewhich is 4 bytes long (once it is real), and, then, extra 4 bytes are written out of bounds.Such errors can be easily detected with AddressSanitizer (ASan) and, actually, detected in this way.
To Reproduce
Enable ASan in CI.
Expected behavior
No ASan error
System Environment
CI of libFMS; FFLAGS="-fsanitize=address", LDFLAGS="-fsanitize=address"