Re:Don't run 'strings' on untrusted files
by ajuc on Sunday October 26, 2014 @06:22AM
(#8510716)
in one important practical aspect it isn't - strings are length+content in pascal, not null-delimited as in c. It's very important difference.
[ Parent
| on HN ]
You read into buffers, not strings. You can easily have buffers overflows. Pascal arrays are bounds checked, but not when it matters: http://wiki.lazarus.freepascal.org/Secure_programming#Buffer....
Re:Don't run 'strings' on untrusted files
by lazyjones on Sunday October 26, 2014 @07:44AM
(#8510828)
The problems mentioned there (assigning to array elements with out-of-bounds indices) can be avoided by using range checks (-CR option for fpc). It's strange (and silly) that this is apparently off by default for fpc, but it's not a language feature of Pascal.