https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89696

--- Comment #9 from Khang H. Nguyen <kevin at fai dot host> ---
No, no, you got me wrong, it is not a tutorial. You got it wrong. I just see so
much insecure with the statement read, of which I think it more like a
procedure. That is why I am trying to report the bug.

For the example below. You telling the compiler that within this 100 character,
there is a set of number. Fair enough, but this string below is not a valid
integer and yet it still parses it because it disregarded any spaces, doesn't
matter where in the string.

I am not being disrespectful or want to advertise my product. I just intended
to report a bug. Nonetheless, I wrote this.
https://github.com/kevinhng86/faiNumber-Fortran. Now if you compare that to
read() and tell me if read() was badly designed or not.

Sorry if I offended you, I just want the code to be more secure. Fortran is a
good language because it has bit extraction by position. That is a great
feature. Nonetheless, built-in procedures and built-in methods should be
secure. Because after all, those are depended on by everyone.

program test1
    implicit none
    character(len=100)  ::  str
    integer             ::  b
    str = "       1234                    1234     1"

    read(str, '(I100)') b

    print *, b

end program test1

Reply via email to