Closed edwardhartnett closed 1 year ago
Well, as noted in the discussion of #393, one could make a similar argument here that a user has no business calling copysb() without ever having previously opened a file to copy to or from, but I see your point and this would be a similarly innocuous failsafe check, so I'll go ahead and work on that.
The subroutine copysb() calls status() like this:
status.f then uses this like this: DO I=1,NFILES IF(ABS(IOLUN(I)).EQ.LUNIT) LUN = I ENDDO
This then segfaults because IOLUN is not yet allocated.
So this can be easily obtained by the user calling copysb() without opening a file first.
We should always error, never segfault.