Fix allocation of array for 4D arrays in IOASCII

Create issue
Issue #818 closed
Frank Löffler created an issue

(At least) one place in IOASCII assumes maxdim<=3 by only allocating 3 entries of an array but then writing maxdim entries. The thorn TestArrays tests 4D arrays in its testsuite and while this seems to work on 64bit machines, it gives a segfault on 32bit machines (plus valgrind complaining loudly). Allocating maxdim entries (like also done elsewhere in the file) solves this problem, as indicated in the attached patch.

Keyword:

Comments (4)

  1. Roland Haas
    • removed comment

    Patch looks fine (the whole line of it) :-). And the extra memory consumption of 8 (4) bytes is negligible.

    Please apply.

  2. Log in to comment