Safer Alternatives to the C Standard Library

后端 未结 6 1498
广开言路
广开言路 2021-02-07 10:29

The C standard library is notoriously poor when it comes to I/O safety. Many functions have buffer overflows (gets, scanf), or can clobber memory if n

6条回答
  •  囚心锁ツ
    2021-02-07 11:02

    This isn't really answering your question about the safest libraries to use, but most functions that are vulnerable to buffer overflows that you mentioned have safer versions which take the buffer length as an argument to prevent the security holes that are opened up when the standard methods are used.

    Unless you have relaxed the level of warnings, you will usually get compiler warnings when you use the deprecated methods, suggesting you use the safer methods instead.

提交回复
热议问题